Repository navigation
S133 — Running sessions pick up new content - #591
Merged
Merged
Conversation
This was referenced Oct 9, 2026
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
Running sessions move onto newly published content at
createSession,submitActionandresumeSession(16 §5.2, §5.3; 20-contract §7, C25).SessionHostgains the contractedcontent?: ContentChannel.getStringsnow returns the union of a session's live epochs (C27, 16 §5.7).createSessionasks the channel once and starts the game on its answer. No content entry is written.submitActionadopts after an accepted action commits, in the action's own write. Messages come from the old epoch and the scene from the new one.resumeSessionwrites an adoption at revision + 1. If that write fails, the store restores the record and returns the unadopted scene. A conflict also evicts the cached record.previewActionand rejected actions never consult the channel.Criteria
S133.1 — createSession starts on the channel's version(3 tests: scope and single call, no-offer/throw fallback, anonymous scope)S133.2 — an accepted action adopts after it commits, in its own write(one write at revision 1, log[action, content], messagesmessage.v1/ scenescene.v2; profile fold sees the action's epoch)S133.3 — resumeSession adopts in its own write(revision + 1 write; no write on the same version;storage_failureandconcurrent_modificationeach restore, serve the v1 scene, and adopt at the next resume)S133.4 — a refusal or a failing channel never fails the command(refusal at submit and resume,core.content.pinnedemitted, unheld offer, throwing channel)S133.5 — queries, previews and rejected actions never consult the channel(zero recorded calls acrossgetScene,getView,getStrings,listCampaigns,listSaves,previewAction, and a rejectedsubmitAction). All 120 existing session tests pass unchanged with no channel.S133.6 — getStrings spans every live epoch(never-adopted session gets exactly v1's table and a v2-created one exactly v2's; after adoption a dropped key resolves, a shared key is the newer text, and both halves of the adopting result resolve; a migration entry starts the union at itsto)Differs from design
Nothing differs from the contract. The judgement calls are recorded in
90-decisions.md, 2026-10-09:createSessionthat names an unheld version fails withunknown_campaign. The kind and profile data come from the offered epoch.core.content.adoptedhas already been emitted by then, so an event stream can show an adoption that did not persist.getStringsskips an epoch the archive no longer resolves.Verified
npm run typecheck,npm run lint: clean.npm test: 119 files, 2318 tests passed. The first full run had one failure:long-horizon.replay.test.ts"long-horizon-win: every state it reaches round-trips" ran past 10 s under load. It passed alone (23/23) and on a second full run. This is a pre-existing timing flake, not this change../build/Test-Documentation.ps1: passed (19 generated pages, 135 Markdown files).git diff --check: clean../docs.ps1 -BuildOnlywas not run: it is not installed locally. CI's Verify Documentation Build covers it.Revert verification. Each fix was reverted alone and
store.test.tswas run:submitActionadoptionresumeSessionadoptionresumeSessionrestore on failed writeresumeSessioneviction on conflictcreateSessionpasses the offered versionliveEpochsstarts at the last migrationgetStringsunion (current epoch only)