Concepts
The ledger
The ledger records the drift you already had, so Plumber can tell it from drift you just added. It is .plumber/ledger.jsonl, with one entry per line. Commit it and review it with your code.
What's in it
| Entry | Records | Written by |
|---|---|---|
| debt | a finding you had when you adopted Plumber, and how many places it was | init, baseline |
| exception | a finding accepted on purpose, with the reason someone gave | accept --why |
| decision | each token you've accepted: its value, where it comes from, its reason | accept-decisions, init, baseline |
An entry is keyed by what was written and where: the rule, the element, the property, the authored text and the file. Moving code up or down a file doesn't change its key; changing the text does.
How a check uses it
plumber check compares today's findings with the ledger:
- A finding covered by debt or an exception is known. It's summarised in one line, and doesn't fail.
- A finding the ledger doesn't cover, or more places than the ledger allows, is new. New errors fail.
- Debt that's gone is stale: a warning, as a reminder to record the progress.
Recording progress
Fixing code doesn't shrink the ledger. To record the progress, run:
npx plumber ledger --ratchet # lower each debt count to what's left, drop what's fixed
npx plumber ledger --prune # drop entries for findings and tokens that no longer exist
baseline refuses to record more debt than you already had, unless you pass --force after a review.
Accepting an exception
When a value is off on purpose, record it with the reason:
npx plumber accept --rule provenance/arbitrary --site src/Judged.tsx:6 --why "Matches the printed form's 13px grid"
The reason is stored with the entry and shown wherever the finding appears. An exception without a reason is an error.
In review
Adding to the ledger lets drift in, so CI treats it as a design decision:
plumber check --base mainreports which entries a branch adds. Debt that grows is an error.- In the GitHub Action, an added exception or decision needs approval from one of your
ledger-approvers. See CI and pull requests. plumber check --strict-ledgerfails on any ledger growth against your last commit, which is what agent hooks use.