Skip to content

feat(roadmap): check every active plan against the verification policy #3579

Closed

Description

@devops-cli-service

Split from #3276.

Problem: The invariant test that reads every active tasks.md would fail on 16 refused Verification: code spans in 3 active change folders. The folders are 2441 with 2 spans, 2610 with 5 spans, and 3187 with 9 spans. The spans include prose spans and test -z spans, not only negative searches. A wider scan of ! spans finds 8 folders with a span that the step would refuse: 2147, 2184, 2570, 2592, 2610, 2644, 3187 and 3373. The plan reader gives only the first span of a task, and #2610 fails in the reader with a ValidationError, so the stage gate does not check it. The reader fix is the separate issue fix(roadmap): the plan reader reports each bad plan with no crash. Why deferred: The rewrite of other issues' plans is outside this issue's scope. The parser change and the #2610 line rewrite can land first. Acceptance criteria: 1. An invariant test in tests/invariants/test_change_folders.py reads every active tasks.md under openspec/changes/ and fails on a Verification: code span that read_verification refuses. The failure names the path and the span. 2. The test passes on the active plans at the default branch. A plan that the step cannot run is rewritten, or the test names the span as an accepted exception with a reason. 3. The test does not read openspec/changes/archive/.

Proposed design

Problem statement

The active tasks.md files hold Verification: code spans that the implement step refuses, and no test reports them. The step reads only the first span of a task, and #2610 raises a ValidationError, so the gate misses the rest. Add an invariant test that checks every active plan against read_verification. The test names each remaining refused span as an accepted exception with a reason.

Acceptance criteria

Requirement: Refused span fails the invariant

The invariant test SHALL fail when an active tasks.md holds a Verification: code span that read_verification refuses.

Scenario: A refused span in an active plan

  • WHEN A temporary change folder holds a task whose Verification: span is the prose the log is empty.
  • THEN The check reports the path of the folder's tasks.md and the span the log is empty.

Requirement: Every span of a task is checked

The test SHALL send every Verification: code span of every active tasks.md to read_verification, not only the first span of a task.

Scenario: A second span is refused

  • WHEN A temporary task line holds two Verification: spans, and read_verification refuses the second.
  • THEN The check reports the second span.

Requirement: Accepted exception

The test SHALL pass when the exception list names a refused span with a reason.

Scenario: An excepted span

  • WHEN The exception list names the folder and the span of a refused span, with a reason.
  • THEN The check reports no problem for that span.

Requirement: Stale exception fails

The test SHALL fail when an exception names a span that no refused span matches.

Scenario: An exception that no refused span matches

  • WHEN The exception list names a span that read_verification accepts.
  • THEN The check reports the entry as stale and names it.

Requirement: Archive is not read

The test SHALL NOT read a tasks.md under openspec/changes/archive/.

Scenario: A refused span in an archived plan

  • WHEN A folder under openspec/changes/archive/ holds a tasks.md with a span that read_verification refuses.
  • THEN The check reports no problem for that folder.

Requirement: The repository passes

The test SHALL pass on the active plans at the default branch.

Scenario: The repository's own change folders

  • WHEN The test runs on the repository's openspec/changes/ at the default branch.
  • THEN The test passes, and each remaining refused span is an accepted exception with a reason.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers the need: the rule is devops-cli's own read_verification, and no external tool reads an OpenSpec tasks.md and applies that grammar. markdown-it-py, already a dependency, covers the Markdown parse and the code spans, but it lacks the verification grammar and the change-folder layout. The change adds a test only: about 40,000 tokens to write, keep and fix it, and about 3 hours of elapsed time.

