Skip to content

feat(roadmap): Add a test-first manifest kind to the stage plan #3251

Closed

Description

@dan-petty

Problem

The planner has a group kind behavior that is test-first, and a kind other that has one repeatable verify command and no test-first form. A plan for a manifest with a unit test cannot be written in the form that the review asks for. Two plans met this on 2026-11-02, and each agent wrote the tasks by hand:

Proposed change

Add a group kind (for example manifest) whose first task is the failing case or pin and whose verify command fails on the base. The kind is chosen when a path under k8s/, a rule file, a dashboard file or a test fixture is in creates or changes. check_proposal checks that the first task names a file that holds a test or a case, and that the verify command is uv run devops ci test <mirror-path> or a named promtool command that exists in tools.lock.

Acceptance criteria

  1. A test shows that a manifest group with the case first and a failing verify passes form_problems.
  2. A test shows that a manifest group with the implementation first is refused.
  3. The planner prompt names the kind, and the test(roadmap): check the planner prompt against its rules #3210 prompt-vs-rules test passes.
  4. The golden set has one replay case from docs(openspec): plan #2950 Add alternatives coverage metrics and alert #3173 or docs(openspec): plan #2919 stuck-item age metrics and alert #3171.

Related: #3189, #3200, #3201.

Proposed design

Problem statement

The stage planner has no test-first kind for a manifest, a rule file, a dashboard file or a case file. A plan for an alert rule with promtool cases or a dashboard panel with a query pin uses the kind other, which has one repeatable command and no failing-case task. Two agents wrote such tasks by hand on 2026-11-02, and the review refused the form. The change adds the kind manifest, a check of its case-first form and of its verify command, the prompt text, and one replay case.

Acceptance criteria

Requirement: manifest kind in the schema

The stage group schema SHALL accept a group of kind manifest that has a test, an implementation and a verify, and no process.

Scenario: a manifest group validates

  • WHEN a group has kind: manifest, a test that names k8s/apps/api/rules_test.yaml in a code span, an implementation, and verify: uv run devops ci test k8s/apps/api
  • THEN StageGroup.model_validate returns a group whose kind is manifest and whose process is None

Requirement: manifest case first accepted

The stage form check SHALL accept a manifest group whose test names a case path that the group creates.

Scenario: case first with a manifest verify

  • WHEN a manifest group lists k8s/apps/api/rules_test.yaml in changes and creates, its test names that path in a code span, and its verify is uv run devops ci test k8s/apps/api
  • THEN form_problems returns no problem for the group

Requirement: manifest implementation first refused

The stage group schema MUST refuse a manifest group that has no test.

Scenario: no case task

  • WHEN a manifest group has test: null and holds the implementation task only
  • THEN the validation error names the kind manifest and the missing test

Requirement: case path forces the manifest kind

The stage form check MUST refuse a group of kind other that creates a case path, and MUST name the kind manifest in the problem.

Scenario: an other group creates a promtool case

  • WHEN an other group lists k8s/apps/api/rules_test.yaml in changes and creates
  • THEN form_problems returns one problem that names other and manifest

Requirement: manifest verify form

The stage form check MUST refuse a manifest verify command that is not uv run devops ci test followed by a path of the group.

Scenario: a devops command that runs no case

  • WHEN a manifest group gives uv run devops ci mutate k8s/apps/api as its verify command
  • THEN form_problems returns one problem that names the command and the ci test form

Requirement: planner prompt names the manifest kind

The planner prompt SHALL name the manifest kind, its first-task rule and its verify rule.

Scenario: prompt and rules agree

  • WHEN the prompt-vs-rules test reads the prompt and the names of GroupKind
  • THEN the test finds manifest in both and passes

Requirement: golden replay case from a hand-written plan

The golden set MUST hold one replay case from #3173 whose manifest group creates no case path.

Scenario: the new case replays

  • WHEN the replay runs on the whole golden set
  • THEN the report lists the new case as caught by the paths gate and the replay exits 0

Existing Tool Considered

No alternatives check has run for this issue. No open, maintained tool covers the need: the rule is a project-internal form of the devops-cli stage plan, and the planner, the kind table and the replay are devops-cli code. The change builds its own code. The written cost is about 70k tokens to build, for about 300 changed lines and 7 tests. The cost to keep and fix it is about 15k tokens a year, when the k8s/ layout or the shell policy changes. The elapsed time is about 1 working day, in one pull request.

Key questions

  • Which name and value does the new group kind take?: The kind is manifest, added to GroupKind. It names the artifact that the group changes, as behavior names a behavior. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_kind.py]
    • Chosen: manifest. It names the artifact that the group changes, as behavior names a behavior.
    • Rejected: test-first. It names the form, not the artifact, so a second test-first form needs a new kind name.
    • Rejected: k8s. It is too narrow: a dashboard file or a rule file is no Kubernetes manifest.
  • Which fields does a manifest group carry?: The fields of behavior. test holds the case task, implementation holds the work, verify holds the command, and process is absent. group_text renders the case task first with fails on the base, then the implementation. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_kind.py]
    • Chosen: reuse test and verify. group_text already renders a test first with fails on the base, so the kind needs no new render rule.
    • Rejected: a new case field. The prompt, the schema and group_text would carry two names for one task.
    • Rejected: the process field. process renders a manual check and no failing command.
  • Where do the rules of the new kind live?: The shape is a pydantic rule of StageGroup: a manifest group has a test and a verify, and no process. The case path rule and the verify form rule are checks of form_problems in src/devops_cli/roadmap/stage_form.py, which check_proposal calls. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_form.py, openspec/changes/archive/2026-10-30-2772-stage-group-files/design.md]
    • Chosen: the schema for the shape, form_problems for the paths. The shape joins the rules of behavior and other, and the path rules join the path rules of form_problems.
    • Rejected: the schema only. A case path rule names the problem in the text of the reply, and the existing path rules live in form_problems.
    • Rejected: form_problems only. A missing test would reach the check as a null field, and the client already returns a schema violation in one retry.
  • What makes the first task of a manifest group a case task?: The test text names, in a code span, a path that is in the group's creates and ends with _test.yaml, _test.yml, _test.json or .test.json, or sits under a testdata/ folder. A Python test module is no case path, so a behavior group is never forced to manifest. (best practice) [sources: src/devops_cli/roadmap/stage_form.py, openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md, tests/roadmap/test_roadmap_stage_form.py]
    • Chosen: a case path in creates, named in the test text. The first task creates the case, so the check reads the task and the group, and it needs no tree.
    • Rejected: a path under tests/. Every Python test module would count, and a behavior group would break.
    • Rejected: a file that exists at the base. The case is new, so the file is absent.
  • Which verify commands does a manifest group accept?: uv run devops ci test followed by one path of the group or its folder. The check refuses every other command, and the problem names the ci test form. A promtool command is out of this change and goes to a new issue. (best practice) [sources: src/devops_cli/roadmap/stage_form.py, src/devops_cli/roadmap/implement_shell_policy.py, docs/TESTING.md]
    • Chosen: uv run devops ci test only. The step runs the command, and the command takes a path of the group.
    • Rejected: any uv run devops command. The group could run a command that covers no case.
    • Rejected: a promtool command pinned by a tools lock. The repository holds no tools lock file, and the step's shell runs no promtool. The part is deferred.
  • Which file pins a tool that the step runs?: No tools lock file exists at the staging commit. The runner image holds the tools that RUNNER_TOOLS names in src/devops_cli/roadmap/runner_tools.py, and the step's shell runs only the programs of SHELL_PROGRAMS in src/devops_cli/roadmap/implement_shell_policy.py, which holds no promtool. [sources: src/devops_cli/roadmap/runner_tools.py, src/devops_cli/roadmap/implement_shell_policy.py, docs/adr/0005-review-findings-come-from-tools-not-models.md]
  • Does the check run the verify command?: No. form_problems is a pure function of the reply. The step shows the failure on the base when it runs the first task, and the replay reads no code and no git. (best practice) [sources: openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md, src/devops_cli/roadmap/stage_form.py, docs/ROADMAP_WORKFLOW.md:275]
    • Chosen: a pure check. The stage job has no sandbox, and the replay reads no code and no git.
    • Rejected: run the command in the stage job. The stage job has no sandbox and no mirror of the repository.
  • Which test compares the prompt with the kinds, and what must change there?: tests/roadmap/test_roadmap_stage_prompt_rules.py reads the kinds from GroupKind. Its regex matches exactly two names, so it must read the names as a list. tests/roadmap/test_roadmap_stage_kind.py pins the schema message Input should be 'behavior' or 'other', so that text must name three kinds. [sources: tests/roadmap/test_roadmap_stage_prompt_rules.py, tests/roadmap/test_roadmap_stage_kind.py]
  • Which plan supplies the replay case?: The plan of docs(openspec): plan #2950 Add alternatives coverage metrics and alert #3173. The case holds a manifest group that names no case path in creates, so the new check catches it as verify_form under the paths gate. (best practice) [sources: tests/roadmap/test_roadmap_stage_eval_run.py, docs/ROADMAP_WORKFLOW.md:275]
  • Does the change need the replay score before and after?: Yes. The pull request states the score of one named model on the whole golden set before and after the change, because it changes the stage prompt and a check of check_proposal. [sources: docs/ROADMAP_WORKFLOW.md:276]
  • Does the new kind replace other?: No. other keeps one task with a verify or a process and no test-first form. Only a group that creates a case path must take manifest. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_kind.py]
    • Chosen: keep both kinds. Many other groups change a manifest with no test, and the manifest form needs a case.
    • Rejected: replace other. It would refuse every group with no test.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-06: none.
