feat(lints): okf-check validates OKF directory completeness

- feat(lints): error on an OKF/ directory holding .md files with no
  index.md (open ferry topic dirs may carry MAP.md instead)
- feat(lints): error on an index.md not directly linking every .md file
  beside it
- docs(okf): add blueprints/index.md and ferries/index.md, delegating
  from OKF/index.md the way decisions/ and learnings/ already do

implements blueprint 029
This commit is contained in:
Łukasz Boryń 2026-09-23 13:00:12 +02:00
parent 011e766915
commit 5535d89963
4 changed files with 94 additions and 35 deletions

38
OKF/blueprints/index.md Normal file
View File

@ -0,0 +1,38 @@
---
type: Index
---
# octobot — blueprints
One file per unit of work: `status: draft | locked | implemented |
superseded-by-NNN`. Numbers are permanent — supersede, never renumber.
- [001](001-add-write-readme-r.md) — add write-readme-r skill — dropped
- [002](002-extract-why-register.md) — extract the why-register from ROADMAP — implemented
- [003](003-graduate-and-collapse-ferries.md) — graduate ferry decisions and collapse the moored ferry — implemented
- [004](004-give-cites-teeth-and-fence-derived-zone.md) — give cites teeth and fence the derived zone — implemented
- [005](005-propose-the-page-plan-from-a-repo-scan.md) — propose the page plan from a repo scan — implemented
- [006](006-rescan-the-page-plan-on-refresh.md) — rescan the page plan on refresh — implemented
- [007](007-add-sound.md) — add sound, the recon that precedes a lock — implemented
- [008](008-make-nostos-primary-and-files-the-fallback.md) — make nostos primary and file reads the fallback — implemented
- [009](009-give-every-page-a-growth-path.md) — give every page a growth path so the line cap can be enforced — implemented
- [010](010-add-muster-the-human-review-gate.md) — add muster, the opt-in human review gate on the loop's close — superseded-by-011
- [011](011-add-blueprint-level-muster.md) — add blueprint-level muster, the opt-in human review gate in weave — implemented
- [012](012-add-ferry-level-muster.md) — add ferry-level muster, the human review gate at moor — implemented
- [013](013-split-moor-into-skill-and-reference.md) — split moor into SKILL.md + REFERENCE.md to hold the line cap — implemented
- [014](014-unify-skill-sibling-file-naming.md) — unify skill sibling-file naming on lowercase-kebab topic names — implemented
- [015](015-record-session-check-discharges-on-the-blueprint.md) — record session-check discharges on the blueprint — implemented
- [016](016-pull-two-skills-under-cap-and-level-commit-twins.md) — pull two skills under the line cap and level the commit twins — implemented
- [017](017-add-a-line-cap-lint-over-skills.md) — add a line-cap lint over skills/ — implemented
- [018](018-own-the-loop-shape-in-flow-1.md) — own the loop's shape in ARCHITECTURE flow 1 — implemented
- [019](019-add-a-render-lint-over-the-loop-shape.md) — add a render lint over the loop's shape — superseded-by-026
- [020](020-enforce-the-prune-and-validate-every-cite.md) — enforce the roadmap prune and validate every page's cites — superseded-by-022
- [021](021-align-validator-and-doctrine.md) — align the validator and the doctrine on splits, prefixes and cites — implemented
- [022](022-validate-every-cite-at-every-status.md) — enforce the roadmap prune and validate every cite at every status — implemented
- [023](023-add-a-link-lint-over-relative-md-links.md) — add a link lint over relative markdown links — superseded-by-026
- [024](024-rename-the-spine-and-give-chart-its-ferry-edge.md) — rename the spine to chart and rig, and give chart its ferry edge — implemented
- [025](025-rule-muster-on-every-blueprint.md) — rule muster on every blueprint — implemented
- [026](026-walk-only-what-git-does-not-ignore.md) — walk only what git does not ignore — implemented
- [027](027-error-on-implemented-with-matches-no.md) — error when a mustered blueprint reaches implemented on matches: no — implemented
- [028](028-convert-cross-skill-links-to-skill-names.md) — convert cross-skill links to unchecked skill names — implemented
- [029](029-prefix-register-filenames-and-validate-okf-structure.md) — validate OKF directory completeness and normalize blueprints/ferries indexing — locked

10
OKF/ferries/index.md Normal file
View File

@ -0,0 +1,10 @@
---
type: Index
---
# octobot — ferries
Open ferries link their `MAP.md`; moored ones link the collapsed page
that replaced it — `<topic> — moored <date> → <topic>.md`.
- [python-siblings](python-siblings/MAP.md) — Python siblings for bdd/diagnose — 0/3 resolved

View File

@ -23,39 +23,10 @@ your task needs. Humans welcome too.
## Blueprints ## Blueprints
- [001](blueprints/001-add-write-readme-r.md) — add write-readme-r skill — dropped - [blueprints/index.md](blueprints/index.md) — one file per unit of work,
- [002](blueprints/002-extract-why-register.md) — extract the why-register from ROADMAP — implemented status-tracked. 29 filed.
- [003](blueprints/003-graduate-and-collapse-ferries.md) — graduate ferry decisions and collapse the moored ferry — implemented
- [004](blueprints/004-give-cites-teeth-and-fence-derived-zone.md) — give cites teeth and fence the derived zone — implemented
- [005](blueprints/005-propose-the-page-plan-from-a-repo-scan.md) — propose the page plan from a repo scan — implemented
- [006](blueprints/006-rescan-the-page-plan-on-refresh.md) — rescan the page plan on refresh — implemented
- [007](blueprints/007-add-sound.md) — add sound, the recon that precedes a lock — implemented
- [008](blueprints/008-make-nostos-primary-and-files-the-fallback.md) — make nostos primary and file reads the fallback — implemented
- [009](blueprints/009-give-every-page-a-growth-path.md) — give every page a growth path so the line cap can be enforced — implemented
- [010](blueprints/010-add-muster-the-human-review-gate.md) — add muster, the opt-in human review gate on the loop's close — superseded-by-011
- [011](blueprints/011-add-blueprint-level-muster.md) — add blueprint-level muster, the opt-in human review gate in weave — implemented
- [012](blueprints/012-add-ferry-level-muster.md) — add ferry-level muster, the human review gate at moor — implemented
- [013](blueprints/013-split-moor-into-skill-and-reference.md) — split moor into SKILL.md + REFERENCE.md to hold the line cap — implemented
- [014](blueprints/014-unify-skill-sibling-file-naming.md) — unify skill sibling-file naming on lowercase-kebab topic names — implemented
- [015](blueprints/015-record-session-check-discharges-on-the-blueprint.md) — record session-check discharges on the blueprint — implemented
- [016](blueprints/016-pull-two-skills-under-cap-and-level-commit-twins.md) — pull two skills under the line cap and level the commit twins — implemented
- [017](blueprints/017-add-a-line-cap-lint-over-skills.md) — add a line-cap lint over skills/ — implemented
- [018](blueprints/018-own-the-loop-shape-in-flow-1.md) — own the loop's shape in ARCHITECTURE flow 1 — implemented
- [019](blueprints/019-add-a-render-lint-over-the-loop-shape.md) — add a render lint over the loop's shape — superseded-by-026
- [020](blueprints/020-enforce-the-prune-and-validate-every-cite.md) — enforce the roadmap prune and validate every page's cites — superseded-by-022
- [021](blueprints/021-align-validator-and-doctrine.md) — align the validator and the doctrine on splits, prefixes and cites — implemented
- [022](blueprints/022-validate-every-cite-at-every-status.md) — enforce the roadmap prune and validate every cite at every status — implemented
- [023](blueprints/023-add-a-link-lint-over-relative-md-links.md) — add a link lint over relative markdown links — superseded-by-026
- [024](blueprints/024-rename-the-spine-and-give-chart-its-ferry-edge.md) — rename the spine to chart and rig, and give chart its ferry edge — implemented
- [025](blueprints/025-rule-muster-on-every-blueprint.md) — rule muster on every blueprint — implemented
- [026](blueprints/026-walk-only-what-git-does-not-ignore.md) — walk only what git does not ignore — implemented
- [027](blueprints/027-error-on-implemented-with-matches-no.md) — error when a mustered blueprint reaches implemented on matches: no — implemented
- [028](blueprints/028-convert-cross-skill-links-to-skill-names.md) — convert cross-skill links to unchecked skill names — implemented
- [029](blueprints/029-prefix-register-filenames-and-validate-okf-structure.md) — validate OKF directory completeness and normalize blueprints/ferries indexing — locked
## Ferries ## Ferries
Open ferries link their `MAP.md`; moored ones link the collapsed page - [ferries/index.md](ferries/index.md) — open deliberations and where
that replaced it — `<topic> — moored <date> → <topic>.md`. they moored. 1 open.
- [python-siblings](ferries/python-siblings/MAP.md) — Python siblings for bdd/diagnose — 0/3 resolved

