Repository navigation
Description
Problem
Since PR #4195 (failure classes and runner facts in the stage context), a live run of devops roadmap eval stage ends 42 of its 48 cases as refused before it makes any model call. The baseline of #3566 cannot score those cases, so it would measure only 6 cases.
I measured this at origin/main (release 0.98.0) with no model call:
- The planner (
plan_iteminstage.py) builds the request in_request. It callscollect_stage_facts_context, and this call reads four files at the staging commit of the case:src/devops_cli/roadmap/failure.py,src/devops_cli/roadmap/runner_tools.py,Dockerfileandk8s/devops/cronjob-runner.yaml. - The golden cases are frozen at old commits (the
base_commitofcase.json). Most of those commits are older than these files. When a file is absent,build_failure_taxonomy_contextorbuild_runner_capabilities_contextraisesRoadmapStageError("Staged source moved or missing: <path>"). The eval counts aRoadmapStageErrorasrefused(_endedinstage_eval_run.py). - The section is added when the issue text matches a word list:
retry,review,stop,tier,failure(failure.py), or the name of a tool such asdevops,uv,gh,python(the three runner files). Almost every case matches. - Count of the 48 cases that the run plans (the other 7 hold no commit and the run leaves them out):
- 30 miss
failure.pyandrunner_tools.py. - 9 miss
runner_tools.pyonly. - 3 miss
failure.pyonly (cases 3167 and 3174, and the commitac16675a). - 6 pass: 3173, 3278, 3372, 3410, good-3264, good-3410.
- Total refused: 42 of 48.
- 30 miss
devops roadmap eval stage --dry-runstill reports 48 cases to run, because the dry run lists the cases and does not build the context. It does not show the problem.- The cases hold the
facts.jsonfile for the gates, but no file for the facts of the context. So the frozen cases lack the four files, not a field.
The cause is that the eval reads the runner facts at the old commit of the case, while the facts describe the runner of today.
Expected
The eval runs the same context code as the job (collect_stage_facts_context), and every case that holds a commit reaches the model. Choose one way to supply the files:
- The eval gives
collect_stage_facts_contexta reader that tries the commit of the case first and then this checkout (the facts describe the runner now, not the era of the plan). The job code does not change. This is the recommended way. - The context builder leaves out a section when its file is absent. This loses the loud error in the job when a staged source moves, so I do not recommend it.
- Store the four files in each case. This is not possible: a case holds an old commit, and 54 copies of the same files go stale.
The eval must not use a second context builder.
Acceptance criteria
uv run pytest tests/roadmap/stage/test_roadmap_stage_eval_facts_context.pypasses. The new test loads every case oftests/fixtures/roadmap_eval/stagethat holds a commit, builds the facts context with the reader of the eval, and asserts that none raisesRoadmapStageError. Today it fails with 42 failures.uv run devops roadmap eval stage --no-toolbox --limit 1 --case 2116reports the case as planned or failed, neverrefusedwith the text "Staged source moved or missing". This is a live run, so run it once after the fix, with the model cap of test(roadmap): run the cloud baseline of the stage eval #3566 in force.- The job keeps its error: a test shows that
_requestof the job still raisesRoadmapStageErrorwhenfailure.pyis absent at the staged commit (the test exists intests/roadmap/stage/test_roadmap_stage_context.py; it stays green).
Existing tool considered
git show <commit>:<path> (already used by _read_staged_file) and the standard library. No new tool or library is needed. The change passes a different reader to a function that already takes one.
Cost
About 40 lines of code and one test file, and one round of review. The cost of not fixing it is larger: a live baseline run scores 6 of 48 cases, and a prompt or model change cannot be measured on the golden set.
Related
- test(roadmap): run the cloud baseline of the stage eval #3566 (the baseline run on the golden set, blocked by this issue)
- feat(roadmap): add failure classes and runner facts to stage context #4195 (added the facts context to the stage context)
- test(roadmap): score the stage pipeline with a cloud model first #3207 (the golden set of the stage job)
- test(invariants): validate stage eval fixtures against schema and tree #4059 (validates the eval fixtures against a schema and the tree; it does not cover the facts context)
Proposed design
Problem statement
Since PR #4195, the stage eval builds the facts context from four files that it reads at the old commit of each golden case. Most commits are older than those files. The read raises RoadmapStageError, and the eval counts the case as refused. 42 of 48 cases end refused before any model call, so the baseline of #3566 would score only 6 cases.
Acceptance criteria
Requirement: Eval facts reader
The stage eval SHALL give collect_stage_facts_context a reader that tries the commit of the case first and then the current checkout.
Scenario: Case commit lacks failure.py
- WHEN The eval builds the facts context for a case whose commit holds no src/devops_cli/roadmap/failure.py
- THEN The reader returns the text of the file from the current checkout and no RoadmapStageError is raised.
Requirement: Every golden case builds facts
The facts context of every golden case that holds a commit SHALL build with the reader of the eval without a RoadmapStageError.
Scenario: All cases build
- WHEN The new test tests/roadmap/stage/test_roadmap_stage_eval_facts_context.py loads every case of tests/fixtures/roadmap_eval/stage that holds a commit and builds its facts context
- THEN No case raises RoadmapStageError.
Requirement: Commit text wins
The eval reader MUST return the text at the commit of the case when the commit holds the file.
Scenario: Commit holds the file
- WHEN The reader gets a path that the case commit holds
- THEN The reader returns the text of the commit and not the text of the checkout.
Requirement: Job keeps its error
The job SHALL still raise RoadmapStageError when a staged source file is absent at the staged commit.
Scenario: failure.py absent in the job
- WHEN The job builds the request and failure.py is absent at the staged commit
- THEN RoadmapStageError is raised, and the existing tests in test_roadmap_stage_context.py stay green.
Requirement: One context builder
The eval MUST use collect_stage_facts_context of the job and MUST NOT use a second context builder.
Scenario: Eval and job share the builder
- WHEN A test inspects the call of the eval path that builds the facts context
- THEN The call goes to collect_stage_facts_context with the reader of the eval.
Existing Tool Considered
No new tool or library is needed. git show <commit>:<path>, already used by _read_staged_file, and the standard library cover the need. The change passes a different reader to collect_stage_facts_context, which already takes one. Cost: about 40 lines of code, one test file and one round of review.
Key questions
- How does the eval supply the four fact files to the context builder?: The eval passes a reader that tries the commit of the case first and then the current checkout. The job code does not change. (best practice) [sources: src/devops_cli/roadmap/stage/stage_context_facts.py, src/devops_cli/roadmap/stage/stage_eval_run.py, tests/roadmap/stage/test_roadmap_stage_context.py]
- Chosen: Reader with commit-then-checkout fallback in the eval. The facts describe the runner of today. The job keeps its loud error. The builder already takes a reader.
- Rejected: Builder leaves out a section when its file is absent. The job would lose the error that shows a moved staged source.
- Rejected: Store the four files in each case. A case holds an old commit, and many copies of the same files go stale.
- Does the builder already take a reader as an argument?: Yes. collect_stage_facts_context takes the issue text and a read function, and the tests pass a read function. [sources: tests/roadmap/stage/test_roadmap_stage_context.py, src/devops_cli/roadmap/stage/stage_context_facts.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 9, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.The eval is almost fully non-functional (42 of 48 cases refused), blocking regression measurement.The stage eval is the primary regression gate for the stage job; without it, changes ship unmeasured.About 40 lines of code and one test file, per the candidate's cost estimate.Both concern the stage eval command, but #3028 created it and the candidate fixes a context-reading bug introduced after delivery.devops-cli-service commentedon Nov 9, 2026
Status set to Ready at d37762b (see proposed design in issue body).
test(roadmap): the stage eval reads the runner facts in the checkout
devops-cli-service commentedon Nov 9, 2026
Released in v0.100.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.100.1
devops-cli-service commentedon Nov 9, 2026
Live since 2026-11-09 12:32 UTC