Skip to content

docs(testing): adr 0007 and docs/testing.md say that a test of src starts no program, and real processes stay in the process runner's contract suite #2143

Closed

Description

@dan-petty

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.py and the process-group tests of core/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 ci row.

The allowances that go:

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:

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.txt of 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 ci row. 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 ci passes, 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 the bwrap mark, and @pytest.mark.live as removed allowances.
  • Criterion 2: docs/TESTING.md defines no 'Live test' that runs on a host where a tool happens to be installed.
    Verification: Run rg -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: Run rg -n 'contract suite|real children|process runner' docs/TESTING.md. Confirm the text identifies tests/test_process_contract.py and 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 ci row.
    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: Run rg -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: Run rg -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 ci passes, including the docs rows.
    Verification: Run uv 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 bwrap mark; and the @pytest.mark.live concept. [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 ci row. 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.py and the process-group tests of core/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.

Activity

  1. added
    source/agent
    type/docs
    on Oct 24, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Type: type/docs. The candidate changes documentation about testing rules and decisions.
    • Priority: P2-Medium. The change affects how tests are written and run, which is important for consistency and performance.
    • Value: High. The change improves test reliability and ensures consistent behavior across environments.
    • Effort: Low. The change only updates documentation and does not require code changes.
    • Related: test(ci): the suite's slowest tests run on recorded scanner and installer results, not real semgrep, gitleaks, bandit, uv audit, uv pip sync or sudo #1666, which asks for a different change. 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.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at bb46660 (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    effort/low
    value/high
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Oct 28, 2026
  5. removed
    status/in-review
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumsource/agenttype/docsvalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions