Repository navigation
Description
Problem
The stage planner reads GitHub while it plans: read_issue and find_issues (planner and verifier), the open pull requests that meet a path the plan names, and the files of a pull request that the body names. In the 14 days to 2026-11-23 the planner made 931 read_issue and 442 find_issues calls that returned data, and the verifier made 396 and 151, about 3.4 calls per planned attempt. The prompt of the extended toolset tells the model to read each #N and to search the issues before the plan names what it depends on.
From #6814 the agent phase of stage runs in a container that holds no GitHub credential, and the agent of #6705 holds none either. Each read then answers "GitHub could not be read", so the plans miss done or parked items, decisions in comments, overlaps and dependencies.
Change
preparereads this data before the agent phase and writes it to the run folder as files:- each issue that the item body names, with its comments;
- the open pull requests and the paths that each one changes;
- the files of each pull request that the body names;
- a snapshot of the open issues (number, title, labels, body) for a local search.
- The read tools of the agent phase answer from these files. The agent of refactor(roadmap): the stage agent is stock Coder #6705 reads the same files with its shell.
- With
--phase allnothing changes.
Acceptance criteria
- A test of a separate agent phase with no credential gets the same answers from
read_issue, the open-pull overlap and the files of a named pull request as--phase allgets. - A test shows that
find_issuesin a separate agent phase finds an open issue by a word of its title or body.
Dependencies
Source
Source: #6813
Alternatives check of 2026-11-23: in-use.
The repository already uses this tool.
Tool: cli/cli (https://github.com/cli/cli), MIT, last activity 2026-11-20, maintained.
Reason: Searches found no tool that snapshots GitHub reads for an agent with no credential; the GitHub CLI covers the fetching half (issue with comments, PR files, open-PR paths, issue list as JSON), while the run-folder store and file-backed read tools stay project code.
Covers:
- Fetches one issue with its comments as JSON
- Lists open pull requests with their changed paths
- Reads the files of a named pull request
- Lists open issues with number, title, labels and body
Lacks:
- No on-disk snapshot that later reads answer from
- No local search over the issue snapshot
- Needs a live GitHub credential at each call
- No run-folder layout or read-tool adapters
Proposed design
Problem statement
The agent phase of stage runs in a container with no GitHub credential. The stage planner reads issues, open pull requests and pull-request files while it plans, so each read fails. The plan then misses done items, decisions in comments, overlaps and dependencies. The agent phase now uses the stock Coder and offers no custom GitHub read tool. prepare will fetch these reads with the Service token and write them under work/github/. The stock Coder will read the files with its shell and the roadmap_stage_coder.md prompt.
Acceptance criteria
Requirement: Prepare writes named issues with comments
The prepare phase SHALL write each issue that the item body names, with its comments, to work/github/issues/<number>.json before the agent phase starts.
Scenario: Two named issues
- WHEN a test runs
preparefor an item whose body names feat(release): v0.1.11 #12 and docs(valkey): expand roadmap and add IT domain knowledge base guide #34 with a fake GitHub client that returns one comment on feat(release): v0.1.11 #12 - THEN
work/github/issues/12.jsonholds the state, title, labels, body and that comment, andwork/github/issues/34.jsonexists
Requirement: Prepare writes open pull requests with paths
The prepare phase SHALL write each open pull request with the paths that it changes to work/github/pulls.json.
Scenario: Two open pull requests
- WHEN a test runs
preparewith a fake client that returns two open pull requests, one of which changessrc/app.py - THEN
work/github/pulls.jsonholds both numbers and titles, and the paths of the second includesrc/app.py
Requirement: Prepare writes files of a named pull request
The prepare phase SHALL write the files of each pull request that the item body names to work/github/pull-files/<number>.json.
Scenario: Named pull request
- WHEN a test runs
preparefor an item whose body names feat(ai): agent constellation quiesce & emergency failover controller #56 with a fake client that returns one changed file with a patch - THEN
work/github/pull-files/56.jsonholds the path and the patch of that file
Requirement: Issue index is newline-delimited and bounded
The prepare phase SHALL write the open issues to work/github/issue-index.jsonl as one JSON object per line, with at most 1000 records and a body of at most 500 characters.
Scenario: Repository with 3000 open issues
- WHEN a test runs
preparewith a fake client that returns 3000 open issues, each with a body of 2000 characters - THEN
work/github/issue-index.jsonlholds at most 1000 lines, each body is at most 500 characters, and the file is at most 1 MiB
Requirement: A shell search finds an issue in the index
The open-issue index MUST let a shell search find an open issue by a word of its title or body.
Scenario: Word that only one open issue has
- WHEN a test runs
preparewith a fake client that returns an open issue feat(roadmap): record the reference hits of a stage case in the replay #4211 with the wordnondisruptivein its body, and then runsgrep -i nondisruptive work/github/issue-index.jsonl - THEN the output holds
#4211and no other issue number
Requirement: Coder prompt names the snapshot files
The stage Coder prompt roadmap_stage_coder.md SHALL name work/github/issues/, work/github/pulls.json, work/github/pull-files/ and work/github/issue-index.jsonl and tell the Coder to read them with its shell.
Scenario: Prompt for the stock Coder
- WHEN a test builds the stage Coder prompt
- THEN the prompt holds each path and a shell command that searches
work/github/issue-index.jsonl
Requirement: Agent phase offers no custom GitHub read tool
The --phase agent stage run SHALL offer only the stock Coder tools and no read_issue or find_issues tool.
Scenario: Agent phase tool list
- WHEN a test runs the stage agent phase with a fake Coder
- THEN
script.tools_offeredequalsstock.tools_offered
Requirement: Phase all keeps the live reads
A run of --phase all MUST keep the live GitHub reads and write no file under work/github/.
Scenario: Phase all run
- WHEN a test runs
--phase allfor an item with a fake GitHub client - THEN the client receives the issue reads and no file under
work/github/is written
Requirement: A failed read does not stop prepare
The prepare phase SHALL record a failed GitHub read in work/github/errors.json and continue with the other reads.
Scenario: One read fails
- WHEN a test runs
preparewith a fake client that raises for docs(valkey): expand roadmap and add IT domain knowledge base guide #34 and returns data for feat(release): v0.1.11 #12 - THEN
work/github/issues/12.jsonexists, nowork/github/issues/34.jsonexists, andwork/github/errors.jsonnames docs(valkey): expand roadmap and add IT domain knowledge base guide #34
Existing Tool Considered
The alternatives check of 2026-11-23 in the issue body gives cli/cli (MIT, maintained) the verdict in-use. That block lists what the tool covers and lacks. prepare uses cli/cli for the fetches. The project code fills the lacks that the block names: the work/github/ snapshot store, the newline-delimited issue index and the Coder prompt that reads them with the shell. This is about 150 lines of Python and Markdown: about 40k tokens to build, about 10k tokens a month to keep and fix, over about 1 day.
Key questions
- Which files does
preparewrite, and where does the stock Coder read them?:preparewriteswork/github/issues/<n>.json,work/github/pulls.json,work/github/pull-files/<n>.jsonandwork/github/issue-index.jsonl. The stock Coder reads these files with its shell. The promptroadmap_stage_coder.mdnames them. (best practice) [sources: src/devops_cli/roadmap/stage/stage_job_phases.py:689, src/devops_cli/roadmap/stage/stage_agent.py:105, openspec/specs/roadmap-stage/phases/spec.md:60, tests/roadmap/stage/test_roadmap_stage_agent.py:104]- Chosen: One file for each read under
work/github/. The stock Coder reads the run folder with its shell, and refactor(roadmap): the stage agent is stock Coder #6705 useswork/for the agent copy. - Rejected: Write under
state/github/and copy towork/github/. The agent phase needs no second copy, and the extra copy adds a failure mode. - Rejected: Write all reads to one file
work/github.json. The issue index alone can reach the run-file size limit.
- Chosen: One file for each read under
- How does the open-issue index stay within the run-file size limit?: It has its own file,
work/github/issue-index.jsonl. It holds at most 1000 records, cuts each body to 500 characters, and stays at most 1 MiB. (best practice) [sources: src/devops_cli/roadmap/stage/stage_tools.py:419, docs/roadmap/stage.md:50]- Chosen: A separate newline-delimited index with at most 1000 records and 500 characters of body. The whole open-issue listing is about 11 MB, over the 1 MiB limit of a run file.
- Rejected: Reuse
state/issues.jsonof refactor(roadmap): the stage agent is stock Coder #6705. That file holds only the item and the issues of active change folders, so a search over the open issues finds nothing. - Rejected: One file for each open issue. About 2000 files in one run folder are slow to write and to read.
- How does the stock Coder search the open-issue index?: It uses its shell with
greporrgonwork/github/issue-index.jsonl. The prompt tells it to search before it plans. A customfind_issuestool in--phase agentwould break ADR 0036 and the stock Coder contract. (best practice) [sources: src/devops_cli/roadmap/stage/stage_agent.py:105, tests/roadmap/stage/test_roadmap_stage_agent.py:104, openspec/specs/roadmap-stage/phases/spec.md:60]- Chosen: A shell search over
work/github/issue-index.jsonl. The stock Coder has a shell, and the index is small enough to search with no custom tool. - Rejected: Add a custom
find_issuestool to--phase agent. ADR 0036 andphases/spec.mdkeep the agent phase on the stock Coder tools. - Rejected: A SQLite full-text index. It adds a build step and a file format for a search of at most 1000 records.
- Chosen: A shell search over
- What does
preparedo when a GitHub read fails?: It records the failure inwork/github/errors.json, writes no file for that read, and continues with the other reads. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, docs/roadmap/stage.md:50]- Chosen: Record the failure and continue. One failed read must not stop the plan, and the other reads still help the Coder.
- Rejected: Stop the run. A rate limit or one missing pull request would stop every plan of the run.
- Should
--phase allwrite the snapshot files?: No.--phase allkeeps the live GitHub reads and writes no file underwork/github/. Only a separatepreparephase writes the snapshot. (best practice) [sources: src/devops_cli/roadmap/stage/stage_job_phases.py:689, openspec/specs/roadmap-stage/phases/spec.md:60]- Chosen: Keep the live reads in
--phase all. The issue states that--phase alldoes not change, and the old custom engine still reads GitHub. - Rejected: Write snapshots in
--phase alltoo. This changes the current behavior and adds files that no tool reads in that mode.
- Chosen: Keep the live reads in
- Which tool covers the GitHub reads?:
cli/clicovers the GitHub reads, with the verdictin-usein the alternatives check of 2026-11-23 in the issue body. The project adds the snapshot store, the newline-delimited index and the Coder prompt. (best practice) [sources: src/devops_cli/roadmap/stage/stage_job_phases.py:689]- Chosen: Use
cli/clifor the fetches. The tool is open, maintained and already in use, and it covers the fetch half of the need. - Rejected: Build a GitHub fetch client in the project. It repeats an open, maintained tool and adds cost with no gain.
- Chosen: Use
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 23, 2026
Both concern GitHub reads for the stage planner, but #3238 adds the tools to the toolbox while the candidate pre-fetches the data so the tools work without a live credential.dan-petty commentedon Nov 23, 2026
The dependency changes: #6813 is closed as not planned, and #6705 now builds the phases of stage together with the
Coderagent. This item needs thepreparephase of #6705. The agent of #6705 reads these files with its shell.devops-cli-service commentedon Nov 23, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
dan-petty commentedon Nov 23, 2026
prepareof #6705 writes the issue listing of the stage run, and this item builds on it. The listing isstate/issues.json, with a copy for the agent inwork/, in the record form ofIssueRecord. It holds only the records thatdevops roadmap plan-recheck --issuesreads: the item with its body, and the number and state of each issue that an active change folder names. The whole listing of the repository is about 11 MB, over the limit of 1 MiB of a run file. So the snapshot of the open issues for the local search of this item needs a file and a limit of its own. The plan:openspec/changes/6705-stage-agent-stock-coder/on main.devops-cli-service commentedon Nov 23, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
dan-petty commentedon Nov 25, 2026
This issue cannot be built as written after #6705 (
443130279, ADR 0036). The acceptance criteria and refined design requireread_issue,find_issues, open-pull overlap checks, and named pull-request file reads inside--phase agent. After #6705,run_stage_agent(src/devops_cli/roadmap/stage/stage_job_phases.py:689) runs stockCoder(src/devops_cli/roadmap/stage/stage_agent.py:105) with no custom tools (openspec/specs/roadmap-stage/phases/spec.md:60,tests/roadmap/stage/test_roadmap_stage_agent.py:104:script.tools_offered == stock.tools_offered). Addingread_issueorfind_issuesto--phase agentbreaks ADR 0036 andphases/spec.md, while--phase alluses the old custom engine until #6846. Please refine #6831 for stockCoderreadingpreparesnapshot files fromwork/github/via its shell and prompt (roadmap_stage_coder.md).devops-cli-service commentedon Nov 25, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 25, 2026
Released in v0.219.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.219.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 17:09 UTC