Repository navigation
fix(show): include requirement and scenario names in JSON - #1972
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository: Fission-AI/OpenSpec/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Fission-AI/OpenSpec/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (10)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesRequirement and scenario names
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Requirement and scenario names appear to flow through the intended JSON outputs consistently. No issue identified here prevents merging after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 7 files. (3 skipped: 3 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
show --json described each requirement as its SHALL sentence and each scenario as its bullets. The parser read both headers and dropped them, so a JSON reader could not name a requirement the way archive matches it. Requirements and scenarios now carry a name, normalized by the same helpers archive and the MODIFIED scenario loss check use. The field is additive and optional in the schema. Closes Fission-AI#1971
050b0d6 to
d10e465
Compare
alfred-openspec
left a comment
There was a problem hiding this comment.
Approved at d10e465. Requirement and scenario names now use the same normalization as archive and the scenario-loss check, the JSON addition is backward-compatible, filtered and no-scenario output retain requirement names, and the CLI plus agent contracts are updated. The full check matrix is green. Final review of the docs-lab change by @TabishB is still required.
Closes #1971
Also answers the secondary request in #1918, which asks for the same names so tools can match a delta to its baseline.
show --jsondescribed each requirement as its SHALL sentence and each scenario as its bullets. The parser already reads both headers and then dropped them, so nothing in the JSON said which requirement was which by the name archive matches on.What changes
Each requirement and each scenario in
show --jsonnow carries aname. This applies to spec JSON and to therequirement/requirementsobjects inside change deltas.The names come from the same normalization archive already uses. For a requirement,
normalizeRequirementNameremoves theRequirement:prefix and a closing#run. For a scenario, the MODIFIED scenario loss check's own name reader is now exported asscenarioNameFromHeaderText, so a scenario name in the JSON is always the name that check compares.C#keeps its#. A level 4 header withoutScenario:is named by its text, since it already counts as a scenario.The field is additive. It is optional in
RequirementSchemaandScenarioSchema, so objects built outside the parser still validate. No existing field changes.Docs
The two JSON examples in
docs-lab/reference/cli.mdshow the new fields, and a short paragraph says what each name is.docs/agent-contract.mdsection 4.2 spells out the requirement and scenario shape.Testing
pnpm testpasses, 5944 tests.pnpm lintis clean. Five new tests cover prefix and closing run removal, a#inside a name, a level 4 header withoutScenario:, change delta names for ADDED and MODIFIED, and the CLI output with-rand--no-scenarios. All five fail on main.