Skip to content

fix(roadmap): Return the item when a cited class field now exists #3406

Closed

Description

@dan-petty

Problem or Motivation

The premise probe of the stage job checks a path or an identifier that an issue cites. It does not check a class field that the issue says is absent.

Issue #3344 says PullStatus in src/devops_cli/github/client.py defines no labels. Commit 499a5462 (#3399) added labels, so the premise is false now. The stage job still staged PR #3350, and its Feasibility said the field is absent. A plan can therefore spend a full stage run on a gap that a merged commit has already closed.

Proposed Solution & Architectural Design

  • Add a probe question for a dotted reference Class.field in the issue body: read the class at the staged commit and ask whether it defines the field.
  • Reuse the model reader that feat(roadmap): Refuse a plan that reads an absent model field #3344 adds, or the ast reader of src/devops_cli/roadmap/stage_probe.py when feat(roadmap): Refuse a plan that reads an absent model field #3344 is not merged.
  • When the field exists and the issue says it is absent, return the item to New with the evidence, or tell the planner to restate the plan around the current field.
  • Add an offline test in tests/roadmap/test_roadmap_stage_probe.py with a class that holds the named field and a body that says it is absent.

Target Subsystem

SDLC, Git & PR Governance

Existing Tool Considered

No open, maintained tool reads a Pydantic class field at a git commit. The change extends the existing premise probe and uses its git calls and the standard library ast; it adds no dependency. Cost: about 4,000 output tokens to build and test, about 1,000 tokens for each later fix, and about 2 hours elapsed.

Proposed design

Problem statement

The stage premise probe checks each path and identifier that an issue cites. It reads a dotted reference such as PullStatus.labels as a path, and no file holds that path. The plan can then state that a field is absent after a commit added it. The stage job spends a full plan run on a premise that is already false.

Acceptance criteria

Requirement: Field reference probe

The premise probe SHALL read a cited Class.field reference as a class field when the staging commit defines the class.

Scenario: A class that defines the cited field

  • WHEN The issue body cites PullStatus.labels and PullStatus at the staging commit defines labels
  • THEN The probe text says that PullStatus defines labels at its file and line, and the reference is not in the probe's missing list.

Requirement: Field absent from the class

The probe SHALL state that the class defines no field of the cited name when the class at the staging commit has no such member.

Scenario: A class without the cited field

  • WHEN The issue body cites PullStatus.unknown_field and PullStatus at the staging commit defines no unknown_field
  • THEN The probe text says that PullStatus defines no unknown_field, and the reference is in the probe's missing list.

Requirement: False absence returns the item

The stage job SHALL return the item to New with the probe evidence when the body states that a cited field is absent and the staging commit defines it.

Scenario: The body says a field is absent while the class defines it

  • WHEN The body says that PullStatus defines no labels and PullStatus at the staging commit defines labels
  • THEN The stage job returns the item to New, and its comment quotes the probe line that names the file and line of labels.

Requirement: A field reference is no path

The probe MUST NOT report a cited Class.field reference as a path when the staging commit defines the class.

Scenario: The cited dotted reference names a class

  • WHEN The issue body cites PullStatus.labels and the staging commit defines the class PullStatus
  • THEN The probe text holds no line that says the path PullStatus.labels is no file of the staging commit.

Requirement: Bounded read-only field probe

The field probe MUST count each git command against the probe budget and MUST leave the checkout unchanged.

Scenario: A probe of cited fields

  • WHEN The probe reads a cited class field at the staging commit
  • THEN The probe reports its command count against CONST_ROADMAP_STAGE_PROBE_MAX_COMMANDS, and git status --porcelain of the checkout stays empty.

Existing Tool Considered

No alternatives check has run. No open, maintained tool reads a Pydantic class field at a git commit. The change extends the existing premise probe with the standard library ast and adds no dependency. Cost: about 4,000 output tokens to build and test, about 1,000 output tokens for each later fix, and about 2 hours elapsed.

