fix(ios): prevent duplicate mutations and preserve read retries

TH
2h ago
+1616-243

Summary

The Swift journal owns execute/join/terminal admission, preventing completed interactions from running twice. An explicit read trait lets finished reads execute again after a lost reply and excludes them from the closed-id window. Execution tokens isolate joiners across re-admission. Recorded failures preserve their code and hint, and successful shutdown replays retain finish behavior.

20 files: 9 production, 7 tests, 1 fixture, 2 docs, 1 patch changeset. The closed-id marker window remains bounded at 4096; queued and running entries remain queryable.

Validation

Head 7c883d7aa617ca757de61304fb8b6cae957717ec, base f7879cf2d266ee1dd476d0342b2819bdeceb647b.

  • Fail-first: read admission, HTTP snapshot repeat, and missing error hint fail on the pre-fix working tree.
  • iOS focused Swift: 81 passed. Focused TypeScript at unchanged production head: 77 passed. Selector replay mutation fails; restoration passes.
  • pnpm check:xctest-selection and pnpm build:xcuitest passed.
  • Native duplicate check: 75 clones, zero new. Exact-head affected gate passed: receipt run-p6s57A, exactCommit=true, checkoutChanged=false.
  • Production-head 9c13f73 live route (final commit changes only tests) on mad2026-sol: open, snapshot, tap, close; runner exited. Same-ID listener tests prove a mutation runs once and a snapshot runs twice.
  • CI on the new head is pending. The prior Apple failure was the test’s host-label assumption; the corrected test observes fresh admission while its command queue is held. macOS host UI automation cannot initialize locally; simulator evidence is recorded separately.