Skip to content

Commit 51a44ec

Browse files
committed
fix(scripts): assert ADR numbers name one decision + repair a broken ADR link (#5992)
`check-adr-anchors` now audits the premise every anchor rests on: an ADR number identifies exactly ONE decision. Three numbers under `docs/adr/` were each claimed by two unrelated records (0010 / 0019 / 0057); they are grandfathered on an explicit, shrink-only allowlist in the script, so a FOURTH collision fails the ESLint job. Successive versions of one decision (`0006-project-environment-split{,.v2,.v4}.md`) are distinguished structurally — same stem plus `.vN` — not by naming 0006. `--self-test` provokes the red paths on synthetic directories and asserts, against the live tree, that dropping the allowlist surfaces exactly the three known collisions. Also fixes the broken relative link in `0057-erp-authorization-core-business-units-and-scope-depth.md`, which pointed at `./0010-metadata-protection.md` (the file is `0010-metadata-protection-model.md`). Route C of the maintainer ruling on #5992. Route B (slug-qualified references) and route A (renumbering) are deliberately not implemented. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn
1 parent a36db28 commit 51a44ec

4 files changed

Lines changed: 402 additions & 11 deletions

File tree

.github/workflows/lint.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,15 @@ jobs:
182182
# and the mechanism was simply that the edited file never mentioned them —
183183
# so the author could not have known. Presence check only; the invariant
184184
# travels in the failure message (scripts/adr-anchors.json).
185-
- name: ADR anchors (governed code names its decision)
185+
#
186+
# Since #5992 the same script also audits the premise the anchors rest on:
187+
# an ADR number names exactly ONE decision. Three numbers were each claimed
188+
# by two unrelated records (0010/0019/0057) — grandfathered on an explicit
189+
# shrink-only allowlist in the script, so a FOURTH collision goes red here.
190+
# The `--self-test` in the pnpm script provokes that red path on synthetic
191+
# directories every run, because a collision is rare enough that nobody
192+
# would otherwise see the gate fail before it mattered.
193+
- name: ADR anchors + number uniqueness (governed code names its decision)
186194
run: pnpm check:adr-anchors
187195

188196
# #3280/#3290 org-identifier guard: `organizationId` is the blessed

docs/adr/0057-erp-authorization-core-business-units-and-scope-depth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**Status**: Accepted in part (2026-06-21) — D1–D3/D8 implemented (scope-depth enum + evaluator, `sys_business_unit` tree, hierarchy-resolver seam, conformance rows); **D4–D7 superseded by ADR-0090 D3 / ADR-0095**: the `sys_role`/`sys_user_role`/`role_and_subordinates` vocabulary never shipped — the code realizes them as flat `sys_position`/`sys_user_position` with rollup on the BU tree. This ADR's own implementation-status table predates that supersession; read it with the rename applied.
44
**Deciders**: ObjectStack Protocol Architects
5-
**Builds on**: [ADR-0010](./0010-metadata-protection.md) (metadata protection / object ownership),
5+
**Builds on**: [ADR-0010](./0010-metadata-protection-model.md) (metadata protection / object ownership),
66
[ADR-0049](./0049-no-unenforced-security-properties.md) (enforce-or-remove),
77
[ADR-0054](./0054-runtime-proof-for-authorable-surface.md) (runtime proof),
88
[ADR-0055](./0055-master-detail-controlled-by-parent.md) (RLS reuses pre-resolved membership IN-form; **no compiler subquery**),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"check:skill-frame-sync": "node scripts/check-skill-frame-sync.mjs --self-test && node scripts/check-skill-frame-sync.mjs",
4141
"check:skill-frame-freshness": "node scripts/check-skill-frame-freshness.mjs --self-test && node scripts/check-skill-frame-freshness.mjs",
4242
"check:skill-compatibility": "node scripts/check-skill-compatibility-version.mjs --self-test && node scripts/check-skill-compatibility-version.mjs",
43-
"check:adr-anchors": "node scripts/check-adr-anchors.mjs",
43+
"check:adr-anchors": "node scripts/check-adr-anchors.mjs --self-test && node scripts/check-adr-anchors.mjs",
4444
"check:org-identifier": "node scripts/check-org-identifier.mjs",
4545
"check:authz-resolver": "node scripts/check-single-authz-resolver.mjs --self-test && node scripts/check-single-authz-resolver.mjs",
4646
"check:slot-lookup": "node scripts/check-slot-lookup-ratchet.mjs",

0 commit comments

Comments
 (0)