React PlumberInstall package

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

EntryRecordsWritten by
debta finding you had when you adopted Plumber, and how many places it wasinit, baseline
exceptiona finding accepted on purpose, with the reason someone gaveaccept --why
decisioneach token you've accepted: its value, where it comes from, its reasonaccept-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:

Recording progress

Fixing code doesn't shrink the ledger. To record the progress, run:

sh
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:

sh
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: