Skip to content

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

Closed

Description

@dan-petty

Problem Description

src/devops_cli/roadmap/stage/stage_context_facts.py:18-21 names 4 devops-cli paths: src/devops_cli/roadmap/failure.py, src/devops_cli/roadmap/runner_tools.py, Dockerfile and k8s/devops/cronjob-runner.yaml. The stage reads them from the staged commit of the target repository. When a path does not exist, the code raises RoadmapStageError (:101-105 and :214-226). The trigger regexes match most issue texts (:23-26: retry, review, stop, tier and failure; :28-36: about 40 tool names such as uv and python). So the stage fails for most items in the 6 other repositories.

Reproduction Steps

  1. Let the Service stage an item of dan-petty/dotfiles or dan-petty/homelab whose text names uv, python or retry.
  2. Read the Service log.

Expected vs Actual Behavior

Expected: the stage gives a verdict for the item.
Actual: the stage raises "Staged source moved or missing: src/devops_cli/roadmap/runner_tools.py".

Logs, Traces, or Terminal Output

Loki over 7 days, {service_name="roadmap-service"} |= "Staged source moved or missing": 2 lines, for dan-petty/dotfiles#1 (2026-11-11 14:37Z), and for dan-petty/homelab#1 and dan-petty/homelab#2 (15:19Z). 3 items in 2 repositories cannot stage.

Proposed Solution & Architectural Design

The runner tools and the failure taxonomy describe the Job image. The Job image is the devops-cli image for every repository.

  • Read RUNNER_TOOLS, NOT_IN_RUNNER and FailureClass from the installed modules devops_cli.roadmap.runner_tools and devops_cli.roadmap.failure for every target. Remove the ast parse of the staged copy.
  • Read the Dockerfile packages and the pod security settings from the staged commit only when the commit holds those files (devops-cli). Otherwise, leave out those 2 subsections. Do not raise.
  • Add a devops-cli test that asserts that the 2 paths exist, so that a move still fails in CI (AGENTS.md rule 11).
  • No profile field is necessary.

Target Subsystem

SDLC, Git & PR Governance (src/devops_cli/roadmap/stage/stage_context_facts.py).

Existing Tool Considered

The fix removes a read and imports the installed modules. No tool is necessary. Cost: about 30 lines and 2 tests, about 80,000 tokens and 1 hour to build, about 2,000 tokens a month to keep.

Acceptance Criteria

  • A unit test: collect_stage_facts_context for a text that names uv, with a read_file that returns None for every path, returns the runner tools section and does not raise.
  • A unit test: for the devops-cli files, the section text is byte-equal to the current output.
  • After the rollout, the Loki query above over 24 h gives 0 lines.
  • fix(security): Source aliases only from ~/.aliases.zsh dotfiles#1, dan-petty/homelab#1 and dan-petty/homelab#2 get a stage verdict that is not this error.

Dependencies

None.

Source: #4627

Proposed design

Problem statement

The stage facts context reads four devops-cli paths from the staged commit of the target repository. The trigger regexes match most issue texts, and the commits of the 6 other repositories hold neither devops-cli module path. The stage then raises RoadmapStageError and gives no verdict. A Dockerfile in another repository describes another image, so it cannot supply the runner facts either. The fix reads the runner tools and the failure taxonomy from the installed modules, which describe the runner image that every repository uses. It reads the Dockerfile and the pod manifest only for a devops-cli commit, and it leaves both subsections out otherwise. The same builder feeds the stage eval, so its tests and the two specs that name the old source change with the fix.

Acceptance criteria

Requirement: Runner facts come from the installed module

The stage facts context SHALL read RUNNER_TOOLS, NOT_IN_RUNNER and FailureClass from the installed devops-cli modules for every target repository.

Scenario: A text names uv and every staged read returns None

  • WHEN collect_stage_facts_context runs on a text that names uv, and read_file returns None for every path
  • THEN the context holds the runner tools section and raises no RoadmapStageError

