5 Commits
Author SHA1 Message Date
james.maes adef7fc1b6 fix(store): harden placement queries, paging, and write locking
Five defects found in review:

- existing_placements never pinned that a never-saved key is absent, and
  its negative case was vacuous (no Archive row existed to over-report).
  Over-reporting makes genuinely new mail look already-seen and be
  skipped by the sync classifier. Both are now real assertions, backed
  by a count so a dropped IN filter fails.
- save_email_at and delete_placements both read then write in one
  deferred transaction. In WAL mode that aborts with SQLITE_BUSY, which
  busy_timeout does not retry; twenty racing saves reproducibly failed.
  Both now use BEGIN IMMEDIATE, matching the WORM and ledger appenders,
  with a concurrency regression test.
- list_messages_page claimed the folder join was one-to-one. It is not:
  the placements key permits one message in one folder twice, and the
  message-only cursor made the second row unreachable across a page
  boundary. The keyset now carries the full placement address.
- list_messages_for_export matched a folder id without its account,
  reintroducing the cross-account collision this model removes.
2026-08-11 15:31:06 -05:00
james.maes 1aacf74509 docs(plan): record pre-flight rulings on gate, ledger access, scoping 2026-08-11 13:56:45 -05:00
james.maes d138dbf65d docs(plan): plan the message/placement identity split
Refs #394
2026-08-11 13:46:56 -05:00
James Maes a997220a98 docs: add Nuncio Monitor implementation plan
Twelve tasks across four phases: outbox account attribution, System.Shutdown,
System.GetHealth, then the monitor crate.
2026-08-07 13:46:05 -05:00
James Maes 1e5f19c6ae docs: add Nuncio Monitor design spec
In-repo dev instrument (crates/nuncio-monitor) plus the three engine
changes it needs: System.Shutdown, pending_remote_mutations.account_id,
and System.GetHealth (implements #296).
2026-08-07 13:36:46 -05:00