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 pull request #415 from atomantic/claim/codex5-client-error-reporter

[._.]/ Adam Eivy3741843ca3b3
diff --cc PLAN.md
index 2d7aee9b87,7fbac6420f..20987175b5
--- a/PLAN.md
+++ b/PLAN.md
@@@ -4,9 -4,9 +4,8 @@@ For project goals, see [GOALS.md](./GOA
## Next Up
-- [ ] [agent-spawn-widen-try-finally-guard] **Widen the `spawningTasks` guard in `agentLifecycle.js` to cover the whole spawn path.** `server/services/agentLifecycle.js:~165` adds `task.id` to `spawningTasks` but the `try/finally` only wraps a narrow window; an uncaught throw inside `buildAgentPrompt`, `writeFile('prompt.txt')`, `createAgentRun`, or `registerAgent` (lines ~165–525) leaks the guard forever, permanently blocking re-spawns of that task id until process restart. Four `it.skip('TODO(plan.md backlog): …')` tests at `agentLifecycle.test.js:440-490` already pin the regression and flip green on fix. Single-user system means a stuck guard is silently un-recoverable.
-- [ ] [backport-pre-023-migrations-to-_lib] **Back-port pre-023 prompt-replace migrations onto `scripts/migrations/_lib.js`.** 003 / 004 / 005 / 006 / 010 / 013 / 019 all clone the inline `applyMigration` + per-file scan + customized-skip warning pattern that `_lib.js` now centralizes. Wrap any `OLD_SHIPPED_MD5: string` entries (003 / 004 / 006) into single-element arrays to match the `accepted[filename]: string[]` shape. Drop ~70 LOC per migration; nothing changes behaviorally so the only risk is mis-typed hashes — review each diff alongside a re-run of its test against the `_testHelpers.js` `runPromptMigrationTests`. Settled-history migrations have a higher rewrite-bar than active code, so a separate PR with focused review is appropriate. Surfaced by /simplify during `[pipeline-idea-stage-character-detail-plumbing]`.
+- [ ] [bump-stale-shipped-md5-on-settled-migrations] **Bump stale `NEW_SHIPPED_MD5` entries on settled migrations + add `runPromptMigrationTests` coverage.** Migrations 003 / 004 / 005 / 013 still record their original NEW hash, but downstream migrations have since evolved the same files (e.g. 003's `pipeline-idea-expansion.md` is at the post-025 hash today, 005's `pipeline-arc-overview.md` is at the post-019 hash, 013's `pipeline-comic-script.md` is past `133d200d069c2e8173b7c129eea58f53`). That's a latent bug: a fresh install with `data/migrations.applied.json` cleared misclassifies every shipped file as "customized" instead of "already current," and `runPromptMigrationTests`'s drift-catch can't be wired up. Per the 019 convention, bump each migration's `NEW_SHIPPED_MD5` entry to the current `data.sample` hash and append the intermediate hash(es) to `ACCEPTED_OLD_MD5`; then add a `<num>.test.js` that calls `runPromptMigrationTests`. Skipped from `[backport-pre-023-migrations-to-_lib]` because that PR was scoped to a pure refactor.
- [ ] [codex5-polling-consolidation] **[P2][PERF]** Migrate remaining `setInterval` callers to `useAutoRefetch`. The shared hook at `client/src/hooks/useAutoRefetch.js` exists; 20+ pages/components still spin local `setInterval`s — ChiefOfStaff, Brain, DigitalTwin, Loops, Browser, CyberCity, ImageGen, Ambient, AgentsPage, calendar, meatspace, city tabs. Migrate each to `useAutoRefetch` (which already provides the `document.visibilityState === 'hidden'` short-circuit); for domains with a Socket.IO event stream, switch to event-driven refetch instead of polling.
- - [ ] [codex5-client-error-reporter] **[P2][OBSERVABILITY]** Funnel client errors into Review Hub. `client/src/main.jsx`'s `window.onerror` + `unhandledrejection` listeners only `console.log` today. Add `POST /api/client-errors` with redaction (drop tokens / long payloads) + rate-limit (~1/sec, drop duplicates by message+stack hash). Surface grouped client errors in the Review Hub feed; optionally raise a CoS task at a configurable threshold.
- [ ] [codex5-dashboard-intent-layouts] **[P2][DASHBOARD]** Finish intent-named layouts + morning default + widget suggestions. `server/services/dashboardLayouts.js` seeds `morning-review` and `ops` already; still missing `Deep Work`, `Health`, `Agent Watch`. Add the three remaining seeded layouts, a "make this my morning default" toggle that activates a layout in a configured time window, and a "widget suggestion" hint: when a layout omits a widget whose data source is populated (e.g. layout has no calendar widget but calendar is connected), surface an inline "Add Calendar?" affordance.
- [ ] [codex5-onboarding-capability-map] **[P2][ONBOARDING]** Capability map of connected systems. One page showing each integration's status: Providers (per-provider configured/available/throttled), Calendar, Brain/memory embeddings, Voice (mic + TTS), Tailscale + HTTPS, Genome/health imports, Telegram/messages, App registry/PM2. Each row links to the relevant settings page. Doubles as a setup checklist and a runtime health overview.
- [ ] [migrate-two-remaining-local-formatters] **Migrate two remaining local formatters surfaced during the module-discovery PR.** Two additional local format definitions were found that aren't in the original tracker: (1) `client/src/components/calendar/EventDetail.jsx:10` defines `formatDateTime(dateStr, isAllDay)` with an all-day branch the shared `formatDateTime` lacks — extend the shared helper to take `{ allDay: true }` or keep this local and rename to `formatEventDateTime`. (2) `client/src/components/cos/tabs/TaskItem.jsx:78` defines `formatDurationMin(mins)` with a `~` approximation prefix (`~3h 30m`) — extend shared `formatDurationMin` with an `{ approximate: true }` option. Low priority; visual semantics need to be preserved exactly.