Skip to content

feat(roadmap): Add failure classes and runner facts to stage context #3258

Closed

Description

@dan-petty

Problem

Two kinds of neighbour are not in the planner's context, and both gave a blocker in the plan reviews of 2026-11-02.

  1. The failure taxonomy (feat(roadmap): classify a failure and name its class in the stop #3195). A plan that changes retry, review or stop behavior must say how a failure is classed. Evidence: docs(openspec): plan #3060 plan model tier ladder for retries #3225 (the plan advances a ladder on "a provider error", which failure.py:74-75 maps to retry; the XML 400 that motivates it is class parser), docs(openspec): plan #2916 One function decides draft readiness #3170 (a new failure phrase falls into ci_infra with action retry by default), docs(openspec): plan #3049 Plan the review gate before the ready mark #3183 (three review stop phrases all give ci_infra/retry, which cannot clear a finding).
  2. The capabilities of the runner pod. A plan whose feature needs a tool or privilege that the runner image or pod lacks is not caught. Evidence: docs(openspec): plan #3049 Plan the review gate before the ready mark #3183 (plan feat(roadmap): Run devops review on the diff before marking PR ready #3049) asks the implement job to run devops review before the ready mark. The runner image installs only git, ca-certificates, curl and jq (Dockerfile:53-58), and NOT_IN_RUNNER in runner_tools.py lists bwrap, semgrep, gitleaks, osv-scanner, kube-linter and trivy (all True). The review prints "The review tools did not run" and exits 1. The pod drops all capabilities and uses the RuntimeDefault seccomp profile (feat(roadmap): run the implement agent shell in a real sandbox #2695). Refine set the item Ready with "Dependencies: None" although feat(roadmap): the implement agent can use the project's development tools #3041 and feat(roadmap): run the implement agent shell in a real sandbox #2695 are open.

Proposed change

When the plan cites retry, review, stop, tier or failure words, add failure.py (class table and rules) to the context. When the plan cites a command or a tool name, add the runner capability facts: the image tools, NOT_IN_RUNNER, and the pod security settings, each read from the repository (not copied). The prompt tells the planner to state both in ## Feasibility, and the gate refuses a plan whose Feasibility names no runner capability for a plan that adds a command to the Job.

Acceptance criteria

  1. A test shows that a plan that cites retry gets the class table in its context.
  2. A test shows that a plan that adds devops review to the Job gets NOT_IN_RUNNER and the image tool list, and is refused without a Feasibility line that names them.
  3. The facts are derived from failure.py, runner_tools.py and the Dockerfile at the staged commit (a test fails if a source moves).
  4. A replay case from docs(openspec): plan #3049 Plan the review gate before the ready mark #3183 or docs(openspec): plan #3060 plan model tier ladder for retries #3225 is in the golden set.

Related: #3195, #3238, #3246, #3253.

Proposed design

Problem statement

The planner lacks the failure classes and the runner capabilities that a plan depends on. Plans can add commands that the runner image cannot run, and reviews then block them. The change adds repository-derived facts to the staging context and a gate that checks the Feasibility section.

Acceptance criteria

Requirement: Failure taxonomy in staging context

Staging context SHALL include the failure class table and action rules from failure.py when the plan cites retry, review, stop, tier or failure.

Scenario: Retry plan gets class table

  • WHEN A staging run gets a plan that cites retry.
  • THEN The planner context contains the class table and ACTION_BY_CLASS rules read from failure.py at the staged commit.

Requirement: Runner capability facts in staging context

Staging context SHALL include the runner image tools, NOT_IN_RUNNER entries and pod security settings when the plan cites a command or tool name.

Scenario: Review command gets runner facts

  • WHEN A staging run gets a plan that adds devops review to the Job.
  • THEN The planner context contains the image tool list, the NOT_IN_RUNNER entry for each review tool and the pod security settings.

Requirement: Repository-derived facts

The context builder MUST read the failure classes, runner tools and pod security settings from repository files at the staged commit. It MUST NOT copy them into a static prompt.

Scenario: Source move fails the test

  • WHEN A test moves or renames failure.py, runner_tools.py or the pod security manifest.
  • THEN The context builder test fails and names the moved source.

Requirement: Planner Feasibility instruction

The planner prompt SHALL tell the planner to state each needed failure class and runner capability in ## Feasibility.

Scenario: Prompt names Feasibility

  • WHEN The staging prompt includes failure or runner capability facts.
  • THEN The prompt contains the instruction to state those facts in ## Feasibility.

Requirement: Gate refuses unsupported Job command

The staging gate SHALL refuse a plan that adds a command to the Job when its ## Feasibility section names no runner capability for that command.

Scenario: Unsupported Job command is refused

  • WHEN A plan adds devops review to the Job and its Feasibility section names no review tool from NOT_IN_RUNNER.
  • THEN The gate returns a refusal that names devops review and the missing runner capability.

Requirement: Gate refuses unsupported verify program

The staging gate SHALL refuse a plan whose task verify runs a NOT_IN_RUNNER program without a ## Feasibility line that names its runner capability.

Scenario: Helm verify is refused

  • WHEN A plan has a task verify that runs helm template and its Feasibility section names no runner capability for helm.
  • THEN The gate returns a refusal that names helm and the missing runner capability.

Requirement: Docker verify is refused

The staging gate SHALL refuse a medium-effort plan whose task verify runs docker without a ## Feasibility line that names its runner capability.

Scenario: Medium-effort Docker verify is refused

  • WHEN A medium-effort plan has a task verify that runs docker build and its Feasibility section names no runner capability for docker.
  • THEN The gate returns a refusal that names docker and the missing runner capability.

Requirement: Replay case in golden set

The golden set MUST include one replay case from #3183 or #3225 that exercises the failure taxonomy and runner capability context.

Scenario: Replay case runs offline

Existing Tool Considered

No alternatives check has run. No open, maintained tool covers this repository-specific need. The change builds its own code. The written cost is about 40,000 tokens to build, keep and fix it, and 2 elapsed days.

Key questions

  • Which failure facts go into the staging context, and how does the builder source them?: Include the class table and ACTION_BY_CLASS rules from src/devops_cli/roadmap/failure.py at the staged commit. Read them from the file. Do not copy them into the prompt. (best practice) [sources: src/devops_cli/roadmap/failure.py:74, docs/ROADMAP_WORKFLOW.md:134, docs/ROADMAP_WORKFLOW.md:149]
    • Chosen: Read failure.py at the staged commit. This keeps the class table and actions aligned with the code that classifies stops.
    • Rejected: Copy a static class table into the prompt. This drifts when failure.py changes and fails the source-move test.
    • Rejected: Always include the full file. This spends context on plans that do not touch failure behavior.
  • Which runner capability facts go into the staging context, and how does the builder source them?: Include the image tools from the Dockerfile and RUNNER_TOOLS, the NOT_IN_RUNNER entries and the pod security settings. Read each from its repository file at the staged commit. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:186, src/devops_cli/roadmap/runner_tools.py:193, k8s/README.md:643, tests/roadmap/test_roadmap_runner_tools.py]
    • Chosen: Read Dockerfile, runner_tools.py and the pod manifest. This keeps capability facts aligned with the image, the exclusion table and the pod settings.
    • Rejected: Copy a capability list into the prompt. This drifts when the image or pod settings change.
    • Rejected: Use only NOT_IN_RUNNER. This misses image tools and pod security settings that a plan can depend on.
  • What triggers the failure taxonomy and runner capability context?: Include the failure taxonomy when the item text or plan draft cites retry, review, stop, tier or failure words. Include runner capability facts when the same text cites a command or tool name. Keep both out otherwise. (best practice) [sources: src/devops_cli/roadmap/failure.py, src/devops_cli/roadmap/runner_tools.py, docs/ROADMAP_WORKFLOW.md:134]
    • Chosen: Keyword-triggered context. This adds the facts only to plans that depend on them and keeps the token budget.
    • Rejected: Always include both fact sets. This spends context on every plan and raises token cost.
    • Rejected: Let the planner request facts. The planner does not know what it lacks before it writes the plan.
  • How does the gate detect commands and verify programs that need runner capabilities?: Parse the plan's Job command lines and task verify lines. Check the first program word against NOT_IN_RUNNER and the image tool list. Require the ## Feasibility section to name the matching capability. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/runner_tools.py:186, src/devops_cli/roadmap/runner_tools.py:193, tests/roadmap/test_roadmap_implement_shell_refusal.py]
    • Chosen: Parse task and Job command lines. This matches the first-word rule of the step shell and catches both Job commands and task verifies.
    • Rejected: Search the whole plan for tool names. This raises false refusals when a plan mentions a tool in prose or a citation.
    • Rejected: Require a structured command manifest. This adds a new plan format that existing changes do not use.
  • Does the gate cover a task verify whose program is in NOT_IN_RUNNER, or only commands added to the Job?: Cover both. A task verify that runs helm template or docker must be refused when its Feasibility line names no runner capability. The implement step runs the verify. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:186, src/devops_cli/roadmap/runner_tools.py:193, tests/roadmap/test_roadmap_runner_tools.py]
    • Chosen: Cover Job commands and task verify programs. The reply gives helm and docker verify cases that the current gate misses.
    • Rejected: Cover Job commands only. This leaves the helm and docker verify cases uncaught.
  • Should the gate apply to plans of every effort, or only to low-effort items that the Service takes today?: Apply the gate to every staged plan. The Service filter is separate from staging. Revisit only if a person widens effort=low in implement.py. (best practice) [sources: src/devops_cli/roadmap/implement.py:105]
    • Chosen: Check every staged plan. Staging runs before the Service filter, so the gate protects every plan and does not depend on effort.
    • Rejected: Check only low-effort plans. This lets a medium- or high-effort plan keep an impossible command, and the filter can change.
  • Does the change add a new label for a refused plan?: No. Use the existing owner/* claim labels and give the reason in the refusal comment. (best practice) [sources: CONTEXT.md]
    • Chosen: Use existing owner/* labels. The labels already leave an item out and carry the reason, so no new label family is needed.
    • Rejected: Add a new refusal label. This adds a label family and state that the existing claim labels already express.
  • What format does the required Feasibility section use?: Require a ## Feasibility section with one line for each command or verify program that needs a runner capability. Each line names the program, its source in the image or NOT_IN_RUNNER, and the pod setting that applies. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:186, k8s/README.md:643]
    • Chosen: One line for each capability need. This gives the gate a precise fact to check and keeps the section short.
    • Rejected: A free-form Feasibility paragraph. The gate cannot check that the needed capability is named.
    • Rejected: A full copy of the runner tables. This bloats the plan and duplicates facts that the context already holds.
  • Which replay case goes into the golden set?: Use the docs(openspec): plan #3049 Plan the review gate before the ready mark #3183 plan feat(roadmap): Run devops review on the diff before marking PR ready #3049 case that adds devops review to the implement Job. Add the fix(k8s): name the Loki deployment mode Monolithic #2441 helm verify case if the golden set has room. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:186]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-06: rejected.
Rejected by ADR 0010. A newer fact can change an ADR.
Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec), MIT, last activity 2026-11-05, maintained.

Activity

  1. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 2, 2026
  2. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

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

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It fixes a class of plan-review blockers but does not block the system or expose a security risk.
    • Value: Medium. It prevents a recurring category of plan failures but the system still functions without it.
    • Effort: Medium. It requires modifying context assembly, adding a gate check, deriving facts from three source files, and writing four acceptance tests.
    • Related: feat(roadmap): the stage context holds the callers and tests of each cited symbol #3012, which asks for a different change. Both extend the stage context with additional data, but #3012 adds callers and tests of cited symbols while the candidate adds the failure class table and runner capability facts.
  3. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 760f2cb until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • The proposal has no problem statement, no acceptance criterion with its requirement, scenario, WHEN and THEN, or no answer to the existing-tool question. State the problem, the requirements with their scenarios, and the open tool that covers the need or the cost of building it.
  4. dan-petty commented on Nov 4, 2026

    @dan-petty
    OwnerAuthor

    Evaluation of 2026-11-04. Add one case to the gate of this item.

    The gate covers a plan that adds a command to the Job. It must also cover a task verify whose program is in NOT_IN_RUNNER. Example: task 1.1 of openspec/changes/2441-loki-values-name-the-monolithic-deployment/tasks.md has a verification that runs helm template, and NOT_IN_RUNNER lists helm (src/devops_cli/roadmap/runner_tools.py:186). #2441 has low effort, so the implement job takes it, and the step refused that line on 2026-11-03.

    A second case of the same class: task 1.5 of the plan of #2554 needs a host with a local engine, and NOT_IN_RUNNER lists docker (runner_tools.py:193).

    The Service takes only effort=low items (src/devops_cli/roadmap/implement.py:105), so a plan with such a need at medium or high effort does not reach a Job today. Check those plans again if a person widens the filter. No new label is necessary for this: the owner/* claim labels already leave an item out, with the reason.

  5. added
    status/ready
    and removed
    status/new
    on Nov 5, 2026
  6. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

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

  7. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Alternatives check: rejected

    Rejected by ADR 0010. A newer fact can change an ADR.

    Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec)

    • License: MIT
    • Last activity: 2026-11-05
    • Maintained: yes

    Covers:

    • It is the project's adopted change-proposal layer: the plan, its requirements/scenarios and its task list live in an OpenSpec change folder, which is where a ## Feasibility section would sit.
    • It ships a validation gate over the change proposal, so a plan can be refused for structure before it is staged.

    Lacks:

    • It holds no failure taxonomy: it does not read the class table or ACTION_BY_CLASS rules from failure.py, so a plan that changes retry/review/stop behavior gets no class facts.
    • It holds no runner capability facts: the image tool list, the NOT_IN_RUNNER entries and the pod security settings are not known to it.
    • validate --strict reads no proposal prose, so it cannot refuse a plan whose Feasibility line names no runner capability for a Job command or a task verify program.
    • ADR 0010 rejected a forked OpenSpec schema with a feasibility artifact, so extending it to carry this fact set is not an available route; the repository derives the facts and enforces the section with its own test and gate.

    Searches run:

    • OpenSpec spec-driven development change proposal validate CLI
    • open source tool classifies CI failures into categories retry vs code error
    • OpenSpec Fission-AI GitHub
    • openspec spec driven development
    • openspec
    • spec driven development tool validate change proposals
    • check commands used in a plan are installed in container image tool

    Sources:

    Checked on 2026-11-06. A person decides what this means for the item. The check changes no label and closes no issue.

  8. changed the title [-]feat(roadmap): the stage context holds the failure classes and the runner capabilities that a plan depends on[/-] [+]feat(roadmap): Add failure classes and runner facts to stage context[/+] on Nov 6, 2026
  9. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 94 characters, and the limit is 60. The type and the scope stay.

    • Before: feat(roadmap): the stage context holds the failure classes and the runner capabilities that a plan depends on
    • After: feat(roadmap): Add failure classes and runner facts to stage context
    • Source of the summary: the background model
  10. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 9, 2026
  11. removed
    status/in-review
    on Nov 9, 2026
  12. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-09 03:15 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/mediumpriority/p2-mediumscope/roadmaptype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions