Repository navigation
Description
Problem or Motivation
This item is the tracker of Phase E for the infrastructure and planning packages. It moves their tests onto the shared edge fakes. It also moves the in-memory roadmap store out of src and moves domain logic out of commands/.
The first body of this item was written on 2026-10-07. It named 40 test files for one pull request. That scope is too big, and part of it is void. Refine set needs-split. The evidence comment of 2026-11-05 proposed 3 items. This rewrite measures again at origin/main 29309f0 and splits the work into 6 children. Each child is one reviewable pull request.
Counting rules, used by every child:
- A patch site is one call of
patch,patch.object,patch.dict,monkeypatch.setattr,monkeypatch.setitemormonkeypatch.delattr, whatever its target.monkeypatch.setenvandmonkeypatch.chdirare no patch sites. - A seam site is a patch site whose target is a
socketorhttpx2name. The DNS and HTTP seams of refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 replace seam sites. - A private import is a
from devops_cli... import _namein a test file. - A scan is an AST pass over the files of a child. Each pull request comment gives the counts before and after.
Measured facts at 29309f0:
- 26 of the 40 named files remain. They hold 26,761 lines and 1,101 tests. They hold 266 patch sites (26 of them seam sites) and 42 private imports. The count of 150 sites in the evidence comment came from another method.
InMemoryRoadmapStoresits inroadmap/memory_store.py(779 lines). 96 test-side files import it: 90 test modules, 5 modules oftests/support/andtests/roadmap_faults.py. The class name appears 1,684 times in them. Insrc, onlyroadmap/duplicate_eval.py:32imports it.- 8 patch sites replace
get_roadmap_store: 3 intests/support/roadmap.py(lines 35 and 63, and the one inunreadable_github_roadmap) and 5 in tests. tests/roadmap_faults.pyholdsStoppingStore(2 users) andListingStore(1 user).tests/roadmap_github_fake.py(GitHubFake, theghprocess edge) has 9 importers and sits outsidetests/support/fakes/.- The Q19 logic is still in
commands/:- PromQL calls (
commands/prometheus.py:174, 240, 330, 398, 453). - Cloudflare record matching (
commands/cloudflare.py:438-505). - Grafana dashboard calls (
commands/grafana.py:289-350). - Argo workflow waiting (
commands/argo.py:134) and the Argo CD client (commands/argo.py:179-208). - Trace-span resolution (
commands/sandbox.py:821).
- PromQL calls (
Criteria of the old body that are void now:
| Old criterion | Why it is void |
|---|---|
| Sandbox mock detection is gone | Done. sandbox/host.py holds no _is_mock_subprocess. #2149 (closed) owns the process fake for it. |
bwrap live tests in the default run |
Replaced by the rule of 2026-10-24. #2149 (closed) and #1337 (closed) own it. |
Four direct getaddrinfo calls go through the DNS seam |
The calls are gone. sandbox/models.py:270, 299 and valkey/client.py:52 call vet_addresses. |
No inline LLMClient( in roadmap/ |
Done by #1001 (closed). |
BoardServer folds into the session fake |
tests/roadmap_board_fake.py is gone. tests/project_board_fake.py tests github/projects.py, and no roadmap code reaches it (ADR 0016). It stays. |
| Ratchet ceilings drop by the removals | #1309 closed as not planned. #1336 turns the counts into bans. |
| Hypothesis tests for RESP parsing | valkey/protocol.py and cache/ are gone. |
Move the store to tests/support/fakes/ |
Still true. The old body did not see the duplicate_eval coupling. Child 1 removes it first. |
| Valkey and Cloudflare client resolution moves to the package | Dropped. Each one only turns settings and a keyring secret into a client. That is wiring. The Valkey fake (#1317) and the HTTP fake (#1314) reach the client behind it. |
| 14 named files are gone | They no longer exist. Three are test_pipeline_engine.py, test_cache_tiered.py and test_valkey_concurrency.py. Two are test_release_* files. Nine are test_roadmap_* files: board_read, close, config, document, lifecycle_properties, migrate, quota, render, reprioritize. |
Proposed Solution & Architectural Design
Close this tracker when its 6 children are closed. This tracker has no code of its own.
The children and their order
| # | Child | Blocked by |
|---|---|---|
| 1 | refactor(roadmap): the in-memory store leaves src, intake's evaluation reads a seeded roadmap, and the fault mode replaces StoppingStore |
none |
| 2 | test(roadmap): roadmap and ci tests take their store through one install hook and use no internal patch |
child 1 |
| 3 | test(roadmap): the four largest roadmap test files split by behaviour |
child 2 |
| 4 | test(sandbox): sandbox tests run on the process, Docker and OTLP fakes, and span resolution leaves commands/ |
none |
| 5 | test(infra): docker, tf, watchers and Argo CRD tests run on edge fakes, and Argo waiting and Cloudflare matching leave commands/ |
none |
| 6 | test(infra): Argo CD, PromQL and Grafana run on the HTTP fake, and their API calls leave commands/ |
#1314 (proposed, see below) |
Children 1 to 3 touch the same test files, so they land in this order. Children 4 and 5 touch files that no other child touches. They run in parallel with children 1 to 3.
Why #1314 blocks only child 6
- Child 6 tests code that builds clients with
new_http_client(argo/fleet.py:61,argo/gitops.py:398,argo/rollouts.py:96,commands/prometheus.py:73). A test cannot inject a transport into these. The only fake isstub_web, which refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 deletes. - refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 is open with
status/new. Nobody has split it. A proposed split is in its comments (2026-11-05). Its part 3 moves the callers of the factories by package, and its last step deletesnew_http_clientandstub_web. - The text of refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 has two readings. One says that package items migrate the "inline builders" and DNS bypasses. The other says that part 3 migrates the callers of the factories. The code of child 6 calls the factory, not an inline builder. The DNS sites that refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 gave to test(infra): infrastructure tests run on edge fakes #1335 are gone (table above). So part 3 of refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 owns the callers of child 6.
- This block is a proposal until refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 is split. If the split gives these callers to the package items, remove the block. Then refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 waits for child 6.
- Children 4 and 5 need no injectable HTTP client. Their edges are processes, Docker, Kubernetes and OTLP, and those fakes exist. The seam sites in their files stay. refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 replaces them.
Done when
- All 6 children are closed.
- In the 26 remaining named files, no private import remains. No patch site remains except the 16 seam sites of children 2 and 4. test(cli): Convert ratchets to bans and merge invariant tests #1336 then turns this into a ban.
git grep -n -E "memory_store|roadmap_faults" -- src testsfinds nothing.uv run devops cipasses.
Found while measuring (not in scope)
The command test files of #1327 (closed, PR #2872) still patch devops_cli names at 29309f0. tests/commands/test_valkey.py patches commands.valkey._resolve_client 22 times. tests/commands/test_cloudflare_commands.py patches commands.cloudflare.load_settings 20 times and _resolve_client 15 times. #1336 will fail on them. A person decides whether to reopen #1327 or file a new item. This tracker does not take that work. Child 5 and child 6 move only the cases that test the moved rule.
Target Subsystem
SDLC, Git & PR Governance
Existing Tool Considered
pytest and Hypothesis stay the runner and the property-test tool. Both are open and maintained. They give no fake for the edges of this repository, so the fakes in tests/support/fakes/ stay the way to double an edge (ADR 0007).
The tracker builds nothing. Each child names its own tool and cost.
Strategic alignment
- Depends on: refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 (through child 6, proposed). Every other dependency of the old body is closed: 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(github): the github session owns transport, ledger, error classes and link pagination #983, refactor(ai): one model seam: llmclient over three wire adapters behind one factory, no second provider stack #1001, refactor(k8s): KubernetesService is the Kubernetes API seam, with a shared fake cluster and its contract suite #1315, refactor(infra): DockerEngineService is the Docker engine seam, with a shared in-memory engine fake and its contract suite #1316, refactor(ai): Valkey, Qdrant and the embedder each have one seam, with shared fakes and contract suites #1317, 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, refactor(cli): tests control time: time-machine fakes wall-clock reads, and retry and rate-limit waits return at once and are recorded #1320.
- Blocks: test(cli): Convert ratchets to bans and merge invariant tests #1336.
- Parent: test(cli): tests double only process edges and mirror the source tree #1307 (phase E).
- Related: refactor(roadmap): group the job modules in subpackages #3187 and feat(roadmap): list registry and ratchet entries a plan needs #3254 (open change folders that name
memory_store.pyandroadmap_faults.py; child 1 updates both), test(github): github/ is tested through its public interface over the gh process and session fakes, with no internal patches or private imports #1321 (BoardServerusers), 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 and fix(ci): the live bubblewrap tests run wherever bwrap is installed and skip only where it is missing #1337 (closed, ownbwrap).
Proposed design
Problem statement
Phase E moves infrastructure and planning package tests onto the shared edge fakes. This tracker has no code of its own. It coordinates six child items that each fit one pull request. It closes when all six children close, the final scans find no forbidden reference, and uv run devops ci passes.
Acceptance criteria
Requirement: No private imports
The 26 remaining named test files SHALL hold no private import from devops_cli.
Scenario: Private import scan
- WHEN An AST scan runs over the 26 named test files.
- THEN It finds zero private imports.
Requirement: Patch sites limited to seams
The 26 remaining named test files SHALL hold no patch site other than the 16 seam sites of children 2 and 4.
Scenario: Patch site scan
- WHEN An AST scan runs over the 26 named test files.
- THEN It finds no patch site other than the 16 seam sites.
Requirement: Store references removed
The repository SHALL hold no reference to memory_store or roadmap_faults in src or tests.
Scenario: Store reference scan
- WHEN
git grep -n -E "memory_store|roadmap_faults" -- src testsruns. - THEN It finds nothing.
Requirement: Full gate passes
The repository SHALL pass uv run devops ci.
Scenario: Full gate
- WHEN
uv run devops ciruns on the final child merge. - THEN It exits with code 0.
Existing Tool Considered
No alternatives check has run. pytest and Hypothesis stay the runner and the property-test tool. Both are open and maintained. They give no fake for the edges of this repository, so the fakes in tests/support/fakes/ stay the way to double an edge (ADR 0007). The tracker builds no code, so it has no build cost.
Key questions
None.
Fit
Needs splitting into 6 items:
-
refactor(roadmap): the in-memory store leavessrc, intake's evaluation reads a seeded roadmap, and the fault mode replacesStoppingStore; blocked by none.
-
test(roadmap): roadmap and ci tests take their store through one install hook and use no internal patch; blocked by child 1.
-
test(roadmap): the four largest roadmap test files split by behaviour; blocked by child 2.
-
test(sandbox): sandbox tests run on the process, Docker and OTLP fakes, and span resolution leavescommands/; blocked by none.
-
test(infra): docker, tf, watchers and Argo CRD tests run on edge fakes, and Argo waiting and Cloudflare matching leavecommands/; blocked by none.
-
test(infra): Argo CD, PromQL and Grafana run on the HTTP fake, and their API calls leavecommands/; blocked by refactor(cli): Unify HTTP and DNS seams with shared fakes #1314.
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
24 remaining items
devops-cli-service commentedon Nov 6, 2026
The proposal at dc9815e needs splitting into 6 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.
refactor(roadmap): the in-memory store leavessrc, intake's evaluation reads a seeded roadmap, and the fault mode replacesStoppingStore; blocked by none.test(roadmap): roadmap and ci tests take their store through one install hook and use no internal patch; blocked by child 1.test(roadmap): the four largest roadmap test files split by behaviour; blocked by child 2.test(sandbox): sandbox tests run on the process, Docker and OTLP fakes, and span resolution leavescommands/; blocked by none.test(infra): docker, tf, watchers and Argo CRD tests run on edge fakes, and Argo waiting and Cloudflare matching leavecommands/; blocked by none.test(infra): Argo CD, PromQL and Grafana run on the HTTP fake, and their API calls leavecommands/; blocked by refactor(cli): Unify HTTP and DNS seams with shared fakes #1314.test(sandbox): sandbox tests run on process, Docker and OTLP fakes (#…
refactor(roadmap): the in-memory store leaves src (#3839)
chore(roadmap): settle the change folders of 5 closed items (#7813)