Skip to content

feat(roadmap): Verify a claimed missing check in helpers and base #3416

Closed

Description

@dan-petty

Problem or Motivation

The stage job planned an issue whose behavior already existed. The plan of PR #3374 (for #3368) says the implement job "writes the delivery title with no check" and that "neither call runs a title check". PR #3319 (be129c99) had already added the guard: _delivery_title in src/devops_cli/roadmap/implement_run.py:957 calls title_problems(title, declared) and raises _StopError, and both _publish and _pull_request call _delivery_title. The plan read the two call sites and not the body of the helper they call, so its Feasibility asserted a fact that the base contradicted.

The result was a plan whose core change duplicates a guard that exists, and an ADDED requirement for behavior that openspec/specs/roadmap-implement-job/spec.md already states.

The premise probe (#3176) reports whether a cited path exists. It does not report whether a check that a plan calls absent is absent.

Proposed Solution & Architectural Design

  1. When a plan task or decision claims a check is missing at a call site, the premise probe searches the called helper bodies and the base tree for that check, and reports the path and the line where it found it.
  2. The stage job reconciles the issue against the base: when the behavior the issue asks for is already in the base or in a merged pull request, the job returns the item with that evidence instead of planning a duplicate.
  3. Add a test in tests/roadmap/test_roadmap_stage_plan.py for a plan that claims a check is missing while a called helper runs it, and one for a plan whose claim is true.

Target Subsystem

src/devops_cli/roadmap/stage_probe.py, src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_change.py

Existing Tool Considered

No open, maintained tool checks a code premise across a call chain. The premise probe is the repository's own tool, and this change extends it. Cost: about 8,000 tokens to build and test, about 1,500 tokens to keep and fix, and about 3 hours elapsed. The change deletes no internal code.

Source: PR #3374

Proposed design

Problem statement

A stage plan can claim that a call site runs no check while a helper of that call site runs the check. The premise probe checks cited paths and identifiers only, so the job plans a duplicate of existing behavior. The change makes the probe search called helper bodies and the base tree for a claimed missing check. The stage job returns the item with the path and line when it finds the check.

Acceptance criteria

Requirement: The probe finds a check in a called helper

The stage premise probe SHALL search the bodies of helpers that a cited call site calls when a plan claims that a check is missing.

Scenario: A false missing-check claim

  • WHEN A plan task says that _publish runs no title_problems check, and _publish calls _delivery_title, whose body calls title_problems.
  • THEN The probe reports title_problems with the path and line of its call.

Requirement: The probe searches the base tree

The probe SHALL search the base tree for a claimed missing check when the cited call site and its helpers do not hold it.

Scenario: A check in another file

  • WHEN A plan claims that a call site runs no title_problems check, and another file at the staging commit holds title_problems.
  • THEN The probe reports the path and line of title_problems in that file.

Requirement: A false missing-check claim returns the item

The stage job SHALL return an item to New with the probe evidence when a plan claims that a check is missing and the probe finds the check.

Scenario: A plan that duplicates an existing guard

  • WHEN A plan claims that _publish runs no title check, and the probe finds title_problems in _delivery_title.
  • THEN The stage plan records the item in returned, writes no branch, opens no pull request, and the evidence names the path and line of title_problems.

Requirement: A true missing-check claim stays ready

The stage job SHALL keep the plan when the probe finds no check for a claimed missing check.

Scenario: A plan whose claim is true

  • WHEN A plan says that a call site runs no title_problems check, and neither the call site, its helpers nor the base tree hold that check.
  • THEN The stage plan keeps the change in ready and records no PremiseFailed.

Requirement: The search stays bounded and read-only

The missing-check search MUST use the existing probe budget and MUST make only read-only git commands at the staging commit.

Scenario: The budget is spent

  • WHEN A plan claims a missing check and the probe has no command left.
  • THEN The probe lists the claim as skipped and runs no further command.

Requirement: The search makes no model call

The missing-check search MUST be deterministic and MUST make no model call.

Scenario: A claim is probed

  • WHEN A plan claims a missing check and the stage job probes it.
  • THEN The stage job sends no model request for the search.

Requirement: A claim with no cited call site is ignored

The probe SHALL ignore a missing-check claim that cites no call site and no check name.

Scenario: A general claim

  • WHEN A plan says that a check is missing but names no function and no check.
  • THEN The probe adds no line and the stage job plans the item as before.

Requirement: The probe runs before the stage writes

The stage job SHALL run the missing-check probe after the model reply and before it writes a branch or a pull request.

Scenario: The probe finds the check

  • WHEN The model reply claims a missing check and the probe finds it.
  • THEN No branch is pushed and no draft pull request opens.

Existing Tool Considered

No alternatives check has run. No open, maintained tool checks a code premise across a call chain. The premise probe is the repository's own tool, and this change extends it. The written cost is about 8,000 tokens to build and test, about 1,500 tokens to keep and fix, and about 3 hours elapsed. The change deletes no internal code.

Key questions

  • What existing outcome returns an item on a false premise?: PremiseFailed carries the evidence. _return_item calls apply_return with plan_return, so the stage job returns the item to New and writes no branch. [sources: src/devops_cli/roadmap/stage.py]
  • Where does the stage planner hold the probe lines and call the reply checks?: _Planner._request calls probe_premise and stores _probe_lines. _Planner._settle calls check_proposal with those lines before it writes the change. [sources: src/devops_cli/roadmap/stage.py]
  • What bound and commands does the premise probe use?: The probe uses CONST_ROADMAP_STAGE_PROBE_MAX_COMMANDS. It runs only git cat-file, git grep and git log at the staging commit, with -- before every path. [sources: src/devops_cli/roadmap/stage_probe.py]
  • How should the stage job detect a missing-check claim in a plan?: Scan feasibility, the group tasks and decisions for an absence word and a check word. Require a code-spanned call site or check name. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage.py, docs/adr/0005-review-findings-come-from-tools-not-models.md]
    • Chosen: Scan plan texts for an absence word and a check word near a code-spanned call site or check name. The issue names plan tasks and decisions, so a new schema field would not catch a prose claim.
    • Rejected: Add a required missing_checks field to StageProposal. A model can omit the field, and the existing bad plan is prose.
    • Rejected: Ask the verifier model to find the claim. ADR 0005 keeps findings deterministic, and the probe is a tool.
  • What code should the probe search for the claimed check?: Read the cited call site at the staging commit. Collect the functions that it calls. Search those helper bodies for the check. If none holds it, search the base tree. (best practice) [sources: src/devops_cli/roadmap/stage_probe.py, src/devops_cli/roadmap/implement_run.py]
    • Chosen: Search the cited call site's file and one level of called helpers, then the base tree. This covers the helper that the plan did not read, and it avoids an unrelated whole-tree match.
    • Rejected: Search only the cited call site body. The cited bug read the call site and missed the helper.
    • Rejected: Search the whole base tree first. It can report a check that the call site never calls.
  • What does the stage job do when the probe finds the check?: The job returns the item to New through PremiseFailed and apply_return. The evidence names the path and line. The job pushes no branch and opens no pull request. (best practice) [sources: src/devops_cli/roadmap/stage.py]
    • Chosen: Return the item to New with PremiseFailed and the path and line. The stage job already returns a false premise this way, and the issue asks for that evidence.
    • Rejected: Stop the item as Blocked. A false premise is not a stop; it returns to New.
    • Rejected: Send the plan back to the model. The issue asks the job to reconcile and return, not to plan a duplicate again.
  • Should the probe read merged pull requests from GitHub?: Use the staging commit tree only. The base tree holds the behavior of a merged pull request. (best practice) [sources: src/devops_cli/roadmap/stage_probe.py, src/devops_cli/roadmap/stage.py]
    • Chosen: Use the staging commit tree only. A merged behavior is in the base tree, and the probe stays read-only and offline.
    • Rejected: Search merged pull requests on GitHub. It adds network, authentication and rate limits for no extra evidence.
  • Which tests prove the change?: Add one case where a called helper holds the claimed check and the item returns. Add one case where no helper holds the check and the plan is ready. (best practice) [sources: tests/roadmap/test_roadmap_stage_plan.py]
    • Chosen: Add two cases to tests/roadmap/test_roadmap_stage_plan.py. The issue names the file, and it already covers probe quotes and premise returns.
    • Rejected: Add a new test module. The change belongs with the stage plan tests.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

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

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 4, 2026
  2. dan-petty commented on Nov 4, 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 duplicate plans but does not block delivery or expose a security risk.
    • Value: Medium. It stops the stage job from planning a guard that already exists, saving model calls and review time.
    • Effort: Medium. It needs changes to the probe, the stage job reconciliation, and new tests across three files.
    • Related: feat(roadmap): the stage job probes the premise at the staging commit and returns an item whose premise is false #3011, which asks for a different change. Both extend the premise probe at the staging commit; #3011 covers path existence, while the candidate adds a search of called helper bodies for a check a plan claims is absent.
  3. added
    priority/p2-medium
    on Nov 4, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 4, 2026
  5. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

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

  6. changed the title [-]feat(roadmap): the stage premise check proves a claimed missing check is absent[/-] [+]feat(roadmap): Verify a claimed missing check in helpers and base[/+] on Nov 6, 2026
  7. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

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

    • Before: feat(roadmap): the stage premise check proves a claimed missing check is absent
    • After: feat(roadmap): Verify a claimed missing check in helpers and base
    • Source of the summary: the background model
  8. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Alternatives check: rejected

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

    Tool: github/codeql (https://github.com/github/codeql)

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

    Covers:

    • Interprocedural call-graph and dataflow queries answer whether a cited call site (for example _publish) reaches a named check (for example title_problems) through the helpers it calls, which is the exact claim the plan got wrong.
    • A query over a checked-out tree can also locate the check name anywhere in the base tree, covering the second half of the proposed search.
    • Query results are deterministic and need no model call, so they are checked facts rather than model findings, in line with the project's rule that findings come from tools.
    • The repository already consumes CodeQL results from GitHub code scanning, so the analysis question is answerable with a tool the project accepts, without building an in-repo checker.

    Lacks:

    • Needs a CodeQL database built by the CLI and extractor, not the probe's bounded set of read-only git cat-file, git grep and git log commands at the staging commit.
    • The CLI is not redistributable in a public repository, so it cannot be committed or bundled the way the probe is.
    • Database creation per staging commit is far heavier than the existing probe command budget and is not an offline, few-command check.
    • It does not provide the repository's own plumbing: the absence-word/check-word scan of plan prose, the probe line format, or the PremiseFailed / apply_return path that returns the item to New.
    • It does not implement the two stage-plan test cases the issue asks for.

    Searches run:

    • open source tool build Python call graph to check whether a function is reachable from a call site
    • static analysis interprocedural reachability query "function is called" code search tool self-hosted
    • PyCG python call graph generator
    • python call graph generator tool
    • call graph analysis tool
    • code2flow
    • semgrep
    • CodeQL call graph query
    • sourcegraph SCIP code intelligence index
    • call graph

    Sources:

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

  9. added
    owner/service
    on Nov 14, 2026
  10. 10 remaining items

  11. added
    status/in-progress
    and removed
    status/planned
    on Nov 15, 2026
  12. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Stopped at group 1.

    Failed check: pytest on base: tests/roadmap/stage/test_roadmap_stage_probe.py.

    Failure class: outside_plan.
    Action taken: repair, 1 fix round(s).
    Action left: wait: wait for a person.

    Step Status Attempts Tokens in/out Last failing command
    group 1 stopped 2 12223427/66565 pytest on base: tests/roadmap/stage/test_roadmap_stage_probe.py

    Reason:

    The extra turn for the static check changed files that the step had not changed: src/devops_cli/roadmap/stage/stage_probe.py.
    

    Last message of the agent (a claim that no check verified): The static check failed because the test module imported check_claims/claimed_missing_checks at the top level, so the base replay hit a collection error and no test ID failed. ## Fix tests/roadmap/stage/test_roadmap_stage_probe.py is the only file changed in this turn: - Restored the top-level import to blocked_by, probe_premise (both exist on the base). - Moved the import of the two new functions into each of the six new test functions, with a comment on the first one. This follows the repo's own pattern in tests/support/roadmap_stage.py:314 ("the fail-to-pass replay loads it against a base tree that has no StageWriter yet"). The implementation, message and tasks ticks are unchanged. ## Verification - Base replay, proved by temporarily restoring the base stage_probe.py and messages.py and running the test file: 24 passed, 6 failed as FAILED test IDs (no collection error). Then restored the implementation. - uv run devops ci test tests/roadmap/stage/test_roadmap_stage_probe.py — 30 passed. - uv run devops ci test tests/roadmap/stage/test_roadmap_stage_plan.py — 184 passed. - uv run ruff check on the three changed Python files — passed. - uv run mypy --strict on the two changed src/ files — no issues. Note: the branch had been reset to main while the check ran; I recovered the implementation from the earlier wip commit 74749b27b and re-ran every check above on the recovered tree. git diff HEAD --stat shows only the group's four fil

    The job discarded this work. Read it before you retry:

    diff --git a/tests/roadmap/stage/test_roadmap_stage_probe.py b/tests/roadmap/stage/test_roadmap_stage_probe.py
    index f765aa0f3..a8830d4a8 100644
    --- a/tests/roadmap/stage/test_roadmap_stage_probe.py
    +++ b/tests/roadmap/stage/test_roadmap_stage_probe.py
    @@ -12,12 +12,7 @@ from devops_cli.config.constants import (
     )
     from devops_cli.roadmap.refine.refine import git_result
     from devops_cli.roadmap.stage import stage_probe
    -from devops_cli.roadmap.stage.stage_probe import (
    -    blocked_by,
    -    check_claims,
    -    claimed_missing_checks,
    -    probe_premise,
    -)
    +from devops_cli.roadmap.stage.stage_probe import blocked_by, probe_premise
     
     if TYPE_CHECKING:
         from pathlib import Path
    @@ -308,6 +303,10 @@ CLAIM = "The plan says that `_publish` runs no `title_problems` check."
     
     
     def test_a_check_in_a_helper_body_of_the_call_site_is_found(repo: StageRepo) -> None:
    +    # Imported here: the fail-to-pass replay loads this module against a base tree that has no
    +    # claim search yet.
    +    from devops_cli.roadmap.stage.stage_probe import check_claims, claimed_missing_checks
    +
         repo.track({PUBLISH: PUBLISH_SOURCE})
         sha = repo.git("rev-parse", "HEAD")
     
    @@ -325,6 +324,8 @@ def test_a_check_in_a_helper_body_of_the_call_site_is_found(repo: StageRepo) ->
     
     
     def test_a_check_in_the_body_of_the_call_site_is_found(repo: StageRepo) -> None:
    +    from devops_cli.roadmap.stage.stage_probe import check_claims
    +
         repo.track({PUBLISH: PUBLISH_SOURCE})
         sha = repo.git("rev-parse", "HEAD")
     
    @@ -342,6 +343,8 @@ def test_a_check_in_the_body_of_the_call_site_is_found(repo: StageRepo) -> None:
     
     
     def test_a_check_that_only_another_file_holds_names_its_path_and_line(repo: StageRepo) -> None:
    +    from devops_cli.roadmap.stage.stage_probe import check_claims, claimed_missing_checks
    +
         repo.track({PUBLISH: PUBLISH_WITHOUT_CHECK, TITLES: TITLES_SOURCE})
         sha = repo.git("rev-parse", "HEAD")
     
    @@ -359,6 +362,8 @@ def test_a_check_that_only_another_file_holds_names_its_path_and_line(repo: Stag
     def test_a_call_site_that_is_no_python_source_leaves_the_search_to_the_tree(
         repo: StageRepo,
     ) -> None:
    +    from devops_cli.roadmap.stage.stage_probe import check_claims
    +
         rust = "src/devops_cli/publish.rs"
         repo.track({rust: "fn _publish() {\n    let title = 1;\n}\n", TITLES: TITLES_SOURCE})
         sha = repo.git("rev-parse", "HEAD")
    @@ -374,6 +379,8 @@ def test_a_call_site_that_is_no_python_source_leaves_the_search_to_the_tree(
     
     
     def test_a_claim_with_no_call_site_adds_no_line(repo: StageRepo) -> None:
    +    from devops_cli.roadmap.stage.stage_probe import check_claims, claimed_missing_checks
    +
         general = "The plan says that the title check is missing, and adds it."
         named = "The plan says that the `title_problems` check is missing."
     
    @@ -389,6 +396,8 @@ def test_a_claim_with_no_call_site_adds_no_line(repo: StageRepo) -> None:
     def test_a_claim_with_no_command_left_is_skipped(
         repo: StageRepo, monkeypatch: pytest.MonkeyPatch
     ) -> None:
    +    from devops_cli.roadmap.stage.stage_probe import check_claims, claimed_missing_checks
    +
         repo.track({PUBLISH: PUBLISH_SOURCE})
         ran: list[tuple[str, ...]] = []
     

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

    The job kept 1 work-in-progress commit on the branch feat/3416-verify-a-claimed-missing-check-in on origin. The last is 9b5fcc8b27938d9b475add8006f3018fff2544ea. The job discarded only the work after it. The next run continues from it and does the tasks that are not ticked.

  13. added
    status/blocked
    and removed
    status/in-progress
    on Nov 15, 2026
  14. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-implement-devops-cli-3416-7334f7 ended: succeeded.
    Image digest: sha256:8eb01bbf4733ad025ae03ba6f0b040269878699c269450994163754fa514f553

    The last lines of its log:

    Tool call: run_command, started: uv run ruff check tests/roadmap/stage/test_roadmap_stage_probe.py
    Tool call: run_command, started: grep -n check_claims\\|claimed_missing_checks tests/roadmap/stage/test_roadmap_stage_probe.py
    Tool call: run_command, program grep, ok.
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git checkout HEAD~1 -- src/devops_cli/roadmap/stage/stage_probe.py src/devops_cli/lang/en/messages.py
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_probe.py ...
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git checkout HEAD -- src/devops_cli/roadmap/stage/stage_probe.py src/devops_cli/lang/en/messages.py
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git status --short
    Tool call: run_command, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_probe.py ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git log --oneline -4
    Tool call: run_command, started: git show HEAD:src/devops_cli/roadmap/stage/stage_probe.py | grep -n ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git checkout 74749b27b -- src/devops_cli/roadmap/stage/stage_probe.py src/devops_cli/lang/en/messages.py
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git status --short
    Tool call: run_command, started: grep -c <masked> src/devops_cli/roadmap/stage/stage_probe.py src/devops_cli/lang/en/messages.py
    Tool call: run_command, program grep, ok.
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_probe.py ...
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: uv run ruff check src/devops_cli/roadmap/stage/stage_probe.py src/devops_cli/lang/en/messages.py ...
    Tool call: run_command, started: uv run mypy --strict src/devops_cli/roadmap/stage/stage_probe.py src/devops_cli/lang/en/messages.py ...
    Tool call: run_command, program uv, ok.
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_plan.py ...
    Tool call: run_command, started: git diff HEAD --stat
    Tool call: run_command, program git, ok.
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git diff HEAD -- tests/roadmap/stage/test_roadmap_stage_probe.py | ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git diff HEAD -- openspec/changes/3416-verify-a-claimed-missing-check-in/tasks.md
    Tool call: run_command, program git, ok.
    Failure class outside_plan. Action left: wait.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    
  15. removed
    owner/service
    on Nov 15, 2026
  16. added
    status/in-review
    and removed
    status/blocked
    on Nov 16, 2026
  17. removed
    status/in-review
    on Nov 16, 2026
  18. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-16 13:55 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/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions