Skip to content

PR_26175_DELTA_002: consolidate replay runtime cloning#182

Merged
ToolboxAid merged 1 commit into
mainfrom
PR_26175_DELTA_002_Shared_Runtime_Consolidation
Jun 25, 2026
Merged

PR_26175_DELTA_002: consolidate replay runtime cloning#182
ToolboxAid merged 1 commit into
mainfrom
PR_26175_DELTA_002_Shared_Runtime_Consolidation

Conversation

@ToolboxAid

Copy link
Copy Markdown
Owner

Summary

  • Adds cloneRuntimeValue(...) to the shared runtime snapshot helper.
  • Moves replay model/system cloning onto the shared runtime helper instead of local structuredClone calls.
  • Preserves replay behavior and adds fallback coverage for environments without structuredClone.
  • Marks the Delta Shared JS consolidation backlog item complete and adds required governance reports.

Validation

  • node --check src/shared/runtime/snapshotClone.js
  • node --check src/engine/replay/ReplayModel.js
  • node --check src/engine/replay/ReplaySystem.js
  • node --check tests/replay/ReplaySystem.test.mjs
  • node tests/replay/ReplaySystem.test.mjs
  • node tests/final/FinalSystems.test.mjs
  • git diff --check

Artifact

  • tmp/PR_26175_DELTA_002_Shared_Runtime_Consolidation_delta.zip

Notes

  • Team Delta ownership only.
  • No UI, API contract, browser-owned data, or tool state changes.

@ToolboxAid ToolboxAid marked this pull request as ready for review June 25, 2026 15:26
@ToolboxAid ToolboxAid merged commit 801780b into main Jun 25, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27f185b26e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

recordFrame(frame) {
if (this.recording) {
const clonedFrame = structuredClone(frame);
const clonedFrame = cloneRuntimeValue(frame);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Route timeline snapshots through the fallback clone

When structuredClone is unavailable, this new fallback clone lets recordFrame create clonedFrame, but the same call immediately passes that frame into ReplayTimeline.pushSnapshot, which still calls the global structuredClone and throws TypeError: structuredClone is not a function. This means recording still breaks in the exact fallback environment covered by the new test; I confirmed with node ./scripts/run-node-test-files.mjs tests/replay/ReplaySystem.test.mjs.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant