Repository navigation
Description
Problem or Motivation
Child 3 of the ADR modernization (#5233). Consolidation. It restates the live ruleset (9 rules), the aggregate job names, the #704/#405/#406 rejections, 'AI Scan off' with its read-back, the release-PR skew rule and one test run for each merge. The check binding goes in only if the owner approves decision 3. If not, a revisit line goes in. The owner merges it.
The review of each record that this item changes:
- ADR 0004 (supersede (merge with 0014 into the merge-gate record)): The body names update-prs.yml, release/* rulesets, strict mode and copilot-pass, and all are gone. The successor restates the aggregate names, the feat(github): pr readiness requires an issue-linked, completed task file #704/chore(ci): per-check input scoping — investigated, not building #405/feat(cli):
devops ci testselects tests from a coverage index built on demand bydevops ci coverage --build-index#406 rejections and 'AI Scan off' with its read-back. The App-key rule moves to SECURITY.md. - ADR 0014 (supersede (merge with 0004 into the merge-gate record)): It lists 3 of the 9 rules of the live ruleset. The CI SLO stays in AGENTS.md rule 5 and TESTING.md, with no third copy. 'Local runs' changes only in the PR that ships feat(pr): pr create gates the change and pushes once #4708.
- ADR 0012 (retire): It is superseded by 0013, and it got two notes after the supersession. Its live points move: the squash settings and the release-please keys to the release record, the required checks to the merge-gate record, and its Pages note to Status History.
Proposed Solution & Architectural Design
A new record. SECURITY.md gets the App-key rule: the roadmap App key is never an Actions secret, and the release App key is an environment secret by design. Change the front matter of 0004 and 0014. Move 10 citation lines of 0004 and the 0012 citation at fail-to-pass.yml:8. Rename test_only_update_prs_holds_actions_write_permission_and_ci_dispatches (test_architectural_invariants.py:778). A separate issue replaces the classic devops gh branch-protection audit with a read-only OpenTofu github_repository_ruleset plan or a rulesets read.
Owner decision 3 of 2026-11-12: All three GitHub settings, in this order: (1) cut the App grant to the 9 permissions that the code asks for; (2) after #4417, turn on the App webhook (Issues only) and delete the 7 repository hooks in the same hour; (3) bind the 3 required checks of the ruleset to the GitHub Actions app.
Rules of the ADR process (docs/adr/README.md, #5225) that apply:
- Supersession: the new record sets 'supersedes', and the same PR sets status and 'superseded-by' on the old record. The test fails on a link that goes only one way. The new record restates each rule and each rejected option that still holds, because the alternatives check drops superseded records. Never amend a superseded record. After a third amendment, or when a body contradicts the code, the next change is a supersession.
- Length: the body of a new record has 1,000 words or fewer, its title has 10 words or fewer, and its slug has 60 characters or fewer. Designs, catalogues, row tables, cutover plans, caps and measurements go to OpenSpec changes and specs, to settings or to docs, with a link under More Information.
- Use one Considered Options section. Each bullet ends with 'chosen.', 'rejected, because .' or 'deferred until .'. 'Deferred' does not match the rejected regex (adr.py:49), so the check stops refusing on a premise that changed. Each record has a Confirmation section that names its test, CI row or metric, and an optional tracker key.
- Code, tests and workflows cite the record in force. A test fails on a citation of a superseded record in src/, tests/ and .github/ (archived changes and CHANGELOG.md are history). Each superseding PR moves the citations of the records that it supersedes. Rename sweeps do not change docs/adr/.
- Merge ADR changes in batches. Each change of the ADR set changes adr_hash (alternatives.py:634-644, 1006) and makes every checked item due again. So all pure status changes go in docs(adr): add MADR front matter, a Status History and the ADR rules #5225, and the record PRs merge one at a time in the planned order.
- Keep the fix(roadmap): the ADRs in force fill the alternatives ADR budget #5049 budget test. A new record must fit in the tokens that the records it supersedes free. Short option bullets keep the budget, because options are 6,883 of the 8,464 tokens today.
Keep these constraints on purpose. The review found a reason for each one:
- ADR 0014, no strict policy and no merge queue: a repository that a user owns has no merge queue, and the release PR (always-update, reason at 0014:47) shows a red main.
- ADR 0014, pre-push runs only the fast static checks: the cluster gate (feat(k8s): add the CI gate WorkflowTemplate #4691, feat(ci): devops ci --remote runs the gate in the cluster #4698, feat(pr): pr create gates the change and pushes once #4708) is not built, so the text changes only in the PR that ships it.
- AGENTS.md rule 5, the 300 s CI target: only the alarm limit moves to 360 s, from the owner's words of 2026-10-23.
The owner merges this pull request.
Target Subsystem
docs/adr/, SECURITY.md, .github/workflows/fail-to-pass.yml, tests/invariants/test_architectural_invariants.py.
Existing Tool Considered
MADR 4 and the rules of docs/adr/README.md (#5225). No new tool.
Acceptance Criteria
- A new record supersedes ADR 0004 and ADR 0014. It restates the live ruleset (9 rules), the aggregate job names, the feat(github): pr readiness requires an issue-linked, completed task file #704, chore(ci): per-check input scoping — investigated, not building #405 and feat(cli):
devops ci testselects tests from a coverage index built on demand bydevops ci coverage --build-index#406 rejections, 'AI Scan off' with its read-back, the release-PR skew rule and one test run for each merge. - The record states the binding of the 3 required checks to the GitHub Actions app (owner decision 3).
-
SECURITY.mdhas the App-key rule: the roadmap App key is never an Actions secret, and the release App key is an environment secret by design. - The 10 citation lines of ADR 0004 and the ADR 0012 citation at
fail-to-pass.yml:8move.test_only_update_prs_holds_actions_write_permission_and_ci_dispatches(test_architectural_invariants.py:778) has a name that matches what it tests. - A separate issue is filed: a read-only OpenTofu
github_repository_rulesetplan or a rulesets read replaces the classicdevops gh branch-protectionaudit. - The index and link tests of docs(adr): add MADR front matter, a Status History and the ADR rules #5225 pass, and the fix(roadmap): the ADRs in force fill the alternatives ADR budget #5049 budget test passes: the alternatives check fits every record in force under its cap.
Dependencies
This record shares the index of #5235, so it merges after it.
Related
- Tracker: docs(adr): track the ADR modernization #5233. Review source:
docs/adr/at e413c40.
Source: #5233
Alternatives check of 2026-11-16: not-applicable.
Class: docs, no search.
Tool: none found.
Proposed design
Problem statement
ADR 0004 and ADR 0014 describe a merge gate that no longer exists. One new merge-gate record must supersede both records and restate the live rules and the rejected options that still hold. The same pull request puts the App-key rule in SECURITY.md, moves the citations in src/, tests/ and .github/, and renames one invariant test. The owner merges it after #5235. The replacement of the classic branch-protection audit is a separate issue, so this proposal defers it.
Acceptance criteria
Requirement: Two-way supersession link
The new merge-gate record SHALL set supersedes to ADR 0004 and ADR 0014, and the same pull request SHALL set status: superseded, superseded-by and a dated Superseded by line in Status History on both old records.
Scenario: Two-way supersession link
- WHEN
uv run devops ci test tests/roadmap/test_roadmap_adr.pyruns on the pull request. - THEN The test exits 0 and reports no one-way link: the new record names both old records, and each old record names the new record in
superseded-by.
Requirement: Record restates the live merge gate
The new record SHALL restate each live rule and each rejected option of ADR 0004 and ADR 0014 that still holds, including the 9 rules of the live main ruleset, the 3 aggregate job names, the #704, #405 and #406 rejections, 'AI Scan off' with its read-back, the no-strict-policy and no-merge-queue decision, the release-PR skew rule, one test run for each merge and the pre-push fast-check hook.
Scenario: Record restates the live merge gate
- WHEN
rg -n '9 rules|nine rules|Static Analysis|Tests & Coverage|Semantic PR|#704|#405|#406|AI Scan|ai-scan|strict|merge queue|pre-push|one test run|release pull request|release-PR' docs/adr/runs, anduv run devops ci --check --only docsruns. - THEN The search finds the rule count, the aggregate job names, each rejection and each decision in the new record, and the docs check exits 0.
Requirement: Required-check binding is present
The new record SHALL state that the 3 required checks of the main ruleset bind to the GitHub Actions app, as owner decision 3 of 2026-11-12 approves.
Scenario: Required-check binding is present
- WHEN
rg -n 'GitHub Actions app' docs/adr/runs, anduv run devops ci --check --only docsruns. - THEN The search finds the binding of the 3 required checks to the GitHub Actions app in the new record, and the docs check exits 0.
Requirement: SECURITY.md holds the App-key rule
SECURITY.md SHALL state that the roadmap App key is never a GitHub Actions secret and that the release App key is an environment secret by design, and the new record SHALL link to that rule under More Information.
Scenario: App-key rule is in SECURITY.md
- WHEN
rg -n 'roadmap App key|release App key' SECURITY.mdruns, anduv run devops ci --check --only docsruns. - THEN The search finds both statements in SECURITY.md, and the docs check exits 0 with no style or link problem in SECURITY.md or in the new record.
Requirement: Citations name only records in force
The pull request SHALL move each citation of ADR 0004, ADR 0014 and the ADR 0012 citation at .github/workflows/fail-to-pass.yml:8 to the record in force.
Scenario: No citation of a superseded record remains
- WHEN
rg -n 'ADR 0004|ADR 0014|ADR 0012' src tests .githubruns, anduv run devops ci --check --only actionlint,zizmorruns on the changed workflows. - THEN The search finds no citation of ADR 0004, ADR 0014 or ADR 0012 in a source file, a test or a workflow, and the workflow checks exit 0.
Requirement: Invariant test name matches its check
The test function test_only_update_prs_holds_actions_write_permission_and_ci_dispatches SHALL be renamed to a name that states that no workflow holds actions: write and that ci.yml admits workflow_dispatch.
Scenario: Renamed invariant test
- WHEN
rg -n 'def test_only_update_prs_holds_actions_write_permission_and_ci_dispatches|def test_no_workflow_holds_actions_write_and_ci_admits_workflow_dispatch' tests/invariants/test_architectural_invariants.pyruns, anduv run devops ci test tests/invariants/test_architectural_invariants.pyruns. - THEN The search finds the new function name and no old function name, and pytest exits 0.
Requirement: Record follows ADR structure and length limits
The new record SHALL have one Considered Options section, a Confirmation section, option bullets that end with chosen., rejected, because <reason>. or deferred until <condition>., a title of 10 words or fewer, a slug of 60 characters or fewer and a body of 1,000 words or fewer.
Scenario: ADR structure and length limits pass
- WHEN
uv run devops ci test tests/roadmap/test_roadmap_adr.pyruns. - THEN The test exits 0 and reports no structure or length problem for the new record.
Requirement: ADR index and budget pass
The README index SHALL be regenerated from the front matter, and the records in force SHALL fit under the cap that CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENS sets.
Scenario: ADR index and budget pass
- WHEN
uv run devops ci test tests/roadmap/test_roadmap_adr.py tests/roadmap/test_roadmap_alternatives.pyruns. - THEN Pytest exits 0, the index check reports no problem, and the test of
fit_to_budgetreports a token count at or under the cap with no record left out.
Requirement: Pending a person after the merge
The owner SHALL merge the pull request after all checks pass and the review approves.
Scenario: Owner merges the record pull request
- WHEN All required checks pass, the review approves, and the owner reviews the pull request.
- THEN The owner merges the pull request into
main.
Existing Tool Considered
The alternatives check of 2026-11-16 in the issue body gives not-applicable (class docs, no search) and Tool: none found. No open, maintained tool covers this docs-only consolidation. MADR 4 is the record template, but it covers no consolidation check. This change builds no code, so it has no build cost.
Key questions
- Which ADR process rules govern this supersession?: Follow
docs/adr/README.md(docs(adr): add MADR front matter, a Status History and the ADR rules #5225). The new record setssupersedesto ADR 0004 and ADR 0014 and holdsstatus: acceptedwith itsbody-hash. The same pull request setsstatus: supersededandsuperseded-byon both old records and adds a datedSuperseded byline to each Status History. The new record restates each live rule and each rejected option that still holds, because the alternatives check drops a superseded record. It has one Considered Options section and a Confirmation section. Its title has 10 words or fewer, its slug 60 characters or fewer and its body 1,000 words or fewer. The record pull requests merge one at a time. [sources: docs/adr/README.md] - What does owner decision 3 of 2026-11-12 require for the new record?: The owner approved all three GitHub settings on 2026-11-12. The order is: (1) cut the App grant to the 9 permissions that the code asks for. (2) After feat(service): verify GitHub App webhooks with one secret #4417, turn on the App webhook (Issues only) and delete the 7 repository hooks in the same hour. (3) Bind the 3 required checks of the ruleset to the GitHub Actions app. The record states the check binding as a rule in force. It does not claim that the settings are applied, because only a person changes repository settings. (best practice) [sources: AGENTS.md]
- Chosen: State the check binding in the record. Owner decision 3 approves the binding of the 3 required checks, so the record states it as a rule in force.
- Rejected: Write only a revisit line. The owner approved decision 3, so a revisit line would understate the decision.
- Rejected: State all three settings as done. Only a person changes repository settings. The record states the binding, not that the App grant or the webhook change is applied.
- Where does the App-key rule go, and what does it say?: It goes in SECURITY.md as rule 17, after rule 16, which is the last numbered rule. It states that the roadmap App key is never a GitHub Actions secret: it lives in the Kubernetes Secret
devops-cliand in the workstation keyring. It states that the release App key is an environment secret by design: the release job reads it from its environment. The new record links to SECURITY.md and does not copy the rule. (best practice) [sources: SECURITY.md, docs/adr/0004-ci-is-the-authoritative-gate.md]- Chosen: A new numbered rule in SECURITY.md. SECURITY.md holds the security guarantees, and rule 16 is the last numbered rule. The App-key rule is a guarantee of its own.
- Rejected: Add it to rule 1 of SECURITY.md. Rule 1 states zero secret leakage in general. The release environment secret is a deliberate placement that needs its own rule.
- Rejected: Keep it in ADR 0004. ADR 0004 is superseded by this change, and a superseded record is not amended.
- Rejected: Write it in both SECURITY.md and the new record. The App-key rule has one home. The record links to it under More Information.
- Which citations of ADR 0004, ADR 0014 and ADR 0012 must move?: The pull request moves each citation that names ADR 0004 or ADR 0014 in
src/,tests/and.github/to the record in force. It moves the ADR 0012 citation at.github/workflows/fail-to-pass.yml:8to the record in force. The body names 10 citation lines of ADR 0004. The existing citation test at the branch is authoritative for the full set. [sources: .github/workflows/fail-to-pass.yml, docs/adr/README.md] - Which path holds the test to rename, and what does it check?: The test is in
tests/invariants/test_architectural_invariants.py; the body cites line 778. It asserts that no workflow holdsactions: writeand thatci.ymladmitsworkflow_dispatch. The old name says that onlyupdate-prs.ymlholds that permission, and ADR 0004 records that no such workflow exists. The new name istest_no_workflow_holds_actions_write_and_ci_admits_workflow_dispatch. [sources: tests/invariants/test_architectural_invariants.py, docs/adr/0004-ci-is-the-authoritative-gate.md] - Does this issue retire ADR 0012?: No. ADR 0012 is already
status: supersededwithsuperseded-byADR 0013. This pull request carries its live required-checks point in the new merge-gate record and moves the ADR 0012 citation at.github/workflows/fail-to-pass.yml:8to the record in force. The squash settings and the release-please keys go to the release record, another child, and the Pages note goes to Status History. Pure status changes belong to docs(adr): add MADR front matter, a Status History and the ADR rules #5225. (best practice) [sources: docs/adr/README.md, .github/workflows/fail-to-pass.yml]- Chosen: Carry ADR 0012's live required-checks point into the merge-gate record. The required checks are a live point of ADR 0012 that the merge-gate record restates anyway, and no status change is needed.
- Rejected: Retire ADR 0012 in this pull request. ADR 0012 is already superseded by ADR 0013, and pure status changes go in docs(adr): add MADR front matter, a Status History and the ADR rules #5225.
- Rejected: Leave the ADR 0012 citation unchanged. A citation of a superseded record fails the check.
- Does the branch-protection audit replacement go in this pull request?: No. The issue body names it as a separate issue. This item is a docs-only ADR consolidation. The replacement needs code, tests and a read-only GitHub API or OpenTofu path, so it goes to a new issue. (best practice) [sources: AGENTS.md, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md]
- Chosen: Defer the audit replacement to a new issue. The change is code and tests, and it does not fit in the docs-only ADR pull request.
- Rejected: Build the audit replacement in this pull request. One issue delivers one pull request, and this item is the ADR record.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
adr, and .github/labels.yml declares no scope/adr label. Add the label to the file to give the scope to this item.Both are part of the ADR modernization under #5233, but #5225 adds the structural framework (front matter, Status History, rules) while this candidate creates one specific consolidated merge-gate record.devops-cli-service commentedon Nov 12, 2026
adr, and .github/labels.yml declares no scope/adr label. Add the label to the file to give the scope to this item.Both are children of the ADR modernization #5233 and both consolidate superseded records, but item 5235 covers ADR 0001 and 0016 and this item covers ADR 0004 and 0014.devops-cli-service commentedon Nov 16, 2026
Alternatives check: not-applicable
Class: docs. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Owner question: Who merges the merge-gate record pull request? (a person decides)
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 21, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 24, 2026
The owner merges the pull request. Only a person merges pull requests (AGENTS.md).
devops-cli-service commentedon Nov 24, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.