Skip to content

feat(roadmap): the stage job probes the premise - #3176

Merged
dan-petty merged 5 commits into
mainfrom
feat/3011-the-stage-job-probes-the-premise
Nov 2, 2026
Merged

dan-petty merged 5 commits into
mainfrom
feat/3011-the-stage-job-probes-the-premise

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The stage job now probes the premise of an issue before the model call. For each path and identifier that the issue cites, up to 10 read-only git commands (cat-file, grep, log) ask the staging commit if it holds the item and, for a missing one, which commit removed it. The lines go to the model input as probes, and the prompt asks feasibility to quote them. The cited items come from the extraction of collect_context.

A reply can set premise_failed with evidence and no plan. The round then calls plan_return and apply_return: the issue gets the evidence and the Status New, and gets no branch and no pull request. The result returned joins devops_cli_roadmap_stage_total. The recorded false_premise defects of the golden set get the gate none, since the replay reads no git.

Closes #3011

Change: openspec/changes/archive/2026-11-02-3011-the-stage-job-probes-the-premise/

🤖 Generated with Claude Code

https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW

Copy link
Copy Markdown
Owner

Review of the plan for #3011.

CI: all 18 checks pass or skip. Premise: partly holds. _Planner._request is at src/devops_cli/roadmap/stage.py:646 and StageProposal at stage_change.py:239, and no premise_failed exists. But the stage job already extracts cited paths and identifiers at the staging commit, and already has a read-only toolbox (finding 1).

  1. The plan duplicates code that exists. _Planner._request already puts collect_context(self._source, self._sha, item.body, ...) in the model input (stage.py:650-655). collect_context (src/devops_cli/roadmap/refine.py:643) already calls _collect_cited_files(source, sha, body) and _collect_identifiers(source, sha, body) on the backtick-quoted items of the body, at sha. The plan adds a new stage_probe.py with its own cited_items extractor and never mentions these helpers. In addition, the planner has a toolbox with git_log, git_show, search_code and callers (stage_tools.py:51-121, and the requirement "The planner has a read-only toolbox" in openspec/specs/roadmap-stage/spec.md:550). Fix: state in design.md what collect_context and the toolbox lack (for a missing path: the removal commit; for an identifier: a definition check, not a match), and extend the helpers instead of adding a second extractor. Rule 3 asks for that.
  2. The job has no way to run devops roadmap return. _Planner has no store (stage.py:592-619), and plan() returns StagedChange | OverBudget; _plan_each (stage.py:780-800) and stage_eval_run.py:185 branch on those two types. Task 3.2 says _Planner.plan "return[s] the item with devops roadmap return ...". The code for it is in-process: plan_return and apply_return(store, plan) (src/devops_cli/roadmap/return_item.py:34,55). Fix: add a third outcome type (for example PremiseFailed), handle it in _plan_each and the eval runner, and call plan_return/apply_return from the round where the store exists. Do not shell out to the CLI. The spec text "SHALL run devops roadmap return <issue> --comment <evidence> --confirm" should say what the job does in terms a test can assert (the issue gets the comment and Status New, no branch, no PR).
  3. A pending gate is left out. src/devops_cli/roadmap/stage_eval_gates.py:119 lists DefectType.FALSE_PREMISE: "#3011" in PENDING_GATES, and tests/roadmap/test_roadmap_stage_eval_run.py:327-329 asserts GateName.PENDING for it. A change that delivers feat(roadmap): the stage job probes the premise at the staging commit and returns an item whose premise is false #3011 should turn this into a built gate (or the plan must say why not). The capability roadmap-stage-eval (openspec/specs/roadmap-stage-eval/spec.md) is not in the delta. Fix: add a group for the gate, its test update and the delta.
  4. The spec delta and the proposal point to a folder that does not exist. Impact and task 5.1 name openspec/changes/3011-stage-premise-probe/specs/roadmap-stage/spec.md. The real folder is 3011-the-stage-job-probes-the-premise. Task 5 also asks to write a delta that this PR already contains; the task will be a no-op for an implementer. Fix: remove group 5 (the validation is the verify step of group 4 or a final openspec validate --strict), and correct the path.
  5. Acceptance criteria of feat(roadmap): the stage job probes the premise at the staging commit and returns an item whose premise is false #3011 are dropped. (a) The replay of docs(openspec): plan #2152 replace legacy IPv4 parser #2971 (cites validate_url, removed by fix(security): remove pre-flight resolve paths for egress #2845) has no scenario and no test; the task tests use generic "a path". (b) "Probes are read-only" has no requirement or scenario. (c) The bound is never stated: design says 10, but the proposal, the spec and the tasks use "a stated number" and CONST_ROADMAP_STAGE_PROBE_MAX_COMMANDS with no value. Fix: write 10 in the spec scenario, add the docs(openspec): plan #2152 replace legacy IPv4 parser #2971 replay as a test, and add a read-only scenario (the commands are an allow-list of cat-file, grep, log).
  6. Extraction rule is weak. "A string with a forward slash is a path, and one without is an identifier" classifies config.yaml, AGENTS.md and -X importtime as identifiers and owner/repo, git log -S x -- a/b and a shell command with a path as paths. The design rejected the model for extraction, but a rule on the form is needed. Fix: validate each item with a pattern (a path has an extension or a known root; an identifier is [A-Za-z_][A-Za-z0-9_]*), and skip the rest. Add tests for a command in backticks.
  7. Existing Tool Considered understates the cost. The issue (refine section) says about 600 lines, 12,000 tokens and 2 hours; the proposal says about 120 lines, 3,000 tokens and 1 hour, with no reason. Fix: use the numbers of the issue or explain the cut.
  8. Feasibility is a list of tool calls (read_file, search_code, file_symbols), not commands. One claim is wrong: "roadmap return found in AGENTS.md line 10" is right (rule 2 is on line 10), but the code that can be called is return_item.py, as in finding 2. The first checks are plans.
  9. The PR body shows devops roadmap return --comment --confirm; the <issue> and <evidence> placeholders were dropped. Fix: quote the command in backticks with placeholders intact. The tuicr bullet is allowed by openspec/config.yaml.
  10. The prompt change (task 4.1) is verified by uv run devops ci docs. Not verified that this command covers the prompt file src/devops_cli/ai/tasks/roadmap_stage_change.md; the requirement "The prompts and the validator name the same kinds" (roadmap-stage/spec.md:543) suggests a prompt test exists. Fix: name the test that checks the prompt text.

