Skip to content

fix(roadmap): Verify a claimed member against the staged source #3458

Closed

Description

@dan-petty

Problem or Motivation

The Feasibility section of the plan of #3417 (pull request #3438) said: "read_file src/devops_cli/roadmap/step_files.py showed that a parsed group carries its kind, so the check can run for a behavior group only." The claim is false. TaskGroup in src/devops_cli/roadmap/step_files.py holds number, title, tasks and text, and no kind. plan_read._kind in src/devops_cli/roadmap/plan_read.py infers the kind from the group text.

The plan passed uv run devops openspec check and the plan check. The stage check reads the paths and identifiers that a plan cites, and it does not read a claim about a member of a type. #3407 covers a Feasibility claim that quotes a class, but this claim names a file and a member that the file does not have.

Proposed Solution & Architectural Design

  • Extend the rule of fix(roadmap): Check a class claim against the staged source #3407 from a class to a member: when a Feasibility line, a decision or a rejected alternative claims that a type under src/ holds a member, read the type at the staged commit and refuse a member that the source does not define.
  • Require the line to quote the source statement it read, in a code span. When the line names a type or a member and quotes no statement, refuse it.
  • Compare the quoted text with the module at the staged commit, as fix(roadmap): Check a class claim against the staged source #3407 plans. A plan then cannot state a field that the type lacks.
  • Add a test with the TaskGroup claim and one with a true claim about a field that the type has.

Target Subsystem

src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_verify.py, src/devops_cli/ai/tasks/roadmap_stage_verify.md

Existing Tool Considered

The stage probe of #3176 in src/devops_cli/roadmap/stage_probe.py already reads a commit with git grep, and #3407 plans the comparison of a quoted code span with a staged class. This change extends that rule to a member and adds no second reader. The cost is about 2,000 tokens to build and test and about 30 minutes elapsed.

Source: #3438

Alternatives check of 2026-11-07: none.
Tool: none found.

Proposed design

Problem statement

The plan check accepts a claim that a type holds a member that the type lacks. It also accepts a Feasibility line that names a module under src/ and quotes no statement of that module. The plan of #3417 said that a parsed group carries its kind, and TaskGroup in src/devops_cli/roadmap/step_files.py holds no kind member. The change extends the class-claim rule to a Class.member claim, reads the class at the staged commit, refuses a member that the class body does not define, and requires a code span that quotes a statement of the named module.

Acceptance criteria

Requirement: Refuse a member that the staged class lacks

The stage plan check SHALL read the class that a Class.member claim names at the staged commit and MUST refuse a member that the class body does not define.

Scenario: False TaskGroup member claim

  • WHEN A Feasibility line names TaskGroup.kind and src/devops_cli/roadmap/step_files.py, and it quotes class TaskGroup:.
  • THEN The check reports that TaskGroup defines no kind member and refuses the plan.

Requirement: Accept a member that the staged class defines

The stage plan check SHALL accept a Class.member claim when the class body at the staged commit defines the member and the line quotes a statement of that class.

Scenario: True TaskGroup field claim

  • WHEN A Feasibility line names TaskGroup.tasks and src/devops_cli/roadmap/step_files.py, and it quotes tasks: tuple[GroupTask, ...].
  • THEN The check reports no member problem and accepts the plan.

Requirement: Require a quoted statement for a named source

A Feasibility line, a decision or a rejected alternative that names a type, a member or a module under src/ SHALL hold a code span that quotes a statement of that module.

Scenario: Line with a module and no statement

  • WHEN A Feasibility line names src/devops_cli/roadmap/step_files.py and holds no second code span with a statement of that module.
  • THEN The check reports the line and refuses the plan.

Requirement: Refuse a quote that the staged module lacks

The stage plan check SHALL compare each quoted statement with the named module at the staged commit and MUST refuse a quote that the module does not hold.

Scenario: Quote absent from the staged module

  • WHEN A Feasibility line quotes kind: str for src/devops_cli/roadmap/step_files.py.
  • THEN The check reports the missing quote and refuses the plan.

Requirement: Judge only a line that names a source

The quote rule SHALL judge only a line that names a type, a member or a module under src/ in a code span.

Scenario: Line with no source name

  • WHEN A Feasibility line names no type, member or module under src/.
  • THEN The check reports no quote problem for the line.

Requirement: State the quote rule in the verification prompt

The verification prompt MUST state that a line which names a type, a member or a module under src/ and quotes no statement of its module is a false_premise finding.

Scenario: Prompt-rule test reads the prompt

  • WHEN The test tests/roadmap/stage/test_roadmap_stage_prompt_rules.py reads src/devops_cli/ai/tasks/roadmap_stage_verify.md.
  • THEN The test finds the false_premise rule that names a line with no statement of its module.

Existing Tool Considered

The alternatives check of 2026-11-07 returned none: no open, maintained tool covers the need. The closest tool, griffe (https://github.com/mkdocstrings/griffe), parses Python source into the members of a class. It lacks the rest: it reads a working tree and not a commit, it finds no Feasibility, decision or rejected-alternative line, it compares no quoted code span with a staged module, and it reports no false_premise finding. The change therefore extends the class-claim rule that the project keeps (src/devops_cli/roadmap/stage/stage_change.py:2556) and reuses its class-body reader parse_class_fields (src/devops_cli/roadmap/stage/stage_models.py:114). The written cost is about 2,000 tokens to build and test the rule, and about 30 minutes elapsed. The upkeep is one test module and one prompt sentence.

Key questions

  • Does TaskGroup in src/devops_cli/roadmap/step_files.py hold a kind member?: No. TaskGroup holds number, title, tasks, text and line. Its is_behavior property reads a Kind: line from the group text, and the plan reader infers a kind for a group that holds no such line. [sources: src/devops_cli/roadmap/step_files.py:59, src/devops_cli/roadmap/plan_read.py]
  • Which files hold the stage check, the verification module and the verification prompt that the change touches?: The stage check is src/devops_cli/roadmap/stage/stage_change.py. The verification module is src/devops_cli/roadmap/stage/stage_verify.py. The verification prompt is src/devops_cli/ai/tasks/roadmap_stage_verify.md. The issue names the first two one folder up, so the plan uses the paths that the commit holds. [sources: src/devops_cli/roadmap/stage/stage_change.py:2556, src/devops_cli/roadmap/stage/stage_verify.py, src/devops_cli/ai/tasks/roadmap_stage_verify.md]
  • Is the class-claim rule of fix(roadmap): Check a class claim against the staged source #3407 in the code at the refined commit?: Yes. class_claim_problems is defined in src/devops_cli/roadmap/stage/stage_change.py, and tests/roadmap/stage/test_roadmap_stage_class_claim.py tests it. The member rule therefore extends a rule that the code holds, and the item waits on no other item. [sources: src/devops_cli/roadmap/stage/stage_change.py:2556, tests/roadmap/stage/test_roadmap_stage_class_claim.py]
  • How does the check find the member in the class at the staged commit?: Parse the staged class source with parse_class_fields, and refuse a member that the returned field map lacks. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:2556, src/devops_cli/roadmap/stage/stage_models.py:114]
    • Chosen: Reuse parse_class_fields on the staged class source. The project already parses a class body with it, and the class-claim rule already reads the staged class, so the change adds no second reader.
    • Rejected: Walk the module with a new ast reader. It duplicates parse_class_fields and adds a second reader.
    • Rejected: Search the module text for the member name. Another class or a local variable can satisfy the search.
    • Rejected: Trust the quoted statement only. A quote from another class passes with no class check.
  • What must a plan line quote when it names a type, a member or a module under src/?: The line holds a code span with a statement of that module. The check refuses the line when the staged module holds no such statement. The comparison folds white space, as the citation rule does. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:2415]
  • Where should the member rule and the quote rule run?: The member rule extends class_claim_problems, which already reads the cited class at the staged commit. The quote rule joins the CITATION gate, which already reads a cited file at the staged commit and compares a quoted text with it. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:2556, src/devops_cli/roadmap/stage/stage_change.py:2415]
    • Chosen: Extend class_claim_problems and the CITATION quote check. One member check sits beside the class-source mapping, and one quote check sits beside the staged-file reader.
    • Rejected: Extend model_problems. It judges a Class.attribute of a known model from a fixed field map, not an arbitrary class at the staged commit, and it scans task text.
    • Rejected: Add a new member gate. It duplicates the class-claim rule and adds a second member check.
    • Rejected: Extend the verification prompt only. The plan of feat(roadmap): the implement job re-checks a plan premise against the base #3417 passed the model pass with the false claim.
  • Which test must a group that changes src/devops_cli/ai/tasks/roadmap_stage_verify.md carry?: A group that changes a roadmap_stage_*.md prompt lists tests/roadmap/stage/test_roadmap_stage_prompt_rules.py in its reads or changes, and its verify command names that test. [sources: src/devops_cli/roadmap/stage/stage_change.py, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/low
    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/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It closes a verification gap but does not block a release or expose a security risk.
    • Value: Medium. It stops plans with false member claims from passing the stage check.
    • Effort: Low. The body estimates about 2000 tokens and 30 minutes to build and test.
    • Related: fix(roadmap): Check a class claim against the staged source #3407, which asks for a different change. Both verify plan claims against staged source, but #3407 checks a class-level claim while this checks whether a type defines a specific member.
  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 7cf8335 (see proposed design in issue body).

  6. changed the title [-]fix(roadmap): the plan check reads a claim about a field against the staged source[/-] [+]fix(roadmap): Verify a claimed member against the staged source[/+] 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 68 characters, and the limit is 60. The type and the scope stay.

    • Before: fix(roadmap): the plan check reads a claim about a field against the staged source
    • After: fix(roadmap): Verify a claimed member against the staged source
    • Source of the summary: the background model
  8. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The searches surfaced only general Python API parsers, such as griffe, which list a class's members from source; none reads a class at a staged commit, routes the Feasibility/decision/rejected-alternative lines of a plan, or compares a quoted code span with a module. The issue therefore asks for an extension of the project's own stage probe and the #3407 comparison rather than for a library, and the stdlib ast the design already names covers only the class-body parse.

    Tool: none found

    Lacks:

    • Reads the named module and type at the staged commit rather than in the working tree
    • Finds the plan lines (Feasibility, decisions, rejected alternatives) that name a type or member under src/
    • Compares a quoted code span with the staged module text
    • Reports a missing quote as a false_premise finding in the verification prompt

    Tools considered:

    Searches run:

    • Python library inspect class members from source without importing (griffe), results: 0
    • tool verify code documentation claims about class attributes against source code, results: 0
    • griffe python static analysis, results: 0
    • python ast check class attributes from source, results: 0
    • griffe, results: 0
    • griffe documentation, results: 0
    • static analysis class member existence python source, results: 0
    • griffe inspect python module members, results: 0
    • python library read class attributes from source without import, results: 0
    • griffe github mkdocstrings, results: 0

    Sources:

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

  9. dan-petty commented on Nov 14, 2026

    @dan-petty
    OwnerAuthor

    Returned to New: the item extends the rule of #3407, and that rule is not on main. #3407 is open (status/ready, effort/medium), and src/devops_cli/roadmap/stage/stage_change.py holds no check that compares a claimed class or member with the staged source; the only matches are the gate-name comment at line 2304. Building #3458 first would add the member rule without the class rule it extends. Build #3407 first, then refine this item against the merged rule.

  10. 25 remaining items

  11. added
    status/in-review
    and removed
    status/blocked
    on Nov 18, 2026
  12. removed
    status/in-review
    on Nov 18, 2026
  13. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-18 04:24 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/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions