Repository navigation
Description
Problem
Phase E migration of the foundation packages: core/, config/, git/, dry_run/ and http/, the root modules main.py and entry.py, and exceptions/, lang/ and models/. This item owns the 36 test files named below, by today's flat names (7,732 lines, 366 tests) [measured: AST pass at 5c45b1e]. #1313 places most of them under those mirror directories; a file named here belongs to this item wherever #1313 places it.
- core:
test_audit_{logger,stream}.py,test_command_decorator.py,test_consolidation_{binaries,cli_errors,core_paths,process_json,serialization}.py,test_coverage_index.py,test_data_dir_worktrees.py,test_gitignore_evaluation.py,test_process.py,test_process_pipeline.py,test_subprocess_env_boundary.py,test_template_rendering.py,test_validation.py,test_workspace_cleanup.py. - config:
test_command_builders.py,test_config_{settings_cache,env_overrides}.py,test_data_dir_configuration.py,test_headless_auth.py,test_metadata.py,test_ai_task_settings_paths.py. - git:
test_git_{operations,worktree}.py. - dry_run and root modules:
test_consolidation_dry_run_decorator.py,test_fast_dispatch.py,test_main_dry_run.py. - http:
test_http.py,test_http_async_client.py,test_http_broker.py.test_http_connection_pool.pyreferencesk8s/most and is test(k8s): k8s/ is tested through its public interface over the Kubernetes API, process, HTTP and keyring fakes, with no internal patches or private imports #1322's, which proposes moving itshttp/pool.pycases totests/http/. - exceptions, lang and models:
test_exceptions.py,test_language_catalogs.py,test_resource_schemas.py,test_prometheus_models.py.
The evidence:
- Tests patch internals. 60 of the 107 patch sites target a devops_cli name, in 17 files, and the files import 32 private names [measured: census AST pass, files unchanged at 5c45b1e].
- Process and git:
run_subprocess20, 12 of them ingit.operations;git.operations._ensure_known_host3. - Config and the GitHub token= 7;
core.process._github_tokenand_github_lookup_failure6. - Entry and dry-run:
main._delegateandmain.app9;render_dry_run_result4. test_headless_auth.pyimports the private_keyring_getand_keyring_setto reach the keyring fallback.- At the edges:
subprocess.run13,socket.getaddrinfo13 (11 hand-built tuples intest_validation.py), GitPython'sRepo8.
- Process and git:
- Accommodations.
run_subprocess_asyncreroutes to the sync path wheneversubprocess.runis not the stdlib function [code: core/process.py:545].- The child-process environment allow-list passes
PYTEST_CURRENT_TESTthrough [code: core/process.py:93]. - The settings cache is keyed on
CONFIG_PATHbecause "tests rebind it" [code: config/settings.py:928, :983-984]. Ten test sites in six files rebind it, and so does the floor [code: tests/conftest.py:473], whose patch fix(ci): tests touch no state outside their temporary directories #1311 removes. Three of the ten sites are outside this item:test_config_cmd.py:147,test_review_untrusted_tree.py:83andtest_telemetry_collector_export.py:88. get_repo_origin_name.cache_clearis attached by hand [code: core/repo.py:466].
- The conftest patches core privates. These count toward the ratchet (Q15):
CONST_USER_DATA_ROOT[code: tests/conftest.py:308], because home-relative locations are fixed at import [code: config/constants.py:15-16, :21; config/defaults.py:55-56]. fix(ci): tests touch no state outside their temporary directories #1311 drops this patch and leaves call-time resolution to this item;_own_source_dir[code: tests/conftest.py:321];_github_tokenand_github_lookup_failure[code: tests/conftest.py:357-358], and_github_tokenand_lookup_github_tokeninfail_the_github_lookup[code: tests/conftest.py:369-370], which test(cli): tests find the repository root and fixtures from any depth, import no other test module and build test data with shared builders, and devops test maps a change to its mirror directory #1312 moves totests/support/.
- Dead code.
core/process_pipeline.py(143 lines) has no product caller. Only the lazy export [code: core/init.py:42-43, :62-63] andtests/test_process_pipeline.pyreach it. - Git is mocked although Q23 makes it real. Its tests patch
git.operations.run_subprocess(12) and GitPython'sRepo(8)._ensure_known_hostwrites under the home's.ssh[code: git/operations.py:139]. - HTTP and DNS.
http/holds the three parallel seams refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 replaces [code: http/client.py:55; http/pool.py:63; http/broker.py:186]. DNS goes through the private_resolve_host_ips[code: core/validation.py:192]. refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 movestest_http_broker.pyoffstub_webonto its HTTP fixture. - Shape.
test_data_dir_worktrees.pyis 1,216 lines.- Catch-alls:
test_validation_edge_cases[code: tests/test_validation.py:223],test_git_operations_edge_cases[code: tests/test_git_operations.py:253],test_main_helpers_and_entrypoint[code: tests/test_fast_dispatch.py:113]. - The network-guard cases in
test_validation.py(:368-454,:695) test the hermetic floor. - Six files are named after a consolidation refactor.
Acceptance criteria
Doubles only at edges
- No test of this item patches a devops_cli name or imports a private one. Today that is 60 sites and 32 imports.
- git and GitPython run for real in temporary repositories (conftest's
gitfixture).ssh-keyscanand other processes answer through refactor(cli): one process runner owns execution, process groups and dry-run #775's process fake, and theknown_hostsfile_ensure_known_hostwrites is undertmp_path. - The GitHub token lookup is tested through refactor(cli): one process runner owns execution, process groups and dry-run #775's fake answering
gh auth token. No test or fixture assigns_github_token. - DNS answers come from refactor(cli): Unify HTTP and DNS seams with shared fakes #1314's DNS fake, and the hand-built
getaddrinfotuples go.http/tests run against refactor(cli): Unify HTTP and DNS seams with shared fakes #1314's seam and HTTP fake. - Keyring reads and writes in
config/tests go through refactor(security): one keyring seam owns the keyring and the Secret Service lock check, with a shared keyring fake and its contract suite #1318's keyring fake, including the headless fallback. - The runner's span checks, among them the command-line masking check that patches
core.process.trace_span[code: tests/test_process.py:139], read the exported spans from refactor(telemetry): OTLP export goes through one exporter seam, and tests read exported spans and metrics from a shared fake #1319's OTLP fake, opted into per test (Q28).
Accommodations and hooks (Q15, Q27)
- The async reroute at
core/process.py:545is gone. refactor(cli): one process runner owns execution, process groups and dry-run #775's single sync and async runner, which lands first, should leave none; if one remains, this item deletes it. - The
PYTEST_CURRENT_TESTpass-through (core/process.py:93) goes in the same PR as the last reader of that variable,commands/ci.py:253and:257, which test(ci): devops ci, test, devcontainer, workspace, install-tools, uv, branches and pipeline are tested over edge fakes, with no lazy patch targets or PYTEST_CURRENT_TEST checks #1325 deletes. If test(ci): devops ci, test, devcontainer, workspace, install-tools, uv, branches and pipeline are tested over edge fakes, with no lazy patch targets or PYTEST_CURRENT_TEST checks #1325 has landed, this PR deletescore/process.py:93, andrg -n PYTEST_CURRENT_TEST src/prints nothing afterwards. If not, test(ci): devops ci, test, devcontainer, workspace, install-tools, uv, branches and pipeline are tested over edge fakes, with no lazy patch targets or PYTEST_CURRENT_TEST checks #1325's PR deletes it, under the same criterion in test(ci): devops ci, test, devcontainer, workspace, install-tools, uv, branches and pipeline are tested over edge fakes, with no lazy patch targets or PYTEST_CURRENT_TEST checks #1325. - The settings cache no longer keys on
CONFIG_PATH. No test rebindsCONFIG_PATH: every site uses test(cli): the hermetic floor fails a test that reaches an edge without a fake and resets all process-wide state after every test #1310'sconfigfixture (Q16), including the three outside this item. - Home-relative locations resolve when read, from the environment the floor sets (fix(ci): tests touch no state outside their temporary directories #1311's per-worker home and user data root). Conftest no longer patches
_own_source_diror the GitHub token privates. - The hand-attached
cache_clear(core/repo.py:466) gives way to a public reset of the origin cache, which the floor calls.
Dead code (Q25)
- These are deleted:
core/process_pipeline.py;- its lazy exports;
tests/test_process_pipeline.py.
Behaviour files and names
- One file per behaviour, named after it (Q8, Q10). The catch-alls dissolve, and the consolidation-named files,
test_fast_dispatch.pyandtest_main_dry_run.pyare renamed after their behaviour. -
test_data_dir_worktrees.pysplits by behaviour. - The network-guard cases leave
test_validation.pyand join test(cli): the hermetic floor fails a test that reaches an edge without a fake and resets all process-wide state after every test #1310's tests of the floor intests/invariants/test_hermetic_floor.py, the floor's file in test(cli): Convert ratchets to bans and merge invariant tests #1336's mapping. - Dry-run plan rendering (
render_request_plan,render_dry_run_result) is a syrupy snapshot (Q18). - URL and service-URL validation and gitignore evaluation get Hypothesis property tests (Q21).
- The two module-level
CliRunner()s give way to test(cli): the hermetic floor fails a test that reaches an edge without a fake and resets all process-wide state after every test #1310'sclifixture (Q14), and the five redundant@pytest.mark.asynciomarkers go.
Ratchets and coverage
- If test(cli): ratchets hold internal patches, private imports and test accommodations in src at today's counts and name each site that would raise one #1309 has landed, its ceilings drop by this item's removals, and the PR body states the counts before and after.
- If test(cli): the hermetic floor fails a test that reaches an edge without a fake and resets all process-wide state after every test #1310 added its interim
unreachable(...)marker, none remains in this item's files. A test that relied on the refusal installs the edge's fake in its refusing state. - Unreachable lines are deleted (Q22). Coverage stays at or above 90%.
-
uv run devops cipasses.
Key questions
- Does git get a fake? Decided 2026-10-07: no. git runs real in temporary repositories, and every other process is faked (Q23).
- May this item change tests outside its files? Decided 2026-10-07: yes, where its accommodations are deleted. The item that owns an accommodation deletes it (Q27), so a test that still rebinds
CONFIG_PATHmoves to theconfigfixture in the same PR. - Who owns
main.py,entry.py,exceptions/,lang/andmodels/? (proposed) This item. No other item owns them. The 4 test files ofexceptions/,lang/andmodels/have no patch site. - Overlap with refactor(cli): one process runner owns execution, process groups and dry-run #775? (proposed) refactor(cli): one process runner owns execution, process groups and dry-run #775 owns the runner's behaviour: the sync and async merge, process groups and dry-run. This item moves the tests of
core/onto refactor(cli): one process runner owns execution, process groups and dry-run #775's fake and removes whatever accommodation is left. - Why does this item wait for fix(ci): tests touch no state outside their temporary directories #1311? (proposed) fix(ci): tests touch no state outside their temporary directories #1311 gives each worker its own home and removes the floor's
CONFIG_PATHandCONST_USER_DATA_ROOTpatches. Until then the cache key and the import-time home paths still serve the floor, so this item cannot remove them. - Which files? Decided 2026-10-07: each file goes to the package owning most of what it tests (Q17). Every test file is named in exactly one child's list, so the list above is this item's share wherever test(cli): every test file sits in the directory mirroring the package it tests or in tests/invariants/, and the root conftest holds only the hermetic floor #1313 places a file.
Strategic alignment
- Depends on: fix(ci): tests touch no state outside their temporary directories #1311, test(cli): every test file sits in the directory mirroring the package it tests or in tests/invariants/, and the root conftest holds only the hermetic floor #1313, refactor(cli): one process runner owns execution, process groups and dry-run #775, refactor(cli): Unify HTTP and DNS seams with shared fakes #1314, refactor(security): one keyring seam owns the keyring and the Secret Service lock check, with a shared keyring fake and its contract suite #1318, refactor(telemetry): OTLP export goes through one exporter seam, and tests read exported spans and metrics from a shared fake #1319. Blocks: test(cli): Convert ratchets to bans and merge invariant tests #1336. Related: test(cli): ratchets hold internal patches, private imports and test accommodations in src at today's counts and name each site that would raise one #1309 (ratchets), test(cli): the hermetic floor fails a test that reaches an edge without a fake and resets all process-wide state after every test #1310 (config fixture, resets), test(ci): devops ci, test, devcontainer, workspace, install-tools, uv, branches and pipeline are tested over edge fakes, with no lazy patch targets or PYTEST_CURRENT_TEST checks #1325 (
PYTEST_CURRENT_TESTreaders), test(k8s): k8s/ is tested through its public interface over the Kubernetes API, process, HTTP and keyring fakes, with no internal patches or private imports #1322 (test_http_connection_pool.py), test(github): github/ is tested through its public interface over the gh process and session fakes, with no internal patches or private imports #1321 (test_github_session.pyalso sets_github_token), feat(cli): reachable--dry-runpreviews for delegated commands #412 (dry-run previews), feat(cli): structured fuzzing of parsers and schema boundaries #416 (parser fuzzing). - Parent: test(cli): tests double only process edges and mirror the source tree #1307 (phase E).
- Evidence tags are explained in test(cli): tests double only process edges and mirror the source tree #1307. Here [code: path:line] lines are at 5c45b1e, the release/v0.2.28 head, and the per-item counts were recounted there.
Update 2026-10-08: refinement
tests/test_http_egress.py (#898) joins this item. Its DNS answers come from #1314's DNS fake, and since VettingBackend takes an inner backend (http/egress.py:159, :200), backend tests pass a recorder instead of patching httpcore2.
Alternatives check of 2026-11-01: not-applicable.
Tool: none found.
Proposed design
Problem statement
This item migrates 36 foundation test files to edge fakes. Git commands answer through git_fake, and no test starts real git or imports GitPython. The item removes product-code accommodations that exist only for tests, deletes dead code, and reorganizes test files by behaviour.
Acceptance criteria
Requirement: No internal patches or private imports
No test of this item SHALL patch a devops_cli name or import a private name.
Scenario: Search for internal patches and private imports
- WHEN A search for monkeypatch.setattr on devops_cli names and for from devops_cli import _ runs over this item's test files.
- THEN The search output is empty.
Requirement: Git commands use the git fake
Git commands in this item's tests SHALL answer through the git_fake fixture, and no test SHALL start real git or import GitPython.
Scenario: Git test files run with git_fake
- WHEN The git test files run with the git_fake fixture.
- THEN No test starts real git or imports GitPython, and no test patches git.operations.run_subprocess or GitPython Repo.
Requirement: Known hosts path stays under tmp_path
The known_hosts file that _ensure_known_host writes SHALL be under tmp_path.
Scenario: Known hosts test writes under tmp_path
- WHEN The test of _ensure_known_host runs.
- THEN The known_hosts file is under tmp_path.
Requirement: GitHub token lookup uses the process fake
The GitHub token lookup SHALL be tested through the process fake answering gh auth token, and no test or fixture SHALL assign _github_token.
Scenario: Token lookup test uses process fake
- WHEN A test exercises the GitHub token lookup path.
- THEN The fake answers gh auth token and no test or fixture assigns _github_token.
Requirement: DNS answers use the DNS fake
DNS answers SHALL come from the DnsFake, and hand-built getaddrinfo tuples SHALL be removed.
Scenario: DNS test uses DnsFake
- WHEN A test exercises a DNS resolution path.
- THEN The answer comes from DnsFake and no hand-built getaddrinfo tuple remains.
Requirement: HTTP tests use the HTTP fake
HTTP tests SHALL run against the WebFake seam, including test_http_egress.
Scenario: HTTP test uses WebFake
- WHEN An HTTP test runs.
- THEN The request goes through WebFake and no test patches a devops_cli HTTP name.
Requirement: Keyring uses the keyring fake
Keyring reads and writes in config tests SHALL go through FakeKeyring, including the headless fallback.
Scenario: Keyring test uses FakeKeyring
- WHEN A config test exercises a keyring read or write.
- THEN The operation goes through FakeKeyring and no test patches _keyring_get or _keyring_set.
Requirement: Spans come from the OTLP fake
Runner span checks SHALL read exported spans from the OTLP fake, opted into per test.
Scenario: Span test reads from OTLP fake
- WHEN A test checks runner spans, including the command-line masking check.
- THEN The spans are read from the OTLP fake and no test patches core.process.trace_span.
Requirement: Async reroute removed
The async reroute at core/process.py:545 SHALL be removed.
Scenario: Reroute condition is absent
- WHEN core/process.py is read after the change.
- THEN The reroute condition that checks whether subprocess.run is not the stdlib function is gone.
Requirement: PYTEST_CURRENT_TEST pass-through removed
The PYTEST_CURRENT_TEST pass-through in core/process.py:93 SHALL be removed.
Scenario: No PYTEST_CURRENT_TEST in src
- WHEN rg -n PYTEST_CURRENT_TEST src/ runs after the change.
- THEN The output is empty.
Requirement: Settings cache does not key on CONFIG_PATH
The settings cache SHALL NOT key on CONFIG_PATH, and no test SHALL rebind CONFIG_PATH.
Scenario: Cache key does not reference CONFIG_PATH
- WHEN config/settings.py is read after the change.
- THEN The cache key does not reference CONFIG_PATH and every test site uses the config fixture.
Requirement: Home-relative paths resolve at read time
Home-relative locations SHALL resolve when read, from the environment the floor sets.
Scenario: Paths resolve at call time
- WHEN config/constants.py is read after the change.
- THEN The paths resolve at call time, not import time, and conftest no longer patches _own_source_dir or the GitHub token privates.
Requirement: Origin cache has a public reset
The hand-attached cache_clear at core/repo.py:466 SHALL give way to a public reset of the origin cache.
Scenario: Public reset method exists
- WHEN core/repo.py is read after the change.
- THEN A public reset method replaces the hand-attached cache_clear, and the floor calls it.
Requirement: Dead code is deleted
core/process_pipeline.py, its lazy exports, and tests/test_process_pipeline.py SHALL be deleted.
Scenario: Files do not exist
- WHEN ls src/devops_cli/core/process_pipeline.py and ls tests/test_process_pipeline.py run after the change.
- THEN Both files do not exist and the lazy exports in core/init.py are removed.
Requirement: One file per behaviour
Each test file SHALL be named after the behaviour it tests, and catch-all files SHALL be dissolved.
Scenario: No catch-all names remain
- WHEN The test file names in this item's directories are read after the change.
- THEN No catch-all name remains, test_fast_dispatch.py and test_main_dry_run.py are renamed, and test_data_dir_worktrees.py is split by behaviour.
Requirement: Network-guard cases move to the floor file
The network-guard cases in test_validation.py SHALL move to tests/invariants/test_hermetic_floor.py.
Scenario: Cases present in floor file
- WHEN tests/invariants/test_hermetic_floor.py is read after the change.
- THEN The network-guard cases are present in that file and absent from test_validation.py.
Requirement: Dry-run rendering is a snapshot
Dry-run plan rendering SHALL use a syrupy snapshot.
Scenario: Syrupy assertions present
- WHEN The dry-run test files are read after the change.
- THEN The assertions use syrupy snapshot comparisons.
Requirement: Property tests cover validation and gitignore
URL and service-URL validation and gitignore evaluation SHALL have Hypothesis property tests.
Scenario: Given decorators present
- WHEN The validation and gitignore test files are read after the change.
- THEN Hypothesis
@givendecorators are present.
Requirement: CLI tests use the cli fixture
Module-level CliRunner instances SHALL give way to the cli fixture, and redundant asyncio markers SHALL be removed.
Scenario: No module-level CliRunner
- WHEN rg -n CliRunner() runs in this item's test files after the change.
- THEN The output is empty and the five redundant
@pytest.mark.asyncio markers are gone.
Requirement: Ratchet ceilings drop
If #1309 has landed, its ceilings SHALL drop by this item's removals, and the PR body SHALL state the counts before and after.
Scenario: Ceilings are lower
- WHEN The ratchet test is read after the change.
- THEN The ceilings are lower than before and the PR body states the counts.
Requirement: No unreachable markers remain
If #1310 added its interim unreachable marker, none SHALL remain in this item's files.
Scenario: No unreachable markers
- WHEN rg -n unreachable runs in this item's test files after the change.
- THEN The output is empty.
Requirement: Coverage stays at or above 90 percent
Unreachable lines SHALL be deleted and coverage SHALL stay at or above 90 percent.
Scenario: Coverage threshold met
- WHEN uv run devops ci runs after the change.
- THEN Coverage is at or above 90 percent.
Requirement: CI passes
uv run devops ci SHALL pass.
Scenario: Exit code zero
- WHEN uv run devops ci runs after the change.
- THEN The exit code is 0.
Existing Tool Considered
The alternatives check recorded not-applicable and named no tool. No single open maintained tool covers the need. The project builds its own test fakes in tests/support/: ProcessFake, GitFake, DnsFake, FakeKeyring, the OTLP fake and the HTTP fake. The written cost is the tokens to build, keep and fix these fakes until they match each edge, plus the elapsed maintenance time across dependency upgrades. pytest, syrupy, Hypothesis and httpx2 cover parts.
Key questions
- How do the git tests run after ADR 0007?: The git tests use git_fake and GitFake. No test starts real git, and no test imports GitPython. (best practice) [sources: docs/TESTING.md]
- Rejected: Run real git in temporary repositories. ADR 0007 and docs/TESTING.md list git as a faked program. A real git would violate the hermetic floor.
- Chosen: Use git_fake with recorded transcripts. docs/TESTING.md defines GitFake and says that a test with git_fake cannot start a real git.
- Does this item need a separate git split?: No. The two git files already use git_fake. Their remaining Path.home edit goes with the home-resolution work. (best practice) [sources: docs/TESTING.md, tests/conftest.py]
- Rejected: Keep a separate real-git item. The two files already use git_fake and hold no run_subprocess patch or Repo patch.
- Chosen: Remove the separate git item and fold the Path.home edit into home-resolution work. Only one environment edit remains, and it belongs with home resolution.
- May this item change tests outside its files?: Yes, where its accommodations are deleted. A test that still rebinds CONFIG_PATH moves to the config fixture in the same PR. (best practice) [sources: docs/TESTING.md]
- Rejected: Restrict changes to this item's files only. Three CONFIG_PATH rebinding sites are outside this item's files. Leaving them would block the cache-key removal.
- Chosen: Allow changes where accommodations are deleted. The item that owns an accommodation deletes it. This keeps the removal atomic.
- Who owns main.py, entry.py, exceptions/, lang/ and models/?: This item owns them. No other item owns them, and the four test files of exceptions/, lang/ and models/ have no patch site. (best practice) [sources: src/devops_cli/main.py, src/devops_cli/entry.py]
- Rejected: Assign them to a separate item. These modules have no patch sites and no other item claims them. A separate item adds coordination cost for no benefit.
- Chosen: This item owns them. The four test files have no patch site, so the work is small. No other item owns these modules.
- What is the overlap with refactor(cli): one process runner owns execution, process groups and dry-run #775?: refactor(cli): one process runner owns execution, process groups and dry-run #775 owns the runner behaviour: the sync and async merge, process groups and dry-run. This item moves the core tests onto its process fake and removes the leftover accommodation. (best practice) [sources: docs/TESTING.md]
- Rejected: This item owns the runner behaviour. refactor(cli): one process runner owns execution, process groups and dry-run #775 delivers the runner. This item would duplicate that work.
- Chosen: refactor(cli): one process runner owns execution, process groups and dry-run #775 owns the runner and this item moves tests onto its fake. refactor(cli): one process runner owns execution, process groups and dry-run #775 delivers the single sync and async runner. This item migrates the tests and removes the leftover accommodation.
- Why does this item wait for fix(ci): tests touch no state outside their temporary directories #1311?: fix(ci): tests touch no state outside their temporary directories #1311 gives each worker its own home and removes the floor's CONFIG_PATH and CONST_USER_DATA_ROOT patches. Until then the cache key and the import-time home paths still serve the floor. [sources: tests/conftest.py, src/devops_cli/config/constants.py]
- Which files belong to this item?: Each file goes to the package that owns most of what it tests. Every test file is named in exactly one child list, so the body list is this item's share wherever test(cli): every test file sits in the directory mirroring the package it tests or in tests/invariants/, and the root conftest holds only the hermetic floor #1313 places a file. (best practice) [sources: docs/TESTING.md]
- Rejected: Assign by test file name. Some files test multiple packages. Name alone does not determine ownership.
- Chosen: Assign by the package owning most of what the file tests. This gives each file a single owner and avoids overlap between items.
- How are the settings cache and CONFIG_PATH handled?: The settings cache no longer keys on CONFIG_PATH. No test rebinds CONFIG_PATH, and every site uses the config fixture. (best practice) [sources: docs/TESTING.md]
- Rejected: Keep the CONFIG_PATH cache key. docs/TESTING.md says no test patches CONFIG_PATH and a test sets configuration through the config fixture.
- Chosen: Remove the CONFIG_PATH cache key and use the config fixture. The config fixture writes the test's own config.yaml and resets the settings cache.
- How are home-relative paths resolved?: Home-relative locations resolve when read, from the environment the floor sets. Conftest no longer patches _own_source_dir or the GitHub token privates. (best practice) [sources: docs/TESTING.md, tests/conftest.py]
- Rejected: Keep import-time home paths. Import-time paths need the CONST_USER_DATA_ROOT patch and block per-worker isolation.
- Chosen: Resolve home paths at call time from the floor environment. The floor gives each test its own data directory, config and home. Call-time resolution uses that environment.
- How is the origin cache reset?: A public reset of the origin cache replaces the hand-attached cache_clear, and the floor calls it after each test. (best practice) [sources: docs/TESTING.md]
- Rejected: Keep the hand-attached cache_clear. docs/TESTING.md requires a public reset for every process-wide cache and singleton.
- Chosen: Add a public reset and call it from the floor. This matches the floor rule and removes a test-only attachment.
- How is the dead code handled?: core/process_pipeline.py, its lazy exports and tests/test_process_pipeline.py are deleted. (best practice) [sources: src/devops_cli/core/init.py]
- Rejected: Keep the pipeline module behind a test. The module has no product caller. A test that reaches it keeps dead code alive.
- Chosen: Delete the module, its exports and its test. docs/TESTING.md says a line that no public behaviour reaches is dead code and is deleted.
- How are runner spans, DNS, HTTP and keyring edges faked?: Runner spans use the OTLP fake. DNS uses DnsFake. HTTP uses WebFake. Keyring uses FakeKeyring. (best practice) [sources: docs/TESTING.md]
- Rejected: Patch the private devops_cli names. docs/TESTING.md forbids a test that patches a devops-cli module, class, function or attribute.
- Chosen: Install the edge fakes through their seams. docs/TESTING.md defines one fake for each edge and installs it through the seam.
- How does the change split?: The change splits into seven items: core tests, config tests, dry-run and root tests, HTTP tests, exceptions/lang/models tests, accommodations and hooks, and dead code plus file reorganization. No separate real-git item remains. (best practice) [sources: docs/TESTING.md]
- Rejected: Keep eight items with a separate real-git item. ADR 0007 and docs/TESTING.md forbid real git in tests. The two git files already use git_fake.
- Chosen: Use seven items without a separate real-git item. The remaining git-file edit belongs to home resolution, so the real-git item has no work.
Fit
Needs splitting into 7 items:
- Core tests on edge fakes: 17 files, remove run_subprocess and GitHub token patches, and use the process fake.
- Config tests on edge fakes: 7 files, use the config fixture and the keyring fake, and remove CONFIG_PATH and keyring patches.
- Dry-run and root module tests: 3 files, remove main._delegate and render_dry_run_result patches.
- HTTP tests on the HTTP and DNS fakes: 4 files including test_http_egress, and remove getaddrinfo patches.
- Exceptions, lang and models tests: 4 files, with no patch sites to remove.
- Accommodations and hooks removal: async reroute, PYTEST_CURRENT_TEST, settings cache key, origin cache reset, and home resolution including the Path.home edit in test_ensure_known_host.
- Dead code deletion and file reorganization: process_pipeline.py, test_data_dir_worktrees split, catch-alls, renaming, and Hypothesis and syrupy tests.
Suspected block
None.
Dependencies
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNew
- StatusShow more project fieldsNew
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
It is one of several parallel Phase E migration items in a planned sequence; important for test architecture but not a blocking defect or security issue.Removing 60+ internal patch sites, production-code accommodations (async rerouting, PYTEST_CURRENT_TEST passthrough, CONFIG_PATH-keyed cache), and 143 lines of dead code makes the codebase significantly more maintainable and the test suite36 test files spanning 7,732 lines and 366 tests must be rewritten to use edge fakes, plus production-code accommodations must be removed and conftest patches reworked.dan-petty commentedon Oct 8, 2026
Linked: #1114 (v0.2.32), which deletes the
ssh-keyscancall (git/operations.py:91-93) this item fakes; whichever lands second drops it. Found by the 2026-10-08 backlog review.7 remaining items
devops-cli-service commentedon Oct 29, 2026
The proposal at a408dee needs splitting into 8 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 1, 2026
Alternatives check: not-applicable
Tool: none found
Checked on 2026-11-01. A person decides what this means for the item. The check changes no label and closes no issue.
[-]test(cli): core, config, git, dry-run and http tests run on edge fakes and real git, and no source module keeps a hook for tests to rebind[/-][+]test(cli): Use edge fakes and real git; drop test rebind hooks[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 127 characters, and the limit is 60. The type and the scope stay.
test(cli): core, config, git, dry-run and http tests run on edge fakes and real git, and no source module keeps a hook for tests to rebindtest(cli): Use edge fakes and real git; drop test rebind hooksdan-petty commentedon Nov 6, 2026
Item 3 of the Fit note ("Git tests on real git: 2 files, remove 12 run_subprocess patches and 8 Repo patches") cannot be built as written. Checked at 662828d on main.
Evidence:
src/starts no system program. Real child processes stay only in the contract suite of the process runner.git_fakefixture installsGitFake(tests/support/fakes/git.py), which answers from transcripts that the real git recorded (tests/support/git_recording.py). A test withgit_fakecannot start a real git.git_fake:tests/git/test_git_operations.pyandtests/git/test_git_worktree.pyhold norun_subprocesspatch and noRepopatch. They hold two environment edits:Path.homeintest_ensure_known_hostandpatch.dict(os.environ, ...)intest_get_user_worktrees_dir.tests/invariants/test_architectural_invariants.py, around line 1109) fails whensrc/imports GitPython or starts git by a way other than the process runner.The acceptance criterion "git and GitPython run for real in temporary repositories" now conflicts with ADR 0007. A change that follows it would undo the owner decision. No code was written.
Suggested re-scope: delete item 3 from the Fit note. The only work left in these two files is the
Path.homepatch intest_ensure_known_host, which belongs to the config and home-resolution item (item 7).devops-cli-service commentedon Nov 6, 2026
The proposal at a0f9557 needs splitting into 7 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.
test(config): config tests use the config fixture and edge fakes (#3867)
refactor(cli): entry.main sets a dry-run state that is set again (#4286)
dan-petty commentedon Nov 10, 2026
All tasks of this item are complete.
The change split into four sub-issues, and each pull request is merged into
main:The other parts were completed as follows:
git_fake.core/process_pipeline.pywas removed in refactor(security): delete the dependency-manifest parsers, transit helpers and orphan core modules nothing calls #1841.All test suites and invariant checks pass on
main.