Skip to content

fix(simulation): invalidate obsolete REST compile-to-start ownership - #190

Merged
ttbombadil merged 1 commit into
mainfrom
fix/compile-start-ownership
Oct 5, 2026
Merged

ttbombadil merged 1 commit into
mainfrom
fix/compile-start-ownership

Conversation

@ttbombadil

Copy link
Copy Markdown
Collaborator

Summary

  • Give pending REST compile-to-start work a synchronous generation owner; suppress obsolete success, compiler-error and transport-error callbacks.
  • Invalidate on Stop (also offline), newer starts/compiles, workspace replacement, explicit file/example/external code loading and unmount. Cover public mutation entrypoints and start refs.
  • Cancel the existing delayed Reset when its start intent is superseded.
  • Release only a cancelled pending compile's indicators; preserve the sandbox compilation phase and compiled snapshot payload for accepted results.

Reproduction and scope

Base: freshly fetched 5b425872cc90fc23c617a4792fdc06146db5b417, after green post-merge CI for #189.

Real React Query/controller hooks with deferred HTTP responses reproduced nine main regressions. React Query already prevents obsolete per-call success callbacks and post-unmount starts; shared mutation callbacks still let an old failure stop a newer run. These callbacks now obey the same ownership guard.

Independent review found cancellation could leave compile indicators busy without a WebSocket terminal response. Three additional RED/GREEN cases cover offline cancellation, external replacement and cancellation before the mutation body runs. Standalone Compile supersession has another RED/GREEN test. Focused suites: 67 passed.

Ordinary editor edits and same-project tab navigation retain the captured-source behavior. Context cancellation is explicit at existing replacement/load boundaries and tracks workspace identity, avoiding a new editor or Tutor policy. No HTTP/WebSocket payload or external API contract changes; no SSOT/ADR/Tutor/Planner/Mastery/Prompt changes or Provider calls.

Verification

  • Full unit/coverage and Sonar quality gate, types, docs, read-only lint and build.
  • Real toolchain integration, Docker integration and complete Chromium E2E.
  • Local E2E uses the existing temporary port3307 adapter with unchanged assertions because an unrelated project owns3000.
  • Normal commit and pre-push gates; no bypass. Protected/untracked user files untouched.

@ttbombadil
ttbombadil merged commit d9a21de into main Oct 5, 2026
5 checks passed
@ttbombadil
ttbombadil deleted the fix/compile-start-ownership branch October 5, 2026 13:27
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