Repository navigation
Description
Problem or Motivation
The implement plan gate of #3393 reads the change folder at a revision for each item that the run judges. _Judge.judge runs for every named item, so a run with many items lists the default tree and reads the base specs once for each item. The default branch does not change during a run, and the base specs are the same for each item, so those reads repeat work.
Proposed Solution & Architectural Design
- Read the file list and the base specs of
origin/<default>once inplan_implement, and pass them to_Judge. - Keep the read of a Staged branch per item, because each item has its own branch.
- Add a test in
tests/roadmap/test_roadmap_implement_job.pythat a run over two items lists the default tree once.
Target Subsystem
src/devops_cli/roadmap/implement.py, tests/roadmap/test_roadmap_implement_job.py.
Existing Tool Considered
The revision readers files_at, file_texts_at and base_specs_at of plan_read.py already exist after #3393. The change reuses them and adds a cache for the default branch. Cost: about 2,000 tokens to build and test, about 500 tokens to keep and fix, and about 1 hour of elapsed time. The change deletes no code.
Source: #3403
Proposed design
Problem statement
The implement plan gate of #3393 reads the change folder of an item at a revision. The gate reads the default tree and the base specs for each item that a run judges. The default branch and the base specs do not change during a run, so these reads repeat work. The change reads them one time for a run and passes them to the judge of every item.
Acceptance criteria
Requirement: Default tree read once per run
plan_implement SHALL list the files of origin/ once for a run and give that list to the judge of every item.
Scenario: A run over two Planned items
- WHEN A run judges two Planned items in one call to
plan_implement. - THEN The run lists the files of
origin/one time.
Requirement: Base specs read once per run
plan_implement SHALL read the base specs of origin/ once for a run and give them to the judge of every item.
Scenario: Two items need the base specs
- WHEN A run judges two items whose plans the gate checks against the base specs.
- THEN The run reads the base spec files of
origin/one time.
Requirement: Staged branch read for each item
The judge SHALL list the files of the branch of each Staged item that it judges.
Scenario: Two Staged items on two branches
- WHEN A run judges two Staged items whose branches differ.
- THEN The run lists the files of each of the two branches.
Requirement: Same selection as a read for each item
The plan MUST return the same targets and the same left-out reasons as a plan that reads the default tree for each item.
Scenario: The reads of one run give the same result
- WHEN A run judges a set of items with the default reads taken one time.
- THEN Each item gets the target or the left-out reason that a read for each item gives.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers this need. The change adds a cache over the repository's own readers, files_at, file_texts_at and base_specs_at of src/devops_cli/roadmap/plan_read.py. Written cost: about 2,000 tokens to build and test, about 500 tokens to keep and fix, and about 1 hour of elapsed time. The change deletes no code.
Key questions
- Where does the run keep the default tree and the base specs, so that each item reads them one time?:
plan_implementreads them one time and passes them to_Judgewhen it builds the judge. It already passesremote_headsandplannedthis way. (best practice) [sources: src/devops_cli/roadmap/implement.py]- Chosen: Read one time in
plan_implementand pass to_Judge. The function already takes the remote heads and the planned changes as optional arguments and reads them one time when the caller gives none. The default tree and the base specs follow the same path. - Rejected: A cache inside
plan_read.py, keyed by the revision. A cache in the reader outlives one run and hides the read from the caller. A test can then not count the reads of a run. - Rejected:
functools.lru_cacheon the readers. The cache would hold the clone and every revision that a run reads, and it would live after the run. A pass-through argument keeps one run and one set of reads.
- Chosen: Read one time in
- Which reads stay a read for each item?: The files of a Staged branch stay a read for each item, because each Staged item has its own branch. The reads of
origin/are the only ones that the run takes one time. (best practice) [sources: src/devops_cli/roadmap/implement.py]- Chosen: Keep the branch read for each Staged item. The route of a Staged item is its own branch, and two items never share it. A cache saves no read for these items.
- Rejected: Cache every revision that the run reads. Each Staged branch is read one time in a run, so the cache saves no read. It adds a key and a lifetime for no gain.
- How does the test show that a run over two items lists the default tree one time?: The test runs two items in one call and counts the git calls that the run makes at the process edge. It asserts one call that lists
origin/. (best practice) [sources: tests/roadmap/test_roadmap_implement_job.py]- Chosen: Count the git calls of the run at the process edge. The job test already counts the calls of
job_world.programsto check a push and a documentation run. The count reads the real path of the reader. - Rejected: Count with a spy on
files_at. The spy replaces the reader under test, so the test no longer shows that the real reader runs one time. - Rejected: A unit test of
plan_implementalone. The body names the job test file, and a job test runs the same plan path that the Service runs.
- Chosen: Count the git calls of the run at the process edge. The job test already counts the calls of
- Does the plan gate of fix(roadmap): the implement job refuses a plan that fails the plan check #3393 exist on the default branch?: No.
_Judge.judgeinsrc/devops_cli/roadmap/implement.pyreads no change folder, and fix(roadmap): the implement job refuses a plan that fails the plan check #3393 is still a change folder underopenspec/changes/. [sources: src/devops_cli/roadmap/implement.py, openspec/changes/3393-the-implement-job-refuses-a-plan/tasks.md] - Which readers does the gate use for a revision?: The gate uses
files_at,file_texts_atandbase_specs_atofsrc/devops_cli/roadmap/plan_read.py. The change of fix(roadmap): the implement job refuses a plan that fails the plan check #3393 adds these public readers. [sources: openspec/changes/3393-the-implement-job-refuses-a-plan/tasks.md, openspec/changes/3393-the-implement-job-refuses-a-plan/design.md]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 4, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
perfprefix of the title gives the type.(roadmap)scope of the title gives the scope.It removes redundant work in multi-item runs but does not fix a defect or block a user.It saves repeated tree and spec reads for runs with many items, reducing wall time and API calls.The body states about one hour of elapsed time and that it deletes no code.Both target the implement plan gate in implement.py, but #3393 adds the gate logic and the candidate optimizes the reads it performs.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at 89682e4 (see proposed design in issue body).
devops-cli-service commentedon Nov 5, 2026
Released in v0.62.5: https://github.com/dan-petty/devops-cli/releases/tag/v0.62.5
devops-cli-service commentedon Nov 5, 2026
Live since 2026-11-05 16:42 UTC