Tool: none found.

Activity

  1. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 2, 2026
  2. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    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. Two plans already required hand-written tasks, but no user-facing break or security risk is present.
    • Value: Medium. It removes a recurring manual workaround for manifest and alert-rule plans.
    • Effort: Medium. Requires a new kind, check_proposal rules, prompt update, tests, and a golden replay case.
    • Related: feat(roadmap): behavior groups run fail-to-pass and record the result #3042, which asks for a different change. Both deal with test-first forms in the stage plan, but the candidate adds a new group kind while #3042 enforces fail-to-pass execution for the existing behavior kind.
  3. added
    priority/p2-medium
    status/ready
    and removed
    status/new
    on Nov 2, 2026
  4. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

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

  5. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.

    Evidence:

    The path tools.lock is no file of the staging commit. No commit in the history deleted or renamed it.

  6. added
    status/new
    status/ready
    and removed
    status/ready
    status/new
    on Nov 2, 2026
  7. 13 remaining items

  8. added
    status/blocked
    and removed
    status/in-progress
    on Nov 7, 2026
  9. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261107-131652-e1ae ended: succeeded.
    Image digest: sha256:ff3526a65853e025ecb4c2c4ca2f78c6e582c29342b762db525e35b57ab5443c

    The last lines of its log:

    Tool call: shell, program uv, ok.
    Tool call: shell, started: git diff
    Tool call: shell, program git, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: read_file, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_manifest.py
    Tool call: shell, started: uv run ruff check src/devops_cli/roadmap/stage/stage_change.py src/devops_cli/lang/en/messages.py ...
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: git diff openspec/changes/3251-add-a-test-first-manifest-kind/tasks.md
    Tool call: shell, program git, ok.
    Tool call: shell, started: git status --short
    Tool call: shell, program git, ok.
    Tool call: shell, started: git status
    Tool call: shell, started: git diff --stat HEAD
    Tool call: shell, program git, ok.
    Tool call: shell, program git, ok.
    Tool call: shell, started: git log --oneline -5
    Tool call: shell, started: git show --stat HEAD
    Tool call: shell, program git, ok.
    Tool call: shell, program git, ok.
    Tool call: shell, started: uv run devops ci --check --only ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run python -c <masked>
    Tool call: shell, program uv, refused.
    Tool call: shell, started: uv run python -c <masked>
    Tool call: shell, program uv, refused.
    Tool call: shell, started: uv run python -c <masked>
    Tool call: shell, program uv, refused.
    Tool call: shell, started: uv run python -c <masked>
    Tool call: shell, program uv, ok.
    Tool call: shell, started: git status
    Tool call: read_file, ok.
    Tool call: shell, program git, ok.
    Failure class limit_reached. Action left: raise_limit.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 12m 37s
    
  10. removed
    owner/service
    on Nov 7, 2026
  11. added 5 commits that reference this issue on Nov 7, 2026
    407615d
    6f4d36c
    37b0707
    c3ab76f
    19eddfe
  12. added
    status/in-review
    and removed
    status/blocked
    on Nov 7, 2026
  13. removed
    status/in-review
    on Nov 7, 2026
  14. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-07 22:00 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/p2-mediumscope/roadmaptype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions