Commit 3459244
fix(devx): read the ledger note against its own field, and stop --lower minting the drift (#10820)
`DEBT`/`TEST_DEBT` pair a measured `errors` with free prose, and nothing read
the prose: a note could narrate any count at all, including one its own field
contradicted, with every gate green. Four hand repairs of that shape are on
record (#7038, #8982, #10721, #10775), the last two on the same day. None of
them closed the class, because `--lower` MINTS it -- its regex capture ends at
the digits, so the sanctioned one-command way to close a surplus is also the way
to desynchronise a note.
Both halves land together, because neither is safe alone. A check without the
tool fix leaves the ledger RED after the next `--lower` run, in whoever's PR ran
it, breaking the "closing an entry is FREE" invariant #5278/#6376 paid for. The
tool fix without the check leaves today's instances undetected.
COMPOSITION reads exactly one thing -- the house-convention tier itemisation the
notes already open with -- and abstains, silently, everywhere else. A tier
counted twice or a further tier count later in the note means the note quotes
its own history and the entry is skipped rather than guessed at. Per-code
tallies (`TS2835 x67, ...`) are deliberately NOT summed: they are partial by
construction, and plugin-rest's sums to 147 while saying "composition as counted
at 153".
`--lower` now plans a `compositionAt` declaration alongside each lowering that
would strand an itemisation, and writes it as a sibling field beside the number
it already locates -- no prose surgery, no invented composition. The staleness
becomes a declared fact the check reads and the green summary reports, instead
of a silent one nothing reads at all. `compositionAt` may only ever declare a
pile LARGER than the field, so it cannot launder a raise.
Measured: over all 33 entries on main, 11 are checked and 0 fire. Over the tree
before #10721 landed, exactly the two known instances fire and nothing else.
Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>1 parent b303673 commit 3459244
1 file changed
Lines changed: 469 additions & 19 deletions
0 commit comments