Skip to content

feat(roadmap): the step guard allows a test removal that the plan records #3490

Closed

Description

@dan-petty

Problem

A plan can order the removal of an old test, but the step guard refuses each lost test. So such a plan can never pass. roadmap_implement_step.md:36 says Do not remove, rename or replace a test, and lost_tests (implement_test_names.py) counts a moved test as lost. This hurts the implement job, which spends the tokens and discards the work, and the person who must find the cause.

Evidence from the window 2026-11-03T15:05Z to 2026-11-04T15:05Z:

#2651 (29 tests, 5,323,223 tokens) and #3393 (4 tests, 5,147,858 tokens) lost tests by a model error. Their plans order no such removal. They used 10.5M of the 15.0M input tokens in these 4 stops. Their repair turn belongs to #3053 and not to this issue.

Expected

The step guard allows a removal or a rename that the plan records, and it refuses any other lost test. The record is the weakened_checks list of #3320, with check, stopped and safeguard. This issue adds no second plan form and no second gate. The prompt says the same as the guard. The eval property TESTS_KEPT reads the same record as allow_lost_tests.

The plan of this issue names the safeguard, because AGENTS.md rule 5 lets only the owner lower a threshold. #3320 holds that rule.

The plan of this issue also chooses the class of a lost test that the plan does not record. The failure.py docstring says that the class list is fixed, so a new class changes that table and its test.

Acceptance criteria

Existing tool considered

Project code covers the need: lost_tests, _tests_failure (implement_step.py:1061), weakened_checks of #3320 and allow_lost_tests (implement_eval_properties.py:203). The standard library ast already reads the test names.

Dependencies

Related

Related: #3053, #3098, #2519, #2592, #2610, #2636

Proposed design

Problem statement

A plan can order the removal or rename of an old test, but the step guard refuses every lost test. The implement job then stops and spends tokens on a plan that it cannot complete. The change makes the guard, the prompt and the TESTS_KEPT eval property accept a lost test that the plan records in weakened_checks of #3320. The guard refuses any other lost test and classifies it correctly.

Acceptance criteria

Requirement: Recorded removal passes the guard

The step guard SHALL allow a test removal that the plan's weakened_checks list records.

Scenario: Recorded removal

  • WHEN A step loses a test and weakened_checks holds an entry for that test with check, stopped and safeguard.
  • THEN The guard reports no lost-test failure.

Requirement: Unrecorded removal stops the guard

The step guard SHALL refuse a test removal that the plan's weakened_checks list does not record.

Scenario: Unrecorded removal

  • WHEN A step loses a test and no weakened_checks entry names that test.
  • THEN The guard reports a lost-test failure and the step stops.

Requirement: Recorded rename or move passes the guard

The step guard SHALL allow a rename or a move when the weakened_checks entry names the old test.

Scenario: Recorded rename

  • WHEN A test moves or changes its name and weakened_checks holds the old path::name.
  • THEN The guard reports no lost-test failure.

Requirement: Prompt states the recorded exception

The roadmap_implement_step.md prompt SHALL allow a test removal or rename that the plan records and SHALL refuse any other lost test.

Scenario: Prompt text

  • WHEN The implement-step prompt renders for a plan with a weakened_checks entry.
  • THEN The prompt text says a recorded removal or rename is allowed and an unrecorded lost test is refused.

Requirement: Lost-test stop is not a CI retry

A stop for a lost test SHALL read the lost_test class with action stop, not ci_infra with action retry.

Scenario: Lost-test failure class

  • WHEN A lost test stops a step.
  • THEN The failure record reads lost_test with action stop.

Requirement: TESTS_KEPT reads the plan record

The eval property TESTS_KEPT SHALL pass a test removal that weakened_checks records, through the same list as allow_lost_tests.

Scenario: Recorded removal in eval

  • WHEN A fixture records a removal in weakened_checks and builds allow_lost_tests from that record.
  • THEN TESTS_KEPT returns OK.

Requirement: Remaining plans hold the record

Each plan of #2519, #2592, #2610 and #2636 that remains under openspec/changes SHALL hold a Weakened checks entry.

Scenario: Plan migration

  • WHEN The command git grep -l "Weakened checks" openspec/changes runs after the change.
  • THEN The output lists each of those plans that is still under openspec/changes.

Requirement: One plan record and one gate

The change SHALL use the weakened_checks list of #3320 and SHALL add no second plan form or gate.

Scenario: Single record

  • WHEN A plan records a test removal.
  • THEN The guard and the prompt read weakened_checks; no other record or gate authorizes the removal.

Existing Tool Considered

No alternatives check has run. The need is project-internal: lost_tests, _tests_failure (src/devops_cli/roadmap/implement_step.py:1061), weakened_checks from #3320 and allow_lost_tests (src/devops_cli/roadmap/implement_eval.py:89). The standard library ast already reads the test names. No open external tool covers this guard. The change extends existing project code; it does not build a new tool. The written cost is the guard, prompt and eval tests in this issue.

