ADR-0037: baseline has three modes of Rulebearing's own; dependency-cruiser has none
- Status: Accepted (2026-09-24, by the maintainer)
- Date: 2026-09-24
- Derives from: ADR-0015 (the stable violation id), ADR-0031 (
summary.expired[]), ADR-0009 - Constrains:
crates/rb-cli/src/cmd/baseline.rs,crates/rb-rules/src/known.rs,crates/rb-report/src/baseline.rs - Implemented by: Wave 2 plan, Step 10
- Requirements: FR-RULE-09
Context
Plan 0002 Step 10 asks for rulebearing baseline [--baseline-mode full | shrink-only | format] "with dependency-cruiser's three modes". dependency-cruiser 18.2.0 has no modes: depcruise-baseline runs depcruise -c -T baseline -f .dependency-cruiser-known-violations.json and nothing else. The coverage tab's row and FR-RULE-09 describe a behaviour upstream does not have, so the modes need a definition of their own. The one upstream behaviour to keep is the baseline reporter's output, which gate 1 layer 3 byte-compares against test/report/baseline.
Decision
full(the default) writes every current violation as aknownViolationsentry keyed by its stable id. An entry already in the file keeps itsexpires,ownerandreason. With no lifecycle fields, the output is byte for byte dependency-cruiser's.shrink-onlyreads the file (or, without one,options.knownViolations), writes it back less the entries no current violation matches, prints each entry it removed, and never adds one. It exits with the number of removed entries, so a fixed finding fails CI until its entry leaves the baseline: import-linter's unmatched-ignore alerting (design ยง import-linter contracts). New findings are warned about, not added.formatrewrites the file sorted by rule,from,toandid, without cruising, and exits 0.--expires,--ownerand--reasonfill those fields on each written entry that lacks them. An entry past itsexpiresstops applying the day after and fails the run throughsummary.expired[].--ignore-known [file]replacesoptions.knownViolations, as dependency-cruiser does.--no-ignore-knownapplies none, the configuration's included; the last of the two wins.
Consequences
- The coverage tab row for the baseline is Parity+: the reporter and
--ignore-knownmatch upstream, the modes and the lifecycle fields are additions. rulebearing import import-linterpointsignore_importsusers atbaseline --baseline-mode shrink-only.
Alternatives considered
- No modes, as upstream. Rejected: the plan's shrink-only behaviour is the import-linter alerting the design promises, and
formatkeeps a hand-edited baseline reviewable. shrink-onlyexiting 1 on any removal. Rejected: the count names how many entries went, as the error count does for violations.