Skip to content

Close workspace preference interleaving gaps - #3110

Draft
Chris0Jeky wants to merge 2 commits into
mainfrom
codex/1410-workspace-interleavings
Draft

Chris0Jeky wants to merge 2 commits into
mainfrom
codex/1410-workspace-interleavings

Conversation

@Chris0Jeky

@Chris0Jeky Chris0Jeky commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Purpose

Resolve the three client-state residuals recorded in #1410 without changing the server contract:

  1. a replay from a deferred/dismissed onboarding placeholder adopts the successful response's restored steps;
  2. logout invalidates in-flight mode and onboarding write generations so old-session settlements cannot dirty the next session;
  3. a clean Home or Today summary that post-dates a failed write and matches local mode confirms that intent and releases the dirty guard.

Red → green evidence

RED — exact test-only head. Commit 60e75e05d21eb97efe343167cd40d8150ee63610 added five focused store regressions and no production changes. Main CI run 34920286988, Ubuntu frontend job 104226729173, passed lint, typecheck, build, and PWA validation before failing only in the frontend test phase. Its archived JUnit receipt contains exactly five failures, all in workspaceStore.residualInterleavings.spec.ts:

  • replay left the deferred steps: [], null current step, and old dismissal timestamp;
  • an old-session mode rejection restored preferenceError after logout;
  • an old-session onboarding rejection restored preferenceError after logout;
  • a matching clean Home summary left preferencesHydrated false;
  • a matching clean Today summary left preferencesHydrated false.

GREEN candidate. Commit 91936bc2a2abaa24d708ff2e0ad6b709a34ec545 extends the existing per-field version/read-snapshot architecture. Smart CI run 34920797590 and CI Extended run 34920797882 are successful. Main CI run 34920797772 is still executing its exact-head matrix; this PR remains draft until that evidence settles.

Design

  • Summary reads reconcile a dirty mode only when their read snapshot is clear and the returned mode equals the local intent. A disagreeing server value remains blocked until a later authoritative reconciliation.
  • Replay adopts its response only when the optimistic source is the server's dismissed/deferred placeholder shape. Ordinary optimistic onboarding writes remain confirm-only, preserving newer local intent.
  • Logout bumps both write generations while retaining pending counters so old finally blocks still balance loading state without being able to mutate preference state.
  • Today now records successful mode hydration just as Home already does.

Scope

  • workspaceStore ordering/reconciliation semantics and focused tests only.
  • Two commits and two changed files against main.
  • No API, persistence, server ordering, cross-device token, UI component, route, or product-mode behavior changes.

Closes #1410

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.

Workspace-mode guards: three residual interleavings from #1386 round 5 (replay payload, logout invalidation, dirty-mode reconciliation)

1 participant