fix: parse scenarios on every non-singular spec kind (protocol et al.)#49
Merged
Conversation
CarriesScenarios() gated scenario parsing to story/domain, so a `kind: protocol` spec's `<!-- id: scenario… -->` was never parsed into Spec.Scenarios. It never entered the declared set, so a test's `// [scenario…]` binding joined to nothing and Join reported it as a Dangling binding — a spurious D12 violation. Trove blocks on owning scenarios from protocol specs. Gate on `!k.Singular()` instead: every per-file behavioral contract kind (story, domain, protocol, use-case, flow, view-model, command, error) carries scenarios; the singular cross-cutting doc kinds (narrative, architecture, design-system, conventions) stay excluded. That exclusion is load-bearing — specs/CONVENTIONS.md carries an illustrative `<!-- id: scenario.item.create.happy-path -->` that must never be parsed as a real declaration. Regression: TestVerifyProtocolScenarioJoins drives the real Verify path over a kind: protocol fixture + a Go `// [scenario…]` binding and asserts the scenario joins (no Dangling), passes, and locks. TestCarriesScenarios pins the non-singular contract.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Kind.CarriesScenarios()gated scenario parsing tostory/domain, so akind: protocolspec's<!-- id: scenario… -->was never parsed intoSpec.Scenarios. It never entered thedeclaredset injoinTarget, so a test's// [scenario…]binding joined to nothing andJoinreported it as aDanglingbinding — a spurious D12 violation. Trove needs to own scenarios fromkind: protocolspecs.Change
Gate on
!k.Singular(): every per-file behavioral contract kind (story, domain, protocol, use-case, flow, view-model, command, error) carries scenarios; the singular cross-cutting doc kinds (narrative, architecture, design-system, conventions) stay excluded.That exclusion is load-bearing —
specs/CONVENTIONS.mdcarries an illustrative<!-- id: scenario.item.create.happy-path -->that must never be parsed as a real declaration. A blanket "all kinds" would have polluted SpecKit's own library;specify scanon this repo stays clean.Tests
TestVerifyProtocolScenarioJoins(engine) — drives the realVerifypath over akind: protocolfixture + a Go// [scenario.troved.search.returns-mapped-results]binding; asserts the scenario joins (noDangling), passes, and locks. Watched it fail RED with the exact dangling binding before the fix.TestCarriesScenarios(specmodel) — pins the non-singular contract (8 behavioral kinds carry; 4 singular kinds don't).Verification
mise run cigreen (fmt, build, vet,go test ./...).specify scanon this repo:clean.Follow-up (not in this PR)
specs/CONVENTIONS.mddescribes scenario-carrying using only story/domain as examples — now incomplete (not false). Worth a focused wording pass since it's normative spec truth.