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: rewrite NEXT.md as concise end-user release notes
Adam Eivy0ccd7b827bad
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 377192bbbb..e1a4027a78 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -1,53 +1,34 @@# Unreleased Changes## Added-- **[local-llm-backend-management] Local LLMs — pick a backend at setup, manage models, and migrate between Ollama and LM Studio.** Setup now asks whether you want **Ollama** or **LM Studio** for local on-device models and installs the chosen one if it's missing (`scripts/setup-llm.js`, wired into `npm run setup`; `npm run setup:llm` to run it standalone). The choice is recorded as `LLM_BACKEND` in `.env`, and the matching AI provider is auto-enabled on boot. A new **Settings → Local LLMs** tab (reachable from the sidebar, ⌘K, and voice) shows both backends' status, **one-click installs a missing backend** (Homebrew on macOS for both; the official script for Ollama on Linux; a download link elsewhere — with live installer output over the socket), can **start or stop Ollama directly** when the local server is installed but not running, makes clear **both backends can run at the same time** — the **Default** marker (formerly the misleading "Active" badge, which read as a running-state indicator) just picks which one PortOS routes local runs to, and **Set as Default** changes it without moving anything — and lets you **move models between the two in either direction, independently of the default**: the GGUF weights are portable (only the on-disk *layout* differs — Ollama's content-addressed blob store vs LM Studio's plain file tree), so each backend card's **Import from…** action offers **Link** (hardlink the GGUF so both backends share one file on disk — zero extra space, falling back to a copy across filesystems) or **Copy** (an independent duplicate), with **no re-download** either way; models that can't be shared/copied — LM Studio MLX-format, sharded, or (when targeting Ollama) multimodal — re-pull the cross-backend catalog equivalent. It also manages models like the LoRA/Media-Models pages do: a curated cross-backend catalog bucketed by **Reasoning**, **Coding**, **Image Analysis**, **Text Embeddings**, **Chat**, **Small & Fast**, and **Multilingual**, with current Hugging Face GGUF/MLX recommendations (including Devstral Small 2, Ministral 3, Qwen3 4B, Granite 3.2, Gemma 3 270M, GLM-4.6V Flash, and Nomic Embed v2 MoE), search, one-click install, free-text "pull by name", and delete — with live pull progress over the `localLlm:progress` socket. Server side: `server/services/ollamaManager.js` (native Ollama HTTP API + local GGUF import via `/api/create`, with link mode pre-placing a content-addressed `blobs/sha256-…` hardlink so create dedups against it), `server/services/lmStudioManager.js` (hardlink-or-copy GGUF into LM Studio's model tree), `server/services/localLlm.js` (unified orchestration + `.env` default marker + provider enabling + bidirectional link/copy migrate, decoupled from the default), `server/lib/localLlmCatalog.js` (pure catalog + install-id mapping), `server/lib/localLlmDisk.js` (pure on-disk GGUF/manifest reasoning for the local-share/copy fast-path), and `/api/local-llm/*` routes.-- **[codex5-onboarding-capability-map] Capabilities page — every connected system at a glance.** A new Capabilities page (under System) shows the status of each integration on one screen: AI Providers, Calendar, Brain & Memory, Voice, Tailscale & HTTPS, Genome & Health, Telegram, Messages, and Apps & Processes. Every row says whether it's set up and healthy — Ready, Degraded, Error, or Not set up — and links straight to its settings, so the page works as both a first-run setup checklist and a quick runtime health overview. Reachable from the sidebar, ⌘K, and voice.-- **Federated media collections + per-category sync integrity.** Media collections are now a first-class peer-sync record kind (`mediaCollection` in `PEER_SUBSCRIBABLE_KINDS`, schema-version-gated at `mediaCollections: 1`): they auto-subscribe on create, push per-record on edit, and propagate deletes via tombstones — collections now reach parity between federated machines the way universes/series already did, instead of only riding along as `linkedCollection` cargo or the opt-in 60s snapshot. Required adding soft-delete to collections (`deleted`/`deletedAt`; `deleteCollection` marks instead of splicing; `listCollections({ includeDeleted })`; tombstone-aware LWW merge; tombstone GC), so a delete on one node can't be resurrected by a reverse-subscribed peer. Synced images now carry their **generation prompts**: the peer asset manifest advertises a canonical gen-params-only `sidecarSha256` (machine-local hash-cache stripped so it converges across peers), and the asset-pull worker fetches each image's `.metadata.json` sidecar alongside the bytes — fixing images that previously landed in "Unsorted" with no prompts. A new per-category **sync integrity** surface (`GET /api/peer-sync/manifest`, `GET /api/peer-sync/integrity`, pure `computeRecordIntegrity` diff) drives a `SyncBadge` on every Universe / Series / Media-Collection row (in-sync / diverged / assets-missing / local-only / on-peer-only / "not syncing — enable?") plus a deep-linkable `SyncDetailDrawer` (`/…/:id/sync`) showing the per-peer breakdown, previews, and manual actions: **Sync to peer** (`POST /sync-record`, force-push bypassing the unchanged-hash short-circuit), **Sync now** (`POST /sync-now`, backfill-subscribe + retry a peer's pending pushes), and **Pull missing prompts** (`POST /pull-metadata` + a button on the Unsorted view that backfills sidecars from online peers). `mediaCollections` sync stays **opt-in** per peer (default off); the badge surfaces a clear "enable?" state rather than flipping the default.-- **Manual tombstone GC trigger.** The 60s `syncOrchestrator` sweep buffers tombstones for 24h to give every peer time to ack a deletion before the bytes leave disk — fine for normal use, painful right after a mass-delete. New `POST /api/sync/tombstones/sweep` (Zod-validated optional `{ graceMs }` clamped to `[0, 24h]`) calls `sweepTombstones({ graceMs })` so callers can shrink the buffer; the per-kind null-cutoff refusal (snapshot-mode peer with no per-record subscription) still fires independently of `graceMs` to preserve resurrection safety. Companion `GET /api/sync/tombstones/status` returns the dry-run refusal status without invoking the prune helpers. A new "GC tombstones now" section on the Instances page (between SelfCard/AddPeer and the peers list) POSTs `graceMs: 0` and surfaces per-kind prune counts + any refusals in a toast; the button is disabled only when every kind is refused. `scripts/gc-tombstones-now.js` is the equivalent CLI path (dry-run by default; `--apply` to prune) for headless cleanups — uses the same "stop the server first, single-process write-tail isn't cross-process safe" wording as `cleanup-test-data.js`. `sweepTombstones` now returns `{ universes, series, issues, refused }` so the manual trigger can explain why a kind didn't shrink. The orchestrator path keeps the 24h default behavior unchanged.-- `server/lib/collectionStore.js` — per-type, per-record JSON storage helper with explicit type-level `schemaVersion` stamping. `createCollectionStore({ dir, type, schemaVersion, sanitizeRecord })` returns `loadOne` / `saveOne` / `listIds` / `loadAll` / `deleteOne` / `loadTypeIndex` / `saveTypeIndex` / `verifySchemaVersion`. Per-id write queue means writes to different records run in parallel — the win over a single-file write queue. `verifyCollectionVersions([store, ...])` is called at server boot after `runMigrations()` so a missed migration produces a loud, single-line log per collection (does not crash — PortOS is single-user).-- New layout `data/universes/{id}/index.json` for the universe builder, plus a type-level `data/universes/index.json` carrying `{ schemaVersion: 5, type, updatedAt, config: { runs } }`. Migration 034 (`scripts/migrations/034-split-universe-builder-to-per-uuid.js`) splits the legacy monolithic `data/universe-builder.json` (1.4MB / ~30 universes that previously rewrote in full on every mutation) into per-record files at boot. The legacy file is renamed to `universe-builder.json.bak-034` (not deleted) as a recovery path. Idempotent — partial-completion re-runs finish the split; full-completion re-runs are no-ops.-- **Cross-instance sync now gates on schema version.** New `server/lib/schemaVersions.js` is the single source of truth for the per-category storage-layout contract (`PORTOS_SCHEMA_VERSIONS = { universes: 5 }`); future category bumps add entries. Every outbound sync payload (federated peer push, 60s snapshot sync, share-bucket manifest) carries a `portosMeta { portosVersion, schemaVersions }` envelope. Receivers run `compareSchemaVersions(sender, local)`; when the sender is **ahead** on any category the receiver REJECTS — federated peer push returns 409 + `{ code: PEER_SYNC_SCHEMA_VERSION_AHEAD, context: { details: { ahead, behind, senderPortosVersion, receiverSchemaVersions } } }`, snapshot sync surfaces `blockedBySchema` on the peer record, share-bucket import skips the manifest with reason `portos-schema-ahead` and emits a `sharing:portos-schema-ahead` socket event. Senders persist the gap (`sub.blockedBySchema` on peer subscriptions, `peer.schemaGaps[category]` on peer records via `updatePeer`) and pause retries (5-minute cooldown; `peer:online` reconnect bypasses to re-probe in case the peer upgraded). Legacy senders without `portosMeta` pass through unchanged. The Instances page renders a new `<SchemaGapBadge>` per peer card explaining the gap in both directions: "Peer X is on an older PortOS — they need to update before we can sync universes" / "Peer X is on a newer PortOS — update PortOS to receive their universe updates." A "sender behind" mismatch DOES NOT gate — the existing sanitizer chain backfills older inputs.-- **Multiple, ordered code-review agents per task.** The custom-task form (`TaskAddForm`) and scheduled-task form (`ScheduleTab`) now expose an ordered multi-reviewer picker (new `client/src/components/cos/ReviewerPicker.jsx`) instead of a single reviewer dropdown: click reviewers to add them (run order = click order, numbered badges), reorder with ↑↓, remove with ✕, plus a **stop-mode** selector (`run all` / `stop on first fix` / `stop on first clean`) and a **reviewer-applies** toggle. Task metadata gains `reviewers: string[]` (ordered, replacing the single `reviewer`), `reviewStopMode`, and `reviewerApplies`; a read-side `normalizeReviewers()` (server `server/lib/validation.js` + client mirror in `constants.js`) keeps legacy single-`reviewer` tasks/schedules working. The agent prompts thread the list through as slashdo `--review-with a,b,c [--review-stop-on-findings|--review-stop-on-clean] [--reviewer-applies]` on the self-completion path, and the system-spawned review-loop follow-up agent runs each reviewer in the configured order (`buildReviewWithArgs()` builds the flag string; Copilot is pre-requested only when it *leads* the list — otherwise the follow-up requests it at its turn so it reviews the post-fix diff — and the follow-up still runs the CLI reviewers on non-GitHub forges where Copilot is unavailable).--- **Universes list/table index — CRUD all universes at a glance.** New `client/src/pages/Universes.jsx` lists every universe in a table (desktop) / card stack (mobile) with canon-entity count, linked-series count, last-updated, and per-row Share / Sync-to-peer / two-click delete (optimistic remove + rollback, no `window.confirm`) — mirroring the Series Pipeline index. Series counts come from a client-side join against `listPipelineSeries()` (reverse of the join `Pipeline.jsx` already does); canon counts sum the `characters`/`places`/`objects` trunks. The PipelineSeries "Open" link beside the Linked-Universe picker now opens the actually-linked universe instead of a blank builder.-- **[ltx-9x16-resolution] 9:16 vertical preset in the video generator.** The Video Gen resolution dropdown now offers `576×1024 (9:16)` — the true portrait mirror of the existing `1024×576 (16:9)` landscape preset — so vertical/social clips are a one-click pick instead of a manual custom size.-- **Richer Local-LLM model cards — age, real file size, RAM hint, and capability icons.** Each model card now shows: a **"published Xd ago"** age for Hugging Face results (reusing the shared `timeAgo` formatter; tooltip with the exact publish date + last-updated) — the server now carries the model's `createdAt` alongside `lastModified`; the **real GGUF file size** (the HF *search* endpoint omits per-file sizes, so the server backfills them from the per-model `?blobs=true` endpoint, cached per repo so the debounced search box doesn't re-fetch); an approximate **"~N GB RAM"** hint (model weights + ~20% overhead, rounded up); and model **capabilities as colored icons** (Vision/Code/Reasoning/Tool-use/Chat/Embeddings) in the LM Studio style, replacing the previous text labels — each icon keeps a `title`/`aria-label` for discoverability.-- **[wire-proactive-cos-speech-to-real-triggers] The assistant can now speak up on its own.** With proactive voice enabled, your Chief of Staff speaks first on three kinds of moments — a critical system error, a new task becoming ready, and a high-priority notification — instead of only talking back when you address it. Each kind is rate-limited on its own timer so a burst can't talk over you, and all of it still respects quiet hours and the proactive-voice switch.+- **Local LLMs — choose your engine and manage models in one place.** Setup now lets you pick Ollama or LM Studio for on-device models and installs it for you if it's missing. A new Settings → Local LLMs tab shows both engines' status, installs a missing one in a click, can start or stop Ollama, and lets you run both at once. Browse a curated catalog (reasoning, coding, image analysis, embeddings, chat, small & fast, multilingual) or search Hugging Face, install by click or by name, and move a model between the two engines without re-downloading it.+- **Capabilities page — every connected system at a glance.** A new page shows whether each integration (AI providers, calendar, brain & memory, voice, Tailscale & HTTPS, genome & health, Telegram, Messages, apps) is set up and healthy, with a direct link to fix anything that isn't. Handy as both a first-run checklist and an ongoing health view.+- **Media collections now sync across your machines.** Image collections stay in sync between your federated PortOS machines, including each image's generation prompts — so synced images no longer arrive with their prompt missing. Universes, series, and collections each show a sync badge, and a details panel lets you push to, pull from, or re-sync a specific machine. Collection sync is opt-in per peer.+- **See all your universes in one place.** A new Universes list shows every universe with its entity and linked-series counts and when it was last updated, and lets you share, sync, or delete each one inline.+- **Richer local-model cards.** Model cards now show how long ago a model was published, its real download size, an approximate RAM requirement, and its capabilities (vision, code, reasoning, tool use, chat, embeddings) as colored icons.+- **9:16 vertical video preset.** The video generator now offers a 576×1024 (9:16) portrait resolution alongside the existing 16:9 landscape — one click for vertical and social clips.+- **Run several code reviewers per task, in order.** When creating or scheduling a task you can pick multiple reviewers, set the order they run in, choose whether to stop after the first that finds (or clears) issues, and whether they apply their own fixes.+- **Your assistant can speak up on its own.** With proactive voice enabled, your Chief of Staff now talks first for a critical error, a newly ready task, or a high-priority notification — not only when you address it. Quiet hours are still respected.+- **Force-clear deleted records on demand.** After a big cleanup you can now purge deleted records immediately from the Instances page instead of waiting for the routine sweep.## Changed-- **[migrate-two-remaining-local-formatters] Consolidated duplicate date/time and duration formatters.** The calendar event-detail panel and the Chief of Staff task list now use the shared formatting helpers instead of near-identical local copies — no change to how event dates/times or task duration estimates appear.-- **[dedupe-hhmm-time-window-helpers] Shared time-of-day helpers.** Voice quiet-hours and time-windowed dashboard layouts now share one implementation for parsing HH:MM times and deciding whether the current time falls inside a window, so the two can't quietly drift apart.-- **[extract-compare-helpers-once-eight-callers] Shared dashboard refresh-dedupe helpers.** The dashboard widgets that skip needless re-renders when their polled data hasn't visibly changed now share one comparison implementation, so the dedupe logic can't drift between widgets.-- **Universe page route renamed `/universe-builder` → `/universes`.** `/universes` is now the list/table index; the editor lives at `/universes/:universeId`, and `/universes/new` is the create-mode entry point (the `UniverseBuilder` editor treats the `new` sentinel as no-id → blank draft; real ids are UUIDs so no collision). The "Universe" sidebar entry is relabeled "Universes" and points at the index; the editor header gains a "← All Universes" back link. Legacy `/universe-builder*` (and the older `/media/universe-builder*`) paths redirect to `/universes*` preserving search + `#canon`, so existing bookmarks and in-app deep-links keep working. The `/api/universe-builder/*` backend endpoints are unchanged. `useUniverseNav`'s exported `universeBuilderBasePath` is renamed `universesBasePath`; the nav-manifest entry + voice/`⌘K` aliases follow the new path.-- **Bumped the bundled `lib/slashdo` submodule v2.18.0 → v3.1.0.** v3.1.0's `/do:pr` / `/do:release` accept an ordered, comma-separated `--review-with` list plus `--review-stop-on-*` and `--reviewer-applies` flags — the slashdo capability this release wires into the task forms. Added `.claude/commands/do/` symlinks for the new `depfree` / `pr-better` / `scan` commands so the in-repo project slash-command set matches the vendored submodule.-- `data.sample/` renamed to `data.reference/` to reflect its actual role: the canonical reference / seed source consumed by `scripts/setup-data.js` (and by migrations that look up the post-migration shipped version of a file). The old name implied "optional samples"; the new name conveys "this is what `./data/` is bootstrapped from and compared against." All code, tests, and active docs (CLAUDE.md, README, docs/) updated; historical `.changelog/v*.md` entries kept as-is since they describe past releases. The `DATA_SAMPLE_DIR` constant in `server/index.js` is now `DATA_REFERENCE_DIR`; `sampleDir` in `setup-data.js` is now `referenceDir`.-- `server/services/universeBuilder.js` rewritten to consume `collectionStore` instead of `readJSONFile` + `atomicWrite` against a monolithic file. The per-entity `CURRENT_SCHEMA_VERSION = 4` (stamped INSIDE each universe record) is preserved unchanged — it describes record shape and is orthogonal to the new type-level `schemaVersion: 5` (storage layout). Cross-record state (`runs[]` history) moves to `data/universes/index.json` under `config.runs`. Per-record edits no longer serialize against unrelated universe edits — concurrent PATCHes on different universes now run in parallel.-- **[data-versioning-split-pipeline-issues] Split pipeline issues and series into collection stores.** `data/pipeline-issues.json` now migrates to `data/pipeline-issues/{id}/index.json` via migration 035, and `data/pipeline-series.json` migrates to `data/pipeline-series/{id}/index.json` via migration 036 so the pipeline area lands on one storage convention. The issue and series services now use `collectionStore` with boot-time schema verification, per-record saves for ordinary issue/series edits, series-scoped queues only where issue renumbering touches siblings, and sync snapshots read through the service APIs instead of monolithic files.-- `server/services/dataSync.js` universe-sync category points at the new `data/universes/` directory. `readFingerprintMap` walks two levels deep so per-record edits invalidate the cache; the dir layout's `index.json` mtime catches add/remove/edit at every nesting level. `getUniverseSnapshot()` reads via `listUniverses({ includeDeleted: true })` so peer sync sees the same set tombstones included.-- `data/history.json` is now `data/history.jsonl`. Migration 037 converts the legacy `{ entries: [...] }` wrapper into one JSON record per line, renames the old file to `history.json.bak-037`, and the history service now appends new actions instead of rewriting the whole file on each log. `server/lib/fileUtils.js` also exposes shared `appendJSONLine`, `readJSONLines`, and `writeJSONLines` helpers for other JSONL logs.-- `/work <task>` Claude Code slash command (`.claude/commands/work.md`) — slugifies the task, spins up a fresh git worktree under `.claude/worktrees/<slug>/` branched off local `main` (NOT current HEAD), `cd`s into it, carries out the work without disturbing the originating checkout's uncommitted edits / branch / HEAD, and on completion always chains `/simplify` → `/do:review --with codex,gemini` → `/do:pr --review-with copilot` so codex + gemini findings are addressed locally *before* the PR opens (otherwise Copilot kicks in immediately on unreviewed code and burns review cycles). Branch / dir collision auto-suffixes with `-2`, `-3`, etc. `.claude/worktrees/` is already gitignored.-- **Fork-aware update flow.** The PortOS update tab now detects whether the local clone's `origin` remote points at upstream `atomantic/PortOS` or at a personal fork (`server/lib/gitRemote.js` parses SCP-style + HTTPS + ssh:// remote URLs, case-insensitive owner/repo match). When running from a fork the Update tab swaps the "Update Now" button for three explicit choices: **Sync Fork & Update** (runs `gh repo sync <owner>/<fork> --source atomantic/PortOS --branch main` then proceeds with the local update — fast-forward only, so it refuses to clobber divergent fork commits), **Sync Fork Only** (sync without applying), and **Update from Fork As-Is** (skip sync, pull from your fork's origin — useful if you already merged upstream into your fork via your own workflow). The server `/api/update/execute` endpoint now gates fork runs behind either a fresh `lastForkSync` record (≤10 min, same fullName) or an explicit `acknowledgeFork: true` to avoid the silent "I clicked Update and nothing happened" failure mode when a fork's main is behind upstream. The release-check still polls `atomantic/PortOS` so fork users continue to see upstream version notifications. `POST /api/update/sync-fork` exposes the gh-sync action; a 409 with `FORK_DIVERGED` is returned when the fork's main has commits not on upstream, with guidance pointing the user at PRs / feature branches / the explicit `--force` escape hatch they can run from a terminal. `update.sh` / `update.ps1` now log the active origin URL so users can confirm in the update log which repo they actually pulled from.-- **[extract-layout-doc-io-helper-from-migrations] Shared helper for dashboard-layout seeding migrations.** Internal cleanup: the migrations that add new built-in dashboard widgets/layouts to existing installs now share one read/guard/write helper instead of each copying the same boilerplate, so future layout migrations stay consistent.--## Fixed-- **Deleting an LM Studio model no longer errors with `unknown command 'rm'`.** The delete path shelled out to `lms rm <model> -y`, but the `lms` CLI has no `rm`/`delete` command (and LM Studio's REST API exposes no delete), so every LM Studio model deletion failed. `lmStudioManager.deleteModel()` now removes the model's on-disk `<publisher>/<repo>/` folder directly — resolving an API id that differs from the downloaded repo (e.g. `openai/gpt-oss-20b` → `lmstudio-community/gpt-oss-20b-GGUF`) via a normalized repo-name scan — and prunes the publisher dir when it's left empty. The destructive delete is guarded so it can only ever remove a concrete `<publisher>/<repo>` folder strictly under the models root: traversal ids (`.`, `..`, `/`, `x/..`) are rejected, an ambiguous id that matches multiple variants (e.g. a `-GGUF` and an `-MLX-*` build) refuses rather than guessing, and an exact `publisher/repo` always wins over the fuzzy scan. A currently-loaded model is best-effort unloaded first so the running app isn't left serving deleted files, and the model cache is reset even on a partial failure so the list re-reads the real on-disk state. `localLlm.js` routes LM Studio deletes through it instead of the bogus CLI call.+- **Universe pages moved to a list at `/universes`.** The Universe section is now a list you open into individual editors; existing `/universe-builder` links still work.+- **Machines on mismatched PortOS versions won't corrupt each other.** If a peer is running a newer version with an incompatible data format, sync pauses and you'll see a clear note to update. Older peers keep working as before.+- **Fork-aware updates.** If you run PortOS from your own fork, the Update tab now offers explicit choices — sync your fork from upstream and update, sync only, or update from your fork as-is — and won't silently do nothing when your fork is behind. Update notifications still track upstream releases.+- **Faster, safer storage for large data.** Universes, comic issues, and series now save each record on its own instead of rewriting one big file, so edits are quicker and more resilient. Existing data is upgraded automatically on first launch.+- **Settings tabs everywhere.** The Providers and Prompts pages now share the same tabbed Settings header as the other settings pages, so you can move between them without going back to the sidebar.-- **Completed Claude TUI agents now show their final resolution again.** When a TUI agent wrote its `.agent-done` completion sentinel and then ran `/quit`, the process exited within milliseconds — long before the 2s sentinel poll fired — so the shell-exit path finalized the agent first and the poll bailed on `finalized`. The sentinel's markdown summary was therefore never appended to the agent's output, leaving the completed-agent details view blank. The sentinel read now happens inside `finish()` (the single chokepoint for every finalize path — `/quit`-exit, idle-timeout, and the poll), so the resolution is captured no matter which path wins the race. Extracted as an idempotent `ingestDoneSentinel()` helper; the poll watcher is now only an early-finalize trigger.--- **Background agent cleanup no longer removes an in-progress manual claim's workspace.** A long-running hands-on task could have its isolated workspace deleted out from under it by the periodic agent-cleanup sweep, which mistook the human-owned workspace for an abandoned agent one. The sweep now leaves manual-claim workspaces alone and only reaps truly abandoned agent workspaces, and it runs on the daily maintenance schedule instead of every 15 minutes.+## Fixed-- **Federated media-collection sync reconciliation + resolution UX.** Follow-up to the federated-media-collections feature, fixing issues found running it across two machines. (1) **Universe/series-linked collections now reconcile across peers.** Each machine used to mint a random UUID for its "Universe: X" / "Series: Y" collection, so per-record sync (keyed on `id`) treated each machine's copy as distinct — integrity reported both sides "local only" and the merge created a *duplicate* on every peer. Linked collections now derive a deterministic id (`uc-<universeId>` / `sc-<seriesId>`); create paths reclaim the id when a tombstone holds it (re-creating a deleted collection). Migration 038 canonicalizes existing ids on each machine, merging (union of items) any same-owner duplicates and rewriting `mediaCollection` subscription recordIds — idempotent; both machines converge independently. (2) **New "Pull from peer" action** (`GET /api/peer-sync/record` + `POST /api/peer-sync/pull-record`) lets a machine that is *behind* on a record fetch it and background-pull its asset bytes via `applyIncomingPush`, instead of "Sync to peer" being push-only; the Sync Details drawer is now direction-aware (Pull for peer-only, Sync for local-only, both for diverged/assets-missing). (3) **The Sync Details drawer can no longer hang on "Loading…"** — the record fetch gets a 12s timeout + explicit error state. (4) **Removed the unbounded "Live-pushed records" per-record list** from the Instances page (the Sync Details drawer covers per-record status). `mediaCollections` sync remains opt-in per peer — enable the "Media Collections" category on the Instances page for collections to sync.-- **[upcoming-tasks-widget-drop-catch-to-empty] Upcoming Tasks widget no longer blanks on a transient hiccup** — a momentary failure of the dashboard's Upcoming Tasks background refresh now keeps the last-loaded tasks on screen instead of clearing the list.-- **[propagate-runner-errorAnalysis-into-onRunFailed-context] Propagate `metadata.errorAnalysis` into the `onRunFailed` event context.** Runner-provided error analysis now rides the failed run result into `promptRunner`, so fallback provider marking reuses the category and wait-time already computed by the runner instead of analyzing the wrapper error again. The emitted `AI_PROVIDER_EXECUTION_FAILED` context also includes `errorAnalysis` for downstream auto-fix and diagnostics consumers.-- **`plan-task` agents now claim their own PLAN.md item instead of one the scheduler pre-picks.** The scheduled "plan-task" job used to reserve a PLAN.md slug at dispatch time and hand it to the agent as a hard constraint, but the actual lock (the `claim/<slug>` branch) isn't created until the agent runs — so two runs firing close together could both be handed the same first-available item, and one would waste its turn (the failure mode behind the 2026-05-21 duplicate-PR incident). The agent now picks the next unclaimed item itself at execution time and immediately creates the claim branch, exactly like the `/claim` command, so concurrent runs naturally land on different items. The dispatch-time scan is kept only as a gate that skips the run when nothing is claimable. Existing scheduled-task prompts auto-upgrade on next load (`plan-task` prompt v6 → v7); `feature-ideas` is unaffected.-- **Codex agents can now open PRs.** Codex CLI agents were spawned as `codex exec` with no sandbox/approval bypass, while Claude (`--dangerously-skip-permissions`) and Gemini (`--yolo`) got one — so Codex ran under the default sandbox that blocks network (its `gh pr create` couldn't resolve `api.github.com`) and, in non-interactive mode, silently cancelled any command needing approval. A Codex agent could push a branch over SSH yet fail to open the PR over HTTPS. Codex now gets `--dangerously-bypass-approvals-and-sandbox`, matching the other CLIs' unrestricted posture on PortOS's private single-user machine.-- **Non-Claude agents get a working "simplify" step.** `/simplify` is a Claude Code built-in slash command, so Codex/Gemini agents couldn't run the literal `/simplify` instruction baked into task prompts. The reuse/quality/efficiency self-review step is now phrased so any CLI can do it — Claude Code still runs `/simplify`, while other CLIs are told to do the equivalent diff review by hand. Applies to the scheduled-task templates and the per-agent completion sections.-- Providers (`/ai`) and Prompts (`/prompts`) pages now render the same Settings sub-nav tabbed header as the other settings pages, so users can hop between Backup / Database / General / MortalLoom / Prompts / Providers / Sharing / Telegram / Voice without going back to the sidebar. Extracted a shared `SettingsTabsHeader` component used by `Settings.jsx`, `AIProviders.jsx`, and `PromptManager.jsx`.-- **[test-autosubscribe-fanout-getpeers-guard-remaining] Apply the `getPeers → []` test stub to the remaining record-creating test files (and consider a shared guard).** Added `mockNoPeers()` to the shared test helper module and applied it across the remaining universe/series-creating suites, preserving the sharing tests' explicit identity stubs. Documented the convention in `CLAUDE.md` so new record-creating tests do not leak fixtures into live peer sync data.-- **Test fixtures no longer leak into the real `data/universes/` via peer-sync fan-out.** `createUniverse` fires a non-awaited `autoSubscribeRecordToAllPeers`, which reads the live peer registry through `instances.js#getPeers` — a `dataPath` closure that resolves to the REAL `PATHS.data` once the post-return microtask escapes a test's `fileUtils` mock window. Three universe-creating suites (`universeBuilder.test.js`, `universeBuilderPromote.test.js`, `universeCanon.test.js`) created non-ephemeral fixtures without stubbing `getPeers`, so their "Moebius SciFi" universes were pushed across the federation and persisted into real `data/` by receiving instances (and re-leaked intermittently on every run). Each suite now mocks `getPeers → []`, matching the existing guard in `importer.test.js` / `promoteToPipeline.test.js`.-- **[dashboard-active-layout-revert-tracks-server-confirmed-id] Failed dashboard layout switches snap back to the real active layout.** If two dashboard layout switches fail to save back-to-back, the dashboard now reverts to the layout the server last confirmed instead of getting stuck displaying one that was never actually applied.+- **Deleting an LM Studio model works again.** It previously failed with an "unknown command" error; PortOS now removes the model's files directly, with safeguards so only the intended model is ever deleted.+- **Finished terminal-agent sessions show their final summary again.** Agents that completed and quit immediately could leave the results view blank; the summary is now always captured.+- **Long-running manual tasks keep their workspace.** The periodic cleanup no longer deletes the working folder of an in-progress hands-on task.+- **Media-collection sync across machines is more reliable.** Linked collections no longer duplicate on each machine, you can pull a record from a peer that has a newer copy, and the sync details panel no longer hangs on "Loading…".+- **The Upcoming Tasks dashboard widget no longer blanks** on a momentary refresh hiccup — it keeps showing the last loaded tasks.+- **Failed dashboard layout switches snap back** to the layout that's actually active instead of getting stuck.+- **Scheduled planning agents no longer collide** on the same to-do item when two run close together.+- **Codex agents can now open pull requests** (previously blocked by a sandbox restriction).## Removeddiff --git a/.changelog/README.md b/.changelog/README.mdindex 8422f7f7bd..0f0d152503 100644--- a/.changelog/README.md+++ b/.changelog/README.md@@ -105,6 +105,9 @@ they care about this release.point of view.- **No "Touched:" / "New file:" / "Removed:" footers.** Those belong in commitmessages, PRs, or `git log`.+- **No `[plan-id]` slug prefixes.** Slugs like `[data-versioning-split-pipeline-issues]`+ are for grep-ability across commits, branches, and PR titles — keep them out of+ user-facing release notes.- **No internal data shapes.** "Each Work now carries `imageStyle = { presetId,prompt, negativePrompt }`" should be "Each Writers Room work can pin a worldstyle preset that prefixes every scene's image prompt."