Key questions

  • Which failure class should a lost test get when the plan does not record it?: Add one lost_test class with action stop. Do not keep ci_infra with retry. The new class changes the fixed class table of failure.py and its test. The repair turn for a model error stays with feat(roadmap): every step repairs before it gives up, in bounded rounds #3053. (best practice) [sources: src/devops_cli/roadmap/failure.py, src/devops_cli/roadmap/implement_step.py:1320]
    • Chosen: Add lost_test with action stop. The class names the cause and gives an action that can help. A retry cannot restore a test that the plan does not record.
    • Rejected: Keep ci_infra with action retry. A retry cannot help a lost test. The current class hides the cause.
    • Rejected: Use an existing model-error class. The issue does not define that class for this cause. A new class keeps the fixed table explicit.
  • How do the step guard and the TESTS_KEPT eval property read the same plan record?: Use one helper that reads weakened_checks and returns the path::name entries. The guard and TESTS_KEPT call the helper. TESTS_KEPT compares the result with allow_lost_tests, so both read one list. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:1061, src/devops_cli/roadmap/implement_eval.py:78, src/devops_cli/roadmap/implement_eval_properties.py:203]
    • Chosen: One shared helper. The guard and the eval property cannot drift. The issue adds no second gate.
    • Rejected: Separate parsing in the guard and the eval property. Two parsers can disagree on the same plan record.
  • How do the plans of fix(k8s): key claim table by chart version #2519, fix(ai): remove weight recs from gateway tune #2592, perf(k8s): use tag_digest HEAD for image pins #2610 and fix(models): make clean-default model fields required #2636 get the Weakened checks entry?: Amend each plan that remains under openspec/changes in this pull request. Add the entry to its change folder. Do not run a new stage job for those items. (best practice) [sources: CONTEXT.md, AGENTS.md]
    • Chosen: Amend each remaining change folder. One pull request delivers this issue. The entry is a small edit to an existing plan.
    • Rejected: Run a new stage job for each item. A stage job creates separate work and a second plan. The issue needs no new plan form.
  • Does the recorded exception lower a quality threshold that only the owner can allow?: No. The plan names the safeguard, and feat(roadmap): a plan that deletes a guard check records the weakened check #3320 holds the owner rule. The guard allows only a removal that the plan records. It refuses every other lost test. (best practice) [sources: AGENTS.md, src/devops_cli/roadmap/implement_step.py:1061]
    • Chosen: Recorded exception with a safeguard. The exception is narrow and named. The guard still refuses an unrecorded lost test.
    • Rejected: Allow every lost test. This lowers the test-keeping threshold for every step and hides model errors.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3320

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/high
    effort/medium
    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/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P1-High. Repeated implement stops wasted over 10.5 million tokens in one window, and four open plans still conflict with the guard.
    • Value: High. Prevents millions of wasted tokens and unresolvable step failures when a plan legitimately orders a test removal.
    • Effort: Medium. Modifies the guard logic, the prompt, the TESTS_KEPT property, adds tests, and amends four existing plans.
    • Related: feat(roadmap): a plan that deletes a guard check records the weakened check #3320, which asks for a different change. Both use the weakened_checks list from #3320, but #3320 adds the recording of a weakened check while the candidate makes the step guard read that record to allow a plan-ordered test removal.
  3. added
    priority/p1-high
    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 336731c (see proposed design in issue body).

  6. added
    owner/agent
    on Nov 5, 2026
  7. dan-petty commented on Nov 5, 2026

    @dan-petty
    OwnerAuthor

    Answer from project standards, under the owner's instruction of 2026-11-05.

    Question: which class does a lost test that the plan does not record get?
    Answer: FailureClass.TESTS_LOST, with the action wait in ACTION_BY_CLASS. This change adds no new class. The step passes this class since #3476, so a stop no longer reads ci_infra. The rule digest of stop_clear.py clears only a class with the action retry, so a new runner image no longer starts the same step again. A new image cannot restore a test. This replaces the lost_test class that the proposed design names: FailureAction has no stop action, and the docstring of failure.py says that the class list is fixed.

    Question: what safeguard makes a recorded removal safe, given that AGENTS.md rule 5 lets only the owner lower a threshold?
    Answer: The guard trusts a recorded removal only after a person merges the plan. AGENTS.md says that only a person merges a pull request, so that merge is the owner allowing the removal under rule 5. The job reads the record from origin/<default>, in the same way as _hooks_config (#3043). It never reads the checkout, which the agent can edit. An entry that the agent writes waives nothing, and a plan that is only on its staged branch records nothing.

    Question: must this item wait for #3320?
    Answer: No. This item owns the reader: plan_read.read_change reads the ## Weakened checks section of proposal.md into StageProposal.weakened_checks. The implement job stopped #3320 on 2026-11-05 because no group of its plan reads the section back. #3320 keeps the reply key, the writer and the gate. The branch of this item changes the plan of #3320 to match, and the form of an entry agrees with the fields of that plan: - **<check>**: Stopped: <stopped> Safeguard: <safeguard>.

    Question: how do the plans of #2519, #2592, #2610 and #2636 get an entry?
    Answer: By an amendment in this pull request, as the proposed design says. Each entry names each test that the plan removes or renames as path::name.

    The line numbers in this issue now match origin/main at 05544abc.

  8. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 6, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 6, 2026
  10. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor
  11. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 02:22 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/p1-highscope/roadmapsource/agenttype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions