Files
buzz/crates
Duncan 1155310d9a fix(pool): make P2-3 first-terminal-wins gate cover pool state, not just ack
Unify commit/rollback and terminal ack under a single first-terminal-wins
gate. Previously the two blocks ran independently: the commit/rollback
block executed for every same-gen return while only the ack block was
gated on last_acked_effort_gen, producing order-dependent pool state.

New semantics: the first same-gen return whose result is terminal
(Applied / Failed / Cleared) performs the commit-or-rollback AND emits
the ack AND marks the generation resolved. Later same-gen returns touch
neither state nor the ack stream — the Desktop-visible ack and the
pool state it reflects are resolved atomically by the same return.

V-3 discarded-failed special case: a second-returning Failed worker may
carry desired_effort == pool.desired_effort (values match after the
first worker Applied and committed). V-3's equality check would skip
invalidation, but that worker's live session ran at DEFAULT effort —
stale. Force-invalidate when a same-gen return is discarded and the
worker's result was Failed, regardless of the value comparison.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-06 19:08:20 -04:00
..