Key questions

  • How does the test find the Verification: spans of an active plan?: The test parses each active tasks.md with markdown-it-py and sends every Verification: code span, whatever its form, to read_verification. It does not use the plan reader, which returns only the first span of a task and raises a ValidationError on perf(k8s): use tag_digest HEAD for image pins #2610. (best practice) [sources: tests/invariants/test_change_folders.py, src/devops_cli/roadmap/implement_shell_policy.py, src/devops_cli/roadmap/plan_read.py]
    • Rejected: Read the spans with the plan reader. The reader returns only the first span of a task and raises on perf(k8s): use tag_digest HEAD for image pins #2610, and its fix is a separate issue.
    • Chosen: Parse the Markdown in the test and call read_verification per span. It reads every span, never crashes on a bad plan, and the module already parses Markdown with markdown-it-py.
  • Which change folders does the test read?: Every folder under openspec/changes/ except archive/. The existing invariant already skips archive/, and an archived plan is the record of a delivered item. (best practice) [sources: tests/invariants/test_change_folders.py, CONTEXT.md]
    • Chosen: Active folders only. An archived plan is a record of a delivered item, and no step runs it.
    • Rejected: Every folder, archive included. The test would fail on history that no job can change.
  • Where does the exception list live, and does the test fail on a stale entry?: A module-level list in tests/invariants/test_change_folders.py holds one entry per accepted span: the folder, the span and the reason. The test fails on an entry that no refused span matches, so the list cannot rot. (best practice) [sources: tests/invariants/test_change_folders.py]
    • Chosen: Module-level list with a stale check. The module holds its other rules this way, and the check removes an entry when a plan is rewritten.
    • Rejected: A separate data file. The list is small, and the module already holds its rules.
    • Rejected: A list with no stale check. An entry would keep hiding a span that the grammar accepts.
  • Is the rewrite of the refused spans in other items' plans part of this issue?: No. This issue adds the test and names each remaining refused span as an accepted exception with a reason. A new issue rewrites the spans, because the plans belong to other items and refactor(roadmap): group the job modules in subpackages #3187's three -E lines hold word boundaries that the fixed grammar cannot express. (best practice) [sources: CONTEXT.md, tests/invariants/test_change_folders.py]
    • Rejected: Rewrite the other plans in this issue. It changes other items' plans, and refactor(roadmap): group the job modules in subpackages #3187's owner must choose the check for its -E lines.
    • Chosen: Defer the rewrites and except the spans here. The test lands with a complete exception list, and one new issue tracks the rewrites.
  • Does this issue need feat(roadmap): let a negative search verify check more than one name #3276 first?: Yes. feat(roadmap): let a negative search verify check more than one name #3276 changes the grammar that accepts the perf(k8s): use tag_digest HEAD for image pins #2610 -E line, so the exception list must be written after it lands. An exception for that line would become stale and fail the test. (best practice) [sources: src/devops_cli/roadmap/implement_shell_policy.py, src/devops_cli/roadmap/implement_step.py]
  • Does the plan reader fix block this issue?: No. The test reads the spans itself, so the ValidationError of perf(k8s): use tag_digest HEAD for image pins #2610 and the first-span limit of the reader do not stop it. The reader fix stays a separate issue. (best practice) [sources: src/devops_cli/roadmap/plan_read.py, tests/invariants/test_change_folders.py]
    • Rejected: Wait for the reader fix. The test does not use the reader, so the fix is not a precondition.
    • Chosen: Land without the reader fix. The test parses the spans and reports every folder, so it does not crash on perf(k8s): use tag_digest HEAD for image pins #2610.
  • How does the exception list get its entries?: Run the new test at the default branch after feat(roadmap): let a negative search verify check more than one name #3276 lands and record each refused span with a reason. The reply names 15 spans in three plans, and the wider ! scan names 8 folders, so the run gives the complete list. (best practice) [sources: tests/invariants/test_change_folders.py]
    • Chosen: Record the spans from the run of the new test. The run reads every span of every active plan, and the two counts in the body do not agree.
    • Rejected: Record the 16 spans named in the body. The body counts 3 folders, and the wider scan finds refused spans in 8.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3276

Activity

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

    @devops-cli-service
    ContributorAuthor

    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 enforces a policy on active plans but does not block a release or fix a crash.
    • Value: Medium. It catches refused Verification spans before they reach a stage gate.
    • Effort: Medium. It needs a new test file, span parsing, and rewrites of 16 spans in 3 folders.
    • Related: fix(roadmap): the plan reader reports each bad plan with no crash #3482, which asks for a different change. Both deal with plan verification, but the candidate adds an invariant test while #3482 fixes the reader crash.
  3. dan-petty commented on Nov 5, 2026

    @dan-petty
    Owner

    Update from #3276. The change for #3276 adds repeated -e literals to the negative search. The branch is feat/3276-negative-search-accepts-repeated-e.

    The -E line of the #2610 plan (task 3.3) now uses four -e literals. The step accepts that line.

    Refused Verification: commands at origin/main d254410: 16 in three active plans. With the #3276 change: 15.

    This issue still covers the invariant test and the rewrites of these plans. #3276 does not add the test.

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

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at bd65ef6. A bot opened the item, so a review of the issue and of the proposal must approve it first. The review found the defects below. A person edits the body to answer them. The next refine round looks at the item again only after a body edit.

    • false_premise at key_questions: How does the exception list get its entries?: The plan cites a reply to the issue that names 15 spans. The issue and files give only 16 spans, and the plan states no source for 15. Evidence: "The reply names 15 spans in three plans"
    • false_premise at key_questions: Which change folders does the test read?: The plan says the existing invariant already skips archive/. It says the module already uses markdown-it-py and holds its rules in module-level lists. files is empty, so nothing in the input supports these claims about the module. Evidence: "The existing invariant already skips archive/"
  5. dan-petty commented on Nov 6, 2026

    @dan-petty
    Owner

    PR #3809 delivered the work of this item together with #3595.

    The pull request body closes #3595 only. This comment closes #3579 as delivered by the same change.

  6. removed
    status/new
    on Nov 6, 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/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions