Gate quit-time flushes through the departure gate #200

Closed
opened 2026-11-19 09:20:41 +01:00 by AlexKucera · 0 comments
Owner

Parent

Follow-up from the PR #198 finish audit (converged security + general finding; pre-existing seam, untouched by that diff).

What to build

Quitting the app is the one document departure that bypasses the brief-25 gate: PostsModel.shutdown() flushes both sessions best-effort and ignores the results. Two harms:

  • EditorSession.flush() does not hold for an unanswered #67 conflict (only the debounce does), so quitting while the reload alert is up writes the local text over the foreign disk body — the exact harm the #114 audit calls out.
  • A failed quit-time flush silently drops the only copy of the edits — the bug class PR #198 fixed for navigation, one call away from the gate.

Deliver: quit-time flushes route through the departure-gate conflict hold — quitting never overwrites an unanswered foreign body. Plus an explicit product decision, pinned, for the failed-flush-at-quit posture: silently drop (current behavior), block quit (the WritingLockAppDelegate refusal precedent), or rescue (strand the buffer to a recovery file).

Acceptance criteria

  • Quitting with an unanswered #67 conflict leaves the foreign disk body untouched (pin: disk bytes unchanged across a quit-time shutdown)
  • The failed-flush-at-quit posture is an explicit, documented decision with a pin matching it
  • Full verify rail green

[Generated by AI]

## Parent Follow-up from the PR #198 finish audit (converged security + general finding; pre-existing seam, untouched by that diff). ## What to build Quitting the app is the one document departure that bypasses the brief-25 gate: `PostsModel.shutdown()` flushes both sessions best-effort and ignores the results. Two harms: - `EditorSession.flush()` does not hold for an unanswered #67 conflict (only the debounce does), so quitting while the reload alert is up writes the local text over the foreign disk body — the exact harm the #114 audit calls out. - A failed quit-time flush silently drops the only copy of the edits — the bug class PR #198 fixed for navigation, one call away from the gate. Deliver: quit-time flushes route through the departure-gate conflict hold — quitting never overwrites an unanswered foreign body. Plus an explicit product decision, pinned, for the failed-flush-at-quit posture: silently drop (current behavior), block quit (the WritingLockAppDelegate refusal precedent), or rescue (strand the buffer to a recovery file). ## Acceptance criteria - [ ] Quitting with an unanswered #67 conflict leaves the foreign disk body untouched (pin: disk bytes unchanged across a quit-time shutdown) - [ ] The failed-flush-at-quit posture is an explicit, documented decision with a pin matching it - [ ] Full verify rail green [Generated by AI]
AlexKucera added the ready-for-agent label 2026-11-19 09:20:41 +01:00
Sign in to join this conversation.