Repository navigation
Description
Problem or Motivation
A plan that adds a plan-check rule can write text that the new rule refuses. The checks of the stage job never run a proposed rule on the plan that proposes it, so the plan can pass every gate and still refuse itself.
The plan of PR #3349 (for #3343) is an example. Its group 1 test task said that a proposal "says a finding has kind: placeholder". The rule under plan refuses a sentence that names a finding and holds a kind value outside DefectType. The plan therefore held the exact text that its own rule refuses. A later staging of the same plan would return a problem for the rule it adds.
#3386 makes the conflict certain. It asks a plan that adds a gate to quote the defect that the gate refuses. A plan that quotes an unknown finding type, as #3386 requires, then holds the text that a prose rule such as #3343 refuses.
content_problems in src/devops_cli/roadmap/stage_change.py judges the text of a plan. It does not build the plan's own StageProposal and run the new rule on it.
Proposed Solution & Architectural Design
- In
content_problemsinsrc/devops_cli/roadmap/stage_change.py, when a plan changessrc/devops_cli/roadmap/stage_change.pyand adds a rule that reads the text of a plan, require a task group test that builds the plan's ownStageProposaland asserts that the new rule returns no problem for it. - Alternatively, the stage job builds the plan's own
StageProposalfrom the reply and runs the new rule on it. It refuses the plan when the rule would refuse the plan text. - Add a case in
tests/roadmap/test_roadmap_stage_plan.pyfor a plan that adds a text rule without a test that the rule accepts its own proposal, and one for a plan with that test. - Name the rule in
src/devops_cli/ai/tasks/roadmap_stage_change.mdbeside the other checks of a plan.
Target Subsystem
SDLC, Git & PR Governance
Existing Tool Considered
No open, maintained tool checks a plan against the rule that the plan adds. The stage check is the only place that reads both the rule and the plan text. The project builds the check itself: about 6,000 tokens to build, about 1,500 tokens to keep and fix, and about 4 hours elapsed.
Proposed design
Problem statement
A plan that adds a rule to check plan text can hold text that the new rule refuses. The stage checks never run the proposed rule on the plan itself. This change adds a stage check that requires such a plan to include a test. The test builds the plan's own StageProposal and asserts that the new rule returns no problem.
Acceptance criteria
Requirement: Missing self-acceptance test
A plan with a behavior group that changes src/devops_cli/roadmap/stage_change.py MUST include a test text that names StageProposal, content_problems and no problem.
Scenario: Plan without the test is refused
- WHEN
check_proposalreceives a valid proposal with a behavior group that changessrc/devops_cli/roadmap/stage_change.pyand no group test text names both symbols and no problem. - THEN
check_proposalreturns one problem that namesStageProposalandcontent_problems.
Requirement: Present self-acceptance test
A plan with a behavior group that changes src/devops_cli/roadmap/stage_change.py MUST pass the self-acceptance rule when one group test text names StageProposal, content_problems and no problem.
Scenario: Plan with the test is accepted
- WHEN
check_proposalreceives a valid proposal with a behavior group that changessrc/devops_cli/roadmap/stage_change.pyand a group test text that names both symbols and no problem. - THEN
check_proposalreturns no self-acceptance problem.
Requirement: No self-acceptance rule for other plans
A plan whose groups change no path in src/devops_cli/roadmap/stage_change.py MUST NOT be refused by the self-acceptance rule.
Scenario: Plan that changes another file is accepted
- WHEN
check_proposalreceives a valid proposal whose groups change onlysrc/devops_cli/roadmap/stage.py. - THEN
check_proposalreturns no self-acceptance problem.
Requirement: Staging prompt states the rule
The staging prompt src/devops_cli/ai/tasks/roadmap_stage_change.md MUST state the self-acceptance test rule beside the other checks of a plan.
Scenario: Prompt names the self-acceptance test
- WHEN A test loads the prompt with
load_task_prompt. - THEN The prompt text contains
StageProposal,content_problemsand the self-acceptance test rule.
Existing Tool Considered
No alternatives check has run. No open, maintained tool checks a plan against the rule that the plan adds. The stage check is the only place that reads both the rule and the plan text. The project builds the check itself: about 6,000 tokens to build, about 1,500 tokens to keep and fix, and about 4 hours elapsed.
Key questions
- Where does the stage check enforce the self-acceptance test rule?: Add the rule to
content_problemsinsrc/devops_cli/roadmap/stage_change.py. The stage job and the replay both call this function throughcheck_proposal. One rule set judges both paths. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_eval_gates.py]- Chosen: Add the rule to
content_problems. The stage job and the replay call the same function, so the rule needs no second seam. - Rejected: Build the plan's own
StageProposalin the stage job and run the new rule. The new rule is not implemented at staging time, so the stage job cannot run it. - Rejected: State the rule in the prompt only. The prompt gives guidance and no gate, so a plan can still pass and refuse itself.
- Chosen: Add the rule to
- When does the self-acceptance test rule apply?: Apply the rule when a behavior group changes
src/devops_cli/roadmap/stage_change.py. A behavior group adds or changes code behavior, so it marks a new or changed plan rule. An other group that only refactors the file does not trigger the rule. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]- Chosen: A behavior group that changes
stage_change.py. It marks added behavior and avoids a test demand for refactors and documents. - Rejected: Any change to
stage_change.py. It refuses a refactor or a comment change that adds no rule. - Rejected: A text keyword in
whyorwhat_changes. The text is free prose and a fragile trigger.
- Chosen: A behavior group that changes
- Which test text satisfies the self-acceptance test rule?: Require one group
testtext to nameStageProposal,content_problemsand the phrase no problem. The check accepts any group, not only the group that changesstage_change.py. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_plan.py, openspec/changes/3343-the-stage-probe-checks-defecttype-membership/design.md:10]- Chosen: Required symbols and the phrase no problem. The check is deterministic and matches the test the issue asks for.
- Rejected: Exact sentence match. A small wording change would fail a valid plan.
- Rejected: No static check and rely on review. The stage gate would still pass a plan that refuses itself.
- Does the plan check have enough data to apply the rule?: Yes.
StageProposalholds each group with itskind,changesandtesttext.content_problemsreceives the whole proposal. [sources: src/devops_cli/roadmap/stage_change.py] - Can a test build a
StageProposaland callcontent_problemsoffline?: Yes. Existing tests build proposals withmake_stage_proposaland callcheck_proposalandcontent_problemswith no network or cluster. [sources: tests/roadmap/test_roadmap_stage_plan.py, tests/roadmap/test_roadmap_stage_content.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 4, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
A plan can pass every gate and still refuse itself, which is a correctness gap in the validation pipeline.It closes a class of self-contradictory plans that no current gate catches.It changes content_problems, adds two test cases, and names the rule in the task document.Both concern a plan that adds a rule or gate, but #3386 requires quoting the refused defect while the candidate requires the new rule to accept the plan's own text.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at 4e0e243 (see proposed design in issue body).
devops-cli-service commentedon Nov 4, 2026
Staged: branch
feat/3404-the-plan-check-requires-a-new, draft pull request #3409. 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 3 model request(s), and used 236067 input tokens and 12120 output tokens. The model made no tool call.
dan-petty commentedon Nov 4, 2026
PR #3408 (the plan for #3405) is another instance.
The plan adds a rule that refuses a task text that names
MESSAGES.roadmapunless a group changessrc/devops_cli/lang/en/messages.py. Group 1 of the plan namedMESSAGES.roadmapin its tasks and did not listmessages.pyinchanges. The plan passed every check, and the rule it adds would refuse it.The omitted file was also a real defect: the plan needed a new
RoadmapMessagesentry inmessages.pyfor the problem text, and the project holds every output string in that catalog. The fixed plan listsmessages.pyin group 1.docs(openspec): plan #3404 name the message file in group 1
docs(openspec): plan #3404 Require a self-acceptance test for a plan …
devops-cli-service commentedon Nov 5, 2026
Stopped at fix.
Failed check:
Service Image. The end of its log:Failure class:
limit_reached.Action taken: none.
Action left:
raise_limit: raise the limit that the run went over.pytest on base: tests/roadmap/test_roadmap_stage_content.pypytest on base: tests/roadmap/test_roadmap_stage_prompt_rules.pyService ImageReason:
Last message of the agent (a claim that no check verified): Now let me check the premise evidence once more and look at the exact Dockerfile region I will change:
The job discarded this work. Read it before you retry:
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 ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemallow it.devops-cli-service commentedon Nov 5, 2026
The runner Job devops-cli-runner-20261105-150105-8e54 ended: succeeded.
Image digest: sha256:8db59b516837519d266dfa65de12581c242b8c7de3e2501820d66fb0fdab5e08
The last lines of its log:
fix(roadmap): keep the recorded plans accepted by the self-acceptance…
devops-cli-service commentedon Nov 6, 2026
Released in v0.66.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.66.0
devops-cli-service commentedon Nov 6, 2026
Live since 2026-11-06 06:16 UTC