mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-10-27 06:47:07 +00:00
2d51308d39
* wip(collab): the schema-version rebuild sets unflushed edits aside and the item stays marked (BUG-3244 A) Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * wip(server): set-aside rows refuse every content write and restore unless overwrite_pending_edits, which discards and reports them (BUG-3244 A) Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * wip: set-aside read/discard endpoints and pad item set-aside; census and migrated-table entries (BUG-3244 A) Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * wip(store): set-aside edits travel in the workspace bundle; the migrate gate asks the op-log only (BUG-3244 A) Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * wip: set-aside advice branches at every door that names a remedy; mark-only doors share one helper (BUG-3244 A, ruling 1) Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * test(cli): set-aside notices name the right remedy (BUG-3244 A) Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * docs: the rebuild sets unflushed edits aside; freeze reason, API docs and op-log prose follow (BUG-3244 A) Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * test(web): identity-gate rows re-reviewed for the set-aside reason threading (BUG-3244 A) The edits in each covered unit are a pure pendingEditsReason(e) argument or string branch, or a reason passed to the dialog; no await, write or fence changed. Three anonymous-unit matchers follow the new call text, and the keepalive failure row lists the pure classifier in may. Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * test(server): a restore override counts the set-aside rows it discarded (BUG-3244 A) Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * fix(store): the rebuild sets aside the rows its DELETE returned, so an append between choosing and clearing is not lost (BUG-3244 A, codex r1) On Postgres each statement takes its own snapshot and the setup lock does not stop a connected peer appending, so a row committed between the old INSERT ... SELECT copy and the DELETE was deleted without being set aside. The kept rows are now chosen from DELETE ... RETURNING. A test hook in the gap drives a Postgres leg; a mutant that chooses before the gap loses the row. Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * test(web): playbook save row re-reviewed after the BUG-3230 U3 rebase (BUG-3244 A) Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * fix(store): the set-aside move's first statement is the DELETE, so SQLite never upgrades a stale read snapshot (BUG-3244 A, codex r2) Reading the watermark first took a read snapshot on SQLite; a concurrent append would then make the DELETE fail with SQLITE_BUSY_SNAPSHOT instead of waiting. The watermark is now read after the DELETE, where a later value is only more accurate. Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * feat(mcp): ToolSurfaceVersion 0.56, content_state gains superseded_set_aside (BUG-3244 A) The value reaches pad_item get / full list, pad_playbook run and the item resource's line above the body, and its remedy differs from applied_pending_flush (opening the item will not restore the edits). An additive bump with a version.go entry; README, CLAUDE.md and the MCP instructions follow. Read/discard of set-aside rows stays off the catalog. Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9 * test(server): after a bumped rebuild the next open is granted the seed once and the item stays superseded (BUG-3244 A x BUG-3240) Claude-Session: https://claude.ai/code/session_016PXRzXhokr61CLbbu3Txj9
36 lines
1.5 KiB
Go
36 lines
1.5 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
// YjsUpdate is a single appended Yjs binary update for an item.
|
|
//
|
|
// Rows live in the `item_yjs_updates` op-log added in PLAN-1248. The
|
|
// dumb-relay WebSocket server (TASK-1254) appends one row per peer
|
|
// update; on reconnect, clients replay rows since their last known ID
|
|
// and resume seamlessly. UpdateData is the raw output of Yjs's
|
|
// encodeStateAsUpdate / mergeUpdates — opaque to the server. SchemaVersion
|
|
// is stamped from the client at append time and drives TASK-1268's
|
|
// snapshot-and-rebuild flow when a Tiptap minor bump changes the
|
|
// underlying ProseMirror schema between releases.
|
|
type YjsUpdate struct {
|
|
ID int64 `json:"id"`
|
|
ItemID string `json:"item_id"`
|
|
UpdateData []byte `json:"update_data"`
|
|
SchemaVersion string `json:"schema_version"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
// YjsSetAside is an op-log row a collab schema-version rebuild moved out of
|
|
// the op-log because it can no longer replay (BUG-3244). OpLogID is its id in
|
|
// item_yjs_updates before the move; UpdateData is the frame, byte for byte,
|
|
// and SchemaVersion the editor era it was written under.
|
|
type YjsSetAside struct {
|
|
ID int64 `json:"id"`
|
|
ItemID string `json:"item_id"`
|
|
OpLogID int64 `json:"op_log_id"`
|
|
UpdateData []byte `json:"update_data"`
|
|
SchemaVersion string `json:"schema_version"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
SetAsideAt time.Time `json:"set_aside_at"`
|
|
}
|