Repository navigation
Description
Split from #5466.
Problem or Motivation
The stage planner reads again the files that its request holds. The change of #5466 adds a given set to the trace gate and numbers the context code lines. Nobody can say how many re-reads the change removes until real Service runs exist. The sample of 2026-11-06 to 2026-11-13 holds 383 read_file calls on cited files that the capped context kept, in 42 of 52 items. The count of 383 does not split the reads for line numbers from the reads that the gate forced. The run index of #5460 makes the measure exact for each run.
Why this part is deferred
The count needs 7 days of real Service stage runs. #5433 has merged and logs the subject of each refused claim (src/devops_cli/roadmap/stage/stage_findings.py:227), so the baseline can be taken from the runs before the gate change reaches the Service. No pull request delivers a 7-day observation, so this part waits on an outside event. The rest of #5466 stays in its own item.
Acceptance Criteria
- Baseline first: from the runs before the gate change reaches the Service, count for 7 days the refused paths that the capped context held. Record that count in
## Feasibilityas the baseline, not 383. - Measure: report the re-reads of context paths in two parts: re-reads for line numbers (a ranged read of a given range) and re-reads that the gate forced.
- Live proof after release: on real Service stage runs for 7 days, give the
read_filecalls on context paths (sample baseline 383 in 42 of 52 items), the ownread_issueand no-argumentread_speccalls (baseline 33), and the share ofstage_problem_trace_pathin thestage gate returnslines (baseline 10 of 60).
Proposed design
Problem statement
The stage planner reads again the files that its request context holds. No report splits these re-reads by cause. Nobody can say how many re-reads the trace-gate change of #5466 removes. This change adds one report command over the per-run stage records of the run index of #5460. The report counts the context reads, their causes, the issue and spec reads, the trace path share and the refused context paths of a window.
Acceptance criteria
Requirement: The report counts the reads of context paths
The stage re-read report SHALL print the count of the read_file calls on the paths that the request context of the run held, for its window.
Scenario: Two context reads and one read outside the context
- WHEN
uv run pytest tests/roadmap/stage/test_stage_rereads.pyserves the report a run index with tworead_filecalls on context paths and oneread_filecall on a path outside the context - THEN the report prints
context_reads=2
Requirement: The report splits the reads of context paths by cause
The stage re-read report SHALL split the reads of context paths into line-number reads and gate-forced reads.
Scenario: One ranged read and one read after a trace refusal
- WHEN
uv run pytest tests/roadmap/stage/test_stage_rereads.pyserves the report oneread_filecall with a start line and an end line on a context path, and oneread_filecall with no range on a path that astage_problem_trace_pathfinding of the reply before it names - THEN the report prints
line_number=1 gate_forced=1
Requirement: The report counts the issue read and the no-argument spec read
The stage re-read report SHALL count the read_issue calls and the read_spec calls with no argument of the runs in its window.
Scenario: Two issue reads and one no-argument spec read
- WHEN
uv run pytest tests/roadmap/stage/test_stage_rereads.pyserves the report a run index with tworead_issuecalls and oneread_speccall with no argument - THEN the report prints
read_issue=2 read_spec_noarg=1
Requirement: The report gives the share of the trace path code
The stage re-read report SHALL give the share of stage_problem_trace_path in the stage gate returns lines of its window.
Scenario: One of three returns names the trace path code
- WHEN
uv run pytest tests/roadmap/stage/test_stage_rereads.pyserves the report threestage gate returnslines, and one of them namesstage_problem_trace_pathin itscodes= - THEN the report prints
trace_path_share=1/3
Requirement: The report gives the refused context paths of a window
The stage re-read report SHALL print the number of distinct subject paths of the stage_problem_trace_path findings of the last refused reply of each run that the request context held.
Scenario: One refused reply with three findings on two context paths
- WHEN
uv run pytest tests/roadmap/stage/test_stage_rereads.pyserves the report one refused reply with threestage_problem_trace_pathfindings on two distinct context paths - THEN the report prints
baseline_refused_paths=2
Requirement: The report counts only the runs inside its window
The stage re-read report MUST leave out each run whose time is outside the window that the report names.
Scenario: A run one day before the window
- WHEN
uv run pytest tests/roadmap/stage/test_stage_rereads.pyserves the report one run inside the window with two context reads and one run one day before the window with three context reads - THEN the report prints
context_reads=2
Requirement: Pending a person after the merge
The change MUST give the counts of the report over the real Service stage run records of the 7 days before the trace-gate change of #5466 reaches the Service and of the 7 days after it.
Scenario: The two live windows on the Service records
- WHEN a person runs
uv run devops roadmap eval stage rereads --since <start> --until <end>on the Service stage run records of each 7-day window - THEN the report prints
context_reads,line_number,gate_forced,read_issue,read_spec_noarg,trace_path_shareandbaseline_refused_pathsfor each window, and the person records the baseline count in a comment on this issue
Existing Tool Considered
No alternatives check has run for this item. jq and DuckDB are open and maintained, and they read and count JSON records. They lack the stage run record schema, the pairing of a read with a finding code, the request-context check and the parse of the stage gate returns lines. The change builds a report module of the roadmap eval group and one command. The module is about 200 lines with its tests. The written cost is about 80k tokens to build, keep and fix that code, and about one day of elapsed work.
Key questions
- Which records does the report read?: The per-run records of the run index of feat(roadmap): run records give the run, step and path class of tool calls #5460. Each record holds the tool calls of one run with their arguments, the findings of its replies and the paths that the request context held. (best practice) [sources: src/devops_cli/roadmap/stage/stage_plan_record.py:53, src/devops_cli/roadmap/agent_run.py:419, openspec/changes/archive/2026-11-29-5460-run-records-tool-calls/proposal.md]
- Chosen: Read the run index of feat(roadmap): run records give the run, step and path class of tool calls #5460. It keeps each run's tool calls with their arguments, so the report splits a read by cause and counts the calls.
- Rejected: Read the per-item plan records. They hold the request, the proposal and
PlanFactsonly, and no per-call line range. - Rejected: Read the trace comments of the staged pull requests. A refused run opens no pull request, so its reads have no comment.
- How does the report tell a line-number read from a gate-forced read?: A
read_filecall with a start line and an end line is a line-number read. Aread_filecall with no range is a gate-forced read when astage_problem_trace_pathfinding of the reply before it names the same path. Any other read counts in neither part. (best practice) [sources: src/devops_cli/roadmap/stage/stage_findings.py:227, src/devops_cli/roadmap/stage/stage_tools.py:406]- Chosen: Pair the read with the finding subject. The finding holds its code and its subject path, so the pair is exact and the same records give the same count.
- Rejected: Pair the read with the call before it. The order of the calls differs between runs, so the pair is not exact.
- Rejected: Classify the reads with a model. The same records must give the same count, and a model gives no stable count.
- Which log line holds the share of
stage_problem_trace_path?: Thestage gate returnsline. The share is the count of these lines whosecodes=namesstage_problem_trace_path, over allstage gate returnslines of the window. [sources: src/devops_cli/roadmap/round_log.py:72, src/devops_cli/roadmap/stage/stage_finding_classes.json:132] - Which calls are the own issue read and the no-argument spec read?: A
read_issuecall, and aread_speccall with no capability.read_specwith no capability lists the capabilities, so the call reads no spec body. [sources: src/devops_cli/roadmap/stage/stage_tools.py:343, src/devops_cli/roadmap/stage/stage_tools.py:406] - Does the report wait for the run index of feat(roadmap): run records give the run, step and path class of tool calls #5460?: No wait. feat(roadmap): run records give the run, step and path class of tool calls #5460 has merged: the change
openspec/changes/archive/2026-11-29-5460-run-records-tool-callsadded therun_indexandrowfields toToolCallRecord(src/devops_cli/roadmap/agent_run.py:419). The report reads that merged run index. The per-item plan and refused records hold no per-call line range and no count of theread_issueandread_speccalls, so the report reads the run records. [sources: openspec/changes/archive/2026-11-29-5460-run-records-tool-calls/proposal.md, src/devops_cli/roadmap/agent_run.py:419, src/devops_cli/roadmap/stage/stage_plan_record.py:53] - Does the item continue while the stage job is re-architected?: No. The project records chore(roadmap): hold incremental stage and implement work #6521 as an open hold issue: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture of refactor(roadmap): re-architect stage and implement on Coder #6519. chore(roadmap): hold incremental stage and implement work #6521 has no sub-issue and no
type/epiclabel, so it is no tracker, and it holds the item back. The item continues when a person closes chore(roadmap): hold incremental stage and implement work #6521. [sources: docs/roadmap/refine.md:24, tests/roadmap/refine/test_roadmap_refine_dependencies.py:23] - Where does the baseline count go, and who takes it?: A person runs the new command on the runs of the 7 days before the trace-gate change reaches the Service, and records the count in a comment on this issue. The merge archives the change folder, and a later edit of an archived folder is a commit that only updates tracking. (best practice) [sources: CONTEXT.md, AGENTS.md]
- Chosen: Record the count in a comment on this issue. CONTEXT.md keeps roadmap state in issues, and the merge archives the change folder.
- Rejected: Record the count in the
## Feasibilityof the change folder. The merge archives the folder, and AGENTS.md rule 8 refuses a commit that only updates tracking. - Rejected: Keep the sample 383 as the baseline. The sample does not split the reads by cause, so it is no baseline for the gate change.
Fit
Fits in one pull request.
Suspected block
The release of #5466 must reach the Service. The 7-day baseline window closes then, and the live window needs 7 days of real Service stage runs after it.
Activity
devops-cli-service commentedon Nov 18, 2026
Both concern stage re-reads of the request context, but #5466 changes the trace gate code and the candidate observes the re-read count after that change ships.devops-cli-service commentedon Nov 19, 2026
Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.
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.
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 Dec 1, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Dec 1, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence