Repository navigation
Port the Parlance 0.15.0 runtime contract: 207/207 vectors - #4
Merged
Merged
Conversation
…mmit Parlance 0.15.0 changes how a runtime steps a dialogue, and a 0.14 port handed a 0.15 shape plays it wrong with no error. This ports every runtime item in MIGRATIONS.md 0.15.0: - One ResolveNode skip walk, shared by StepDialogue and AdvanceNode. Only an interstitial gated node (no choices, not isEnd) is skipped. A gated node with choices or isEnd is returned, and its gate hides only the line. Both gates are judged once, on arrival, before onEnter. - StepDialogue returns textHidden (with node.text "" when hidden) and lockedChoices: failing choices whose whenLocked resolves to "show" (choice, then rules.choices.whenLockedDefault, then "hide"), with text and lockedText interpolated. A text-less node stays text-less. - The fallback partition: a fallback choice is offered only when no non-fallback choice passes. PartitionChoices is the one place this lives, and both StepDialogue and ChooseChoice read it. - ChooseChoice returns an error containing "not selectable" for a hidden, locked or unoffered-fallback choice. It reports errors the same way AdvanceNode does. - StepResolvedNode presents an already-resolved node. It takes an optional arrivalState for textHidden, for callers that apply onEnter between the resolve and the present steps of the arrival sequence. - The engine effect leaves state unchanged, with an explicit case. Node and choice tags pass through untouched. AdvanceNode takes an optional project, as the reference does, so its skip walk evaluates gates against the project. The harness now checks lockedChoiceIds on every step vector. It checks nodeId, text, textHidden, nodeTags and visibleChoiceTags whenever a vector states them. It handles expectedError for chooseChoice the same way it does for advanceNode. The changed vectors (step_dialogue 24, choose_choice 17, advance 14, apply_effect 29, resolve_quests 7), the conformance README and the common, dialogue and rules schemas are re-copied from parlance 440369d. The new binding schema is added. The PIN names that commit as v0.15.0 pre-tag and must move to the tag commit once v0.15.0 is tagged. All 207 vectors pass locally with .NET SDK 8.0.131. Eight mutants each turn at least one family red: no locked list, skip every gated node, show the hidden line, no fallback partition, textHidden always false, choose anything, skip gated choice nodes, and engine mutating state. The README usage example passed the project dict as the dialogue and omitted the project argument to ChooseChoice. Both are fixed, and the usage now covers textHidden, lockedChoices and engine dispatch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018SVV6KXuhgbARyUvgQKbUP
The contract is unchanged since the release-prep commit this port was built against (440369d): every vendored vector and schema is byte-identical to parlance at a3c6454, which v0.15.0 tags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018SVV6KXuhgbARyUvgQKbUP
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.
This ports the runtime to Parlance v0.15.0.
conformance/PINpoints toa3c6454, the commit v0.15.0 tags. All vendored vectors and schemas are byte-identical to parlance at that commit.Runtime (
Runtime/Runtime.cs)ResolveNodewalk, shared byStepDialogueandAdvanceNode:isEnd);isEndis returned withtextHidden: trueandtext: "";StepResolvedNode(..., arrivalState)is the presenting half of the arrival sequence.lockedChoicesuseswhenLocked, thenrules.choices.whenLockedDefault, then"hide", and interpolateslockedText.ChooseChoicereturns{error}("not selectable") for a hidden or locked choice, or a fallback that isn't offered. This is the same error shapeAdvanceNodeuses.textis optional; node and choice tags pass through unchanged;engineis an explicit no-op.ConformanceTests.csalways assertslockedChoiceIds. It assertstext,textHidden,nodeTagsandvisibleChoiceTagswhenever a vector states them, and handlesexpectedErrorforChooseChoice.Verification
dotnet testwith SDK 8.0.131, matching CI's8.0.x, passed 11/11 families, 207/207 vectors.textHiddenalways false, accept any choice, skip gated nodes that have choices, and an engine effect that changes state. Every one turned at least one family red.main, so this PR is its first CI run.package.jsonalready requires Unity 2021.3, which supports C# 8.Merge once v0.15.0 is tagged at
a3c6454.🤖 Generated with Claude Code
https://claude.ai/code/session_018SVV6KXuhgbARyUvgQKbUP
Generated by Claude Code