ADR-0095: Key-Rule Governance — Free Until First Use, Then Frozen¶
- Status: accepted
- Date: 2026-07-26
- Deciders: Nicolas Burri ("agree with recommendations", design session 2026-07-26; his immutability instinct recorded 2026-07-25: "I assume this would be part of the project setup and would have to be immutable").
- Relates to: ADR-0077 §4 (scope-configured key conventions + auto-numbering — the mechanism this governs), the project-setup wizard (D-2 presets seed the rules at birth), the B4 key-rule edit UI (unblocked by these semantics), ADR-0073 (scope config — the surface it lives on).
Context¶
Key-naming rules (per-(scope, trace-item-type) prefixes the Suggest button uses) were seed/ import-only; a rule edit UI (B4) needs governance semantics first. Keys are regulatory identifiers: trace links, coverage views, audit packs and printed PDFs all cite them — a rule change under minted keys silently bifurcates a scope's naming.
Decision¶
- Free while unused: a scope's key rule for a type is freely editable (scope-config, the existing config permission) as long as no trace item of that type exists in the scope. The wizard seeds lane-preset rules at project birth, so day-one projects never touch this.
- Structurally frozen at first use: once the first key of that type is minted in the scope, the rule is read-only in the UI and the server refuses changes (409 naming the frozen reason and the item count) — the ADR-0091 floor pattern: enforced at the act, not merely hidden.
- The deliberate exception: an audited admin act ("change key rule despite N existing items") remains possible for the genuinely rare case — loud (confirmation naming the consequence: existing keys keep their names; only future suggestions change), audited with before/after, never silent. No renumbering of existing keys, ever (keys are cited identity).
- Existing keys are NEVER migrated by a rule change — a rule governs future suggestions only.
Consequences¶
- B4 (key-rule edit UI) builds on these semantics; the server gate is a small addition to the existing key-rule write path; tests pin free-edit, freeze, and the audited exception.
- The wizard's D-3 completeness read counts "may-define without a key rule" as a gap (already in slice 1); the freeze makes the wizard's seeded choice durable by default.