Skip to content

feat(roadmap): a plan that deletes a guard check records the weakened check #3320

Open

Description

@dan-petty

Problem or Motivation

The plan in PR #3277 (for #3204) deletes the hand-written exclusion tuple of test_all_cli_commands_are_either_exposed_or_excluded in tests/ai/mcp/test_mcp.py, and it makes the hand-written class of CONST_DOCS_INVENTORY the complement of the other classes. Both changes remove a check that forces a person to decide: a new MCP command, and a new Markdown file with no class, each fail a test today and pass silently after the change. The issue asks for this, and each change is safe by default (a new command is unexposed). Still, AGENTS.md rule 5 says never lower a security or quality threshold, and only the owner can allow it. The plan does not say that it weakens a check, and the review found it by reading the tasks.

Proposed Solution & Architectural Design

  1. In the plan check, find a task or a decision that deletes a test or an entry of a guard list (Delete, Remove, drops) under tests/ or in a CONST_* inventory, and ask the plan for a ## Weakened checks entry: the check, what it stopped, and the safeguard that replaces it or the person who allowed it.
  2. Refuse a plan that deletes such a check and has no entry.
  3. Test with a plan that deletes test_all_cli_commands_are_either_exposed_or_excluded and has no entry.

Target Subsystem

src/devops_cli/roadmap/stage_change.py (check_proposal), openspec/config.yaml proposal rules.

Source: #3277

Dependencies

Proposed design

Problem statement

check_proposal accepts a plan that deletes a guard check. PR #3277 deletes the hand-written exclusion tuple of test_all_cli_commands_are_either_exposed_or_excluded. It also makes the hand-written class of CONST_DOCS_INVENTORY the complement of the other classes. Each change removes a check that forces a person to decide, and AGENTS.md rule 5 lets only the owner lower a threshold. The plan did not say that it weakens a check, and a review found it by reading the tasks. The check must refuse such a plan unless it records the check, what it stopped and its safeguard.

Acceptance criteria

Requirement: A deleted guard check needs an entry

check_proposal SHALL refuse a plan whose work texts delete a test or a CONST_* entry when no weakened_checks entry names it.

Scenario: A plan deletes a guard test and records nothing

  • WHEN A reply deletes test_all_cli_commands_are_either_exposed_or_excluded in a task, and weakened_checks is empty.
  • THEN check_proposal returns one problem that names test_all_cli_commands_are_either_exposed_or_excluded.

Requirement: An entry that names the check satisfies the rule

check_proposal MUST accept a plan whose weakened_checks entry names each guard check that the plan deletes.

Scenario: A plan deletes a guard test and records it

  • WHEN The reply deletes the same test and gives an entry whose check holds test_all_cli_commands_are_either_exposed_or_excluded.
  • THEN check_proposal returns no weakened-check problem.

Requirement: The proposal file shows each weakened check

render_change SHALL write a ## Weakened checks section that gives the check, what it stopped and the safeguard of each entry.

Scenario: A plan with one weakened check renders

  • WHEN A reply gives one weakened_checks entry.
  • THEN proposal.md holds ## Weakened checks with the check, what it stopped and the safeguard of the entry.

Requirement: A plan that weakens no check keeps its proposal file

check_proposal MUST report no weakened-check problem for a plan that deletes no guard check, and render_change MUST write no ## Weakened checks section for it.

Scenario: A plan that deletes no guard check

  • WHEN A reply deletes no test and no CONST_* entry, and weakened_checks is empty.
  • THEN check_proposal returns no weakened-check problem and proposal.md has no ## Weakened checks section.

Requirement: The proposal rules ask for the weakened check

The proposal rules in openspec/config.yaml SHALL ask a plan that deletes a guard check to give the ## Weakened checks entry.

Scenario: The proposal rules name the section

  • WHEN A test reads the proposal rules of openspec/config.yaml.
  • THEN One rule names ## Weakened checks and its three facts.

Existing Tool Considered

No alternatives check has run on this item. No open, maintained tool or library covers the need: the rule refuses a plan of this repository, so it lives in check_proposal. To build it instead costs about 40k tokens to write, about 5k tokens a month to keep and fix, and about 3 hours of elapsed time.

Key questions

  • Where does the stage job check a plan, and which texts of a reply state its work?: check_proposal in src/devops_cli/roadmap/stage_change.py holds the rules of openspec/config.yaml that a schema cannot say. The texts that state the work are what_changes, each group's implementation and documentation, and each decision with its reason. [sources: src/devops_cli/roadmap/stage_change.py, openspec/config.yaml]
  • How does the check find a deleted guard check?: Scan the texts that state the work for a deletion verb and a guard target. Do not trust a flag that the model sets. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md, src/devops_cli/roadmap/stage_change.py]
    • Chosen: Scan the work texts for a deletion verb and a guard target. The check is deterministic and independent of the model's declaration, as ADR 0005 asks of a finding.
    • Rejected: Require the model to set a deletes_check boolean. A model that forgets the flag passes the check, so the guard is no guard.
    • Rejected: Refuse every plan that lists a path under tests/ in changes. A plan that edits a test without deleting it would be refused.
  • Which words and targets count as a deletion of a guard check?: The verbs delete, remove and drop, with their -s, -ed and -d forms, matched without case. The target is a tests/ path, a test_* name or a CONST_* name. (best practice) [sources: AGENTS.md, tests/ai/mcp/test_mcp.py, src/devops_cli/config/constants.py]
    • Chosen: The three verbs with their inflections, and the three target forms. The issue names these verbs and these targets, and the match stays bounded.
    • Rejected: Any word that means a removal. A synonym list grows without bound and refuses plans that delete nothing.
    • Rejected: Only the exact words Delete, Remove and drops. A task writes removes or removed, and the check would miss it.
  • What does a weakened_checks entry hold?: Three one-line texts: check, the name or path of the check; stopped, what the check stopped; and safeguard, the replacement or the person who allowed the deletion. (best practice) [sources: AGENTS.md, src/devops_cli/roadmap/stage_change.py]
    • Chosen: Three required texts. The issue asks for the check, what it stopped and the safeguard, and a reviewer reads each as a separate fact.
    • Rejected: One free text. A free text lets a plan name the check and skip the safeguard.
    • Rejected: The check name and an optional reason. The safeguard is the fact that replaces the check, so it is required.
  • How does an entry satisfy a detected deletion?: An entry satisfies a deletion when its check text holds the detected name or path. The check refuses a detected deletion with no such entry. (best practice) [sources: src/devops_cli/roadmap/stage_change.py]
    • Chosen: The entry names the check. A plan that deletes two checks needs two entries, and the match stays deterministic.
    • Rejected: Any non-empty entry satisfies every deletion. One entry would cover an unrelated deletion.
    • Rejected: The entry equals the check exactly. An entry that writes the check in a sentence would be refused.
  • Where does the proposal file hold the weakened checks?: In ## Weakened checks, after ## Impact and before ## Feasibility. The section appears only when the list is not empty. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, openspec/config.yaml]
    • Chosen: A section of proposal.md after Impact. The proposal states what the change does and what it gives up, and the check reads the reply, not the file.
    • Rejected: A section of design.md. A design records a choice; a weakened threshold is a fact of the change that a reviewer must see.
    • Rejected: No section, only the check. The issue asks the plan for an entry that a person reads.
  • Which message namespace holds the new problem and section texts?: MESSAGES.roadmap in src/devops_cli/lang/en/messages.py, as every text of stage_change.py uses. [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/lang/en/messages.py]
  • Does the change carry a spec delta?: Yes. check_proposal decides whether the stage job accepts a plan, so a consumer observes the change. The delta adds one requirement to roadmap-stage and sets no skip_specs. (best practice) [sources: openspec/config.yaml, docs/ROADMAP_WORKFLOW.md]
    • Chosen: ADDED requirement in roadmap-stage. The stage job's answer to a plan is observable, and the config asks for a delta.
    • Rejected: skip_specs: true. The rule changes what the job does, so the change is no test, document or refactor.
  • Which test proves the check offline?: A new module tests/roadmap/test_roadmap_stage_weakened_checks.py builds a StageProposal whose task deletes a guard test. It calls check_proposal with a thin tree and no base specs. [sources: tests/roadmap/test_roadmap_stage_form.py, tests/roadmap/test_roadmap_stage_plan.py, tests/roadmap/test_roadmap_stage_prompt_rules.py]
  • Does the change need a replay case and a model score before and after?: Yes. docs/ROADMAP_WORKFLOW.md asks a change to check_proposal to set the new gate in the case files and to state the score of the same model before and after. The plan gives both as tasks, and the score goes in the pull request comment. (best practice) [sources: docs/ROADMAP_WORKFLOW.md]
    • Chosen: Add the replay case and state the score. The workflow document makes both a condition of a change to a stage gate.
    • Rejected: Add the replay case only. The document asks for the model score too.
    • Rejected: Neither. A gate change that states no count breaks the rule of the workflow document.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 3, 2026
  2. dan-petty commented on Nov 3, 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 closes a process gap that lets plans silently weaken guard checks, but it does not block a release or fix a live failure.
    • Value: Medium. It catches a specific class of silent guard weakening that a human review found by reading tasks manually.
    • Effort: Medium. It needs pattern matching for deletion keywords in tests and inventories, a new required section check, and a test case.
    • Related: feat(roadmap): add a plan-check command for a plan pull request #3201, which asks for a different change. Both concern the plan-check system, but 3201 creates the overall plan-check command while the candidate adds one specific rule for deleted guard checks.
  3. added
    priority/p2-medium
    on Nov 3, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 3, 2026
  5. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 8e0a486 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

    Staged: branch feat/3320-a-plan-that-deletes-a-guard, draft pull request #3333. 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:

    1. Refuse a plan that deletes a guard check: 10924 tokens
    2. Write the weakened checks into the proposal file: 10895 tokens
    3. Ask for the section in the proposal rules: 7931 tokens
    4. Replay a plan that deletes a guard check: 7941 tokens
    5. State the score of the stage gate: 15986 tokens

    The plan run made 2 model request(s), and used 149484 input tokens and 6135 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:

    • other at group 1: The plan adds the weakened_checks field to StageProposal but never edits the stage prompt roadmap_stage_change.md. The existing prompt test then fails because the prompt keys no longer match the model fields. The model also never learns to give the entry. Evidence: "assert sorted(bullets) == sorted(StageProposal.model_fields)"
    • other at group 4: The plan adds the replay case by editing the loader module stage_eval_cases.py. A case is a directory of fixtures, and the plan names no fixture path. It also does not touch the gate code that would refuse the new defect, and GateName has no gate for it. Evidence: "one directory of fixtures for each plan"
    • other at group 5: The plan records the model score in docs/ROADMAP_WORKFLOW.md. The plan's own design says the score goes in the pull request comment. A before and after score is also unknown when the plan is written. Evidence: "the score goes in the pull request comment"
    • verify_form at group 3: The scenario for the proposal rules needs a test that reads openspec/config.yaml. The group has no test, and uv run devops openspec check does not assert that the rule names ## Weakened checks. The spec delta also leaves this requirement out. Evidence: "A test reads the proposal rules of openspec/config.yaml."
  7. added 2 commits that reference this issue on Nov 3, 2026
  8. added
    status/planned
    owner/service
    status/in-progress
    and removed
    status/ready
    status/planned
    on Nov 3, 2026
  9. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Stopped at group 1.

    Failure class: plan_defect.
    Action taken: none.
    Action left: wait: wait for a person.

    Step Status Attempts Tokens in/out Last failing command
    group 1 stopped 1 4316470/32653 -

    Reason:

    The agent asked for a scope change: The plan renders the `## Weakened checks` section but no group reads it back. `read_change` gives `weakened_checks=[]`, so `check_proposal` refuses every plan that the stage job accepted for the entry it holds, and a person cannot repair the plan by editing `proposal.md`.. Evidence: `src/devops_cli/roadmap/plan_read.py:439` builds `StageProposal(...)` with no `weakened_checks`, and `_proposal` at `plan_read.py:182` reads only Why, What Changes, Feasibility and Existing Tool Considered. `src/devops_cli/roadmap/implement.py:373`, `src/devops_cli/roadmap/plan_check.py:342` and `src/devops_cli/roadmap/plan_recheck.py:179` run `check_proposal` on that proposal. No group of `openspec/changes/3320-a-plan-that-deletes-a-guard/tasks.md` names `src/devops_cli/roadmap/plan_read.py`, and `git grep -n weakened_checks -- src/ tests/` exits 1.
    

    Last message of the agent (a claim that no check verified): I stopped before implementing. The plan renders the new section but no group reads it back, and the group I hold may not change the reader. What I found - check_proposal runs on a change folder too, not only on the reply of the model: src/devops_cli/roadmap/implement.py:373, src/devops_cli/roadmap/plan_check.py:342 and src/devops_cli/roadmap/plan_recheck.py:179 call it on the StageProposal that read_change builds. - read_change builds that proposal at src/devops_cli/roadmap/plan_read.py:439 and passes no weakened_checks. _proposal (plan_read.py:182) reads only Why, What Changes, Feasibility and Existing Tool Considered, so it drops a ## Weakened checks section. - No group of the change names src/devops_cli/roadmap/plan_read.py, and git grep -n weakened_checks -- src/ tests/ finds nothing. - Result of the plan as written: the stage job accepts a plan that records a weakened check, render_change writes the section, and then the implement job, plan check and plan recheck refuse the same plan for the entry it already holds. A person cannot repair it by editing proposal.md, because the reader ignores the section. The plan of #3204 (PR #3277) hits this at once. What I changed: nothing. I wrote the first test of task 1.1, saw it fail on the base (AttributeError: 'RoadmapMessages' object has no attribute 'stage_problem_weakened_check' from uv run devops ci test tests/roadmap/test_roadmap_stage_weakened_checks.py), and deleted that file

    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.

  10. added
    status/blocked
    and removed
    status/in-progress
    on Nov 5, 2026
  11. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261105-144608-e491 ended: succeeded.
    Image digest: sha256:8db59b516837519d266dfa65de12581c242b8c7de3e2501820d66fb0fdab5e08

    The last lines of its log:

    Tool call: read_file, ok.
    Tool call: shell, started: grep -l <masked> tests/fixtures/roadmap_eval/stage/*/case.json
    Tool call: shell, program grep, ok.
    Tool call: shell, started: grep -n -E (Delete|delete|deletes|deleted|Remove|remove|removes|removed|Drop|drop|drops|dropped) tests/fixtures/roadmap_eval/stage/good-2491-a-refused-jwt-excha ...
    Tool call: shell, program grep, refused.
    Tool call: shell, started: grep -n -E (Delete|delete|deletes|deleted|Remove|remove|removes|removed|Drop|drop|drops|dropped) tests/fixtures/roadmap_eval/stage/good-2491-a-refused-jwt-excha ...
    Tool call: shell, program grep, refused.
    Tool call: grep, ok.
    Tool call: grep, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: shell, started: ls tests/fixtures/roadmap_eval/stage
    Tool call: shell, program ls, ok.
    Tool call: grep, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: grep, retry (context must be between 0 and 20. Path: src/devops_cli/roadmap/implement_shell_policy.py).
    Tool call: grep, ok.
    Tool call: write_file, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_weakened_checks.py
    Tool call: shell, program uv, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: shell, started: git grep -n weakened_checks -- src/ ...
    Tool call: shell, started: git grep -n check_proposal( -- src/devops_cli/roadmap/implement.py ...
    Tool call: shell, program git, ok.
    Tool call: shell, program git, ok.
    Tool call: shell, started: uv run python -c __import__("pathlib").Path("tests/roadmap/test_roadmap_stage_weakened_checks.py").unlink()
    Tool call: shell, program uv, ok.
    Tool call: shell, started: git status --short
    Tool call: shell, program git, ok.
    Tool call: read_file, ok.
    Failure class plan_defect. Action left: wait.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 9m 36s
    
  12. removed
    owner/service
    on Nov 5, 2026
  13. added a commit that references this issue on Nov 7, 2026
  14. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    New case on 2026-11-13: plan PR #4917 (item #4472) stopped its implement run for this cause.

    • Task 1.1 of the plan says: replace tests/commands/test_test_selection.py::test_a_selection_past_the_serial_limit_runs_on_the_capped_workers with a new case, "because the file count no longer decides alone".
    • The plan has no ## Weakened checks entry for that test.
    • The implement runner (devops-cli-runner-20261113-135040-3720, v0.128.0) did what the task said, and the step guard stopped the run with class tests_lost: "The agent removed tests that existed at the start of the step. ... only when the plan on the default branch names it in ## Weakened checks." The run spent 6.4 M tokens, and fix(ci): a narrowed ci test runs many slow tests serially #4472 is now Blocked.

    So the guard is right, and the plan is incomplete: a plan whose task replaces or removes a test must also record it under ## Weakened checks. This issue is the source fix. A stage check that refuses such a plan (or the plan writer adding the entry from the task text) would have stopped this before the push. The same cause needed plan correction #5310 for #3785.

  15. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    Two more cases on 2026-11-13, so three in one day. Each plan passed devops roadmap plan-check and CI Plan Check.

    1. fix(ci): a narrowed ci test runs many slow tests serially #4472. Task 1.1 replaced a test with no ## Weakened checks entry. The implement step stopped with tests_lost. A correction PR (docs(openspec): plan #4472 name the replaced selection test #5463) added the entry.
    2. refactor(ai): rank the benchmark with numpy and pytrec-eval #1928 (PR docs(openspec): plan #1928 Rank the benchmark with numpy and pytrec_eval #5422). A plan revision added a test rename to task 3.2 with no entry. The independent review found it before merge, and the entry was added.
    3. fix(roadmap): decision points need cuts for shadow and run in async code #5272 (this cycle). Task 10.1 says: "Rewrite test_the_registry_refuses_a_catalogue_above_60_series ... as test_the_registry_accepts_a_catalogue_at_the_bound_and_refuses_one_above_it". The plan has no ## Weakened checks entry. The runner did groups 1 to 9 (about 28M tokens). At group 10 the step guard stopped it with tests_lost at 20:04Z (runner devops-cli-runner-20261113-182029-a051, 6,250 s, 32.6M tokens in total).

    The guard at implement time is correct. The gap is that no check before the merge sees a task that removes or renames a test with no entry. The stage gate or plan-check can find this deterministically:

    • A task text that names an existing test (path::name or a bare test_* name that git grep finds at the base) with a verb such as rewrite, replace, rename, remove or delete, and that names no new test of the same name, needs a ## Weakened checks line for that path::name.
    • Refuse the plan with the finding weakened_check_missing and the test name, so that the planner adds the line.

    This costs one plan return, not a 30M-token implement run. A plan correction PR for #5272 follows.

  16. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

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/agentstatus/blockedtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions