Commit 50d6fc3
committed
refactor(engine): make the ADR briefing budget a built-in check
The briefing budget is a property of the engine, not a governance decision
this project happens to hold: `briefAdr` truncates every project's ADRs at
the same cap, so every archgate user has the same blind spot. Shipping it
as a dogfooded ADR plus companion rules put the check in the wrong place,
and the symptoms showed it — the rule read `DEFAULT_MAX_SECTION_CHARS` out
of `src/engine/context.ts` and hardcoded a fallback everywhere else, and it
reimplemented `extractAdrSections` because ARCH-024 forbids a rule file
from importing engine code.
Moving it into the CLI dissolves both problems: the check now imports the
same cap and the same extractor that perform the truncation, so they
cannot disagree. The parity test that existed only to detect that drift is
deleted along with them.
- `src/engine/adr-sections.ts` owns `BRIEFED_SECTIONS`,
`DEFAULT_MAX_SECTION_CHARS`, `extractAdrSections`, `truncateSection`, and
`collectBriefingBudgetWarnings`. Extracted into its own module because
`context.ts` already imports `runner.ts`, so measuring from the runner
would have closed an import cycle.
- `archgate check` reports every overflowing section as a `[briefing]`
advisory, in console, CI annotations, and JSON (`briefingWarnings`).
Measured over ALL ADRs, including `rules: false` ones — ARCH-024 is the
worst offender and has no companion rules at all, so a rules-only check
would have missed it.
- Advisory by design: it never affects `pass`. Sections that enumerate
normative identifiers have an irreducible floor above the cap, and a
blocking check would be unfixable and would train authors to suppress it.
Removes GEN-005 and its companion rules. The four ADRs that declare a
deliberate overflow now point at the built-in check instead.
Documented in all three locales; ADR count drops to 46 rules.
Signed-off-by: Rhuan Barreto <rhuan@barreto.work>1 parent b138de6 commit 50d6fc3
20 files changed
Lines changed: 404 additions & 399 deletions
File tree
- .archgate/adrs
- .claude/agent-memory/archgate-developer
- docs
- public
- src/content/docs
- nb/reference/cli
- pt-br/reference/cli
- reference/cli
- src/engine
- tests
- commands
- engine
- integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments