Skip to content

fix(roadmap): cut prose after a cited stage command - #4982

Merged
dan-petty merged 4 commits into
mainfrom
fix/4956-stage-prose-citation
Nov 12, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/4956-stage-prose-citation

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

The stage citation gate read a devops command cited in a sentence to the end of the sentence, so English words became arguments (uv run devops ci to confirm ...: unknown command 'to'). The replay showed this false refusal in 7 recorded plans.

cited_command_length in src/devops_cli/core/command_resolver.py ends a cited command at the first word that the command tree does not take: an option, a known option value, a subcommand name or a declared argument. A group that needs a subcommand keeps the next word. A word before an option stays, as a sentence puts no option after an English word. Thus ai ast-graph --help and pr monitor 4982 --bogus are still refused. Each uv run devops starts a new command. A code span keeps the full check.

Limit: prose after an unknown subcommand of a group that runs alone is not refused.

Closes #4956

Change: openspec/changes/archive/2026-11-12-4956-cut-prose-after-a-cited-stage/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Verification

fail-to-pass (uv run devops ci fail-to-pass --base origin/main): 12 failed on base, 67 passed (tests/core/test_docs_command_resolver.py, tests/roadmap/stage/test_roadmap_stage_command_citations.py; 0 errored). On base, the 4 new prose tests of the citation gate fail with unknown command 'to' under 'devops ci' and unexpected extra argument ... for 'devops roadmap intake'. The 8 new resolver cases fail with ImportError: cannot import name 'cited_command_length'. The two control tests (unknown option and unknown subcommand in a sentence) pass on base and on the change.

Stage replay (uv run devops roadmap eval stage --replay --json), base origin/main 87ae9ee and the change: the report is the same. 58 cases, paths 53/53 caught, kind 25/25, content 3/3, prompt keys 1/1, 0 missed, 5/5 good plans pass, no failures.

Citation refusals per case (check_gates on each recorded plan):

Case Base Change
2130 unknown command 'scan' under 'devops review' (code span) same
2152 unknown command 'to' under 'devops ci' none
2175 unknown command 'and' under 'devops ci' none
2258 extra argument for 'devops branches sync'; unknown option '--dry-run' for 'devops ssh list' unknown option '--dry-run' for 'devops ssh list'
2260 extra arguments for 'devops ci fail-to-pass' and 'devops uv lock'; unknown option '--dry-run' for 'devops mcp tools' unknown option '--dry-run' for 'devops mcp tools'
2524 extra argument 'command with gh issue create' for 'devops roadmap intake' none
2946 unknown command 'to' under 'devops ci' none
3183 extra argument 'passes' for 'devops config show' none
3205 unknown command 'follow' under 'devops roadmap' (code span) same

The other gates give the same problems on every case. Case 2175 was refused only by the false citation refusal. All 7 of its recorded defects have gate none, so no judged defect changes.

Static rows (uv run devops ci --check --only lint,format,docs,constructs,openspec,test-tree): all pass.
Covering tests: tests/roadmap/stage/test_roadmap_stage_command_citations.py, tests/core/test_docs_command_resolver.py, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py: 189 passed.
mypy on src/devops_cli/core/command_resolver.py and src/devops_cli/roadmap/stage/stage_commands.py: no issues.

This is Service code (the stage job). It waits for the owner's "safe and vetted" call before merge.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 08:51
@dan-petty
dan-petty force-pushed the fix/4956-stage-prose-citation branch from c8c0d4f to 4356631 Compare November 12, 2026 10:03
@dan-petty
dan-petty marked this pull request as draft November 12, 2026 10:05
@dan-petty

Copy link
Copy Markdown
Owner Author

Review fix for the 2 confirmed findings (head 435663142).

Finding 1 (blocking), fixed. A sentence puts no option after an English word, so a word before an option stays in the cited command. Under a group that runs with no subcommand, the resolver reports it as an unknown subcommand again.

Finding 2 (major), fixed. The cited command keeps the declared arguments of a command (nargs from Click) and the values of its known options (opts, secondary_opts, is_flag, count), so the check sees an option after them. A variadic argument keeps one word, and more words only before an option. A -- is a dash in a sentence, not an option.

Evidence:

Check Result
uv run devops ci fail-to-pass --base 5762e939a 15 tests fail on the previous fix commit and pass on head
uv run pytest tests/core/test_docs_command_resolver.py tests/roadmap/stage/test_roadmap_stage_command_citations.py 101 passed
uv run mypy on the 4 changed Python files no issues
uv run devops ci --check --only lint,format,docs,constructs,openspec,test-tree pass (openspec after the requirement split), pre-push static checks pass
uv run devops roadmap eval stage --replay --json exit 0, same report as the previous head
Probes of the review (base refuses, previous head accepts) all refused again except uv run devops scan gitleak to check (stated limit)
Recorded plans (58 cases) the 7 false refusals stay fixed; the true refusals of 2130, 2258, 2260 and 3205 stay
Tree sweep: each of the 505 runnable paths with trailing prose 0 refusals (same as the previous head)
Tree sweep: each runnable path with its arguments, a known option and its value, then prose 0 refusals
The same sweep with --bogus before the prose refused for each path except devops gh api and devops uv run, which pass unknown options on (the resolver accepts them in a code span too)

