Skip to content

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

120 KB
Raw Blame

Release v2.25.0

Released: 2026-07-01

Highlights

  • MeatSpace POST — a full cognitive-training overhaul. Six new deterministic drills (N-Back, Digit Span, Stroop, Schulte Table, Mental Rotation, Reaction Time), spaced-repetition scheduling that resurfaces memory items when they're due, opt-in adaptive difficulty for mental-math, a Morse trainer with a new Head Copy mode that logs to your training streak, an at-a-glance progress strip (current streak, 7-day trend, weakest-domain focus), a responsive analytics History dashboard, all 14 LLM drill types exposed in a domain-grouped config, and an optional daily reminder that follows timezone changes and catches up after a restart.
  • Music Video production mode grew up. Import a track's audio straight from a YouTube URL, a beat-quantized timeline arranger that drag-snaps scenes to the beat grid, auto-arrange scenes across song sections by energy, an autonomous shot planner that proposes a scene per song section, and deep-linkable project scene boards.
  • Creative Director autonomy. Auto-cast can now optionally write a first-pass treatment + scene plan, queue on-model portrait renders for newly-cast members, and generate a first-pass background-music bed — all grounded in your Catalog, and never clobbering work you already have.
  • Security hardening. Closed a DNS-rebinding TOCTOU in the SSRF guard (the vetted IP is now pinned at connect time), fixed three arbitrary-file-read paths in the vision/run endpoints, hardened backup restore/delete path validation, stopped the Settings API returning HuggingFace/Civitai tokens, and resolved active npm-audit CVEs in the protobufjs and ws chains.
  • App-wide theme consistency. A large sweep moved charts, button hovers, terminal panels, and AI-feature accents onto the theme's --port-* tokens across Digital Twin, Chief of Staff, Brain, Goals, Messages, Agents, MeatSpace, the CyberCity HUD, shared UI primitives, and most pages — plus a new --port-accent-2 (purple/violet) semantic token. Charts now recolor live when you switch themes.
  • Config drawers, tabbed. Edit App, the Chief-of-Staff task config, Media Generation Settings, and the pipeline image-gen drawers are now organized into deep-linkable tabs (shareable via URL, with a mobile <select> fallback) instead of one page-length scroll — codified as a project-wide convention.
  • Self-update & restart reliability. The in-app update/reconcile no longer strands PortOS stopped (it now survives PM2's tree-kill via a double-fork), the self-restart no longer hangs at "stopping apps" and leaves the server down, and the Windows updater no longer aborts on normal git/npm progress output.
  • Chief of Staff — swarm claiming. Scheduled claim-issue tasks can now run in swarm mode: partition up to six mutually-independent open issues, fan out one worktree agent per issue, and serialize only the merges.
  • Federation reach. Music-video projects now ship their linked track (audio bytes + record) to a Music-Videos-only peer so remote renders no longer fail for missing audio, with the bundled track tombstone ack-tracked to close a narrow garbage-collection strand window.
  • Performance & hot-path hygiene. Removed blocking sync I/O from live SSE/socket paths, added timeouts to external model/metadata fetches so a hung endpoint can't stall callers, stopped global keydown/click listeners thrashing on every render, and wrapped unguarded async child-process handlers so a failed write can't crash the server.
  • Accessibility & mobile. Hover-only image/file actions are now reachable on touch devices, calendar and message action buttons meet the 44px minimum touch target, and content no longer clips behind the mobile browser's URL bar (dynamic-viewport dvh sizing).
  • Brain & CoS pagination + Windows CLI providers. The Brain and CoS-task list endpoints gained opt-in limit/offset pagination without breaking existing clients, and npm-installed CLI providers (OpenCode, Codex, Claude Code) now resolve and launch correctly on Windows — with process-tree kills so Stop actually stops them.
  • Docs, deps & internals. A full documentation audit fixed drift across the README and docs/; CI and releases moved to Node 24; the default Claude tier is now claude-sonnet-5; and a wave of refactors trimmed roughly 5,000 lines (shared stage-seed migration helpers, dropped the three-fenestra and sax dependencies, and declared toolkit extension points replacing runtime monkey-patching).

Self-Update

  • The in-app update/reconcile no longer strands PortOS stopped. updateExecutor launched update.sh with a plain spawn(..., { detached: true }), assuming it would survive the restart phase — but PM2's TreeKill walks PPID, not the process group, so the moment the script's own pm2-stop step ran pm2 delete ecosystem.config.cjs, the script (still a PPID-child of portos-server) was killed along with the server. Every app was stopped and the only process that would have run the final pm2 start was dead — the "update/reconcile shuts everything down but never comes back" failure. On POSIX the script now launches through spawnDetached()'s double-fork (the same reparent-to-init machinery LoRA training uses to survive PM2 restarts, #1332), with STEP: progress streamed via the control-dir log tailer, so the update runs to completion and restarts PortOS even after the server dies mid-script. Windows keeps its prior plain-spawn behavior (PM2 there is taskkill-based; detached survival is a POSIX-only guarantee). (server/services/updateExecutor.js)

CI

  • CI and release workflows now run Node 24.x (matching .nvmrc, which has pinned 24 while the workflows still ran 20.x). Also removed the stale v1.14-era GSD planning workspace (.planning/, .plan-questions.md) from the repo root — the milestone it tracked shipped in February and GSD is no longer in use for PortOS itself (the GSD feature for managed apps is unaffected; it simply no longer lists PortOS).

Documentation

  • Full documentation audit — accuracy, organization, and a master index. Six parallel audits verified every doc against the current code and the drift is now fixed. Highlights: docs/API.md corrected (the four /api/agents/* sections and the scaffold/templates section had wrong base paths, the stale CoS scheduled-scripts section is replaced by the real /cos/jobs surface, dead Socket.IO events — detect:stream, errors:subscribe, cos:status/cos:log/script:*/cos:memory:* — replaced with the real ones, and a complete route-domain index of every mounted /api/* prefix added, pointing at the OpenAPI spec on /api-access); the PostgreSQL-primary reality (June ADR) now reflected everywhere it was missing (README.md tech stack + contributing notes, GOALS.md non-goals, docs/ARCHITECTURE.md diagram/storage tier, docs/CONTRIBUTING.md prerequisites, docs/TROUBLESHOOTING.md database section, docs/features/memory-system.md storage story); docs/DEPS.md tables resynced to the real dependency lists (sax removed via #1824, portos-ai-toolkit vendored in-tree, googleapis → scoped @googleapis/*, missing pdf-lib/sharp/undici + client test deps + full override-pin list added); docs/GITHUB_ACTIONS.md now describes the actual CI jobs (Postgres service container, test:ci/test:db:ci, client tests, smoke boot, client lint); stale service/page paths fixed across the feature docs (digital-twin.js, promptService.js, PromptManager.jsx, /api/detect/port, JIRA sprint manager's move to the Schedule system, unbuilt M35 Phase-5 services marked "(not built)", shipped-status notes on the OpenClaw spec/audit); ecosystem.config.cjs docs (docs/PM2.md, docs/PORTS.md, docs/ARCHITECTURE.md) updated to the top-level PORTS convention and the real portos-ui process name. Organization: new docs/README.md master index (linked from the root README), convention READMEs for docs/decisions/, docs/research/, and docs/superpowers/, the brain build-plan artifacts moved from docs/features/brain/ to docs/plans/, the undated research review date-prefixed, and docs/SECURITY_AUDIT.md labeled as the historical 2026-02 snapshot it is (title year typo fixed). README also gained the missing feature bullets (Music Studio, Music Video, Mood Boards, Catalog, Tribe, Morse/CW trainer) and the previously unlinked docs (DEPS.md, GOALS_OPERATIONAL.md, claude-ollama.md).

AI Providers

  • MeatSpace POST wordplay drills no longer cold-bootstrap LLM calls on server boot. initDrillCache() fired at every server start and, on a fresh install (empty on-disk cache), silently kicked off a sequential 40-call backfill (4 drill types × up to 10 batches each) — visibly slow and surprising when the active provider was a TUI-driven CLI, since each call pastes into a real claude/codex session and waits. Boot now only loads the existing on-disk cache into memory (zero LLM calls); the bulk cache-fill only runs from a new explicit POST /api/meatspace/post/drill-cache/fill endpoint, gated behind a client-side consent modal (CacheFillConsentModal in WordplayTrainer.jsx) that names the provider about to be used and lets the user pick a different provider/model or skip straight to a single on-demand drill. Incremental top-ups after a cache has already been primed still run silently (triggerReplenish now no-ops on a cold/empty cache). See the new "AI Provider Usage Policy" section in CLAUDE.md — no PortOS feature should queue AI provider calls a user hasn't knowingly triggered, outside of automations the user explicitly scheduled.
  • [issue-1865] CLI provider runs now work on Windows — npm-installed CLI providers (OpenCode, Codex, Claude Code) ship as .cmd/.bat shims on Windows; a bare command name like opencode never resolves there because spawn()'s default shell:false doesn't apply Windows' PATHEXT search at all. The Test-provider button surfaced this as "Resolved 'opencode' to ... but it could not be executed" — and that diagnostic was itself hitting a second bug: where's first PATH match can be the extension-less POSIX shell-script stub npm ships alongside the real Windows wrapper (for Git Bash/WSL), which is never launchable natively. A new resolveWindowsExecutable (server/lib/bufferedSpawn.js) resolves a bare command to its actual .exe/.cmd/.bat path via a deliberately extension-aware filesystem search (skipping that stub). Critically, a resolved .cmd/.bat target still cannot be launched directly under shell:false even with the explicit extension — Node's CVE-2024-27980 patch makes spawn()/execFile() refuse batch files outright rather than safely auto-wrapping them — so a new prepareWindowsSafeSpawn wraps a batch target through Node's own documented-safe pattern, cmd.exe /c <path> <args> (a native .exe target is launched directly, unwrapped). Because cmd.exe is itself a normal native executable, Node's existing, already-tested non-shell argv escaping governs the result — correctly preserving spaces in each argument (including a multi-word vision-captioning prompt) — with none of shell:true's DEP0190 hazard (shell:true with an args array does not escape arguments, it just space-joins them, so it was rejected as the fix here). This applies to the runner's spawn call, the vendored toolkit's built-in fallback, the autofixer/calendar-sync CLI runner, the vision-captioning CLI runner, and testProvider()'s version probe (fixing the Test button's literal reported scenario). Because a .cmd/.bat target routes through an intermediate cmd.exe process, a plain SIGTERM only kills that wrapper and orphans the real CLI process; every kill path for these processes (timeout, fallback-signal abort, Stop Run) now uses a taskkill /T /F-based process-tree kill on Windows (killProcessTree, extended to mark .killed synchronously and to skip non-ChildProcess killables like a node-pty TUI session, which has its own native teardown) and a plain SIGTERM elsewhere, unchanged. (#1865)
  • [claude-default-sonnet-5] Default Claude CLI/TUI providers now use claude-sonnet-5 for the medium tier. The seeded claude-code, claude-code-tui, and both *-bedrock providers ship the new sonnet tier (claude-sonnet-5, Bedrock us.anthropic.claude-sonnet-5) in place of claude-sonnet-4-6, and the Anthropic model-refresh dropdown lists it first. Migration 153 bumps existing installs' sonnet tier from claude-sonnet-4-6 → claude-sonnet-5 — rewriting the models list and swapping any tier pointer still on claude-sonnet-4-6, while leaving customized model lists and still-current pins (opus-4-8, haiku-4-5) untouched. The claude-sonnet-5 context window (1M) is registered in both the server (stageRunner.js) and client (utils/providers.js) model maps. (data.reference/providers.json, server/lib/aiToolkit/defaults/providers.sample.json, server/routes/scaffoldPortOS.js)

Apps

  • [issue-1968] The "Edit App" drawer is now organized into tabs. The app-edit panel was a single page-length scroll of ~25 fields plus two ad-hoc collapsible accordions (JIRA, DataDog); it's now a wider (size="lg") tabbed drawer split into General (name, icon, repo path), Ports & TLS, Commands (start/build/PM2/editor), Workflow (work tracker + worktree/PR defaults), JIRA, and DataDog — so no single section requires excessive scrolling and the form breathes. The active tab deep-links via a ?appTab= URL param (shareable/bookmarkable, reload-safe) and collapses to a <select> on mobile. All field wiring, validation, and save behavior are unchanged — this is a layout reorganization only — and every field is now wired with an htmlFor/id label pairing. The drawer still refuses to dismiss on Esc / backdrop click so an accidental keystroke mid-edit can't discard the form. (client/src/components/apps/EditAppDrawer.jsx, Closes #1968)

Brain & CoS API

  • [issue-1835] Brain & CoS list endpoints now support opt-in limit/offset pagination — GET /api/brain/people|projects|ideas|admin|memories and GET /api/cos/tasks previously returned their entire backing store with no bound, while sibling endpoints (GET /api/brain/links, GET /api/memory) already exposed pagination envelopes. Each of these endpoints now accepts limit/offset query params: when neither is present they return the exact same shape as before (raw array for the brain collections; the { user, cos } grouped structure for tasks), so every existing client keeps working; when a pagination param is passed they return a bounded { <collection>, total, limit, offset } envelope — and for /api/cos/tasks the paginated branch windows each source's tasks array, adds a pagination block, and drops the full-set derived collections (grouped, autoApproved, awaitingApproval) so the response is genuinely bounded rather than re-leaking the whole queue. limit defaults to 50 and is clamped to 500. Shared isPaginationRequested / paginateArray helpers were added to server/lib/validation.js alongside the existing parsePagination. (#1835)

Chief of Staff

  • [issue-1971] The task config drawer is now organized into tabs. The Chief of Staff schedule tab's per-task config panel was a single flat scroll grouped only by <h4> headers; it's now a tabbed drawer split into Stage config (per-stage provider/model), Global defaults (schedule/provider/prompt controls), and Per-app overrides — so no single section runs off the bottom of the panel. The Stage config tab only appears for pipeline-backed tasks and the Per-app overrides tab only when there are active apps (each shows a count badge), so there's never an empty tab. The active tab deep-links via a ?taskTab= URL param (shareable/bookmarkable, reload-safe) and collapses to a <select> on mobile; the task identity header (name + badges) stays pinned atop every tab. All config wiring and per-app override interactions are unchanged — layout only — and the drawer still refuses to dismiss on Esc mid-save. (client/src/components/cos/tabs/schedule/TaskConfigDrawer.jsx, Closes #1971)

MeatSpace POST

  • [issue-1986] The POST launcher now fills the full desktop width. The Power On Self Test launcher (PostSessionLauncher.jsx) previously wrapped every card in a single ~672px column (max-w-2xl), leaving a large dead gutter on wide monitors. It's now a responsive main-plus-sidebar grid (lg:grid-cols-[minmax(0,1fr)_22rem], capped at max-w-6xl): the primary session flow — Today's Status, Session Mode toggle, Conditions, and the Start / Quick 5 Min buttons — stays in the left column above the fold, while the Mental Math / Wit & Memory drill summaries and Recent Sessions flow into the right sidebar. On mobile it collapses to a single readable column (Start buttons still prominent), the header action buttons wrap instead of overflowing, and the Start buttons stack on narrow screens. Layout-only — session start, Quick 5 Min, the Test/Train toggle, and condition tags are all unchanged. (client/src/components/meatspace/post/PostSessionLauncher.jsx, Closes #1986)
  • [issue-1987] The POST drill config now exposes all 14 LLM drill types in a responsive, domain-grouped layout. The Drill Configuration screen (PostDrillConfig.jsx) previously showed a single narrow column that only surfaced 5 of the 14 generatable LLM drills — so the entire Imagination family (What If?, Alternative Uses, Story Prompt, Invention Pitch, Reframe) plus Compound Chain, Bridge Word, Double Meaning, and Idiom Twist could be generated server-side but never toggled on for a session. All 14 are now shown as toggle cards grouped under Wordplay / Verbal Agility / Imagination section headers, laid out in a responsive grid (single column on mobile, up to three columns on desktop) instead of one page-length stack. Enabling any of them and saving persists via PUT /post/config and makes the drill appear in Full POST and Quick 5 Min sessions. (client/src/components/meatspace/post/PostDrillConfig.jsx, Closes #1987)
  • [issue-1990] The POST launcher now shows your progress at a glance — streak, trend, and weakest-domain focus. The Power On Self Test launcher (PostSessionLauncher.jsx) previously surfaced only "Today's Status" plus the last three raw scores, even though the server already computes rich analytics that never reached it. It now loads GET /post/stats (30-day and 7-day windows) alongside the config/session fetch and renders a compact analytics strip above the fold: a current streak card with the same 🔥/⚡/✨ glyphs as the dashboard Daily POST widget (plus your best streak), a 7-day average card with a trend arrow showing how the last week compares to your 30-day baseline, and a weakest-domain callout ("Lowest domain this month: Verbal Agility — 62 avg") derived from per-drill averages mapped to their training domain. A one-click Practice <domain> button starts a focused session running every enabled drill in your weakest domain — and it always targets a domain you actually have drills enabled for, so it can't dead-end. Everything degrades gracefully with no history (the strip simply doesn't render), and all existing launcher behavior — Full POST, Quick 5 Min, the Test/Train toggle, and condition tags — is unchanged. Extracted the shared domainLabel / computeDomainAverages helpers into constants.js (now reused by History). (client/src/components/meatspace/post/PostSessionLauncher.jsx, constants.js, PostTab.jsx, Closes #1990)
  • [issue-1988] POST History is now a responsive analytics dashboard. The History view (client/src/components/meatspace/post/PostHistory.jsx) was a single max-w-3xl column that stacked a lone overall-score line chart, a 3-up stat block, and the session table — surfacing only a fraction of what getPostStats already computes. It now fills desktop width and surfaces the full stats payload: a 4-up summary of Sessions / Avg Score / Current Streak / Longest Streak, a wide Score Trend line beside a horizontal Avg by Domain bar chart (each domain colored to match its text-*-400 domain class), and a Drill Breakdown card that groups every drill's average into per-domain progress bars — so per-domain and per-drill averages plus streaks are visible without opening a single session. The five training domains (Mental Math / Memory / Wordplay / Verbal Agility / Imagination) are derived from each drill's type via DRILL_TO_DOMAIN, because the runners persist coarse module keys (mental-math, llm-drills) rather than domain keys — so all LLM drills split correctly across Wordplay/Verbal/Imagination instead of collapsing into one bucket. Mobile stays single-column; the 7/30/90/All range selector still drives every panel from one fetch. (Closes #1988)
  • [issue-1989] POST Memory surfaces are now responsive. The Memory Builder, Practice, and Session Results screens were all pinned to a single narrow max-w-2xl column that wasted desktop width. Memory Builder (MemoryBuilder.jsx) now renders its saved items as a responsive card grid (grid-cols-1 md:grid-cols-2 xl:grid-cols-3) — each card lays out the item icon, title, line/chunk meta, and mastery badge above a full-width Practice button (with an aria-labeled delete for non-built-ins), while the create form and description stay in a readable max-w-2xl column above the grid. Memory Practice (MemoryPractice.jsx) widens the reading-oriented screens to max-w-4xl — the practice-mode picker (now a two-column card grid), Learn progressive-reveal, and Speed Run — while the active-recall focus steps (Sequence, Fill-in-the-Blank, Spaced Repetition) stay at a comfortable max-w-2xl for readability. Session Results (PostSessionResults.jsx) widens to max-w-4xl and lays the per-drill breakdown out in two columns on desktop. Layout-only: create/edit/delete, practice submission, mastery display, and score/breakdown rendering are unchanged; every surface collapses to a single column on mobile. (Closes #1989)
  • [issue-1995] POST Morse modes and reference tabs are now deep-linkable via the URL. The Morse trainer kept its mode (Copy/Send) and reference view (Tree/Length/List) in local useState, so — unlike every other routed POST sub-page — those views weren't bookmarkable, shareable, reload-safe, or reachable from ⌘K / voice. The selected mode now lives in the /post/morse/:mode route segment (Copy → /post/morse/copy, Send → /post/morse/send) and the reference tab in a ?ref=tree|length|list search param (via the shared useDrawerTab hook) — so the exact drill + reference you're looking at is the single source of truth in the URL and survives reload/share. A stale or deleted deep link degrades gracefully: an unknown :mode segment falls back to the mode-picker grid (not a blank panel) and an unknown ?ref value falls back to the Tree view. New NAV_COMMANDS entries (nav.post.morse.copy / .send / .tree / .length / .list) make "morse send", "morse tree", etc. reachable from the ⌘K palette and voice navigation. (client/src/components/meatspace/post/MorseTrainer.jsx, client/src/components/meatspace/tabs/PostTab.jsx, server/lib/navManifest.js, Closes #1995)
  • [issue-1996] The Morse Tree reference view is now a clear, fully-labeled tree. The Tree reference previously gave every branch equal-width columns — including missing ones — so a lightly-populated side of the tree could squeeze and visually displace everything above it, making the start node appear to sit under the "dit" side and making some letters (especially E and its descendants) hard to find. The tree now computes each node's position from its actual subtree size and draws it with connector lines, so the start node sits centered under "Start," every one of the 41 characters (A–Z, 0–9, and punctuation) is visible and labeled, and the live keying highlight during a Send drill only lights up a node once you've actually keyed to it.
  • [issue-1991] POST memory items now resurface on a spaced-repetition schedule. Memory items (songs, poems, speeches, sequences) tracked mastery but had no review cadence — practice was entirely user-initiated, with nothing telling you what to review today. Each item now carries a lightweight SM-2-inspired schedule (ease, interval, next-review date): finishing a practice session reschedules the item automatically — a strong, mostly-correct session pushes the next review further out, while a miss-heavy session resets it to "due now" so it comes back around immediately. The Memory Builder gains a Due Today (N) banner listing what's ready for review with a one-click Review Next, plus a small "Due" badge on each item that's ready; the count updates the moment you finish practicing. Existing items keep working unchanged — a migration stamps every pre-existing item with a "due now" default so nothing gets stranded — and a new GET /post/memory-items/due endpoint lists due items most-overdue first.
  • [issue-1992] Opt-in adaptive difficulty for mental-math POST drills. Math drill params (steps / maxDigits / maxExponent / estimation tolerancePct) were fixed values from config that never responded to how you were doing. A new Adaptive difficulty toggle in the Drill Configuration screen (default OFF, so existing installs are unchanged) makes each math drill nudge its primary difficulty knob from your recent scored performance: sustained high accuracy (≥90% over enough sessions) bumps it one step harder, repeated misses (≤50%) ease it back, all clamped to safe min/max bounds — and it won't move until it has enough scored samples to trust. The adjustment is a pure, unit-tested policy (server/lib/postAdaptive.js) applied server-side at drill-generation time, so manual config still wins whenever Adaptive is off. It's fully transparent: each math drill card shows the effective difficulty (e.g. "Adaptive: max digits 2 → 3 (harder · 94% recent)") via a new GET /post/adaptive-preview endpoint, so it's never a black box. (server/lib/postAdaptive.js, server/services/meatspacePost.js, client/src/components/meatspace/post/PostDrillConfig.jsx, Closes #1992)
  • [issue-1993] New deterministic cognitive drills — N-Back, Digit Span, and Stroop. POST spanned math, LLM, and memory drills but was missing classic non-LLM cognitive-training exercises. A new Cognitive domain adds three provider-free drills: N-Back (1/2/3-back working-memory matching), Digit Span (forward/backward sequence recall), and Stroop (name the ink color, not the word — attention/inhibition). Each is configurable in the Drill Configuration screen, playable in both Test and Train modes via a dedicated interactive runner, scored, and saved to your training history alongside every other drill — with zero AI provider calls. Scoring is recomputed server-side from the generated drill (never trusting the client) using a shared 80% accuracy + 20% speed blend, and the drills are picked up by Full POST and Quick 5 Min automatically. (Closes #1993)
  • [issue-1997] Morse Trainer now logs practice to your POST training streak, plus a new Head Copy mode. Completing a Copy or Send round previously only updated the trainer's own localStorage prefs (Koch level, best round) — it never touched POST's training log, so Morse practice was invisible to the rest of the app. Every completed round/check now logs to the same training log other POST training-mode drills use, and the Settings panel shows your training streak plus Morse-specific sessions-logged/accuracy right next to the existing Koch-level readout. Also ships a new Head Copy mode alongside Copy and Send: identical Koch-progression practice, but with the on-screen morse-code hints and reference cheat sheet hidden, so you're copying purely from memory. Deep-linkable at /post/morse/head-copy and reachable from ⌘K/voice nav like the existing modes. Existing Copy/Send behavior and prefs are unchanged. (client/src/components/meatspace/post/MorseTrainer.jsx, server/lib/postValidation.js, server/lib/navManifest.js, Closes #1997)
  • [issue-1994] Optional daily reminder for your POST session. POST is meant to be a daily habit, but nothing ever nudged you to actually do it. A new Daily Reminder toggle in the Drill Configuration screen — off by default — lets you pick a time of day; if you haven't completed a session by then, you'll get a single in-app notification reminding you, and it stays silent once you've already practiced that day. Turning it off stops all nudges immediately. No AI calls are involved, and changing the time takes effect right away without a restart. (Closes #1994)
  • [issue-2008] Cognitive drills (N-Back, Digit Span, Stroop) no longer show a "Time Limit" field that did nothing. These three drills are self-paced/stimulus-driven and never counted down against it, unlike Mental Math and Wit & Memory drills, which genuinely do enforce their time limit. The dead field is removed from the Drill Configuration screen and drill summaries, along with the unreachable stimulusMs/showMs config pass-through (no UI ever set them — the drills always used their built-in pacing anyway). No behavior change to how the drills actually play. (Closes #2008)
  • [issue-2009] Hardened the N-Back / Digit Span / Stroop cognitive drills against silent scoring regressions. The result-assembly logic that turns your answers into the questions[] payload the server rescores from (N-Back's off-by-one-prone target lookup, Digit Span's forward-vs-backward comparison, Stroop's ink-vs-word grading) is now covered by focused unit tests, matching the test coverage the other POST drill runners already had. No behavior change. (client/src/components/meatspace/post/PostCognitiveDrillRunner.jsx, Closes #2009)
  • [issue-2010] Memory drills inside a POST session now count as a review. Practicing a memory item (Sequence or Element Flash) as part of a scored POST session previously updated your score but never touched that item's spaced-repetition schedule — so it stayed on "Due Today" even right after you'd just reviewed it, which only the dedicated Memory Builder practice screen would clear. A POST-session memory drill now advances the item's schedule the same way MemoryBuilder practice does (a strong session pushes the next review out; a miss-heavy one resets it to due-now), so "Due Today" and the review streak stay accurate no matter which screen you practiced from. (server/services/meatspacePost.js, server/services/meatspacePostMemory.js, client/src/hooks/usePostSession.js, Closes #2010)
  • [issue-2016] POST-session memory drills now also update per-chunk and per-element mastery, not just the review schedule. Follow-up to #2010, which only advanced the spaced-repetition schedule because POST-session answers didn't carry enough detail to attribute a right/wrong answer to a specific chunk or element. A Sequence or Element Flash drill now reports which verse/chunk or which element symbol each answer was about, so finishing a POST session updates the same "Mastery" percentages and per-chunk/per-element accuracy shown in Memory Builder — just like practicing directly there. (client/src/hooks/usePostSession.js, server/services/meatspacePost.js, server/services/meatspacePostMemory.js, server/lib/postValidation.js, Closes #2016)
  • [issue-2006] Three more Cognitive drills — Schulte Table, Mental Rotation, and Reaction Time. Rounds out the Cognitive domain from #1993 with the three follow-up exercises: Schulte Table (scan a shuffled numbered grid and tap 1, 2, 3... in order — visual attention and scan speed), Mental Rotation (pick which of four shapes is the reference shape rotated, not mirrored — spatial reasoning), and Reaction Time (simple or choice reaction-time baseline, with a false-start penalty for jumping the gun). All three are configurable, playable in Test and Train modes, scored, and saved to your training history alongside the rest of POST — with zero AI provider calls, same as the rest of the Cognitive domain.
  • [issue-2015] The daily POST reminder now follows timezone changes and catches up after a restart. Three follow-ups to #1994's reminder: changing your timezone elsewhere in Settings now reschedules the reminder to the new local time automatically, instead of it silently keeping the old offset until you next touch POST's own config; if the server was down (or mid-restart) when today's reminder was due, it now fires as soon as the server is back up rather than staying silent until tomorrow; and it's protected against sending a duplicate nudge if that catch-up and the normal daily tick ever land on the same day. No user-facing config changes. (server/services/meatspacePostReminder.js, server/services/meatspacePost.js, Closes #2015)

Media Generation

  • [issue-1969] Media Generation Settings is now grouped into tabs. The image/video backend settings surface — one long flat scroll rendered by the Image Gen, Video Gen, and Storyboard settings drawers — now groups its fields into a pills sub-navigation (Backend / External / Local / Codex CLI / Tokens / Expose / Test) that collapses to a <select> on mobile, so no single section is page-length. The grouping is internal to ImageGenTab (built on the shared TabPills), so it renders identically in every host drawer with no tabs-within-tabs; the active sub-tab deep-links via a ?mediaTab= search param (useDrawerTab) so an open section is shareable and reload-safe. The Save + Test Connection bar stays pinned below the tabs on every section. All existing controls, save/test behavior, and label wiring are unchanged. The Local tab is kept mounted (hidden) once visited so switching tabs during a long-running pip install (e.g. a 10-minute torch upgrade) no longer tears down its stream and cancels the install. (client/src/components/settings/ImageGenTab.jsx, Closes #1969)

Music Video

  • Deep-link straight to a project's scene board. The Music Video page's selected project now lives in the URL (/media/music-video/:projectId) instead of local component state, so a project's edit/scene-selection board is directly shareable, bookmarkable, and reachable from ⌘K, voice nav, and the media job-completion hooks — clicking a project navigates to its id'd route, deleting the open project returns to the index, and a stale/deleted id renders a "project not found → back to projects" fallback rather than a blank selection. Establishes the project-wide convention (now documented in CLAUDE.md) that every selectable UI element encodes its selection in the URL by id. (client/src/pages/MusicVideo.jsx, client/src/App.jsx)

  • [issue-1945] Import a track's audio straight from a YouTube URL. Both the project-create form and an existing project's detail view now have a "paste a YouTube URL" field next to the track picker (the detail view also gained the ability to change a project's linked track after creation, which wasn't previously possible at all). PortOS downloads the video and extracts just its audio via yt-dlp (a new host dependency — install it the same way you installed ffmpeg), lands it in the shared music library as a new Track, and links it to the project automatically. Progress streams live (download % → extracting → importing) with a Cancel button, mirroring the render job's progress UI. POST /api/tracks/import/youtube is a library-level endpoint (server/services/trackYoutubeImport.js, server/lib/ytdlp.js), so any project's track picker can reuse an imported track without re-downloading.

  • [issue-1854] Beat-quantized timeline arranger: drag-snap scenes to the beat grid. The director board's scene list now sits above an interactive beat-grid timeline (built from the project's cached audio analysis) showing section bands, beats, and downbeats. Drag a scene's right edge to trim how long it plays, or drag its body to reposition it — both snap to the nearest beat, downbeat, or section boundary within a small tolerance; an unsnapped drop is left exactly where you placed it. A confirmed (snapped) length-trim is marked beat-aligned and now renders exactly as arranged: the render's beat-snap step (beatSnapClips) honors a beat-aligned scene's saved startSec/endSec outright instead of re-deriving the cut from whichever beats happen to be nearby at render time — a reposition-only drag never marks a scene beat-aligned unless it already had a real, explicitly-set duration, so simply nudging a freshly-added scene can't silently crop its clip down to the timeline's placeholder length. Auto-arranging scenes across the song's sections by energy is filed as a follow-up (#1915). (Closes #1854)

  • [issue-1915] Auto-arrange scenes across song sections by energy. A one-click Auto-arrange button on the Music Video scene board distributes every scene across the analyzed song's sections weighted by each section's energy — louder sections get more (shorter) cuts, calmer sections get fewer (longer) ones — and writes the same persisted startSec/endSec/beatAligned fields the manual drag-snap arranger (#1854) writes, so the result is a director-tunable starting point honored exactly at render time. The offline audio analysis now records a normalized 0..1 energy per section (additive/optional — older cached analyses fall back to an even spread; re-run Analyze to populate it). The distribution is a pure, isolated helper — autoArrangeScenes(scenes, audioAnalysis) in client/src/lib/beatGrid.js (largest-remainder allocation by energy weight, interior cuts snapped to the beat grid) — unit-tested independently of the UI. (Closes #1915)

  • [issue-1855] Autonomous shot planner: AI proposes a scene per song section. A new AI Plan button (and POST /api/music-video/:id/plan) seeds the director scene board from the analyzed track in one click — one scene per audio section, with each scene's duration set to that section's exact span (energy-aware for free, since the cached sections already come from energy-novelty segmentation: louder, more eventful stretches were already split into more/shorter sections). It also best-effort asks the active AI provider for a first-pass framePrompt/shot prompt per scene from the project's concept and section context; a missing/disabled provider or an unparsable response degrades gracefully to plain, empty-prompt scenes rather than failing the request. Director-first — every seeded scene is an ordinary, fully-editable board entry, identical to a hand-added one. (Closes #1855)

Creative Director

  • [issue-1867] Auto-cast first-pass scene reference frames. Extends the opt-in first-pass gen step from #1818 (catalog portraits) one stage later: once a treatment exists (via auto-compose, or a later /:id/start), the director seeds a first reference frame per scene the same way it already seeds cast portraits — one image-gen job per scene, rendered at the project's locked-in aspect ratio, enqueued onto the durable media-job queue and filed onto scene.sourceImageFile (the same field a manual reference image or i2v-continuation source already populates) by a new creativeDirectorSceneImageHook, so the render lands even with no client mounted. The user's opt-in is persisted on the project independent of the compose toggle (the OverviewTab checkboxes are independent, and a project can be started later without re-composing in the same request). Idempotent (a scene that already has a reference frame is left alone), skips useContinuationFromPrior scenes (their actual source is the prior scene's extracted last frame at render time, so a seeded frame there would just be discarded), and only fires for queue-backed image-gen modes (local/Codex), mirroring the portrait path's graceful skip for external mode. The two remaining downstream modalities #1818 named — first-pass scene clips (image-to-video) and a first-pass music bed — are genuinely separate pipelines and are tracked as their own follow-up issues (#1927, #1928) rather than folded into this slice. (server/services/creativeDirector/firstPassGen.js, server/services/creativeDirectorSceneImageHook.js)

Dev Tools

  • [issue-1975] View system logs straight from a failed AI run. Failed runs in Dev Tools → AI Runs History now have a View System Logs button (both a quick icon on the collapsed row and a labeled button in the expanded error panel) that pops open the relevant PortOS system log — portos-cos for CoS-agent runs, portos-server for everything else — so an operator who doesn't know where the logs live can read the full error context without leaving the page. The log viewer includes a process picker and a tail-length selector, and is a reusable ProcessLogModal that any part of the app can open. (Closes #1975)
  • [issue-1946] Download full videos from a YouTube or x.com URL. A new Dev Tools → Video Downloader page lets you paste a YouTube (video/shorts/youtu.be) or x.com/Twitter status URL and download the full video (not just the audio, which is #1945's job) via yt-dlp — the same host dependency the music-video track import already uses. The clip lands in your video storage as a distinguishable downloaded-<id>.mp4, gets an auto-generated thumbnail, and — because it's written as a source: 'download' entry into the shared video-history store — also shows up in your media gallery alongside AI-generated renders (no new "library" concept; the existing media asset index picks it up through the same completed-video path it already uses, and prunes it on delete). Download progress streams live (download % → merging → finalizing) with a Cancel button, and the page lists everything you've downloaded (thumbnail, title, source link, age) with delete. x.com/Twitter pulls are best-effort — login-walled or rate-limited posts surface a clear error rather than a generic failure. Long/huge downloads are bounded (≤1h, ≤2GB) so a livestream or archive URL can't eat disk unbounded. POST /api/devtools/video-download (server/services/videoDownload.js, server/routes/videoDownload.js) mirrors #1945's async-job/SSE pattern. (Closes #1946)

Federation

  • Peer sync polling now defers until Tailscale is actually connected. A machine that booted off-tailnet (e.g. a laptop with Tailscale stopped) would immediately start probing every configured peer's MagicDNS hostname, spamming the logs with ⚠️ Probe failed … DNS lookup failed for X — is Tailscale MagicDNS up? + escalating ⏳ Peer X backoff lines on a 30s loop. startPolling() now checks the Tailscale backend state at boot (new getTailscaleStatus/isTailscaleUp in server/lib/tailscale.js, which reads tailscale status --json — BackendState: "Running" vs "Stopped", so a mere "binary installed" check isn't mistaken for "connected"). When every enabled peer is tailnet-only (a *.ts.net MagicDNS host or a 100.64.0.0/10 CGNAT address) and Tailscale isn't connected, probing is deferred with a single 🌐 Peer sync deferred … line and a lightweight 60s watcher that starts the real probe loop automatically the moment Tailscale comes up — no manual "sync now" needed. A peer reachable without Tailscale (plain LAN IP or non-tailnet DNS host) is never deferred; it's probed immediately as before. Solo installs with no peers are unchanged (they never probe Tailscale at all). (server/services/instances.js, server/lib/tailscale.js)

Pipeline

  • [issue-1970] Pipeline image-gen drawers now group their settings into labeled sections. The "Reference image gen" (NounsStage) and "Comic page image gen" (ComicScriptStage) config drawers previously rendered the shared ImageGenSettingsForm as one flat scroll; they now show three organized sections — Backend, Model & LoRA, and Prompts & Style — so the backend picker, per-model controls grid, and prompt/style textareas are visually separated instead of running together. Both drawers open at the md size so the per-model controls grid isn't cramped. The organization is opt-in via a new grouped prop on ImageGenSettingsForm, so the form's in-page host (UniverseBuilder's Batch-render card) keeps its existing flat layout unchanged. All controls and save/apply behavior are preserved — this is layout-only. The Backend section is dropped (leaving just the "no backend configured" warning) when no backend is available, and the Prompts & Style section is dropped when both style fields and the preset picker are hidden, so no empty section card ever shows. (client/src/components/imageGen/ImageGenSettingsForm.jsx, client/src/components/pipeline/stages/NounsStage.jsx, client/src/components/pipeline/stages/ComicScriptStage.jsx) (Closes #1970)

Architecture

  • [issue-1878] CoS runner now wires the process-level unhandledRejection/uncaughtException net (defense-in-depth). The main server (server/index.js) already registered a process-level net via the shared setupProcessErrorHandlers() helper (server/lib/errorHandler.js) — but the standalone CoS runner (server/cos-runner/index.js), a separate long-lived PM2 process that spawns and supervises child agents, had none, so a stray async handler that rejected/threw outside the request lifecycle would crash it with Node's default unhandled output. The runner now calls the same shared helper, giving it the identical, already-tested convention: log via the emoji-prefixed console.error style, log-and-stay-alive on an unhandled rejection, and log-then-exit-cleanly on an uncaught exception (after flushing, so PM2 restarts a process that would otherwise be left in an undefined state and reaps any orphaned agents on boot). Reusing the shared helper (rather than rolling inline handlers) keeps the two long-lived processes consistent and routes arbitrary non-Error throw values through normalizeError, so the net can't itself throw on a reason with no .stack. This is the backstop for the per-handler try/catch wrapping done in #1825 — not a replacement for it. While wiring this up, hardened the shared helper's uncaughtException branch, which dereferenced error.stack on the raw thrown value — a non-Error throw (throw null) made the net itself throw, masking the original exception and skipping the clean exit/flush; it now guards error instanceof Error (mirroring the existing unhandledRejection branch). A regression test (server/process-safety-net.test.js) asserts the shared helper registers both handlers, that both entry processes wire it up, and that the uncaughtException listener tolerates a non-Error throw value. (Closes #1878)

Security

  • safeUrlFetch SSRF guard now pins the vetted IP at connect time, closing a DNS-rebinding TOCTOU — isPublicHttpUrlSafe resolved a hostname's DNS to validate it was public, but the subsequent fetch re-resolved the same hostname at connect time, so a rebinding host could answer a public address for the check and a loopback/link-local/cloud-metadata address for the actual connection, slipping past the guard. The guard now resolves once and the connection is pinned to that exact validated address via a per-request undici Agent whose connect.lookup always returns the vetted IP — while Host header and TLS SNI stay the original hostname, so cert validation is unaffected. Every redirect hop is still independently re-validated and re-pinned. (Low real-world exploitability — PortOS is single-user on a private network and URL sources are user-pasted Pinterest boards / stored feeds — but the connect-time re-resolution is now eliminated.) (#1859)
  • Resolved active npm audit CVEs in the kokoro-js → protobufjs chain and the client ws transitive — the server's [email protected] pulled protobufjs <=7.6.0 (GHSA-wcpc-wj8m-hjx6 DoS, GHSA-f38q-mgvj-vph7), and the stale protobufjs: 7.5.9 override sat inside the vulnerable range. Pinned kokoro-js to 1.2.0 (the audit-stated fix, still within the code's documented ^1.2.x compatibility window — KokoroTTS/TextSplitterStream exports unchanged) and bumped the protobufjs override to 7.6.3 in root + server/package.json. On the client, engine.io-client nested its own [email protected] (GHSA-96hv-2xvq-fx4p memory-exhaustion DoS) that the root ws: 8.21.0 override couldn't reach; added ws: 8.21.0 to client/package.json overrides. Both npm audit runs now report 0 vulnerabilities for these chains. (#1823)
  • Backup restore/delete path validation hardened — subdirFilter on POST /api/backup/restore was an unconstrained string interpolated into an rsync --include=${subdirFilter}/*** arg, so * could override the filter chain (restoring everything over live data) and ../foo could traverse out of the snapshot subdir; it now validates against a relative path pattern that rejects wildcard, .., and absolute-path segments, with a mirrored defense-in-depth guard in restoreSnapshot for non-route callers. deleteBackup previously validated filename.replace(/[.]/g,'') (so the real dotted filename was never checked, leaving only the startsWith(backupDir) guard) — it now validates the raw filename directly and explicitly rejects ... (#1822)
  • Settings API no longer leaks third-party API tokens — GET and PUT /api/settings redacted only the top-level secrets key, so imageGen.hfToken (HuggingFace) and civitai.apiKey were returned in full on both initial load and after any save. Both responses now run through a single sanitizer that strips those tokens (sibling config preserved), matching how the Settings UI already reads only token presence from the dedicated /image-gen/setup/hf-token-status and /loras/auth/civitai status routes. On-disk values are untouched. (#1821)
  • Vision-test endpoint no longer reads arbitrary files — POST /api/providers/:id/test-vision took imagePath straight from the request body, so a ../ traversal or absolute path could have any readable file base64-encoded and forwarded to the configured external vision provider. The image loader now allowlists imagePath to a real image basename under data/screenshots (via the canonical resolveScreenshot path resolver), rejecting traversal and absolute-path escapes before any file is read or forwarded. (#1820)
  • POST /api/runs vision screenshots no longer read arbitrary files — the same unsanitized-imagePath gap as #1820 lived in the vendored aiToolkit runner: screenshots[] was validated only as z.array(z.string()) and passed straight to loadImageAsBase64, which did imagePath.startsWith('/') ? imagePath : join(screenshotsDir, imagePath) — so { "screenshots": ["../../../../etc/passwd"] } (or an absolute path) could have any readable file base64-encoded and forwarded to the configured external vision provider. The untrusted POST /api/runs boundary now sanitizes screenshots[] via a new sanitizeScreenshotRefs helper that basenames each entry (collapsing both ../ traversal and absolute-path escapes, including the legitimate absolute paths the Runner UI uploads under data/screenshots) and enforces an image-extension allow-list, returning a 400 for any non-image / traversal reference before the run is created. The shared loadImageAsBase64 loader additionally basenames relative refs as defense-in-depth, while still passing trusted in-process absolute paths (e.g. Universe Builder gallery images under data/images, already validated by resolveImageSources) through unchanged. Kept self-contained — no imports out of the toolkit. (#1870)

Added

  • CoS claim-issue swarm mode — the schedule config (CoS → Schedule → Claim Issue, and the resolved claim-work flow) gains a Swarm Mode selector that runs each scheduled claim in slashdo /do:next --swarm mode: instead of claiming one issue per run, it partitions up to N (2–6) mutually-independent open issues, fans out one worktree subagent per issue (each running the unchanged single-issue claim → implement → review flow), and serializes only the merges. Configurable globally with a per-app override; GitHub/GitLab issue trackers only (plan-task / JIRA are a no-op). The swarm directive is prepended to the dispatched prompt only when enabled, so it's a pure opt-in wrapper with no prompt-default version bump; swarmCount is range-validated (0 = off, 2–6 = swarm size) in sanitizeTaskMetadata.
  • Creative Director auto-compose — the Overview tab's Auto-cast control now has a + treatment toggle (shown only before a treatment exists): with it on, once the director seeds the cast from the catalog it autonomously writes a first-pass treatment + scene plan grounded in that cast, instead of stopping at cast seeding. Director-first — the autonomous treatment is a starting point you keep editing on the same board, and it never clobbers an existing treatment. (#1817)
  • Creative Director first-pass portraits — the Overview tab's Auto-cast control gains a + portraits toggle: with it on, once the director seeds the cast from the catalog it queues an on-model portrait render for each newly-cast member that has no portrait yet, so the cast "arrives on-model" without hand-rendering each ingredient. Reuses the existing media-job queue and the durable catalog image-attach hook (the render lands as the ingredient's portrait even if you've navigated away), is strictly optional and idempotent (members that already have a portrait are skipped), and seeds only the queue-backed image-gen modes (local / codex) — external SD-API and a disabled codex are skipped gracefully rather than failing the auto-cast. (#1818)
  • [issue-1928] First-pass music bed — auto-cast can now optionally generate a first-pass background-music render for the project itself (a new 'audio' media-job kind backed by the existing local MusicGen/AudioLDM2/ACE-Step generators), landing on the project's musicBed field via a durable completion hook once the render finishes — even if you've navigated away. Skips gracefully when no local audio-gen engine is provisioned, and re-running auto-cast never clobbers an existing bed.
  • Shell page now has a Fullscreen button that promotes the terminal to a full-viewport overlay (above the sidebar), hiding the stacked header/tabs/quick-commands toolbars so the TUI gets the whole screen — a major mobile usability win where those toolbars previously ate most of the display. Fullscreen keeps a compact, horizontally-scrollable control bar (Exit, Ctrl+C, Paste, arrow/Enter keys) so you can still drive a TUI by thumb, and the Ctrl+C/Paste labels now collapse on small screens to save width.
  • OpenCode Ollama TUI provider for CoS tasks. The TUI completion workflow is now provider-aware: a slashdo-free TUI (OpenCode, which doesn't load Claude Code /do:* slash commands) gets a plain git + forge-CLI commit → push → open-PR-for-review → .agent-done sentinel handoff instead of /do:pr / /do:push, so an OpenCode TUI agent can actually complete an automated task. The manual path opens the PR/MR (GitHub gh or GitLab glab) for review without auto-merging. Ships opencode-ollama-tui to existing installs via migration 152. (#1814)

Windows updater

  • [issue-1811] Windows update no longer aborts on a successful git pull — the PowerShell updater (update.ps1) was treating normal git/npm progress messages (which those tools print to stderr, e.g. "From https://github.com/…") as fatal errors and stopping the update partway through. The updater now distinguishes real failures (by exit code) from routine status output, so updates run to completion on Windows. (#1811)

Fixed

  • Video download now works on a fresh install — startVideoDownload pointed yt-dlp at data/videos without ensuring the directory exists, so on a fresh install (where no prior render/import had created it) the very first download failed before producing a file. It now ensureDirs the target first, like every other video writer. (server/services/videoDownload.js)
  • Chief of Staff and Moltworld live updates now survive a socket reconnect — the server rebuilds an empty per-socket subscriber Set on every reconnect (laptop sleep, network blip, server restart), but both consumers registered their re-subscribe only conditionally: ChiefOfStaff attached its socket.on('connect', …) handler solely in the else branch (skipped when the socket singleton was already connected at mount) and useMoltworldWs emitted agents:subscribe once at mount with no connect listener at all. So after a reconnect the cos:* / moltworld:* events went dead until the component remounted — and the Moltworld feed has no polling fallback. Both now subscribe immediately when connected and re-subscribe on every connect, matching the established Shell.jsx pattern. (client/src/pages/ChiefOfStaff.jsx, client/src/hooks/useMoltworldWs.js)
  • Beat-snapping a right-edge timeline drag no longer commits a scene shorter than the minimum — computeDragSpan floored the out-point at startSec + minSceneSec before snapping to the beat grid, then overwrote it with the snap target unconditionally, so a beat sitting just below the floored end (within tolerance) could commit a span under the minimum scene length. The floor is now re-applied after the snap. Server-side beatSnapClips re-clamps at render, so this was a displayed/committed-span bug only; covered by a new regression test. (client/src/lib/beatGrid.js)
  • [issue-2022] Moltworld presence panel no longer shows phantom agents after everyone leaves — useMoltworldWs's handlePresence/handleNearby gated the state write on agents.length > 0, so an empty "nobody nearby" snapshot (forwarded verbatim from the external Moltworld WS) was silently dropped and the WorldTab "Nearby Agents" panel stuck on a stale agent list forever. Both handlers now validate Array.isArray(agents) and call setPresence unconditionally for a well-formed array, so a confirmed-empty event clears the panel. presence initializes to null (not-yet-known) rather than [], and WorldTab distinguishes the two: null falls back to the last REST join/explore list, while an empty array is a live "nobody here" snapshot that wins over the stale fallback. A malformed non-array payload preserves prior state. Covered by new hook tests. (client/src/hooks/useMoltworldWs.js, client/src/components/agents/tabs/WorldTab.jsx, Closes #2022)
  • PortOS self-restart / reconcile no longer hangs at "stopping apps" and leaves the server down — restarting the PortOS app (Apps → restart, or a reconcile) sends portos-server a SIGINT, but the graceful-shutdown handler hung forever, so PM2's default 1600ms kill_timeout SIGKILLed the process — and the tree-kill took the in-flight restart orchestration down with it, so the server never came back and had to be restarted by hand. Root cause: the handler called httpServer.close() after io.close(), but socket.io's io.close() already closes its current this.httpServer — and since every io.attach() reassigns that reference (socket.io index.js:303), with HTTPS enabled it's the loopback mirror, not :5555. Calling close() a second time on an already-closed server makes Node register the callback as a one-time 'close' listener for an event that already fired — so it never runs and the await blocks until the 10s force-exit timer (which PM2 pre-empted with SIGKILL). The rewritten shutdown(): force-drops long-lived SSE/keep-alive sockets with closeAllConnections() up front; closes socket.io + both HTTP servers idempotently (ERR_SERVER_NOT_RUNNING = already-closed = success), each behind a short bounded backstop so a WebSocket-upgraded socket that neither closeAllConnections() nor the server's connection tracker can reach can't stall the exit; bounds the DB-pool close() the same way (a leaked/LISTEN client can't hang it); and unref()s the force-exit timer so it can't itself hold the loop open. Graceful shutdown now completes in well under a second with the DB pool closed cleanly, every time (down from a 10s hang that ended in SIGKILL). As a backstop, portos-server also gains an explicit PM2 kill_timeout: 12000 (just above the app's own 10s force-exit) so even a future stall defers to the app's clean exit instead of an abrupt SIGKILL. (server/index.js, ecosystem.config.cjs)
  • [issue-1922] Music-video federation's bundled track tombstone is now ack-tracked, closing a narrow track-GC strand window — #1858 bundles a music-video project's linked track record (linkedTrack) so a Music-Videos-only peer (no track subscription) can resolve it, and a track delete fans the tombstone out the same way. But computeAckedDeletesFromPayload (peerSyncReceive.js) only looked at record/issues, never linkedTrack, so such a peer could never ack a bundled track delete through any cursor — and the sender's track-tombstone GC cohort (tombstoneGc.js) only ever waited on peers with a direct track subscription, so it was entirely blind to a musicVideoProjects-only peer regardless of the ack fix. Implemented option (a) from the deferred #1858 review: computeAckedDeletesFromPayload now folds in a bundled linkedTrack tombstone's deletedAt, and the track GC cutoff additionally folds musicVideoProject subscribers into its cohort, reading their confirmed-delivery floor off a new bundle-specific lastConfirmedTrackBundleAtMs (stamped only when the bundled track merge actually succeeded — not the generic lastConfirmedPushedAt, which advances even when the bundle failed or was stripped for a legacy peer). Local subscription-state addition only; no wire-payload shape change, so no schema-version bump. (#1922)
  • [issue-1858] Music-video federation now ships the linked track to a Music-Videos-only subscriber — a music-video project created the normal way stores a trackId with uploadedAudioFilename: null, so a peer subscribed to the Music Videos category only (not Music/Tracks) received the project and scene clips but no master audio, and its render failed with Linked track not found / AUDIO_MISSING. Because the receiver's resolveMasterAudioPath() looks the track up by id before touching any file, shipping the bytes alone wasn't enough — the push now bundles the linked track record itself (linkedTrack, merged via mergeTracksFromSync and gated by the same tombstone/opt-out rules as linkedCollection) and its audioFilename bytes in the music-video asset manifest. Additive optional payload key, so no schema-version bump and older peers ignore it; dedup-by-music:<filename> keeps a separately-federated track from double-shipping. A linked-track edit now also fans a push out to every music-video project that links it (so the bundled audio stays fresh on a Music-Videos-only peer), the receiver requires the bundle's id to match the project's trackId (no smuggling an unrelated track), and the bundle rides the push hash + schema gate + delivery-pending ack exactly like the existing linkedCollection/manuscriptReview bundles. (#1858)
  • [issue-1845] Client fetch hygiene — effect fetches now abort on cleanup and window is read lazily — StagePromptModelPicker fired two effect fetches guarded only by a cancelled flag, so rapid stageName changes wasted in-flight round-trips; it now passes an AbortController signal to both and aborts on cleanup. LocalSetupPanel's /setup/check fetch had no abort and its setChecking(false) finally could fire after unmount; it now aborts the prior/in-flight check (so a stale response can't clobber a newer one) and guards every state set behind a mountedRef. VoiceCapture read window.SpeechRecognition at module scope — a ReferenceError when the file is imported in an SSR/Node test context — now resolved lazily via a useState initializer that only runs in the browser. And useArmedAction's fire is wrapped in useCallback so memoized children stay stable. (#1845)
  • useEscapeKey/useClickOutside no longer thrash their global listener on every render — both hooks kept the caller's handler/onOutside in the effect dep array, so the window keydown/mousedown listener was removed and re-added on every parent render while open. Since most call sites pass a fresh inline arrow (() => setOpenCommentId(null)), that meant a full detach+reattach on every keystroke in editors like PipelineManuscriptEditor/AnnotatedManuscriptSection and on every render of SceneCard/WorkEditor/UniverseBuilder. Both hooks now read the handler through a ref (the same pattern useKeyboardShortcuts already uses), so the listener subscribes only when active (and, for useClickOutside, ref) changes while still always invoking the latest handler. Behavior-preserving; covered by new hook tests. (#1844)
  • Blocking sync I/O removed from request/completion hot paths — several syscalls ran synchronously on paths that serve live SSE/socket traffic, freezing the event loop for their duration. checkForTaskCommit (agentRunTracking.js) ran a spawnSync('git', ['log', …]) on the completion path of every failed CoS run (100ms–2s on a large repo); it now uses the async, hard-timeout bufferedSpawn. buildId.js statSync'd client/dist/index.html on every SPA navigation; the freshness check is now throttled to at most once per second (the hot path between checks is a clock comparison, no syscall), so a rebuild re-syncs the served HTML with the on-disk chunks within the throttle window instead of paying a stat per navigation. The avatar (routes/avatar.js) and attachment (routes/attachments.js) routes swapped existsSync/statSync for async fs.access/fs.stat (via a new canonical pathExists helper in fileUtils.js), and uploads now call the idempotent ensureDir directly. Separately, the tombstone-prune paths for authors/tracks/creative-director projects (DB + file backends) wrapped their per-record deleteSyncBaseHash loops in withBaseHashFlushBatch, collapsing N sync_base_hashes.json rewrites into one. (#1828)
  • External API model/metadata fetches now time out instead of stalling callers indefinitely — _fetchGeminiModels (Gemini model refresh in aiToolkit/providers.js) made a fetch with no AbortSignal, unlike every other provider model-fetch in that file, so a hung Google endpoint could block a model-refresh request forever; it now uses the same AbortSignal.timeout(8000). fetchCivitaiModel and searchCivitaiLoras (server/lib/civitai.js) likewise passed no signal, so a Civitai hang stalled LoRA metadata/search callers; both now default to AbortSignal.timeout(10000) and accept a caller-provided signal override. (#1827)
  • Absent-vs-cleared merge bugs that silently restored values the user just cleared — three spots conflated "field absent" with "field intentionally cleared to empty". A memory content edit now regenerates the summary and (file backend) reindexes BM25 via a shape-based gate (typeof content === 'string' / Array.isArray(tags)) instead of a falsy one that skipped both on an empty value and could crash generateSummary on a null/undefined content — fixed in both the file backend (memory.js) and the production Postgres backend (memoryDB.js) so they stay mirrored. (Empty memory content stays blocked at the API by memoryUpdateSchema's min(1), consistent with create.) A genuinely empty-body email refresh now overwrites the cached body instead of || collapsing back to the stale text (messageSync.js, both the thread-match and original-message paths). And clearing a CoS task's legacy direct field (context/model/provider/app) to "" now persists as "" rather than || undefined deleting the key — null still drops it (cosTaskStore.js). (#1826)
  • Unguarded async child_process handlers can no longer crash the Node process — several close/error event handlers were async and awaited disk writes / completion bookkeeping with no try/catch, so a single failed write (e.g. a full disk) or a throwing completion hook surfaced as an unhandled rejection and took down the whole server. Wrapped the at-risk handler bodies in server/services/runner.js (both close and error), videoTimeline/local.js, agentCliSpawning.js (both close and error), and both the CLI close handler and the detached processStream().catch in aiToolkit/runner.js. The recovery paths now still settle callers waiting on onComplete with failure metadata (so a finalization failure surfaces as a failed run instead of hanging forever), with the completion hook isolated from onComplete so a throwing onRunFailed can't block the caller from settling. Also replaced the two silent recovery-critical .catch(() => {}) swallows in cos-runner/index.js with logged failures so a lost completion-metadata write is visible instead of silently dropping a finished task. (#1825)
  • Catalog "Appears in" panel no longer renders dangling chips that deep-link to soft-deleted universe/series/creative-director targets — the detail page filters refs to live targets only (the orphan stays recoverable via the "Orphaned" album). Also fixed a stale resolver bug where soft-deleted Creative Director projects (#1564) wrongly resolved as live, and extended orphan-bucket detection so a deleted CD project's ex-cast surfaces as orphaned rather than unlinked. (#1812)
  • [issue-1836] Avatar GLB stream errors now return the standard error envelope — when GET /api/avatar/model.glb hits a read error mid-stream (e.g. the file is removed after the existence check), the 404/500 JSON response carried a bare { error } instead of the { error, code, timestamp } shape every other PortOS endpoint stamps via errorMiddleware. Since the stream error event fires outside the request promise chain (where a throw would crash the process), the handler now stamps code + timestamp directly, so clients see a consistent error shape. (#1836)

UX & Theming

  • [issue-1851] Charts, button hovers, and terminal panels now follow the active theme — several of the most-visible colors were hardcoded and stayed put when you switched themes. The health/meatspace charts (alcohol consumption, metric trend cards) drew their bars, gridlines, axes, reference lines, and tooltips with fixed hex values because chart SVG props can't read CSS variables; a new useChartColors() hook resolves the theme's --port-* tokens at render and re-resolves on theme switch, so charts now recolor with the rest of the app. The 13 primary call-to-action buttons across Goals, Story Builder, and Jira Reports used a hardcoded blue hover (hover:bg-blue-600) that diverged from a non-blue accent theme; they now hover as a shade of the active accent. The Chief-of-Staff terminal panel and the GSD/app document editors that hardcoded near-black backgrounds now use the theme's terminal-background token, and the Writers Room reading-mode ink color is centralized. (A broader sweep of the remaining ~900 off-token color utilities and a semantic purple token are tracked separately in #1909.) (#1851)
  • [issue-1909] New --port-accent-2 (purple/violet) semantic token, plus the rest of the recharts cards now follow the active theme — the remaining 8 chart files without useChartColors() (ActivityBloodCorrelation, AlcoholHrvCorrelation, BloodPressureCard, BodyCompChart, NicotineChart, NicotineHealthCorrelation, POST history, sleep stages) are converted, leaving every recharts site in the app theme-aware. Purple/violet/indigo had no --port-* equivalent, so AI-recommendation and secondary-emphasis highlights (Epigenetic Tracker's curated recommendations, the Chief of Staff "Learning: good" indicator) stayed a fixed purple regardless of theme; --port-accent-2 is now defined and tuned per-theme across all 8 PortOS themes. The cos/tabs/AgentCard.jsx JIRA ticket badge and link (base + hover) are remapped onto --port-accent. This is one bounded, reviewable slice of the ~900-site sweep — the remainder is tracked by feature area in #1924, including a caution against blindly remapping the several category-color enum files (e.g. GenomeCategoryCard.jsx, bucketColors.js) that use multi-hue palettes to differentiate categories rather than express theme drift. (#1909)
  • [issue-1924] Digital Twin theme consistency — remapped off-token colors across the Digital Twin UI (overview, identity, enrichment, taste, testing, goals, and the rest of its tabs) onto the existing --port-* theme tokens, so status badges, score gradients, and AI-content highlights now follow the active theme instead of staying a fixed hue. Per-platform/per-category color palettes that intentionally differentiate unrelated items (e.g. social-account platform badges, test-category badges) were left as-is. (#1924)
  • [issue-1909] cos/TerminalCoSPanel.jsx foreground+background re-themed together — the panel's background had been intentionally left pinned to a fixed dark hex because the inner content hardcoded light text and status colors, so swapping the background alone onto the (lighter, in day themes) --port-terminal-bg token would have rendered light-on-light. The background now uses that token and the inner text uses opacity tiers of the paired --port-terminal-text token — blending foreground into background keeps contrast correct whether the active theme's terminal surface is dark or light — while the traffic-light dots, status indicators, log levels, and start/stop buttons move onto the existing port-success/port-warning/port-error/port-accent tokens. Refs #1909 — the remainder of the ~900-site sweep stays tracked there.
  • [issue-1924] Chief of Staff panel theme consistency — remapped off-token colors across the Chief of Staff dashboard (task list, agent cards, memory/learning/productivity/health/digest tabs, schedule editor, terminal event log) onto the existing --port-* theme tokens, so status badges, metric highlights, and AI-content accents now follow the active theme instead of staying a fixed blue/green/cyan/purple. Fixed 7-hue category-color palettes that intentionally differentiate unrelated categories — the per-agent-state mood colors (AGENT_STATES), the memory-type badge palette (MEMORY_TYPE_COLORS), and the workflow-stage palette (STAGE_COLORS) — were deliberately left as raw hues; collapsing them onto the ~4-5 available semantic tokens would make several of those categories render identically. Also documented (not yet fixed) a known contrast gap: the mood-color enum's amber "thinking" state is hard to read against light day themes in the 2 consumers with a theme-aware background; a full per-theme fix is blocked because most consumers feed the color straight into three.js material props, which can't resolve CSS custom properties. Refs #1909, Refs #1924 — remaining feature areas (meatspace/ remainder, city/, ui/, goals/, brain/, apps/, pipeline/, messages/, agents/, writers-room/, wiki/, settings/, gsd/, voice/, and the rest of client/src/pages/) stay tracked there.
  • [issue-1924-meatspace] MeatSpace health-tracking theme consistency — remapped off-token colors across the genome tracker and cognitive-training (POST) drills onto the existing --port-* theme tokens: genotype beneficial/typical status badges now follow port-success/port-accent, and ClinVar severity + genetics-flavored icons and the recurring "Training mode" accent across the POST drill runners now follow port-accent-2, so these surfaces stay theme-consistent instead of a fixed green/blue/purple. Per-category color palettes that intentionally differentiate unrelated categories (genome-marker-category cards, cognitive-domain badges, periodic-table element groups, life-calendar event types, and the health-overview tile colors) were left as-is. Refs #1924 — the remaining feature areas stay tracked there.
  • [issue-1924-ui] Shared UI primitives theme consistency — remapped off-token colors in client/src/components/ui/: the diff renderers (diffRuns.jsx, InlineDiff.jsx, SideBySideDiff.jsx, HunkDiff.jsx) now highlight removed/added text with --port-error/--port-success instead of fixed red/green, and the shared Toast.jsx success/error/warning toast colors move onto --port-success/--port-error/--port-warning. Every site in this slice was a binary or tri-state semantic (removed vs. added, success vs. error vs. warning) rather than a category-color enum, so nothing needed to be left alone. Refs #1924.
  • [issue-1924-goals] Goals theme consistency — remapped off-token colors across the Goals UI (todo/milestone checkboxes, the plan section's decompose/schedule actions, the list view's urgency dot, the detail panel's urgency text and complete button, and the progress slider's trend icon) onto the existing --port-* theme tokens, so completed-state and secondary-action colors now follow the active theme instead of staying a fixed green/purple. The category, goal-type, and check-in-status color enums in goalConstants.js, and GoalsTreeView.jsx's apex/sub-apex/edge-type 3D-scene legend, intentionally differentiate categories rather than express theme drift and were left as-is. Refs #1924.
  • [issue-1924-brain] Brain UI theme consistency — remapped off-token colors across the Brain memory, digest, config, links, and inbox tabs onto the existing --port-* theme tokens: the GitHub-repo clone lifecycle badges now follow port-warning/port-accent/port-success/port-error, and the recurring "secondary AI feature" purple (Send-to-Catalog actions, the Weekly Review section, and Creative capture mode) now follows port-accent-2, so these surfaces stay theme-consistent instead of a fixed yellow/blue/green/red/purple. The category-color enums in constants.js (destination, project/idea/admin status, and confidence-tier palettes) and links/bucketColors.js (bucket color presets) intentionally differentiate unrelated categories and were left as-is, along with the link-type badge palette and the "corrected" inbox-status blue that already carries a distinct meaning from success/warning/error. Refs #1924.
  • [issue-1924-apps-pipeline] Apps and pipeline theme consistency — remapped off-token colors across the app-management drawer/panels and the story pipeline arc canvas onto the existing --port-* theme tokens: the Deploy panel's action button, output-status text, and checkbox accent now follow port-accent-2 instead of a fixed purple; the GSD tab's "Open Claude Code" launcher and its next-phase "Verify" action badge follow port-accent-2; the app overview's enabled-PR indicator follows port-success; and a stage's version-history diff labels now match the diff viewer's own port-error/port-success coloring instead of duplicating it with raw red/green. Multi-hue category pickers that intentionally differentiate unrelated items — the SlashDo command toolbar's per-command colors, the GSD tab's "Open OpenClaw" tool launcher, the editorial check-kind badge's rule-vs-LLM distinction, and the arc canvas's theme-pill palette and Plot/Character/Reader roadmap-chart legend — were left as-is. Refs #1924.
  • [issue-1924-misc-areas] Theme consistency across Messages, Agents, Local LLM, GSD, and Voice — remapped the recurring "secondary AI feature" purple (AI-reply/voice-mode toggles and "AI generated" badges in Messages, the "Find Relevant"/"Build"/"Check Posts" secondary CTAs and reply-type badge in Agents, the local-LLM playground "Chat" link, the GSD phase-verify action and Claude Code launcher, and the Voice widget's floating-agent glow + capture button) onto port-accent-2, and binary success/warning states (MortalLoom's iCloud file-found/not-found indicator, the Voice widget's "thinking" stage) onto port-success/port-warning. The proseTokenizer.jsx/ProseTokenPopover.jsx character/place/object token-highlight colors and the wiki/constants.jsx and wiki/tabs/LogTab.jsx per-category/per-log-type palettes intentionally differentiate unrelated categories and were left as-is, along with LocalLlmTab.jsx's per-capability badge colors (chat/code/reasoning/vision/embeddings/tools/audio) and GSD's "OpenClaw" cyan tool-launcher button (paired with the now-port-accent-2 "Claude Code" button purely to visually distinguish the two tool launchers). Refs #1924.
  • [issue-1909] Verified cos/TerminalCoSPanel.jsx foreground+background re-theme carried over cleanly — the coordinated --port-terminal-bg/--port-terminal-text re-theme from #1909 (commit 8298c5706) was already on main before this slice branched; confirmed no light-on-light regression remains and no further changes were needed here. Refs #1909.
  • [issue-1924-city] CyberCity HUD theme consistency (minimal, lower-priority slice) — city/ is mostly already covered by the .cybercity-themed CSS safety net (client/src/index.css), which neutralizes off-token cyan/gray/black classes app-wide and was intentionally left alone as CyberCity's cyberpunk visual identity. The few genuine gaps fixed here: CityIntelPane.jsx's severity/log-level color maps (SEVERITY_COLORS, LEVEL_COLORS, LEVEL_INDICATORS, DENSITY_BAR_COLORS, the "ALL CLEAR" message, and the critical-count badge) and CityHud.jsx's getHealthSentinel/metricColor threshold functions and connection-status dot duplicated the exact same system-health data SystemHealthWidget.jsx already renders with port-error/port-warning/port-success — these now match. CitySettingsPanel.jsx's "RESET DEFAULTS" button now uses port-error like other destructive actions app-wide (was raw red). Two amber notice messages in CityPlaybackOverlay.jsx (load-failure and "live data" notices) now use port-warning. Left alone as intentional CyberCity identity: the pervasive cyan HUD glow (already safety-netted), per-category stat colors (NODES=violet, TASKS=purple, STREAK=orange), HolographicPanel.jsx's 5-state building-status glow (cyan/red/violet/gray — a deliberate 3D holographic palette distinct from the flat StatusBadge convention), and CityXpBadge.jsx's amber level-up celebration flash and red/rose HP gradient (game-aesthetic, not a success/warning/error semantic). Refs #1924.
  • [issue-1924-pages-b] Second half of client/src/pages/ theme consistency — remapped off-token colors across AgentsPage, Ambient, Apps, HistoryPage, Loops, PipelineSeries, Review, Shell, and StoryBuilder onto the existing --port-* theme tokens: process-list metric accents, PM2/JIRA detail badges, the Shell connected/disconnected indicator and destructive Stop/Ctrl+C/Kill actions, the Loops running/active status badge, and Ambient's inline-styled dashboard stats (which read raw hex matching the token palette) now follow the active theme. Also fixed two stale hover:bg-green-600/hover:text-blue-400 hovers left behind after their base color had already migrated to port-success/port-accent. GitHub.jsx's private/fork/npm repo-attribute badges and CyberCity.jsx's cyan HUD/loading colors were left as-is — the former is a genuine category-differentiator enum, the latter is already covered by the .cybercity-themed CSS safety net in index.css plus the page's intentional neon visual identity. Refs #1924.
  • [issue-1924-pages-a] Theme consistency across CharacterSheet, AIProviders, ChiefOfStaff, DataDog, Jira, UniverseBuilder, CatalogIngredient, and RunsHistoryPage — remapped off-token colors onto the existing --port-* theme tokens: CharacterSheet's "Log Event" action and level-up event color now follow port-accent-2; AIProviders' model-tier indicators (light/medium/heavy) follow port-success/port-warning/port-error and its TUI info banner follows port-accent; ChiefOfStaff's Start/Stop agent buttons, Pending stat icon, and AI-panel border accent follow port-success/port-error/port-warning/port-accent-2; DataDog's and Jira's primary/save/delete/edit buttons and success/error banners follow port-accent/port-success/port-error/port-warning; UniverseBuilder's delete-world button, remove-icon buttons, and "Generate From Idea" AI action follow port-error/port-accent-2; CatalogIngredient's "extract" source badge follows port-accent-2; and RunsHistoryPage's "CoS" source badge follows port-accent-2. Neutral gray/slate text and chrome, and genuine multi-hue category-color enums (Loras.jsx's per-runner-family badges, Uploads.jsx's file-type icons, Ask.jsx's per-source-kind chips, and the app-wide cyan runtime/duration and orange code-highlight conventions) were left as-is. Refs #1924.

UX & Accessibility

  • [issue-1853] Consolidated remaining hand-rolled overlays onto the shared Modal/Drawer components — ConversationViewer, the digital-twin Documents tab's "create document" and "delete document" dialogs, and the CoS task "mark as blocked" dialog had their own bespoke fixed inset-0 backdrop markup at inconsistent opacities (bg-black/50 vs bg-black/70); they now render through <Modal>, picking up its standardized backdrop, Esc/click-outside handling, and stacking behavior for free. The "create document" dialog opts out of backdrop/Esc dismissal (closeOnBackdrop/closeOnEsc={false}) so an accidental outside click can't silently discard a typed draft, matching its pre-conversion behavior. The calendar event-detail panel — a bespoke right-side slide-in that duplicated Drawer's mobile-full-width/desktop-~520px/backdrop/Esc behavior — now renders through <Drawer> directly; Drawer gains an optional closeLabel prop (default unchanged, "Close settings") so the event panel's close button keeps its own accessible name instead of inheriting Drawer's settings-flavored one, and Drawer's close button is bumped from 40px to the project's 44px minimum touch target (#1850) so the conversion doesn't regress that fix — the bump applies to every Drawer consumer. (#1853)
  • [issue-1850] Calendar and message action buttons now meet the 44px minimum touch-target size — the day/week/month calendar nav chevrons, the event-detail close button, and the message-detail action row (Reply / Voice / AI Reply / Refresh / Archive / Delete) previously rendered at ~28–31px, below the WCAG 2.5.5 / Apple HIG 44px minimum and awkward to tap on mobile. Each now enforces min-w-[44px] min-h-[44px] with centered icons, matching the shared Drawer close-button pattern, without changing the visual layout. (#1850)
  • [issue-2023] Hover-only image/file actions are now reachable on touch devices — several image/file management controls were opacity-0 group-hover:opacity-100 with no touch or focus fallback, making them effectively unreachable on phones (PortOS's primary device class over Tailscale). Worst case, the Catalog gallery picker's "Attach"/"Portrait" buttons were the only way to pick an image and the whole flow was blocked on touch. Every action-bearing instance now adopts the responsive reveal pattern from LibraryPane — visible below sm (opacity-100, or opacity-40 where a full-opacity idle state was too noisy), hover-revealed on desktop (sm:group-hover:opacity-100), and always shown on keyboard focus (focus-visible:/focus-within:) — so desktop hover behavior is unchanged while touch users can reach the controls. The Catalog gallery-picker and media-tile actions also enlarge their touch targets below sm. Fixed sites: CatalogIngredient (gallery picker + media tiles), Uploads (download/delete), CharacterSheet (avatar overlay), plus a grep sweep across NotificationDropdown, Layout pin buttons, ArcCanvas, goals log/todo, MeatSpace calendar/life-events, brain LinkChip/FeedsTab, apps GitTab stage/unstage, digital-twin AccountsTab/ListEnrichment, RunnerPage, VideoTimelineEditor, and Ask. Decorative-only hover affordances (e.g. the ProactiveAlerts chevron) were left untouched. (Closes #2023)
  • [issue-1852] Fixed mobile content clipping behind the browser's URL bar — calc(100vh - …) heights don't update when a mobile browser's address bar shows or hides, so the bottom of the Wiki Browse/Graph tabs, the JIRA report list/detail panes, and the Brain inbox "Needs Review" rail could clip behind the chrome. Those now size off dvh instead of vh. The sidebar <aside> now mirrors the page root's existing h-screen h-[100dvh] fallback pattern so it tracks the same dynamic viewport. The Writers Room render-queue dock (pinned to the bottom of the screen) now pads for env(safe-area-inset-bottom) so it no longer sits under the iOS home indicator. (#1852)

Internal

  • [issue-1973] Documented the tabbed config-drawer UX convention — codified the epic #1966 drawer redesign so new config surfaces follow it instead of dumping another page-length flat scroll into a narrow panel. Added a "Config drawers → the shared tabbed Drawer convention" bullet to CLAUDE.md (near the Layout/deep-linking conventions) covering the size variants (sm/md/lg/xl, mobile stays full-screen), when to tab vs. use grouped sections, the per-tab-scroll + state-hoisting rule, the TabPills mobile <select> fallback ("reuse TabPills, never roll a new tab bar"), and deep-linkable active tab via useDrawerTab — pointing at EditAppDrawer.jsx / ImageGenTab.jsx as worked examples and Drawer.jsx as the primitive. Added the design record docs/plans/2026-07-01-drawer-ux-redesign.md (problem, size+tabs+deep-link approach, the #1968–#1972 per-surface migrations, and the scoped-out multi-open-instance id namespacing — deferred because drawers are modal/single-open). Docs only. (Closes #1973)

  • [issue-1964] Made peerSync.test.js full-sync coverage hermetic — getFullSyncCoverageForPeer walks every subscribable record kind, but the test only mocked the universe/series/collection/artist/album/track/music-video list backends. The author, creative-director-project, mood-board, and writers-room (work/folder/exercise) list backends were left unmocked, so a developer running the full server suite against a populated local portos Postgres saw the coverage total count real rows instead of the fixture (expected 3 to be 1) — an order-dependent flake that repeatedly forced a "known flake or real break?" judgment during merge gating. Those six list functions are now partially mocked (the module's real merge/get/tombstone surface is preserved via importOriginal; only the DB-reading list function is overridden) and defaulted to empty in beforeEach, so coverage is driven purely by each test's fixture regardless of suite order or DB contents. Test-only. (#1964)

  • [issue-1947] Boot migrations no longer crash when a server is booted from inside a CoS agent worktree — every path in the boot-migration chain derived its data root from where the executing file lives (import.meta.url), so a node server/index.js launched from inside a CoS agent's git worktree (data/cos/worktrees/agent-*/) resolved data//data.reference/ to the worktree's checkout, which has no gitignored runtime tree — boot migrations then crashed on ENOENT (observed: migration 005 writing data/prompts/stages/pipeline-arc-overview.md). Two fixes: (1) a durable PORTOS_DATA_ROOT env var (new server/lib/dataRoot.js resolveInstallRoot), pinned at real launch in ecosystem.config.cjs, that lets a process pin its install root explicitly instead of inferring it from the executing file — now preferred over the derived path in PATHS (server/lib/fileUtils.js), server/index.js's migration call, and scripts/run-migrations.js; falls back to the derived path when unset (backward compatible). (2) a defensive backstop in runMigrations — isWorktreeRoot() detects a data/cos/worktrees/-rooted path and skips the migration pass with a single-line warning instead of crashing (keyed on the path segment only, so a fresh install's empty data/ isn't a false positive). (Closes #1947)

  • [issue-1848] Strengthened weak truthiness test assertions — replaced toBeTruthy() checks that would pass on wrong values with concrete value/shape assertions: autobiography.test.js now asserts the next-prompt object shape and round-trippable ISO-8601 timestamps for createdAt/updatedAt/lastPromptAt/followUpsGeneratedAt (with updatedAt/lastPromptAt proven strictly newer than the seeded old values); storyBuilder.test.js asserts getSeries() returns the matching series.id and lockedAt is a valid ISO timestamp; commandSecurity.test.js anchors the allowlist against known-safe membership (git/gh/node/npm/pm2/ls/cat/echo) and asserts dangerous commands stay absent, replacing the self-referential array-vs-Set check; and fileUtils.test.js's visualTemplates resolution now asserts the returned path carries the data/templates/ segment + unique basename. (#1848)

  • [issue-1842] Replaced magic numbers with canonical constants — consolidated the duplicated chars-per-token estimate (Math.ceil(len / 4)) onto the canonical estimateTokens() / CHARS_PER_TOKEN from server/lib/contextBudget.js at the usage-recording (server/index.js, services/agentRunTracking.js) and digital-twin-export (×5) sites, and dropped the shadow estimateTokens in services/memoryEmbeddings.js (now re-exported from contextBudget so existing importers are unaffected; truncateToTokens uses CHARS_PER_TOKEN too). The CoS runner port 5558 was a raw literal in cos-runner/index.js, services/cosRunnerClient.js, and services/apps.js; the importable server/lib/ports.js mirror (previously only API/API_LOCAL/UI) now carries the remaining static ecosystem ports (CDP, CDP_HEALTH, COS, AUTOFIXER, AUTOFIXER_UI) and those sites use PORTS.COS (and PORTS.CDP/AUTOFIXER/AUTOFIXER_UI for the sibling app definitions that were also literals). The CoS runner's kill/cleanup setTimeout literals are now named (SIGKILL_GRACE_MS, ORPHAN_CLEANUP_DELAY_MS, SHUTDOWN_DRAIN_MS) and the server's graceful-shutdown force-exit timeout is GRACEFUL_SHUTDOWN_TIMEOUT_MS. Behavior-preserving. (#1842)

  • [issue-1840] Adopted canonical client hooks/utils + deduped countWords — replaced hand-rolled duplicates of existing helpers across the codebase. countWords was re-implemented in server/lib/issueLength.js and server/services/writersRoom/local.js; both now import the new canonical server/lib/textUtils.js (the client formatters.js mirror is documented against it). Six services that open-coded mkdir(dir, { recursive: true }) now use lib/fileUtils.js ensureDir (which swallows the spurious Windows EEXIST/EPERM the raw call doesn't). The logs and openclaw SSE routes route their response-header boilerplate through openSseStream, and X-Accel-Buffering: no moved into the shared SSE_HEADERS (so every SSE consumer disables proxy buffering). On the client, ~44 new Date(x).toLocaleString() display sites now use the canonical formatDateTime for consistent date formatting, and several hand-rolled single-armed-row delete confirmations / saving-flag patterns adopt the useConfirmDelete / useAsyncAction hooks. (#1840)

  • [issue-1849] Unit coverage for under-tested taskLearning + moltbook branch logic — added sibling tests for previously-untested modules called out by the /do:better audit: taskLearning/store.js (extractTaskType classification arms, calculateDurationETA success-vs-total base + p80 clamp), taskLearning/durations.js (confidence tiering, totals fallback, queue-completion matching/formatting), taskLearning/promptRecommendations.js (success-rate status bands, error insights/hints, sort order), and integrations/moltbook/challengeSolver.js (number-extraction regex + 2-decimal formatting, provider selection, failure fallbacks). The promptRecommendations sort test surfaced and fixed a real bug — priorityOrder[status] || 5 treated the top-priority critical status (value 0) as falsy and sorted the most urgent recommendation last; switched to ?? 5. (#1849)

  • [issue-1841] Stopped silently swallowing errors — replaced .catch(() => {}) / bare catch {} swallows that discarded failures with no log or user signal. The recovery-critical completion writes in cos-runner/index.js (output.txt + completion metadata) now log a console.error on failure instead of silently dropping a finished task, and telegramClient.js's poll loop logs non-abort errors (JSON/Type errors that were previously retried blind) before retrying. On the client, the silent initial-load .catch(() => {}) swallows in ToolsTab.jsx (rate-limit / submolt / draft refreshes), the loraTraining/* pickers (CharacterLoraChip, TrainingPanel, LiveSampleGallery, CheckpointPicker, ImportGalleryDialog, UniverseCharacterPicker), and meatspace/post/* (MemoryBuilder, MemoryPractice, PostHistory, PostDrillConfig, PostSessionLauncher, ElementsSong) now console.warn the error while keeping their zero-state fallbacks, so a failed load is visible in the console instead of a silent empty state. (#1841)

  • [issue-1843] Logging hygiene: single-line interpolated logs + parseInt radix — enforced the single-line-log convention across a handful of stragglers flagged by the /do:better audit. useErrorNotifications.js passed error.context as a raw object arg to console.warn/error (expanding a multi-field console group); it now interpolates the context as a single-line JSON suffix via a shared formatContext helper. routes/database.js had an embedded \n that split a failed-command log into two records — the detail is now whitespace-collapsed onto one line. The per-request route-path console.logs in routes/agentActivity.js, routes/platformAccounts.js, and routes/agentPersonalities.js (pure noise — mutations already persist via logAction) were removed. And routes/digital-twin.js's parseInt(req.query.limit) gained its missing radix 10. No behavior change beyond log formatting. (#1843)

  • Dropped the three-fenestra dependency from CyberCity's interior-mapped window panes — the single call site (client/src/components/city/BuildingWindows.jsx) now uses an in-tree InteriorMappingMaterial (client/src/components/city/InteriorMappingMaterial.js), a self-contained MeshStandardMaterial subclass that ports the parallax interior-mapping shader via onBeforeCompile GLSL injection, trimmed to the constructor options and instanced attributes the call site actually uses. MIT attribution for the ported GLSL (Copyright (c) 2026 Edgar Perez) is preserved in the file header. Ships the remaining, more complex half of #1824 (the sax half shipped separately). (Closes #1874)

  • [issue-1860] De-flaked the peerSync reciprocal-sync tests — the positive reciprocates a full-sync peer on peer:online test waited for an async event handler with a hard setTimeout(r, 30) before asserting enqueueReciprocalSync was called, so a loaded CI runner whose handler chain exceeded 30ms produced a spurious failure (surfaced during the v2.24.0 release CI-flake gate). It now polls with vi.waitFor. The sibling negative test (does NOT reciprocate a non-full-sync peer) replaced its fixed-sleep + not.toHaveBeenCalled() — which could false-pass if the absent call were merely slow — with a deterministic full-sync "barrier" peer emitted after the subject: once the barrier's reciprocal call lands, the subject's handler has provably reached and skipped its own fullSync check. Test-only. (#1860)

  • Updated the bundled slashdo submodule to v3.20.0, pulling the latest /do:* slash commands and shared libraries.

  • [issue-1836] Moved socket-handler orchestration into services — the standardize:start and app:deploy Socket.IO handlers (server/services/socket.js) implemented their multi-step flows inline in the socket layer, where they couldn't be unit-tested or reused from an HTTP route. The PM2 standardization flow (analyze → git backup → apply) is now pm2Standardizer.runStandardizeFlow() and the deploy flow (resolve app → check deploy script → run) is now appDeployer.runDeployFlow(); each takes progress callbacks and returns a terminal outcome, so the socket handler is a thin adapter. Both are covered by new unit tests. Behavior-preserving. (#1836)

  • Extracted a shared helper for the copy-paste stage-seed migrations — 44 first-shipment "seed a new pipeline stage" migrations under scripts/migrations/ (e.g. 130-editorial-character-consistency-stage.js) were near-identical: only the stage key differed while ~65 lines of read-reference → no-clobber-copy → merge-stage-config were verbatim copies, each with its own copy-paste test. They now collapse to a 3-line export default makeSeedMigration(stageKey) call from a new scripts/migrations/_seedStageHelpers.js (companion to the existing _lib.js/_testHelpers.js; the runner skips _-prefixed files). The helper reproduces the migrations' on-disk effects exactly — fresh-seed, idempotent no-clobber of a customized .md/config, and missing-reference no-throw; filename defaults to ${stageKey}.md (the universal convention, overridable for a divergent template), and no down() is emitted because the runner (run-migrations.js) only ever calls up() and tracks applied migrations by filename. Boot-log copy is incidental and now uniformly keyed on stageKey. Net −2,500 lines; all 757 scripts/ tests pass unchanged, and the new _seedStageHelpers.test.js covers the helper directly. (#1838)

  • [issue-1891] Extended the stage-seed helper to the multi-stage migrations — #1838 collapsed the 44 single-stage seed migrations onto makeSeedMigration, but left the four genuinely multi-stage ones (091/094/095/107) as hand-rolled for (const stageKey of STAGES) loops — ~70 near-identical lines apiece. scripts/migrations/_seedStageHelpers.js now exports makeSeedMigrations(stageSpecs) (array of bare stageKey strings or { stageKey, filename }) that runs the same copy-if-missing + merge-if-absent body per stage and writes the installed stage-config.json once with an N added summary; makeSeedMigration is now a one-stage wrapper over it. All four migrations collapse to a 3-line call — including 095, whose per-stage returnsJson flag lives only in the shipped stage-config sample and is copied verbatim (the migration never inspects it), so the shared helper is fully equivalent. On-disk results are byte-identical to the prior loops (templates copied only when missing, entries merged only when absent, single pretty-printed write); the boot-log copy is incidental. _seedStageHelpers.test.js gains direct coverage of the array form and all scripts/ tests pass unchanged. (#1891)

  • Extracted a shared withAbortTimeout helper for the duplicated peer-fetch timeout boilerplate — the new AbortController() + setTimeout(abort) + finally{clearTimeout} triple was hand-rolled at 12 federation/probe call sites (4 in instances.js, plus peerSocketRelay, peerSync, peerCosSync×2, peerSyncAssets, peerSyncPush, peerMediaLibrarySync, sidecarSync). It can't reuse fetchWithTimeout because peerFetch needs the Tailnet-insecure HTTPS agent. The new server/lib/abortTimeout.js withAbortTimeout(timeoutMs, fn) runs fn(signal) under a timed AbortController and always clears the timer on settle — covering both the headers-only idiom (peer-sync pulls/pushes, body separately size-capped) and the whole-operation idiom (probePeer shares one signal across three parallel fetches and their body reads). The peerFetch call stays in each module (so existing test mocks/assertions are unchanged); behavior-preserving. (#1839)

  • Replaced aiToolkit runner monkey-patching with declared extension points — server/index.js previously reached into the toolkit runner's private surface, overwriting executeCliRun/executeTuiRun and re-wrapping stopRun/isRunActive/deleteRun to consult an ad-hoc _portosActiveRuns map, plus inlining a 34-line update-marker IIFE in bootstrap. The toolkit runner (server/lib/aiToolkit/runner.js) now exposes setCliRunner()/setTuiRunner() and an external-run registry (registerExternalRun/unregisterExternalRun/hasExternalRun) that its own stopRun/isRunActive/deleteRun consult first — so the host registers its CLI/TUI runners through a documented contract instead of mutating private props, and adding a new lifecycle method no longer requires a matching monkey-patch. server/services/runner.js tracks its child processes via the registry, and the update-marker read/validate/record/cleanup lifecycle moved into a unit-tested processUpdateMarker() in server/services/updateChecker.js. Behavior-preserving; the aiToolkit override contract (server/lib/aiToolkit/CLAUDE.md) is updated to match. (#1834)

  • Decomposed two remaining large files: server/routes/meatspace.js + server/services/videoGen/local.js — the 1,069-line meatspace.js router (14 health sub-domains, each backed by its own service import) is split one concern per file (meatspaceCoreRoutes.js overview/config/birth-date/death-clock/LEV, meatspaceAlcoholRoutes.js, meatspaceNicotineRoutes.js, meatspaceHealthRoutes.js blood/body/BP/workouts/epigenetic/eyes, meatspacePostRoutes.js POST drills + training + memory builder, meatspaceCalendarRoutes.js life calendar/activities/events, meatspaceExportRoutes.js MortalLoom export), assembled by a thin meatspace.js barrel that mounts each under /api/meatspace — the same pattern routes/cos.js/routes/brain.js use; the split is wiring-only (the 70-route surface is byte-identical, verified). The 1,805-line videoGen/local.js had its BYOV runtime management (venv/helper-script path constants, BYOV_RUNTIME_INFO, install/ready/fingerprint probes) extracted to videoGen/runtimes.js and its render-history I/O (loadHistory/saveHistory) to videoGen/history.js; local.js keeps generation + post-processing and re-exports the extracted surface so every existing deep import (from '../videoGen/local.js') keeps resolving unchanged (all 30 prior exports preserved, verified). (#1833)

  • Decomposed server/routes/brain.js (1,149-line router covering 13 sub-domains) — the monolithic Brain router that mixed capture/inbox, four entity CRUD collections + memories, digest/review, settings/summary, links + buckets, graph, federation sync, and the daily log is now split one concern per file (brainCapture.js, brainCrud.js, brainDigest.js, brainSettings.js, brainLinks.js, brainGraph.js, brainSync.js, brainDailyLog.js), assembled by a thin brain.js barrel that mounts each sub-router under /api/brain — the same pattern routes/cos.js already uses. The split is wiring-only: route paths, ordering (literal-before-:id routes stay within their owning sub-router), validation, and the barrel's default export are unchanged, so server/index.js and the existing brain.test.js (105 tests) pass without edits. (#1832)

  • Split server/lib/validation.js (1,897-line multi-domain Zod barrel) — the catch-all schema file that mixed 15+ unrelated domains is decomposed (continuing the #1151 peerSyncValidation.js/creativeDirectorValidation.js precedent) into four per-domain files: agentValidation.js (social-bot agent personality, Moltbook/Moltworld accounts, automation schedules, agent tools + Moltworld payloads, CoS Feature Agents), cosValidation.js (CoS tasks/jobs/loops/learning, the Review-Loop reviewer vocabulary + normalizeReviewers/buildReviewWithArgs, the Code-Review settings slice, and the task-metadata sanitizer), mediaValidation.js (LoRA training, local-LLM/Ollama/LM Studio management, CyberCity snapshots, media-collection bulk ops), and pipelineValidation.js (Writers Room, story-bible character/place/object, editorial checks, storyboard shots/scenes, prompt-stage config, issue-list query). validation.js (~550 lines) keeps the app/process/provider, social-account, GitHub, backup/sharing, and document/legacy-export core plus the validateRequest/validate/parsePagination helpers, and re-exports the four new files (flat) so every existing deep import { x } from '../lib/validation.js' callsite keeps working unchanged; the barrel surfaces each as a namespace export. The new domain files import only zodCompat.js + leaf constant modules (never back through validation.js), keeping the transitional re-export cycle-safe under ESM. (#1831)

  • Decomposed server/services/sharing/peerSync.js (4,004-line god file mixing 3 sync protocols) — the single module that inlined per-record subscription CRUD + the outbound push path (951-line region) + the receiver path (909-line region) + standalone media-library sync + CoS-history/tasks sync is now split into one concern per file: peerSyncShared.js (state machine, constants, peer-capability helpers, the cross-cutting event bus), peerSyncAssets.js (asset manifest build/diff/hash + the receiver-side asset-pull worker, reused by every receive path), peerSyncPush.js (the pushRecordToPeer pipeline + payload builder + schema-gate bookkeeping), peerSyncReceive.js (applyIncomingPush + reverse-subscribe + merge dispatch), peerMediaLibrarySync.js (#1566 media-library sweep), and peerCosSync.js (#1650 CoS history + tasks). peerSync.js (~985 lines) stays the orchestrator — subscription CRUD, the debounced push scheduler, the recordEvents/peer:online listeners, and the boot-time registerSubscriptionAdapter wiring — and re-exports the extracted modules' public surface so every existing importer (routes, sharing/index.js, dataSync, the test suite) keeps working unchanged. The leaf-peerSyncShared design keeps the only module cycle (peerSync ↔ peerSyncReceive, both call-time-only) safe under ESM. Verified behavior-preserving: the full server suite produces byte-identical pass/fail results before and after (zero regressions, 15,092 tests), the DB suite is 156/156 green, and the server smoke-boots cleanly. (#1830)

  • Decomposed server/lib/editorial/checkRegistry.js (7,474-line god file) — the single module that held 2,400 lines of shared infra plus a 68-entry EDITORIAL_CHECKS array (each embedding a full run(ctx) closure) is now split: shared infra lives in checkInfra.js, the 68 checks are grouped by category into checks/*.js (naming, cast, pov, characterArc, continuity, comic, visual, scene, dialogue, proseStyle, research), and checkRegistry.js (480 lines) stays the public entry point — assembling EDITORIAL_CHECKS from the per-category arrays and keeping the registry's lookup/state helpers. The check files import shared infra from checkInfra.js (not back through the registry) so the EDITORIAL_CHECKS spread can't hit a TDZ on the checks' eagerly-evaluated configSchemas. The editorial barrel's public API is byte-for-byte identical (173 exports, verified) and all editorial + runner tests pass unchanged. (#1829)

  • Dropped the sax dependency from the Apple Health XML importer — the 500MB-export streaming path now uses a self-contained ~190-line Record parser (server/services/appleHealthXmlParser.js) that splits the byte stream on <Record> tag boundaries and parses attributes with a quote-aware scan, preserving the prior backpressure (caller pauses the source stream) and error-skip (malformed records dropped, not fatal) behavior. Per the PortOS "write small helpers yourself" policy; covered by new unit + chunk-boundary tests. Partial-ships the sax half of #1824; the client three-fenestra shader replacement is tracked separately. (#1824)

  • [issue-1837] On-disk JSON writes are now crash-safe across ~50 service/route files — ~73 persistence sites used a raw writeFile(path, JSON.stringify(data, null, 2)), which truncates the JSON file if the process crashes mid-write (leaving an unparseable half-record on disk). Each was swapped to the canonical atomicWrite helper (server/lib/fileUtils.js), which writes to a temp file and atomically renames it over the target so readers never see a partial write. Covers brain storage, run/agent metadata, decision log, meatspace (calendar/alcohol/nicotine/health/post), mortal-loom store, identity goals, image/video sidecars, GitHub/Google/Obsidian configs, taste/usage/genome/epigenetic stores, and the scaffolding routes. Sites that intentionally append a trailing newline keep their exact byte output (passed as a pre-stringified string), and videoGen/local.js's { flag: 'wx' } exclusive-create write is left as-is (atomicWrite can't replicate exclusive-create). (#1837)

  • [issue-1846] Replaced vacuous inline-copy tests with coverage of real production logic — subAgentSpawner.test.js had four describe blocks that re-implemented production logic inline and tested the copies, so the real code could regress while the suite stayed green: an inline ERROR_PATTERNS/categorizeError, an inline resolveFailedTaskStatus (which omitted the MAX_TOTAL_SPAWNS short-circuit and compaction metadata that the real resolveFailedTaskUpdate has), and stub exitCodeMessages/buildSpawnArgs literals exported from no production module. The error-classification and retry-decision blocks now live in agentErrorAnalysis.test.js against the real exported ERROR_PATTERNS (via analyzeAgentFailure) and a new pure resolveFailedTaskDecision helper extracted from resolveFailedTaskUpdate (the async wrapper delegates to it and just stamps timestamps + creates the investigation task — behavior-preserving); the exit-code block is replaced by a new agentRunTracking.test.js covering the real extractErrorFromOutput mapping; and the redundant spawn-args stub is dropped since agentCliSpawning.test.js already covers the real buildCliSpawnConfig. The genuine imported-helper tests (isTruthyMeta/isFalsyMeta/applyAppWorktreeDefault) are kept. (#1846)

  • [issue-1876] Consolidated four private XML-entity decoders into a shared server/lib/xmlEntities.js — decodeXmlEntities/decodeEntities/inline stripHtml had drifted into near-identical copies across appleHealthXmlParser.js, claudeChangelog.js, pinterestFeed.js, feeds.js, and messageGmailSync.js, so an entity-handling fix had to be applied in up to five places. The most complete implementation (named + decimal &#NN; + hex &#xNN; via a single double-decode-safe pass, out-of-range-tolerant) is promoted to a shared, barrel-registered helper that also takes an optional extra-named-entity map ({ nbsp: ' ', zwnj: '' }) for the mail-specific entities Gmail's HTML-to-text needs; every call site now imports it. Behavior-preserving (each site's existing tests pass on the shared single-pass decoder); covered by a new xmlEntities.test.js. (#1876)

  • [issue-1847] Added tests for four sync-critical pure modules that shipped without one — server/lib/lwwTimestamp.js (the last-writer-wins polarity behind every cross-instance merge), server/lib/pgTimestamp.js (mirrorTimestamp's TIMESTAMPTZ bind-safety guards), server/lib/agentGuard/index.js (agentGuardEnv's PATH-prepend + PORTOS_REAL_PM2 pm2-kill shim), and the previously-untested providerSchema/validate exports of server/lib/aiToolkit/validation.js. Coverage hits the real branch points: parseTsMs non-string/unparseable returns, compareNewerWins/compareEarlierWins tie + unparseable-side + ISO-vs-non-ISO + antisymmetry; mirrorTimestamp calendar-rollover normalization, year-0000 rejection, ±expanded-year rejection, 0001/9999 bounds; agentGuardEnv guard-dir-first PATH order, Path fallback, real-pm2 resolution, plus the bin/pm2 bash shim's actual block behavior (spawns the shim with a stub real-pm2 to assert pm2 kill/startup/unstartup and delete/stop/restart all are blocked case-insensitively while scoped/read-only commands pass through, and the no-pm2-found 127 path); providerSchema endpoint ''/null→undefined coercion, id slug regex + 80-char max, numCtx 512–1048576 bounds, and validate's {path, message} error shape. Tests only. (#1847)

  • [self-improvement] CoS's auto-approved error-investigation tasks now require human review, matching the rest of the codebase's error-driven task creators — two task creators auto-approved an unsupervised agent to start editing code from thin diagnostic evidence: autoFixer.js's createAutoFixTask (triggered by severity: 'critical' or canAutoFix, covering bare uncaughtException/unhandledRejection — no repro steps, no live process state, since the process already crashed) and agentManagement.js's orphan-retry investigation task (triggered after repeated agent-orphaning, an infra/process-flakiness signal rather than a diagnosed code bug). Every other error-driven task creator (createAIProviderInvestigationTask, handleErrorRecovery, agentErrorAnalysis.js's createInvestigationTask) already required approval first; these two were the outliers, and both shipped with zero test coverage for this branch. CoS's own learning.json history bears this out — this task class runs rarely and has a materially worse success rate than the reviewed-first paths. Flipped both to approvalRequired: true and added coverage for the previously-untested branches (approval flag, trigger conditions, skip paths, dedupe).

  • [issue-1956] Extracted a shared SIGTERM→grace→SIGKILL kill-escalation helper for spawn-based jobs — the identical "SIGTERM, then after 8s escalate to SIGKILL if the tracked child hasn't exited" cancel block was copy-pasted across seven job-cancel paths (musicVideo/render.js, videoTimeline/local.js, imageGen/local.js, imageGen/codex.js, videoGen/local.js, loraTraining/index.js, trackYoutubeImport.js). It now lives in one place — killWithEscalation(proc, { label, stillRunning, delayMs=8000 }) (server/lib/killWithEscalation.js) — which preserves each site's exact guard (job.process === proc / activeProcess === proc / activeProcs.get(id) === proc), its exit check (exitCode === null && signalCode === null), and its emoji-prefixed single-line warning, while wrapping the out-of-request-lifecycle setTimeout callback in try/catch and unref'ing the timer (codex passes delayMs: 5000). Behavior-preserving consolidation; covered by a new killWithEscalation.test.js. (#1956)

  • [issue-1967] The slide-in Drawer primitive gained a tabbed, wider, deep-linkable layout — the shared right-side config drawer (client/src/components/Drawer.jsx) was a single flat scroll in a fixed ~520px panel, so large config surfaces (Edit App, Media Generation Settings, CoS task config) became page-length scrolls. It now takes a size prop (sm/md/lg/xl, the last two using more of a wide viewport via extra breakpoints; the old widthClass stays as a back-compat escape hatch), an optional tabs layout that renders a sticky TabPills bar under the header (collapsing to a <select> on mobile) with a per-tab scroll region that resets on switch, and a bodyClassName hook for multi-column tab bodies. A new useDrawerTab(paramName, defaultTab, tabIds?) hook backs the active tab with a caller-named URL search param so the open section is shareable/bookmarkable and degrades to the default on a stale link. Fully back-compat — omit tabs and it's the original flat drawer (existing EditAppDrawer/SyncDetailDrawer tests unchanged). This is the foundation for the drawer-UX epic (#1966); the per-surface migrations (#1968–#1973) build on it. (Closes #1967)

  • [issue-1972] SyncDetailDrawer now renders through the shared Drawer primitive — the per-peer sync-status/detail panel (client/src/components/sync/SyncDetailDrawer.jsx) hand-rolled the exact drawer shell (its own backdrop, fixed inset-y-0 right-0 <aside>, header/close button, Esc listener, and body scroll-lock) instead of reusing client/src/components/Drawer.jsx. It was the only hand-rolled clone left after the #1967 foundation, so it couldn't inherit future width/animation/a11y/mobile changes. It now mounts as <Drawer open onClose title="Sync Details" size="sm" closeLabel="Close sync details">, deleting the duplicated markup plus its own Esc/scroll-lock effects and the now-unused X import. Adopting the shared size="sm" (520px) replaces the old hand-rolled 480px so the drawer family stays consistent. To preserve its two-line header, the Drawer primitive gained an optional subtitle prop (rendered under the title in the header) — so the record-name stays a header concern instead of being nudged into the scrollable body with a fragile negative margin. Content, action buttons, and behavior are otherwise identical (all existing SyncDetailDrawer/SyncView/Drawer tests pass). (Closes #1972)

  • [media-gen-drawer-width] The "Media Generation Settings" drawer now opens wide and the tab strip lost its stray scrollbar. The three drawers that host the image/video generation settings (Image Gen, Video Gen, and the Storyboard panel) opened at the narrow default width, so the 7-section tabbed surface was crammed into a ~520px column with the tabs overflowing behind an ugly horizontal scrollbar and a lot of empty space. They now open at the lg width (up to 880px) so the tabs fit on one row and the content uses the space, and the shared TabPills pills variant now hides its horizontal scrollbar to match the underline variant. (client/src/pages/ImageGen.jsx, client/src/pages/VideoGen.jsx, client/src/components/writers-room/StoryboardPanel.jsx, client/src/components/ui/TabPills.jsx)

Full Changelog

Full Diff: https://github.com/atomantic/PortOS/compare/v2.24.0...v2.25.0