Skip to main content

Module debt

Module debt 

Source
Expand description

Budget debt: the inherited violations a project carries, and only downward.

A budget gate measures one document on one or more dimensions and fails the measurement that exceeds its budget. A project adopting the convention with a corpus written before it would fail its first commit on files nobody touched, so it records each inherited violation here, per gate, per path, per dimension. A numeric dimension carries a ceiling the gate judges against instead of the budget. A boolean dimension is an exception that clears once the condition is corrected.

The file can only shrink. Nothing delivers it, nothing raises a ceiling, and a recorded dimension that stops matching what the gate measures is a failure naming the command that lowers it. The tightening is pure: it takes the parsed debt and a set of measurements and returns the new debt, so the gates and the command share one implementation and a test drives it with no filesystem. What a gate measures is each gate’s business.

SATISFIES budget-debt:a-recorded-dimension-only-shrinks

Structs§

Debt
The recorded debt.
DimensionSpec
One dimension a budget gate measures: its key in the file, its kind, and the noun a finding prints after the number.
Measurement
One measurement: a gate, a path, a dimension, and what was found.
Presence
Which files are on disk.
Tightened
What a tightening produced.

Enums§

Change
One change a tightening makes, or declines to make.
DebtError
A debt file that cannot be trusted, or a verb the state refuses.
Kind
What a dimension measures.
Measured
What a gate measured on one dimension of one path.
Recorded
One recorded dimension.

Constants§

BUDGET_GATES
The gates that measure a budget, in id order.
DEBT_PATH
Where an instance keeps its debt.
LEGACY_DEBT_PATH
The flat list of exempt chapters an older instance carries.
SCHEMA_VERSION
The debt file schema this binary reads and writes.

Functions§

dimensions
The dimensions one budget gate measures, or none for a gate that measures no budget.
legacy_list
The entries of the legacy chapter list, normalized, in file order.
normalize
The form a path takes in the file: repository-relative, no ./.