Skip to content

fix(roadmap): stage context reads runner facts from the package - #4723

Merged
dan-petty merged 2 commits into
mainfrom
fix/4628-stage-context-reads-runner-facts-from
Nov 11, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4628-stage-context-reads-runner-facts-from

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The stage facts context read 4 devops-cli paths from the staged commit of the target and raised RoadmapStageError when one was absent. The commits of the 6 other repositories hold none of them, so the stage gave no verdict for most of their items. The failure classes, the runner tools and NOT_IN_RUNNER now come from the installed modules, because the runner image is the devops-cli image for every repository. The Dockerfile packages and the pod security settings come from the staged commit only when it holds runner_tools.py, and the builder raises no error. Each NOT_IN_RUNNER line now holds its reason text, not the name of a constant. A test holds the 3 staged fact paths, so a move fails in CI.

Closes #4628

Change: openspec/changes/archive/2026-11-11-4628-stage-context-reads-runner-facts-from/

The stage facts context read failure.py, runner_tools.py, the Dockerfile
and the pod manifest from the staged commit, and raised when a path was
absent. A commit of another repository holds none of them, so the stage
gave no verdict for most of its items.

The failure classes, the runner tools and NOT_IN_RUNNER now come from the
installed modules. The Dockerfile packages and the pod security settings
come from the staged commit only when it holds runner_tools.py. A test
holds the 3 staged fact paths, so a move fails in CI.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 11, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Measurements

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main: 6 failed on base (6 failed and 10 passed in tests/roadmap/stage/test_roadmap_stage_context.py and tests/roadmap/stage/test_roadmap_stage_eval_facts_context.py; 0 errored).

Test that failed on base Base error
test_a_retry_text_gets_the_failure_taxonomy_from_a_commit_of_another_repository RoadmapStageError: Staged source moved or missing
test_a_uv_text_gets_the_runner_tools_from_a_commit_of_another_repository RoadmapStageError: Staged source moved or missing
test_the_dockerfile_of_another_repository_gives_no_image_facts RoadmapStageError: Staged source moved or missing
test_each_not_in_runner_line_holds_its_reason_text AssertionError: assert ['kustomize', ...] == []
test_a_case_whose_checkout_lacks_the_module_files_too_reaches_the_model the case ended refused, 0 model calls
test_the_job_reaches_the_model_when_the_staged_commit_lacks_the_module_files RoadmapStageError: Staged source moved or missing

Proof on a real failure

The Service log holds the failure. Loki, {service_name="roadmap-service"} |= "Staged source moved or missing", last 24 h, 2 lines:

  • 2026-11-11T14:37:35Z: Service job execution failed for dan-petty/dotfiles: ... stage: the stage job failed for 1 item(s): #1 (RoadmapStageError: Staged source moved or missing: src/devops_cli/roadmap/runner_tools.py)
  • 2026-11-11T15:19:04Z: the same error for dan-petty/homelab items 1 and 2.

Reproduction of the dotfiles failure. The script reads the title and body of item 1 of dan-petty/dotfiles, clones the main branch of that repository read-only, and runs collect_stage_facts_context with _read_staged_file of stage.py (the read of the job) at the commit. It runs the base module (origin/main) and the module of this change:

commit: 7d80c9105f8a | failure words: False | tool names: True
base: RoadmapStageError: Staged source moved or missing: src/devops_cli/roadmap/runner_tools.py
change: no error, 4935 characters, headings: ['### Runner capabilities', '#### Image tools', '#### Excluded tools (NOT_IN_RUNNER)']

The base gives the error of the log. The change gives the runner section with no image facts, because the commit is not a devops-cli commit.

The devops-cli text

The base builder and the new builder ran on the devops-cli files, with a text that triggers both sections:

  • 86 lines in each text. 22 lines differ, and each is a NOT_IN_RUNNER entry. The base values of those lines were _NO_CLUSTER, _SCANNER, _NO_GATE_STEP and exclusion rule: the name of a constant, not a fact. The new lines hold the reason text of the installed dict.
  • Every other line is byte-equal: the failure classes, the action rules, the installed packages, the runner tools and the pod security settings.
  • Size: 2,655 characters before, 5,985 after (about 830 tokens more, only for an item whose text names a tool).

Stage eval replay

uv run devops roadmap eval stage --replay on the change: "every gate refuses what it must refuse", and the good plans that every gate accepts: 5 of 5. The change changes no gate, and the replay does not build the facts context (replay_case in stage_eval_gates.py calls no planner), so the base gives the same result.

Tests

  • uv run devops ci test before the rebase: 23,054 passed, 2 skipped, 1 failed: tests/ci/test_ci_gate_admission.py::test_a_cached_verdict_takes_no_slot. The cause was the run itself: it wrote its log file into the worktree root while it ran, so the workspace fingerprint of the test changed and the cache missed. The test passes alone (11 passed in tests/ci/test_ci_gate_admission.py).
  • After the rebase onto origin/main, the 2 changed test files: 16 passed.
  • uv run devops openspec check: passed. uv run devops openspec archive: every spec and change validates.

Live steps (for a person, after the merge)

  1. Merge, let release-please make the release, and let Argo CD roll roadmap-service in the namespace devops to the release image.
  2. Confirm the image: kubectl -n devops get deployment roadmap-service -o jsonpath='{.spec.template.spec.containers[0].image}' names the release that holds this change.
  3. Let the Service poll stage the waiting items of dan-petty/dotfiles and dan-petty/homelab (the 5-minute poll), or wait for the next round.
  4. Loki, 24 h after the rollout: {service_name="roadmap-service"} |= "Staged source moved or missing" gives 0 lines.
  5. Item 1 of dan-petty/dotfiles and items 1 and 2 of dan-petty/homelab get a stage verdict that is not this error. test(roadmap): confirm the stage error is gone after the rollout #4663 holds steps 4 and 5.

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 18:10
@dan-petty
dan-petty merged commit 05e09dc into main Nov 11, 2026
32 checks passed
@dan-petty
dan-petty deleted the fix/4628-stage-context-reads-runner-facts-from branch November 11, 2026 18:10
dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.112.3](v0.112.2...v0.112.3)
(2026-11-11)


### Bug Fixes

* **ai:** record the duration of each agent model request
([#4717](#4717))
([1930b71](1930b71))
* **devcontainer:** poll the Docker daemon through the clock
([#4721](#4721))
([be32268](be32268))
* **roadmap:** confine repair fix turns to the plan files
([#4689](#4689))
([d2e7597](d2e7597))
* **roadmap:** name the nearest test of a module
([#4696](#4696))
([b746c95](b746c95))
* **roadmap:** scoped intake reads a bounded page count
([#4740](#4740))
([f89ccc5](f89ccc5))
* **roadmap:** stage context reads runner facts from the package
([#4723](#4723))
([05e09dc](05e09dc))
* **roadmap:** stage holds an item where openspec is not set up
([#4749](#4749))
([45bd54a](45bd54a))
* **roadmap:** trace gate reads a tool call citation
([#4694](#4694))
([5c71ad4](5c71ad4))


### Performance Improvements

* **ci:** cancel superseded CodeQL runs and idle triggers
([#4763](#4763))
([c951368](c951368))


### Code Refactoring

* **ai:** delete orphan prompts and the prompt fallbacks
([#4710](#4710))
([38a1b13](38a1b13))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): stage context reads runner facts from the package

1 participant