feat(write-OKF): enforce the line cap by giving every page a growth path

- feat(okf-check): error over cap, and cap blueprints at 150 not 110
- docs(okf-layout): name the move at cap+1 per page kind — shed, prune, split
- docs(split-page): add the split procedure, pure-move and index rewiring
- docs(write-OKF): route an over-cap page to split-page.md from refresh
- implements blueprint 009
This commit is contained in:
Łukasz Boryń 2026-07-24 00:16:47 +02:00
parent a6769919c1
commit e66be91c73
6 changed files with 117 additions and 16 deletions

View File

@ -1,6 +1,6 @@
---
type: Blueprint
status: draft
status: implemented
traces-to: user request 2026-07-24
---

View File

@ -30,7 +30,7 @@ your task needs. Humans welcome too.
- [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 — draft
- [009](blueprints/009-give-every-page-a-growth-path.md) — give every page a growth path so the line cap can be enforced — implemented
## Ferries

View File

@ -56,7 +56,8 @@ contract: [okf-layout.md](okf-layout.md).
or removed unasked. An unwarranted page is deleted only when wholly
derived, else superseded per step 3. Contract:
[taxonomy-scan.md](taxonomy-scan.md).
2. **Smallest edit per delta** — never rewrite a page wholesale.
2. **Smallest edit per delta** — never rewrite a page wholesale; a page
over its cap splits per [split-page.md](split-page.md), alone.
3. **Supersede, don't delete**: outdated claims get struck with a
pointer to the replacement, mirroring
[architect/revise.md](../architect/revise.md) discipline.
@ -99,7 +100,7 @@ contract: [okf-layout.md](okf-layout.md).
cross-link the rest.
- **Never** write raw logs, transcripts, or scratch into OKF — durable
synthesis only.
- **Never** exceed 110 lines per page — split and index instead.
- **Never** exceed a page's cap — split per [split-page.md](split-page.md).
- **Never** move legacy files without explicit consent.
## See also

View File

@ -23,7 +23,8 @@ OKF/
│ # moored: <topic>.md, pinned with sealed:
├── modules/ # proposable, never mandatory: <name>.md per code
├── analyses/ # directory / analysis directory a scan found
└── LEARNINGS.md # debunked claims, gotchas — append-only, sourced
└── LEARNINGS.md # debunked claims, gotchas — append-only, sourced;
# splits into learnings/<theme>.md at the cap
```
The spine above is a diagram, not a required page set — `okf-check`
@ -57,7 +58,7 @@ loop, not on disk.
first, at most one pair — never its content.
- Conformance check: `scripts/okf-check <okf-dir>` — reach for it from
this skill's own base directory, never a repo-relative path. Exit 1 on
any error; over-cap pages and pages with no `cites` are warnings.
any error; pages with no `cites` are warnings.
## Page contracts (one line each in index.md)
@ -67,11 +68,18 @@ loop, not on disk.
reading. The cold-start page.
- **ARCHITECTURE.md** — module map with seams; every claim cites a file
path. Uses design-codebase vocabulary (module, interface, seam, adapter).
At the cap it **sheds**, keeping the map, seams and flows and moving
per-module prose into the `modules/`/`analyses/` pages that repo's scan
proposed — outside their derived fences, which refresh regenerates.
- **CONTEXT.md** — glossary per model-domain's CONTEXT-FORMAT.md.
**One canonical glossary per bounded context — never per issue.**
Issue-local terms live in their blueprint until they recur.
Issue-local terms live in their blueprint until they recur. Splits into
`context/<subroot>.md` only when multi-context; over the cap in a
single-context repo is that rule already broken.
- **ROADMAP.md** — architect's skeleton (locked decisions, phases with
verify steps, risks, out-of-scope).
verify steps, risks, out-of-scope). At the cap it **prunes**, never
splits: a discharged phase collapses to one line naming what shipped
and its blueprint numbers, which hold the detail.
- **decisions/** — the why-register: one file per settled decision,
permanent numbers, format in
[model-domain/DECISION-FORMAT.md](../../engineering/model-domain/DECISION-FORMAT.md).
@ -93,13 +101,22 @@ loop, not on disk.
collapse — fields and drift rule in
[page-warrant.md](page-warrant.md).
- **LEARNINGS.md** — what was believed / what is true / source. Never
edited retroactively, only appended or superseded.
edited retroactively, only appended or superseded. At the cap it splits
into `learnings/<theme>.md` and becomes their index; both contracts hold
per page, and supersession then works **across** pages —
[split-page.md](split-page.md).
## Rules
- Durable knowledge only — no session state, no high-frequency logs
(that's [write-handoff](../../productivity/write-handoff/SKILL.md) territory).
- One fact, one home; cross-link with relative paths.
- Every page ≤110 lines; grow by splitting + indexing, not by scrolling.
- Every page ≤110 lines, a blueprint ≤150; grow by splitting + indexing,
not by scrolling. Over cap is an **error**, not a warning, because every
kind above has a move at cap+1 — [split-page.md](split-page.md).
- A growth-path directory is created **lazily** — when the cap forces it,
never scaffolded empty at init.
- Blueprints may grow from `NNN-<slug>.md` into `NNN-<slug>/` directories
(blueprint.md + notes) — the glossary never moves in there.
(blueprint.md + notes) — the glossary never moves in there. Over 150
lines reads as **scope** first: two blueprints, or a
[ferry](../ferry/SKILL.md).

View File

@ -3,9 +3,9 @@
Errors (exit 1): missing type, missing warrant, duplicate answer,
unresolvable cite, malformed `okf:derived` fence, page unreachable from
index.md, register index line disagreeing with its decision file, moored
ferry with a malformed `sealed:` pin or a surviving directory. Warnings
(exit 0): page over the 110-line cap, page with no cites, blueprint
index.md, page over its line cap, register index line disagreeing with
its decision file, moored ferry with a malformed `sealed:` pin or a
surviving directory. 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
@ -17,6 +17,7 @@ import sys
from pathlib import Path
CAP = 110
BLUEPRINT_CAP = 150
LINE_SUFFIX = re.compile(r"\d+(-\d+)?")
@ -207,8 +208,11 @@ def main(argv):
continue
if not fields.get("type"):
errors.append(f"{rel}: missing type:")
if len(text.splitlines()) > CAP:
warnings.append(f"{rel}: over the {CAP}-line cap")
# Every page kind has a growth path at cap+1, so the cap is an
# error: a legal move always exists. See split-page.md.
cap = BLUEPRINT_CAP if "blueprints" in rel.parts else CAP
if len(text.splitlines()) > cap:
errors.append(f"{rel}: over the {cap}-line cap")
# Sounding is a precondition of lock. Only at `locked`: `draft` is
# not-yet-sounded, and `implemented` would retro-flag 002-006.

View File

@ -0,0 +1,79 @@
# Splitting a page at the cap
`okf-check` errors when a page passes its cap — 110 lines, 150 for a
blueprint. This is that error's procedure. Which move a page gets is its
contract in [okf-layout.md](okf-layout.md); this page is *how* to make the
move without losing content or breaking the bundle.
## The move is pure
A split relocates; it never authors.
- Entries move **verbatim** — nothing reworded, merged, resequenced or
dropped. An improvement noticed mid-split is a later commit.
- It lands in **its own change**, alone, so review reads it as a
relocation instead of a 200-line diff mixing moves with edits.
- Verify by **count**: entries in == entries out. A split that changes the
count is an edit wearing a split's clothes.
New content lands in the next change, alongside whatever it documents.
## Choosing the axis
Split by **theme, and the theme is the layer that has to change because of
the entry.** That rule decides entries that could sit in two places: a
lesson about a viewer that reads a grammar belongs under the grammar,
because the grammar is what constrains the viewer.
Chronological halves ("2025", "2026") also hold the cap and destroy
findability — a new entry gets no obvious home. Don't.
Theme **names** are the repo's, never this skill's. Name them after that
repo's layers as they actually are.
## Rewiring the index
The parent becomes an index of its subpages, and `index.md` keeps its
single line to the parent. Subpages are **not** listed in `index.md` — it
is capped too, and would grow with every theme added.
Three frontmatter obligations, all enforced by `okf-check`:
- Every subpage carries the parent's `type:` and its own `purpose:`,
`answers:` and `cites:`.
- **`answers:` may not collide.** Duplicate answers across pages is an
error — the parent's question narrows to the index's own ("where does
each theme live?") and each subpage claims the slice it now owns.
- Every subpage must be **reachable**: linked from the parent, which is
linked from `index.md`. An unreachable page is an error, a page listed
but not yet written is legal.
## The derived-fence trap
`modules/` and `analyses/` pages are the only ones carrying an
`okf:derived` region, and refresh regenerates the inside of it wholesale.
Prose shed out of `ARCHITECTURE.md` therefore lands **outside** the fence,
in the judgement zone. Inside, it survives until the next refresh and then
silently is not there.
## Lazily, at the cap
The directory appears when the cap forces it — never scaffolded empty at
init, never pre-created for a page that might grow later. An empty
`learnings/` is the same mistake as the empty `adr/` this repo already
deleted once.
## When the page is a blueprint
Over 150 lines, ask what is long before splitting the file. A blueprint
naming three things in its slug is over-*scoped*, not over-written:
compound work that still fits one session becomes two blueprints, and work
past one session goes to [ferry](../ferry/SKILL.md), whose own trigger is
exactly this. The `NNN-<slug>/` directory form is for a blueprint's notes,
not for a blueprint that should have been two.
## Done criteria
- `scripts/okf-check <okf-dir>` exits 0, output pasted.
- Entry count equal before and after, stated.
- The split is alone in its change, message `docs(okf): split <page>`.