Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

validate: a scenario with no WHEN/GIVEN or THEN step counts as a scenario and passes

Aperta
#2,078 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@artemasmith ci sta già lavorando.

Dal 13/10/2026.

  • #2079 di @artemasmith — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
testing

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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/MUST keyword: guidance, not a verdict change (so plain validate and archive keep agreeing).
  • Fails --strict, which already fails on any warning.
  • Both paths: delta ADDED/MODIFIED blocks and main specs, so the delta and spec readers stay in parity.
  • Fence-aware: a WHEN inside a fenced example is documentation, not a step — the masking extractRequirementBody already applies to requirement text.
  • Uppercase, word-bounded keyword matching, exactly the containsShallOrMust convention.

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:refine work (#783 / #893), which runs across all artifacts after drafting. This is a form check at authoring time, next to the scenario-shape checks validate already 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.

Lingua principale
TypeScript
Stelle
71.6k
Fork
4.9k
Merge medio
2g 6h
PR unite (30g)
82

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Fission-AI/OpenSpec

Tutte le issue di Fission-AI/OpenSpec

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.