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
Release v2.7.0
Released: 2026-05-23
Full Changelog
Full Diff: https://github.com/atomantic/PortOS/compare/v2.6.0...v2.7.0
Added
Peer-sync coverage for media collections, closing the gap where per-universe and per-series image/video buckets (the
data/media-collections.jsonrecords that drive the "Universe: X" galleries with 74 / 124 / etc items) never propagated to peers. The file sat outside every sync category, and the per-record push pipeline couldn't help either: collection item adds emitrecordEvents.updated('universe', id), but the universe record itself doesn't move, so thelastPushedHashshort-circuit treated every push asunchangedand the receiver's collection diverged permanently. Fix is in three layers — (1) newmediaCollectionssnapshot category inserver/services/dataSync.jswith amergeMediaCollectionsFromSyncentrypoint that LWWs scalars and unions items bykind:refso neither side ever loses a render to a collection-level updatedAt race; the per-collection write goes through the sameserializeFileWritetail every other mediaCollections mutator uses. (2) The universe / series push payload inserver/services/sharing/peerSync.jsnow bundles the linked collection (findCollectionByUniverseId/findCollectionBySeriesId) and the asset manifest includes each item'srefso image bytes flow through the existing receiver-side asset-pull worker —simplePayloadHashcoverslinkedCollectionso the short-circuit can no longer collapse a collection-only edit. Tombstone pushes deliberately skip the collection bundle so a deleted universe doesn't re-create an empty bucket on the peer. (3)applyIncomingPushroutes the bundledlinkedCollectionthroughmergeMediaCollectionsFromSyncso the receiver's JSON converges atomically with the record merge.DEFAULT_SYNC_CATEGORIESinservices/instances.js, the route enum inroutes/dataSync.js, AND thesyncCategoriesSchemaZod inroutes/instances.jsall gainmediaCollections(Zod's default object parsing strips unknown keys, so PATCHsyncCategories.mediaCollectionswould otherwise silently no-op — same regression class the universe + pipeline schema fix patched earlier). The client'sSYNC_CATEGORY_METAadds the row.ephemeral: truefield on universes, series, and issues — a local-only "don't sync to peers" marker. Set on POST (create) or PATCH; sanitizer normalizes anything non-true back to absent. The wire / push / subscribe / merge / asset layers ALL honor the flag end-to-end:- Wire (
sanitizeRecordForWire): returnsnullfor live ephemeral records so both transports (60s snapshot loop + per-record push) skip them. Tombstones for ephemeral records still cross the wire — a once-shared record marked ephemeral then deleted still propagates its delete so peers that still hold the live copy converge. Theephemeralfield itself is stripped from every wire output so the byte-stable checksum invariant survives even when a strayephemeral: falselives on disk. - Subscription lifecycle:
createUniverse/createSeriesskip auto-subscribe for ephemeral records.updateUniverse/updateSeriesPATCH transitions are wired: false→true tears down every per-record sub for the record (newunsubscribeAllForRecordhelper); true→false re-firesautoSubscribeRecordToAllPeersso the now-shareable record reaches every peer with the matching category.autoSubscribePeerToAllRecords(peer:online backfill) filters ephemeral records out of the set-diff. - Receiver-side merges (
mergeUniversesFromSync/mergeSeriesFromSync/mergeIssuesFromSync): strip inboundephemeralfield unconditionally (a buggy/older/non-conformant peer can't plant a "dark" record on the receiver), and refuse the merge entirely when the LOCAL record is ephemeral — peer edits can't overwrite content, peer deletes can't trigger our orphan cascade, and the post-merge asset-pull worker never schedules downloads for local-ephemeral records. - Series asset manifest: ephemeral AND deleted child issues are filtered out of the asset-manifest input to
buildAssetManifestForSeries(not just out of the bundledissuesarray). Their tombstones still ride in the bundledissuesso the receiver's delete cascade can finish — only their asset filenames are stripped, so the receiver doesn't pull bytes for records it's about to orphan. Same rule applies at the top level: a tombstone push for a deleted universe or series ships an emptyassetManifest(the deleted record itself still crosses so the peer can converge). peerSynclistener now also subscribes torecordEvents.deleted(not just'updated') so soft-deletes propagate via the per-record push pipeline — previously they were stranded for any peer that had a per-record sub (which is most peers under the new auto-subscribe).retryPendingPushesForPeerwalks every sub (not just unpushed ones) onpeer:online; thelastPushedHashshort-circuit insidepushRecordToPeerskips the network call for unchanged records, so out-of-band file edits (cleanup scripts, hand-edits) re-propagate on the next reconnect.
New
scripts/cleanup-test-data.jsone-shot soft-deletes records matching a conservative test-fixture name roster (Test Work,Commit U,Commit S, etc. — generic names like'A'/'B'/'Live'/'Hidden'deliberately excluded to avoid clobbering real user records), cascading the delete to child issues of each tombstoned series so the orphan-zombie state never materializes. Default is dry-run;--applywrites; users restart PM2 afterward to trigger propagation.- Wire (
quick-imagedashboard widget — a textarea + Generate button that hands the typed prompt off to the Image Gen page via?prompt=…(the same query-param the Media History remix flow already consumes). Registered inwidgetRegistry.jsxand seeded into the default Everything layout inserver/services/dashboardLayouts.js. Existing installs pick it up via migration033-seed-quick-image-widget.js, which inserts the widget at its preferred grid slot below quick-brain when free and appends below the existing grid otherwise; only the built-indefaultlayout is touched.Cmd+Enterin the textarea submits.Federated peer-sync tombstone GC (Stage 5 of 5). New
server/services/sharing/tombstoneGc.jsruns once per 60s sync tick and prunes tombstoned universes / series / issues that every subscribed peer has acked + a 24h grace buffer. The cutoff ismin(now, minAckedAcrossPeers) - 24h, which collapses the "no peers subscribed" and "peers behind" cases into one formula (Infinity from an empty peer list clamps viaMath.mintonow). Issue tombstones use the series ack horizon since issues ride series pushes. Three new exports (pruneTombstonedUniverses,pruneTombstonedSeries,pruneTombstonedIssues) on the record services are mechanical-prune helpers — the GC module owns the policy.syncOrchestratordynamically importssweepTombstonesto keep the GC's universe / pipeline / sharing graph off the orchestrator's boot path. Logs only when prune count > 0.Federated peer-sync UI + receiver-side asset pull (Stage 4 of 5). New
SyncToPeerButton(client/src/components/sharing/SyncToPeerButton.jsx) appears next to the existingShareToButtonon Universe and Series pages — a dropdown of every enabled peer with a check/circle toggle to subscribe/unsubscribe. NewMediaImagecomponent (client/src/components/MediaImage.jsx) wraps<img>and renders a "Syncing" placeholder when the asset 404s (peer-pushed records reference UUIDs that haven't been pulled yet); apeerSync:asset-arrivedsocket event swaps the placeholder for the live bytes the moment the receiver's worker lands them. The Instances page now shows a per-peer "Live-pushed records" section listing every active sync subscription with a one-click unsubscribe and a↩ reversebadge for subs that were auto-created by an inbound push. New receiver-sidepullMissingAssetsFromPeerworker inserver/services/sharing/peerSync.jsbackground-fetches each missing asset from the sender's/data/{kind-dir}/<filename>static mount and writes it locally (capped at 100MB per asset, filenames re-validated against path traversal even after the diff already sanitized them).peerSyncEventsis wired throughsharing/index.jsto socket clients so the UI updates in real time.Federated peer-sync HTTP routes and orchestrator wiring (Stage 3 of 5). New
server/routes/peerSync.jsmounts at/api/peer-syncwithPOST /push(receiver-side; wrapsapplyIncomingPushwith Zod-validated payload + asset-manifest size cap of 2000),GET/POST /subscriptions(list + create local outgoing subs), andDELETE /subscriptions/:id.installPeerSyncListener()now runs alongsideinstallSubscriptionListenerininitSharingso onerecordEvents 'updated'fan-out drives both the share-bucket and peer-sync transports.syncOrchestratornow consultslistPeerSubscriptions(peerId)per cycle and skips the snapshot category for any(peer, kind)pair where a per-record peer subscription exists (universe-sub → skip 'universe' snapshot; series-sub → skip 'pipeline' snapshot) so the push pipeline owns the wire for subscribed pairs and the 60s loop stops re-applying the same records. Asset static mounts under/data/{images,image-refs,videos,video-thumbnails}now passacceptRanges: trueexplicitly so the receiver's background asset-pull can resume partial downloads over flaky Tailnet links (default of serve-static, now encoded as a contract so it can't accidentally regress).Federated peer-sync pipeline modules (Stage 2 of 5). New
server/services/sharing/peerSync.jsholds the per-record subscription store (data/sharing/peer_subscriptions.json), the asset-manifest builder, the push pipeline that serializes a record + its child issues + the SHA-manifest to a peer's/api/peer-sync/pushendpoint, and the receiver-sideapplyIncomingPushthat merges via the existingmerge*FromSyncLWW path, computes the asset-diff response, and best-effort auto-creates a reverse subscription back to the sender (honoring per-peerdirections: ['inbound']to skip when explicitly inbound-only). Newserver/services/sharing/peerTombstoneCursors.jsholds per-peerlastAckedDeleteAtwater-marks so a tombstone is only GC'd once every subscribed peer has acked it (with asubscribedSincehorizon so late-joining peers don't have to ingest every historical deletion). State writes serialize through a module-levelwriteTailso a fire-and-forget push can't clobber a concurrent subscribe write on the same JSON. The actual HTTP routes and orchestrator wiring land in Stage 3.Foundation for federated peer sync of Universes, Series, and Issues (Stage 1 of 5). Soft-delete (
deleted+deletedAttombstone fields) is now part of the on-disk record for universes, series, and issues — so a delete propagates to other PortOS instances via the existing LWW snapshot merge instead of vanishing locally and resurrecting from a peer.listUniverses/listSeries/listIssues(and their per-id getters) filter tombstones by default; pass{ includeDeleted: true }to see them.mergeUniversesFromSync/mergeSeriesFromSync/mergeIssuesFromSyncdetect delete-transitions and fire the same orphan-cleanup cascades as a local delete (media-collection unlink, slot-map clear, issue renumber). Newserver/lib/syncWire.jsis the single source of truth for what fields cross the peer wire (today it stripsruns[]from universe state — shared by the 60s snapshot loop and the upcoming per-record push). Newserver/lib/assetHash.jspersists SHA-256 hashes in eachdata/images/{uuid}.metadata.jsonsidecar so both the share-bucket exporter and the upcoming peer-sync push pipeline reuse the same value (no per-bucket recomputation, no per-transport cache).insertUniverseWithId/insertSeriesWithId/insertIssueWithIdnow overwrite a tombstoned record (re-import undeletes) but still reject DUPLICATE on a live record.
Changed
- Default Claude CLI and TUI providers now ship with the undated model trio (
claude-haiku-4-5,claude-sonnet-4-6,claude-opus-4-7) and pinclaude-opus-4-7as the default model.data.sample/providers.json, the aiToolkit defaults (server/lib/aiToolkit/defaults/providers.sample.json), and the scaffolded-project providers inserver/routes/scaffoldPortOS.jsall match. Existing installs get the same shift via migration032-claude-default-opus-4-7.js, which only rewrites a Claude provider when itsmodelsarray still matches the previously-seeded dated list (*-20251001/*-20250929/*-20251101/claude-opus-4-6) — so a user who curated their own model list is left alone. reference-watchtask now appends slug-tagged[ref-watch-…]checklist items directly to PLAN.md instead of writing a standaloneREFERENCE_REVIEW.mdproposal file. Adopt-worthy commits become actionable PLAN items that/claim/plan-taskcan pick up; Maybe items get the same shape with a**Decision needed:**clause; security-flagged commits get no PLAN entry and are mentioned only in the final assistant summary. Prompt version bumped tov2; non-customized v1 prompts auto-upgrade on next schedule load.
Removed
- Top-level
/reference-reposglobal summary page and sidebar entry. Reference repos are now exclusively app-scoped — manage them via each app's "References" tab. Removedclient/src/pages/ReferenceRepos.jsx, the route + lazy import fromclient/src/App.jsx, the sidebar entry fromclient/src/components/Layout.jsx, and thenav.reference-reposentry fromserver/lib/navManifest.js(the manifest's shape-invariant tests cover the deletion automatically). Thecompact/initialRefsprops onReferenceReposPanelare gone since the global summary was their only consumer.
Fixed
- Instances page no longer claims
Universe: behind/Pipeline: behindfor peers that are actually converged via the per-record push pipeline. When per-record subscriptions cover a category, the 60s snapshot loop intentionally skips it, so thecursor.checksums[cat]water-mark freezes at whatever it was when the first sub was created. The UI'scursorChecksum !== remoteChecksumtest then flagged "behind" forever even though the push pipeline was keeping records in sync.SnapshotSyncBadgenow takes alivePushCoveredprop derived from the peer's actual subscriptions (universe-subs cover'universe',series-subs cover'pipeline'— mirrors the inverse map inpeerSync.js'sKIND_TO_CATEGORY) and renders a distinctlive-pushstate instead. The subscription fetch is lifted fromPeerSyncSubscriptionsSectiontoPeerCardso both children share one network call. - macOS "Enable HTTPS" on the Instances page failed with
tailscale cert failed: ... operation not permittedwhen the only Tailscale CLI on the machine was the Mac App Store / GUI app bundle. The MAS build runs under macOS App Sandbox and can't write the LE cert temp file outside its container. PortOS now: (1) reordersTAILSCALE_CANDIDATESinserver/lib/tailscale.jsso Homebrew (/opt/homebrew/bin/tailscale,/usr/local/bin/tailscale) is preferred over the App-bundle (kept as last-resort fallback); (2) detects the sandboxed-only state at boot via the newhasOnlySandboxedTailscale()helper and prints actionablebrew install tailscaleguidance fromscripts/setup-cert.jsbefore the doomedtailscale certcall; (3) rewrites the runtime EPERM toast inserver/services/certProvisioner.jsto point at the brew fix instead of surfacing raw sandbox stderr (newtailscale-sandboxedreason code); (4) on macOS,./setup.shnow detects the sandboxed-only state via the JS helper (single source of truth for the candidate paths) and unattended-installsbrew install tailscalewhen available, with printed guidance when brew is missing. Non-fatal in every branch. - Federated peer-sync category toggles for Universe and Pipeline silently no-op'd. The Zod
syncCategoriesSchemainserver/routes/instances.jswas missing both keys; Zod's default object parsing strips unknown keys, so the PATCH validated as an emptysyncCategoriesobject, the service-side merge became a no-op, and the checkbox stayed unchecked with no server-side error. Addeduniverseandpipelineto the schema to restore parity withDEFAULT_SYNC_CATEGORIESand the UI'sSYNC_CATEGORY_META. - Auto-run the world → universe data rename on server boot. The conversion previously shipped as a manual CLI script (
server/scripts/migrateWorldToUniverse.js) that nobody knew to invoke, so installs upgrading from the World Builder era kept staledata/world-builder.jsonfiles and never saw their worlds appear as universes. The new migration031-world-to-universe-data-rename.jsdoes the file rename, top-level key rename (worlds→universes),worldId→universeIdrewrite inpipeline-series.json,worldRun→universeRunrewrite inmedia-jobs.json, and also relinks any"World: <name>"render collections inmedia-collections.jsonto their universe by canonical-name match. - Universe Builder picker dropdown rendered beneath the tab subnav and downstream section cards in Lumen Glass / Blueprint Ops themes. Those themes ship a non-
none--port-backdrop-filter, and the global rule inindex.cssapplies it to every.bg-port-card.border.rounded*— which turns each such card into its own stacking context. The picker'sabsolute z-30dropdown was trapped inside the header card's context and couldn't paint over later sibling cards. Addingrelative z-30to the picker's<header>lets that stacking context win against subsequent siblings so the dropdown overlays them as intended. - TUI agent raw-PTY buffer no longer truncates the head at ~640KB ("⚠️ raw PTY buffer exceeded 1MB — head dropped"). The buffer feeds
analyzeAgentFailureat finalize, so silently slicing the head was the exact behavior the warning admitted to ("failure analysis may miss earlier symptoms").server/services/agentTuiSpawning.jsnow spools raw PTY bytes to a per-agentraw.txtfile in 250ms-debounced batches (mirroring the existing parsed-output pipeline that writesoutput.txt), so the in-memory footprint stays bounded regardless of run length.analyzeAgentFailurereads the tail of the file (last 1MB) on failure via a non-throwingreadFileTailhelper; successful runs skip the read entirely. The paste-marker poll keeps only a short-lived post-paste accumulator that lives for the paste window. A 256MB disk safety valve truncatesraw.txtif a runaway agent exceeds the cap (preserves the most-recent bytes thatreadFileTailactually consumes; warns once and sets arawSpoolTruncatedagent-metadata flag). The oldrawBufferTruncatedflag is gone with the in-memory truncation logic. - MortalLoom iCloud reads now survive macOS Optimize-Mac-Storage evictions. The prior fix tolerated
EAGAIN/-11 frombird's coordination locks by warning + returningnull, but every dashboardProactive Alertspoll (every 2 min viauseAutoRefetch) still surfaced the warning whenever the file had been evicted:existsSyncreturns true on a placeholder, thenreadFiletriggers an async download that doesn't return inline, so the read fails with EAGAIN.server/services/mortalLoomStore.jsnow (1) retries every transientreadFile/writeFile/statup to three times with 50ms then 100ms backoff before falling through to the warn path — covers the common <200ms coordination/materialize windows so transients are invisible to the UI; (2) firesbrctl download <path>against the configured store path at server boot (and again wheneversettings:updatedflips MortalLoom sync on or changes the path) so macOS pre-materializes the file. Note thatbrctl downloadonly triggers the download — it does not set a persistent "Keep Downloaded" flag (that requires Finder, or undocumentedbrctl unevict), so re-eviction under future disk pressure is still possible; the retry path is what guarantees the hardening, the pre-materialize just collapses the first-read latency. Best-effort and macOS-only — non-darwin and missing-brctlenvironments fall through to the retry path. Disabling sync clears the dedup cache so a later re-enable with the same path re-materializes instead of silently no-op'ing. GET /api/digital-twin/identity/goals(and any other identity read that consults MortalLoom iCloud sync) 500'd withUnknown system error -11, readwhen the MortalLoom.json file in the iCloud ubiquity container was momentarily unreadable — typically while iCloud was mid-sync, downloading, or resolving a conflict.readStore()andgetStatus()inserver/services/mortalLoomStore.jsnow catch the transientreadFile/statfailure, log a single warning with the errno, and returnnull/ a null-summary response (matching the existing "file not present yet" path). ENOENT races betweenexistsSyncandreadFile/stat(file disappears mid-call) are treated as silently absent rather than transient — no warning noise, andgetStatus()reportsexists:falseinstead of falsely reportingexists:true,size:0.updateStore()resolves the path once and threads it through both the read and the write so a settings change mid-call can't desync the overwrite guard from the actual write target; it also refuses to overwrite when the parsed store isn't a plain object (array/primitive) soJSON.stringifycan't silently drop named properties. Read consumers (mlArrayIfEnabled,mlGetProfileIfEnabled,readDailyLogIfEnabled,mlIdAtDateIndex) already handlednullas "fall through to local PortOS data," so the goals endpoint now serves local data instead of 500ing.