validate: a scenario with no WHEN/GIVEN or THEN step counts as a scenario and passes
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- testing
Research direction
Read the existing validate checks for empty scenario bodies and the containsShallOrMust convention, along with extractRequirementBody and the delta and main spec readers. Add focused coverage for trigger and outcome keywords, including fenced examples, on both delta and main spec paths. Done means normal validation warns and strict validation fails for scenarios missing both halves, while valid scenarios and keywords inside fences are handled as described.
Written by the indexing model from the issue text.
Description
Description
validate checks that a requirement has at least one scenario, and (since #1857) that a scenario's body is not empty. Nothing checks what the body contains: a scenario whose steps assert nothing passes everywhere.
### Requirement: Credit Notes
The system SHALL issue a credit note when an invoice is voided.
#### Scenario: Invoice voided
- **AND** the ledger is balanced
This validates (--strict included), archives, and lands in the main spec — and it can never fail a test built from it: no step triggers it (no **WHEN**/**GIVEN**) and no step asserts an outcome (no **THEN**). Those are the two halves the canonical format in docs/concepts.md and the generated templates always include, and the two halves the empty-scenario hint already prescribes ("add its steps, e.g. - **WHEN** ... and - **THEN** ...").
Reproduction
In a project created with openspec init + openspec new change edit, with a valid proposal and tasks, the delta openspec/changes/edit/specs/billing/spec.md:
## ADDED Requirements
### Requirement: Credit Notes
The system SHALL issue a credit note when an invoice is voided.
#### Scenario: Invoice voided
- **AND** the ledger is balanced
openspec validate edit --strict --json # "valid": true
openspec archive edit --yes # succeeds
Control: adding - **WHEN** an invoice is voided / - **THEN** a credit note is issued is of course valid too — the point is that the first form is indistinguishable to every gate.
Expected
A scenario with neither a trigger step nor an outcome step is reported at authoring time. Proposal:
- WARNING in normal mode — the same posture as the missing
SHALL/MUSTkeyword: guidance, not a verdict change (so plainvalidateandarchivekeep agreeing). - Fails
--strict, which already fails on any warning. - Both paths: delta
ADDED/MODIFIEDblocks and main specs, so the delta and spec readers stay in parity. - Fence-aware: a
WHENinside a fenced example is documentation, not a step — the maskingextractRequirementBodyalready applies to requirement text. - Uppercase, word-bounded keyword matching, exactly the
containsShallOrMustconvention.
Positioning
- Not #1720 (pre-generation quality gate: EARS grammar, ambiguity, cross-requirement consistency — in design review). This is the minimal deterministic slice — does the scenario have its two halves at all — with no grammar and no judgment.
- Not the soft "specs define measurable scenarios" check in the
/opsx:refinework (#783 / #893), which runs across all artifacts after drafting. This is a form check at authoring time, next to the scenario-shape checksvalidatealready does. - The natural continuation of #1857: that issue made "a scenario must have a body" true on both paths; this one makes "the body must be a scenario" true.
We hit this maintaining a spec contour on top of OpenSpec: a note-shaped scenario passes every gate, and only a human reading the spec notices it asserts nothing.
- Dominant language
- TypeScript
- Stars
- 71.6k
- Forks
- 4.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 63
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Fission-AI/OpenSpec
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Fission-AI/OpenSpec#2084 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 70/100
Fission-AI/OpenSpec#2082 ·
Maintainers usually reply within 2 days
-
[Bug] /opsx:update guardrails contradict the new glob-artifact file creationPossibly taken @clay-good claimed this 1 day ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 87/100
Fission-AI/OpenSpec#2068 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Fission-AI/OpenSpec#1966 · 1 comment ·
Maintainers usually reply within 2 days
-
feat(schemas): open each proposal with a short review focusPossibly taken @GaoSSR claimed this 25 days ago. Opendesign-review
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
Fission-AI/OpenSpec#1908 ·
Maintainers usually reply within 2 days
All issues in Fission-AI/OpenSpec
Similar issues
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OWASP/cve-lite-cli#1335 ·
Maintainers usually reply within 1 day
-
Windows: main-screen mouse tracking requires WT_SESSION, so it never enables inside herdr panesOpen
Difficulty 1/5 Under an hour Newbie friendliness 66/100
code-yeongyu/senpi#3353 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Channels status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
mastra-ai/mastra#27093 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement needs-triage ui
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day