Files
pad/cmd
xarmian 5fe478b7d0 fix: refuse a token-guarded content write over unflushed tab edits (BUG-3133) (#1423)
expected_seq guards the row, and a browser tab's typing is not in the row
until the tab flushes. So a content PATCH carrying a current token replaced
those edits: through the applier's setContent with a tab open, and with no
tab open the direct path's PruneItemOpLogTx deleted them, and they existed
nowhere else.

A content write that carries expected_seq or expected_updated_at is now
refused with 409 content_pending_flush while content-bearing op-log rows sit
above the flush watermark. The check is composed into the existing precheck,
so the direct, applier and collab-disabled paths all inherit it, and runs in
the write's own tx after the token check (a stale token still answers
update_conflict). It has its own code because re-reading returns the same
row and seq. overwrite_pending_edits lifts it on the API, the CLI
(--overwrite-pending-edits; item edit --force sets it on the save) and MCP
on both transports, with a shared hint that does not say re-read and retry.

A tokenless write is unchanged, except that a direct write now reports
warnings.pruned_pending_edits when its prune deleted such rows (the CLI
prints it to stderr).

MCP ToolSurfaceVersion 0.39: a behavior bump with one additive param.

Claude-Session: https://claude.ai/code/session_01X4uYKs5ZPF28eCWfm8VPvE
2026-09-22 00:42:02 -04:00
..