Skip to content

fix(devtools): isolate replay execution lifetimes - #3326

Open
Chris0Jeky wants to merge 2 commits into
mainfrom
audit/replay-lifecycle
Open

Chris0Jeky wants to merge 2 commits into
mainfrom
audit/replay-lifecycle

Conversation

@Chris0Jeky

@Chris0Jeky Chris0Jeky commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

Hardens the internal trace replay engine around one explicit execution lifetime.

Previously, repeated play() calls could schedule duplicate delivery, while an async action handler could settle after stop(), seekTo() or dispose() and still advance state, emit an error or schedule further work. Pause/resume could also invoke one pending action twice, and a reentrant state listener could leave later observers seeing an obsolete state.

This change:

  • gives the current playback generation exclusive ownership of timers and async settlement;
  • prevents repeated Play from creating duplicate schedules;
  • revokes stale continuations after Stop, Seek or Dispose;
  • allows a paused pending action to settle once without scheduling a successor;
  • resumes without invoking the pending handler again;
  • suppresses obsolete notifications after synchronous observer reentry;
  • rejects non-finite speed and non-integer/non-finite seek controls;
  • preserves the selected seek position after completion;
  • adds a focused canonical lifecycle suite and bounded evidence note.

Scope

Three files only. Public method signatures remain unchanged. This cannot cancel or roll back an external effect already started inside a handler; it suppresses obsolete engine continuations. No application data, backend, schema, dependency, workflow, authorization or route change.

Base: 307c3b8b50bec1cb0bfaea3e570a942bcb1d4451

Exact source head: b51fd55fbcc477b15503f428f3cbab64a93b4414

Red/green evidence

A supplemental runner imports the actual production replay module:

  • unchanged main: 17 expected behavioral failures, 5 controls passing;
  • corrected source: 22/22 passing.

The coverage includes duplicate Play, late resolve/reject after replacement, Stop/Seek/Dispose ownership, pending-action pause/resume, handler-chain interruption, completion seeks, invalid controls and reentrant state observers.

Verification

  • Smart CI Self-Test 35596117841: success.
  • CI Extended 35596118320: success.
  • Required CI 35596118244: success across Linux/Windows frontend lint, typecheck, build and full coverage tests; backend unit/API integration on both platforms; architecture, migrations, containers, dependency/SAST/secret scans, docs governance, worktree contracts and E2E smoke.
  • Combined local JWT/replay actual-module suite: 51/51 passed.
  • Smart CI Node suite: 554/554 passed.
  • Refactoring-ranker Python suite: 32 passed.
  • Docs governance, golden-principles and relative-link checks passed.

Ready for independent review. Green CI is not merge authorization. Review should focus on pending-handler pause/resume semantics, reentrant state callbacks, stale error suppression and final disposal.

No rollback migration is required. Observer exceptions and validation of externally mutated Trace objects remain outside this slice.

Give timers and asynchronous handlers generation-scoped ownership so stop, seek and dispose revoke stale continuations. Prevent duplicate play scheduling, preserve pause/resume semantics, guard reentrant state delivery, and add focused lifecycle regression coverage.

Chris0Jeky commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

Publication/qualification checkpoint for exact head b51fd55fbcc477b15503f428f3cbab64a93b4414:

  • Smart CI Self-Test run 35596117841: success.
  • CI Extended run 35596118320: success.
  • Required CI run 35596118244: queued at the latest inspection.

The source, lifecycle regression and evidence-note blobs all match the locally verified Git object identities. This is a draft checkpoint, not exact-head qualification or merge approval; keep the PR draft until the complete hosted matrix and independent review are inspected.

Copy link
Copy Markdown
Owner Author

Exact-head qualification is complete for b51fd55fbcc477b15503f428f3cbab64a93b4414:

  • Smart CI Self-Test 35596117841: success.
  • CI Extended 35596118320: success.
  • Required CI 35596118244: success across Linux/Windows frontend lint, typecheck, build and full coverage tests; backend unit/API integration on both platforms; architecture, migrations, containers, dependency/SAST/secret scans, docs governance, worktree contracts and E2E smoke.

The PR is being moved to ready-for-review. Green CI is qualification evidence, not merge authorization; independent review remains required.

@Chris0Jeky
Chris0Jeky marked this pull request as ready for review September 21, 2026 12:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-21T12:34:23.636541Z b51fd55 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Labels

None yet

Projects

Status: Pending

Development

Successfully merging this pull request may close these issues.

1 participant