wake/W4 hardening (low-pri): observed_seq incremented before store enqueue can permanently wedge the inbox #908
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Low-priority hardening tracked from the #907 (W4 detector) review (RoR comment 18933). Mos-ruled: file even though unreachable today, because the SEVERITY is a permanent inbox wedge.
Failure mode:
detector.sh's_next_observed_seqincrements the persistent monotonic counter BEFOREstore.sh enqueue. If an enqueue ever fails, the detector fails loud and does NOT advance the per-watch last-observed hash (so the source re-observes with the NEXT seq) — but the BURNED seq never reaches the store'sobserved.set. By the §2.2 contiguous-prefix contract (triple-ratified in W2), every futureconsume --upto Nwith N beyond the burned seq then HARD-REJECTS on the interior-gap check — permanently wedging the consumer inbox.Likelihood: unreachable on the validated call path today —
store.sh enqueueonly fails on malformed args or catastrophic disk/jq failure, none of which occur on the detector's validated call. Hence LOW priority. But awareness-only rots; the wedge is permanent if it ever fires, so it is tracked.Fix (cheap, when the file is next touched): increment
observed_seqonly AFTER a successfulstore.sh enqueue— OR, on the enqueue failure path, record the seq as observed-with-tombstone so the contiguous-prefix stays gapless. Add a red-first test simulating an enqueue failure and asserting no permanent gap.Part of #892. Ref: #907 RoR (comment 18933).
SCOPE EXPANDED (Mos ruling, 2026-07-26) — now the store-side allocator UNIFICATION, absorbing the §5 migration fix. A live dragon-lin pilot surfaced a THIRD arrow at the same detector-private-counter seam: §5 migration seeds the STORE cursors but NOT the detector's private
observed_seq_counter→ detector restarts at 0 → next deltas get seqs ≤ consumed →enqueueidempotent-no-ops (exit 0) while the watch-hash advances = PERMANENT SILENT SWALLOW, no fail-loud. Three independent arrows now: (1) this issue's burn-before-enqueue wedge; (2) the W5 reconcile aliasing repro (reconcile.sh dual-allocator note); (3) the live migration-restart swallow. RULING: unify on a SINGLE store-side allocator (store.sh enqueueallocates observed_seq atomically from its own durable cursor + returns it; delete the detector private counter) — this makes counter-seeding moot and the migration seam disappears STRUCTURALLY. Brief requires a red-first migration-restart test (adopt→migrate→restart→delta must WAKE not swallow) + preserves the W2 contiguous-prefix contract. Builder dispatched; same flow builder→indep-review→RoR→id-11. StillCloses #908(fully resolved by the unification).