Repository navigation
Description
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 prosethe log is empty. - THEN The check reports the path of the folder's
tasks.mdand the spanthe 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, andread_verificationrefuses 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_verificationaccepts. - 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 atasks.mdwith a span thatread_verificationrefuses. - 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 activetasks.mdwithmarkdown-it-pyand sends everyVerification:code span, whatever its form, toread_verification. It does not use the plan reader, which returns only the first span of a task and raises aValidationErroron 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_verificationper span. It reads every span, never crashes on a bad plan, and the module already parses Markdown withmarkdown-it-py.
- Which change folders does the test read?: Every folder under
openspec/changes/exceptarchive/. The existing invariant already skipsarchive/, 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.pyholds 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
-Elines 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
-Elines. - Chosen: Defer the rewrites and except the spans here. The test lands with a complete exception list, and one new issue tracks the rewrites.
- 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
- 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
-Eline, 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]- Chosen: Wait for feat(roadmap): let a negative search verify check more than one name #3276. The stale check would fail on the perf(k8s): use tag_digest HEAD for image pins #2610
-Eexception when feat(roadmap): let a negative search verify check more than one name #3276 lands. - Rejected: Land before feat(roadmap): let a negative search verify check more than one name #3276 with the extra exception. It makes feat(roadmap): let a negative search verify check more than one name #3276 update this test file, and the default branch fails in between.
- Chosen: Wait for feat(roadmap): let a negative search verify check more than one name #3276. The stale check would fail on the perf(k8s): use tag_digest HEAD for image pins #2610
- Does the plan reader fix block this issue?: No. The test reads the spans itself, so the
ValidationErrorof 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.
Activity
devops-cli-service commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It enforces a policy on active plans but does not block a release or fix a crash.It catches refused Verification spans before they reach a stage gate.It needs a new test file, span parsing, and rewrites of 16 spans in 3 folders.Both deal with plan verification, but the candidate adds an invariant test while #3482 fixes the reader crash.dan-petty commentedon Nov 5, 2026
Update from #3276. The change for #3276 adds repeated
-eliterals to the negative search. The branch is feat/3276-negative-search-accepts-repeated-e.The
-Eline of the #2610 plan (task 3.3) now uses four-eliterals. The step accepts that line.Refused
Verification:commands at origin/main d254410: 16 in three active plans. With the #3276 change: 15.-Eline is fixed.-Eregex lines with word boundaries. The fixed grammar cannot express these, so the plan needs a rewrite by its owner.This issue still covers the invariant test and the rewrites of these plans. #3276 does not add the test.
feat(roadmap): let a negative search verify check more than one name (#…
devops-cli-service commentedon Nov 6, 2026
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_premiseat key_questions: How does the exception list get its entries?: The plan cites a reply to the issue that names 15 spans. The issue andfilesgive only 16 spans, and the plan states no source for 15. Evidence: "The reply names 15 spans in three plans"false_premiseat key_questions: Which change folders does the test read?: The plan says the existing invariant already skipsarchive/. It says the module already usesmarkdown-it-pyand holds its rules in module-level lists.filesis empty, so nothing in the input supports these claims about the module. Evidence: "The existing invariant already skipsarchive/"fix(openspec): accept every Verification line of an active plan (#3809)
dan-petty commentedon Nov 6, 2026
PR #3809 delivered the work of this item together with #3595.
Verification:span of every active plan toread_verification, skipsopenspec/changes/archive/, and names the path, line and command of a refused span.The pull request body closes #3595 only. This comment closes #3579 as delivered by the same change.