Repository navigation
Description
Problem or Motivation
Part 1 of 6 of #1335. InMemoryRoadmapStore is the fake of the roadmap store. It sits in src/devops_cli/roadmap/memory_store.py (779 lines) and ships in the wheel. TESTING.md says that fakes, and in-memory implementations that production does not use, live in tests/support/ and never ship in the wheel.
Production uses the class in one place. roadmap/duplicate_eval.py:32 imports it, and judge_case (duplicate_eval.py:154) builds one store per case. The command devops roadmap eval intake runs this code. The old body of #1335 did not see this use. All facts below are measured at origin/main 29309f0.
The evaluation needs little from the store. judge_case seeds one issue and the text of .github/labels.yml, then calls intake_candidate. That function calls plan_intake, and confirm is false, so nothing is written. plan_intake reads through five store methods: issues (intake.py:1202), repository_file (:510), closures (:772), evidence_holds (:924, through _p0_refusal) and comments_on (:1020, through _has_comment). Only apply_intake writes.
Other facts:
- 96 test-side files import the class: 90 test modules, 5 modules of
tests/support/andtests/roadmap_faults.py. The class name appears 1,684 times in them. tests/roadmap_faults.pyholds two wrappers of the store, and neither has a contract suite.StoppingStorefails one write.test_roadmap_run.py:1608andtest_roadmap_stage_apply.py:163use it.ListingStorecounts the directory listings and can fail one.test_roadmap_alternatives.py:893, 908uses it. The file also holdsWRITES, the set of store writes that can fail.tests/roadmap/test_roadmap_store_contract.py(1,252 lines) already runs the label and job-record cases on both adapters: the in-memory one andGitHubRoadmapStoreoverGitHubFake.GitHubFake(tests/roadmap_github_fake.py) has no write fault. It fails only a file answer and the traffic paths.- Three constants
DEFAULT_ROADMAP_MEMORY_*inconfig/defaults.py:727-730exist for this class. One test imports one of them. - Two open change folders name files that this item moves or deletes.
openspec/changes/3187-group-the-job-modules-in-subpackages/plans to movememory_store.pyintoroadmap/stores/.openspec/changes/3254-list-the-registry-and-ratchet-entries/plans aREGISTRY_COUNTSdeclaration and a stage check for theWRITESset intests/roadmap_faults.py. Both plans are wrong after this item.
Proposed Solution & Architectural Design
Decision for duplicate_eval
Give the evaluation its own read-only roadmap. Do not keep the test fake in src.
- Add a Protocol
IntakeReadsinroadmap/store.pywith the five read methods above.RoadmapStorealready satisfies it, so no caller changes. - Retype what the planning path passes around:
plan_intake, the field_Run.store,_p0_refusal(intake.py:917),_priority(:929) and_has_comment(:1017).apply_intakeandintake_candidatekeepRoadmapStore.mypythen proves that the planning path writes nothing and reads nothing else. - Add
SeededRoadmapinroadmap/duplicate_eval.py. It is a small frozen class that holds oneIssueRecordand the text of.github/labels.yml. It has no write method.issues()returns the record.repository_file()returns the labels text.closuresandcomments_onreturn[].evidence_holdsreturnsFalse.
judge_casebuilds aSeededRoadmapand callsplan_intake(..., new=candidate). It reads the one decision of the plan. It no longer callsintake_candidate. The verdicts must not change.duplicate_eval.pygets its own repo constant for therepoargument. It no longer importsDEFAULT_ROADMAP_MEMORY_REPO.
Why this and not another design:
- Keep
InMemoryRoadmapStoreinsrcas a production type. TESTING.md allows an in-memory implementation insrconly if production uses it. Production uses two reads of it. The class would ship 779 lines ofseed_*,as_actorandjob_writeshelpers for them. Rejected. - Move the evaluation under
tests/orscripts/.devops roadmap eval intakeis a shipped command, asstage evalandimplement evalare. Its case fileroadmap/intake_duplicate_cases.jsonships in the package. Rejected. - Build the evaluation store from
GitHubRoadmapStoreover a recorded session. It needs a recorded REST page set for 16 cases, to read one issue and one file. It would test the GitHub store, not intake. Rejected.
The move
git mv src/devops_cli/roadmap/memory_store.py tests/support/fakes/roadmap_store.py. Move the threeDEFAULT_ROADMAP_MEMORY_*constants into that module and delete them fromconfig/defaults.py. Rewrite its docstring. It is a fake, and the contract suite keeps it equal toGitHubRoadmapStore.- Change the import in the 96 test-side files. The edit is the import line only. The check is in the criteria.
- Update the two open change folders in the same pull request (rule 8).
- refactor(roadmap): group the job modules in subpackages #3187: remove
memory_store.pyfromproposal.md,design.md,specs/roadmap-package-layout/spec.mdandtasks.md. That includes the task that moves it and the verification patterns that name it. - feat(roadmap): list registry and ratchet entries a plan needs #3254: the
WRITESset moves into the fake. Changeproposal.md,tasks.mdandspecs/roadmap-stage/spec.mdso that theREGISTRY_COUNTSdeclaration and the plan-task path nametests/support/fakes/roadmap_store.py. If feat(roadmap): list registry and ratchet entries a plan needs #3254 lands first, its declaration moves withWRITESin this item.
- refactor(roadmap): group the job modules in subpackages #3187: remove
The fault mode
Add fail_write(*, at, applied=False, write=None, item=None) to the fake. It makes the at-th matching write raise GitHubOperationError("HTTP 502") once. With applied=True, the write applies first and then raises. The fake records every attempted write in writes. This keeps the semantics of Fault in tests/roadmap_faults.py. WRITES moves into the fake.
ListingStorebecomes a record and a fault of the fake. The fake keepslisted(each directory a job listed, in order).fail_listing(error)makes the next listing raiseerror.- Replace the 3 users of the two wrappers. Delete
tests/roadmap_faults.py. - Add the fault cases to
test_roadmap_store_contract.pyfor both adapters.GitHubFakehas no write fault today. Addfail_writeto it as well (about 30 lines). Both adapters must raise the same error type, and the first step of the work is a test that shows it.
Order
Land this first. It changes the import line of 96 files, so every other roadmap test change conflicts with it. Children 2 and 3 of #1335 wait for it.
Acceptance criteria
- A test first:
SeededRoadmaphas no write method.judge_casegives the same verdict and reason for each of the 16 cases ofintake_duplicate_cases.json.tests/roadmap/test_roadmap_duplicate_eval.pypasses with no change to its assertions. -
test ! -e src/devops_cli/roadmap/memory_store.pyis true.git grep -n -E "InMemoryRoadmapStore|memory_store|DEFAULT_ROADMAP_MEMORY" -- srcprints nothing. -
plan_intakeand the three helpers takeIntakeReads.uv run mypypasses. - The fake is at
tests/support/fakes/roadmap_store.py. The diff of the other test-side files holds import lines only. The path filter of the command excludes the fake, the deleted faults file and the 3 fault-mode users. Then this command prints nothing:git diff -U0 origin/main -- tests ':!tests/roadmap_faults.py' ':!tests/support/fakes/roadmap_store.py' ':!tests/roadmap/test_roadmap_run.py' ':!tests/roadmap/test_roadmap_stage_apply.py' ':!tests/roadmap/test_roadmap_alternatives.py' | grep -E '^[+-]' | grep -v -E '^(\+\+\+|---)' | grep -v -E '^[+-]\s*(from|import)\s|^[+-]\s+[A-Za-z_]+,$|^[+-]\s*[()]\s*$'. The pull request comment gives the exact command and its output. -
tests/roadmap_faults.pyis deleted. The write-fault cases run in the contract suite on both adapters. The listing fault is tested on the fake only, because it is a fake feature. A write that fails before it applies leaves the state unchanged. A write that fails after it applies leaves the change in place. -
git grep -n -E "memory_store|roadmap_faults" -- openspec/changes ':!openspec/changes/archive'prints nothing. The folders of refactor(roadmap): group the job modules in subpackages #3187 and feat(roadmap): list registry and ratchet entries a plan needs #3254 are consistent with the new paths. -
uv run devops cipasses.
Target Subsystem
SDLC, Git & PR Governance
Existing Tool Considered
No open library gives a fake of this repository's roadmap store, so the fake stays hand-written. Its contract suite keeps it equal to GitHubRoadmapStore on recorded and scripted gh answers. This is the pattern of ADR 0007.
For the evaluation store, a narrow Protocol and a read-only class of about 40 lines replace a class of 779 lines in src. The cost to build is about 150,000 tokens, most of it for the import edits in 96 files. It costs about 20,000 tokens a year to keep. The work takes about one day.
Strategic alignment: child of #1335. Parent #1307. Blocks the children 2 and 3 of #1335. Related: #3187, #3254.
Activity
dan-petty commentedon Nov 6, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
refactorprefix of the title gives the type.(roadmap)scope of the title gives the scope.It removes a test fake from the production wheel but does not fix a user-facing defect or add a feature.It stops shipping a 779-line test fake in the wheel and clarifies the read-only contract, but users see no new behaviour.It touches 96 test files, 1684 name references, two open change folders, and requires a new Protocol, a new class, and retyping of five functions.Both move the in-memory roadmap store out of src, but #1335 is the umbrella tracker for six children and this item is only child 1.refactor(roadmap): the in-memory store leaves src
refactor(roadmap): the in-memory store leaves src
refactor(roadmap): the in-memory store leaves src
devops-cli-service commentedon Nov 6, 2026
Released in v0.73.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.73.0
devops-cli-service commentedon Nov 6, 2026
Live since 2026-11-06 22:09 UTC
test(infra): infrastructure tests run on edge fakes (#4283)