Four went in: terminal modes and the wipe that ends the session - #55
Merged
Conversation
…ommand procedures
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.
Implements the phase 12 plan (#54):
SessionMode.VICTORYwith its command-legality contract, and every party wipe — battle or not — routed togame_overthrough one piece of terminal-state machinery. The milestone runs: the phase golden's trap wipe ends the session and replays and restores clean, a deprivation wipe ends it the same way, and the victory legality census holds at both the declaration and the executed seam.What shipped
SessionMode.VICTORYandSessionMode.terminal— the second terminal mode and the one place "has this session ended?" is decided. Play commands are illegal in both terminal modes by construction; referee commands remain legal except the three that would resume play:PlaceParty(illegal invictoryonly — it stays legal ingame_overas the documented salvage door toraise_dead) andSpawnMonsters/SpawnNpcParty(illegal in both; a concluded session opens no new play state). The spawn narrowing is a changelogChangedentry, and the spec's victory sentence gains the matching one-sentence carve-out.GameSession.execute, sharing one walk with_record_deaths: edge-triggered (fires only when the command's own events killed a member and nobody is left), so the salvage flow —PlaceParty(town)ferrying corpses to the temple — never re-triggers the ending. Terminal modes are sticky: a death after victory leavesvictoryalone, and nothing ends twice._check_endskeeps ending the battle, the session check owns the mode flip and theGameOverEvent— one construction site, one reason string. TheResolveBattleRoundTPK event stream is byte-identical to before the fold (verified against amainworktree, 4 seeds, full event dumps).advance_turns' in-field cadences. The boundary is fact 5's: the wiping command's own bookkeeping (relocation, time, its report) stands; what never follows a wipe is a fresh procedure with fresh draws.phase12_wipe.json): a scripted gas-trap wipe — seed chosen so the 2-in-6 spring fires, generator raises if it ever misses — plus two referee probes among the corpses, covering load-equals-replay over a session that ends, which no prior golden did.No
schema_versionbump, no new events/codes/templates, no existing golden touched.Review provenance
Implementation and review both ran as Opus subagents under coordination, per the phase loop. Round 1 came back NEEDS REVISION with one blocking finding the plan's guard census had missed —
TurnUndead's attacks branch advances a round (where a delayed poison can wipe the party) and then opened a player-visible battle among corpses — reproduced by script, plus four non-blocking (unguarded trapped-cache draws on the treasure stream, aPlacePartydocstring contradiction, a vacuous stream assertion in the chute test, and a truncated-rest reporting nuance). Fixes landed asaddress rubber-duck review findings; the census gap and the truncated-rest boundary were folded back into the plan asamend phase 12 plan: extend the guard census to turn-undead and trapped-cache looting, so plan and code do not diverge. Round 2: SOLID — every fix re-verified by rerunning the original repros, both new guards proven load-bearing by reversion in a scratch worktree, TPK stream re-confirmed byte-identical, golden not regenerated by the fixes. Sign-off notes folded in.Full gate green locally:
ruff format --check,ruff check,pyright,pytest(1921 passed),mkdocs build --strict.https://claude.ai/code/session_01CB29d5EbD7XWGrB1EC52dt