Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
docs: flatten plan backlog
[._.]/ Adam Eivy520e86df82c4
diff --git a/PLAN.md b/PLAN.mdindex 3a69062ed2..501adec70d 100644--- a/PLAN.md+++ b/PLAN.md@@ -4,11 +4,9 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [.changel## Next Up-1. **[video-resume-restore-keyframes]** **VideoGen resume: restore keyframes from the active job.** `ACTIVE_JOB_PARAM_FIELDS` in `server/routes/videoGen.js` (~line 739) intentionally omits `keyframes` (gallery filename + frame-index pairs for multi-keyframe FFLF) because the v1 resume effect doesn't repopulate the picker UI for them. A user who reloads mid-render on a keyframe job loses the keyframe-picker state even though every other form field is restored. Whitelist `keyframes` in the route AND wire a `setKeyframes()`-style setter in `client/src/pages/VideoGen.jsx`'s resume effect (~line 507). Independent of the SSE re-attach.-## Backlog-Claimable, well-specified, no decision needed — `/claim`-able. Unordered.+- [ ] [video-resume-restore-keyframes] **VideoGen resume: restore keyframes from the active job.** `ACTIVE_JOB_PARAM_FIELDS` in `server/routes/videoGen.js` (~line 739) intentionally omits `keyframes` (gallery filename + frame-index pairs for multi-keyframe FFLF) because the v1 resume effect doesn't repopulate the picker UI for them. A user who reloads mid-render on a keyframe job loses the keyframe-picker state even though every other form field is restored. Whitelist `keyframes` in the route AND wire a `setKeyframes()`-style setter in `client/src/pages/VideoGen.jsx`'s resume effect (~line 507). Independent of the SSE re-attach.- [ ] [unify-media-job-sse-hook-imagegen-videogen] **Unify ImageGen + VideoGen SSE attach into `useMediaJobSse` hook.** Both pages now have near-duplicate EventSource handlers (ImageGen `startLocalGeneration` ~lines 655 + resume block ~317; VideoGen `attachJobEvents` ~line 450). Build a hook on top of `useSseProgress` (`client/src/hooks/useSseProgress.js`) that handles the queued / started / status / progress / complete / error / canceled SSE types and consolidate both sites.- [ ] [capabilities-cheap-memory-count] **Capabilities route should count active memories without sorting/paginating.** `GET /api/capabilities` calls `getMemories({ status: 'active' })` (`server/routes/capabilities.js` ~line 69) only to read `.total`, but `getMemories` loads the full index, filters, sorts, and paginates before returning `{ total, memories }` — the sort + slice is wasted work on a page polled every ~20s. Add a lightweight `countMemories({ status })` (or a `countOnly` option) to `server/services/memory.js` that returns the filtered count without the sort/paginate, and switch the route to it. Micro-opt; the index is cached via `loadIndex`, so low urgency.- [ ] [banner-icon-aria-hidden] **Apply `aria-hidden="true"` to `<Banner>`'s rendered icon.** `client/src/components/ui/Banner.jsx` (~line 62) renders the `icon` prop as a bare `<Icon …>` — when the icon is decorative (the body text already conveys the meaning), screen readers should skip it. Either wrap the icon render in `<span aria-hidden="true">` inside Banner, or thread an `iconAriaHidden` prop. Once landed, re-migrate the `ImportTab.jsx` error row to `<Banner tone="error" size="md" icon={AlertCircle} actions={…}>` (it was reverted from `<Banner>` because the icon prop doesn't pass through a11y attributes).@@ -16,103 +14,13 @@ Claimable, well-specified, no decision needed — `/claim`-able. Unordered.- [ ] [rich-text-editor-for-prose-stage-replace-plain] **Rich-text editor for prose stage.** Replace the plain textarea in `ProseStage.jsx`. **Decision (resolved 2026-05-30): reuse the existing Writers Room editor** rather than introducing a new markdown-editor dependency — it already exists, keeps the prose-editing experience consistent across surfaces, and avoids a third editor stack. Extract/share the Writers Room editor component for the prose stage.- [ ] [scene-level-wardrobe-picking-per-scene] **Scene-level wardrobe picking.** Per-scene `characterAppearances: [{ characterId, wardrobeId? }]` on storyboard scenes with a wardrobe-picker dropdown. **Decision (resolved 2026-05-30): the user picks (no extractor guess), and wardrobe is APPENDED after `physicalDescription` (it does not substitute body fields).** Rationale: wardrobe is a deliberate creative choice — auto-guessing adds noise the user must then correct, and substituting body fields would lose canonical character description. Both are reversible if the extractor-guess path is wanted later.- [ ] [setup-browser-canary-headless] **Managed-browser headed/headless default.** `data.reference/browser-config.json` ships `"headless": true`, but `browser/server.js`'s header comment says "Default headed" and opting into Canary at setup currently runs it invisibly. **Decision (resolved 2026-05-30): default HEADED.** The whole purpose of the custom-Chrome-binary feature is a *visible, differentiated* browser, so headless-by-default defeats it. Flip the seed to `"headless": false` AND set `config.headless = false` in `scripts/setup-browser.js#applyCanaryToConfig` (this also closes item (c) of `[chrome-canary-followups]`). Ship a one-time migration that flips the seed value only where the installed config still matches the old shipped hash; leave user-customized values alone.--## Deferred Architecture (human-led planning)--God-file decomposition candidates — none are bugs; pick up when touching the file for unrelated reasons.--- `server/services/cos.js` (3115 LOC) — split into cosTaskStore / cosTaskGenerator / cosJobScheduler / cosHealthMonitor.-- `server/services/agentLifecycle.js` (1446 LOC) — extract prepareAgentWorkspace / resolveProvider / processCompletion.-- `server/services/identity.js` (1917 LOC) — separate genomic markers + longevity + goals + todos.-- `server/services/taskSchedule.js` (2369 LOC) — extract prompt management to `taskPromptService.js`.-- `server/services/taskLearning.js` (1939 LOC) — separate metrics aggregation from heuristic routing.-- `server/services/autonomousJobs.js` (1567 LOC) — extract job registry / scheduler / execution paths.-- `server/services/voice/tools.js` (1284 LOC) — group by domain (UI / calendar / brain / media) into siblings.-- `server/services/git.js` (1271 LOC) — extract command builders + parsers.-- `server/cos-runner/index.js` (1076 LOC) — extract spawn / lifecycle / IPC layers.-- `server/services/memory.js` (1049 LOC) — separate retrieval, classification, persistence.-- `server/services/xcodeScripts.js` (1131 LOC) — collapse repeated AppleScript builders.-- `server/routes/apps.js` (1180 LOC) — extract `npm install` orchestration to `appBuilder.js`.-- `client/src/pages/VideoGen.jsx` (1361 LOC) — extract mode-specific control panels (i2v / a2v / extend / FFLF).-- `client/src/pages/ImageGen.jsx` (1182 LOC) — extract preset picker + multi-reference uploader.-- `client/src/components/goals/GoalDetailPanel.jsx` (1252 LOC) — god component.-- `client/src/components/meatspace/tabs/CalendarTab.jsx` (1269 LOC) — extract grid renderer + goal-link panels.-- `client/src/components/cos/tabs/ScheduleTab.jsx` (1088 LOC) — extract schedule editor + run history table.-- `client/src/components/writers-room/StoryboardPanel.jsx` (1199 LOC) — extract scene tile + render dock subcomponents.-- `autofixer/ui.js` (972 LOC) — inline HTML template needs extraction.-- API contract — standardize error response shapes (`asyncHandler` + `ServerError` everywhere).-------## Blocked on decision / design (skip for `/claim`)--Items here need a research / design pass, an explicit decision, or a precondition to fire before any code can land — `/claim` should skip them by default. **Each item that is blocked on a decision the user must make carries a `❓ **Question:**` line; answer it and move the item back up to Next Up / Backlog.**--### Audio / Video / Image gen--- [ ] [pipeline-audio-phase-4c-2-4c-3-4d-2-local-oss] **Pipeline Audio Phase 4c.2/4c.3/4d.2.** Local OSS music gen (MusicGen sidecar; pick generator first); 3rd-party engine stubs; VO line muxing into the CD stitch with per-line offsets + music-bed ducking.- > ❓ **Question:** Which local OSS music generator should the sidecar use? **Recommendation: MusicGen** (Meta; MLX-portable, runs locally, bounded ~30s clips, well-supported) for the first slice, with AudioLDM2 as a possible second backend and a commercial API (Suno, duration control) deferred to the 3rd-party-stub phase. Confirm MusicGen, or name a different starting generator.-- [ ] [whole-episode-audio-generation-strategy-stop] **Whole-episode audio generation strategy.** Stop relying on per-clip audio; drive audio gen from episode-level prose/script arc. New `audioMode: 'per-clip' | 'silent' | 'generated' | 'uploaded-track'`. Treat as a new sub-brainstorm when picked up — investigation first.- > ❓ **Question:** Two decisions gate this: (1) which generator family — local-bounded (MusicGen-MLX, ~30s), local long-form (AudioLDM2), or commercial (Suno, real duration control)? and (2) at what granularity does episode-level audio drive — one track per episode, per-scene beds, or per-arc cues? Pick a generator + granularity and I'll scope the `audioMode` design from there.-- [ ] [world-builder-phase-2-external-sd-api-per-bucket] **World Builder Phase 2 — external SD-API + per-bucket model overrides.** Wire Together / Replicate / Fal into the world-builder batch path so high-end renders are practical; let each bucket pick its own model.- > ❓ **Question:** Is high-end external-SD-API rendering a priority now, or stay local-only for World Builder? With the 128GB machine online, local 9B–17B models may cover the quality need without adding a third-party render dependency + key management. Greenlight external providers, or defer?-- [ ] [native-fflf-deeper-test-on-real-keyframe-pairs] **Native FFLF deeper test on real keyframe pairs.** Validate with last frame of clip A + first frame of clip B from the same scene; expose more pipeline knobs (cfg-scale, stg-scale, stage1-steps) if interpolation looks weak.- > ❓ **Question:** This needs you to supply (or point me at) a real keyframe pair from the same scene to validate against — it can't be self-tested without representative content. Do you have a clip-A-last / clip-B-first pair I should test with, or should I synthesize a stand-in pair?-- [ ] [episode-video-provider-picker-runwayml-third-party] **Episode-video provider picker (RunwayML / third-party).** _Trigger-gated on a code precondition, not a user decision:_ once the provider abstraction lands, expose the picker on `EpisodeVideoStage`.-- [ ] [comic-book-pdf-export-once-stages-comicpages] **Comic-book PDF export.** _Trigger-gated on a code precondition, not a user decision:_ once `stages.comicPages` carries enough panel data + rendered images, export print-ready PDF.--### Large product / UX redesigns--These are strategic roadmap items, not single-decision blocks — they need a design pass and prioritization against GOALS.md before any can be `/claim`-ed. **Prioritization pass needed: which (if any) of these are the next milestone?**--- [ ] [writers-room-phases-4-5-phase-4-synced-prose] **Writers Room Phases 4–5.** Phase 4 synced prose/script/media review; Phase 5 realtime CD feedback. Builds on the unified bible/scene model. See [writers-room.md](./docs/features/writers-room.md).-- [ ] [cybercity-v2-phase-2-deeper-drill-down-per-agent] **CyberCity v2 Phase 2+** — deeper drill-down: per-agent spatial trail, system flow lines between buildings, recent-action timeline overlay. See [cybercity-v2.md](./docs/features/cybercity-v2.md).-- [ ] [m50-p9-cos-automation-rules-automated-email] **M50 P9 — CoS Automation & Rules.** Automated email classification, rule-based pre-filtering, email-to-task pipeline.-- [ ] [m50-p10-auto-send-with-ai-review-gate-per-account] **M50 P10 — Auto-Send with AI Review Gate.** Per-account/per-recipient trust level + dual-LLM review (drafter + reviewer). Auto-send only when both approve or trust ≥ 0.9. See [messages-security.md](./docs/features/messages-security.md).-- [ ] [m34-p5-p7-digital-twin-multi-modal-capture-voice] **M34 P5-P7 — Digital Twin.** Multi-modal capture (voice/video/image identity sources), advanced testing, personas. Ties to GOALS.md "Multi-Modal Identity Capture".-- [ ] [cross-domain-insights-engine-m42-p5] **M42 P5 — Cross-Domain Insights Engine.** Connect genome ↔ health ↔ taste ↔ identity ↔ creative output into narrative insights surfaced in Brain. GOALS.md flags this as the next milestone for "Digital Identity Modeling" but no design has been written.- > ❓ **Question (design pass — answer all four to unblock):** (a) Which signal pairs are worth correlating first (e.g. genome↔longevity, taste↔creative-output, health↔goals)? (b) Where do insights land — a new `/insights` surface, or fold into the Brain daily/weekly digest? (c) How does the user dismiss / accept an insight? (d) Does the LLM receive a structured "facts table" or raw stage data?-- [ ] [codex5-unified-review-queue] **[P1][PRODUCT]** Cross-domain Review Queue (the "inbox zero" for PortOS). One page (`/review` or `/inbox`) that collects: Brain inbox items needing classification, Ask answers ready for promotion, CoS completed tasks pending approval, Message drafts awaiting send, Health anomalies pending acknowledgement, and failed syncs / imports / backups. Each row has accept / dismiss / drill-down. Build the surface aggregator first, then opt each producer into it.-- [ ] [codex5-health-provenance-chips] **[P1][HEALTH][TRUST]** Extend Ask's source-chip pattern to MeatSpace / genome / death clock / longevity views. Each insight tags itself as `data-backed | inferred | experimental | speculative` with a "what would change this?" explainer and a clinician-export view for blood + lifestyle data. Pairs with `[codex5-decision-provenance-everywhere]`.-- [ ] [codex5-autonomy-guardrails] **[P1][AUTONOMY]** Per-domain autonomy levels + dry-run + budgets + while-away briefing. Today CoS has a single global autonomy posture. Split into per-domain knobs (Brain auto-classify, Memory auto-extract, CoS auto-run, Messages auto-send) each with `off | dry-run | execute`. Add spending / time / token budgets per domain. Add a "what did agents do while I was away?" digest pulling from the existing CoS / agent run logs into a daily briefing card.-- [ ] [codex5-mobile-task-flows] **[P2][MOBILE]** Five phone-native flows: (1) system health + one-tap restart of an app, (2) one-tap voice/text Brain capture, (3) "what should I do now?" Ask, (4) approve / reject a CoS result from a notification, (5) log a health/lifestyle event in ≤10 seconds. Each should be reachable in ≤2 taps from a Tailscale-launched mobile session.-- [ ] [codex5-sidebar-collapse-ia] **[P1][IA]** Collapse sidebar to 8–10 top-level domains + Pinned + Recent. Today the sidebar carries deep nested tabs at the same level as top-level domains; review recommends `Home, Ask, Apps, CoS, Brain, Calendar, Goals, Health, Dev Tools, Settings` only at the top level with deep tabs pushed into each page's local tab bar and Cmd+K. Add Pinned + Recent sections driven by the user's actual working set. Touch every consumer of `Layout.jsx`'s nav tree; expect alphabetical ordering convention to survive.-- [ ] [codex5-visual-modes] **[P2][DESIGN]** Product-specific visual modes: `Ops` (dense terminal-like, minimal animation), `Focus` (quiet, spacious, only next actions), `Health` (warmer, less cyber, more explanation), `Review` (document-like, optimized for reading + decisions). Needs a day-mode selector to switch between them. Extend the existing Tailwind token system rather than introducing a parallel theming layer.-- [ ] [codex5-decision-provenance-everywhere] **[P2][DESIGN]** Decision/provenance pattern across CoS, Insights, Health, Goals, Dashboard widgets. Each AI-generated or rule-driven surface answers: "Why am I seeing this?", "What data backs this?", "What changed?", "What can I do next?" Reuse the Ask source-chip component. Pairs with `[codex5-health-provenance-chips]`.-- [ ] [codex5-empty-states-teach] **[P3][ONBOARDING]** Workflow-teaching empty states. Each "no data" state replaces "Nothing here" with a setup hint that names the next action: "Connect calendar to unlock schedule-aware goals", "Add birth date + genome file to unlock longevity estimates", "Capture 10 notes to improve Ask Yourself", "Configure one API provider to enable autonomous CoS". Inventory empty states first, then prioritize by which pages new users hit earliest.--### Trigger-gated (waiting for a code precondition — not a user decision)--These fire on a code-side event (Nth consumer, a prior item landing, an observed perf problem), not on a human decision — leave them parked until the trigger occurs. The three phosphene items carry a `❓ **Question:**` because they additionally need a scope/product call from the user.--- [ ] [useasyncaction-post-unmount-setstate-guard-add] **`useAsyncAction` post-unmount setState guard.** Add `mountedRef` to gate `setRunning(false)`. YAGNI today; do at 4th consumer.-- [ ] [extract-usecanonpatch-universe-setuniverse] **Extract `useCanonPatch(universe, setUniverse, universeId, mountedRef)`.** `UniverseCanon.jsx` + `NounsStage.jsx` 95% identical optimistic-patch handlers. Extract when a 3rd caller appears.-- [ ] [shallow-equal-guard-in-usemediaannotations-socket] **Shallow-equal guard in `useMediaAnnotations` socket handler.** Speculative micro-opt; theoretical until observed.-- [ ] [low-client-extract-shared-usepopoverposition-hook] **[LOW][CLIENT]** Extract shared `usePopoverPosition` hook — **premise eroded; revisit when a 3rd caller lands.** Today the pattern lives in exactly two components (`client/src/components/ThemeSwitcher.jsx` and `client/src/components/media/CollectionPickerShell.jsx`) — both implement portal-with-fixed-positioning + `useLayoutEffect` measurement + rAF-coalesced scroll/resize listeners. With only 2 callers the abstraction isn't worth the indirection; extract when a third surface needs the same shape.-- [ ] [pill-component-goaldetailpanel-migration] **Migrate `GoalDetailPanel.jsx`'s badges to the shared `<Pill>`.** `GoalDetailPanel.jsx`'s badges were intentionally left out of `[shared-pill-chip-component]`: their colors are computed from data (`GOAL_TYPE_CONFIG[].bg/color` ~line 384, `CATEGORY_CONFIG`/`urgencyColor()` ~571-581, tag chips ~528/707, `CHECK_IN_STATUS_CONFIG` ~993), so they don't map to a fixed `tone`. They'd migrate via `<Pill tone="bare" bordered={false} className={`${cfg.bg} ${cfg.color}`}>`, which only consolidates the structural `rounded px-2 py-0.5 text-xs` shape — not the colors. Marginal benefit + many edits in a 1252-LOC god-component, so deferred. Do it opportunistically when next touching the file (pairs with the `GoalDetailPanel.jsx` god-component split under "Deferred Architecture").- [ ] [setup-data-import-drift-tables-from-migrations] **`setup-data.js` should import drift tables from each migration file.** `SHIPPED_PROMPT_OLD_MD5` + `SHIPPED_PROMPT_NEW_MD5` in `scripts/setup-data.js:139-196` manually mirror the `ACCEPTED_OLD_MD5` + `NEW_SHIPPED_MD5` exports each migration file already maintains. The mirror is hand-edited every time a migration ships and is the most likely place to drift. After `[backport-pre-023-migrations-to-_lib]` lands, every prompt-replace migration will export those constants — `setup-data.js` can build the tables by sweeping/glob-importing the migration files and removing the mirror entirely. Single source of truth, no hand sync.-- [ ] [parallelize-applypromptreplacemigration-files] **Parallelize `applyPromptReplaceMigration` per-file scan.** Today every prompt-replace migration covers exactly one file, so the serial `for (await readFile…)` loop in `scripts/migrations/_lib.js` costs nothing. When the first multi-file migration lands, fold the loop into `Promise.all(Object.keys(accepted).map(async filename => …))` and accumulate the `{ updated, alreadyCurrent, skipped }` counters post-flight. Theoretical until needed.-- [ ] [shots-aware-scene-output-contract-partial-split] **Shots-aware scene-output-contract partial.** Split into `_partials/scene-fields-core.md` + `_partials/scene-fields-shots.md` when a third shots-using stage appears.-- [ ] [ref-watch-phosphene-bump-ltx2-pin-v0148] **Bump `LTX2_PIN` from `f8f20c83` to v0.14.8 + adopt phosphene's frame_rate / class-rename / a2v / lora-fusion patches together.** From `reference-watch` review of phosphene (2026-05-22). Concrete upstream wins between PortOS's pin and current dgrauet HEAD: VAE auto-tiling that caps peak Metal memory on HD / long runs (#25), `_pending_loras` honored across every pipeline's `load()` override (#22, #23 — fixes silent character-LoRA-drops on Extend/HQ), `--lora` on `--low-ram` flow (#30), accurate transformer load-time markers for progress UI. Cost: in v0.14.x, `TextToVideoPipeline` / `ImageToVideoPipeline` / `ExtendPipeline` / `TwoStagePipeline` / `AudioToVideoPipeline` are all renamed (public surface becomes `TI2VidOneStagePipeline`, `RetakePipeline`, `TI2VidTwoStagesPipeline`, `A2VidPipelineTwoStage`, etc.). `generate_ltx2.py` would fail at import. Source commits: `2166d138` / `770ed0bd` (defensive imports v2), `94ae3430` (method-presence dispatch instead of class assumption), `aa235aa0` (`fps=` → `frame_rate=` shim), `681f429a` (a2v missing `frame_rate=` runtime patch), plus `[ref-watch-phosphene-lazy-eval-env-bootstrap]`. Scope: large (100–200 lines of careful Python touching every pipeline path, plus smoke test of every mode — text/image/fflf/extend/a2v — at the new pin).- > ❓ **Question:** Do you want to take on this large/risky pin bump now? My recommendation if yes: **ship it as one PR (not per-mode)** — the class renames touch every pipeline's import simultaneously, so a half-migrated state won't even import; one PR with a full five-mode smoke test is safer than partial landings. And do it **after** the post-decode `os._exit(0)` work (`[ref-watch-phosphene-mlx-post-decode-os-exit]`) so the hang-mitigation is in place first. Confirm "yes, one PR, after os._exit" or tell me to defer.-- [ ] [ref-watch-phosphene-sigkill-watchdog-videogen-local] **Panel-side SIGKILL watchdog (Node layer) in `videoGen/local.js`.** From `reference-watch` review of phosphene (commit `94bd6965`, 2026-05-22). Even with helper-side `os._exit(0)` adopted, defense-in-depth at the Node layer is cheap insurance: watch stdout for the upstream "[Decoding video + audio + muxing] done in X.Xs" line (or the final `{"video_path": ...}` JSON), then arm a 30–45s grace timer that SIGKILLs the child if it doesn't exit. PortOS already has SIGTERM→SIGKILL escalation in `cancel()` (`server/services/videoGen/local.js:71-79`); reuse that path. **Trigger:** only do this if real users hit the hang after the pin bump and `os._exit(0)` proves insufficient. Scope: small/medium.- [ ] [data-versioning-centralize-cosagents-settings] **Centralize `cosAgents.js` + `settings.js` on `atomicWrite` + `createFileWriteQueue`.** Both currently bypass the shared helpers and roll their own read/write paths. Audit each call site, migrate to the established pattern, run the existing tests. Low-risk mechanical refactor; do it once a CoS PR happens to be open.-- [ ] [data-versioning-cache-invalidation-on-split] **Cache invalidation hooks in `brainStorage.js` / `messageSync.js` / `meatspacePostDrillCache.js` — needed only when their backing collections split.** These caches don't touch universe data so they were safe to skip for PR #458. When a future PR splits Brain or Messages collections into per-record `collectionStore` layouts, audit each cache for "cache key ↔ split-record-id" consistency: per-id writes are visible to other readers without going through the cache, so any cache that fronts the now-split file needs an invalidation event hook (or a switch to read-through against `store.loadOne`).-- [ ] [data-versioning-typeindex-config-convention] **Establish a convention for the `config` slot on `data/{type}/index.json`.** `createCollectionStore` left `index.json`'s `config` open and unused — the first real consumer (probably the pipeline-issues split's history/runs analog) should pick the shape and document it in `server/lib/README.md` + the `collectionStore.js` header. Candidate shape: `{ config: { runs?: [], featureFlags?: {}, lockPolicies?: {} } }` — but defer the decision to the first real need.- [ ] [cos-task-id-uniqueness-validation] **CoS task-ID uniqueness — validate at parse, not silently in `reorderTasks`.** Two related risks: (1) `server/lib/taskParser.js` `parseTasksMarkdown` doesn't detect duplicate task IDs — corrupted markdown propagates downstream; either throw on duplicate or warn + dedupe with a suffix. (2) `server/services/cos.js` `reorderTasks` (~line 2781) builds a `new Map(tasks.map(t => [t.id, t]))` which silently collapses duplicates — only the last wins, losing the others on the reorder write-back. Fix order: harden the parser so reorder can rely on uniqueness, then keep the Map-build as-is or assert uniqueness defensively.- [ ] [cos-runner-client-non-json-response-handling] **`cosRunnerClient.js` fetch wrappers — handle non-JSON runner responses.** `spawnAgentViaRunner` and siblings (~`server/services/cosRunnerClient.js:139`) `await response.json()` unconditionally; if the runner returns a 500 HTML error page (e.g. PM2 crash mid-restart) the client crashes with `Unexpected token <` instead of surfacing the runner's actual error. Wrap each parse in `try { JSON.parse(text) } catch { { error: text } }` and propagate the synthesized error so the caller sees a useful message.- [ ] [cos-agent-output-write-amplification] **`appendAgentOutput` write-amplification — already batched via `appendAgentOutputLines`, audit non-runner producers.** CLAUDE.md documents the streaming-producers convention (batched variant + ~250ms debounce + drain on completion); the runner path uses it. Verify every producer that calls `appendAgentOutput` directly (`server/services/cosAgents.js:216`) is human-pace, not a hot loop. If any hot producer is still calling the per-line variant, migrate it. Likely a no-op audit; capture it so the convention doesn't silently drift.- [ ] [cos-on-demand-mark-app-review-started-dedupe] **`evaluateTasks` on-demand loop — dedupe `markAppReviewStarted` calls per app.** When multiple on-demand requests for the same app are queued in a single evaluation cycle (`server/services/cos.js:730`), `markAppReviewStarted` is called once per request — wasted state writes. Collect unique `appId`s before the loop and call once. Nit-level priority.- [ ] [subagent-spawner-top-level-side-effects] **`subAgentSpawner.js` top-level side effects — move init into an explicit `initSpawner()`.** Module-load (`server/services/subAgentSpawner.js:153`) wires event listeners + timers, which interferes with test isolation (each test import re-arms them). Wrap the init block in `export function initSpawner()` and call it from `server/index.js` after dependencies are ready. Treat as a refactor — needs care that no consumer relies on the import-time wiring.-- [ ] [ref-watch-phosphene-long-clip-temporal-boost-12fps] **"Long Clip Temporal Boost" (render at 12fps, interpolate to 24fps).** From `reference-watch` review of phosphene (commit `53585fc`, 2026-05-22). Phosphene added a 12fps render path that uses ffmpeg's `minterpolate` / RIFE downstream to fill back to 24fps, doubling the effective clip length per memory budget. PortOS doesn't have an interpolation post-step in `server/services/videoGen/local.js`. The math helpers (`_duration_to_8k_frames`, LTX `8k+1` frame-count snapping) are useful regardless.- > ❓ **Question:** Is a 12fps-render-then-interpolate mode worth a feature surface? It doubles max clip length per memory budget, but there's no user pain motivating it today and minterpolate can introduce artifacts. Want it (I'll scope a `--target-fps` + interpolation post-step), or skip?-- [ ] [ref-watch-phosphene-t2v-standard-env-gated-two-stage] **Env-gated two-stage T2V perf experiment.** From `reference-watch` review of phosphene (commit `5004b40b`, 2026-05-28). PortOS's `run_text` already routes through `TwoStagePipeline` *when `cfg_scale` is set* (~line 221) — but the default no-CFG path uses single-stage. Phosphene's experiment routes T2V Standard through `pipe.generate_two_stage()` (half-res Stage 1 + 2× latent upsample + 3-step Stage 2 refine) even without CFG, gated on an env flag. Predicted ~30-35 % wall-time reduction on T2V Standard. Fix: in `run_text`, when `cfg_scale is None`, branch on a new `PORTOS_T2V_TWO_STAGE` env to call `pipe.generate_two_stage(...)` with stage1_steps=8, stage2_steps=3, cfg_scale=1.0. Scope: small.- > ❓ **Question:** Land this behind an `A/B env knob` first, or — once you've eyeballed the quality on a couple of test prompts — just flip two-stage on as the universal T2V Standard default? Recommendation: ship the env knob first, validate quality on your prompts, then flip the default in a follow-up. Confirm "env knob first" or "flip default directly."--### Duplicate resolution + conflict journal — deferred follow-ups (2026-05-25)--Surfaced while building the sync-hygiene feature. Consciously scoped out of v1.-- [ ] [conflict-journal-media-collections] **Conflict journal does not cover media-collection scalar overwrites.** `mergeMediaCollectionsFromSync` (`server/services/mediaCollections.js`) LWW-overwrites scalars (name/description/coverKey/universeId/seriesId) when `remoteWins`; items are union-merged (never lost). v1 hooks only universe + series merges because the whole-record content hash used by `conflictJournal.detectConflict` would false-positive on collections whenever items differ. Doing it right needs scalar-subset hashing that stays consistent with the sender-side base hash. Low value (scalar loss is minor), deferred.- [ ] [conflict-journal-issues] **Issue-level conflict journaling.** The share-bucket importer hook (`server/services/sharing/importer.js` `applyAutoMerge`→`mergeOne`) is gated to `universe`/`series`; child issues ride LWW silently. Extend the journal to issues (needs the issue merge path to thread a `source` + call `maybeJournalBeforeOverwrite`).- [ ] [conflict-journal-deep-diff] **`diffSummary` is top-level shallow only.** `conflictJournal.diffSummary` compares top-level fields via canonicalStringify, so the UI shows "categories differ" rather than which variation/canon entry changed. Add per-field deep diffing for richer InlineDiff rendering in the Conflicts tab.@@ -123,46 +31,19 @@ Surfaced while building the sync-hygiene feature. Consciously scoped out of v1.- [ ] [dup-detect-collection-count-undercount] **`duplicateDetection.collectionItemsByUniverse` last-wins instead of summing.** Uses `.set(universeId, length)` while `seriesByUniverse` accumulates with `+`; if two live collections share a `universeId`, `linkedCollectionItemCount` undercounts the survivor-suggestion heuristic. Sum like the series count. Surfaced in /code-review (low, display only).- [ ] [conflict-journal-push-flush-coalesce] **Coalesce per-push base-hash flushes.** `pushRecordToPeer` (`server/services/sharing/peerSync.js` ~947) stamps a base hash and calls `flushBaseHashes()` per pushed universe/series, so a large push loop rewrites `sync_base_hashes.json` once per record. A `setTimeout`-based debounce was tried and reverted (the unref'd timer leaked into `peerSync.test.js`'s settle-waits and made the suite flaky). A safe coalescing approach (microtask/`queueMicrotask` batch within a single push burst, or a test-injectable scheduler) could land the optimization without the timer-leak flake. Low priority.- [ ] [conflict-journal-base-hash-prune] **`sync_base_hashes.json` grows unbounded.** `server/lib/conflictJournal.js` seeds a base hash per synced universe/series and never prunes entries for deleted/tombstoned records. Tiny per-entry, but a long-lived install accumulates dead keys. Add a sweep (drop keys whose record no longer resolves) to the tombstone GC path.--### Storage scalability — deferred follow-ups (2026-05-26)--- [x] [media-collections-per-record-store] **Migrated `media-collections.json` to the per-record `createCollectionStore` layout** (migration `059-split-media-collections.js`, boot verifier wired, dataSync watch path → dir, full reader/writer + sync rewrite). Design record: `docs/plans/2026-05-31-media-collections-per-record-store.md`. Follow-ups surfaced in `/simplify` and deferred below.--#### media-collections store — deferred follow-ups (2026-05-31)-- [ ] [makesplitmigration-shared-factory] **Extract a shared `makeSplitMigration` factory into `scripts/migrations/_lib.js`.** The monolithic→per-record split scaffolding (`fileExists` / `readJsonStrict` / `readJsonTolerant` / `writeJson` + the `withFileTypes` already-split scan + the gate1/gate2/recovery/split/stamp/backup body) is now copied verbatim across **four** migrations: `034-split-universe-builder`, `035-split-pipeline-issues`, `036-split-pipeline-series`, `059-split-media-collections`. They differ only in `{ typeDirName, legacyFilename, backupSuffix, typeSchemaVersion, typeLabel, recordsKey, idPattern, buildConfig }` (e.g. `config: { runs }` for universes vs `config: {}` for collections). `_lib.js` already houses cross-migration families (`makePromptReplaceMigration`, layout helpers) — add a split family there and collapse the four to ~15-line config blocks. Pre-existing duplication; 059 was the 4th copy. Own change + test surface, so deferred out of the migration PR.- [ ] [mediacollections-deterministic-loadone-fastpath] **`findCollectionByUniverseId` / `findCollectionBySeriesId` (and the `findOrCreate*` provisioners) `loadAll()` where a deterministic `loadOne(uc-/sc-<id>)` fast-path would usually hit.** `server/services/mediaCollections.js` — these scan every record by stamp to also catch legacy unconverged collections at random ids. peerSync calls the lookups per outbound push (`peerSync.js:608/1108/1175`), so a `loadOne(linkedCollectionId({...}))`-first / `loadAll`-fallback would cut the warm path to O(1). Modest under single-user load; kept as a faithful scan for now.- [ ] [mediacollections-parallel-merge-prune] **Parallelize the multi-record loops in `mergeMediaCollectionsFromSync` and `pruneTombstonedCollections`.** Both iterate distinct record ids in a sequential `for await` over `queueRecordWrite` — different ids use different per-record queues, so a bounded `Promise.all` (use the shared bounded-concurrency mapper) would fan out the snapshot-apply batch (`dataSync.js` passes a full collections list) and the GC sweep. Most peer pushes carry a single record so the realized win is the snapshot/GC paths only; low priority.--### Browser / Chrome-variant + commands hardening (review candidates, 2026-05-25)-- [ ] [commands-centralized-parser] **`commands.js` re-implements command parsing with a naive `split(/\s+/)` instead of the centralized quote-aware parser.** `server/services/commands.js:28` splits on whitespace (breaks quoted args) and only imports `ALLOWED_COMMANDS`/`DANGEROUS_SHELL_CHARS` from `commandSecurity.js` — not its `parseCommandArgs`/`validateCommand`. Route through `validateCommand` so allow-listing, dangerous-char checks, and quote-aware arg parsing are one verified step. Verified (gemini IMPROVEMENT).--### Worktree cleanup — deferred follow-ups (2026-05-25)-- [ ] [worktree-remove-helper] **Extract the repeated "worktree remove --force → on-fail rm + prune" dance into one helper.** The pattern is now inlined in 4 spots in `server/services/worktreeManager.js`: `removeWorktree`, `reapMergedWorktrees`, `cleanupExternalRepoWorktrees`, and `removePersistentWorktree`. Extract `forceRemoveWorktreeDir(repo, worktreePath, label)` and route all four through it.- [ ] [plan-task-prefer-merge] **Switch the `/claim` (`plan-task`) Phase-6 merge order to prefer `--merge` over `--squash`.** The live `plan-task` prompt in `server/services/taskSchedule.js` (~line 562) still tries `gh pr merge --auto || --squash || --merge || --rebase`, so `/claim` squash-merges by default — inconsistent with the `--merge`-first default now used by the review-loop / `/do:pr` agent prompts. Deferred because: (a) `plan-task` is a **version-migrated** prompt, so the change needs a `PROMPT_VERSIONS['plan-task']` bump (7→8) **and** the v7 default preserved in `PREVIOUS_DEFAULT_PROMPTS['plan-task']` (~190-line byte-exact copy); (b) `/claim` self-cleans its worktree/branch regardless of merge method; and (c) `reapMergedWorktrees` detects squash merges anyway. Low benefit, non-trivial migration cost — do it as a focused follow-up when touching `plan-task` prompt versioning next.--### Importer provider/model picker — deferred follow-ups (2026-05-26)-- [ ] [shared-optional-provider-picker] **Add an optional/"Default" mode to the shared provider/model picker and migrate the inline copies.** Three pages now hand-roll the same inline two-`<select>` "Default sentinel + provider + model" picker because the shared `ProviderModelSelector.jsx` + `useProviderModels.js` force a selection. UniverseBuilder.jsx (~2968) and Importer.jsx (~437, plus its `getProviders`+enabled-filter effect ~93 and `llmModels` memo) duplicate the logic in `FeatureProviderPicker.jsx`/`useProviderModels`. Add an `emptyOption`/`allowDefault` prop to `ProviderModelSelector` and an `allowDefault`/`includeEmpty` flag to `useProviderModels` that skips the auto-select, then refactor both. Note the importer's default label must stay accurate to its *per-stage* resolution. Cleanup only; no behavior change.- [ ] [importer-screenplay-teleplay-seed] **Mirror the comic-script verbatim-seed for screenplay imports → `stages.teleplay`.** The comic-script import now seeds the verbatim script into `stages.comicScript` (ready) instead of `stages.prose`, via the `CONTENT_TYPE_SEED_STAGE` table. Adding screenplay is a one-row change: `'screenplay': 'teleplay'`. Also extend the auto-run script-first guard in `autoRunner.js` (currently checks `comicScript || teleplay` already) and check whether any downstream teleplay consumer parses a specific format (the comic path needed `parseComicScript` taught the bare `PAGE/PANEL` form).--### Importer backport/merge code-review follow-ups (2026-05-26)-- [ ] [importer-progress-hook] **Extract a `useImporterProgress` hook.** The `importer:progress` socket subscription is hand-rolled in `client/src/pages/Importer.jsx` (~60-86) — raw `socket.on/off` + `activeRunIdRef` runId-filter in a page `useEffect`, duplicating the lifecycle already factored into `useImageGenProgress` / `useMediaJobProgress` / `usePipelineAutoRunProgress`. Extract to `client/src/hooks/useImporterProgress.js`, register in the hooks `index.js` barrel + README. Also fold the `ImporterProgress` checklist's status→icon ternary into a shared lookup.- [ ] [importer-progress-reconnect] **Live checklist stalls if the socket misses the `start` frame.** The `importer:progress` handler gates every `stage` frame on a runId set only by a `start` frame; a mid-analyze socket reconnect means stage frames are dropped and the checklist stays on "Starting…" until analyze resolves. Degrades gracefully. Fix: if a `stage` frame arrives while `analyzing` with no active runId, adopt it and lazily seed the stage list, OR have the server resend `start` on (re)subscribe.- [ ] [importer-retry-arcsummary-empty] **Retry's `arcSummary` uses `||` truthiness, dropping an intentionally-cleared summary.** `runRetryIssues` in `Importer.jsx` builds `arcDraft?.summary || arcDraft?.logline || ''`, so clearing the summary in Review falls back to the logline rather than sending none — violates the absent-vs-intentionally-empty rule. Non-fatal. Fix: treat `summary === ''` as an intentional clear (`summary == null ? logline : summary`).-- [ ] [importer-orphan-shell-gc] **An abandoned analyze leaves an empty universe/series shell on disk.** `analyzeImport` persists universe+series after canon+arc succeed, so if the user abandons after an issue-split failure on a brand-new universe/series, empty shells linger in `data/`. By-design, but a periodic GC of zero-issue, zero-canon shells older than N days (or marking analyze-created shells `ephemeral` until commit promotes them) would keep `data/` clean.--### v2.11.0 release-review follow-ups (2026-05-27)-- [ ] [comic-allcaps-continuation-vs-cue] **`normalizeBareComicScript` in `server/lib/comicScriptParser.js` (~line 193) can misread a short all-caps continuation line (e.g. a bare `STOP` mid-balloon) as a new speaker cue.** The continuation branch's `!BARE_SPEAKER_LINE.test(t)` guard exists so a genuine second speaker opens a new balloon — but an all-caps shouted continuation with no punctuation matches the same shape. A proper fix needs one-line lookahead (a real cue is followed by its own dialogue line; a trailing shout is followed by a marker/EOF) — which means converting the `for…of` line loop to indexed iteration. Deferred as IMPROVEMENT: flipping the heuristic instead would regress the more-common multi-speaker case.- [ ] [voice-taskcomplete-announce-once-guard] **`onTaskUpdated` in `server/services/voice/proactiveTriggers.js` (~line 193) re-announces if an already-completed voice-dispatched task is updated again.** The spoken "your coding task is done" line keys on `tasks:changed action:'updated'` + terminal status + `voiceDispatch`, with no record of already-announced task ids — so a future caller that runs `updateTask` on an already-completed voice-dispatched task would re-fire the announcement. Fix: track announced task ids in a `Set` in the closure (clear on unwire), OR gate on the previous→terminal status *transition*. Low severity — deferred per YAGNI since the re-update path doesn't exist today.--### Unified Story Builder — deferred follow-ups (2026-05-27)--- [ ] [story-builder-import-aesthetic-readermap-gaps] **Import pre-fills arc/characters/issues but NOT universe aesthetic or reader map.** `analyzeImport` creates the universe with only a name (no logline/premise/styleNotes/influences) and the importer never extracts a reader map — yet `createStorySession` import-branch marks every step `ready`. So in an imported session the universeAesthetic + readerMap steps show empty content under a misleading "Ready" badge. Mitigations in place: the session `seedIdea` is seeded from the extracted arc summary, and generateStep's expand falls back through `seedIdea`→universe name. Follow-up: either mark only the importer-filled steps `ready` (others `pending`), or extract a starter/aesthetic + reader-map pass during import.- [ ] [story-builder-issue-llm-seeding] **Seed issues from the arc inside the builder.** The `issues` step currently lists existing issues and links out to the Pipeline to create/produce them. Add a "Generate issues from arc" action that calls `generateSeasonEpisodes` (arcPlanner) per season and persists via `createIssue`, so the user doesn't have to leave the builder. Per-issue lock + production handoff already work.- [ ] [story-builder-sse-progress] **SSE streaming for long generations.** `generateStep`/`refineStep` are synchronous request/response — fine for arc/reader-map but a long arc-overview blocks the button with only a spinner. Add a `GET /api/story-builder/:id/steps/:stepId/progress` EventSource endpoint (reuse `client/src/hooks/useSseProgress.js`) and stream stage progress like the pipeline auto-run does.- [ ] [story-builder-arc-refine-feedback] **AI refine-with-feedback for the plot-arc step.** `refineStep` supports `universeAesthetic`, `readerMap`, and `characters`, but `plotArc` only offers full regenerate (`generateArcOverview`) — there's no "refine the arc against this note" path. Add an arc-refine prompt + `refineArc` in `arcPlanner.js` and wire it into `refineStep`'s `plotArc` branch + the `StepPanel` plotArc RefineBox.@@ -170,25 +51,16 @@ Surfaced while building the sync-hygiene feature. Consciously scoped out of v1.- [ ] [story-builder-create-rollback] **`createStorySession` seed mode leaves an orphan universe if `createSeries` throws.** `server/services/storyBuilder.js` creates the universe shell, then the series shell, with no rollback — a `createSeries` failure leaves a stray universe (which also fired peer auto-subscribe) with no session pointing at it. Wrap the two creates so a series failure deletes the just-created universe, or create the series first.- [ ] [story-builder-goto-step-gate-divergence] **Two `setStoryCurrentStep` paths swallow a rejection and navigate anyway.** (a) `goToStep` in `client/src/pages/StoryBuilder.jsx` (~line 769) on a manual step click and (b) the `lock.toggle` `onSuccess` auto-advance (~line 754). If the server re-gate rejects the move while the client's `staleSteps` is stale, the UI lands on the target step but the persisted `currentStep` pointer stays behind. Either toast + revert nav on rejection, or refetch on failure. Both paths share the fix.- [ ] [story-builder-import-partial-commit] **Import flow doesn't handle a partial commit.** `ImportPanel.importAndBuild` calls `commitImport` once; if it fails after the universe/arc/canon persist but the issue-create rolls back, it just toasts a generic error. Re-clicking re-sends the full payload — a retry could duplicate issues. The standalone `Importer.jsx` guards this with the `arcAlreadyPersisted` retry (sends `arc:null, seasons:[]`). Either reuse that path or surface a "open in the Importer to recover" link.-- [ ] [universe-styleImageRefs-wire-and-journal] **`styleImageRefs` is wire-synced but not version-gated, and feeds the conflict-journal content hash.** `sanitizeRecordForWire('universe')` ships `styleImageRefs` to peers; an older peer drops it on receive and, after its own edit bumps `updatedAt`, LWW-strips it back off a newer peer. Separately, `contentHashForRecord` now includes `styleImageRefs`, so a probe render can contribute to a 3-way-divergence conflict-journal entry whose diff won't mention it (`RESTORABLE_FIELDS.universe` omits it). Options if it becomes annoying: bump the `universes` schema version (gate it), make `styleImageRefs` local-only (strip from wire), or exclude it from the content hash. Deferred — low-stakes, regenerable.- [ ] [story-builder-extract-image-render-hook] **Cleanup: the image-render lifecycle is duplicated 5×.** `StepCharacters` (StoryBuilder.jsx) + `StyleProbeImage.jsx` each re-implement `getSettings → readPipelineImageSettings → imageCfg` + a single-render jobId lifecycle, and `StepCharacters` near-verbatim copies `UniverseCanonSection`'s styled-render-and-persist routine. Extract a `useImageRenderSettings()` + `useSingleImageRender({ buildPrompt, onComplete })` hook and a shared canon styled-render helper. Also: `ProviderModelPicker` (StoryBuilder.jsx) duplicates the Importer's `LlmPicker` + `SeriesLlmPicker`/`FeatureProviderPicker`/`StagePromptModelPicker` — promote one shared provider/model picker.-- [ ] [story-builder-session-sync] **Optional cross-machine resumable sessions.** Sessions are intentionally local-only in v1 (excluded from peer sync). If cross-machine resume is wanted later, key the staleness model on a content hash carried in the session (the integrity helper already produces one) rather than live-record diffing, so a peer's universe edit doesn't false-positive-stale the local session.-- [ ] [story-builder-step-content-staleness] **Upstream-hash detects when a step's INPUTS drift, not when its OUTPUTS are edited out-of-band.** A user can lock the universeAesthetic step, then mutate `universe.logline` directly in Universe Builder, and the aesthetic step lock won't flag stale (the lock is only soft — it gates the StoryBuilder UI, not the underlying universe record). Either: (i) extend `buildUpstreamInputs` to fingerprint each step's *own outputs* as well, treating any post-lock mutation as stale, or (ii) enforce harder locks at the underlying-record layer. Deferred — current behavior matches the "upstream-only" hashing design intent.- [ ] [story-builder-refine-returns-provider] **`refineStep('readerMap')` drops `providerId`/`model` from the conductor's return.** Every other refine branch surfaces them so the route/UI can show which model ran; the readerMap branch destructures `runId` only. Two-line fix (local-review SC-6, 2026-05-27).- [ ] [story-builder-refine-fallback-changes] **`refineReaderMap` returns `changes`/`rationale` describing a refine attempt that was discarded in favor of the existing map.** When the LLM payload is empty, the function falls back to `arc.readerMap` but still surfaces the change list the LLM described. Fix: when falling back, clear `changes` and `rationale`. (local-review SC-7, 2026-05-27).- [ ] [story-builder-hash-shape-vs-derivation-tests] **storyBuilder.test.js asserts `upstreamHash` is a 64-char hex string but never that it equals `hashUpstream(stepId, inputs)`.** A buggy implementation that always stamped `hashUpstream('idea', null)` would also pass. Import `hashUpstream` and assert exact equality so future input-set drift surfaces as a test failure. (local-review SC-8, 2026-05-27).- [ ] [migration-043-line-ending-precedent] **Migration 043 (story-builder prompts) is first-shipment-only — no OLD_SHIPPED_MD5 hashing.** Correct today (the prompts haven't shipped to anyone). But the precedent matters: when a future migration AMENDS these prompts, follow migration 003's pattern — normalize line endings before hashing, and ship both `OLD_SHIPPED_MD5` and `NEW_SHIPPED_MD5`. Add a one-line reminder comment to the migration. (local-review SS-3, 2026-05-27).- [ ] [style-probe-image-uses-draft-not-saved] **`<StyleProbeImage>` in Universe Builder renders against the in-memory draft but persists the resulting filename to the SERVER's saved record.** A probe image semantically built from in-progress styleNotes/influences gets pinned to a saved universe whose actual style fields are still on the prior values; once the user discards the draft, the styleImageRefs persists on a record that never had those style notes. Either gate `canRender` on `!draftDirty`, or warn when the draft has uncommitted style changes. (local-review C-5, 2026-05-27).--### Local LLM Playground — deferred follow-ups (2026-05-31)-- [ ] [llm-playground-preserve-partial-output] **A timed-out / aborted playground run discards everything the model already streamed.** `streamChatCompletion` (`server/services/localLlmPlayground.js`) accumulates `output` locally; on an `AbortError` it throws, the `runLocalLlmTest` catch returns `text: ''`, and `ResultPanel` (`client/src/pages/LocalLlmPlayground.jsx`) shows only the error (the `result.error ? <error> : <pre>{result.text}</pre>` branch hides text whenever error is set). Surface the partial stream: thread the accumulated text out of the throw (or accumulate it in `runLocalLlmTest`'s `onChunk`) and render it alongside the timeout error. Deferred — needs a UI change to show partial-text-plus-error, not just a server tweak. (local-review SS, 2026-05-31).- [ ] [llm-playground-cancel-in-flight] **No way to cancel an in-flight playground run (up to a 10-minute timeout).** The Run button only locks via `busy`; there's no client `AbortController` / Cancel affordance. Add a Cancel button wired to a client-side `AbortController` passed into `testLocalLlmModel`/`compareLocalLlmModels` (the request options already spread through `apiCore`); aborting the client fetch also closes the server reader early. Deferred as a UX feature, not a bug. (local-review CT, 2026-05-31).- [ ] [nav-route-manifest-coverage-guard] **Add a guard asserting every client `<Route path>` has a matching `NAV_COMMANDS` entry.** This PR shipped a page (`/local-llm/playground`) reachable only via in-page links because the route was added to `client/src/App.jsx` without a `server/lib/navManifest.js` entry — the existing fail-fast guard validates entry *shape* but can't catch a *missing* entry for an added route. Add a test (or boot-time check) that parses the `<Route path=…>` list out of `App.jsx` and asserts each non-param, non-redirect route resolves to a `NAV_COMMANDS` path. Must allow an explicit opt-out list for routes intentionally kept out of nav (param/detail sub-routes like `/shell/:sessionId`, `settings` → redirect) to avoid false positives. Deferred from the playground review: cross-cutting and carries real false-positive risk, so it deserves its own change rather than riding along. (local-review encoding, 2026-05-31).- [ ] [llm-playground-shared-target-key] **The `${backend}\n${modelId}` compare-target key is hand-inlined ~5×.** It appears in `LocalLlmTab.jsx` (compareTargetKeys, toggleCompareTarget, the delete-prune, the checkbox `checked`) and is re-implemented as `targetKey()` in `LocalLlmPlayground.jsx`. Extract a single `localLlmTargetKey({backend, modelId})` helper both files import, so the URL round-trip can't desync on a delimiter change. Deferred only because a new `client/src/lib` module triggers the barrel + README maintenance rule; fold it in next time either file is touched. (local-review SQ, 2026-05-31).--## Deferred-- [ ] [runs-route-fallback-model-tests] **Add a route-level test harness for `POST /api/runs` fallback-model execution.** `server/lib/aiToolkit/routes/runs.js` now derives `runModel` from `runData.usedFallback`/`fallbackModel` so an API/TUI/CLI fallback runs the fallback's model rather than leaking the primary's request model. There is currently no route-test harness anywhere in the repo (no supertest, no httpMocks), so this path is only covered transitively via the `createRun`/`getFallbackProvider` unit tests. Stand up a minimal route harness (fake `runnerService` with spied `createRun`/`executeApiRun`/`executeCliRun`/`executeTuiRun`) and assert: (a) non-fallback runs pass the request `model` unchanged for all three types; (b) a fallback swap with a configured `fallbackModel` runs that model on API (3rd arg), TUI (cloned `defaultModel`), and CLI (cloned `defaultModel`); (c) a fallback swap with no pin runs the fallback provider's own `defaultModel`, never the primary's model id. Skipped here to avoid building a route harness from scratch inside a bugfix PR.- [ ] [consolidate-client-url-normalize] **Consolidate client-side URL normalization.** Three components prepend `https://` to a bare URL with near-identical logic: `normalizeUrl` in `client/src/components/brain/tabs/LinksTab.jsx`, the inline block in `client/src/components/QuickBrainCapture.jsx` (~line 34, with `URL_PATTERN`/`DOMAIN_PATTERN` regexes), and `client/src/components/brain/tabs/FeedsTab.jsx` (~line 50, no `git@` handling). Extract one `normalizeUrl`/`isUrl` pair to a shared `client/src/utils/` helper and migrate all three. Must preserve each one's subtly different behavior (FeedsTab ignores `git@`; QuickBrainCapture splits detection from normalization).- [ ] [brain-bucket-chip-reorder] **Drag-to-reorder chips *within* a bucket.** The Brain → Links bucket board (`client/src/components/brain/links/BucketBoard.jsx` + `BucketCard.jsx`) supports dragging a chip *between* buckets and reordering buckets, but not repositioning a chip within its own bucket — `bucketOrder` is only ever appended (max+1) on assign. Add intra-bucket position-aware drop (compute target index from the drop location, renumber `bucketOrder`, persist via `updateBrainLink`).@@ -197,17 +69,87 @@ Surfaced while building the sync-hygiene feature. Consciously scoped out of v1.- [ ] [memory-mgmt-new-endpoint-tests] **Add tests for the 5 new memory-management routes.** `/api/local-llm/loaded`, `/api/local-llm/unload`, `/api/voice/whisper`, `/api/voice/tts/status`, `/api/voice/tts/unload` have no test coverage. Add focused happy-path + validation-rejection tests so future regressions in the schema-parity fixes (or the `unloadModel` residency check) surface as test failures.- [ ] [qwen-image-edit-init-image-required] **Qwen-Image-Edit dispatches without its required init image.** `qwen-image-edit` (registry `mediaModels.js:202`) loads `QwenImageEditPipeline` which requires an `image` arg; the entry is exposed in the normal image-gen model picker which permits text-only submission. Today the user picks the model, submits a text prompt, and the runner crashes deep inside the diffusers pipeline. Options: (a) add an `editOnly: true` flag + validate at `routes/imageGen.js` POST; (b) filter the model from the picker when no source image is uploaded; (c) reroute through a future `/api/image-gen/edit` endpoint.- [ ] [hidream-requires-hf-token-fail-fast] **Probe HF token upfront for HiDream gated-encoder downloads.** `data.reference/media-models.json`'s HiDream entries carry `requiresHfToken: true`, but `scripts/z_image_turbo.py` `load_external_text_encoder()` does NOT call `probe_hf_auth()` the way `flux2_macos.py:265` does. A user without a valid HF token currently sees a multi-GB download attempt that fails with a 401 deep inside transformers. Mirror the FLUX.2 probe before invoking `transformers.from_pretrained()` on the gated encoder repo.-- [ ] [flux2-bf16-kv-multi-reference-support] **Lift the multi-reference gate on `flux2-klein-9b-bf16`.** `scripts/flux2_macos.py` (~line 280) refuses `--reference-images` on `quantization='none'` because the bf16 entry's `repo` is the base 9B (not kv) — `Flux2KleinKVPipeline` would load fine but run K/V-cached reference attention against a transformer not tuned for reference-editing. Either swap the bf16 entry's `repo` to `black-forest-labs/FLUX.2-klein-9B-kv` and ship a migration, or thread an explicit `kvRepo` field through the runner. Quality validation requires a 64+ GB machine.- [ ] [flux2-runner-sidecar-tests] **Test coverage for `generateImage`'s sidecar `meta` payload.** `server/services/imageGen/local.test.js` exercises `buildArgs` but never asserts on the sidecar `meta` object built inside `generateImage` — including the `referenceImageFilenames` + `referenceImageStrengths` fields. A focused test would need to either factor the meta-builder out of `generateImage` so it's callable without spawning Python, or stub the spawn + assert on the persisted sidecar JSON.- [ ] [comic-script-generation-panel-hardening] **Harden `pipeline-comic-script.md` to prevent content-in-page-description malformation at generation time.** The `comic-structure` editorial-review category (migration 057) catches pages where all content landed in the page-level description instead of panel definitions — that's a detection layer; the root fix is in the generation prompt. Add explicit rules to `data.reference/prompts/stages/pipeline-comic-script.md`: (a) "NEVER put action, dialogue, or scene content in the page-level description — that is ONLY for layout intent (1–3 lines max)"; (b) "Every page MUST have 4–6 discrete `Panel N` blocks with `Description:`, `Caption:`, `Dialogue:`, and `SFX:` fields." Add a migration alongside the prompt change.-- [ ] [comic-structure-finding-shape-unification] **Unify the finding-shape contract across `comic-structure` and narrative categories.** The `comic-structure` finding (migration 057) repurposes the `suggestion` field as a full replacement document (complete panel-by-panel rewrite), while all other categories use it as a delta/advice string. Consider: adding a `replacementStrategy: 'full-page' | 'delta'` field; or restructuring to `{ finding, fix: { find, replace } }` where the `fix` block is category-specific. Update `pipeline-manuscript-completeness.md`, `manuscriptReview.js`, and `pipeline-manuscript-fix.md` accordingly. The current approach works end-to-end, but the contract inconsistency should be resolved before the finding type proliferates.- [ ] [manuscript-review-sync] **Wire the manuscript-review comment set into cross-install sync.** `data/pipeline-series/{id}/manuscript-review.json` is written as a sibling of the series record but is NOT carried by `exportSeries`/`importSeries` or the peer-sync path. `manuscriptReview.mergeReviewFromSync(seriesId, remoteReview)` (LWW-per-comment) already exists; what's missing is (a) including the review document in the series export bundle, (b) a wire-schema-version gate in `server/lib/schemaVersions.js`, and (c) calling `mergeReviewFromSync` on the receiving side. Accepted *fixes* already sync (they write to issue stage outputs); only the comment list/status/dismissals don't propagate yet.-- [ ] [reference-watch-default-prompt-version-bump-check] **Re-audit `DEFAULT_TASK_INTERVALS['reference-watch'].taskMetadata` whenever `PROMPT_VERSIONS['reference-watch']` changes.** The schedule default was flipped from `readOnly: true` → `false` on 2026-05-28 because the v2 prompt instructs the agent to append `[ref-watch-…]` items to PLAN.md and commit them. A future v3 prompt that returns to a propose-only flow would need to flip the default back. Pin: `server/services/taskSchedule.js#DEFAULT_TASK_INTERVALS` reference-watch entry must stay in sync with the prompt's behavior; tests in `taskSchedule.test.js` and `referenceRepos.test.js` pin the current contract.- [ ] [season-continuity-extract-honors-series-llm] **Season-episodes continuity extract doesn't honor the series LLM (or a model override).** The continuity `extractCanonFromProse` call in `generateSeasonEpisodes` (`server/routes/pipeline.js`, the `if (body.commit)` block) passes only `providerOverride: body.providerOverride` — no `series.llm` fallback and no `modelOverride` — so it falls back to the global active provider instead of the series-pinned LLM. Not a correctness bug, just an inconsistency. Add the same `providerMatchesSeries`-guarded provider/model resolution used by the extract-canon and extract-scenes routes.- [ ] [prune-orphan-subscriptions-for-deleted-records] **Sweep orphaned peer subscriptions left by tombstone prune.** `pruneTombstonedUniverses` / `pruneTombstonedSeries` rm the record dir but leave its rows in `data/peer_subscriptions.json`. On `peer:online`, `retryPendingPushesForPeer` walks them, `loadOne` returns null, and the push no-ops (harmless but inflates the "retrying N pending pushes" count). Add an orphan-subscription sweep (drop subs whose `recordKind/recordId` no longer resolves) to the tombstone GC path.- [ ] [coalesce-fallback-provider-failure-storm] **Coalesce duplicate fallback work during an N-way provider-failure storm.** When a stuck provider has N simultaneous in-flight calls, each failure independently runs `pickFallbackProvider` → `getAllProviders()` → `loadProviders()` (reads `providers.json` from disk every time — no in-memory cache) → `markUnavailable` (writing `provider-status.json`). Two compounding fixes: (a) add a tiny TTL cache (~1s) to `aiToolkit/providers.js#loadProviders`; (b) coalesce per-provider failure handling in `promptRunner.js` with a `Map<providerId, Promise>` so subsequent failures for the same provider await the first's mark-and-pick result. Acceptance: under a simulated 10-concurrent-failure load, providers.json is read at most twice and provider-status.json is written once. Surfaced by /simplify during the ai-fallback PR (2026-05-22).-## Future Ideas+## Blocked / Deferred (skip for `/claim`)++Items here need a user decision, design pass, code precondition, hardware validation, or future priority signal before they become claimable. Keep this section at the bottom so `/claim` works from the backlog downward.++- [ ] [pipeline-audio-phase-4c-2-4c-3-4d-2-local-oss] **Pipeline Audio Phase 4c.2/4c.3/4d.2.** Local OSS music gen (MusicGen sidecar; pick generator first); 3rd-party engine stubs; VO line muxing into the CD stitch with per-line offsets + music-bed ducking.+ > ❓ **Question:** Which local OSS music generator should the sidecar use? **Recommendation: MusicGen** (Meta; MLX-portable, runs locally, bounded ~30s clips, well-supported) for the first slice, with AudioLDM2 as a possible second backend and a commercial API (Suno, duration control) deferred to the 3rd-party-stub phase. Confirm MusicGen, or name a different starting generator.+- [ ] [whole-episode-audio-generation-strategy-stop] **Whole-episode audio generation strategy.** Stop relying on per-clip audio; drive audio gen from episode-level prose/script arc. New `audioMode: 'per-clip' | 'silent' | 'generated' | 'uploaded-track'`. Treat as a new sub-brainstorm when picked up — investigation first.+ > ❓ **Question:** Two decisions gate this: (1) which generator family — local-bounded (MusicGen-MLX, ~30s), local long-form (AudioLDM2), or commercial (Suno, real duration control)? and (2) at what granularity does episode-level audio drive — one track per episode, per-scene beds, or per-arc cues? Pick a generator + granularity and I'll scope the `audioMode` design from there.+- [ ] [world-builder-phase-2-external-sd-api-per-bucket] **World Builder Phase 2 — external SD-API + per-bucket model overrides.** Wire Together / Replicate / Fal into the world-builder batch path so high-end renders are practical; let each bucket pick its own model.+ > ❓ **Question:** Is high-end external-SD-API rendering a priority now, or stay local-only for World Builder? With the 128GB machine online, local 9B–17B models may cover the quality need without adding a third-party render dependency + key management. Greenlight external providers, or defer?+- [ ] [native-fflf-deeper-test-on-real-keyframe-pairs] **Native FFLF deeper test on real keyframe pairs.** Validate with last frame of clip A + first frame of clip B from the same scene; expose more pipeline knobs (cfg-scale, stg-scale, stage1-steps) if interpolation looks weak.+ > ❓ **Question:** This needs you to supply (or point me at) a real keyframe pair from the same scene to validate against — it can't be self-tested without representative content. Do you have a clip-A-last / clip-B-first pair I should test with, or should I synthesize a stand-in pair?+- [ ] [episode-video-provider-picker-runwayml-third-party] **Episode-video provider picker (RunwayML / third-party).** _Trigger-gated on a code precondition, not a user decision:_ once the provider abstraction lands, expose the picker on `EpisodeVideoStage`.+- [ ] [comic-book-pdf-export-once-stages-comicpages] **Comic-book PDF export.** _Trigger-gated on a code precondition, not a user decision:_ once `stages.comicPages` carries enough panel data + rendered images, export print-ready PDF.+- [ ] [writers-room-phases-4-5-phase-4-synced-prose] **Writers Room Phases 4–5.** Phase 4 synced prose/script/media review; Phase 5 realtime CD feedback. Builds on the unified bible/scene model. See [writers-room.md](./docs/features/writers-room.md).+- [ ] [cybercity-v2-phase-2-deeper-drill-down-per-agent] **CyberCity v2 Phase 2+** — deeper drill-down: per-agent spatial trail, system flow lines between buildings, recent-action timeline overlay. See [cybercity-v2.md](./docs/features/cybercity-v2.md).+- [ ] [m50-p9-cos-automation-rules-automated-email] **M50 P9 — CoS Automation & Rules.** Automated email classification, rule-based pre-filtering, email-to-task pipeline.+- [ ] [m50-p10-auto-send-with-ai-review-gate-per-account] **M50 P10 — Auto-Send with AI Review Gate.** Per-account/per-recipient trust level + dual-LLM review (drafter + reviewer). Auto-send only when both approve or trust ≥ 0.9. See [messages-security.md](./docs/features/messages-security.md).+- [ ] [m34-p5-p7-digital-twin-multi-modal-capture-voice] **M34 P5-P7 — Digital Twin.** Multi-modal capture (voice/video/image identity sources), advanced testing, personas. Ties to GOALS.md "Multi-Modal Identity Capture".+- [ ] [cross-domain-insights-engine-m42-p5] **M42 P5 — Cross-Domain Insights Engine.** Connect genome ↔ health ↔ taste ↔ identity ↔ creative output into narrative insights surfaced in Brain. GOALS.md flags this as the next milestone for "Digital Identity Modeling" but no design has been written.+ > ❓ **Question (design pass — answer all four to unblock):** (a) Which signal pairs are worth correlating first (e.g. genome↔longevity, taste↔creative-output, health↔goals)? (b) Where do insights land — a new `/insights` surface, or fold into the Brain daily/weekly digest? (c) How does the user dismiss / accept an insight? (d) Does the LLM receive a structured "facts table" or raw stage data?+- [ ] [codex5-unified-review-queue] **[P1][PRODUCT]** Cross-domain Review Queue (the "inbox zero" for PortOS). One page (`/review` or `/inbox`) that collects: Brain inbox items needing classification, Ask answers ready for promotion, CoS completed tasks pending approval, Message drafts awaiting send, Health anomalies pending acknowledgement, and failed syncs / imports / backups. Each row has accept / dismiss / drill-down. Build the surface aggregator first, then opt each producer into it.+- [ ] [codex5-health-provenance-chips] **[P1][HEALTH][TRUST]** Extend Ask's source-chip pattern to MeatSpace / genome / death clock / longevity views. Each insight tags itself as `data-backed | inferred | experimental | speculative` with a "what would change this?" explainer and a clinician-export view for blood + lifestyle data. Pairs with `[codex5-decision-provenance-everywhere]`.+- [ ] [codex5-autonomy-guardrails] **[P1][AUTONOMY]** Per-domain autonomy levels + dry-run + budgets + while-away briefing. Today CoS has a single global autonomy posture. Split into per-domain knobs (Brain auto-classify, Memory auto-extract, CoS auto-run, Messages auto-send) each with `off | dry-run | execute`. Add spending / time / token budgets per domain. Add a "what did agents do while I was away?" digest pulling from the existing CoS / agent run logs into a daily briefing card.+- [ ] [codex5-mobile-task-flows] **[P2][MOBILE]** Five phone-native flows: (1) system health + one-tap restart of an app, (2) one-tap voice/text Brain capture, (3) "what should I do now?" Ask, (4) approve / reject a CoS result from a notification, (5) log a health/lifestyle event in ≤10 seconds. Each should be reachable in ≤2 taps from a Tailscale-launched mobile session.+- [ ] [codex5-sidebar-collapse-ia] **[P1][IA]** Collapse sidebar to 8–10 top-level domains + Pinned + Recent. Today the sidebar carries deep nested tabs at the same level as top-level domains; review recommends `Home, Ask, Apps, CoS, Brain, Calendar, Goals, Health, Dev Tools, Settings` only at the top level with deep tabs pushed into each page's local tab bar and Cmd+K. Add Pinned + Recent sections driven by the user's actual working set. Touch every consumer of `Layout.jsx`'s nav tree; expect alphabetical ordering convention to survive.+- [ ] [codex5-visual-modes] **[P2][DESIGN]** Product-specific visual modes: `Ops` (dense terminal-like, minimal animation), `Focus` (quiet, spacious, only next actions), `Health` (warmer, less cyber, more explanation), `Review` (document-like, optimized for reading + decisions). Needs a day-mode selector to switch between them. Extend the existing Tailwind token system rather than introducing a parallel theming layer.+- [ ] [codex5-decision-provenance-everywhere] **[P2][DESIGN]** Decision/provenance pattern across CoS, Insights, Health, Goals, Dashboard widgets. Each AI-generated or rule-driven surface answers: "Why am I seeing this?", "What data backs this?", "What changed?", "What can I do next?" Reuse the Ask source-chip component. Pairs with `[codex5-health-provenance-chips]`.+- [ ] [codex5-empty-states-teach] **[P3][ONBOARDING]** Workflow-teaching empty states. Each "no data" state replaces "Nothing here" with a setup hint that names the next action: "Connect calendar to unlock schedule-aware goals", "Add birth date + genome file to unlock longevity estimates", "Capture 10 notes to improve Ask Yourself", "Configure one API provider to enable autonomous CoS". Inventory empty states first, then prioritize by which pages new users hit earliest.+- [ ] [useasyncaction-post-unmount-setstate-guard-add] **`useAsyncAction` post-unmount setState guard.** Add `mountedRef` to gate `setRunning(false)`. YAGNI today; do at 4th consumer.+- [ ] [extract-usecanonpatch-universe-setuniverse] **Extract `useCanonPatch(universe, setUniverse, universeId, mountedRef)`.** `UniverseCanon.jsx` + `NounsStage.jsx` 95% identical optimistic-patch handlers. Extract when a 3rd caller appears.+- [ ] [shallow-equal-guard-in-usemediaannotations-socket] **Shallow-equal guard in `useMediaAnnotations` socket handler.** Speculative micro-opt; theoretical until observed.+- [ ] [low-client-extract-shared-usepopoverposition-hook] **[LOW][CLIENT]** Extract shared `usePopoverPosition` hook — **premise eroded; revisit when a 3rd caller lands.** Today the pattern lives in exactly two components (`client/src/components/ThemeSwitcher.jsx` and `client/src/components/media/CollectionPickerShell.jsx`) — both implement portal-with-fixed-positioning + `useLayoutEffect` measurement + rAF-coalesced scroll/resize listeners. With only 2 callers the abstraction isn't worth the indirection; extract when a third surface needs the same shape.+- [ ] [pill-component-goaldetailpanel-migration] **Migrate `GoalDetailPanel.jsx`'s badges to the shared `<Pill>`.** `GoalDetailPanel.jsx`'s badges were intentionally left out of `[shared-pill-chip-component]`: their colors are computed from data (`GOAL_TYPE_CONFIG[].bg/color` ~line 384, `CATEGORY_CONFIG`/`urgencyColor()` ~571-581, tag chips ~528/707, `CHECK_IN_STATUS_CONFIG` ~993), so they don't map to a fixed `tone`. They'd migrate via `<Pill tone="bare" bordered={false} className={`${cfg.bg} ${cfg.color}`}>`, which only consolidates the structural `rounded px-2 py-0.5 text-xs` shape — not the colors. Marginal benefit + many edits in a 1252-LOC god-component, so deferred. Do it opportunistically when next touching the file (pairs with the `GoalDetailPanel.jsx` god-component split under "Deferred Architecture").+- [ ] [parallelize-applypromptreplacemigration-files] **Parallelize `applyPromptReplaceMigration` per-file scan.** Today every prompt-replace migration covers exactly one file, so the serial `for (await readFile…)` loop in `scripts/migrations/_lib.js` costs nothing. When the first multi-file migration lands, fold the loop into `Promise.all(Object.keys(accepted).map(async filename => …))` and accumulate the `{ updated, alreadyCurrent, skipped }` counters post-flight. Theoretical until needed.+- [ ] [shots-aware-scene-output-contract-partial-split] **Shots-aware scene-output-contract partial.** Split into `_partials/scene-fields-core.md` + `_partials/scene-fields-shots.md` when a third shots-using stage appears.+- [ ] [ref-watch-phosphene-bump-ltx2-pin-v0148] **Bump `LTX2_PIN` from `f8f20c83` to v0.14.8 + adopt phosphene's frame_rate / class-rename / a2v / lora-fusion patches together.** From `reference-watch` review of phosphene (2026-05-22). Concrete upstream wins between PortOS's pin and current dgrauet HEAD: VAE auto-tiling that caps peak Metal memory on HD / long runs (#25), `_pending_loras` honored across every pipeline's `load()` override (#22, #23 — fixes silent character-LoRA-drops on Extend/HQ), `--lora` on `--low-ram` flow (#30), accurate transformer load-time markers for progress UI. Cost: in v0.14.x, `TextToVideoPipeline` / `ImageToVideoPipeline` / `ExtendPipeline` / `TwoStagePipeline` / `AudioToVideoPipeline` are all renamed (public surface becomes `TI2VidOneStagePipeline`, `RetakePipeline`, `TI2VidTwoStagesPipeline`, `A2VidPipelineTwoStage`, etc.). `generate_ltx2.py` would fail at import. Source commits: `2166d138` / `770ed0bd` (defensive imports v2), `94ae3430` (method-presence dispatch instead of class assumption), `aa235aa0` (`fps=` → `frame_rate=` shim), `681f429a` (a2v missing `frame_rate=` runtime patch), plus `[ref-watch-phosphene-lazy-eval-env-bootstrap]`. Scope: large (100–200 lines of careful Python touching every pipeline path, plus smoke test of every mode — text/image/fflf/extend/a2v — at the new pin).+ > ❓ **Question:** Do you want to take on this large/risky pin bump now? My recommendation if yes: **ship it as one PR (not per-mode)** — the class renames touch every pipeline's import simultaneously, so a half-migrated state won't even import; one PR with a full five-mode smoke test is safer than partial landings. And do it **after** the post-decode `os._exit(0)` work (`[ref-watch-phosphene-mlx-post-decode-os-exit]`) so the hang-mitigation is in place first. Confirm "yes, one PR, after os._exit" or tell me to defer.+- [ ] [ref-watch-phosphene-sigkill-watchdog-videogen-local] **Panel-side SIGKILL watchdog (Node layer) in `videoGen/local.js`.** From `reference-watch` review of phosphene (commit `94bd6965`, 2026-05-22). Even with helper-side `os._exit(0)` adopted, defense-in-depth at the Node layer is cheap insurance: watch stdout for the upstream "[Decoding video + audio + muxing] done in X.Xs" line (or the final `{"video_path": ...}` JSON), then arm a 30–45s grace timer that SIGKILLs the child if it doesn't exit. PortOS already has SIGTERM→SIGKILL escalation in `cancel()` (`server/services/videoGen/local.js:71-79`); reuse that path. **Trigger:** only do this if real users hit the hang after the pin bump and `os._exit(0)` proves insufficient. Scope: small/medium.+- [ ] [data-versioning-cache-invalidation-on-split] **Cache invalidation hooks in `brainStorage.js` / `messageSync.js` / `meatspacePostDrillCache.js` — needed only when their backing collections split.** These caches don't touch universe data so they were safe to skip for PR #458. When a future PR splits Brain or Messages collections into per-record `collectionStore` layouts, audit each cache for "cache key ↔ split-record-id" consistency: per-id writes are visible to other readers without going through the cache, so any cache that fronts the now-split file needs an invalidation event hook (or a switch to read-through against `store.loadOne`).+- [ ] [data-versioning-typeindex-config-convention] **Establish a convention for the `config` slot on `data/{type}/index.json`.** `createCollectionStore` left `index.json`'s `config` open and unused — the first real consumer (probably the pipeline-issues split's history/runs analog) should pick the shape and document it in `server/lib/README.md` + the `collectionStore.js` header. Candidate shape: `{ config: { runs?: [], featureFlags?: {}, lockPolicies?: {} } }` — but defer the decision to the first real need.+- [ ] [ref-watch-phosphene-long-clip-temporal-boost-12fps] **"Long Clip Temporal Boost" (render at 12fps, interpolate to 24fps).** From `reference-watch` review of phosphene (commit `53585fc`, 2026-05-22). Phosphene added a 12fps render path that uses ffmpeg's `minterpolate` / RIFE downstream to fill back to 24fps, doubling the effective clip length per memory budget. PortOS doesn't have an interpolation post-step in `server/services/videoGen/local.js`. The math helpers (`_duration_to_8k_frames`, LTX `8k+1` frame-count snapping) are useful regardless.+ > ❓ **Question:** Is a 12fps-render-then-interpolate mode worth a feature surface? It doubles max clip length per memory budget, but there's no user pain motivating it today and minterpolate can introduce artifacts. Want it (I'll scope a `--target-fps` + interpolation post-step), or skip?+- [ ] [ref-watch-phosphene-t2v-standard-env-gated-two-stage] **Env-gated two-stage T2V perf experiment.** From `reference-watch` review of phosphene (commit `5004b40b`, 2026-05-28). PortOS's `run_text` already routes through `TwoStagePipeline` *when `cfg_scale` is set* (~line 221) — but the default no-CFG path uses single-stage. Phosphene's experiment routes T2V Standard through `pipe.generate_two_stage()` (half-res Stage 1 + 2× latent upsample + 3-step Stage 2 refine) even without CFG, gated on an env flag. Predicted ~30-35 % wall-time reduction on T2V Standard. Fix: in `run_text`, when `cfg_scale is None`, branch on a new `PORTOS_T2V_TWO_STAGE` env to call `pipe.generate_two_stage(...)` with stage1_steps=8, stage2_steps=3, cfg_scale=1.0. Scope: small.+ > ❓ **Question:** Land this behind an `A/B env knob` first, or — once you've eyeballed the quality on a couple of test prompts — just flip two-stage on as the universal T2V Standard default? Recommendation: ship the env knob first, validate quality on your prompts, then flip the default in a follow-up. Confirm "env knob first" or "flip default directly."+- [ ] [importer-orphan-shell-gc] **An abandoned analyze leaves an empty universe/series shell on disk.** `analyzeImport` persists universe+series after canon+arc succeed, so if the user abandons after an issue-split failure on a brand-new universe/series, empty shells linger in `data/`. By-design, but a periodic GC of zero-issue, zero-canon shells older than N days (or marking analyze-created shells `ephemeral` until commit promotes them) would keep `data/` clean.+- [ ] [story-builder-import-aesthetic-readermap-gaps] **Import pre-fills arc/characters/issues but NOT universe aesthetic or reader map.** `analyzeImport` creates the universe with only a name (no logline/premise/styleNotes/influences) and the importer never extracts a reader map — yet `createStorySession` import-branch marks every step `ready`. So in an imported session the universeAesthetic + readerMap steps show empty content under a misleading "Ready" badge. Mitigations in place: the session `seedIdea` is seeded from the extracted arc summary, and generateStep's expand falls back through `seedIdea`→universe name. Follow-up: either mark only the importer-filled steps `ready` (others `pending`), or extract a starter/aesthetic + reader-map pass during import.+- [ ] [universe-styleImageRefs-wire-and-journal] **`styleImageRefs` is wire-synced but not version-gated, and feeds the conflict-journal content hash.** `sanitizeRecordForWire('universe')` ships `styleImageRefs` to peers; an older peer drops it on receive and, after its own edit bumps `updatedAt`, LWW-strips it back off a newer peer. Separately, `contentHashForRecord` now includes `styleImageRefs`, so a probe render can contribute to a 3-way-divergence conflict-journal entry whose diff won't mention it (`RESTORABLE_FIELDS.universe` omits it). Options if it becomes annoying: bump the `universes` schema version (gate it), make `styleImageRefs` local-only (strip from wire), or exclude it from the content hash. Deferred — low-stakes, regenerable.+- [ ] [story-builder-session-sync] **Optional cross-machine resumable sessions.** Sessions are intentionally local-only in v1 (excluded from peer sync). If cross-machine resume is wanted later, key the staleness model on a content hash carried in the session (the integrity helper already produces one) rather than live-record diffing, so a peer's universe edit doesn't false-positive-stale the local session.+- [ ] [story-builder-step-content-staleness] **Upstream-hash detects when a step's INPUTS drift, not when its OUTPUTS are edited out-of-band.** A user can lock the universeAesthetic step, then mutate `universe.logline` directly in Universe Builder, and the aesthetic step lock won't flag stale (the lock is only soft — it gates the StoryBuilder UI, not the underlying universe record). Either: (i) extend `buildUpstreamInputs` to fingerprint each step's *own outputs* as well, treating any post-lock mutation as stale, or (ii) enforce harder locks at the underlying-record layer. Deferred — current behavior matches the "upstream-only" hashing design intent.+- [ ] [flux2-bf16-kv-multi-reference-support] **Lift the multi-reference gate on `flux2-klein-9b-bf16`.** `scripts/flux2_macos.py` (~line 280) refuses `--reference-images` on `quantization='none'` because the bf16 entry's `repo` is the base 9B (not kv) — `Flux2KleinKVPipeline` would load fine but run K/V-cached reference attention against a transformer not tuned for reference-editing. Either swap the bf16 entry's `repo` to `black-forest-labs/FLUX.2-klein-9B-kv` and ship a migration, or thread an explicit `kvRepo` field through the runner. Quality validation requires a 64+ GB machine.+- [ ] [comic-structure-finding-shape-unification] **Unify the finding-shape contract across `comic-structure` and narrative categories.** The `comic-structure` finding (migration 057) repurposes the `suggestion` field as a full replacement document (complete panel-by-panel rewrite), while all other categories use it as a delta/advice string. Consider: adding a `replacementStrategy: 'full-page' | 'delta'` field; or restructuring to `{ finding, fix: { find, replace } }` where the `fix` block is category-specific. Update `pipeline-manuscript-completeness.md`, `manuscriptReview.js`, and `pipeline-manuscript-fix.md` accordingly. The current approach works end-to-end, but the contract inconsistency should be resolved before the finding type proliferates.+- [ ] [reference-watch-default-prompt-version-bump-check] **Re-audit `DEFAULT_TASK_INTERVALS['reference-watch'].taskMetadata` whenever `PROMPT_VERSIONS['reference-watch']` changes.** The schedule default was flipped from `readOnly: true` → `false` on 2026-05-28 because the v2 prompt instructs the agent to append `[ref-watch-…]` items to PLAN.md and commit them. A future v3 prompt that returns to a propose-only flow would need to flip the default back. Pin: `server/services/taskSchedule.js#DEFAULT_TASK_INTERVALS` reference-watch entry must stay in sync with the prompt's behavior; tests in `taskSchedule.test.js` and `referenceRepos.test.js` pin the current contract.++- `server/services/cos.js` (3115 LOC) — split into cosTaskStore / cosTaskGenerator / cosJobScheduler / cosHealthMonitor.+- `server/services/agentLifecycle.js` (1446 LOC) — extract prepareAgentWorkspace / resolveProvider / processCompletion.+- `server/services/identity.js` (1917 LOC) — separate genomic markers + longevity + goals + todos.+- `server/services/taskSchedule.js` (2369 LOC) — extract prompt management to `taskPromptService.js`.+- `server/services/taskLearning.js` (1939 LOC) — separate metrics aggregation from heuristic routing.+- `server/services/autonomousJobs.js` (1567 LOC) — extract job registry / scheduler / execution paths.+- `server/services/voice/tools.js` (1284 LOC) — group by domain (UI / calendar / brain / media) into siblings.+- `server/services/git.js` (1271 LOC) — extract command builders + parsers.+- `server/cos-runner/index.js` (1076 LOC) — extract spawn / lifecycle / IPC layers.+- `server/services/memory.js` (1049 LOC) — separate retrieval, classification, persistence.+- `server/services/xcodeScripts.js` (1131 LOC) — collapse repeated AppleScript builders.+- `server/routes/apps.js` (1180 LOC) — extract `npm install` orchestration to `appBuilder.js`.+- `client/src/pages/VideoGen.jsx` (1361 LOC) — extract mode-specific control panels (i2v / a2v / extend / FFLF).+- `client/src/pages/ImageGen.jsx` (1182 LOC) — extract preset picker + multi-reference uploader.+- `client/src/components/goals/GoalDetailPanel.jsx` (1252 LOC) — god component.+- `client/src/components/meatspace/tabs/CalendarTab.jsx` (1269 LOC) — extract grid renderer + goal-link panels.+- `client/src/components/cos/tabs/ScheduleTab.jsx` (1088 LOC) — extract schedule editor + run history table.+- `client/src/components/writers-room/StoryboardPanel.jsx` (1199 LOC) — extract scene tile + render dock subcomponents.+- `autofixer/ui.js` (972 LOC) — inline HTML template needs extraction.+- API contract — standardize error response shapes (`asyncHandler` + `ServerError` everywhere).- **Identity Context Injection** — per-task-type digital twin preamble toggle.- **Content Calendar** — unified calendar across platforms.