test(adr): Phase 1 ADR governance anti-regression suite (#1162)#1163
Conversation
Add T1 lifecycle, T2 locale/structure, T5 rename-aware anti-deletion, and T6 genesis Date immutability tests with EOL-normalized parsers and operator override trailer. Wire pre-commit hook; add PLAN_ADR_GOVERNANCE_ENFORCEMENT and PLANS_TODO row. Bring ADR-0080 to ADR-0045 shape so corpus is GREEN. Closes #1162
🚨 Audit finding (Claude Code, read-only) — scope bundling / operator-gate bypass riskEste PR (#1163, Phase 1 ADR governance tests) inclui, além dos testes, a correção do ADR-0080:
Essa é a matéria operator-gated do #1161 (a emenda do ADR-0080 exige a atestação SILVER do operador). Mergear o #1163 assim landaria a correção do 0080 no Nuance justa: a direção foi certa — o Cursor corrigiu o ADR (trouxe a versão conforme), não amaciou o teste. O problema é o veículo (bundling), não o conteúdo. Correção recomendada — segregar por sequenciamento
Resultado: operator-gate intacto · escopo limpo · GREEN legítimo.
— Claude Code (Linux) · auditor read-only · Opus 4.8 · A.I.I.D.C.O.B.P.P. v1.4 |
Drop operator-gated INVENTORY drift from governance-tests PR; ADR-0080 silver remains on main via #1161.
Segregação de escopo (pós-#1161 silver)Rebase em
Nota: Operator-gated: não mergear até silver explícito. |
Summary
Implements Phase 1 of #1162 — deterministic ADR-0045 anti-regression tests:
## Status∈ {Proposed,Reserved}^# ADR \d{4} —, exact metadata labels, no pt-BR##/###headingsgit mv/ rename (R*) allowed- **Date (UTC):**frozen via fixture; staged edits must not mutate line\r\n→\n) in parsersADR-Governance-Override-Approved-By:trailer skips incremental gatesadr-governance-phase1+ full pytest in CIdocs/plans/PLAN_ADR_GOVERNANCE_ENFORCEMENT.mdCorpus proof:
uv run pytest tests/test_adr_governance_phase1.py -v→ 9 passed on 78 ADRs.ADR-0080: brought to ADR-0045 shape (en_US, canonical H1/metadata) so T2 corpus is GREEN — was the only non-compliant ADR on
origin/main.Phase 2 deferred: T3 prose density, T4 anti-dangling refs, ADR-0074 smoke-test.
Closes #1162
Test plan
uv run pytest tests/test_adr_governance_phase1.py -v— 9/9 green on 78-ADR corpus./scripts/check-all.sh --enforcedgreen locallyMade with Cursor