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
The test suite does not enforce the program allowlist that owner decision 4 of 2026-11-12 sets. Live marks outside the allowlist still run, the host skip hides missing programs, the git allowance lets a test start a real git, and the openspec contract cases skip in CI. This item makes collection fail on a live mark outside the allowlist, which is the base-program set beside RUNNER_TOOLS, removes the host skip and the git allowance, moves the openspec cases to the openspec row, corrects the freezegun reason in docs/TESTING.md, and supersedes ADR 0007 with a new tests record whose 47 citations move. The owner merges the pull request.
Acceptance criteria
Requirement: Live marks use the allowlist
Collection MUST fail when a test carries a live mark for a program outside the allowlist.
Scenario: An unlisted live program stops collection
- WHEN A pytester case writes a test that carries
@pytest.mark.live("curl"),curlis not in the allowlist, and the case runsuv run pytest --collect-onlyon that tree. - THEN pytest exits with a collection error that names
curland the test.
Requirement: Allowlist matches the images
The allowlist MUST be the LIVE_ALLOWLIST beside RUNNER_TOOLS, and that set MUST be the base programs that the Dockerfile and the devcontainer image carry.
Scenario: The test-tree check refuses a non-base live program
- WHEN
curlgains an entry inLIVE_ALLOWLIST, anduv run devops ci --check --only test-treeruns. - THEN The
test-treerow fails and namescurlas outside the base programs of the Dockerfile and the devcontainer image.
Requirement: No host skip
The test suite MUST NOT skip a test because the host lacks a live program.
Scenario: A missing allowed program does not skip a test
- WHEN A test carries a live mark for an allowed program that is absent from PATH, and the suite runs.
- THEN The test fails with the missing program, and the run reports no skip for that test.
Requirement: No git allowance
The test suite MUST NOT allow a test to start a real git.
Scenario: A test that starts git is refused
- WHEN A test starts
gitwithout the git fake, anduv run pytest tests/invariants/test_hermetic_floor.pyruns. - THEN The hermetic floor fails the test and names git.
Requirement: Openspec cases run in the openspec row
The openspec row of devops ci MUST run the openspec contract cases.
Scenario: The openspec row runs the contract cases
- WHEN
uv run devops ci --check --only openspecruns. - THEN The row runs
uv run pytest -n 0 tests/openspecand reports its result.
Requirement: Testing document states the freezegun reason
docs/TESTING.md MUST state that freezegun is not used because its frozen monotonic clock hangs asyncio and tenacity, and MUST NOT call it unmaintained.
Scenario: The testing page gives the clock reason
- WHEN
! git grep -n -F 'freezegun is not used: it is unmaintained' docs/TESTING.mdruns, anduv run devops ci docsruns. - THEN The grep exits 0 with no match, and the docs row passes with the statement at
docs/TESTING.md:156giving the frozen monotonic clock reason.
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 link test passes
- WHEN
uv run pytest tests/invariants/test_adr_records.pyruns. - THEN The test passes and the new record names
supersedes: ["0007"]while ADR 0007 namesstatus: supersededandsuperseded-by.
Requirement: Citations move to the record in force
Code, tests and workflows MUST cite the new tests record and MUST NOT cite superseded ADR 0007.
Scenario: The superseded-citation test passes
- WHEN
uv run pytest tests/invariants/test_adr_superseded_citations.pyruns. - THEN The test passes and no citation of ADR 0007 remains in src/, tests/ or .github/.
Requirement: The record budget holds
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 budget test passes and reports the new record under
CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENS.
Requirement: No live mark names a program outside the allowlist
Every @pytest.mark.live in tests/ MUST name a program in the allowlist.
Scenario: The live-mark census finds no unlisted program
- WHEN
uv run pytest tests/roadmap/test_roadmap_runner_tools.pyruns. - THEN The test passes and the live marks name only
sh,bash,git,python,python3,find,sleep,echo,pwd,trueandfalse.
Existing Tool Considered
The alternatives check of 2026-11-16 is not-applicable: class test, no search, no tool found. pytest is the open, maintained tool that covers collection and markers. It lacks the project-specific program allowlist, so the change adds a hook of about 20 lines in tests/conftest.py and a LIVE_ALLOWLIST constant beside RUNNER_TOOLS; no new tool or library is built. The project's RUNNER_TOOLS table remains the one record of each program and its source.
Key questions
- Which programs does the allowlist permit?: Owner decision 4 of 2026-11-12 (fetched 2026-11-17) admits only the programs that the devcontainer, the GitHub runner and the runner image all carry:
sh,bash,git,python,python3, and the base utilitiesfind,sleep,echo,pwd,trueandfalse.curl,jq,ps,kubectl,openspecanddevopsare outside the list; their live marks move to a fake, a contract suite or a CI row. (best practice) [sources: https://github.com/docs(adr): track the ADR modernization #5233, src/devops_cli/roadmap/runner_tools.py:117, src/devops_cli/roadmap/runner_tools.py:124, src/devops_cli/roadmap/runner_tools.py:162]- 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 the runner image holds. It would admit curl, jq and the other tools that the owner decision does not name and keep 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 is it checked against the images?: A
LIVE_ALLOWLISTconstant insrc/devops_cli/roadmap/runner_tools.pyholds the set:sh,bash,git,python,python3,find,sleep,echo,pwd,trueandfalse. It sits besideRUNNER_TOOLS, so the table remains the one record of each program's source. Thetest-treerow checks the set against the table and the Dockerfile, andtests/conftest.pyimports it for the collection hook. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:94, src/devops_cli/roadmap/runner_tools.py:143, tests/roadmap/test_roadmap_runner_tools.py:151, docs/CLUSTER.md:68]- Chosen: A
LIVE_ALLOWLISTbesideRUNNER_TOOLS. It gives one source of truth, and the existing runner-tool tests already compare the table with the Dockerfile. - Rejected: A new
tests/support/live_programs.pyconstant. It duplicatesRUNNER_TOOLSand drifts from the image. - Rejected: Parse the Dockerfile during collection. Collection would read a config file, which docs/TESTING.md forbids; the test-tree row checks the file instead.
- Chosen: A
- How does collection fail on an unlisted live mark?:
pytest_collection_modifyitemsintests/conftest.pyraisespytest.UsageErrorwith each item and its unlisted program. The run stops before any test starts. (best practice) [sources: tests/conftest.py:1261, tests/conftest.py:1286]- Chosen: Raise
pytest.UsageErrorfrompytest_collection_modifyitems. It fails collection with the item 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 does the new tests record change?: The new record supersedes ADR 0007. It restates each rule and each rejected option that still holds, including the enforced allowlist and the removal of the git and host-skip allowances. It sets
supersedes: ["0007"]; ADR 0007 getsstatus: superseded,superseded-byand itsSuperseded byline in the same pull request. (best practice) [sources: docs/adr/README.md:64, docs/adr/README.md:67, docs/adr/0007-tests-double-only-process-edges.md:17]- 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 amending a superseded record, and the body contradicts the code.
- Rejected: Leave ADR 0007 in force. The program allowlist changes the rule that ADR 0007 records.
- Which freezegun reason does docs/TESTING.md state?: The only freezegun statement is
docs/TESTING.md:156, not lines 74, 140 or 150. It must say that freezegun is not used because its frozen monotonic clock hangs asyncio and tenacity. The claim that it is unmaintained is removed: freezegun 1.5.5 is the current release (09 Aug 2025, fetched 2026-11-17). [sources: docs/TESTING.md:156, https://github.com/spulec/freezegun/releases] - How do the openspec contract cases run in the openspec row?: The
openspecCheckSpecinsrc/devops_cli/commands/ci.pyaddsalso_cmds=[['uv', 'run', 'pytest', '-n', '0', 'tests/openspec']], souv run devops ci --check --only openspecruns bothdevops openspec checkand the contract cases. The general test run no longer selectstests/openspec. (best practice) [sources: src/devops_cli/commands/ci.py:991, tests/openspec/test_openspec_tool.py:1, docs/TESTING.md:76]- Chosen: The openspec row runs the 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, and the issue moves them.
- Rejected: Delete the cases. They are contract cases and the issue keeps them.
- Which citations move to the new record?: The 47 lines in
src/,tests/and.github/that cite ADR 0007 move to the new record. Archived changes andCHANGELOG.mdstay as history. The references indocs/TESTING.md,docs/SDLC.mdanddocs/SERVICE_PATTERNS.mdalso point to the new record so no document cites a superseded record. [sources: docs/adr/README.md:70, tests/invariants/test_adr_superseded_citations.py] - What length 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. Designs, tables, caps and measurements go to OpenSpec or docs with a link under More Information. [sources: docs/adr/README.md:75]
- Do the live marks outside the allowlist move in this pull request?: Yes. The
curl,jq,ps,kubectl,openspec,devopsand other non-base marks move to a fake, a contract suite or a CI row in the same pull request. The collection failure cannot land while a mark outside the allowlist remains. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:202, tests/roadmap/test_roadmap_runner_tools.py:151]- Chosen: Move every mark outside the allowlist. Owner decision 4 fails collection on an unlisted mark, so the existing marks must fit the list or move.
- Rejected: Add a ratchet over the 67 marks. A ratchet keeps host-dependent marks; owner decision 4 requires collection to fail.
- Rejected: Grandfather the existing marks. It leaves the program ban unenforced, the finding that the review recorded.
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.