Limit, stated in the requirement, design.md, proposal.md and the PR body: in a sentence, an unknown subcommand of a group that runs with no subcommand is not refused when an English word comes after it. A code span gets that check.

This is Service code: it waits for the owner's "safe and vetted" call before a merge.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 10:13
A command that a plan cites in a sentence ends at the first word that the command tree does not list, so the stage citation gate no longer reads the English words after it as arguments.

Refs #4956
@dan-petty
dan-petty enabled auto-merge (squash) November 12, 2026 12:40
@dan-petty
dan-petty force-pushed the fix/4956-stage-prose-citation branch from 4356631 to 760f912 Compare November 12, 2026 12:42
@dan-petty

Copy link
Copy Markdown
Owner Author

Rebase onto main at acb4e197b. New head: 760f912af.

What the rebase changed:

  • refactor(openspec): split big capabilities into nested ones #4981 split openspec/specs/roadmap-stage/spec.md into nested capabilities and deleted the flat file. The old archive commit appended to the flat file, so it conflicted. The rebase keeps the deletion of the flat file and drops the old archive commit.
  • The delta of 4956-cut-prose-after-a-cited-stage moved from specs/roadmap-stage/spec.md to specs/roadmap-stage/claims/spec.md. The claims capability holds the cited-command requirements ("Resolve cited command spans", "Resolve cited option flags"). proposal.md and tasks.md now name roadmap-stage/claims.
  • A new uv run devops openspec archive 4956-cut-prose-after-a-cited-stage added the two requirements at the end of openspec/specs/roadmap-stage/claims/spec.md (19 requirements). The archive commit is the last commit.
  • The two code commits did not change.

Results:

  • uv run devops ci test tests/core/test_docs_command_resolver.py tests/roadmap/stage/test_roadmap_stage_command_citations.py: 101 passed.
  • uv run devops openspec check: passed.
  • CI on 760f912af: 19 checks pass, 4 skip. The pull request merges clean.

@dan-petty
dan-petty merged commit a172563 into main Nov 12, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/4956-stage-prose-citation branch November 12, 2026 12:53
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.119.0](v0.118.0...v0.119.0)
(2026-11-12)


### Features

* **repos:** the claim sets In Progress
([#5111](#5111))
([06ef1c6](06ef1c6))
* **roadmap:** a fix-plan step repairs a plan PR with open findings
([#5104](#5104))
([ca5b16d](ca5b16d))
* **roadmap:** extend stage review rounds while open findings drop
([#5090](#5090))
([bacf713](bacf713))
* **roadmap:** re-anchor a stale citation that matches one line
([#5040](#5040))
([16356d8](16356d8))


### Bug Fixes

* **ci:** keep failed test IDs in the service image shard summary
([#5106](#5106))
([88589ef](88589ef))
* **github:** count each page of a paginated GitHub read
([#5070](#5070))
([908e24a](908e24a))
* **github:** keep the metrics permissions out of the runner Job token
([#5064](#5064))
([fb549ff](fb549ff))
* **github:** pace mutations through the clock seam
([#5063](#5063))
([2bd87bc](2bd87bc))
* **k8s:** delete the CoreDNS files that k3s never applies
([#5055](#5055))
([463f601](463f601))
* **monitoring:** tidy LLM stack windows, units and lines
([#5052](#5052))
([375d724](375d724))
* **roadmap:** a refused kept plan uses no stage gate return
([#4983](#4983))
([b8adbca](b8adbca))
* **roadmap:** count a command as removed only when MUST NOT governs it
([#4985](#4985))
([2e6f407](2e6f407))
* **roadmap:** cut prose after a cited stage command
([#4982](#4982))
([a172563](a172563))
* **roadmap:** name every module of a group with no named test
([#5089](#5089))
([27a0e79](27a0e79))
* **roadmap:** stage returns every open review finding to the planner
([#5067](#5067))
([21b116e](21b116e))
* **roadmap:** the alternatives check reads the tools in use
([#5062](#5062))
([8903233](8903233))
* **roadmap:** the constants gate reads 6_500 and no new value
([#5080](#5080))
([8a7b113](8a7b113))
* **roadmap:** the constants gate reads only a stated value
([#5042](#5042))
([cf4733e](cf4733e))
* **telemetry:** read repository traffic as the GitHub App
([#4932](#4932))
([7c42823](7c42823))
* **tests:** close the UDP, DNS and git gaps of the network floor
([#5101](#5101))
([047ee48](047ee48))
* **tests:** repair the bwrap contract suite and gate it
([#5110](#5110))
([9a0659d](9a0659d)),
closes [#4715](#4715)


### Performance Improvements

* **ci:** build the Service image once for its test shards
([#5079](#5079))
([dcf5bd5](dcf5bd5))
* **ci:** run only the required checks on the release PR
([#5057](#5057))
([8174071](8174071))
* **ci:** stop the cache export of pull request image builds
([#5113](#5113))
([ba30820](ba30820))
* **roadmap:** consolidate keeps its vectors in the shared tiers
([#5099](#5099))
([2a8bf1a](2a8bf1a))


### Code Refactoring

* **roadmap:** one Status writer for every job
([#5109](#5109))
([24cfedc](24cfedc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): cut prose after a cited stage command

1 participant