Repository navigation
Description
Problem
The owner decided on 2026-10-24 that a test of the owner's src/ code starts no system program and does not read the host. Every test must run the same in the devcontainer and on a stock GitHub runner, with no install and no host change on the runner.
ADR 0007 and docs/TESTING.md still allow real programs in tests. So agents keep writing tests that start git, bwrap, kubectl, ruff, ast-grep, python and sh. The test-suite audit of 2026-10-24 at df8e2ee found that about 1,030 of 10,597 test items (9.7%) start a real program, and that they hold about 34% of the summed test time. The bwrap tests run in the devcontainer and skip on the runner, so the two places do not run the same suite.
Proposed solution
Amend ADR 0007 and docs/TESTING.md, and change no code in this pull request:
- A test of
src/starts no program. Every program is an edge, and the test reaches it through its fake. - Real child processes stay only in the contract suite of the process runner (
tests/test_process_contract.pyand the process-group tests ofcore/process.py), because process groups and signals need real children. - Every other real tool goes to one of two places: a contract suite that replays recorded transcripts of the tool, or a row of
devops ci. - A check of committed files or of tool configuration is a row of
devops ci, not a pytest test. - The bwrap cases are an opt-in contract suite that a person runs in the devcontainer. CI does not run them, and a default test run does not either.
- A skip that depends on the host goes. A test that cannot run the same on every host is a contract case or a
devops cirow.
The allowances that go:
- git runs for real in temporary repositories (ADR 0007, Consequences; TESTING.md, "Real").
- kubectl's offline renderers,
kubectl kustomizeandkubectl patch --local, run for real (added by perf(ci): the gate finishes in 2 minutes and pull-request CI in 3, with no test over 5 seconds and none touching the network, real tools or localhost services #1725). - bwrap runs for real in a test with the
bwrapmark, skipped only where bwrap is missing. @pytest.mark.live: a test runs a named local tool and skips where it is missing (TESTING.md, "Live test").
The follow-up issues of the same audit migrate the suite to this rule, one part each. The section "Migration" lists them.
Migration
The follow-up issues of the 2026-10-24 audit, one pull request each:
- test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146: one git seam, with a fake that answers from recorded transcripts and a contract suite that replays them.
- test(core): the data directory, run store and gitignore tests start no git and reach git through the git fake #2174, test(roadmap): the roadmap refine, run and intake tests start no git and reach git through the git fake #2178, test(ci): the devops ci, devops test and fail-to-pass tests start no git and reach git through the git fake #2179, test(review): the review tests start no git and reach git through the git fake #2180, test(security): the analyze, ai tooling and security scanner tests start no git and reach git through the git fake #2181, test(k8s): Use the git fake in k8s and argo cd gate tests #2182 and test(repos): the repos, branches, github, ssh, devcontainer, tf and openspec tests start no git and reach git through the git fake #2183: the tests of each package stop starting git and use the fake of test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146.
- test(sandbox): the host sandbox and the sandbox tool executor are tested through the process fake on every runner, src detects no mock, and the real bwrap cases are an opt-in contract suite #2149: the host sandbox and the sandbox tool executor run on the process fake, and the bwrap cases become the opt-in suite.
- ci(gate): checks of committed files and tool configuration run as devops ci rows, not as pytest tests that start the tool #2164: the checks of committed files and tool configuration become
devops cirows. - test(floor): every test sees the same tokenizer cache, mounts, process table, PATH and programs on every host, and no skip depends on the host #2165: the floor hides host state, and no skip depends on the host.
- test(cli): live marks sit on the tests that start a program, not on whole modules #2170: each
livemark sits on the tests that start the program. - test(cli): migrate 49 tests to public interfaces #2167: the test files that no child of test(cli): tests double only process edges and mirror the source tree #1307 names move to the shared fakes.
- test(cli): test modules repeat no floor reset, define each shared fixture once, and hold no tests of test helpers #2173: the tests of test helpers go.
- test(k8s): devops k8s commands are thin adapters tested over edge fakes, and the _K8sModule patch forwarding is gone #1323 (reopened): the
devops k8scommand tests.
Existing tool considered
pytest, its markers and the existing shared fakes cover the need. This item is a decision record and a document change, so it builds nothing.
Evidence
docs/adr/0007-tests-double-only-process-edges.md, "Consequences": git and bwrap run for real; kubectl's offline renderers run for real.docs/TESTING.md, sections "Test doubles" (Edge, Live test) and "Doubles" (Faked edges, Real)..data/agent/scratch/audit/full_list.txtof the 2026-10-24 audit, class 1 and the cost summary.
Acceptance criteria
- ADR 0007 records the decision of 2026-10-24, with the date, and says which earlier allowances it removes.
- docs/TESTING.md defines no "Live test" that runs on a host where a tool happens to be installed. The "Real" list holds no program. The process runner's contract suite is the one place that starts real children.
- docs/TESTING.md says where each other real tool goes: a recorded contract suite or a
devops cirow. It names the bwrap suite as opt-in. - AGENTS.md, CONTRIBUTING.md and the knowledge base hold no sentence that this change makes wrong (
rg -n "run for real|live test|bwrap mark" AGENTS.md CONTRIBUTING.md docs src/devops_cli/ai/knowledge_base). - The text is in ASD-STE100.
-
uv run devops cipasses, the docs rows included.
Related: #1307 (the parent of the test migration), #1336 (the ratchets become bans).
Proposed design
Problem statement
ADR 0007 and docs/TESTING.md still allow tests to start real programs and to skip based on host state. The owner decided on 2026-10-24 that a test of src/ starts no system program and does not read the host. This item amends both documents to record that decision. It names the process runner's contract suite as the one place that starts real children. It states where each other real tool goes. It changes no code.
Acceptance criteria
- Criterion 1: ADR 0007 records the decision of 2026-10-24 with the date and names each earlier allowance it removes.
Verification: Read the amended ADR 0007. Confirm it states the date 2026-10-24 and lists git in temporary repositories, kubectl offline renderers, bwrap with thebwrapmark, and@pytest.mark.liveas removed allowances. - Criterion 2: docs/TESTING.md defines no 'Live test' that runs on a host where a tool happens to be installed.
Verification: Runrg -n 'live test|Live test' docs/TESTING.md. Confirm no definition remains that ties execution to host tool availability. - Criterion 3: The 'Real' list in docs/TESTING.md holds no program.
Verification: Read the 'Real' bullet in docs/TESTING.md. Confirm it names no program such as git, bwrap, or kubectl. - Criterion 4: docs/TESTING.md names the process runner's contract suite as the one place that starts real children.
Verification: Runrg -n 'contract suite|real children|process runner' docs/TESTING.md. Confirm the text identifiestests/test_process_contract.pyand the process-group tests as the sole location of real children. - Criterion 5: docs/TESTING.md states where each other real tool goes: a recorded contract suite or a
devops cirow.
Verification: Read the relevant sections of docs/TESTING.md. Confirm each tool (git, kubectl offline renderers, bwrap) has a named destination. - Criterion 6: docs/TESTING.md names the bwrap suite as opt-in, run by a person in the devcontainer.
Verification: Runrg -n 'bwrap|opt-in' docs/TESTING.md. Confirm the text states CI does not run the bwrap suite and a person runs it in the devcontainer. - Criterion 7: AGENTS.md, CONTRIBUTING.md and the knowledge base hold no sentence that this change makes wrong.
Verification: Runrg -n 'run for real|live test|bwrap mark' AGENTS.md CONTRIBUTING.md docs src/devops_cli/ai/knowledge_base. Confirm no match remains that contradicts the amended rule. - Criterion 8: The text of the amended documents is in ASD-STE100.
Verification: Read the changed sections. Confirm one instruction per sentence, active voice, simple tenses, no contractions, and at most 25 words per description sentence. - Criterion 9:
uv run devops cipasses, including the docs rows.
Verification: Runuv run devops ci. Confirm exit code 0 and no failure in the docs check.
Key questions
- What does the owner's decision of 2026-10-24 state?: A test of
src/starts no system program and does not read the host. Every test runs the same in the devcontainer and on a stock GitHub runner, with no install and no host change. (proposed) - Which earlier allowances does the decision remove?: git runs for real in temporary repositories; kubectl's offline renderers run for real; bwrap runs for real with the
bwrapmark; and the@pytest.mark.liveconcept. [sources: docs/adr/0007-tests-double-only-process-edges.md, docs/TESTING.md] - Where does each real tool go after the decision?: The process runner's contract suite keeps real children. Every other real tool goes to a recorded contract suite or a
devops cirow. The bwrap cases become an opt-in contract suite a person runs in the devcontainer. (proposed) - Does this item change any code?: No. It is a decision record and a document change. The follow-up issues migrate the suite. (proposed)
- What is the process runner's contract suite?:
tests/test_process_contract.pyand the process-group tests ofcore/process.py. Process groups and signals need real children, so this suite is the one place that starts them. [sources: tests/test_process_contract.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 24, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The candidate changes documentation about testing rules and decisions.The change affects how tests are written and run, which is important for consistency and performance.The change improves test reliability and ensures consistent behavior across environments.The change only updates documentation and does not require code changes.Both items deal with tests that start real programs, but the candidate enforces a rule that no src test starts a program while item 1666 focuses on slowest tests running external tools.dan-petty commentedon Oct 28, 2026
Status set to Ready at bb46660 (see proposed design in issue body).
docs(openspec): plan #2167 migrate 49 tests to public interfaces (#2982)
ci(gate): run the checks of committed files as devops ci rows (#3557)