Repository navigation
Description
Problem or Motivation
Each task group of an implement step starts a new agent. The agent must find the branch, the kept wip: commits and the changed files again, which the step knows before the first request:
- Since the
run_commandprompt of 2026-11-12, the 10 runner runs made 183 git read calls:git status68,git diff52,git log34,git show29. That is about 18 for each run (n = 10, from 2026-11-12 04:00Z to 2026-11-13 16:00Z). - In the 7 days before, 45 runs made 699 git read calls, with 239 identical repeats in 31 runs. The chained start
git status --short && git log ...was refused 20 times. Refusals count toward the refusal cap of 30 and toward 3 in a row. - One implement request holds about 3.2 tool calls, so about 3 removed calls remove one request (about 5 s at the gateway).
Only the calls at the start of a step can go. The repeats after an edit stay, and git status stays allowed.
Proposed Solution & Architectural Design
- Add a
# Checkout statesection to the step message. Mark it "at step start". It gives:- the branch and the base commit;
- the subjects of the kept
wip:commits of the step; - the paths that differ from the base, with the counts of added and removed lines.
- Build the section from data that the step already holds: its
wip:commit list and the base commit. If the step must run git for the paths, run it through the existing local runner with no credentials, aftercheck_settings(src/devops_cli/roadmap/implement/git_isolation.py), with--no-ext-diff --no-textconv -c core.fsmonitor=false. The agent of an earlier group can write.git/config, hooks and.gitattributes. - Give no tick list:
tasks.mdis already in the message. - Put the section after the change documents (after
tasks.md) and just before# Your group. The text that is the same for all steps of an item then stays a cache prefix. - Write the section as a pure function of the step state, so that a later scaffold unit of the pipeline split can own it.
Size: at most about 300 o200k tokens.
Target Subsystem
SDLC, Git & PR Governance: src/devops_cli/roadmap/implement/implement_step.py, implement_run.py, git_isolation.py, the implement prompt in src/devops_cli/ai/tasks/.
Existing Tool Considered
git gives the state, and the step already records the wip: commits (#3054). No tool is necessary. Cost to build: about 0.6M tokens and 2 hours (estimate), about 60 lines and 4 tests.
Acceptance Criteria
- Test first: for a step with two kept
wip:commits and one changed file, the message holds the section with the branch, both subjects and the path, aftertasks.mdand before# Your group. - Test first: a checkout whose
.git/configsetscore.fsmonitorand an external diff driver starts neither program when the step builds the section. - A test: the section has at most 300 o200k tokens for 20 changed paths.
- Measure: the git read calls and the chain refusals in the first 15 calls of each step, from runner runs since 2026-11-12 (needs the
step startline of feat(roadmap): run records give the run, step and path class of tool calls #5460). Give n with each baseline, and extend the window until n is at least 30 runs. Usedevops roadmap eval implementas a screen only. - Live proof after release: the same counts on real Service runner runs for 7 days.
Dependencies
-
chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
-
Issue feat(roadmap): run records give the run, step and path class of tool calls #5460 gives the
step startline for the measure. Land this item before the E2 A/A pass of the pipeline split. feat(roadmap): the implement shell and prompt use the preset #4645 changes the implement prompt; do not stack the pull requests.
Standards Compliance
- I confirm this proposal aligns with AGENTS.md engineering principles (cyclomatic complexity <= 10, nesting <= 4 blocks, zero bare exceptions, tests that cover the changed lines).
Alternatives check of 2026-11-29: in-use.
The repository already uses this tool.
Tool: git/git (https://github.com/git/git), NOASSERTION, last activity 2026-11-29, maintained.
Reason: Searches found no other tool, and git reads the branch, merge-base, commit subjects and per-path numstat counts; the issue already names git through the existing credential-free local runner, so only the section renderer is new.
Covers:
- Branch name and base commit from the merge-base
- Commit subjects oldest first with log format
- Added and removed line counts for each changed path
- Hardened flags that skip fsmonitor, external diff and textconv
Lacks:
- No section text, placement after tasks.md or before the group heading
- No 300-token cap or dropped-path count
- No pure renderer or test seam for the pipeline split
Proposed design
Problem statement
Each task group of an implement step starts a new agent. The agent repeats git read calls to find the branch, the commits on the branch and the changed files. The step already holds the branch and can resolve the base once. Add a # Checkout state section to the step message so the agent starts with that state.
Acceptance criteria
Requirement: Checkout state section
The implement step message SHALL hold a # Checkout state section with the mark at step start.
Scenario: Message holds the section
- WHEN A step builds its message for a group.
- THEN The message holds
# Checkout stateand the lineat step start.
Requirement: Checkout state content
The section SHALL give the branch, the base commit, the commit subjects oldest first, and each changed path with its added and removed counts.
Scenario: Two commits and one changed file
- WHEN A step with two commits since the base and one changed file builds its message.
- THEN The section holds the branch, the base commit, both subjects, and the path with its added and removed counts.
Requirement: Section order
The message MUST place the section after the tasks.md text and the item comments, and before # Your group.
Scenario: Section between tasks.md, comments and the group
- WHEN A step builds its message from a change that holds
tasks.md, one item comment and a group. - THEN The index of
# Checkout stateis greater than the index of thetasks.mdtext and the comment, and less than the index of# Your group.
Requirement: Hardened changed-path read
The step MUST read the changed paths through the existing local runner with no credentials and with -c core.fsmonitor=false, --no-ext-diff and --no-textconv.
Scenario: Configured fsmonitor and external diff driver
- WHEN A checkout sets
core.fsmonitoranddiff.externalto programs that write a marker file, and the step builds the section. - THEN No marker file exists and the section holds the changed path.
Requirement: Settings check before the read
The step MUST call check_settings before it reads the commit subjects and changed paths.
Scenario: Settings check comes first
- WHEN The step builds the section.
- THEN The step calls
check_settingsbefore the first git call.
Requirement: Pure section renderer
The renderer SHALL take only the branch, the base commit, the commit subjects and the changed-path stats, and return the section text.
Scenario: Renderer takes only step data
- WHEN The renderer is called twice with the same data.
- THEN It returns the same text and starts no process.
Requirement: Token budget
The renderer MUST keep the section within 300 o200k tokens for 20 changed paths.
Scenario: Twenty changed paths
- WHEN The renderer builds the section for 20 changed paths.
- THEN The token count that
count_tokensgives for the section is at most 300.
Requirement: Token budget overflow
When the section would exceed 300 o200k tokens, the renderer SHALL drop paths from the end and state the count of dropped paths.
Scenario: Long changed-path list
- WHEN The renderer builds the section for changed paths that would exceed 300 tokens.
- THEN The token count is at most 300 and the section states the count of dropped paths.
Requirement: No task checklist
The renderer SHALL NOT add a task checklist to the section.
Scenario: Section holds no checkbox
- WHEN The renderer builds the section.
- THEN The section holds no
- [ ]or- [x]text.
Requirement: Pending a person after the merge
A person SHALL measure the git read calls and chain refusals in the first 15 calls of each step on real Service runner runs.
Scenario: Post-release measurement
- WHEN The
step startline of feat(roadmap): run records give the run, step and path class of tool calls #5460 is present and the change is live for 7 days. - THEN The measurement gives n and each baseline, with n at least 30 runs, and the counts do not increase.
Existing Tool Considered
The alternatives check of 2026-11-23 in the issue body returned in-use for git/git (https://github.com/git/git). The repository already uses git through the existing credential-free local runner. The check names what git covers and lacks. The proposal uses git for the branch, base, subjects and numstat. The collector adds the hardened flags, and a pure renderer adds the # Checkout state section, its placement and its 300-token cap. Written cost: about 0.6M tokens and 2 hours, about 60 lines and 4 tests.
Key questions
- Which data gives the branch, the base commit, the commit subjects and the changed paths?: The run holds the branch and the default branch. The collector resolves the base with
resolve_merge_baseon the default branch and the branch tip. The step does not hold the commit subjects or the changed-path stats, so the collector reads them with git. The section lists the commits on the branch since the base, because a stopped step keeps no work. [sources: src/devops_cli/roadmap/implement/implement_run.py:629, src/devops_cli/roadmap/implement/implement_run.py:703, src/devops_cli/git/operations.py:579, CONTEXT.md:146] - How does the step get the branch and the base?:
_ItemRunpassesself.branchandself.defaulttorun_step, which passes them tobuild_step_inputs. The collector resolves the base withresolve_merge_baseand gives it to the pure renderer. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py:629, src/devops_cli/roadmap/implement/implement_run.py:703, src/devops_cli/roadmap/implement/implement_step.py:433]- Chosen: Pass the branch and default branch as parameters. The run holds them, and explicit parameters keep the prompt builder inputs visible and the renderer pure.
- Rejected: Read the job record inside build_step_inputs. It couples the prompt builder to the store and makes a step test need a job record.
- Rejected: Read the branch and default branch with git inside build_step_inputs. It repeats data that the run already holds.
- Which commit is the base for the section?: Use the merge-base of the default branch and the branch tip, resolved with
resolve_merge_base.implement.baseis for withdraw, not for the diff. It is the branch tip before the job for a Staged item, which is not an ancestor after the start rebase, andnewfor a Planned item. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:170, src/devops_cli/roadmap/implement/implement_run.py:869, src/devops_cli/roadmap/implement/implement_run.py:886, src/devops_cli/git/operations.py:579]- Chosen: Merge-base with the default branch. It is the commit where the item branch left the default branch, and the project already uses
resolve_merge_basefor changed files. - Rejected: The
implement.baserecord. It is the branch tip before the job for a Staged item, which is not an ancestor after the start rebase, andnewfor a Planned item. - Rejected: The step start commit. It is the branch tip, so the diff would hold no earlier group work.
- Chosen: Merge-base with the default branch. It is the commit where the item branch left the default branch, and the project already uses
- Where does the
# Checkout statesection go in the step message?: Place the section after the text oftasks.mdand the item comments, and before# Your group. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py:469, src/devops_cli/roadmap/implement/implement_step.py:474, src/devops_cli/ai/tasks/roadmap_implement_step.md:1]- Chosen: After tasks.md and the comments, before # Your group. It keeps the change documents and the item comments in the shared cache prefix and puts the step state just before the group.
- Rejected: Before the change documents. It moves per-item text after the step state and breaks the shared prefix.
- Rejected: At the end of the message. It puts the state after the group and away from the first read of the agent.
- How does the step read the changed paths without starting a program that the agent wrote?: Call
check_settingsfirst. Then run the hardened local runner with no token:git -C <checkout> -c core.fsmonitor=false merge-base -- <default> HEADfor the base,git -C <checkout> -c core.fsmonitor=false log --format=%s --reverse <base>..HEADfor the subjects, andgit -C <checkout> -c core.fsmonitor=false diff --no-ext-diff --no-textconv --numstat <base> HEADfor the paths. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py:1929]- Chosen: Hardened local git runner. It uses the existing runner, checks the settings first, and disables fsmonitor, external diff and textconv.
- Rejected: Read .git files directly. It duplicates git parsing and misses the index and worktree state.
- Rejected: Use pygit2 or dulwich. It adds a dependency and does not render the section. The alternatives check gives
in-usefor git.
- Does the section renderer run git or take data?: A pure renderer takes the branch, base, subjects and path stats. A separate collector runs git. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py:433]
- Chosen: Pure renderer plus collector. It is testable offline and a later scaffold unit can own it.
- Rejected: Renderer runs git. It makes the function impure and hard to test.
- How does the section stay within 300 o200k tokens?: Count the section with
count_tokens. If it exceeds 300, drop changed paths from the end and state the count of dropped paths. (best practice) [sources: src/devops_cli/ai/context_budget.py:90, src/devops_cli/roadmap/implement/implement_step.py:483]- Chosen: Cap with an omitted count. It keeps the section bounded and tells the agent that paths are missing.
- Rejected: List all paths. Long path lists can exceed the 300-token budget.
- Rejected: Drop the whole changed-path list. It loses the state that the section exists to give.
- Does the section include a task checklist?: No.
tasks.mdis already in the message. A second list adds tokens and can disagree. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_implement_step.md:12, src/devops_cli/roadmap/implement/implement_step.py:474]- Chosen: No checklist. It avoids duplicate text and token cost.
- Rejected: Include a checklist. It duplicates
tasks.mdand can disagree with it.
- What format does the section use?: Use a Markdown section. Put the mark
at step starton its own line after the heading. Give one bullet for the branch. Give one bullet for the base commit. Give a list of commit subjects, oldest first. Give a list of changed paths with(+added/-removed). (best practice) [sources: src/devops_cli/ai/tasks/roadmap_implement_step.md:1, src/devops_cli/roadmap/implement/implement_step.py:474]- Chosen: Markdown bullet list. It is compact, readable and cheap in tokens.
- Rejected: JSON block. It adds syntax and tokens for data that the agent reads as text.
- Rejected: Table. Long paths wrap and cost tokens.
- What does the item wait on?: It waits on chore(roadmap): hold incremental stage and implement work #6521, the hold of the re-architecture of refactor(roadmap): re-architect stage and implement on Coder #6519. feat(roadmap): the implement shell and prompt use the preset #4645 changes the implement prompt, so its pull request lands first. feat(roadmap): run records give the run, step and path class of tool calls #5460 supplies the
step startline for the measurement. [sources: docs/roadmap/refine.md:19, docs/roadmap/refine.md:21, docs/roadmap/refine.md:23, docs/roadmap/refine.md:29]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 13, 2026
Both work on the implement step and the wip: commit list, but #3054 delivers the commit list on stop while this candidate reads that list to build a state section in the step message.devops-cli-service commentedon Nov 17, 2026
Alternatives check: none
Reason: The web searches returned only generic documentation pages and no tool that builds a "Checkout state" section into an agent step message. The issue itself concludes that no tool is necessary: git and the step's recorded
wip:commit list already give the branch, base commit, subjects and changed paths, and the work is about 60 lines in the project's own prompt code. The closest libraries found (Dulwich, pygit2) only replace the git reads the project already has through its hardened local runner; they do not produce the section, its position before# Your group, or its token budget.Tool: none found
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 18, 2026
Refine cannot set this item to Ready at 9be129e while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/ai/tasks/roadmap_implement_step.md.devops-cli-service commentedon Nov 19, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
fix(roadmap): Keep blockers that a sentence opens with other words (#…
devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 23, 2026
The result in the alternatives block of the issue body changed. Before this check:
none, no tool. A person decides what the new result means for the item.Searches (5)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 27, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 30, 2026
Premise check after the release of the hold #6521 (2026-11-30): the premise is false:
StepConversation(implement_step.py:642) carries one conversation across the groups of an item (#6527), and thegit_isolation.pyrunner and its refusals went with the allowlist. Closed as not planned (AGENTS.md rule 2); a person may reopen it, or file a new item from fresh evidence.