Repository navigation
Description
Problem or Motivation
Child 12 of the ADR modernization (#5233). Decision (owner decision 4). It waits for the owner.
The review of each record that this item changes:
- ADR 0007 (supersede after owner decision 4 (tests record)): The seam and fake rules hold (internal patches fell from 1,925 to 223). The program ban is not enforced: 67 live marks remain, and the openspec contract tests skip in CI. One ratchet over all of tests/ can go in now.
Proposed Solution & Architectural Design
Collection fails on a live mark outside the allowlist, which comes from the Dockerfile and the runner and devcontainer images. Remove the host skip at tests/conftest.py:1212-1250 and the git allowance at :555-556. Move the openspec cases to the openspec row. Fix docs/TESTING.md:74, :140 and :150 (the freezegun reason). A new tests record supersedes 0007, and 47 citation lines move.
Owner decision 4 of 2026-11-12: Option B, an enforced program allowlist. Only the programs that the devcontainer, the runner and the runner image all carry (sh, git, the interpreter, coreutils) are allowed. A mark outside the list fails at collection, and no host skips a test.
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.
The owner merges this pull request.
Target Subsystem
tests/conftest.py, docs/TESTING.md, src/devops_cli/commands/ci.py (the openspec row), docs/adr/.
Existing Tool Considered
pytest collection hooks and the image Dockerfile. No new tool.
Acceptance Criteria
- Collection fails on a live mark outside the allowlist. The allowlist comes from the Dockerfile and the runner and devcontainer images, and a test checks it against the Dockerfile.
- The host skip at
tests/conftest.py:1212-1250and the git allowance at:555-556go. - The openspec contract cases run in the openspec row of
devops ci. -
docs/TESTING.md:74,:140and:150(the freezegun reason) are correct. - A new tests record supersedes ADR 0007, and the 47 citation lines move.
- 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
- feat(release): arm auto-merge for the release PR and record the decision #5249
- test: ratchet internal patches and private imports in tests/ #5248
Owner decision 4 of 2026-11-12 is made. The ratchet item sets the ceilings that this item keeps.
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: test, no search.
Tool: none found.
Proposed design
Problem statement
Make collection fail on a live mark outside the program allowlist, and supersede ADR 0007 with a new tests record. The suite does not enforce the allowlist now. A live mark outside the list still runs. The host skip hides a missing program, and the git allowance lets a test start a real git. The openspec contract cases skip in CI. This change adds LIVE_ALLOWLIST, removes the two allowances, moves the openspec cases to the openspec row, and corrects the freezegun reason. The owner merges the pull request alone, in the planned record order.
Acceptance criteria
Requirement: Unlisted live program fails collection
Collection MUST fail with a usage error when a test carries a live mark for a program outside LIVE_ALLOWLIST.
Scenario: An unlisted live program stops collection
- WHEN A case in
tests/roadmap/test_live_allowlist.pycallscheck_live_markswith an item that carriespytest.mark.live("curl"). - THEN The call raises
pytest.UsageErrorthat namescurland the test id, anduv run pytest tests/roadmap/test_live_allowlist.pypasses.
Requirement: Allowlist holds only base programs
LIVE_ALLOWLIST MUST hold only the base programs that RUNNER_TOOLS records for the Dockerfile and the devcontainer image.
Scenario: The allowlist matches the runner tools table
- WHEN
uv run pytest tests/roadmap/test_roadmap_runner_tools.pyruns. - THEN The test passes and each entry of
LIVE_ALLOWLISTis a base program ofRUNNER_TOOLS.
Requirement: Suite collects with no unlisted mark
The whole test suite MUST collect with no live mark for a program outside LIVE_ALLOWLIST.
Scenario: The suite collects cleanly
- WHEN
uv run pytest --collect-only -qruns at the repository root. - THEN The command exits 0 and its output names no unlisted live program.
Requirement: No host skip
Collection MUST fail, and MUST NOT skip, when a live mark names an allowed program that PATH does not hold.
Scenario: An absent allowed program fails collection
- WHEN A case calls
check_live_markswith an item that carriespytest.mark.live("sh")and awhichfunction that returnsNoneforsh. - THEN The call raises
pytest.UsageErrorthat namessh, and the run reports no skip.
Requirement: No git allowance
The test suite MUST refuse a test that starts a real git.
Scenario: The hermetic floor refuses git
- WHEN A case calls the hermetic floor's process guard with a command that starts
git, and no git fake is in place. - THEN The guard refuses the command and names
git.
Requirement: Openspec cases run in the openspec row
The openspec row of devops ci MUST run the openspec contract test cases.
Scenario: The openspec row runs the contract cases
- WHEN
uv run devops ci --check --only openspecruns. - THEN The row runs the openspec contract test suite and reports its result, and no contract case is skipped.
Requirement: Testing page gives the freezegun reason
docs/TESTING.md MUST give the frozen monotonic clock as the reason that the project does not use freezegun, and MUST NOT call freezegun unmaintained.
Scenario: The testing page gives the clock reason
- WHEN
! git grep -n -F 'unmaintained' docs/TESTING.mdandgit grep -n -F 'monotonic' docs/TESTING.mdrun. - THEN The first command exits 0 with no match, and the second command exits 0 with the freezegun statement.
Requirement: New tests record supersedes ADR 0007
A new tests record MUST supersede ADR 0007, and both records MUST link to each other.
Scenario: The ADR record test and the index check pass
- WHEN
uv run pytest tests/invariants/test_adr_records.pyanduv run devops docs checkrun. - THEN Both commands pass, the new record names
supersedes: ["0007"], and ADR 0007 namesstatus: supersededandsuperseded-by.
Requirement: Citations cite the record in force
Code, tests and workflows MUST cite the new tests record and MUST NOT cite superseded ADR 0007.
Scenario: No citation of ADR 0007 remains
- WHEN
! git grep -n -E 'ADR 0007|0007-tests-double-only-process-edges' src tests .githubruns. - THEN The command exits 0 with no match, and
uv run pytest tests/invariants/test_adr_records.pypasses.
Requirement: The record fits the budget
The new tests record MUST fit in the tokens that ADR 0007 frees under the #5049 budget test.
Scenario: The ADR budget test passes
- WHEN
uv run pytest tests/roadmap/test_roadmap_alternatives.pyruns. - THEN The test passes and the new record stays under
CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENS.
Requirement: Pending a person after the merge
The owner MUST merge the pull request alone, in the planned record order, before the change reaches main.
Scenario: The owner merges the record pull request
- WHEN The checks pass and the pull request is ready.
- THEN The owner merges the pull request, and no agent merges it.
Existing Tool Considered
The alternatives check of 2026-11-16 in the issue body gives not-applicable: class test, no search, and no tool found. pytest is the open, maintained tool that covers collection and markers. It lacks a program allowlist, so the change adds check_live_marks of about 25 lines in tests/support/live_marks.py and one constant in src/devops_cli/roadmap/runner_tools.py. The cost is about 4,000 tokens to build that code, about 1,000 tokens a year to keep and fix it, and under one day of work. The change builds no new tool or library.
Key questions
- Which programs does
LIVE_ALLOWLISThold?: Owner decision 4 of 2026-11-12 admits only the programs that the devcontainer, the runner and the runner image all carry:sh,bash,git,python,python3,find,sleep,echo,pwd,trueandfalse.curl,jq,ps,kubectl,openspecanddevopsare outside the list. A live mark for one of them moves to a fake, a contract suite or a CI row. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:119, docs/adr/0007-tests-double-only-process-edges.md]- Chosen: Only the base programs of the three images. Owner decision 4 names sh, git, the interpreter and coreutils, and
RUNNER_TOOLSrecords those base entries with their source. - Rejected: Every program of the runner image. It admits curl, jq and the other tools that the owner decision does not name, and it keeps host-dependent live marks.
- Rejected: Every program on the host PATH. It is the host-dependent behavior that owner decision 4 removes.
- Chosen: Only the base programs of the three images. Owner decision 4 names sh, git, the interpreter and coreutils, and
- Where does the allowlist live, and how does a test check it against the images?: A
LIVE_ALLOWLISTconstant insrc/devops_cli/roadmap/runner_tools.pysits besideRUNNER_TOOLS, so the table stays the one record of each program and its source.tests/roadmap/test_roadmap_runner_tools.pychecks the set against the table and the Dockerfile.tests/support/live_marks.pyimports the set for the collection check. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:119, tests/roadmap/test_roadmap_runner_tools.py, tests/support/markdown_examples.py]- Chosen: A
LIVE_ALLOWLISTbesideRUNNER_TOOLS. It gives one source of truth, and the runner-tool test already compares the table with the Dockerfile. - Rejected: A new constant file under
tests/support/. It duplicatesRUNNER_TOOLSand drifts from the image. - Rejected: Read the Dockerfile during collection. Collection would read a config file, and the runner-tool test checks the file instead.
- Chosen: A
- How does collection fail on an unlisted live mark?:
check_live_marksintests/support/live_marks.pyraisespytest.UsageErrorwith each test id and its program.pytest_collection_modifyitemsintests/conftest.pycalls it, so the run stops before any test starts. (best practice) [sources: tests/conftest.py]- Chosen: Raise
pytest.UsageErrorfrom the collection hook. It stops collection and names the test and the program. - Rejected: Skip the test at run time. Owner decision 4 removes host skips.
- Rejected: Warn and continue. The issue requires collection to fail.
- Chosen: Raise
- What do the host skip and the git allowance do?: The body names the host skip at
tests/conftest.py:1212-1250and the git allowance attests/conftest.py:555-556. The host skip hides a live program that the host lacks. The git allowance lets a test start a real git beside the hermetic floor. The change removes both. [sources: tests/conftest.py] - What does the new tests record change?: The new record supersedes ADR 0007 and restates each rule and each rejected option that still holds. It sets
supersedes: ["0007"]. The same pull request setsstatus: supersededandsuperseded-byon ADR 0007, and adds itsSuperseded byline. (best practice) [sources: docs/adr/README.md, docs/adr/0007-tests-double-only-process-edges.md]- Chosen: Supersede ADR 0007 with a new record. The body contradicts the code, and the ADR process says the next change is a supersession.
- Rejected: Amend ADR 0007. The ADR process forbids an amendment of a superseded record.
- Rejected: Leave ADR 0007 in force. The program allowlist changes the rule that ADR 0007 records.
- Which reason does
docs/TESTING.mdgive for freezegun?: The page gives the frozen monotonic clock as the reason: it hangs asyncio and tenacity. The page does not call freezegun unmaintained. [sources: docs/TESTING.md] - How do the openspec contract cases run in the openspec row?: The
openspecCheckSpecinsrc/devops_cli/commands/ci.pygains the contract test command as an extra command of the row.uv run devops ci --check --only openspecthen runsdevops openspec checkand the contract cases. (best practice) [sources: src/devops_cli/commands/ci.py:172]- Chosen: The openspec row runs the contract cases. The issue moves the cases to the row, and CI then runs them.
- Rejected: Keep the cases in the general test run. They skip in CI there.
- Rejected: Delete the contract cases. The issue keeps them.
- Do the live marks outside the allowlist move in this pull request?: Yes. Each mark for a program outside the list moves to a fake, a contract suite or a CI row in the same pull request. Collection cannot fail on an unlisted mark while one remains. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:119, tests/conftest.py]
- Chosen: Move every mark outside the allowlist. Owner decision 4 fails collection on an unlisted mark, so each existing mark must fit the list or move.
- Rejected: Add a ratchet over the marks. A ratchet keeps host-dependent marks, and owner decision 4 requires collection to fail.
- Rejected: Grandfather the existing marks. It leaves the program ban unenforced, the finding that the review recorded.
- Which citations move to the new record?: The citations in
src/,tests/and.github/move to the new record. The archived OpenSpec changes andCHANGELOG.mdkeep their citations as history. The pages that name ADR 0007 also point to the new record. [sources: docs/adr/README.md] - What limits does the new tests record keep?: The body has 1,000 words or fewer, the title has 10 words or fewer, and the slug has 60 characters or fewer. The record must also fit in the tokens that ADR 0007 frees under
CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENS. [sources: docs/adr/README.md, src/devops_cli/config/constants.py:3896]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Both reference ADR 0007 and the program ban in tests, but #2143 documents the rule while the candidate enforces it via collection failure and supersedes the record.devops-cli-service commentedon Nov 16, 2026
Alternatives check: not-applicable
Class: test. 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
Refine cannot set this item to Ready at 7a05312 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 27, 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.