Key questions

  • Does the stage premise probe check a class field today?: No. probe_premise probes cited paths and identifiers only. It reads PullStatus.labels as a path, so it writes that the path is no file of the staging commit. [sources: src/devops_cli/roadmap/stage_probe.py, openspec/changes/3344-the-stage-probe-checks-client-model/proposal.md]
  • Does PullStatus define labels at the refined commit?: Yes. PullStatus holds labels: tuple[str, ...] = () with a validator that turns the GitHub label objects into names. [sources: src/devops_cli/github/client.py]
  • How does the probe read a class field at the staging commit?: Read the file text with git cat-file at the staging commit, parse it with the standard library ast, and check the class body for an assignment, an annotated assignment or a method of the cited name. (best practice) [sources: src/devops_cli/roadmap/stage_probe.py, src/devops_cli/core/test_selection.py]
  • How does the probe tell a dotted reference from a file path?: The probe reads a token as a field reference when it holds one dot and git grep finds the class of its left part at the staging commit. Another token stays a path. (best practice) [sources: src/devops_cli/roadmap/stage_probe.py]
    • Chosen: Confirm the class at the staging commit. The class definition decides. README.md and Dockerfile.amd64 find no class, so they stay paths.
    • Rejected: A left part that starts with a capital letter. It reads README.md as a field reference and costs a command on every documentation path.
    • Rejected: Probe the token as a path first. It keeps the false no-file line that this issue fixes.
  • What does the stage job do when the cited field exists and the body says it is absent?: Return the item to New with the probe line as the evidence. A plan run on a premise that is already false is the defect this issue fixes. (best practice) [sources: openspec/changes/3344-the-stage-probe-checks-client-model/design.md, src/devops_cli/roadmap/stage_probe.py]
    • Chosen: Return the item to New. The project returns an item on a false premise already. The probe line names the file and the line of the field.
    • Rejected: Tell the planner to restate the plan. It spends a full plan run on a false premise, which is the cost this issue removes.
  • How does the probe know that the body states the field is absent?: The probe reads the body line that holds the reference and matches a fixed tuple of absence phrases, such as defines no, does not define, has no, lacks and is absent. (best practice) [sources: src/devops_cli/roadmap/stage_probe.py]
    • Chosen: A fixed tuple of absence phrases on the line. It is deterministic and offline, and a test can set the exact wording.
    • Rejected: A model call. It adds a model call and a nondeterministic answer to a probe that is bounded and read-only.
    • Rejected: No detection, report the field state only. The return never triggers, and the planner repeats the defect.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-06: partly.
Tool: mkdocstrings/griffe (https://github.com/mkdocstrings/griffe), ISC, last activity 2026-10-23, maintained.

Activity

  1. added
    type/bug
    source/agent
    status/new
    on Nov 4, 2026
  2. added
    scope/roadmap
    value/medium
    effort/medium
    on Nov 4, 2026
  3. devops-cli-service commented on Nov 4, 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.

    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It prevents wasted stage runs on already-closed gaps but does not block delivery.
    • Value: Medium. It stops the stage job from spending a full run on a gap a merged commit already closed.
    • Effort: Medium. It adds a new probe type, reuses the existing AST reader, and adds an offline test.
    • Related: feat(roadmap): Refuse a plan that reads an absent model field #3344, which asks for a different change. Both check whether a class field exists at the staged commit, but #3344 flags absence for a plan reader while the candidate flags presence for an issue claim.
  4. added
    priority/p2-medium
    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 ecfc9b8 (see proposed design in issue body).

  6. changed the title [-]fix(roadmap): the stage job returns an item whose cited model field now exists[/-] [+]fix(roadmap): Return the item when a cited class field now exists[/+] 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: fix(roadmap): the stage job returns an item whose cited model field now exists
    • After: fix(roadmap): Return the item when a cited class field now exists
    • Source of the summary: the background model
  8. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Tool: mkdocstrings/griffe (https://github.com/mkdocstrings/griffe)

    • License: ISC
    • Last activity: 2026-10-23
    • Maintained: yes

    Covers:

    • Statically inspects Python source, without importing it, and exposes the members a class defines, which answers the core question of whether a cited class holds a cited field.
    • Works offline on source text, so the probe can hand it the text of a file fetched from the staging commit instead of checking the commit out.

    Lacks:

    • It does not read a file at a git commit; the probe still needs its own git call to fetch the source of the staged commit.
    • It does not decide whether a dotted reference in the issue body is a class field or a file path, nor match absence phrases such as defines no or lacks.
    • It does not return the item to New with the probe evidence, nor count its reads against CONST_ROADMAP_STAGE_PROBE_MAX_COMMANDS.
    • It is an added third-party dependency, where the issue proposes the standard library ast the project already uses and no new dependency.

    Searches run:

    • python library inspect class fields at a git commit without checkout AST
    • griffe python API static analysis read class attributes from source
    • griffe python static analysis class attributes
    • libcst parse python class fields
    • griffe
    • tool to check whether a python class defines an attribute
    • python ast check class has field
    • griffe inspect class attribute source code
    • git show file at commit python parse ast

    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
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 9, 2026
  10. removed
    status/in-review
    on Nov 9, 2026
  11. 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/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions