Repository navigation
Description
Problem
When staging a plan that reads an entity from an external client, the planner sometimes assumes fields already exist on the client's return model.
In #3264 / PR #3305, the plan specified that stage_ready reads labels on a pull request using client.get_pull_status(). However, PullStatus in src/devops_cli/github/client.py only defined state, draft, merged, and head_sha, omitting labels. The plan omitted src/devops_cli/github/client.py from its tasks and impact list.
The stage check does not inspect whether attributes a plan accesses on API models actually exist on those models.
Proposed change
- In the stage probe or gate check, when a plan tasks or design specify reading a new attribute from a model (such as
PullStatus.labels), verify whether the model definition contains that attribute. - If the attribute is missing, ensure the plan lists the model module in its changes and tasks.
- Add a test in
tests/roadmap/test_roadmap_stage_plan.pyverifying that missing model attributes are identified during plan staging.
Acceptance criteria
- A test asserts that when a plan relies on reading a new field from a client model, the plan includes updating that model in its task groups.
- Plans with complete model updates pass validation.
Source: #3305
Proposed design
Problem statement
The stage planner can plan a read of a client model attribute that the model does not define. In #3264 / PR #3305 the plan read PullStatus.labels, but PullStatus in src/devops_cli/github/client.py lacked labels, and the plan did not list that module. The stage check must find this gap and require the model module in the plan.
Acceptance criteria
Requirement: Missing model attribute is refused
The stage proposal check SHALL refuse a plan that reads a model attribute absent from the model at the staged commit.
Scenario: PullStatus lacks labels
- WHEN A plan reads
PullStatus.labelsandPullStatusinsrc/devops_cli/github/client.pyhas nolabelsfield at the staged commit. - THEN
check_proposalreturns a problem that namesPullStatus.labelsandsrc/devops_cli/github/client.py.
Requirement: Model module must be in changes
The stage proposal check SHALL require the model module in a group's changes when a plan reads an attribute that the model lacks.
Scenario: Plan omits client.py
- WHEN A plan reads
PullStatus.labelsand no group listssrc/devops_cli/github/client.pyinchanges. - THEN
check_proposalreturns a problem that tells the model to addsrc/devops_cli/github/client.pyto a group'schanges.
Requirement: Complete model update passes
The stage proposal check SHALL accept a plan that reads a new model attribute when a group lists the model module in changes.
Scenario: Plan includes client.py
- WHEN A plan reads
PullStatus.labelsand a group listssrc/devops_cli/github/client.pyinchanges. - THEN
check_proposalreturns no problem for the model attribute.
Requirement: Missing attribute gets one correction
The stage job SHALL return a missing model attribute problem to the model once and SHALL stop the item on a second reply with the same gap.
Scenario: Two replies omit the model module
- WHEN The first and second replies both read
PullStatus.labelsand omitsrc/devops_cli/github/client.pyfromchanges. - THEN The item fails with
RoadmapStageError, and the plan holds no ready change.
Requirement: Regression test covers model attributes
The test suite SHALL include an offline test in tests/roadmap/test_roadmap_stage_plan.py for a plan that reads a missing model attribute.
Scenario: Regression test runs
- WHEN The test file
tests/roadmap/test_roadmap_stage_plan.pyruns. - THEN It checks both the refused plan and the accepted plan with the model module in
changes.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers this repository-specific stage-plan check. Build it in devops-cli: about 15,000 output tokens to write and test the first version, about 2,000 tokens for each later fix, and about 3 hours elapsed.
Key questions
- Where must the stage job enforce a model attribute that a plan reads?: In
check_proposal. A probe fact alone does not refuse a plan that keeps the missing attribute. (best practice) [sources: tests/roadmap/test_roadmap_stage_plan.py, src/devops_cli/roadmap/stage_change.py]- Chosen: check_proposal gate. The stage tests show that
check_proposalreturns a problem and the planner sends it back to the model once. - Rejected: Stage probe only. A probe informs the model but does not refuse a plan that keeps the missing attribute.
- Rejected: OpenSpec validation. OpenSpec validates spec deltas and cannot read Python model fields.
- Chosen: check_proposal gate. The stage tests show that
- How does the check know the fields of a model at the staged commit?: It parses each Python file under
src/devops_cliwithast. It records classes that subclasspydantic.BaseModeland their annotated field names. (best practice) [sources: src/devops_cli/github/client.py, tests/roadmap/test_roadmap_stage_plan.py]- Chosen: AST parse. The staged tree gives source text, and
astreads fields without import side effects. - Rejected: Import the module. A staged file may not import, or may fail to import, and the check needs static facts.
- Rejected: Regular expression. A regex misses inheritance and annotations and gives false matches.
- Chosen: AST parse. The staged tree gives source text, and
- Which model references does the check inspect?: It inspects backticked dotted references in group task text and spec text, such as
PullStatus.labels, when the class is a Pydantic model in the staged tree. (best practice) [sources: tests/roadmap/test_roadmap_stage_plan.py, src/devops_cli/github/client.py]- Chosen: All Pydantic models under src. A generic scan covers client models and other API models without a hardcoded path.
- Rejected: Only github/client.py. A hardcoded path misses models in other modules and needs a change for each new model module.
- Rejected: Only the issue body. The plan text holds the read that caused fix(roadmap): the stage marks a plan ready although its own model review found a defect #3264, so the issue body alone is not enough.
- What must the plan contain when the model lacks the attribute?: A group
changeslist that includes the module of the model, such assrc/devops_cli/github/client.py. (best practice) [sources: tests/roadmap/test_roadmap_stage_plan.py, src/devops_cli/github/client.py]- Chosen: Module in changes. A changed path renders into the tasks and the impact of the change.
- Rejected: Attribute name in task text only. A task text does not change a file, so the model stays incomplete.
- Rejected: Module in reads only. A read does not change the model definition.
- How many correction turns does a missing model attribute get?: One. The first reply gets the problem. A second reply with the same gap stops the item. (best practice) [sources: tests/roadmap/test_roadmap_stage_plan.py]
- Chosen: One retry. The model needs the problem text to correct the plan, and one retry matches the missing-path rule.
- Rejected: No retry. The model cannot correct a gap that it does not see.
- Rejected: Unlimited retries. Unlimited turns hide a model that cannot plan the change.
- Which test file holds the regression test?:
tests/roadmap/test_roadmap_stage_plan.py. [sources: tests/roadmap/test_roadmap_stage_plan.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 3, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.Prevents a recurring class of plan defects but does not block a critical path.Reduces incorrect plans that reference attributes not present on client models.Requires a new check in the stage probe, a validation rule, and a test.Both add a stage probe that verifies a plan's field references match a model definition, but #3328 checks StageProposal fields against prompt reply keys while the candidate checks client model attributes like PullStatus.labels.devops-cli-service commentedon Nov 3, 2026
Status set to Ready at ce4e327 (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
Staged: branch
feat/3344-the-stage-probe-checks-client-model, draft pull request #3350. 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:
The plan run made 2 model request(s), and used 153476 input tokens and 8942 output tokens. The model made no tool call.
A model review of the plan found these points. They stop no draft, and a person judges them:
otherat group 2, implementation: The implementation returns a problem and also adds the module to a group'schanges. This contradicts the spec scenarios: the check must tell the model to add the module, and a second reply with the gap stops the item. The check would also mutate the plan it checks. Evidence: "Return a problem that names the reference and the module when the field is missing, and add the module to a group'schangeswhen no group lists it."otherat group 3: The group creates the spec delta andtasks.mdby hand. The stage job already renders these files from the reply withrender_change, so the group duplicates that work and will conflict with the rendered files. Evidence: ""openspec/changes/3344-stage-model-attribute-check/tasks.md""otherat what_changes / specs: The check scans every dotted reference in the spec, group and design text, and it cannot tell a mention from a read. This plan namesPullStatus.labelsin its own spec scenarios and lists no group that changesclient.py. The new rule would refuse the plan that adds it. Evidence: "check_proposalcollects the dotted references in the text of the groups, the spec deltas and the design, such asPullStatus.labels."docs(openspec): correct the plan of #3344
docs(openspec): plan #3344 Refuse a plan that reads an absent model f…
[-]feat(roadmap): the stage probe checks client model attributes when a plan reads new fields[/-][+]feat(roadmap): Refuse a plan that reads an absent model field[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 75 characters, and the limit is 60. The type and the scope stay.
feat(roadmap): the stage probe checks client model attributes when a plan reads new fieldsfeat(roadmap): Refuse a plan that reads an absent model fieldfeat(roadmap): refuse a plan that reads an absent model field
feat(roadmap): refuse a plan that reads an absent model field
devops-cli-service commentedon Nov 8, 2026
Released in v0.91.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.91.0
devops-cli-service commentedon Nov 8, 2026
Live since 2026-11-08 17:21 UTC