Skip to content

fix(roadmap): accept a shell command as a scenario proof #7401

Description

@dan-petty

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, bash or sh and holds more than one word, as it accepts a git command.
  • 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' and sh -c 'alias ll', a plan that changes zsh/aliases.zsh and whose scenario names that span as its only command.
  • THEN check_proposal returns 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.zsh and whose scenario names the bare code span zsh.
  • THEN check_proposal returns a problem that names the scenario and zsh/aliases.zsh and 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 naming bash -lc 'alias ll', with zsh/aliases.zsh changed.
  • THEN check_proposal returns 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.zsh and whose scenario names git grep -n alias aliases.zsh as its only command.
  • THEN check_proposal returns 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_WORDS at src/devops_cli/roadmap/stage/stage_change.py:1157 holds the accepted first words. The predicate _is_scenario_command at line 1179 requires more than one word and a first word in that set. _config_scenario_problem at line 1216 asks that predicate for the proof of a changed manifest, workflow or config file, and _scenario_problem at 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, bash and sh to _SCENARIO_COMMAND_WORDS at src/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, bash and sh to 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, fish and nu. 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.
  • Does the change keep the rule that a proof holds more than one word?: Yes. _is_scenario_command at src/devops_cli/roadmap/stage/stage_change.py:1181 keeps len(words) > 1, so a bare zsh or a path such as zsh/aliases.zsh still 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.zsh would 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#19 at 3689627: zsh -i -c 'alias ll' and bash -lc 'alias ll', both with zsh/aliases.zsh changed. 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#19 at 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 bash and sh unproven.
  • 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' at openspec/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, so skip_specs stays 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.
  • Does docs/TESTING.md change?: 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.md unchanged. 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.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 27, 2026
  2. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 27, 2026
  4. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    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:

    • openspec scenario proof validator command code span shell command, results: 5
    • python library parse shell command line detect bash zsh sh invocation, results: 5
    • bashlex pypi parse shell commands python, results: 5
  5. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  7. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 28, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 28, 2026
  9. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 00:41 UTC

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/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions