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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
docs([conflict-journal-subscribe-fanout-flush-coalesce]): remove from PLAN.md and log to changelog
[._.]/ Adam Eivy89f52d3320e5
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 56770ea0dc..5c94b21ae3 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -35,6 +35,7 @@- **[coalesce-fallback-provider-failure-storm] AI provider failovers no longer thrash the disk when many requests hit a down provider at once.** When a provider goes down with several requests in flight, PortOS now benches it and picks the fallback a single time for the whole burst instead of repeating that work per request, so failover stays fast and quiet under load.- **[capabilities-cheap-memory-count] Capabilities overview counts Brain memories more cheaply.** The frequently refreshed status overview now reads the active-memory total directly, keeping it lighter as memory history grows.- **[conflict-journal-push-flush-coalesce]** When a peer reconnects and many records sync in one burst, the conflict-tracking base-hash file is now rewritten once for the whole burst instead of once per record — less disk churn during convergence, no behavior change.+- **[conflict-journal-subscribe-fanout-flush-coalesce]** Sharing a record to several machines at once (or enabling sync for a whole category) likewise rewrites that same conflict-tracking file once for the batch instead of once per record/peer — no behavior change.- **[media-collections-per-record-store] Media collections now persist per-record instead of in one monolithic file.** `data/media-collections.json` is split into `data/media-collections/<id>/index.json` (plus a type-level `index.json` stamping the storage `schemaVersion`) via the shared `createCollectionStore` layout — the same per-record shape universes / series / issues already use. Every collection write (`addItem`, `bulkUpdateCollectionItems`, merges, tombstone GC) now serializes on its own record queue, so high-frequency render-filing no longer rewrites the whole ~200 KB document per image or blocks unrelated collections' writes. Migration `059-split-media-collections.js` performs the one-time split (idempotent, backs the legacy file up as `.bak-059`), the boot-time verifier checks the on-disk version, and the dataSync snapshot watcher tracks the directory so per-record edits still invalidate the checksum cache. The wire sync payload is unchanged, so collections still sync across peers of mixed versions.- **[chrome-canary-followups] Custom Chrome setup writes browser config through the shared atomic writer.** The Canary setup script now uses `server/lib/fileUtils.js#atomicWrite` for browser-config updates, so it gets the same temp-file/rename behavior and Windows fallback as the rest of PortOS config persistence.- **[setup-browser-canary-headless] The PortOS-managed browser now runs visible (headed) by default.** New installs — and opting into Chrome Canary at setup — launch a window you can see, since the whole point of a dedicated managed browser is to watch its automation. On update, existing installs still carrying the old headless default are flipped to headed; if you'd previously turned headless *off* (or any non-default value) it's left untouched. If you actually want headless, set `"headless": true` in the browser config again.diff --git a/PLAN.md b/PLAN.mdindex 5ea414ae73..71ebd02414 100644--- a/PLAN.md+++ b/PLAN.md@@ -6,7 +6,6 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [.changelClaimable, well-specified, no decision needed — `/claim`-able. Unordered.-- [ ] [conflict-journal-subscribe-fanout-flush-coalesce] **Coalesce base-hash flushes across the auto-subscribe fan-out loops too.** `withBaseHashFlushBatch` (added in `[conflict-journal-push-flush-coalesce]`) now wraps the `retryPendingPushesForPeer` convergence walk, but two other multi-push loops in `server/services/sharing/peerSync.js` still flush per record: `autoSubscribeRecordToAllPeers` (~362, one record → N peers) and `autoSubscribePeerToAllRecords` (~393, N records → one peer, the category-toggle backfill). Wrapping them is NOT a simple `withBaseHashFlushBatch(async () => { for … })` like the convergence loop was — `subscribePeer` fires its initial `pushRecordToPeer(sub)` **fire-and-forget** (`peerSync.js` ~281, not awaited), so the async stamps/flushes escape the synchronous batch scope before the terminal flush fires and the coalescing is lost. Coalescing here requires either (a) threading an `awaitInitialPush`/batch-aware option through `subscribePeer` so the fan-out can await each initial push inside the batch, or (b) collecting the created subs and doing an explicit post-loop `withBaseHashFlushBatch` re-push. Both change the deliberately-non-blocking initial-push contract, so it's its own change + test surface. Surfaced by /simplify (efficiency) during the convergence-loop coalesce PR (2026-06-02).- [ ] [conflict-journal-base-hash-prune] **`sync_base_hashes.json` grows unbounded.** `server/lib/conflictJournal.js` seeds a base hash per synced universe/series and never prunes entries for deleted/tombstoned records. Tiny per-entry, but a long-lived install accumulates dead keys. Add a sweep (drop keys whose record no longer resolves) to the tombstone GC path.- [ ] [makesplitmigration-shared-factory] **Extract a shared `makeSplitMigration` factory into `scripts/migrations/_lib.js`.** The monolithic→per-record split scaffolding (`fileExists` / `readJsonStrict` / `readJsonTolerant` / `writeJson` + the `withFileTypes` already-split scan + the gate1/gate2/recovery/split/stamp/backup body) is now copied verbatim across **four** migrations: `034-split-universe-builder`, `035-split-pipeline-issues`, `036-split-pipeline-series`, `059-split-media-collections`. They differ only in `{ typeDirName, legacyFilename, backupSuffix, typeSchemaVersion, typeLabel, recordsKey, idPattern, buildConfig }` (e.g. `config: { runs }` for universes vs `config: {}` for collections). `_lib.js` already houses cross-migration families (`makePromptReplaceMigration`, layout helpers) — add a split family there and collapse the four to ~15-line config blocks. Pre-existing duplication; 059 was the 4th copy. Own change + test surface, so deferred out of the migration PR.- [ ] [mediacollections-parallel-merge-prune] **Parallelize the multi-record loops in `mergeMediaCollectionsFromSync` and `pruneTombstonedCollections`.** Both iterate distinct record ids in a sequential `for await` over `queueRecordWrite` — different ids use different per-record queues, so a bounded `Promise.all` (use the shared bounded-concurrency mapper) would fan out the snapshot-apply batch (`dataSync.js` passes a full collections list) and the GC sweep. Most peer pushes carry a single record so the realized win is the snapshot/GC paths only; low priority.