Skip to content

feat(roadmap): the stage job maps each acceptance criterion of the issue to a task group #3019

Closed

Description

@dan-petty

What happened

About 10 of 37 plans drop an acceptance criterion of the issue (2975, 2980, 2982, 2985, 2986, 2987, 2988, 2990, 2994, 2972): for example #2980 drops the 5-run timing criterion and the 85% floor check, and #2990 has no task for the CLI exit code. No rule asks the model to map the criteria, and nothing checks it.

What should happen

  • The reply has a criteria list. Each entry holds the text of one acceptance criterion of the issue and the number of the group that delivers it, or pending-person with a reason.
  • check_proposal refuses a reply that leaves an acceptance bullet of the issue unmapped.

Acceptance criteria

  • A test with an issue of three criteria and a reply that maps two is refused.
  • The tasks.md of a staged plan shows which group delivers which criterion.

Source

An evaluation on 2026-11-01 of the 37 docs(openspec): plan #N pull requests (35 merged, 2 open) found 34 that need fixes and 1 to reject. The per-PR reviews are in the comments of tracker #3005's thread and in .data/agent/scratch/plan-review.json of the owner's workstation. Related: #3005 (the kind of a task group: test for behavior, a repeatable check for other changes).

Proposed design

Problem statement

The stage job does not require the model to map each acceptance criterion of the issue to a task group. About 10 of 37 recent plans drop at least one criterion. No rule in the prompt asks for the mapping, and check_proposal does not verify it. The fix adds a criteria list to the reply schema and a check that refuses a reply with an unmapped criterion.

Acceptance criteria

Requirement: criteria field in reply

The stage reply SHALL include a criteria list in which each entry holds the text of one acceptance criterion of the issue and either the number of the group that delivers it or the string pending-person with a reason.

Scenario: reply with all criteria mapped

  • WHEN The reply's criteria list contains an entry for every acceptance criterion of the issue, each with a group number or pending-person and a reason
  • THEN check_proposal returns no problem for the criteria mapping

Requirement: unmapped criterion refused

check_proposal SHALL refuse a reply that leaves any acceptance bullet of the issue unmapped in the criteria list.

Scenario: reply missing one of three criteria

  • WHEN The issue has three acceptance criteria and the reply's criteria list maps only two
  • THEN check_proposal returns a problem naming the unmapped criterion

Requirement: tasks.md shows mapping

The tasks.md of a staged plan SHALL show which group delivers which acceptance criterion.

Scenario: staged plan tasks.md lists the mapping

  • WHEN A plan is staged with criteria mapped to groups
  • THEN tasks.md contains a section that lists each criterion text and its delivering group number or pending-person with reason

Existing Tool Considered

No open, maintained tool covers this need. The mapping is a project-specific validation rule for the stage job's reply schema. The project builds its own code: a pydantic field on the reply model, a pure validation function in check_proposal, a prompt line, a test, and a tasks.md rendering change. Written cost is about 100 lines of new code (roughly 1000 tokens) plus the test, and maintenance is limited to updating the field when the schema changes. Elapsed time is one focused agent session of 30 to 60 minutes.

