Skip to content

fix(roadmap): the stage job plans a failing test for groups that change no code with behavior #3005

Description

@dan-petty

What happened

The stage job writes a failing test as task n.1 of every task group, also for a group that changes no code that has behavior. The model has to invent a "test", and the implement job then builds it. Examples from the plans on main (counted 2026-11-01):

Cause

  • StageGroup.test is a required field (src/devops_cli/roadmap/stage_change.py), the prompt roadmap_stage_change.md says "test, the failing test to write first", and group_text always renders n.1 {test}, and verify that {verify} fails on the base.
  • roadmap_implement_step.md step 1 says "Write the failing test first" for every group.
  • openspec/config.yaml orders the tasks of every group as failing test, implementation, documentation.
  • AGENTS.md rule 4 has no case for a change that has no behavior to test. The fail-to-pass check applies only to a fix(...) pull request that changes src/.

What should happen

  • A group whose changes hold no path under src/ has no test task: test is null, and verify names the check that proves it (an existing test, uv run devops ci docs, openspec validate, a git grep that must print nothing). A validator in StageGroup refuses a test there, so the model cannot invent one.
  • A group that changes src/ keeps its test task. A deletion that keeps behavior may set test to null with the git grep as verify.
  • group_text renders no n.1 test task when test is null, and numbers the next tasks from n.1.
  • The implement prompt says: "Write the failing test first, when your group has a test task. Else skip step 1." It also says: put no scratch file in the repository root.
  • AGENTS.md rule 4 and docs/TESTING.md name the case: a change of documents, manifests, workflows or a deletion names the check that proves it and adds no test.

Acceptance criteria

  • A reply with a test on a group that changes no src/ path fails validation, and the model gets the problem text.
  • A group with test null renders without an n.1 test task, and tasks.md still passes tests/invariants/test_change_folders.py.
  • The prompts and rule 4 state the case, and a test fails if the prompt and the validator disagree.

Proposed design

Problem statement

The stage job writes a failing test task for every group, including groups that change no code with behavior. The model must invent a test, and the implement job builds it. This produces scratch files that break the build. The fix adds a kind field so a group with no behavior carries a verify command, not a test.

Acceptance criteria

Requirement: Validator rejects test on other group

A StageGroup with kind other and a non-null test SHALL fail validation with a problem text the model receives.

Scenario: other group with test set

  • WHEN A StageGroup has kind other and test is a non-empty string
  • THEN Validation fails with a problem text naming the conflict

Requirement: Validator rejects missing test on behavior group

A StageGroup with kind behavior and a null test SHALL fail validation.

Scenario: behavior group without test

  • WHEN A StageGroup has kind behavior and test is null
  • THEN Validation fails with a problem text naming the missing test

Requirement: Behavior kind requires src path

A StageGroup with kind behavior whose changes hold no path under src/ SHALL fail validation.

Scenario: behavior group with no src path

  • WHEN A StageGroup has kind behavior and every path in changes is outside src/
  • THEN Validation fails with a problem text naming the constraint

Requirement: Other group renders without test task

group_text SHALL render an other group with n.1 as the verify step and no failing test task.

Scenario: other group rendering

  • WHEN group_text is called for a group with kind other
  • THEN The rendered text has n.1 as the verify step and no test task

Requirement: tasks.md passes invariants

A tasks.md rendered with an other group SHALL pass tests/invariants/test_change_folders.py.

Scenario: invariant check on other group

  • WHEN A change folder holds a tasks.md with an other group
  • THEN test_change_folders.py reports no problems for the folder

Requirement: Prompts and docs state the rule

The stage prompt, implement prompt, AGENTS.md rule 4, and docs/TESTING.md SHALL state that a group with no behavior to test has no test task.

Scenario: prompt-validator agreement test

  • WHEN A test checks that the prompt text and the validator agree on the kind rule
  • THEN The test passes, and fails if the prompt and validator disagree

Existing Tool Considered

No check has run. The change builds its own code in devops-cli's staging pipeline. The written cost is the tokens to build, keep and fix the kind field, validators, group_text branch, and prompt edits, plus elapsed time.

Key questions

  • What values does the kind field of StageGroup hold?: behavior and other. A behavior group adds or changes what the code does. An other group covers documents, manifests, workflows, a deletion or refactor that keeps behavior, test-only edits, and data. (proposed)
    • Rejected: kind field with behavior and other. The owner set this rule on 2026-11-01. It follows behavior, not the path.
    • Rejected: test nullable, no kind field. The body's original proposal. The owner replaced it with the kind field, which is more explicit.
  • What does an other group carry in place of test?: verify, one command that can run again and gives the same answer, or process, the steps of a repeatable manual check when no command exists. (proposed)
    • Rejected: verify command or process steps. The owner set this. Every other change has a command or a repeatable process that verifies it.
    • Rejected: no verification at all. The owner requires a verify or process for every other group.
  • Can a group whose changes hold no path under src/ be kind behavior?: No. The validator refuses a behavior group whose changes hold no path under src/. (proposed)
    • Rejected: refuse behavior without src/ path. The owner set this. A group that changes only paths outside src/ cannot be behavior.
    • Rejected: allow behavior without src/ path. This would let the model claim behavior for a document change, which the owner's rule forbids.
  • What is the current StageGroup schema for test?: test is a required Sentence field. group_text always renders n.1 as the failing test with verify. [sources: src/devops_cli/roadmap/stage_change.py]
  • How does group_text render an other group?: n.1 is the verify step, not a failing test. The next tasks number from n.2. (proposed)
    • Rejected: n.1 as verify step. The owner set this. The verify step is the first task of an other group.
    • Rejected: skip n.1, start at n.1 with implementation. The owner's plan keeps n.1 as the verify step for other groups.
  • What does the implement prompt say for an other group?: Write the failing test first, when your group has a test task. Else skip step 1. Put no scratch file in the repository root. (proposed)
    • Rejected: conditional step 1 based on kind. The owner set this. The prompt follows the kind of the group.
    • Rejected: always write the failing test first. This is the current behavior that causes the problem.
  • What do AGENTS.md rule 4 and docs/TESTING.md state about a change with no behavior to test?: A change of documents, manifests, workflows, or a deletion names the check that proves it and adds no test. (best practice) [sources: AGENTS.md, docs/TESTING.md]
    • Rejected: name the case in rule 4 and TESTING.md. The owner set this. The rule follows behavior, not the path.
    • Rejected: no change to rule 4 or TESTING.md. The current rule 4 has no case for a change with no behavior to test.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 1, 2026
  2. dan-petty commented on Nov 1, 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/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It causes 50 groups across 22 plans to generate invalid tests and stop jobs, but it is one of several roadmap defects and not a security or data-loss issue.
    • Value: Medium. Removing the mandatory test task for non-code groups prevents job failures and wasted model effort on a large share of plans.
    • Effort: Medium. It touches StageGroup validation, group_text rendering, two prompt files, AGENTS.md, and adds a cross-check test.
    • Related: fix(roadmap): a staged task group may name no files and renders Reads: None.. #2772, which asks for a different change. Both target StageGroup fields in stage_change.py, but #2772 fixes empty reads/changes rendering while the candidate makes test nullable for non-code groups.
  3. added
    priority/p2-medium
    on Nov 1, 2026
  4. dan-petty commented on Nov 1, 2026

    @dan-petty
    OwnerAuthor

    The owner sets the rule (2026-11-01): write tests for new code functionality. Every other change has a command or a repeatable process that verifies it. This replaces the line "a group that changes src/ keeps its test task" in the issue body. The rule follows behavior, not the path.

    Plan for the fix:

    • A group has a kind: behavior (it adds or changes what the code does) or other (documents, manifests, workflows, a deletion or refactor that keeps behavior, test-only edits, data).
    • A behavior group has test, the failing test to write first, and verify runs that test.
    • An other group has no test. It has verify, one command that can run again and gives the same answer (uv run devops ci docs, openspec validate --strict, git grep that must print nothing, devops k8s image-pins), or process, the steps of a repeatable manual check when no command exists.
    • The validator refuses a test on an other group and refuses a behavior group with no test. A group that changes only paths outside src/ cannot be behavior.
    • group_text renders n.1 as the failing test for behavior, and as the verify step for other.
    • The implement prompt follows the kind of the group. AGENTS.md rule 4 and docs/TESTING.md state the same rule.
  5. dan-petty commented on Nov 1, 2026

    @dan-petty
    OwnerAuthor

    Evaluation of the 37 docs(openspec): plan #N pull requests (35 merged, 2 open), 2026-11-01. Each plan was checked against its issue, the project rules and the tree of main.

    Result: 2 acceptable, 34 need fixes, 1 to reject. Mean scores out of 5: premise checked 2.5, fidelity to the issue 3.0, task quality 2.2, rule compliance 3.0, accuracy of paths and symbols 2.2.

    Defects that repeat:

    1. About 25 plans name a file that does not exist on main. The stage job notes it in its comment and still opens the pull request. (Issue fix(roadmap): the stage job refuses a plan that names a path that does not exist #3010.)
    2. About 28 plans hold no evidence in Feasibility. Four plans rest on a premise that was already false: feat(telemetry): the roadmap Service sends its round pause and its GraphQL points left as gauges #2233, refactor(security): the unused run_subprocess re-import in security/ruff.py and the private _prepare_cmd alias go, and a ci row fails on a new noqa F401 re-import in src #2166, perf(ci): the startup-import tests start 56 interpreters and take 204 s of the suite's 2,423 s #2369, fix(k8s): the volumes of grafana, the prometheus server and loki move off the control-plane node, and their placement exemptions go #2147. (Planned in the issue list below.)
    3. About 14 plans carry a spec delta that the changed paths do not need, or put it in the wrong capability.
    4. About 30 plans repeat task text that contradicts itself: every group says "verify that it fails on the base", also for a deletion or a document change. This issue (fix(roadmap): the stage job plans a failing test for groups that change no code with behavior #3005) fixes it.
    5. About 14 plans use uv run pytest or a flat new test path. About 17 ignore code or tests that exist. About 8 order their groups so that a test needs later code. About 10 drop an acceptance criterion.

    Twelve issues are status/blocked after the implement Job stopped at group 1 of such a plan.

  6. added
    owner/agent
    on Nov 1, 2026
  7. added
    status/ready
    and removed
    status/new
    on Nov 1, 2026
  8. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

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

  9. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 1, 2026
  10. removed
    status/in-review
    owner/agent
    on Nov 1, 2026
  11. added a commit that references this issue on Nov 1, 2026
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