Requirement: The failure taxonomy comes from the installed module

The stage facts context SHALL read FailureClass from the installed devops_cli.roadmap.failure module.

Scenario: A text names retry and every staged read returns None

  • WHEN collect_stage_facts_context runs on a text that names retry, and read_file returns None for every path
  • THEN the context holds the failure taxonomy section and raises no RoadmapStageError

Requirement: The image facts need a devops-cli commit

The stage facts context MUST read the Dockerfile packages and the pod security settings only when the staged commit holds src/devops_cli/roadmap/runner_tools.py, and MUST leave both subsections out otherwise.

Scenario: Another repository's commit holds a Dockerfile

  • WHEN collect_stage_facts_context runs on a text that names uv, read_file returns a Dockerfile text, and it returns None for src/devops_cli/roadmap/runner_tools.py
  • THEN the context holds no Dockerfile section and no pod security section, and raises no RoadmapStageError

Requirement: The devops-cli facts text stays the same

The stage facts context SHALL give the same text for a devops-cli commit as the current code gives.

Scenario: The staged commit is devops-cli's

  • WHEN collect_stage_facts_context runs on a text that names uv, and read_file returns the devops-cli Dockerfile and k8s/devops/cronjob-runner.yaml
  • THEN the context text is byte-equal to the recorded output of the current code

Requirement: A module move fails CI

A test SHALL assert that src/devops_cli/roadmap/failure.py and src/devops_cli/roadmap/runner_tools.py exist.

Scenario: Both module files exist

  • WHEN the test reads the two module paths
  • THEN both paths exist

Requirement: The stage eval reaches the model for an old commit

The stage eval SHALL reach the model for a case whose commit lacks src/devops_cli/roadmap/failure.py and src/devops_cli/roadmap/runner_tools.py.

Scenario: A golden case commit lacks both module files

  • WHEN run_case runs on a case whose commit lacks both module files and the checkout of the run holds them
  • THEN the case makes a model call and does not end refused with Staged source moved or missing

Existing Tool Considered

No alternatives check ran for this item. A check of the open tools finds none that covers the need: the values are the project's own runtime constants. mkdocstrings/griffe, checked in #3406 for a nearby need, covers a docstring or a signature, not a runtime constant. The standard library import of devops_cli.roadmap.runner_tools (tool_names(), NOT_IN_RUNNER) and devops_cli.roadmap.failure (FailureClass, ACTION_BY_CLASS) covers it, and the stage already imports both modules. Cost: about 30 lines added and about 100 lines of ast parsing deleted, 2 new tests and 2 stage-eval tests updated, about 80,000 tokens and 1 hour to build, and about 2,000 tokens a month to keep.

Key questions

  • Where do the runner tools and the failure taxonomy come from for every target repository?: From the installed modules devops_cli.roadmap.runner_tools and devops_cli.roadmap.failure: tool_names(), NOT_IN_RUNNER, FailureClass and ACTION_BY_CLASS. The stage already imports both modules (stage_change.py imports NOT_IN_RUNNER, and stage.py imports FailureClass), so this adds no dependency. The runner image is the devops-cli image for every repository, so these facts do not depend on the commit of the target. [sources: src/devops_cli/roadmap/runner_tools.py:93, src/devops_cli/roadmap/runner_tools.py:190, src/devops_cli/roadmap/runner_tools.py:240, src/devops_cli/roadmap/failure.py:56, src/devops_cli/roadmap/failure.py:116, src/devops_cli/roadmap/stage/stage_change.py:66, src/devops_cli/roadmap/stage/stage.py:151, docs/ROADMAP_WORKFLOW.md:307]
  • Which paths does the stage read from the staged commit now?: src/devops_cli/roadmap/failure.py, src/devops_cli/roadmap/runner_tools.py, Dockerfile and k8s/devops/cronjob-runner.yaml. build_failure_taxonomy_context raises when the first is missing, and build_runner_capabilities_context raises when any of the other three is missing. [sources: src/devops_cli/roadmap/stage/stage_context_facts.py:18, src/devops_cli/roadmap/stage/stage_context_facts.py:19, src/devops_cli/roadmap/stage/stage_context_facts.py:101, src/devops_cli/roadmap/stage/stage_context_facts.py:214, src/devops_cli/roadmap/stage/stage_context_facts.py:218, src/devops_cli/roadmap/stage/stage_context_facts.py:226]
  • Does reading the installed modules give the same text as the ast parse of the devops-cli staged copy?: Yes. tool_names() returns each RunnerTool.name in the order of RUNNER_TOOLS, NOT_IN_RUNNER is the same dict, and the FailureClass members and ACTION_BY_CLASS keys and values give the same lowercased names that the ast extractor gives. The section text is byte-equal for a devops-cli commit. [sources: src/devops_cli/roadmap/runner_tools.py:93, src/devops_cli/roadmap/runner_tools.py:190, src/devops_cli/roadmap/runner_tools.py:240, src/devops_cli/roadmap/failure.py:56, src/devops_cli/roadmap/failure.py:116, src/devops_cli/roadmap/stage/stage_context_facts.py:49, src/devops_cli/roadmap/stage/stage_context_facts.py:83, src/devops_cli/roadmap/stage/stage_context_facts.py:109, src/devops_cli/roadmap/stage/stage_context_facts.py:142]
  • When does the stage read the Dockerfile and the pod manifest?: Only when the staged commit holds src/devops_cli/roadmap/runner_tools.py, which only the devops-cli repository holds. Read each image file when read_file returns it, and leave out its subsection otherwise. Raise no error. (best practice) [sources: src/devops_cli/roadmap/stage/stage_context_facts.py:19, src/devops_cli/roadmap/stage/stage_context_facts.py:214, k8s/devops/cronjob-runner.yaml:34]
    • Chosen: Gate on the module path. Only devops-cli holds this module. The two image facts then describe the image of the commit under plan.
    • Rejected: Gate on the presence of Dockerfile and the pod manifest. A target repository can hold a Dockerfile for a different image. The stage would give a wrong fact about the runner image.
    • Rejected: Keep raising RoadmapStageError. It stops most items in the 6 other repositories. That is the defect of this issue.
    • Rejected: Add a setting that names the repository kind. The module path already tells the fact, and the runner image is the same for every repository.
  • Do the trigger regexes that decide whether to add the facts stay?: Yes, unchanged. The fix changes where the facts come from, not which items get them. (best practice) [sources: src/devops_cli/roadmap/stage/stage_context_facts.py:23, src/devops_cli/roadmap/stage/stage_context_facts.py:28, src/devops_cli/roadmap/stage/stage_context_facts.py:39, src/devops_cli/roadmap/stage/stage_context_facts.py:44]
    • Chosen: Keep the regexes. They bound the facts text to the items whose text names a tool or a failure cause. The plan budget goes to those items.
    • Rejected: Add the facts to every item. It grows every stage prompt with a section that most items do not need.
  • Does the change keep the two path constants?: Keep RUNNER_TOOLS_PATH, because the code reads it to tell a devops-cli commit. Remove FAILURE_TAXONOMY_PATH, because nothing reads it. The new test names both module paths, with the literal path for failure.py or the module's __file__, and asserts that each file exists. (best practice) [sources: src/devops_cli/roadmap/stage/stage_context_facts.py:18, src/devops_cli/roadmap/stage/stage_context_facts.py:19, AGENTS.md:19, tests/roadmap/stage/test_roadmap_stage_context.py:14]
    • Chosen: Keep RUNNER_TOOLS_PATH and remove FAILURE_TAXONOMY_PATH. The marker read gives the first constant a reader. The second constant would have none.
    • Rejected: Keep both constants. It leaves a production constant that only a test reads.
    • Rejected: Remove both constants. The code then needs a literal path to tell a devops-cli commit.
  • What happens to the stage eval and its tests when a case commit lacks the module files?: The eval uses the same builder, so the failure taxonomy and the runner tools no longer come from the case commit: the case reaches the model. Replace the two tests in test_roadmap_stage_eval_facts_context.py that expect refused and RoadmapStageError, update the docstring of plan_item that says the job raises, and change the roadmap-stage-eval requirement. Keep facts_source for the Dockerfile and the pod manifest, whose fallback to the checkout stays. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py:1439, src/devops_cli/roadmap/stage/stage.py:2254, src/devops_cli/roadmap/stage/stage_eval_run.py:188, tests/roadmap/stage/test_roadmap_stage_eval_facts_context.py:120, tests/roadmap/stage/test_roadmap_stage_eval_facts_context.py:139, openspec/specs/roadmap-stage-eval/spec.md:334]
    • Chosen: Update the eval tests, the docstring and the eval spec in this pull request. The eval uses the same builder, so the old tests assert the defect and fail. One pull request keeps the suite green.
    • Rejected: Keep the raise for the eval. The builder no longer reads the module files, and a second code path would keep the defect.
    • Rejected: Defer the eval update to a new item. The stage eval tests fail in this pull request, so the item cannot merge.
  • Which specs carry a delta?: roadmap-stage changes its requirements Failure taxonomy in staging context and Repository-derived facts; its Runner capability facts in staging context requirement still holds. roadmap-stage-eval changes The live run reads the runner facts in the checkout. ADR 0010 requires a spec delta for a change that alters observable behavior. (best practice) [sources: openspec/specs/roadmap-stage/spec.md:3584, openspec/specs/roadmap-stage/spec.md:3591, openspec/specs/roadmap-stage/spec.md:3598, openspec/specs/roadmap-stage-eval/spec.md:334, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md:7]
    • Chosen: Update both specs. The two capabilities name the old source and the old raise, so both deltas are needed.
    • Rejected: Update only roadmap-stage. The roadmap-stage-eval requirement still says the job raises and the eval reads the module files in the checkout.
    • Rejected: Skip the spec delta. The stage context text and the eval outcome are observable, so the change carries a delta (ADR 0010).
  • Do the two post-rollout checks stay in this item?: No. A new item holds them. They wait on the rollout of the runner image and on 24 h of production traffic, and no offline test can check them. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_refine_reply.md:6, docs/roadmap/refine.md:75, docs/roadmap/refine.md:77, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md:29]
    • Chosen: Defer the production confirmation to a new item. The check waits on a rollout and 24 h of traffic. The project moves a part that nobody can build now to a new issue, and an acceptance criterion needs a scenario that a test can check offline.
    • Rejected: Keep the checks as acceptance criteria. No offline test can assert a Loki query over 24 h or the verdict of an item in another repository.
    • Rejected: Keep the checks as tasks in this pull request. The pull request merges before the rollout, so its tasks cannot be done in it.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/bug
    scope/roadmap
    status/new
    value/high
    effort/low
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P1-High. The stage cannot produce a verdict for items in other repositories, blocking the service.
    • Value: High. It unblocks the stage for all items in the six other repositories.
    • Effort: Low. The fix is about 30 lines of code and 2 tests.
    • Related: fix(roadmap): the stage eval refuses 42 of 48 golden cases #4207, which asks for a different change. Both address collect_stage_facts_context reading files from the staging commit, but #4207 fixes the eval refusing devops-cli cases while the candidate fixes the live stage failing for items in other repositories.
  4. added
    priority/p1-high
    on Nov 11, 2026
  5. added
    status/ready
    and removed
    status/new
    on Nov 11, 2026
  6. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 818ac6f (see proposed design in issue body).

    Moved to new items: #4663.

  7. added
    owner/agent
    status/in-progress
    and removed
    status/ready
    on Nov 11, 2026
  8. removed
    status/in-progress
    owner/agent
    on Nov 11, 2026
  9. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-11 19:36 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p1-highscope/roadmapsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions