Skip to content

feat(roadmap): the stage job probes the premise at the staging commit and returns an item whose premise is false #3011

Closed

Description

@dan-petty

What happened

The stage prompt says "You cannot run a command. Write only what the inputs show", so ## Feasibility of 28 of 37 plans holds only checks that the implementation will run later. AGENTS.md rule 2 asks for the evidence first. Four plans were built on a premise that was already false: #2984 (#2233, the code was deleted by #2399), #2981 (#2166, #1332 already removed all 15 unused imports), #2985 (#2369, -X importtime costs about 3% of CPU, not 50%) and #2857 (#2147, the constant does not exist).

What should happen

  • Before the model call, the job runs bounded read-only probes at the staging commit for each path and identifier that the issue cites: does the path exist, does the identifier have a definition, and for a missing one the commit that removed or moved it (git log --diff-filter=DR). The output goes into the model input.
  • The reply can say premise_failed with the evidence. Then the job runs devops roadmap return <issue> --comment <evidence> --confirm and opens no pull request (AGENTS.md rule 2).
  • The prompt asks feasibility to quote the probe output.

Acceptance criteria

Source

An evaluation on 2026-11-01 of the 37 docs(openspec): plan #N pull requests (35 merged, 2 open) found 34 that need fixes and 1 to reject. The per-PR reviews are in the comments of tracker #3005's thread and in .data/agent/scratch/plan-review.json of the owner's workstation. Related: #3005 (the kind of a task group: test for behavior, a repeatable check for other changes).

Proposed design

Problem statement

The stage job cannot run commands, so the Feasibility section of a plan holds only checks that the implementation will run later. AGENTS.md rule 2 asks for evidence first. Four plans were built on a premise that was already false. The stage job must run bounded read-only probes at the staging commit before the model call, feed the probe output into the model input, and return the item when the premise is false.

Acceptance criteria

Requirement: Premise probe at staging commit

The stage job SHALL run bounded read-only probes at the staging commit for each path and identifier cited in the issue before the model call.

Scenario: Probe output is in the model input

  • WHEN The stage job processes an issue that cites a path and an identifier
  • THEN The probe output is present in the model input before the model call

Requirement: Premise failure returns the item

When the model reply contains premise_failed with evidence, the job SHALL run devops roadmap return --comment --confirm and open no pull request.

Scenario: Replay of a false premise

  • WHEN The stage job processes an issue that cites validate_url, which was removed by a prior change
  • THEN The job runs devops roadmap return with the evidence and opens no pull request

Requirement: Feasibility quotes probe output

The Feasibility section of a staged plan SHALL quote the probe output.

Scenario: Feasibility section contains probe text

  • WHEN The stage job produces a plan for an issue with cited paths
  • THEN The Feasibility section contains the text of the probe results

Requirement: Probes are bounded and read-only

The probes SHALL run at most a stated number of commands, and every command SHALL be read-only.

Scenario: Bound is enforced

  • WHEN The issue cites more paths and identifiers than the bound allows
  • THEN The probe function stops at the bound and records which probes were skipped

Existing Tool Considered

No check has run. The probes are standard git commands (git show, git log --diff-filter=DR, git grep) and file system checks; no external library is needed for the probes. The work modifies the stage job's existing code to extract cited paths and identifiers from the issue body, run the bounded probes, feed the output to the model prompt, and handle the premise_failed response. The written cost: approximately 600 lines of Python and prompt text to build, keep, and fix, at roughly 12,000 tokens and 2 hours of elapsed agent time.

Key questions

  • What probes does the job run, and in what order?: For each cited path: check existence with git show :. For each cited identifier: check definition with git grep . For each missing path or identifier: find the removal commit with git log --diff-filter=DR -- or git log -S -- . (best practice) [sources: AGENTS.md]
    • Chosen: Path existence, then identifier definition, then removal commit (sequential). The body states this order. Each step depends on the result of the previous one: a missing path triggers the removal-commit probe.
    • Rejected: All probes in parallel. Saves time but the removal-commit probe is only needed when the path or identifier is missing, so parallelism wastes commands.
  • What is the bound on probe commands?: At most 10 commands per issue. The four cited examples each cite 1 to 4 items, and each item needs at most 3 commands. A bound of 10 covers the typical case and keeps the probe fast. (proposed)
    • Chosen: 10 commands. Covers 3 to 4 cited items with full probing. The body says a stated number, and the examples show 2 to 4 items.
    • Rejected: 20 commands. Covers more items but the examples do not need it, and a larger bound increases the risk of slow probes.
    • Rejected: Unbounded. The body explicitly requires a stated number. Unbounded probes violate the acceptance criterion.
  • How does the job extract cited paths and identifiers from the issue body?: Parse the issue body for backtick-quoted strings. A string that contains a forward slash is a path. A string that does not contain a forward slash is an identifier. This is deterministic and needs no model call. (proposed)
    • Chosen: Parse backtick-quoted strings from the issue body. The body says for each path and identifier that the issue cites. Backtick-quoted strings are the standard way to cite code in issue bodies. This is deterministic and needs no model call.
    • Rejected: Ask the model to extract them. The model cannot run commands, and adding a model call for extraction adds cost and latency for a task that a regex handles.
  • How does the model signal that the premise is false?: The model reply contains a premise_failed field with the evidence text. The job checks for this field before proceeding to open a pull request. (proposed)
    • Chosen: A premise_failed field in the model reply. The body says the reply can say premise_failed with the evidence. A structured field is easy to check and does not depend on parsing free text.
    • Rejected: A specific text pattern in the reply. Fragile: the model may phrase it differently. A structured field is more reliable.
  • What does the job do when the premise is false?: The job runs devops roadmap return --comment --confirm and opens no pull request. This follows AGENTS.md rule 2: return the item to New with the evidence and stop. (best practice) [sources: AGENTS.md]
    • Chosen: Run devops roadmap return and open no pull request. AGENTS.md rule 2 says to return the item with the evidence and stop. The body states this explicitly.
    • Rejected: Open a pull request with a note that the premise is false. Violates AGENTS.md rule 2: write no compensating code. A pull request is compensating work.
  • What does the prompt change to require?: The prompt asks the Feasibility section to quote the probe output. The probe output is in the model input, so the model can quote it directly. (proposed)
    • Chosen: Ask Feasibility to quote the probe output. The body states this. It makes the Feasibility section evidence-based instead of aspirational.
    • Rejected: Ask Feasibility to summarize the probe output. A summary may omit key details. Quoting the output preserves the evidence.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 1, 2026
  2. dan-petty commented on Nov 1, 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/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 prevents four of thirty-seven plans from building on false premises, but the pipeline still runs without it.
    • Value: Medium. It stops wasted implement cycles on plans whose cited code was already removed or moved.
    • Effort: Medium. It needs bounded read-only probes, a 'premise_failed' branch, a 'devops roadmap return' call, and a prompt change, all in the stage job.
    • Related: fix(roadmap): the stage job refuses a plan that names a path that does not exist #3010, which asks for a different change. Both act in the stage job on the premise that cited paths or identifiers still exist, but #3010 refuses the plan while the candidate returns the item via 'devops roadmap return' and adds identifier and git-history probes.
  3. added
    priority/p2-medium
    on Nov 1, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 1, 2026
  5. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Staged: branch feat/3011-the-stage-job-probes-the-premise, draft pull request #3176. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:

    1. Add the premise probe: 6736 tokens
    2. Put the probe output in the model input: 6674 tokens
    3. Return the item on a false premise: 6724 tokens
    4. Ask feasibility to quote the probe output: 6576 tokens
    5. Record the spec delta: 6558 tokens

    The plan run made 16 model request(s), and used 449122 input tokens and 9622 output tokens. The tool calls, in order:

    1. search_code({"text":"premise_failed"})
    2. search_code({"text":"roadmap return"})
    3. list_files({"directory":"src/devops_cli/roadmap"})
    4. read_file({"path":"src/devops_cli/roadmap/stage.py"})
    5. read_file({"path":"src/devops_cli/roadmap/stage_tools.py"})
    6. read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":44,"end_line":400})
    7. read_spec({"capability":"roadmap-stage"})
    8. search_code({"text":"def plan_item"})
    9. search_code({"text":"class StageProposal"})
    10. list_files({"directory":"src/devops_cli/ai/tasks"})
    11. read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":900,"end_line":1200})
    12. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":200,"end_line":330})
    13. read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md"})
    14. read_file({"path":"src/devops_cli/roadmap/stage_toolbox.py"})
    15. search_code({"text":"collect_context"})
    16. search_code({"text":"_plan_each"})
    17. search_code({"text":"def _plan_one"})
    18. read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":600,"end_line":900})
    19. list_files({"directory":"tests/roadmap"})
    20. list_files({"directory":"src/devops_cli/roadmap"})
    21. file_symbols({"path":"src/devops_cli/roadmap/stage.py"})
    22. file_symbols({"path":"src/devops_cli/roadmap/stage_change.py"})
    23. file_symbols({"path":"src/devops_cli/roadmap/stage_tools.py"})
    24. file_symbols({"path":"src/devops_cli/roadmap/stage_toolbox.py"})
    25. read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":580,"end_line":760})
    26. read_file({"path":"src/devops_cli/roadmap/stage_tools.py","start_line":1,"end_line":150})
    27. file_symbols({"path":"tests/roadmap/test_roadmap_stage_plan.py"})
    28. file_symbols({"path":"tests/roadmap/test_roadmap_stage_tools.py"})
    29. list_files({"directory":"openspec/changes"})
    30. list_files({"directory":"src/devops_cli/ai/tasks"})
    31. read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md"})
    32. read_spec({"capability":"roadmap-stage"})
    33. search_code({"text":"feasibility"})
    34. search_code({"text":"CONST_ROADMAP_STAGE_"})
  7. removed
    status/ready
    on Nov 2, 2026
  8. added 2 commits that reference this issue on Nov 3, 2026
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/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions