Self-orientation for small KBs
Type: reference/types/design-proposal.md · Tags: context-engineering
ADR 143 and orient-before-writing.md have the writer hand pre-write orientation to a reporter agent before drafting a new or scope-shifting claim. That design is sized for this KB. Installed projects are often much smaller: a scaffold KB or a young project may hold a few dozen notes. There, a sub-agent costs a launch and a handoff to protect a context the whole orientation surface would barely touch. This proposal lets the writer orient itself when the searched scope is small, and keeps delegation above a threshold of about 100 notes.
The intended outcome is the same orientation result at lower cost where the KB is small. The conjecture is that below the threshold the writer can scan every title and description in scope and open the notes that bear on the claim, provided the orientation question is stated explicitly.
Current state (as of 2026-12-02)
- Delegated pre-write orientation is shipped as an unverified trial under ADR 143 in
cp-skill-writeStep 5 andcp-skill-edit, with live-use retrieval verification still pending.cp-skill-writeStep 5 already falls back to self-orientation at any KB size when a worker cannot launch. This proposal would make self-orientation the chosen route below the threshold rather than only a fallback. - At this KB's density, titles plus descriptions take roughly 150–250 bytes per note, so 100 notes is about 15–25 KB.
kb/theoryholds 466 files, about 111 KB, so this KB is well above the threshold everywhere that matters. - No mechanism reports a KB's or a collection's size to a skill. A writer can count with
rg -lover the scope.
Options
1. Always delegate
Keep the delegated design at every size. Operativity path: none beyond ADR 143. One procedure everywhere and always a fresh framing, at the cost of an extra agent per qualifying write in small KBs.
2. Self-orient below a threshold
Before delegating, the writer measures the searched scope. Below the threshold it scans all titles and descriptions in scope, asks the same question as the reporter (which notes constrain, contradict, narrow or already cover the claim), and opens the notes that bear on it. Above the threshold it delegates as under ADR 143. Operativity path: a branch in the orientation step of cp-skill-write, consumed by every writer that loads the skill. Reversal removes the branch and leaves delegation in place.
Forces
- Note count is a proxy. What matters is the bytes the writer must scan in the searched scope against its context budget. Notes with long descriptions or a scope spanning several collections reach that budget sooner.
- Fresh framing is lost. ADR 143 prefers delegation partly because a reporter does not share the writer's vocabulary. A self-orienting writer searches with the framing of the source it is working from, as in the case that motivated delegated orientation. The explicit orientation question, and a full scan rather than targeted search, are the mitigations; neither is tested.
- Cost. A full description scan of 100 notes costs less context than reading a reporter's output plus the notes the reporter opened, but it stays in the writer's context for the whole draft.
Free choices
- Threshold measure: note count or description bytes.
- Scope: the whole KB, the target collection, or the collections the orientation searches.
- Whether the threshold is a fixed default or configurable per project.
- Whether self-orientation still writes the same report shape, for comparability with delegated runs.
Feasibility and commitment scope
Counting files and reading descriptions uses existing tools. Adoption changes one branch in the skill and is reversible. It depends on ADR 143's delegated orientation remaining in place; without the delegated step there is nothing for this branch to replace.
Adoption criteria
- ADR 143's delegated orientation trial is confirmed by live use or a fresh discriminating case.
- Below-threshold check. On a scope under the threshold, writers orienting themselves with the explicit question find the constraining notes about as often as delegated reporters do. A case is needed where a small scope contains a note that should change the claim; the Case 5 notes could be placed in a reduced scope for this.
- If self-orientation misses where delegation finds, keep Option 1.
Relevant Notes:
- ADR 143: Split authoring into write, edit, and revise with connect marks — extends: governs when pre-write orientation runs and delegates it above this threshold; this proposal adds the small-KB self-orientation branch
- Orient before writing — procedure: the delegated orientation reporter whose question and output shape self-orientation mirrors below the threshold
- Write — procedure: the skill whose orientation step would gain the branch