Key questions

  • Where does the criteria-mapping check live?: In check_proposal, the existing gate that the stage job runs on a reply. The check is a pure function of the reply and the issue body, following the same pattern as path_problems. [sources: docs/ROADMAP_WORKFLOW.md:176, openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md:6]
  • How does check_proposal compare the criteria in the reply against the criteria in the issue body?: Exact text match after trimming leading and trailing whitespace. The function collects the set of criterion texts from the issue body and the set from the reply's criteria list, then reports each text in the issue set that is absent from the reply set. This is deterministic and testable offline. (best practice) [sources: openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md:6]
    • Chosen: Exact text match after trim. Deterministic, testable offline, and the criteria come from the same issue body so the text is stable.
    • Rejected: Fuzzy or semantic match. Adds a model call or a similarity library, which is overkill for text that comes from the same source.
    • Rejected: Index-based match (first criterion to first entry). Fragile: the model may reorder or skip entries, and the check cannot tell a skip from a reorder.
  • What is the shape of each entry in the criteria list?: An object with three keys: criterion (string, the text of the acceptance criterion), group (integer or the string pending-person), and reason (string, required when group is pending-person, optional otherwise). This is stated in the issue body. [sources: openspec/changes/archive/2026-10-30-2772-stage-group-files/design.md:5]
  • How does tasks.md show the criterion-to-group mapping?: A dedicated section after the task groups, titled Criteria, lists each criterion text on one line followed by the delivering group number or pending-person with the reason. This keeps the group task lists uncluttered and makes the mapping easy to scan. (best practice) [sources: openspec/changes/archive/2026-10-30-2772-stage-group-files/design.md:5]
    • Chosen: Dedicated Criteria section after the groups. Clear, scannable, and does not change the existing group task format.
    • Rejected: Inline annotation in each group's task list. Clutters the task list and makes it harder to see which tasks belong to which criterion.
  • Does the stage prompt need a new instruction to produce the criteria list?: Yes. The prompt roadmap_stage_change.md must state that the reply includes a criteria list and that every acceptance criterion of the issue must appear in it. The pydantic schema enforces the shape, and check_proposal enforces completeness. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:177, openspec/changes/archive/2026-10-30-2772-stage-group-files/design.md:5]
    • Chosen: Add a prompt line plus schema and check. The prompt guides the model, the schema enforces shape, and the check enforces completeness. All three layers follow the existing pattern.
    • Rejected: Schema and check only, no prompt change. The model may not produce the field at all without a prompt instruction, causing a retry that wastes a turn.

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/low
    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/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. Ten of thirty-seven plans drop criteria, but the pipeline still produces usable plans.
    • Value: Medium. Guarantees every acceptance criterion is covered by a task group, reducing missed requirements.
    • Effort: Low. Add a criteria list to the reply schema and one mapping check in check_proposal.
    • Related: fix(roadmap): the stage job refuses a plan whose group reads a path that a later group creates #3017, which asks for a different change. Both add a check_proposal validation for stage job output, but 3017 checks group path ordering while the candidate checks criteria-to-group mapping.
  3. added
    priority/p2-medium
    on Nov 1, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 1, 2026
  5. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Staged: branch feat/3019-the-stage-job-maps-each-acceptance, draft pull request #3180. 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. Add the criteria list and the refusal to the stage reply: 11968 tokens
    2. Render the Criteria section in tasks.md: 11875 tokens
    3. State the criteria rule in the stage prompt: 6061 tokens
    4. Add the criteria gate to the golden-set replay: 9559 tokens
    5. Document the criteria rule: 6094 tokens

    The plan run made 15 model request(s), and used 470694 input tokens and 7487 output tokens. The tool calls, in order:

    1. search_code({"text":"check_proposal"})
    2. search_code({"text":"path_problems"})
    3. read_file({"path":"src/devops_cli/roadmap/stage_change.py"})
    4. list_files({"directory":"src/devops_cli/roadmap"})
    5. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":80,"end_line":420})
    6. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":183,"end_line":520})
    7. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":274,"end_line":560})
    8. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":355,"end_line":700})
    9. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":436,"end_line":620})
    10. list_files({"directory":"tests/roadmap"})
    11. list_files({"directory":"src/devops_cli/roadmap"})
    12. search_code({"text":"def check_proposal"})
    13. search_code({"text":"class StageProposal"})
    14. search_code({"text":"def path_problems"})
    15. search_code({"text":"def _tasks_file"})
    16. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":200,"end_line":330})
    17. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":420,"end_line":500})
    18. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":286,"end_line":330})
    19. search_code({"text":"check_proposal("})
    20. read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":620,"end_line":710})
    21. read_file({"path":"src/devops_cli/roadmap/stage_eval_gates.py","start_line":1,"end_line":130})
    22. read_file({"path":"src/devops_cli/roadmap/stage_eval_cases.py"})
  7. removed
    status/ready
    on Nov 2, 2026
  8. added a commit that references this issue on Nov 3, 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/lowpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions