Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

docs([issue-1714]): log newest-edit-wins task LWW to changelog

[._.]/ Adam Eivya75c6a1e8c84
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 90ce7f4665..7ba6bfb0a6 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -12,6 +12,7 @@
- **[issue-1650] Completed Chief-of-Staff agent history now mirrors across full-sync peers.** Each paired machine's CoS history tab becomes a complete replica: a full-sync peer advertises its date-bucketed completed-agent archives (the metadata, transcript, and prompt for every finished agent), and the other machine receiver-pulls any it's missing on the ~60s sweep, verifies each file against its advertised hash before writing, then updates its history index so the arrivals appear. Archives are immutable once an agent finishes, so this is safe append-only replication — nothing is overwritten or merged. It runs only for peers explicitly flagged full-sync; a non-full-sync peer is unaffected. Live/running agents, their terminals, and worktrees stay machine-local as before. (Task-list and claim-metadata federation is tracked separately.) (`server/services/sharing/peerSync.js`, `server/routes/peerSync.js`, `server/services/cosAgents.js`)
- **[issue-1712] The live Chief-of-Staff task list now mirrors across full-sync peers — so two machines never both spawn the same task.** Completing the CoS federation started in #1650, each paired machine now sees the other's live backlog and, crucially, its claims: when one machine claims a task to work it, the other learns of that claim on the ~60s sweep and yields instead of spawning a duplicate agent. Because both machines edit the task files live, the backlogs are merged per task rather than copied over each other — a task you've just claimed is never clobbered by a peer's stale copy, completions converge so a finished task stops showing as in-progress on the other machine, and an expired claim (from a crashed machine) becomes freely re-claimable. It runs only for peers explicitly flagged full-sync; a non-full-sync peer is unaffected. Live terminals, in-flight spawns, and worktrees stay machine-local. (`server/services/sharing/peerSync.js`, `server/services/cosTaskMerge.js`, `server/services/cosTaskStore.js`, `server/routes/peerSync.js`)
+- **[issue-1714] Chief-of-Staff task edits now converge to the most recently edited version across full-sync peers.** Building on the task-list federation in #1712: when the same task is edited on two paired machines while it stays in the same state (you re-prioritize it on one, tweak its description on the other), the machines now keep the *newest* edit instead of an arbitrary-but-stable winner. Each task carries an edit timestamp stamped whenever its content changes — but deliberately *not* on a background claim/lease heartbeat, so merely working a task can't make a stale edit win. Older tasks from a peer that predates this still converge safely (a missing timestamp counts as oldest), and task completion still always wins over an in-progress edit. (`server/services/cosTaskMerge.js`, `server/services/cosTaskStore.js`)
- **[issue-1645] Writers Room folders and writing-sprint exercises now federate across peers.** Following works (#1644/#1565), the library's folders and exercise sessions replicate over the per-record peer-sync push pipeline with full last-writer-wins + tombstone semantics. Both tables gained soft-delete columns (`deleted`/`deleted_at`) so a deletion propagates as a tombstone the merge keeps until garbage-collected — the LWW model never propagates a hard delete, so omitting a record would let an out-of-date peer resurrect it. New record kinds `writersRoomFolder` / `writersRoomExercise` are wired through the schema-version gate, wire sanitizer, conflict journal (with restore), peer-sync subscribe/push/merge, tombstone GC, auto-subscribe-on-create, the Instances sync-category toggles, and both storage backends. Exercises predate federation and carry no `updatedAt`, so the wire sanitizer derives a stable LWW key from their existing `startedAt`/`finishedAt`. (`server/services/writersRoom/`, `server/services/sharing/peerSync.js`, `scripts/migrations/139-…`)
## Editorial checks