# SPEC
## §G GOAL
`init` verb: tracked files → a draft `.ctrm`, commented, deterministic. ⊥ dispatch (`src/cli`), ⊥ set contents (`src/charset`).
## §N NAV
rel|path|lens
up|.|-
up|src|the tool: charset presets, rule resolution, scan, fix, lint levels, token facade, render, CLI
up|src/cli|arg dispatch, verbs, exit codes, `guard` hook adapter
self|src/cli/init|`init` verb: survey tracked files by type, greedy preset cover, draft `.ctrm`
sib|src/cli/guard|`guard` hook adapter: harness payload in, hook decision out, JSON reader
sib|src/cli/explain|`explain` & `sets` answers, `explain --as` forms: args, lines, agent prompt
sib|src/cli/usage|help text, verb detection, did-you-mean, message style
## §V INVARIANTS
V128: `init [--print]` reads the git-tracked fileset (`src/tokens:V9`), 1 group per file type (`*.<ext>`, else the file name). per group: hazard (`check`'s verdict, RGI joiners exempt) → named "fix these", ⊥ EVER granted · builtin map → ASCII (`src/fix:V26`) → "`ctrm fix` rewrites" + `check`'s N finding(s) in M file(s) until it runs, ⊥ granted unless `--keep-fixable` (then needed, typography), ⊥ counted if its line grants it (B81) · rest = needed → greedy cover over `caveman typography math legal marks box emoji cr` (max gain, tie → smaller set, then that order), then letter locales (⊥ `typography-<code>`, B84): 1 holding all if `en-aux` | base code, else base holding most + 1 for rest (B80), else 1 variant holding all, else `any` + comment naming what nothing covers. ∀ set line carries a comment of what it covers; pure-ASCII types listed, ⊥ line. same files → same bytes. `.ctrm` exists → exit 2 naming `--print`, ⊥ overwrite; `--print` → stdout, writes ⊥. runner `init_test.rs`.
## §T TASKS
id|status|task|cites
T68|.|split a group by directory when one dir's need differs (itok: 1 doc of Han text turned `*.md` into `any`) ∴ `docs/x/*.md any` + `*.md ascii+caveman`, ⊥ 1 file widening the type|V128
## §B BUGS
id|date|cause|fix
B80|2026-10-04|1 locale ! held all letters ∴ Polish + U+00E9 → `fi-FI-aux` ⊥ `pl+en-aux` (#5)|V128
B81|2026-10-23|draft counted U+2014 its own `any` line granted|V128
B82|2026-10-25|draft said `1 findings in 1 files` (#37)|V128
B84|2026-11-02|`typography-<code>` ∈ locale candidates ∴ U+2020 → `typography-da` ⊥ `any`, Polish + U+2020 → `pl+typography-da`: B80's language nobody writes|V128