Compensation helper: dispatch a command into the reducer and
apply its emitted events to wstore best-effort. Used when an
earlier sync apply partially wrote SQLite and we need to undo
the leaked rows. SQLite errors during compensation are logged
but ignored β the caller is already returning an error to the
client; throwing on the cleanup just hides the original cause.
(codex P1 + reagent P2 #616 β partial-write cleanup.)
Dispatch a command into the srv reducer and return the emitted
events. Locks the reducer mutex briefly; the lock is released
before any I/O (caller is responsible for publishing the events
to the broadcast bus).
Phase E.4 (Option A) β reverse lookup: given a LayoutState.oid,
find the Tab.oid that owns it (i.e., the tab whose layoutstate
field matches). Returns None when the layout is unowned (legacy
or partially-migrated row) or the wstore read fails β caller treats
either as βskip the reducer dispatch and fall through to the wcore
write.β Linear scan over all tabs; acceptable here because the
layout-update path is low-frequency relative to drag-resize and
the reducer mutex itself is held for sub-millisecond intervals.
Phase E.5.5 β append a layout-delete action to the source tabβs
LayoutState.pendingbackendactions so the source windowβs
frontend tears the moved block out of its layout tree on next
poll. Mirrors the action-queueing portion of
wcore::tear_off_block. Layout migration is E.4.
Phase E.5.5 β set up the layout tree for a tab that just received
its first block via the TearOffBlock saga. Called from the
TearOffBlock RPC handler after the sagaβs reducer-state portion
(CreateTab + MoveBlock) completes. Mirrors the layout-rootnode
Update a wave object by replacing it wholesale in the store.
The incoming value must have otype and oid fields.
Matches Goβs ObjectService.UpdateObject behavior.
Returns (otype, oid, updated_value_with_new_version) on success.
Existence check used by DeleteWorkspace to decide whether to
run the wcore delete path. Propagates StoreError so the caller
can surface real I/O / corruption failures instead of
misclassifying them as βnot foundβ (codex P2 #615 carryover β
the prior bool return collapsed Err(_) into false, which
led to silent successes when SQLite was unhealthy: reducer would
delete its own copy and report success while the disk row was
never touched).