# SPEC
## §G GOAL
Distil a document into the part a reader needs to ACT. Generated, ⊥ hand-written.
## §N NAV
up|src|code nodes — tokens, spec, fed, lens facades & logic
self|src/slice|distil a document to the part needed to ACT, generated
sib|src/tokens|`itok` facade, counts w/ method label, entry cost, working budget
sib|src/spec|`microlith` facade, §-section split, structural check, fmt
sib|src/split|PROPOSE a federation — modules the code separated, the rows naming each, a home for an unmanaged row
sib|src/fed|`§F` parse, edges, chain root→node, `SPEC.md` discovery
sib|src/adopt|foreign single-file spec → federation: row placement, citation rewrite, conservation
sib|src/lens|pack assembly, depth `rule`\|`why`, budget verdict
sib|src/ollama|local endpoint client, `num_ctx`, fence extraction
sib|src/tdd|red→judge→green→gate→repair loop, source region edits
sib|src/plan|open `§T` rows, horizon, confidence, `apply` one step
sib|src/wave|the SCHEDULE a parallel build follows — code DAG, ready set per round, depth & width
sib|src/review|mechanical checks on what `apply` committed
sib|src/state|one idempotent cached store — pace, telemetry, applied rows
sib|src/land|run branch → `main` when believability earns it
sib|src/cli|arg dispatch, usage, exit codes
sib|src/code|read Rust source as text — split, public fns, call detection, signatures
sib|src/debt|a ratchet — measure, compare to a recorded floor, refuse the wrong way
sib|src/assay|a corpus + a compiler grader — measure WHETHER the model can, ⊥ make it
sib|src/git|one git invocation shape — the repo a command acts on, & the env it refuses
## §C CONSTRAINTS
- LOCAL sources only. ⊥ network — `.:C` allows the inference endpoint & nothing else. remote arrives via a pinned flake input, ⊥ an HTTP fetch here.
- declarations in `.sherd-slices`, line-oriented, same family as `.context-limits` & `.spec-records`.
## §V INVARIANTS
V1: a slice is ⊥ a summary. a summary compresses everything proportionally & leaves the reader unable to tell what is authoritative; a slice takes 100% of what is LOAD-BEARING & 0% of the rest
V2: GENERATED. `notation.txt` was extracted by hand once & nothing would notice if `FORMAT.md` moved (B1). `--check` gates the drift
V3: an EMPTY slice is an error, ⊥ an empty file. a rule matching nothing means the source moved & the reader would get silence
V4: a malformed declaration is an error naming its line, ⊥ a skipped row
V5: output carries its provenance — `GENERATED by sherd slice from <source>` — so a reader knows ⊥ to edit it
V6: slices serve COMPLIANCE. a rule fits a line; a JUDGEMENT needs the reasoning ∴ the worker gets slices & the supervisor gets the source
V7: `drifted` has ONE definition, called by `sherd slice --check` AND by the gate. the hook & the loop ! apply the SAME rule — 2 implementations of one check is the defect this repo exists to end (`.:V50`)
## §T TASKS
T5|.|distil `§B` rows into worker prohibitions — the failures are stubs, ⊥ design|V6
## §B BUGS