Repository navigation
Description
Problem
The stage plan reader accepts a spec scenario that names a file only when the scenario also names a command whose first word is in _SCENARIO_COMMAND_WORDS (src/devops_cli/roadmap/stage/stage_change.py:1156): helm, git, kubectl, uv, devops, tofu, terraform, gh, openspec, pytest, ruff and mypy. A shell is not in the list.
A repository with no Python project, such as dan-petty/dotfiles, proves shell behavior with a live check, for example zsh -i -c 'alias ll'. The reader refuses that scenario with "Scenario '...' names zsh/aliases.zsh with no behavior test". The only form that it accepts is a git grep of the file. The spec rule of the repository template (openspec/config.yaml: a scenario of a config file names "a validator command or a live check as its proof, never a test that reads a value of the file") refuses that form.
Evidence: plan PR dan-petty/dotfiles#19. At commit 3689627 each scenario names only its live zsh check: the local plan check reports 2 problems. At commit 457698f each scenario also names a git grep of the file: the plan check passes.
Done when
- The reader accepts a scenario whose code span starts with
zsh,bashorshand holds more than one word, as it accepts agitcommand. - A test of the stage reader proves it with the two scenarios of dotfiles#19 at 3689627.
Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches found no maintained tool or library that validates scenario proofs; the refusal comes from the project's own command-word whitelist in stage_change.py, so the fix is a few lines plus a stage-reader test.
Lacks:
- Shell words zsh, bash, sh accepted as scenario proof commands
- Reader test proving the two dotfiles#19 scenarios at 3689627
- No external dependency for a one-line whitelist change
Proposed design
Problem statement
The stage plan reader refuses a scenario that proves shell behavior with a live shell command. The command-word whitelist _SCENARIO_COMMAND_WORDS at src/devops_cli/roadmap/stage/stage_change.py:1157 holds no shell, so a repository with no Python project cannot prove an alias with zsh -i -c 'alias ll'. The only form that the reader accepts is a git grep of the file, and the spec rule of the template refuses that form. The reader must accept zsh, bash and sh commands of more than one word, with a stage-reader test.
Acceptance criteria
Requirement: A shell command proves a scenario
The stage plan reader SHALL accept a scenario whose code span starts with zsh, bash or sh and holds more than one word, as it accepts a git command.
Scenario: Live shell alias checks
- WHEN A stage-reader test feeds, for each of
zsh -i -c 'alias ll',bash -lc 'alias ll'andsh -c 'alias ll', a plan that changeszsh/aliases.zshand whose scenario names that span as its only command. - THEN
check_proposalreturns no problem for that scenario.
Requirement: A lone shell word proves nothing
The stage plan reader SHALL refuse a scenario whose code span holds only the word zsh, bash or sh.
Scenario: Bare zsh
- WHEN A stage-reader test feeds a plan that changes
zsh/aliases.zshand whose scenario names the bare code spanzsh. - THEN
check_proposalreturns a problem that names the scenario andzsh/aliases.zshand asks for a validator command or a live check.
Requirement: Two live shell checks pass the reader
A test of the stage reader MUST feed two scenarios, each with a live shell check as its only code span, and show no problem.
Scenario: zsh and bash alias checks
- WHEN The test feeds one plan with two scenarios, one naming
zsh -i -c 'alias ll'and one namingbash -lc 'alias ll', withzsh/aliases.zshchanged. - THEN
check_proposalreturns an empty problem list for both scenarios.
Requirement: The current command words still pass
The stage plan reader SHALL keep accepting each command word that it accepts today.
Scenario: git grep proof
- WHEN A stage-reader test feeds a plan that changes
zsh/aliases.zshand whose scenario namesgit grep -n alias aliases.zshas its only command. - THEN
check_proposalreturns no problem for that scenario.
Existing Tool Considered
No open, maintained tool or library covers the need: a scenario proof is the project's own heuristic over code spans, and the alternatives check of 2026-11-27 in the issue body records the verdict none with no tool. A shell parser such as bashlex parses a command line and does not decide whether a span proves a scenario, so it would add a dependency and no rule. The change therefore extends the existing _SCENARIO_COMMAND_WORDS set with zsh, bash and sh. Cost to build: about 2,000 tokens and about 30 minutes, for three words in a frozenset and one stage-reader test. Cost to keep and fix: near zero, because the change adds no dependency and no new module.
Key questions
- Where does the reader refuse a scenario that names a shell command?: The constant
_SCENARIO_COMMAND_WORDSatsrc/devops_cli/roadmap/stage/stage_change.py:1157holds the accepted first words. The predicate_is_scenario_commandat line 1179 requires more than one word and a first word in that set._config_scenario_problemat line 1216 asks that predicate for the proof of a changed manifest, workflow or config file, and_scenario_problemat line 1272 returns early on the same predicate. No shell word is in the set, so both refuse the scenario. [sources: src/devops_cli/roadmap/stage/stage_change.py:1157, src/devops_cli/roadmap/stage/stage_change.py:1181, src/devops_cli/roadmap/stage/stage_change.py:1216, src/devops_cli/roadmap/stage/stage_change.py:1272] - Which shell words does the reader accept?: Add
zsh,bashandshto_SCENARIO_COMMAND_WORDSatsrc/devops_cli/roadmap/stage/stage_change.py:1157. Accept no other shell word now, because the rule of the template asks for a live check and the issue names these three shells. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:1157, openspec/config.yaml:30, docs/TESTING.md:68]- Chosen: Add
zsh,bashandshto the constant. The issue names these three words, and each is a shell that a dotfiles repository uses for a live check of an alias. - Rejected: Add every shell, such as
dash,ksh,fishandnu. The issue names no such shell, and a wider set widens a heuristic that only decides whether a scenario names a proof. - Rejected: Accept any command of more than one word. That drops the guard: a code span that names a file and one word would pass as a proof.
- Chosen: Add
- Does the change keep the rule that a proof holds more than one word?: Yes.
_is_scenario_commandatsrc/devops_cli/roadmap/stage/stage_change.py:1181keepslen(words) > 1, so a barezshor a path such aszsh/aliases.zshstill fails. Only the set of accepted first words changes. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:1181]- Chosen: Keep the length test. The test keeps the refusal of a code span that holds a bare file name or a bare command word.
- Rejected: Drop the length test. A code span such as
zsh/aliases.zshwould then pass as a proof, and the check would stop.
- Which two scenario proofs should the stage-reader test feed?: Feed two live shell checks in the shape of
dan-petty/dotfiles#19at 3689627:zsh -i -c 'alias ll'andbash -lc 'alias ll', both withzsh/aliases.zshchanged. The body records only the zsh proof, and the pull request text is not reachable from this issue, so the test holds its own two spans; a test that copies an external pull request's text would break when that repository changes. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_scenario_evidence.py:262, tests/roadmap/stage/test_roadmap_stage_scenario_evidence.py:297, openspec/config.yaml:30]- Chosen: Two representative live shell checks in the test. The test stays offline and self-contained, and it proves the two-scenario case that the issue asks for without depending on an external repository.
- Rejected: Copy the exact two spans of
dan-petty/dotfiles#19at 3689627. The issue records only one of the two spans, and the pull request text is not a source that this run could read, so the test input would be unverified. - Rejected: One zsh check only. The issue asks for two scenarios, and one check leaves
bashandshunproven.
- Does the change carry a spec delta, and which capability?: Yes: a MODIFIED requirement in
roadmap-stage/spec-delta, the requirement 'A scenario of a changed manifest, workflow or config file names its proof command' atopenspec/specs/roadmap-stage/spec-delta/spec.md:323. Its scenario 'A validator command or a live check' at line 338 gains the shell forms, and a scenario for a bare shell word joins it. The behavior is observable, soskip_specsstays false. (best practice) [sources: openspec/config.yaml:19, openspec/specs/roadmap-stage/spec-delta/spec.md:323]- Chosen: MODIFY the requirement in
roadmap-stage/spec-delta. The reader's refusal is that requirement, and the shell forms are new scenarios of it. - Rejected: Add the delta to
roadmap-stage/plan-text. plan-text holds the one-line text, placeholder and title rules; it holds no scenario-proof rule. - Rejected: Set
skip_specs: true. A consumer observes the reader's acceptance, so the change alters behavior that a consumer observes.
- Chosen: MODIFY the requirement in
- Does
docs/TESTING.mdchange?: No. Line 68 already says that a scenario of a config file names 'a validator command or a live check', and it gives the command forms as examples; a live shell check fits that phrase. The change corrects the reader, not the rule. (best practice) [sources: docs/TESTING.md:68]- Chosen: Leave
docs/TESTING.mdunchanged. The document states the general rule and lists example commands, so it stays true when the reader accepts one more live-check form. - Rejected: Add the shell words to the command list. The list is examples, and a copy of the whitelist would drift from
_SCENARIO_COMMAND_WORDS.
- Chosen: Leave
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 27, 2026
Both fix the scenario proof check in stage_change.py, but #6140 makes the check trigger for non-path spans while the candidate makes the check accept shell commands as valid proofs.devops-cli-service commentedon Nov 27, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (3)
Searches run:
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
chore(main): release 0.241.0 (#7656)
devops-cli-service commentedon Nov 28, 2026
Released in v0.241.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.241.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 00:41 UTC