Related issues: #3012 (the stage context holds the callers and tests of each cited symbol; open, same collect_context surface); #3039 (an independent verifier refutes a plan before the draft opens; open, overlaps on premise checking); #3019 (maps each acceptance criterion to a group; open, another pending gate); #3027 (parent tracker; open). #3010 and #3005 are closed.

Verdict: hold until the plan reuses collect_context/the toolbox (finding 1), routes the return through return_item.py and a new outcome type (finding 2), and fixes the folder path and the stale task 5 (finding 4).


Generated by Claude Code

The job probes each path and identifier that the issue cites at the staging commit with at
most 10 read-only git commands, puts the lines in the model input, and asks feasibility to
quote them. A reply with premise_failed returns the item to New with the evidence through
plan_return and apply_return, and opens no branch and no pull request. The result returned
joins the stage counter. The false_premise defects of the golden set get the gate none.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW
@dan-petty dan-petty changed the title docs(openspec): plan #3011 probe the premise at the staging commit feat(roadmap): the stage job probes the premise Nov 2, 2026
@dan-petty
dan-petty marked this pull request as draft November 2, 2026 13:44
@dan-petty
dan-petty marked this pull request as ready for review November 2, 2026 13:58
@dan-petty
dan-petty merged commit b05e678 into main Nov 2, 2026
22 checks passed
@dan-petty
dan-petty deleted the feat/3011-the-stage-job-probes-the-premise branch November 2, 2026 14:02
dan-petty pushed a commit that referenced this pull request Nov 2, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.43.0](v0.42.1...v0.43.0)
(2026-11-02)


### Features

* **roadmap:** map each acceptance criterion to a group
([#3180](#3180))
([9639c02](9639c02))
* **roadmap:** the stage job probes the premise
([#3176](#3176))
([b05e678](b05e678))

---
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>
dan-petty added a commit that referenced this pull request Nov 8, 2026
#3266 reports two plans whose `## Feasibility` cites `read_file` and
`search_code` results while the stage comment says the run made no tool
call. Nothing compares the claims of a plan with the trace of the run
that wrote it, so a plan presents an unchecked premise as checked. The
premise probe of #3176 checks that a cited path exists, and not that the
run read it.

Closes #3266

Change:
`openspec/changes/archive/2026-11-08-3266-refuse-feasibility-claims-the-run-did/`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants