Repository navigation
fix(interactive): snapshot start State and startIntent before first await - #18
Merged
Merged
Conversation
…wait start() copied caller-owned State and startIntent only after loadInteractiveProgram resolved. That await yields even when the loader is already settled, so a caller could change both objects before the Checkpoint and startIntentHash were created. Copy both with the existing bounded canonical snapshot first, and preserve the initial-State capacity error. Later Store writes use those copies. Includes the R04 regression tests from PR #17.
rockyshi1993
marked this pull request as ready for review
November 12, 2026 05:24
This was referenced Nov 12, 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.
Summary
start()now takes a bounded canonical snapshot of caller-owned State andstartIntentbefore its firstawait.startIntentis rejected by the same canonical JSON rules beforeputArtifact/createRun.Not changed
adminTerminate, async Store, and terminal State projection are untouched.compileInteractiveoption snapshot) is reproduced and left out of this diff.Verification
Local Windows, Node 22.22.2 and Node 24.22.2.
npm run verifyis 371 pass / 0 fail on both. This is not the Ubuntu/Windows CI matrix and not a native Grok Host acceptance.Note
Medium Risk
Changes run-creation timing for durable state and idempotency keys; behavior is narrowly scoped to
start()with regression coverage.Overview
start()now deep-copies callerstateandstartIntentsynchronously, before the firstawaiton program load, so post-call mutations cannot alter the initial checkpoint or start-intent idempotency hash.Oversized initial state still fails closed with
FK_I_CHECKPOINT_CAPACITYat snapshot time (before store writes). Two R04 regression tests assert persisted state and idempotent replay stay tied to the values at call time.Reviewed by Cursor Bugbot for commit 452ac38. Bugbot is set up for automated code reviews on this repo. Configure here.