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([issue-1893]): log issue #1893 to changelog
[._.]/ Adam Eivy0396669fc4e5
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 64664236d6..af0aea4e51 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -50,6 +50,8 @@## Internal+- **[issue-1893] Decided and documented `atomicWrite`'s symlink semantics.** Settled the design question deferred from the #1837 review: when `atomicWrite`'s target is a symlink, the temp+rename deliberately REPLACES the link with a regular file rather than following it to the backing file — the standard atomic-write contract (git, dpkg, rsync, `os.replace` all replace the link), and following it would reintroduce the non-atomic in-place truncate the helper exists to eliminate. The decision (and the reasoning behind not following or rejecting) is now recorded in the helper's JSDoc, and a test pins the replace-not-follow behavior so it can't silently regress. No runtime behavior changed — PortOS ships no symlinked data files — this closes the open question rather than altering the writer. (`server/lib/fileUtils.js`, `server/lib/fileUtils.test.js`)+- **[issue-725] Brain entity stores split to per-record `collectionStore` layout.** Every Brain store (people, projects, ideas, admin, memories, links, buckets, journals, inbox, songs) moved off its monolithic `data/brain/<type>.json` file — where every create/update/delete rewrote the whole file and every read parsed all records behind a 2s cache and one global write mutex — onto the per-record `collectionStore` shape (`data/brain/<type>/<id>/index.json`), read through to disk with per-id write queues so writes to different records no longer serialize. This is proactive scale headroom: PortOS is distributed and a user's federated peers accumulate Brain data on their own schedule, so stores are prepared for size before any one install hits the whole-file-rewrite cliff. Federation is untouched — Brain federates strictly per-record through the storage API seams, so the on-disk container shape is orthogonal to the wire format (no schema-version bump, no wire-category change), and in-place tombstones are preserved through the split so no last-writer-wins delete marker is lost. Migration 200 splits existing installs (legacy files renamed to `.bak-200`, never deleted; idempotent and recovery-safe), and the shared split skeleton (`makeSplitMigration`) gained a `map` mode for the object-keyed `{ records: { <id>: rec } }` shape alongside the existing array mode. Every exported `brainStorage` function keeps its signature and behavior, so all runtime consumers and the whole reconcile/anti-entropy path are unchanged. (`server/services/brainStorage.js`, `scripts/migrations/200-split-brain-stores-to-per-record.js`, `scripts/migrations/_lib.js`)- **[issue-2775] De-flaked the MidiVisualization "Space toggles playback" test.** The MIDI-visualization component tests asserted on the transport button's *optimistic* `playing` state and raced the synth player's async lifecycle (`play()`'s `await ctx.resume()` microtask hop and the immediate `totalSec <= 0 → onEnded` reset), so `findByLabelText('Pause playback')` failed intermittently in CI and passed on re-run. `useMidiPlayer` is now mocked in the component test with a synchronous state-flip stub, so the three chrome-wiring assertions (playing → label, click/Space → toggle, collapse → teardown) are deterministic and no longer depend on audio timing. The hook's real async behavior stays covered directly in `useMidiPlayer.test.jsx` and the player lib in `midiPlayback.test.js`, so no coverage is lost. (`client/src/components/songs/MidiVisualization.test.jsx`)