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([mediacollections-parallel-merge-prune]): remove from PLAN.md and log to changelog
[._.]/ Adam Eivyc5825c61ca28
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex d938b5fa6d..a6ad942cbe 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -37,6 +37,7 @@- **[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.- **[conflict-journal-base-hash-prune]** The conflict-tracking base-hash file no longer accumulates dead entries: deleting a universe, series, issue, or media collection now drops its entry, and the sync housekeeping pass sweeps any strays whose record is gone — so the file stays small on long-running machines. No behavior change.+- **[mediacollections-parallel-merge-prune]** Applying a large incoming media-collection sync snapshot and the collection tombstone cleanup now process records concurrently (bounded) instead of one-at-a-time, so a big sync or cleanup settles faster — 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 58c61dc3a0..912bc11965 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.-- [ ] [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.- [ ] [commands-centralized-parser] **`commands.js` re-implements command parsing with a naive `split(/\s+/)` instead of the centralized quote-aware parser.** `server/services/commands.js:28` splits on whitespace (breaks quoted args) and only imports `ALLOWED_COMMANDS`/`DANGEROUS_SHELL_CHARS` from `commandSecurity.js` — not its `parseCommandArgs`/`validateCommand`. Route through `validateCommand` so allow-listing, dangerous-char checks, and quote-aware arg parsing are one verified step. Verified (gemini IMPROVEMENT).- [ ] [settings-getsave-callers-stale-base] **Migrate `getSettings()→saveSettings({...spread})` callers off the external-read pattern.** `settings.js` now serializes `saveSettings`/`updateSettings` on a per-file write queue, but four callers (`server/routes/imageGen.js:724,736`, `server/routes/loras.js:62,76`) still read via `getSettings()` *outside* the queue, mutate, then `saveSettings(...)` — so a concurrent `updateSettings` landing between their read and queued write is clobbered by their stale base. The clean fix is a deep-merge-aware queued updater they can call (a plain `updateSettings` swap would change semantics: loras uses `deepMerge`, but `updateSettings` shallow-merges, which would drop sibling `civitai.*` keys; imageGen:736 deletes a sub-key by spreading rest). Low value in a single-user install (concurrent settings writes are rare) — surfaced by codex review during the settings atomicWrite migration; deferred for scope + merge-semantics risk.- [ ] [json-state-serialization-one-mechanism] **Two serialization mechanisms guard single-JSON-file writes — pick one.** `server/services/cosState.js` serializes `state.json` writes with the `withStateLock` async mutex (`createMutex`), while `settings.js` (and the issues/series/mediaCollections splits) serialize with `createFileWriteQueue` (single-tail promise chain). Both solve the same "don't let two read-merge-write cycles interleave on one file" problem. Standardize on `createFileWriteQueue` (the documented convention in CLAUDE.md and `fileWriteQueue.js`) and retire the mutex path: route `cosState.saveState`/`loadState`-mutating callers through a per-file queue, then drop `withStateLock`. Low value (both are correct today), and `withStateLock` is imported by several CoS modules so the migration needs care — surfaced by /simplify altitude during the settings atomicWrite migration.