Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Merge remote-tracking branch 'origin/main' into next/issue-1848

[._.]/ Adam Eivya2cf6ab060c2
diff --cc .changelog/NEXT.md
index 06f4c6648f,33d745d4a4..e217614ce3
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@@ -34,9 -34,17 +34,18 @@@
- Catalog "Appears in" panel no longer renders dangling chips that deep-link to soft-deleted universe/series/creative-director targets — the detail page filters refs to live targets only (the orphan stays recoverable via the "Orphaned" album). Also fixed a stale resolver bug where soft-deleted Creative Director projects (#1564) wrongly resolved as live, and extended orphan-bucket detection so a deleted CD project's ex-cast surfaces as orphaned rather than unlinked. (#1812)
- **[issue-1836] Avatar GLB stream errors now return the standard error envelope** — when `GET /api/avatar/model.glb` hits a read error mid-stream (e.g. the file is removed after the existence check), the 404/500 JSON response carried a bare `{ error }` instead of the `{ error, code, timestamp }` shape every other PortOS endpoint stamps via `errorMiddleware`. Since the stream `error` event fires outside the request promise chain (where a throw would crash the process), the handler now stamps `code` + `timestamp` directly, so clients see a consistent error shape. (#1836)
+ ## UX & Theming
+
+ - **[issue-1851] Charts, button hovers, and terminal panels now follow the active theme** — several of the most-visible colors were hardcoded and stayed put when you switched themes. The health/meatspace charts (alcohol consumption, metric trend cards) drew their bars, gridlines, axes, reference lines, and tooltips with fixed hex values because chart SVG props can't read CSS variables; a new `useChartColors()` hook resolves the theme's `--port-*` tokens at render and re-resolves on theme switch, so charts now recolor with the rest of the app. The 13 primary call-to-action buttons across Goals, Story Builder, and Jira Reports used a hardcoded blue hover (`hover:bg-blue-600`) that diverged from a non-blue accent theme; they now hover as a shade of the active accent. The Chief-of-Staff terminal panel and the GSD/app document editors that hardcoded near-black backgrounds now use the theme's terminal-background token, and the Writers Room reading-mode ink color is centralized. (A broader sweep of the remaining ~900 off-token color utilities and a semantic purple token are tracked separately in #1909.) (#1851)
+
+ ## UX & Accessibility
+
+ - **[issue-1850] Calendar and message action buttons now meet the 44px minimum touch-target size** — the day/week/month calendar nav chevrons, the event-detail close button, and the message-detail action row (Reply / Voice / AI Reply / Refresh / Archive / Delete) previously rendered at ~28–31px, below the WCAG 2.5.5 / Apple HIG 44px minimum and awkward to tap on mobile. Each now enforces `min-w-[44px] min-h-[44px]` with centered icons, matching the shared `Drawer` close-button pattern, without changing the visual layout. (#1850)
+
## Internal
+- **[issue-1848] Strengthened weak truthiness test assertions** — replaced `toBeTruthy()` checks that would pass on wrong values with concrete value/shape assertions: `autobiography.test.js` now asserts the next-prompt object shape and round-trippable ISO-8601 timestamps for `createdAt`/`updatedAt`/`lastPromptAt`/`followUpsGeneratedAt` (with `updatedAt`/`lastPromptAt` proven strictly newer than the seeded old values); `storyBuilder.test.js` asserts `getSeries()` returns the matching `series.id` and `lockedAt` is a valid ISO timestamp; `commandSecurity.test.js` anchors the allowlist against known-safe membership (`git`/`gh`/`node`/`npm`/`pm2`/`ls`/`cat`/`echo`) and asserts dangerous commands stay absent, replacing the self-referential array-vs-Set check; and `fileUtils.test.js`'s visualTemplates resolution now asserts the returned path carries the `data/templates/` segment + unique basename. (#1848)
+ - **[issue-1849] Unit coverage for under-tested taskLearning + moltbook branch logic** — added sibling tests for previously-untested modules called out by the /do:better audit: `taskLearning/store.js` (`extractTaskType` classification arms, `calculateDurationETA` success-vs-total base + p80 clamp), `taskLearning/durations.js` (confidence tiering, totals fallback, queue-completion matching/formatting), `taskLearning/promptRecommendations.js` (success-rate status bands, error insights/hints, sort order), and `integrations/moltbook/challengeSolver.js` (number-extraction regex + 2-decimal formatting, provider selection, failure fallbacks). The promptRecommendations sort test surfaced and fixed a real bug — `priorityOrder[status] || 5` treated the top-priority `critical` status (value 0) as falsy and sorted the most urgent recommendation *last*; switched to `?? 5`. (#1849)
- **[issue-1841] Stopped silently swallowing errors** — replaced `.catch(() => {})` / bare `catch {}` swallows that discarded failures with no log or user signal. The recovery-critical completion writes in `cos-runner/index.js` (output.txt + completion metadata) now log a `console.error` on failure instead of silently dropping a finished task, and `telegramClient.js`'s poll loop logs non-abort errors (JSON/Type errors that were previously retried blind) before retrying. On the client, the silent initial-load `.catch(() => {})` swallows in `ToolsTab.jsx` (rate-limit / submolt / draft refreshes), the `loraTraining/*` pickers (`CharacterLoraChip`, `TrainingPanel`, `LiveSampleGallery`, `CheckpointPicker`, `ImportGalleryDialog`, `UniverseCharacterPicker`), and `meatspace/post/*` (`MemoryBuilder`, `MemoryPractice`, `PostHistory`, `PostDrillConfig`, `PostSessionLauncher`, `ElementsSong`) now `console.warn` the error while keeping their zero-state fallbacks, so a failed load is visible in the console instead of a silent empty state. (#1841)
- **[issue-1843] Logging hygiene: single-line interpolated logs + `parseInt` radix** — enforced the single-line-log convention across a handful of stragglers flagged by the `/do:better` audit. `useErrorNotifications.js` passed `error.context` as a raw object arg to `console.warn/error` (expanding a multi-field console group); it now interpolates the context as a single-line JSON suffix via a shared `formatContext` helper. `routes/database.js` had an embedded `\n` that split a failed-command log into two records — the detail is now whitespace-collapsed onto one line. The per-request route-path `console.log`s in `routes/agentActivity.js`, `routes/platformAccounts.js`, and `routes/agentPersonalities.js` (pure noise — mutations already persist via `logAction`) were removed. And `routes/digital-twin.js`'s `parseInt(req.query.limit)` gained its missing radix `10`. No behavior change beyond log formatting. (#1843)