fix(permissions): preserve same-entry mutation intent order - #3363
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Review round 1 found a HIGH same-entry race: clearing mutation tails at session/token replacement let a new intent start while an old in-flight write could still commit. The final fix at The separate lower-severity never-settling request risk is tracked in #3364; an arbitrary client timeout cannot prove that the first server write will not later commit. |
|
Fresh-context fix review completed at |
|
Exact-head CI qualification at e99bba8: full CI run 35784114426 succeeded, including Windows API integration and E2E; Smart CI run 35784116988 succeeded with Plan and Required Gate. Earlier same-head Smart CI run 35784110750 was cancelled before assertions while the successful duplicate started three seconds later. gh pr checks --required exits 0; no failed assertion or unresolved review thread remains. The independent fix review found no HIGH/CRITICAL defect, and the pushed head has aged over three minutes. |
Summary
Serialize board-access updates and revokes per access entry in submission order. A queued operation keeps loading owned from submission, rechecks its session before transport, and proceeds after a failed predecessor. An independent entry remains concurrent and its error receipt is not erased when another entry's queued operation starts.
Closes #3333.
Integration and scope
This integrates source draft #3335 after #3361 landed. The source head
664cdceb9e4392abb9c0989ae42d54a69fea0844remains an ancestor of this branch, preserving its commits. The diff against currentmaincontains only the permission mutation queue, error ownership, its regressions, the analysis note and the bounded STATUS update. It retains #3361's read, token rotation and stale mutation reconciliation behavior.The queue orders one client's intents only. Cross-device changes still need a server revision contract; this PR does not claim one.
Verification
npx vitest --run --maxWorkers=2 --silent.npm run typecheckand changed-file lint passed after the fix.npm run buildand fullnpm run lintpassed before the fix, with 11 existing warnings outside the changed files.node scripts/check-docs-governance.mjsandnode scripts/check-doc-links.mjs: passed, zero broken links and three existing masking warnings.Hosted exact-head CI and a scoped fresh-context review of the logic fix remain merge gates. No browser journey directly exercises same-entry permission mutation races; deferred real-Pinia tests cover that seam.
Documentation and follow-up
docs/STATUS.mdrecords the client behavior and cross-device limit.docs/analysis/2026-09-21-permission-mutation-order.mdrecords the schedules and evidence. A never-settling request can still hold its lane; the lower-severity follow-up is #3364. Existing human actions inOUTSTANDING_TASKS.mdremain open.