Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
Release v2.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
dvhsizing). - Brain & CoS pagination + Windows CLI providers. The Brain and CoS-task list endpoints gained opt-in
limit/offsetpagination 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 nowclaude-sonnet-5; and a wave of refactors trimmed roughly 5,000 lines (shared stage-seed migration helpers, dropped thethree-fenestraandsaxdependencies, and declared toolkit extension points replacing runtime monkey-patching).
Self-Update
- The in-app update/reconcile no longer strands PortOS stopped.
updateExecutorlaunchedupdate.shwith a plainspawn(..., { 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 ownpm2-stopstep ranpm2 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 finalpm2 startwas dead — the "update/reconcile shuts everything down but never comes back" failure. On POSIX the script now launches throughspawnDetached()'s double-fork (the same reparent-to-init machinery LoRA training uses to survive PM2 restarts, #1332), withSTEP: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.mdcorrected (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/jobssurface, 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.mdtech stack + contributing notes,GOALS.mdnon-goals,docs/ARCHITECTURE.mddiagram/storage tier,docs/CONTRIBUTING.mdprerequisites,docs/TROUBLESHOOTING.mddatabase section,docs/features/memory-system.mdstorage story);docs/DEPS.mdtables resynced to the real dependency lists (saxremoved via #1824,portos-ai-toolkitvendored in-tree,googleapis→ scoped@googleapis/*, missingpdf-lib/sharp/undici+ client test deps + full override-pin list added);docs/GITHUB_ACTIONS.mdnow 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.cjsdocs (docs/PM2.md,docs/PORTS.md,docs/ARCHITECTURE.md) updated to the top-levelPORTSconvention and the realportos-uiprocess name. Organization: newdocs/README.mdmaster index (linked from the root README), convention READMEs fordocs/decisions/,docs/research/, anddocs/superpowers/, the brain build-plan artifacts moved fromdocs/features/brain/todocs/plans/, the undated research review date-prefixed, anddocs/SECURITY_AUDIT.mdlabeled 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 realclaude/codexsession 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 explicitPOST /api/meatspace/post/drill-cache/fillendpoint, gated behind a client-side consent modal (CacheFillConsentModalinWordplayTrainer.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 (triggerReplenishnow no-ops on a cold/empty cache). See the new "AI Provider Usage Policy" section inCLAUDE.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/.batshims on Windows; a bare command name likeopencodenever resolves there becausespawn()'s defaultshell:falsedoesn'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 newresolveWindowsExecutable(server/lib/bufferedSpawn.js) resolves a bare command to its actual.exe/.cmd/.batpath via a deliberately extension-aware filesystem search (skipping that stub). Critically, a resolved.cmd/.battarget still cannot be launched directly undershell:falseeven with the explicit extension — Node's CVE-2024-27980 patch makesspawn()/execFile()refuse batch files outright rather than safely auto-wrapping them — so a newprepareWindowsSafeSpawnwraps a batch target through Node's own documented-safe pattern,cmd.exe /c <path> <args>(a native.exetarget is launched directly, unwrapped). Becausecmd.exeis 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 ofshell:true's DEP0190 hazard (shell:truewith 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, andtestProvider()'s version probe (fixing the Test button's literal reported scenario). Because a.cmd/.battarget routes through an intermediatecmd.exeprocess, a plainSIGTERMonly kills that wrapper and orphans the real CLI process; every kill path for these processes (timeout, fallback-signal abort, Stop Run) now uses ataskkill /T /F-based process-tree kill on Windows (killProcessTree, extended to mark.killedsynchronously and to skip non-ChildProcesskillables like a node-pty TUI session, which has its own native teardown) and a plainSIGTERMelsewhere, unchanged. (#1865) - [claude-default-sonnet-5] Default Claude CLI/TUI providers now use
claude-sonnet-5for the medium tier. The seededclaude-code,claude-code-tui, and both*-bedrockproviders ship the new sonnet tier (claude-sonnet-5, Bedrockus.anthropic.claude-sonnet-5) in place ofclaude-sonnet-4-6, and the Anthropic model-refresh dropdown lists it first. Migration 153 bumps existing installs' sonnet tier fromclaude-sonnet-4-6→claude-sonnet-5— rewriting the models list and swapping any tier pointer still onclaude-sonnet-4-6, while leaving customized model lists and still-current pins (opus-4-8, haiku-4-5) untouched. Theclaude-sonnet-5context 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 anhtmlFor/idlabel 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/offsetpagination —GET /api/brain/people|projects|ideas|admin|memoriesandGET /api/cos/taskspreviously 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 acceptslimit/offsetquery 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/tasksthe paginated branch windows each source'stasksarray, adds apaginationblock, and drops the full-set derived collections (grouped,autoApproved,awaitingApproval) so the response is genuinely bounded rather than re-leaking the whole queue.limitdefaults to 50 and is clamped to 500. SharedisPaginationRequested/paginateArrayhelpers were added toserver/lib/validation.jsalongside the existingparsePagination. (#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 atmax-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 viaPUT /post/configand 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 loadsGET /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 shareddomainLabel/computeDomainAverageshelpers intoconstants.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 singlemax-w-3xlcolumn that stacked a lone overall-score line chart, a 3-up stat block, and the session table — surfacing only a fraction of whatgetPostStatsalready 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 itstext-*-400domain 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 viaDRILL_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-2xlcolumn 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 readablemax-w-2xlcolumn above the grid. Memory Practice (MemoryPractice.jsx) widens the reading-oriented screens tomax-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 comfortablemax-w-2xlfor readability. Session Results (PostSessionResults.jsx) widens tomax-w-4xland 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/:moderoute segment (Copy →/post/morse/copy, Send →/post/morse/send) and the reference tab in a?ref=tree|length|listsearch param (via the shareduseDrawerTabhook) — 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:modesegment falls back to the mode-picker grid (not a blank panel) and an unknown?refvalue falls back to the Tree view. NewNAV_COMMANDSentries (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/dueendpoint lists due items most-overdue first. - [issue-1992] Opt-in adaptive difficulty for mental-math POST drills. Math drill params (
steps/maxDigits/maxExponent/ estimationtolerancePct) 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 newGET /post/adaptive-previewendpoint, 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
localStorageprefs (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-copyand 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/showMsconfig 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 toImageGenTab(built on the sharedTabPills), 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 inCLAUDE.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 installedffmpeg), 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/youtubeis 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 savedstartSec/endSecoutright 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/beatAlignedfields 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..1energyper 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)inclient/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-passframePrompt/shotpromptper 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 ontoscene.sourceImageFile(the same field a manual reference image or i2v-continuation source already populates) by a newcreativeDirectorSceneImageHook, 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), skipsuseContinuationFromPriorscenes (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-cosfor CoS-agent runs,portos-serverfor 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 reusableProcessLogModalthat 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 distinguishabledownloaded-<id>.mp4, gets an auto-generated thumbnail, and — because it's written as asource: '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 backofflines on a 30s loop.startPolling()now checks the Tailscale backend state at boot (newgetTailscaleStatus/isTailscaleUpinserver/lib/tailscale.js, which readstailscale 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.netMagicDNS host or a100.64.0.0/10CGNAT 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
ImageGenSettingsFormas 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 themdsize so the per-model controls grid isn't cramped. The organization is opt-in via a newgroupedprop onImageGenSettingsForm, 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/uncaughtExceptionnet (defense-in-depth). The main server (server/index.js) already registered a process-level net via the sharedsetupProcessErrorHandlers()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-prefixedconsole.errorstyle, 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 throughnormalizeError, so the net can't itself throw on areasonwith 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'suncaughtExceptionbranch, which dereferencederror.stackon 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 guardserror instanceof Error(mirroring the existingunhandledRejectionbranch). 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 theuncaughtExceptionlistener tolerates a non-Error throw value. (Closes #1878)
Security
safeUrlFetchSSRF guard now pins the vetted IP at connect time, closing a DNS-rebinding TOCTOU —isPublicHttpUrlSaferesolved a hostname's DNS to validate it was public, but the subsequentfetchre-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 undiciAgentwhoseconnect.lookupalways 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 auditCVEs in the kokoro-js → protobufjs chain and the clientwstransitive — the server's[email protected]pulledprotobufjs <=7.6.0(GHSA-wcpc-wj8m-hjx6 DoS, GHSA-f38q-mgvj-vph7), and the staleprotobufjs: 7.5.9override sat inside the vulnerable range. Pinnedkokoro-jsto1.2.0(the audit-stated fix, still within the code's documented^1.2.xcompatibility window —KokoroTTS/TextSplitterStreamexports unchanged) and bumped theprotobufjsoverride to7.6.3in root +server/package.json. On the client,engine.io-clientnested its own[email protected](GHSA-96hv-2xvq-fx4p memory-exhaustion DoS) that the rootws: 8.21.0override couldn't reach; addedws: 8.21.0toclient/package.jsonoverrides. Bothnpm auditruns now report 0 vulnerabilities for these chains. (#1823) - Backup restore/delete path validation hardened —
subdirFilteronPOST /api/backup/restorewas an unconstrained string interpolated into an rsync--include=${subdirFilter}/***arg, so*could override the filter chain (restoring everything over live data) and../foocould 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 inrestoreSnapshotfor non-route callers.deleteBackuppreviously validatedfilename.replace(/[.]/g,'')(so the real dotted filename was never checked, leaving only thestartsWith(backupDir)guard) — it now validates the raw filename directly and explicitly rejects... (#1822) - Settings API no longer leaks third-party API tokens —
GETandPUT /api/settingsredacted only the top-levelsecretskey, soimageGen.hfToken(HuggingFace) andcivitai.apiKeywere 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-statusand/loras/auth/civitaistatus routes. On-disk values are untouched. (#1821) - Vision-test endpoint no longer reads arbitrary files —
POST /api/providers/:id/test-visiontookimagePathstraight 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 allowlistsimagePathto a real image basename underdata/screenshots(via the canonicalresolveScreenshotpath resolver), rejecting traversal and absolute-path escapes before any file is read or forwarded. (#1820) POST /api/runsvision screenshots no longer read arbitrary files — the same unsanitized-imagePathgap as #1820 lived in the vendored aiToolkit runner:screenshots[]was validated only asz.array(z.string())and passed straight toloadImageAsBase64, which didimagePath.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 untrustedPOST /api/runsboundary now sanitizesscreenshots[]via a newsanitizeScreenshotRefshelper thatbasenames each entry (collapsing both../traversal and absolute-path escapes, including the legitimate absolute paths the Runner UI uploads underdata/screenshots) and enforces an image-extension allow-list, returning a 400 for any non-image / traversal reference before the run is created. The sharedloadImageAsBase64loader additionallybasenames relative refs as defense-in-depth, while still passing trusted in-process absolute paths (e.g. Universe Builder gallery images underdata/images, already validated byresolveImageSources) through unchanged. Kept self-contained — no imports out of the toolkit. (#1870)
Added
- CoS
claim-issueswarm mode — the schedule config (CoS → Schedule → Claim Issue, and the resolvedclaim-workflow) gains a Swarm Mode selector that runs each scheduled claim in slashdo/do:next --swarmmode: 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;swarmCountis range-validated (0 = off, 2–6 = swarm size) insanitizeTaskMetadata. - Creative Director auto-compose — the Overview tab's Auto-cast control now has a
+ treatmenttoggle (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
+ portraitstoggle: 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'smusicBedfield 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 plaingit+ forge-CLI commit → push → open-PR-for-review →.agent-donesentinel 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 (GitHubghor GitLabglab) for review without auto-merging. Shipsopencode-ollama-tuito 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 —
startVideoDownloadpointed yt-dlp atdata/videoswithout 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 nowensureDirs 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:
ChiefOfStaffattached itssocket.on('connect', …)handler solely in the else branch (skipped when the socket singleton was already connected at mount) anduseMoltworldWsemittedagents:subscribeonce at mount with no connect listener at all. So after a reconnect thecos:*/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 everyconnect, matching the establishedShell.jsxpattern. (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 —
computeDragSpanfloored the out-point atstartSec + minSceneSecbefore 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-sidebeatSnapClipsre-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'shandlePresence/handleNearbygated the state write onagents.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 validateArray.isArray(agents)and callsetPresenceunconditionally for a well-formed array, so a confirmed-empty event clears the panel.presenceinitializes tonull(not-yet-known) rather than[], andWorldTabdistinguishes the two:nullfalls 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-servera SIGINT, but the graceful-shutdown handler hung forever, so PM2's default 1600mskill_timeoutSIGKILLed 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 calledhttpServer.close()afterio.close(), but socket.io'sio.close()already closes its currentthis.httpServer— and since everyio.attach()reassigns that reference (socket.ioindex.js:303), with HTTPS enabled it's the loopback mirror, not:5555. Callingclose()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 theawaitblocks until the 10s force-exit timer (which PM2 pre-empted with SIGKILL). The rewrittenshutdown(): force-drops long-lived SSE/keep-alive sockets withcloseAllConnections()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 neithercloseAllConnections()nor the server's connection tracker can reach can't stall the exit; bounds the DB-poolclose()the same way (a leaked/LISTENclient can't hang it); andunref()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-serveralso gains an explicit PM2kill_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 (notracksubscription) can resolve it, and a track delete fans the tombstone out the same way. ButcomputeAckedDeletesFromPayload(peerSyncReceive.js) only looked atrecord/issues, neverlinkedTrack, so such a peer could never ack a bundled track delete through any cursor — and the sender'strack-tombstone GC cohort (tombstoneGc.js) only ever waited on peers with a directtracksubscription, so it was entirely blind to a musicVideoProjects-only peer regardless of the ack fix. Implemented option (a) from the deferred #1858 review:computeAckedDeletesFromPayloadnow folds in a bundledlinkedTracktombstone'sdeletedAt, and thetrackGC cutoff additionally foldsmusicVideoProjectsubscribers into its cohort, reading their confirmed-delivery floor off a new bundle-specificlastConfirmedTrackBundleAtMs(stamped only when the bundled track merge actually succeeded — not the genericlastConfirmedPushedAt, 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
trackIdwithuploadedAudioFilename: 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 withLinked track not found/AUDIO_MISSING. Because the receiver'sresolveMasterAudioPath()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 viamergeTracksFromSyncand gated by the same tombstone/opt-out rules aslinkedCollection) and itsaudioFilenamebytes 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'strackId(no smuggling an unrelated track), and the bundle rides the push hash + schema gate + delivery-pending ack exactly like the existinglinkedCollection/manuscriptReviewbundles. (#1858) - [issue-1845] Client fetch hygiene — effect fetches now abort on cleanup and
windowis read lazily —StagePromptModelPickerfired two effectfetches guarded only by acancelledflag, so rapidstageNamechanges wasted in-flight round-trips; it now passes anAbortControllersignalto both and aborts on cleanup.LocalSetupPanel's/setup/checkfetch had no abort and itssetChecking(false)finallycould 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 amountedRef.VoiceCapturereadwindow.SpeechRecognitionat module scope — aReferenceErrorwhen the file is imported in an SSR/Node test context — now resolved lazily via auseStateinitializer that only runs in the browser. AnduseArmedAction'sfireis wrapped inuseCallbackso memoized children stay stable. (#1845) useEscapeKey/useClickOutsideno longer thrash their global listener on every render — both hooks kept the caller'shandler/onOutsidein the effect dep array, so thewindowkeydown/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 likePipelineManuscriptEditor/AnnotatedManuscriptSectionand on every render ofSceneCard/WorkEditor/UniverseBuilder. Both hooks now read the handler through a ref (the same patternuseKeyboardShortcutsalready uses), so the listener subscribes only whenactive(and, foruseClickOutside,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 aspawnSync('git', ['log', …])on the completion path of every failed CoS run (100ms–2s on a large repo); it now uses the async, hard-timeoutbufferedSpawn.buildId.jsstatSync'dclient/dist/index.htmlon 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 swappedexistsSync/statSyncfor asyncfs.access/fs.stat(via a new canonicalpathExistshelper infileUtils.js), and uploads now call the idempotentensureDirdirectly. Separately, the tombstone-prune paths for authors/tracks/creative-director projects (DB + file backends) wrapped their per-recorddeleteSyncBaseHashloops inwithBaseHashFlushBatch, collapsing Nsync_base_hashes.jsonrewrites into one. (#1828) - External API model/metadata fetches now time out instead of stalling callers indefinitely —
_fetchGeminiModels(Gemini model refresh inaiToolkit/providers.js) made afetchwith noAbortSignal, 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 sameAbortSignal.timeout(8000).fetchCivitaiModelandsearchCivitaiLoras(server/lib/civitai.js) likewise passed no signal, so a Civitai hang stalled LoRA metadata/search callers; both now default toAbortSignal.timeout(10000)and accept a caller-providedsignaloverride. (#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 crashgenerateSummaryon 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 bymemoryUpdateSchema'smin(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|| undefineddeleting the key —nullstill drops it (cosTaskStore.js). (#1826) - Unguarded async
child_processhandlers can no longer crash the Node process — severalclose/errorevent handlers wereasyncandawaited disk writes / completion bookkeeping with notry/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 inserver/services/runner.js(bothcloseanderror),videoTimeline/local.js,agentCliSpawning.js(bothcloseanderror), and both the CLIclosehandler and the detachedprocessStream().catchinaiToolkit/runner.js. The recovery paths now still settle callers waiting ononCompletewith failure metadata (so a finalization failure surfaces as a failed run instead of hanging forever), with the completion hook isolated fromonCompleteso a throwingonRunFailedcan't block the caller from settling. Also replaced the two silent recovery-critical.catch(() => {})swallows incos-runner/index.jswith 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.glbhits 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 viaerrorMiddleware. Since the streamerrorevent fires outside the request promise chain (where a throw would crash the process), the handler now stampscode+timestampdirectly, 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 withoutuseChartColors()(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-2is now defined and tuned per-theme across all 8 PortOS themes. Thecos/tabs/AgentCard.jsxJIRA 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.jsxforeground+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-bgtoken would have rendered light-on-light. The background now uses that token and the inner text uses opacity tiers of the paired--port-terminal-texttoken — 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 existingport-success/port-warning/port-error/port-accenttokens. 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 ofclient/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 followport-success/port-accent, and ClinVar severity + genetics-flavored icons and the recurring "Training mode" accent across the POST drill runners now followport-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-successinstead of fixed red/green, and the sharedToast.jsxsuccess/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 ingoalConstants.js, andGoalsTreeView.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 followport-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 followsport-accent-2, so these surfaces stay theme-consistent instead of a fixed yellow/blue/green/red/purple. The category-color enums inconstants.js(destination, project/idea/admin status, and confidence-tier palettes) andlinks/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 followport-accent-2instead of a fixed purple; the GSD tab's "Open Claude Code" launcher and its next-phase "Verify" action badge followport-accent-2; the app overview's enabled-PR indicator followsport-success; and a stage's version-history diff labels now match the diff viewer's ownport-error/port-successcoloring 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) ontoport-success/port-warning. TheproseTokenizer.jsx/ProseTokenPopover.jsxcharacter/place/object token-highlight colors and thewiki/constants.jsxandwiki/tabs/LogTab.jsxper-category/per-log-type palettes intentionally differentiate unrelated categories and were left as-is, along withLocalLlmTab.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.jsxforeground+background re-theme carried over cleanly — the coordinated--port-terminal-bg/--port-terminal-textre-theme from #1909 (commit 8298c5706) was already onmainbefore 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-themedCSS 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) andCityHud.jsx'sgetHealthSentinel/metricColorthreshold functions and connection-status dot duplicated the exact same system-health dataSystemHealthWidget.jsxalready renders withport-error/port-warning/port-success— these now match.CitySettingsPanel.jsx's "RESET DEFAULTS" button now usesport-errorlike other destructive actions app-wide (was raw red). Two amber notice messages inCityPlaybackOverlay.jsx(load-failure and "live data" notices) now useport-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 flatStatusBadgeconvention), andCityXpBadge.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 acrossAgentsPage,Ambient,Apps,HistoryPage,Loops,PipelineSeries,Review,Shell, andStoryBuilderonto 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 stalehover:bg-green-600/hover:text-blue-400hovers left behind after their base color had already migrated toport-success/port-accent.GitHub.jsx's private/fork/npm repo-attribute badges andCyberCity.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-themedCSS safety net inindex.cssplus 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 followport-accent-2; AIProviders' model-tier indicators (light/medium/heavy) followport-success/port-warning/port-errorand its TUI info banner followsport-accent; ChiefOfStaff's Start/Stop agent buttons, Pending stat icon, and AI-panel border accent followport-success/port-error/port-warning/port-accent-2; DataDog's and Jira's primary/save/delete/edit buttons and success/error banners followport-accent/port-success/port-error/port-warning; UniverseBuilder's delete-world button, remove-icon buttons, and "Generate From Idea" AI action followport-error/port-accent-2; CatalogIngredient's "extract" source badge followsport-accent-2; and RunsHistoryPage's "CoS" source badge followsport-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/Drawercomponents —ConversationViewer, the digital-twin Documents tab's "create document" and "delete document" dialogs, and the CoS task "mark as blocked" dialog had their own bespokefixed inset-0backdrop markup at inconsistent opacities (bg-black/50vsbg-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 duplicatedDrawer's mobile-full-width/desktop-~520px/backdrop/Esc behavior — now renders through<Drawer>directly;Drawergains an optionalcloseLabelprop (default unchanged,"Close settings") so the event panel's close button keeps its own accessible name instead of inheriting Drawer's settings-flavored one, andDrawer'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 everyDrawerconsumer. (#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 sharedDrawerclose-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-100with 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 fromLibraryPane— visible belowsm(opacity-100, oropacity-40where 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 belowsm. Fixed sites:CatalogIngredient(gallery picker + media tiles),Uploads(download/delete),CharacterSheet(avatar overlay), plus a grep sweep acrossNotificationDropdown,Layoutpin buttons,ArcCanvas, goals log/todo, MeatSpace calendar/life-events, brainLinkChip/FeedsTab, appsGitTabstage/unstage, digital-twinAccountsTab/ListEnrichment,RunnerPage,VideoTimelineEditor, andAsk. 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 offdvhinstead ofvh. The sidebar<aside>now mirrors the page root's existingh-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 forenv(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
Drawerconvention" bullet toCLAUDE.md(near the Layout/deep-linking conventions) covering thesizevariants (sm/md/lg/xl, mobile stays full-screen), when to tab vs. use grouped sections, the per-tab-scroll + state-hoisting rule, theTabPillsmobile<select>fallback ("reuseTabPills, never roll a new tab bar"), and deep-linkable active tab viauseDrawerTab— pointing atEditAppDrawer.jsx/ImageGenTab.jsxas worked examples andDrawer.jsxas the primitive. Added the design recorddocs/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.jsfull-sync coverage hermetic —getFullSyncCoverageForPeerwalks 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 localportosPostgres saw the coveragetotalcount 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 viaimportOriginal; only the DB-reading list function is overridden) and defaulted to empty inbeforeEach, 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 anode server/index.jslaunched from inside a CoS agent's git worktree (data/cos/worktrees/agent-*/) resolveddata//data.reference/to the worktree's checkout, which has no gitignored runtime tree — boot migrations then crashed on ENOENT (observed: migration 005 writingdata/prompts/stages/pipeline-arc-overview.md). Two fixes: (1) a durablePORTOS_DATA_ROOTenv var (newserver/lib/dataRoot.jsresolveInstallRoot), pinned at real launch inecosystem.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 inPATHS(server/lib/fileUtils.js),server/index.js's migration call, andscripts/run-migrations.js; falls back to the derived path when unset (backward compatible). (2) a defensive backstop inrunMigrations—isWorktreeRoot()detects adata/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 emptydata/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.jsnow asserts the next-prompt object shape and round-trippable ISO-8601 timestamps forcreatedAt/updatedAt/lastPromptAt/followUpsGeneratedAt(withupdatedAt/lastPromptAtproven strictly newer than the seeded old values);storyBuilder.test.jsassertsgetSeries()returns the matchingseries.idandlockedAtis a valid ISO timestamp;commandSecurity.test.jsanchors 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; andfileUtils.test.js's visualTemplates resolution now asserts the returned path carries thedata/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 canonicalestimateTokens()/CHARS_PER_TOKENfromserver/lib/contextBudget.jsat the usage-recording (server/index.js,services/agentRunTracking.js) and digital-twin-export (×5) sites, and dropped the shadowestimateTokensinservices/memoryEmbeddings.js(now re-exported fromcontextBudgetso existing importers are unaffected;truncateToTokensusesCHARS_PER_TOKENtoo). The CoS runner port5558was a raw literal incos-runner/index.js,services/cosRunnerClient.js, andservices/apps.js; the importableserver/lib/ports.jsmirror (previously only API/API_LOCAL/UI) now carries the remaining static ecosystem ports (CDP, CDP_HEALTH,COS, AUTOFIXER, AUTOFIXER_UI) and those sites usePORTS.COS(andPORTS.CDP/AUTOFIXER/AUTOFIXER_UIfor the sibling app definitions that were also literals). The CoS runner's kill/cleanupsetTimeoutliterals are now named (SIGKILL_GRACE_MS,ORPHAN_CLEANUP_DELAY_MS,SHUTDOWN_DRAIN_MS) and the server's graceful-shutdown force-exit timeout isGRACEFUL_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.countWordswas re-implemented inserver/lib/issueLength.jsandserver/services/writersRoom/local.js; both now import the new canonicalserver/lib/textUtils.js(the clientformatters.jsmirror is documented against it). Six services that open-codedmkdir(dir, { recursive: true })now uselib/fileUtils.jsensureDir(which swallows the spurious Windows EEXIST/EPERM the raw call doesn't). ThelogsandopenclawSSE routes route their response-header boilerplate throughopenSseStream, andX-Accel-Buffering: nomoved into the sharedSSE_HEADERS(so every SSE consumer disables proxy buffering). On the client, ~44new Date(x).toLocaleString()display sites now use the canonicalformatDateTimefor consistent date formatting, and several hand-rolled single-armed-row delete confirmations / saving-flag patterns adopt theuseConfirmDelete/useAsyncActionhooks. (#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(extractTaskTypeclassification arms,calculateDurationETAsuccess-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), andintegrations/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] || 5treated the top-prioritycriticalstatus (value 0) as falsy and sorted the most urgent recommendation last; switched to?? 5. (#1849)[issue-1841] Stopped silently swallowing errors — replaced
.catch(() => {})/ barecatch {}swallows that discarded failures with no log or user signal. The recovery-critical completion writes incos-runner/index.js(output.txt + completion metadata) now log aconsole.erroron failure instead of silently dropping a finished task, andtelegramClient.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 inToolsTab.jsx(rate-limit / submolt / draft refreshes), theloraTraining/*pickers (CharacterLoraChip,TrainingPanel,LiveSampleGallery,CheckpointPicker,ImportGalleryDialog,UniverseCharacterPicker), andmeatspace/post/*(MemoryBuilder,MemoryPractice,PostHistory,PostDrillConfig,PostSessionLauncher,ElementsSong) nowconsole.warnthe 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 +
parseIntradix — enforced the single-line-log convention across a handful of stragglers flagged by the/do:betteraudit.useErrorNotifications.jspassederror.contextas a raw object arg toconsole.warn/error(expanding a multi-field console group); it now interpolates the context as a single-line JSON suffix via a sharedformatContexthelper.routes/database.jshad an embedded\nthat split a failed-command log into two records — the detail is now whitespace-collapsed onto one line. The per-request route-pathconsole.logs inroutes/agentActivity.js,routes/platformAccounts.js, androutes/agentPersonalities.js(pure noise — mutations already persist vialogAction) were removed. Androutes/digital-twin.js'sparseInt(req.query.limit)gained its missing radix10. No behavior change beyond log formatting. (#1843)Dropped the
three-fenestradependency from CyberCity's interior-mapped window panes — the single call site (client/src/components/city/BuildingWindows.jsx) now uses an in-treeInteriorMappingMaterial(client/src/components/city/InteriorMappingMaterial.js), a self-containedMeshStandardMaterialsubclass that ports the parallax interior-mapping shader viaonBeforeCompileGLSL 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 (thesaxhalf shipped separately). (Closes #1874)[issue-1860] De-flaked the
peerSyncreciprocal-sync tests — the positivereciprocates a full-sync peer on peer:onlinetest waited for an async event handler with a hardsetTimeout(r, 30)before assertingenqueueReciprocalSyncwas 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 withvi.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:startandapp:deploySocket.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 nowpm2Standardizer.runStandardizeFlow()and the deploy flow (resolve app → check deploy script → run) is nowappDeployer.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-lineexport default makeSeedMigration(stageKey)call from a newscripts/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;filenamedefaults to${stageKey}.md(the universal convention, overridable for a divergent template), and nodown()is emitted because the runner (run-migrations.js) only ever callsup()and tracks applied migrations by filename. Boot-log copy is incidental and now uniformly keyed onstageKey. Net −2,500 lines; all 757scripts/tests pass unchanged, and the new_seedStageHelpers.test.jscovers 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-rolledfor (const stageKey of STAGES)loops — ~70 near-identical lines apiece.scripts/migrations/_seedStageHelpers.jsnow exportsmakeSeedMigrations(stageSpecs)(array of barestageKeystrings or{ stageKey, filename }) that runs the same copy-if-missing + merge-if-absent body per stage and writes the installedstage-config.jsononce with anN addedsummary;makeSeedMigrationis now a one-stage wrapper over it. All four migrations collapse to a 3-line call — including095, whose per-stagereturnsJsonflag 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.jsgains direct coverage of the array form and allscripts/tests pass unchanged. (#1891)Extracted a shared
withAbortTimeouthelper for the duplicated peer-fetch timeout boilerplate — thenew AbortController()+setTimeout(abort)+finally{clearTimeout}triple was hand-rolled at 12 federation/probe call sites (4 ininstances.js, pluspeerSocketRelay,peerSync,peerCosSync×2,peerSyncAssets,peerSyncPush,peerMediaLibrarySync,sidecarSync). It can't reusefetchWithTimeoutbecausepeerFetchneeds the Tailnet-insecure HTTPS agent. The newserver/lib/abortTimeout.jswithAbortTimeout(timeoutMs, fn)runsfn(signal)under a timedAbortControllerand 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 (probePeershares one signal across three parallel fetches and their body reads). ThepeerFetchcall 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.jspreviously reached into the toolkit runner's private surface, overwritingexecuteCliRun/executeTuiRunand re-wrappingstopRun/isRunActive/deleteRunto consult an ad-hoc_portosActiveRunsmap, plus inlining a 34-line update-marker IIFE in bootstrap. The toolkit runner (server/lib/aiToolkit/runner.js) now exposessetCliRunner()/setTuiRunner()and an external-run registry (registerExternalRun/unregisterExternalRun/hasExternalRun) that its ownstopRun/isRunActive/deleteRunconsult 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.jstracks its child processes via the registry, and the update-marker read/validate/record/cleanup lifecycle moved into a unit-testedprocessUpdateMarker()inserver/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-linemeatspace.jsrouter (14 health sub-domains, each backed by its own service import) is split one concern per file (meatspaceCoreRoutes.jsoverview/config/birth-date/death-clock/LEV,meatspaceAlcoholRoutes.js,meatspaceNicotineRoutes.js,meatspaceHealthRoutes.jsblood/body/BP/workouts/epigenetic/eyes,meatspacePostRoutes.jsPOST drills + training + memory builder,meatspaceCalendarRoutes.jslife calendar/activities/events,meatspaceExportRoutes.jsMortalLoom export), assembled by a thinmeatspace.jsbarrel that mounts each under/api/meatspace— the same patternroutes/cos.js/routes/brain.jsuse; the split is wiring-only (the 70-route surface is byte-identical, verified). The 1,805-linevideoGen/local.jshad its BYOV runtime management (venv/helper-script path constants,BYOV_RUNTIME_INFO, install/ready/fingerprint probes) extracted tovideoGen/runtimes.jsand its render-history I/O (loadHistory/saveHistory) tovideoGen/history.js;local.jskeeps 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 thinbrain.jsbarrel that mounts each sub-router under/api/brain— the same patternroutes/cos.jsalready uses. The split is wiring-only: route paths, ordering (literal-before-:idroutes stay within their owning sub-router), validation, and the barrel's default export are unchanged, soserver/index.jsand the existingbrain.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 #1151peerSyncValidation.js/creativeDirectorValidation.jsprecedent) 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), andpipelineValidation.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 thevalidateRequest/validate/parsePaginationhelpers, and re-exports the four new files (flat) so every existing deepimport { x } from '../lib/validation.js'callsite keeps working unchanged; the barrel surfaces each as a namespace export. The new domain files import onlyzodCompat.js+ leaf constant modules (never back throughvalidation.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(thepushRecordToPeerpipeline + payload builder + schema-gate bookkeeping),peerSyncReceive.js(applyIncomingPush+ reverse-subscribe + merge dispatch),peerMediaLibrarySync.js(#1566 media-library sweep), andpeerCosSync.js(#1650 CoS history + tasks).peerSync.js(~985 lines) stays the orchestrator — subscription CRUD, the debounced push scheduler, therecordEvents/peer:onlinelisteners, and the boot-timeregisterSubscriptionAdapterwiring — 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-peerSyncShareddesign 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 held2,400 lines of shared infra plus a 68-entry480 lines) stays the public entry point — assemblingEDITORIAL_CHECKSarray (each embedding a fullrun(ctx)closure) is now split: shared infra lives incheckInfra.js, the 68 checks are grouped by category intochecks/*.js(naming,cast,pov,characterArc,continuity,comic,visual,scene,dialogue,proseStyle,research), andcheckRegistry.js(EDITORIAL_CHECKSfrom the per-category arrays and keeping the registry's lookup/state helpers. The check files import shared infra fromcheckInfra.js(not back through the registry) so theEDITORIAL_CHECKSspread can't hit a TDZ on the checks' eagerly-evaluatedconfigSchemas. The editorial barrel's public API is byte-for-byte identical (173 exports, verified) and all editorial + runner tests pass unchanged. (#1829)Dropped the
saxdependency from the Apple Health XML importer — the 500MB-export streaming path now uses a self-contained ~190-lineRecordparser (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 thesaxhalf of #1824; the clientthree-fenestrashader 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 canonicalatomicWritehelper (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), andvideoGen/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.jshad fourdescribeblocks that re-implemented production logic inline and tested the copies, so the real code could regress while the suite stayed green: an inlineERROR_PATTERNS/categorizeError, an inlineresolveFailedTaskStatus(which omitted theMAX_TOTAL_SPAWNSshort-circuit andcompactionmetadata that the realresolveFailedTaskUpdatehas), and stubexitCodeMessages/buildSpawnArgsliterals exported from no production module. The error-classification and retry-decision blocks now live inagentErrorAnalysis.test.jsagainst the real exportedERROR_PATTERNS(viaanalyzeAgentFailure) and a new pureresolveFailedTaskDecisionhelper extracted fromresolveFailedTaskUpdate(the async wrapper delegates to it and just stamps timestamps + creates the investigation task — behavior-preserving); the exit-code block is replaced by a newagentRunTracking.test.jscovering the realextractErrorFromOutputmapping; and the redundant spawn-args stub is dropped sinceagentCliSpawning.test.jsalready covers the realbuildCliSpawnConfig. 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/inlinestripHtmlhad drifted into near-identical copies acrossappleHealthXmlParser.js,claudeChangelog.js,pinterestFeed.js,feeds.js, andmessageGmailSync.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 newxmlEntities.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_PM2pm2-kill shim), and the previously-untestedproviderSchema/validateexports ofserver/lib/aiToolkit/validation.js. Coverage hits the real branch points:parseTsMsnon-string/unparseable returns,compareNewerWins/compareEarlierWinstie + unparseable-side + ISO-vs-non-ISO + antisymmetry;mirrorTimestampcalendar-rollover normalization, year-0000 rejection, ±expanded-year rejection, 0001/9999 bounds;agentGuardEnvguard-dir-first PATH order,Pathfallback, real-pm2 resolution, plus thebin/pm2bash shim's actual block behavior (spawns the shim with a stub real-pm2 to assertpm2 kill/startup/unstartupanddelete/stop/restart allare blocked case-insensitively while scoped/read-only commands pass through, and the no-pm2-found 127 path);providerSchemaendpoint''/null→undefined coercion, id slug regex + 80-char max,numCtx512–1048576 bounds, andvalidate'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'screateAutoFixTask(triggered byseverity: 'critical'orcanAutoFix, covering bareuncaughtException/unhandledRejection— no repro steps, no live process state, since the process already crashed) andagentManagement.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'screateInvestigationTask) already required approval first; these two were the outliers, and both shipped with zero test coverage for this branch. CoS's ownlearning.jsonhistory bears this out — this task class runs rarely and has a materially worse success rate than the reviewed-first paths. Flipped both toapprovalRequired: trueand 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-lifecyclesetTimeoutcallback in try/catch and unref'ing the timer (codex passesdelayMs: 5000). Behavior-preserving consolidation; covered by a newkillWithEscalation.test.js. (#1956)[issue-1967] The slide-in
Drawerprimitive 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 asizeprop (sm/md/lg/xl, the last two using more of a wide viewport via extra breakpoints; the oldwidthClassstays as a back-compat escape hatch), an optionaltabslayout that renders a stickyTabPillsbar under the header (collapsing to a<select>on mobile) with a per-tab scroll region that resets on switch, and abodyClassNamehook for multi-column tab bodies. A newuseDrawerTab(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 — omittabsand 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 reusingclient/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-unusedXimport. Adopting the sharedsize="sm"(520px) replaces the old hand-rolled 480px so the drawer family stays consistent. To preserve its two-line header, theDrawerprimitive gained an optionalsubtitleprop (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
lgwidth (up to 880px) so the tabs fit on one row and the content uses the space, and the sharedTabPillspills 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