View File

@ -6,8 +6,11 @@ unresolvable cite, unprefixed register cite in prose, discharged roadmap
phase keeping a verify step, malformed `okf:derived` fence, page phase keeping a verify step, malformed `okf:derived` fence, page
unreachable from index.md, page over its line cap, register index line unreachable from index.md, page over its line cap, register index line
disagreeing with its decision file, moored ferry with a malformed disagreeing with its decision file, moored ferry with a malformed
`sealed:` pin or a surviving directory. Warnings `sealed:` pin or a surviving directory, a directory holding `.md` files
(exit 0): page with no cites, blueprint locked without a `sounded:` stamp. with no `index.md` (an open ferry topic directory may carry `MAP.md`
instead), an `index.md` not directly linking every `.md` file physically
beside it. Warnings (exit 0): page with no cites, blueprint locked
without a `sounded:` stamp.
Pin *shape* only — whether the change id still resolves needs the repo in Pin *shape* only — whether the change id still resolves needs the repo in
hand, which is write-OKF refresh's job, not a validator that must exit 0 hand, which is write-OKF refresh's job, not a validator that must exit 0
@ -197,12 +200,47 @@ def check_roadmap(text, rel, errors):
close() close()
def check_dir_index(okf, errors):
"""Every OKF directory holding `.md` files carries an entry point.
Directly under `ferries/`, an open ferry topic directory is fronted
by `MAP.md` instead — R-015's directory-means-open shape; a moored
ferry is a single file, never a directory, so it never reaches here.
"""
dirs = {p.parent for p in okf.rglob("*.md")}
for d in sorted(dirs):
entry = "MAP.md" if d.parent == okf / "ferries" else "index.md"
if not (d / entry).exists():
rel = d.relative_to(okf.parent)
errors.append(f"{rel}: directory holds .md files with no {entry}")
def check_index_completeness(okf, errors):
"""`index.md` directly links every `.md` file beside it.
Independent of `reachable()`'s transitive, whole-tree check — a page
linked only from a grandparent index still fails this one. `MAP.md`
carries its own D-n table shape and is exempt.
"""
for idx in okf.rglob("index.md"):
d = idx.parent
siblings = {p.resolve() for p in d.glob("*.md") if p.name != "index.md"}
linked = {(d / t).resolve() for t in links(idx.read_text())}
missing = siblings - linked
if missing:
rel = idx.relative_to(okf.parent)
names = ", ".join(sorted(p.name for p in missing))
errors.append(f"{rel}: index.md missing {names}")
def check_ferries(okf, errors): def check_ferries(okf, errors):
"""A page directly under ferries/ is a moored ferry: pinned, collapsed.""" """A page directly under ferries/ is a moored ferry: pinned, collapsed."""
ferries = okf / "ferries" ferries = okf / "ferries"
if not ferries.is_dir(): if not ferries.is_dir():
return return
for page in sorted(ferries.glob("*.md")): for page in sorted(ferries.glob("*.md")):
if page.name == "index.md":
continue
rel = page.relative_to(okf.parent) rel = page.relative_to(okf.parent)
if (ferries / page.stem).is_dir(): if (ferries / page.stem).is_dir():
errors.append(f"{rel}: coexists with ferries/{page.stem}/ — open or moored, never both") errors.append(f"{rel}: coexists with ferries/{page.stem}/ — open or moored, never both")
@ -332,6 +370,8 @@ def main(argv):
check_ferries(okf, errors) check_ferries(okf, errors)
check_register(okf, warrants, errors) check_register(okf, warrants, errors)
check_dir_index(okf, errors)
check_index_completeness(okf, errors)
for line in warnings: for line in warnings:
print(f"WARN {line}") print(f"WARN {line}")