Skip to content

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

Merge remote-tracking branch 'origin/main' into feat/local-model-self-heal

Adam Eivyfdcd1a8641c6
diff --cc .changelog/NEXT.md
index 2092278527,cde5fb350c..b3b8fb39fd
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@@ -1,114 -1,50 +1,54 @@@
- # Unreleased
+ # Unreleased Changes
- ## Dashboard
+ ## Songs
- - **A new "Daily POST" dashboard widget surfaces your cognitive self-test streak and whether you've trained today.** POST (the daily 5-minute math/wordplay/memory/verbal/imagination self-test) had no dashboard presence — you had to navigate to `/post` to even remember it existed, which is exactly the wrong friction for a habit you want to do *daily*. The new widget shows today's status (✓ Done · score%, or a "Start →" nudge), your current practice streak with a fire/zap/sparkle glyph, and your personal-best run — one click into `/post/launcher`. To back it, `getPostStats` now also returns `completedToday`, `currentStreak`, `longestStreak`, `lastDate`, and `todayScore`, computed by a new pure `computePostStreaks(sessions, today)` helper that mirrors the activity-streak grace-window semantics (a not-yet-done today doesn't break the streak if yesterday is logged) using UTC day math so month/DST boundaries don't cause off-by-ones. The widget ships in the built-in **Health** layout — a migration (`145-seed-daily-post-widget.js`) seeds it into existing installs' persisted Health layout, so current users get it too, not just fresh installs — and is addable to any layout. (`server/services/meatspacePost.js`, `client/src/components/DailyPostWidget.jsx`, `client/src/components/dashboard/widgetRegistry.jsx`, `server/services/dashboardLayouts.js`, `scripts/migrations/145-seed-daily-post-widget.js`)
+ - **[issue-2109] The live vocal Tuner now locks onto the note you're singing instead of flickering.** Holding a steady note used to make the readout strobe — the note label flipped between neighbors, the needle lurched, and the display dropped to "—" on every breath or consonant. The tuner now holds a stable reading through brief dropouts (dimming while it coasts), only blanks after a real pause, keeps one note label while your pitch wanders up to ~60¢ around it, and re-locks promptly when you actually change notes — so a held note shows one label with a gently moving needle.
- ## Catalog
+ ## Rounds
- - **[issue-1762] Catalog gains universe/series/tag filters, real pagination, and an Albums grouped view.** The Catalog page had outgrown a flat, hard-capped list of 200 ingredients with only type chips + search. It now exposes the universe, series, and tag facets the server already understood as filter dropdowns (series scoped to the chosen universe), all reflected in the URL (`?type=&universe=&series=&tag=&q=&view=`) so a filtered catalog is shareable and back-button-safe. The flat Grid view paginates past the old cap with a "Load more" button (60/page) and an honest "showing X of N" line. A new **Albums** view groups ingredients by universe with a pinned **"Unsorted / Raw"** album (ingredients linked to nothing yet) and an **"Orphaned"** album (refs whose universe/series was deleted) — each lazy-loading its cards on first expand. The multi-select action bar can now **place a selection into a universe/series** directly, closing the raw → placed loop. Server-side: `listIngredients` gained `refKind`/`refId`/`unlinked`/`orphaned` filters, a new `GET /api/catalog/facets` aggregates type/universe/series/tag facets plus unlinked/orphaned bucket counts in one round-trip, and the shared `<CatalogCard>` is extracted so the grid and albums render identical cards. (`server/services/catalogDB.js`, `server/routes/catalog.js`, `server/lib/catalogValidation.js`, `client/src/pages/Catalog.jsx`, `client/src/components/catalog/`, `client/src/services/apiCatalog.js`)
+ - **[issue-2104] Fixed: 500 Miles' reference TikTok videos now show up on older installs.** The built-in "500 Miles" round shipped with three TikTok reference performances, but any install that already had its data saved from before those were added never picked them up — the Reference material section stayed empty. A one-time backfill now restores the three references for those installs, without touching anything you may have added of your own.
+ - **[issue-2105] Fixed: "Hey Ho Nobody Home" now sings in D minor and stacks cleanly with its partner rounds.** The built-in round shipped with a mis-transcribed melody — centered on G with a major third — that contradicted its own key label and sounded a harsh clash when stacked with Ah Poor Bird and Rose Rose Rose Red in the Round Stack view. The melody is now the correct D-centered, all-natural minor tune (same shape, just the right key), so the three-round quodlibet is consonant. Older installs get the corrected melody automatically; a score you customized yourself is left untouched (use "Refresh from template" to pull the fix).
+ - **[issue-2106] Learn the real parts from a reference recording.** A round reference (like a layered TikTok performance) can now carry attached audio — upload a file or capture through the mic while the video plays — and open in a new analysis view: see the waveform, mark the time ranges where each voice sings alone, and extract each range into a proposed part snapped to the round's tempo and key. Review the proposal side by side with the part you already have, with each bar flagged where the notes disagree, then apply it with one click (nothing changes until you Save). All analysis runs locally on your machine — no AI calls.
- ## Music Video production mode
+ ## Media
- - **[issue-1760] Groundwork: offline beat/tempo/section analysis of an audio track (Phase 0 spike).** The first slice of the planned Music Video production mode proves the riskiest unknown — that a music track's BPM, beat grid, 4/4 downbeats, and a coarse section map can be extracted **fully offline with no new dependency**, using only ffmpeg (already required) plus a pure-JS DSP core (onset-strength envelope → tempo-weighted autocorrelation → beat-phase fit → energy-novelty sections). No Python, no ML model download, no network — so it runs the same in CI and on every install. There's no user-facing surface yet; this is the analyzer the upcoming director scene board and beat-snapped render build on. (`server/services/musicVideo/audioAnalysis.js`)
- - **[issue-1760] Director scene board: create a Music Video project, analyze its track, and storyboard beat-aligned scenes (Phase 1).** Builds the first user-facing surface on top of the Phase 0 analyzer: a new **Create → Music Video** page (also reachable via `⌘K` and voice) where you pick an existing track (or name an uploaded audio file), create a project, and run the offline analyzer with one click — the detected BPM, beat/downbeat counts, and section map render inline. From there you storyboard the video as an ordered list of **scenes**, each with a label, a start/end time, a beat-aligned flag, and image/frame prompts; scenes can be added, edited (blur-to-save), reordered, and removed. Projects persist through a db-primary store (PostgreSQL `music_video_projects` with a file-backend fallback for dev/test), mirroring the creative-director pattern with soft-delete tombstones and LWW timestamps. Cross-machine federation of projects, per-scene reference-frame/image generation + image-to-video, and the beat-snapped render with a master audio bed are filed as follow-ups on #1760. (`server/services/musicVideo/`, `server/routes/musicVideo.js`, `server/lib/musicVideoValidation.js`, `client/src/pages/MusicVideo.jsx`, `client/src/services/apiMusicVideo.js`)
- - **[issue-1770] Music Video projects now sync across your federated machines.** Phase 1 shipped the project store as local-only; it now federates over the same peer-sync pipeline your other creative records use. A new **Music Video** toggle on the Instances page enables it per peer — when on, creating, editing, reordering scenes on, or deleting a project on one machine propagates to the others, with newest-edit-wins conflict resolution and deletions that an out-of-date peer can't resurrect. Conflicting edits are surfaced in the Conflicts UI for restore. Referenced media (the uploaded audio track and rendered scene clips) is not bundled in this phase and is tracked as a follow-up. (Closes #1770)
+ - **Installing a video LoRA from HuggingFace now shows live download progress.** The LoRA Manager's "Install video LoRA from HuggingFace" form (and the curated video quick-install buttons) used to freeze on a static "Downloading…" label with no indication of how far along a multi-GB LoRA was — unlike image-model downloads, which show a percentage. The install now streams byte-level progress over SSE: the button shows `Downloading 42%` and a progress bar with `received / total` bytes fills as it downloads (an indeterminate pulse when the server can't read a Content-Length). Errors — including the "couldn't detect the model family" case that offers the inline "Install as LTX-Video" retry — still surface exactly as before.
+ - **The LoRA Manager's Installed list is now grouped by Video / Image.** The curated "Video LoRAs" suggestion cards sat directly above a single flat "Installed" grid, so installed *image* LoRAs looked like they belonged to the video section. The Installed section is now visually divided from the suggestions and, in the "All" view, splits into labeled **Video LoRAs** / **Image LoRAs** subsections (mirroring the suggestion panel) so it's obvious which renders each LoRA applies to. The Image/Video filter still collapses it to a single scoped list.
+ - **[issue-2036] Sketch & Annotation Canvas (phase 2): re-render an image guided by your annotations.** The annotate page (`/media/annotate/:mediaKey`) gained a "Re-render" action: draw over a generated image, then feed your markup back through local img2img so the marks reshape the render. A confirmation dialog names the exact local model it will run (no surprise AI calls) and lets you add an optional prompt and tune how much to change before it starts; the new render is queued and appears in Media History. Requires a local FLUX img2img runner — the action explains when one isn't available. Phase 3 (blank-canvas storyboard) remains open on #2036.
- ## Devtools
+ ## MeatSpace POST
- - **[issue-1763] Image Cleaner is now a composable, opt-in pipeline with no upload-size cap (Phase 1).** The cleaner ran one fixed pipeline — it *always* stripped the C2PA chunk *and* applied a median+sharpen denoise, with a hard 40MB base64-in-JSON upload cap. It's now a step selector: **Strip metadata & C2PA** (default ON, lossless) and **Median + sharpen** (default OFF, lossy) run independently, with a per-step report card showing exactly what each pass did. The lossless metadata strip was widened from C2PA-only to also drop EXIF/XMP/IPTC and PNG text chunks (`tEXt`/`zTXt`/`iTXt`/`eXIf`) — pixels and color chunks left byte-identical. The upload switched from base64-in-JSON to **raw image bytes** (`express.raw`, 256MB transport ceiling), killing the ~33% base64 inflation and removing the 40MB cap entirely; the decompression-bomb pixel guard stays. The page now also shows the source resolution (W×H + megapixels) before cleaning. The honest "this does NOT defeat SynthID" messaging is preserved. The local diffusion SynthID-disruption pass, the ignore-zone mask, and resolution-aware diffusion options remain tracked in #1763 as the next phase. (`server/lib/imageClean.js`, `server/routes/imageClean.js`, `client/src/pages/ImageClean.jsx`, `client/src/services/apiMedia.js`)
+ - **[issue-2099] POST correctness batch: fill-blank scoring, an honest adaptive preview, weighted session scores, and fair shuffles.** Memory Fill-Blank drills now score and count toward your spaced-repetition schedule/mastery like Memory Sequence and Element Flash — a scoring-shape bug meant a fill-blank answer could never be marked correct no matter what you typed, so any fill-blank work inside a scored session was silently unrecorded (also closes #2116). The Adaptive Difficulty preview for Multiplication now matches what a session will actually generate: it shows your current progressive-ladder rung when the ladder is on (the default) instead of a "Max Digits" adjustment that could never apply. Session scoring config gained real teeth — a per-domain weight you set now actually shifts your blended session score (uniform weights, the default, score exactly as before). Memory drill generators (fill-blank, sequence recall, element flash) now use an unbiased shuffle instead of a skewed one, so which lines/elements you're drilled on is genuinely random.
+ - **[issue-2101] POST config & UX polish: Morse in the sidebar, config presets, keyboard-accessible history, pausable transitions.** Morse is now a full nav entry under the POST sidebar section (previously reachable only via the launcher or ⌘K). The drill config page gained one-click presets — "Balanced daily", "Math focus", "Cognitive focus", and "Everything (local-only)" — plus per-group "Enable all / Disable all" buttons on the Mental Math, Cognitive, and LLM sections (bulk-enabling LLM drills is blocked until you've picked an AI provider). History session rows now expand/collapse with the keyboard (Enter/Space), not just a mouse click. The inter-drill transition screen gained a Pause/Resume control and pauses its 3-second auto-advance countdown while you're hovering or focused on it, so you're never yanked into the next drill mid-read.
+ - **[issue-2097] The Wordplay tab now tracks your practice.** Completing a round of Compound Chain, Bridge Word, Double Meaning, or Idiom Twist in the standalone Wordplay tab used to score every response and then throw the result away — closing the tab meant the practice never happened. Each completed round now logs to your training history (same log the in-session drills and streak use), so Wordplay accuracy shows up in training stats and counts toward your practice streak. The standalone tab and the in-session drill runner now also share one scoring path for these four types, and a bug that always logged 0% accuracy for in-session LLM-drill training rounds (regardless of actual performance) is fixed too.
+ - **[issue-2114] Wordplay training-log entries now keep the per-question breakdown, not just the round total.** Follow-up to #2097: each completed Wordplay round — whether from the standalone Wordplay tab or a wordplay drill inside an in-session training session — previously logged only the aggregate question/correct counts. It now also stores each question's prompt/response, score, feedback, and whether it cleared the correct threshold — so a future progress dashboard can trend which individual wordplay prompts you miss. Bridge Word's persisted prompt is now the clue set it actually showed you (it previously had no readable prompt at all). Entries without a breakdown (older rows, and other training modules) remain fully valid.
+ - **[issue-2094] Scores now separate how *accurate* you were from how *fast* — and stop rewarding not answering.** Every scored drill now records accuracy (of the answers you actually gave), completion (how much of a timed drill you reached), and average speed as distinct numbers alongside the blended headline score, so the session and history views show accuracy and speed side by side instead of one merged figure. Running out of time on a timed drill now lowers *completion*, not accuracy — an unreached question no longer counts as wrong. Adaptive difficulty follows your accuracy (with a guard that skips adjusting when you barely started a drill), so a fast-but-sloppy run and a slow-but-careful run now push difficulty in different, correct directions. The n-back drill is rescored with proper signal-detection: never pressing now lands at ~50% (chance) instead of the old ~70% freebie, and always-pressing is penalized for its false alarms. The reaction-time drill is now scored on your median reaction speed (false starts invalidate their trial) with your best time tracked too. Older saved sessions without the new fields still display and chart correctly.
+ - **[issue-2093] Session results now teach from mistakes on every drill, not just AI ones.** Expanding a math, memory, or cognitive (n-back, digit-span, Stroop, Schulte table, mental rotation, reaction time) drill row on the results screen used to do nothing — only AI-scored drills showed a review. Every drill row now expands into a per-question/per-trial breakdown: a "missed items" summary up top, then a type-appropriate view — a prompt/answer/expected table for math and memory, letter-sequence hit/miss/false-alarm marks for n-back, shown-vs-recalled digits for digit span, word/ink/your-answer for Stroop, and per-trial timing with slow-response outliers flagged for the pure speed drills. Unanswered questions are shown distinctly from wrong ones. The same review now also appears when you expand a past session in History.
+ - **Multiplication drills now ramp up instead of starting hard.** The mental-math multiplication drill used to open at a fixed 2-digit × 2-digit difficulty (e.g. `566 × 191`) for everyone. It now climbs a mastery-gated ladder — `1×1` → `1×2` → `1×1×1` → `2×2` → … — starting at single-digit × single-digit and advancing to the next rung only after you answer a level quickly *and* accurately (≥90% correct within a per-rung speed target). The drill header and the config page show your current rung and per-level mastery. On by default; turn off "Progressive difficulty" on the Multiplication card to go back to the manual Max Digits setting.
+ - **Morse trainer audio now works on mobile Safari.** iOS Safari starts the Web Audio context suspended and only unlocks it once `resume()` fully settles. The trainer fired `resume()` without awaiting it, so the first tones were scheduled against a still-suspended clock and never sounded on iPhone/iPad. It now awaits the resume before scheduling any tone (matching the app's other audio modules), so Copy, Head Copy, and Send-mode keying all produce sound on mobile Safari.
+ - **The Elements Song trainer is now mobile-friendly and speed-readable.** The periodic-table memorization view no longer overflows off the right edge of a phone screen: the mastery summary, search box, and Mastery/Category toggle now stack and stretch to full width on small screens, the periodic table uses smaller cells (with a scroll-hint fade so it's clear the grid pans horizontally), and the header shrinks to fit. It also gained a **Rapid Read** practice mode that RSVP-flashes the lyrics one word at a time (reusing the app's speed reader) — run the whole song from the Practice list, or tap the gauge icon on any verse to speed-read just that section.
+ - **[issue-2102] POST test-coverage hardening.** Added behavioral test coverage for previously-untested load-bearing paths: stats aggregation (module/drill averaging, the days-window cutoff boundary, empty-window shape, streak passthrough), the adaptive-difficulty preview and its integration across every math drill type, the drill-generation route's cache/memory/adaptive dispatch and error paths, all 14 LLM drill generators plus their local/LLM scoring branches, non-memory session scoring/rollup, and the memory-builder's chunk-mastery ordering and built-in mastery-only update restriction. The memory drill's fuzzy-match/fill-blank/sequence/hint scorers and the LLM/session-launcher drill runners' pure helpers are now exported and unit-tested directly instead of only through component rendering (test-only, no user-facing change).
- ## Performance
+ ## POST Training
- - **Tabbed pages now lazy-load their tab bodies, and `/apps` + `/ambient` moved out of the eager entry bundle.** Digital Twin (17 tabs), MeatSpace (11 tabs), and Brain (10 tabs) previously imported *every* tab component up front, so opening any one tab downloaded a single 240–450 kB chunk's worth of all of them. Each tab body is now a `React.lazy` chunk behind a `<Suspense>` boundary, so a user who views 1–2 tabs no longer pays for the other 15. `Apps` and `Ambient` were the only two non-index pages still imported statically into the entry chunk — they're now `lazyWithReload` like every other route, shrinking the initial bundle (~109 → ~95 kB gzip). The Vite vendor split also gained named `vendor-three` / `vendor-charts` / `vendor-term` groups so the big 3D/charting/terminal libs land in stable, single shared chunks instead of an opaque `OrbitControls-*.js`. (`client/src/App.jsx`, `client/src/pages/DigitalTwin.jsx`, `client/src/pages/MeatSpace.jsx`, `client/src/pages/Brain.jsx`, `client/vite.config.js`)
- - **Pipeline series views read only their own issues instead of scanning the whole table.** `listIssuesForSeries` and `listIssues({ seriesId })` loaded *every* issue in the install, sanitized each, then filtered in JS — wasteful in the autopilot/editorial hot loops that call them per series. They now route through a new indexed `WHERE series_id = $1` query (`idx_issues_series`) on the PostgreSQL backend, with a matching JS-filtered path on the dev/test file backend. (`server/services/pipeline/issues.js`, `server/services/pipeline/issuesStore/{db,store}.js`)
- - **Removed avoidable per-render and per-frame work in the client.** `ArcCanvas` rebuilt + re-sorted its season→issue buckets (`Set`/`Map`/`sort`) on every render; it's now a `useMemo` keyed on `[seasons, issues]`. `VideoGen` re-filtered the full installed-LoRA list on every keystroke; those two filters are memoized. The CyberCity sky's `useFrame` loop allocated a fresh `THREE.Vector3` every frame (~60/sec) for the sun direction — it now reuses a module-scoped scratch vector. (`client/src/components/pipeline/ArcCanvas.jsx`, `client/src/pages/VideoGen.jsx`, `client/src/components/city/CitySky.jsx`)
- - **Collapsed serial awaits and an N+1 insert into batched I/O.** The `/api/apps/:id` detail endpoint read each PM2 process status one-at-a-time → now `Promise.all`. `dataSync`'s meatspace snapshot and the media-collections ephemeral/refused-parent lookups did serial independent reads → now concurrent. `memoryDB.updateMemory` inserted one `memory_links` row per related id in a loop → now a single multi-row `INSERT`. (`server/routes/apps.js`, `server/services/dataSync.js`, `server/services/memoryDB.js`)
+ - **[issue-2100] POST now tells you what to practice next — and works toward goals you set.** The launcher gained an **"Up next"** panel: a prioritized list of what to work on — memory items due for review, mastered skills due for a maintenance rep, your weakest recent skill, and laddered drills you're close to leveling up (e.g. "2 more clean reps to reach 2-back", "advance to Koch level 6") — each a one-click deep link into the exact drill or mode. You can set optional **goals** (daily minutes, sessions per week, streak length, Morse WPM) on the config page; the launcher and the dashboard's Daily POST widget show your progress against them, and everything hides cleanly if you set none. A **Full POST** now interleaves your drills across domains (math → cognitive → memory → verbal) instead of running all of one type in a row, and a **Quick 5 Min** session leads with your top recommendation instead of a purely random pick. As always, AI-backed wordplay drills are never auto-added to a default session — those stay opt-in.
+ - **[issue-2096] POST now checks whether you *still* know a skill, not just that you once did.** Element and chunk mastery is now decay-aware: it reads your most recent attempts (a rolling window) instead of an all-time tally, so a recent run of misses actually lowers your mastery and an unlucky early wrong answer no longer haunts you forever. On top of that, POST tracks the skills you've mastered but stopped practicing — multiplication rungs below your current level, cognitive rungs you've passed — and schedules a light "maintenance rep" for them on an expanding 7 → 30 → 90-day cadence. When one comes due, a Quick session quietly mixes in one or two labeled review reps; passing pushes the next check further out, while failing marks the skill "needs refresh" and re-checks it sooner (it never demotes a level you've earned). The Progress dashboard gains a Skill Retention panel showing each skill as fresh / due for review / needs refresh, plus a 90-day retention percentage. Nothing appears until you've actually mastered something, so fresh installs and existing data stay quiet until there's a skill worth re-verifying.
+ - **[issue-2098] POST sessions survive a refresh, are shareable by link, and can't double-record.** A POST session no longer lives only in the current page: refreshing mid-drill now resumes the same run (same drill queue, same completed results, right where you left off), and refreshing on the results screen keeps your results. Every saved session gets its own shareable, bookmarkable address (`/post/session/<id>`) — History rows open it, and it shows the same per-drill mistake review as the just-finished screen; a stale or deleted link shows a clear "session not found" message. Wordplay game modes now live in the URL too (`/post/wordplay/<mode>`), so a mode is deep-linkable and refresh-safe. Saving a session is now idempotent: if the network drops and the app retries, you get one record, not two — and a hiccup in the after-save bookkeeping (spaced-repetition scheduling for memory drills) can never fail an already-saved session.
+ - **[issue-2095] Cognitive drills now level up as you master them, instead of training at one fixed difficulty forever.** N-back, digit span, Schulte table, mental rotation, and Stroop each climb their own mastery-gated ladder: n-back ramps 1-back → 2-back → 3-back and then squeezes the flash speed (2500 → 2000 → 1600ms); digit span grows its span and adds backward recall; Schulte grows the grid 4×4 → 6×6; mental rotation and Stroop add trials. You advance a rung only after sustained high accuracy at the current one (n-back uses the fair signal-detection accuracy, so never-pressing can't bank a level), and you're never demoted below a rung you've earned. Each drill now stamps its difficulty into your saved results, so progress is tracked per level (a 2-back run no longer pools with a 3-back run). The config page shows each drill's current rung and progress toward the next, with a per-drill "Progressive" toggle (on by default) — turn it off to set the knobs by hand, including the previously-hidden n-back stimulus speed and digit-span show time. Reaction time stays a fixed measurement. On by default for existing installs with no migration.
+ - **[issue-2091] A unified Progress dashboard shows whether you're actually improving.** POST has a new **Progress** page (in the POST sidebar section, ⌘K, and voice nav) that pulls scored sessions, Morse/memory practice, and mastery into one view. It charts your score, accuracy, and response-time trends over time — so "am I getting faster?" finally has an answer — with same-day sessions rolled into one point (no more overlapping dots), a per-domain focus selector, and time-in-training cards. Your practice streak is now a single number counting *any* active day — a scored session **or** a Morse/memory practice — so the launcher, the Morse trainer, the Progress page, and the dashboard widgets all show the same streak instead of three different ones. A mastery panel shows your multiplication ladder rung and each memory item's mastery and due status. The full session-history table lives on as a sub-view.
+ - **[issue-2092] Morse progress now lives on the server, with WPM/accuracy trends and a per-character confusion matrix.** Your Koch level and every completed drill round are now saved server-side instead of only in the browser — so clearing browser data or switching devices (over Tailscale) no longer wipes your Morse mastery, and your level is identical everywhere. The first time you open the trainer it adopts your existing browser level once, then keeps both in sync. A new **Morse Progress** panel on `/post/morse` charts accuracy and effective-WPM trends per mode (Copy / Head Copy / Send), highlights your most-confused character pairs (E↔I and friends), and lists your weakest characters worst-first so you know exactly which to drill next. Send-mode rounds record per-character keying accuracy and timing too.
- ## Navigation
+ ## Rounds
- - **Messages moved out of Brain into its own top-level "Comms" section.** The four Messages pages (Inbox, Drafts, Sync, Config) were buried as loose children inside the Brain group, mixed in with notes/feeds/links. They now live under a dedicated **Comms** sidebar section (between Chief of Staff and Create, alphabetically), with clean labels — so messaging is a first-class destination rather than a Brain sub-item. The page routes are unchanged (`/messages/*`), so existing links, ⌘K, and voice ("messages" / "comms") still resolve; only the sidebar grouping and the nav-manifest section moved. (`client/src/components/Layout.jsx`, `server/lib/navManifest.js`)
+ - **[issue-2121] Reference analysis can now pull a voice out of a stacked mix, not just solo spans.** The "analyze a reference's attached audio" workbench used to only transcribe time ranges where a voice sings *alone* — useless for the many layered TikTok builds where a new part enters over the layers already playing and never appears solo. Each segment now has a **Stacked** toggle: turn it on and set a short *backing reference* window from the moment just before the voice enters, and extraction subtracts that backing layer's spectrum (a hand-rolled FFT + spectral-diff, all pure local DSP — zero AI calls) to recover the newly-added voice's pitch line, then transcribes it onto the round's tempo/key grid exactly like the solo path. Enabling the toggle auto-seeds a sensible backing window ending right where the voice enters; you can nudge it or set it from the playhead. Solo extraction is unchanged.
+ - **[issue-2108] Built-in rounds now document their melody variant points.** Ah Poor Bird, Rose Rose Rose Red, and Zum Gali Gali carried melody/lyric choices that differ from other printed versions with no note explaining why — so a future accuracy check (or the AI evaluate feature) could mistake a deliberate variant for an error. Their notation now spells out each variant (Ah Poor Bird's C natural vs. the harmonic-minor C♯; Rose's verse and ending-note choices; Zum Gali Gali's D-minor transposition and refrain-only form) and cites the sources it was checked against.
- ## Settings
+ ## Fixed
- - **The AI Provider add/edit dialog now closes when you click outside it (or press Esc).** The provider form on the AI Providers page was a hand-rolled `fixed inset-0` backdrop with no dismiss-on-backdrop and no Esc handling — the only way out was the Cancel/✕ button. It now uses the shared `ui/Modal` component (the app-wide DRY standard for modal chrome), so a backdrop click or Esc dismisses it like every other migrated dialog. (`client/src/pages/AIProviders.jsx`)
-
- ## Mobile
-
- - **Fix: the Apps page action buttons now meet the 40px touch-target minimum on mobile.** A mobile-responsiveness audit of the app (375px viewport) found the codebase already well-covered — tables wrap in `overflow-x-auto`, drawers/modals use `w-full sm:w-[...]`, and grids carry responsive bases — with one outlier: every control button on `/apps` (Start/Stop/Restart, Launch/Dev UI, Manage/Delete/Archive, and the expanded-panel quick actions like Update/Build/Refresh Config) used `py-1.5` + `text-xs`, rendering ~30px tall — below the codebase's own 40px tap-target convention and the WCAG 44px guideline. Each now gets `min-h-[40px] sm:min-h-0`, so the primary app-management controls are comfortably tappable on a phone while desktop keeps its compact density. (`client/src/pages/Apps.jsx`)
-
- ## Tribe
-
- - **Fix: the Tribe relationship map now adapts to the daytime themes instead of staying dark-only.** The concentric circle map (`TribeCircleMap`) hardcoded dark hexes into its SVG — a near-black label halo (`#1a1a1a`), pale-gray node initials (`#e5e7eb`), and a light-blue "Me" label (`#bfdbfe`) — plus `text-white` legend headings and a `text-white` tooltip name. On a light day theme (near-white cards) the halos showed as dark outlines, the node initials and headings washed out to near-invisible, and the tooltip name vanished. All of these now resolve through the active theme's CSS variables (`rgb(var(--port-card))` for the masking halo, `--port-text` / `--port-text-muted` / `--port-accent` for ink), mirroring the SVG-theming pattern in `ScoreSheet.jsx`, so the map reads correctly in both night and day modes. (`client/src/components/tribe/TribeCircleMap.jsx`)
-
- ## CoS / task learning
-
- - **Learning-based model routing now prefers the lightest tier that succeeds, instead of the marginally-highest-success tier.** `suggestModelTier` sorted candidate tiers by success rate and returned the top one, so a `heavy` tier at 85% would beat a `light` tier at 82% — silently over-allocating compute for the same outcome, despite an inline comment that said "if a lighter tier has high success, no need to upgrade." It now picks the **lightest** tier among all that clear the high-success threshold (≥80%), realizing that intent and saving the heavier model for task types that actually need it. The cost-ranking covers the full tier namespace that actually lands in `routingAccuracy` — not just `light`/`default`/`medium`/`heavy` but the thinking-level names (`minimal`/`low`/`high`/`xhigh`) recorded by `selectModelForTask`, with `minimal`/`low` (local models) cheapest and `xhigh` (opus) heaviest; an unknown/future tier name (e.g. `user-specified`) ranks as heaviest so it can never masquerade as the cheapest option. Failing-tier avoidance and the insufficient-data short-circuit are unchanged. The model selector now resolves a learned thinking-level suggestion (`high`/`xhigh`/`off`) through `getModelForLevel` instead of only its four-entry static map, so a proven thinking-level tier is actually used rather than silently falling through to the provider default. Local-preferred thinking levels (`minimal`/`low`) are excluded from suggestion candidates because the learning→selection path can't switch the active provider to a local one — so the recommender never suggests a tier nothing can run, and the lightest tier the runtime *can* run (e.g. `light`) wins instead of falling through to default. (`server/services/taskLearning/routing.js`, `server/services/agentModelSelection.js`)
-
- ## Local model stack
-
- - **The Local LLMs page now tells you when Ollama is out of date and lets you update it in one click.** The backend card previously showed only the installed Ollama version with no indication that a newer release existed — so an install could quietly fall behind (and a model pull would fail with a cryptic "requires a newer version of Ollama" before the auto-upgrade flow kicked in). The card now compares the running version against the latest published Ollama release (looked up from GitHub, cached 6h so the steady-state UI never hits the network) and, when newer, shows a "v{latest} available" hint plus a green **Update to v{latest}** button that drives the existing in-place updater (direct `.app` download + relaunch on macOS, Homebrew or the official script elsewhere) with live progress. On platforms PortOS can't auto-update, it links to the download page instead. (`server/services/localLlm.js`, `client/src/components/settings/LocalLlmTab.jsx`)
- - **[issue-1320] LoRA captioning now keeps a subject's signature look out of the captions, so the trigger word learns it — and training won't silently start when identity is still leaking.** A LoRA binds whatever the captions *don't* describe to the trigger word, so naming a character's always-present cloak/crown/armor in every caption taught the model those phrases instead of the trigger — the bare trigger then rendered a generic subject. Two changes close the loop: (1) the vision captioner is now told to describe **only what changes shot-to-shot** (pose, framing, expression, lighting, setting) and to omit fixed identity — and when the bible knows the subject's signature wardrobe/props/palette, those are passed in by name as an explicit do-not-mention list, so they're omitted even when the model would have phrased them differently each shot (the case the post-hoc shared-fragment strip misses, since it only matches exact repeated phrasing). (2) Launching a training run now **re-checks for caption identity-leak and blocks** (409 `CAPTION_IDENTITY_LEAK`, listing the offending fragments) instead of training silently — the panel offers "Strip identity & queue" or "Train anyway," and resume skips the gate. This is the dataset-quality groundwork before the #1321 base-tier fidelity bench. (`server/services/loraDatasetCaption.js`, `server/services/loraDatasetGenerate.js`, `server/services/loraTraining/dataset.js`, `client/src/components/loraTraining/TrainingPanel.jsx`)
- - **[issue-1329] Pinned a validated mlx/mlx-metal trio for LoRA training so the GPU-watchdog stack can't silently drift back to the known-bad build.** The three M5 Max kernel panics during FLUX.2 LoRA training all happened on mlx/mlx-metal 0.30.6, but `setup-image-video.sh` installed `mflux>=0.17` as a *floor* and let pip resolve mlx under mflux's `mlx<0.32` cap — so a reinstall could land back on a panicking build. The setup script now pins the bisect-validated trio **mflux 0.17.5 · mlx 0.31.2 · mlx-metal 0.31.2**, proven by run `d36562a0` completing a full LoRA training to adapter extraction (flux2-klein-4b, bf16, 768px, segmentation on) on the panicking M5 Max with no panic or reboot. The runtime-fingerprint half shipped earlier (#1406). (`scripts/setup-image-video.sh`, `docs/research/2026-06-13-mflux-training-watchdog-panic.md`)
- - **[issue-1329] Applied the upstream-confirmed fix for the LoRA-training GPU watchdog panic.** A search of the MLX tracker turned up the root cause: [mlx #3267](https://github.com/ml-explore/mlx/issues/3267) — the Metal GPU watchdog kills sustained LoRA training whose command buffers compete with active-display compositing (escalating to a `watchdogd` kernel panic + hard reboot on M5-class silicon). The MLX maintainer's confirmed workaround is the `AGX_RELAX_CDM_CTXSTORE_TIMEOUT=1` env var, which PortOS now sets automatically in the trainer (it propagates to the `mflux-train` child; set it to `0` to disable). The trainer logs `STATUS:watchdog mitigation · AGX_RELAX_CDM_CTXSTORE_TIMEOUT=…` so a paniclog records whether it was active. Notably, per #3267 the kill is at the IOGPU layer *above* the process boundary — so process-teardown segmentation alone does not prevent it, and the strongest user-side mitigation is to keep the display off (SSH headless or `pmset displaysleepnow`) for heavy sustained runs. Our data points were posted to #3267 rather than filed as a duplicate. (`scripts/train_mflux_lora.py`, `docs/TROUBLESHOOTING.md`, `docs/research/2026-06-13-mflux-training-watchdog-panic.md`)
- - **[issue-1329] Confirmed on the M5 Max what actually stops the watchdog panic: keeping the display off.** A clean A/B on the *same* 9B-bf16 segmentation-OFF config (the heaviest, most panic-prone) — both with `AGX_RELAX_CDM_CTXSTORE_TIMEOUT=1` set — settled it: with the **display active** the box hard-rebooted at step 0 within minutes (first telemetry-captured panic showed Nominal thermal pressure, i.e. a GPU **driver hang** not heat, with `WindowServer` the top-CPU thread); with the **display asleep** (`pmset displaysleepnow`) the identical run reached **step 302**, clearing the documented 150–300 panic window with no panic. So the env var is necessary but not sufficient for heavy runs — for a 9B/heavy bf16 job, drive the box over SSH or sleep the display, and keep segmentation on. `caffeinate -s` does not sleep the display, and closing the lid suspends the whole machine. TROUBLESHOOTING now documents the working recipe. (`docs/TROUBLESHOOTING.md`, `docs/research/2026-06-13-mflux-training-watchdog-panic.md`)
- - **[issue-1329] Fixed a bug that was *causing* the training GPU-watchdog crash, and made PortOS auto-sleep the Mac's display during training (then wake it after).** The trainer spawned `caffeinate -dis` to keep the machine awake — but the `-d` flag *forces the display to stay on*, the exact WindowServer-GPU-contention state that triggers the watchdog kernel panic. (The code comment even said "display can sleep"; the flag did the opposite.) The flag is now `-is` so the display can sleep, and on Apple Silicon PortOS proactively runs `pmset displaysleepnow` when a run starts and wakes the display (`caffeinate -u`) when it finishes — so a run you kick off and walk away from (or trigger remotely) protects the box automatically, and you see the result when it's done. On by default; opt out with `loraTraining.displaySleep: false` (e.g. headless). The training panel now explains the crash risk and recommends letting big runs go overnight. (`server/services/loraTraining/index.js`, `server/services/loraTraining/displayPower.js`, `server/lib/validation.js`, `client/src/components/loraTraining/TrainingPanel.jsx`)
-
- ## Mood boards
-
- - **Fix: Pinterest sync pulled 0 pins from boards that actually had images.** Two bugs compounded. (1) Linking a board *section* URL (`/user/board/section/`) stored a `/user/board/section.rss` feed, but Pinterest serves no per-section RSS — that path returns its HTML page with a 200, which parsed to zero pins. Section URLs now collapse to the parent board's feed (the best available, since Pinterest has no section feed), keeping the section URL for display; already-linked section boards self-heal on the next sync. (2) Pinterest entity-escapes each pin's description HTML (`&lt;img src=…&gt;`) rather than wrapping it in CDATA, so the `<img>` fallback never matched the live feed and every pin was skipped; the parser now decodes the description before probing for the image. (`server/lib/pinterestFeed.js`, `server/services/moodBoard/pinterest.js`)
- - **Import a Pinterest board into a mood board — link it once, then "Sync now" pulls new pins on demand.** Paste a public Pinterest board URL onto a mood board and PortOS fetches the board's RSS feed, downloads each pin's image into your own `data/images/` (so it federates with the board and survives Pinterest link rot), and pins it as an image item with the pin's title as the caption and its permalink as the source. Syncing is incremental: the first sync after linking pulls everything the feed exposes; later syncs add only pins it hasn't seen (deduped by permalink), and re-linking to a different board pulls that one down. NOTE: Pinterest's RSS exposes only the most-recent ~25 pins, not the entire board — the UI states this rather than implying a full backfill. Feed and image fetches go through a new shared SSRF-guarded fetcher (`server/lib/safeUrlFetch.js`), and the link rides the board record's JSONB so it federates with no schema-version bump. (`server/lib/pinterestFeed.js`, `server/services/moodBoard/pinterest.js`, `server/routes/moodBoard.js`, `client/src/pages/MoodBoardDetail.jsx`)
-
- ## Creative onramp
-
- - **[issue-1633] A new "Start a Story" page gives you one clear front door for beginning a story.** Instead of guessing whether to open the Story Builder, the Importer, or the Writers Room, you now pick how you want to begin — from an idea, from an existing work, or by writing prose — and the page routes you into the right tool. You can also choose up front whether to start a fresh universe or attach the story to one you already have; that choice carries through to the Story Builder and Importer automatically. All the existing pages stay exactly where they were — this just adds a signposted entry point (reachable from the sidebar, ⌘K, and voice). (First phase of the larger creative-onramp effort; prose-mode universe linking comes later.)
- - **[issue-1633] Brain notes can now flow into the creative Catalog — making it the one place your ideas, characters, and scenes collect as reusable ingredients.** Two new paths: (1) every Brain record (idea, journal memory, project, admin item, person) gets a **Send to Catalog** button that runs it through the same extract→review→commit pipeline as paste/URL/voice, so a captured thought becomes typed ingredients (characters/scenes/ideas/…) you confirm before keeping. (2) A sticky **Creative** toggle on the Brain capture box (Inbox + Quick Capture) flags a note as a creative idea at capture time — todos and links stay out — and a **Send N creative notes → Catalog** action in the inbox batches the flagged notes into one ingest review when you're ready. Reuses the existing catalog ingest flow end-to-end; no new data model. (`server/services/catalogIngestSources.js`, `server/services/brain.js`, `client/src/components/brain/tabs/InboxTab.jsx`, `client/src/components/QuickBrainCapture.jsx`, `client/src/pages/CatalogIngest.jsx`)
- - **[issue-1722] Batch-sent creative notes now drop out of the inbox once their Catalog ingest is committed — so you can't accidentally send the same notes twice.** Previously, after sending your flagged creative notes to the Catalog, the "N creative notes ready" banner kept showing them and a return trip would re-submit the same text. Now the notes are marked consumed the moment you commit ingredients from that review (not on mere navigation — abandoning the review leaves them re-sendable), so the banner clears itself for the notes you've already turned into ingredients.
- - **[issue-1761] Remix Catalog ingredients straight into a new story — the first output-side bridge of the creative pipeline.** The Catalog now has multi-select: tick any characters/places/objects/ideas/scenes, then **Remix into… → Story Builder** carries them across. Story Builder opens seeded — the chosen ingredients show as chips and the seed-idea field is pre-filled from their summaries (yours to edit), and when you create the story each ingredient is linked to the new series via the existing `catalog_ingredient_refs` table, so it shows up in that ingredient's "Appears in" panel. No new data model and no parallel copy of your ingredients — the story and the Catalog share one graph. The handoff is intentionally generic (`remix.ingredientIds`) and the action is a menu with one target today, so adding further remix destinations (Creative Director casting, portrait gen) is additive. Story Builder creation is unchanged when you don't remix. (First remix slice of the #1721 creative-pipeline epic.) (`server/lib/catalogValidation.js`, `server/services/catalogDB.js`, `server/routes/catalog.js`, `server/lib/storyBuilderValidation.js`, `server/services/storyBuilder.js`, `client/src/pages/Catalog.jsx`, `client/src/pages/StoryBuilder.jsx`, `client/src/services/apiCatalog.js`)
-
- ## Chief of Staff
-
- - **Reference-repo watches now file proposals into the app's configured task tracker — not just PLAN.md.** The weekly `reference-watch` task always appended its adoption-worthy `[ref-watch-…]` proposals to PLAN.md, even for an app configured to track work in GitHub (or GitLab/JIRA) issues — so the proposals landed where nothing would pick them up. The task now resolves each app's work tracker (`resolveAppWorkTracker`) and injects tracker-specific recording instructions into the prompt: PLAN.md apps get committed checklist items as before, GitHub/GitLab apps get a labeled `reference-watch` issue per proposal (`gh`/`glab issue create`), and JIRA apps get a ticket (falling back to PLAN.md when no JIRA credentials are present). The References tab note now states the real destination for the current app instead of hardcoding "PLAN.md". Prompt bumped to v3 with the prior default preserved for cross-install auto-upgrade. (`server/services/referenceRepos.js`, `server/services/taskPromptDefaults/prompts.js`, `server/services/taskPromptDefaults/versions.js`, `server/services/taskPromptDefaults/previousDefaults.js`, `client/src/components/apps/ReferenceReposPanel.jsx`)
- - **[issue-1683] CoS daily action-budget can no longer overshoot by one at the boundary.** `completeAgent()` emitted `agent:completed` — whose handler schedules `dequeueNextTask()` and its daily action-budget gate — *before* recording the just-finished action via `recordDomainUsage('cos', …)`. At the exact `maxActionsPerDay` boundary the dequeue read stale usage that didn't yet include the completing action (which was already `status: 'completed'`, so it wasn't counted as in-flight either), admitting one autonomous spawn past the cap. The usage ledger is now written before the `agent:completed` emit so the gate always counts the completing action. (`server/services/cosAgents.js`)
- - **[issue-1650] A task a federated peer is already working can no longer starve this machine's queue.** Now that peer claims/leases are visible via task-list federation (#1712), both spawn engines skip a task whose live lease belongs to *another* instance **during candidate selection** — before they emit `task:ready` and consume a spawn slot. Previously such a task (often the highest-priority pick) was selected each cycle, the lifecycle spawn guard then refused it (spawning nothing), and that wasted slot starved the next unclaimed task. The skip now runs in `dequeueNextTask` (cos.js) and `evaluateTasks` (cosTaskGenerator.js), across their user-task and auto-approved tiers and their dry-run plan, using the shared `isHeldByOther(task.metadata, instanceId)` predicate. This closes the last open acceptance criterion of #1650 (the dequeue-time peer-claim skip from the #1563 review). (`server/services/cos.js`, `server/services/cosTaskGenerator.js`)
-
- ## Federation
-
- - **[issue-1724] Decision: the Tribe relationship graph and universe render-runs stay machine-local (not federated).** Closing the last two open lines of the full-sync gap matrix (#1561) with an explicit, documented call rather than new sync wiring. The **Tribe graph** (`tribe_people` / `tribe_touchpoints` / `tribe_memory_links`) stays local because it is relationship-graph data — the same boundary PortOS already draws for the brain, where memory *nodes* federate but `memory_links` deliberately do not — and because it is coupled to machine-local domains (its memory cross-links extend the non-federated `memory_links` layer; its touchpoints carry per-machine calendar-account references). **Universe render-runs** (`universe_runs`) stay local because they are a regenerable render cache under a 200-row *global* cap that two peers would mutually evict, while the durable universe record they derive from already syncs. The decision is recorded in an ADR and pinned by a guard test so federating either later is a conscious act. No new sync categories or schema-version keys — no coverage guards touched. (`docs/decisions/2026-06-26-tribe-and-universe-runs-local.md`, `docs/STORAGE.md`, `server/services/tribe.js`, `server/services/universeBuilder/db.js`, `server/services/sharing/peerSync.test.js`)
- - **[issue-1650] Completed Chief-of-Staff agent history now mirrors across full-sync peers.** Each paired machine's CoS history tab becomes a complete replica: a full-sync peer advertises its date-bucketed completed-agent archives (the metadata, transcript, and prompt for every finished agent), and the other machine receiver-pulls any it's missing on the ~60s sweep, verifies each file against its advertised hash before writing, then updates its history index so the arrivals appear. Archives are immutable once an agent finishes, so this is safe append-only replication — nothing is overwritten or merged. It runs only for peers explicitly flagged full-sync; a non-full-sync peer is unaffected. Live/running agents, their terminals, and worktrees stay machine-local as before. (Task-list and claim-metadata federation is tracked separately.) (`server/services/sharing/peerSync.js`, `server/routes/peerSync.js`, `server/services/cosAgents.js`)
- - **[issue-1712] The live Chief-of-Staff task list now mirrors across full-sync peers — so two machines never both spawn the same task.** Completing the CoS federation started in #1650, each paired machine now sees the other's live backlog and, crucially, its claims: when one machine claims a task to work it, the other learns of that claim on the ~60s sweep and yields instead of spawning a duplicate agent. Because both machines edit the task files live, the backlogs are merged per task rather than copied over each other — a task you've just claimed is never clobbered by a peer's stale copy, completions converge so a finished task stops showing as in-progress on the other machine, and an expired claim (from a crashed machine) becomes freely re-claimable. It runs only for peers explicitly flagged full-sync; a non-full-sync peer is unaffected. Live terminals, in-flight spawns, and worktrees stay machine-local. (`server/services/sharing/peerSync.js`, `server/services/cosTaskMerge.js`, `server/services/cosTaskStore.js`, `server/routes/peerSync.js`)
- - **[issue-1714] Chief-of-Staff task edits now converge to the most recently edited version across full-sync peers.** Building on the task-list federation in #1712: when the same task is edited on two paired machines while it stays in the same state (you re-prioritize it on one, tweak its description on the other), the machines now keep the *newest* edit instead of an arbitrary-but-stable winner. Each task carries an edit timestamp stamped whenever its content changes — but deliberately *not* on a background claim/lease heartbeat, so merely working a task can't make a stale edit win. Older tasks from a peer that predates this still converge safely (a missing timestamp counts as oldest), and task completion still always wins over an in-progress edit. (`server/services/cosTaskMerge.js`, `server/services/cosTaskStore.js`)
- - **[issue-1645] Writers Room folders and writing-sprint exercises now federate across peers.** Following works (#1644/#1565), the library's folders and exercise sessions replicate over the per-record peer-sync push pipeline with full last-writer-wins + tombstone semantics. Both tables gained soft-delete columns (`deleted`/`deleted_at`) so a deletion propagates as a tombstone the merge keeps until garbage-collected — the LWW model never propagates a hard delete, so omitting a record would let an out-of-date peer resurrect it. New record kinds `writersRoomFolder` / `writersRoomExercise` are wired through the schema-version gate, wire sanitizer, conflict journal (with restore), peer-sync subscribe/push/merge, tombstone GC, auto-subscribe-on-create, the Instances sync-category toggles, and both storage backends. Exercises predate federation and carry no `updatedAt`, so the wire sanitizer derives a stable LWW key from their existing `startedAt`/`finishedAt`. (`server/services/writersRoom/`, `server/services/sharing/peerSync.js`, `scripts/migrations/139-…`)
-
- ## Editorial checks
-
- - **[issue-1616] The editorial health-score severity weights and the autopilot blocking-severity sets are now tunable per series.** The health score deducted a fixed penalty per open finding (High 12 / Medium 5 / Low 1) and each Series Autopilot gate blocked on a fixed severity set — arc verification and beat continuity on High+Medium, the editorial review on High — with no way to say "for this series, Medium findings shouldn't pause the run" or "weight Low nits more heavily." Each series can now override both from the Editorial Checks page: a **Severity tuning** panel sets per-severity health-score weights (blank = the default) and, per autopilot gate (arc / beat continuity / editorial review), which severities count as blocking (checking none = nothing blocks that gate). The score shown in the panel, the health gate, and the persisted revision-trend snapshots all reflect the override, and the resolved blocking sets drive every autopilot gate read. Both default to "unset → frozen defaults," so existing series are unchanged; the overrides ride peer sync wire-gated at `pipelineSeries` schema v9 (a behind peer rejects the ahead-version transfer rather than stripping the override). Follow-up to the per-check severity override (#1596). (`server/lib/editorial/severityConfig.js`, `server/services/pipeline/editorialScore.js`, `server/services/pipeline/seriesAutopilot.js`, `server/services/pipeline/series.js`, `server/lib/schemaVersions.js`, `server/routes/pipeline/series.js`, `server/routes/pipeline/editorial.js`, `client/src/components/pipeline/editorial/SeriesSeverityConfig.jsx`)
- - **[issue-1626] On-the-nose dialogue findings now say *why* a line is flat, not just that it is.** `dialogue.on-the-nose` flagged subtext-free dialogue but labeled every finding the same way — too broad to act on. Each finding is now sub-classified into one of three subtypes so the fix is obvious: **exposition** (info-dump / "maid-and-butler" lines that state facts to inform the reader), **emotion-tell** (a character naming their own feeling outright instead of letting it surface through behavior), and **relationship-report** (a line describing a bond instead of dramatizing it). The stage prompt classifies and emits the subtype, the runner validates it against an allow-list (a stray label falls back to none), and it renders as a small badge on the finding in both the manuscript comment card and the editorial triage list. Additive and backward-compatible — older findings and synced peers carry no subtype and render unchanged; existing installs pick up the new prompt via boot migration 144. (`server/lib/editorial/checkRegistry.js`, `data.reference/prompts/stages/pipeline-editorial-on-the-nose.md`, `server/services/pipeline/manuscriptReview.js`, `client/src/components/pipeline/manuscript/ManuscriptCommentCard.jsx`, `client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx`, `scripts/migrations/144-editorial-on-the-nose-subtype.js`)
- - **[issue-1631] Findings that name canon entities now link straight to the universe's canon section.** A continuity or character finding ("Aria's eye colour drifts between issues") named a canon entity in plain prose with no way to jump to that entity's record — you'd manually cross-reference. When the selected series has a linked universe, each finding now carries a **Canon** chip row: every character, place, or object whose name appears in the finding's problem/location text becomes a one-click link into the universe's canon section, with the entity's descriptor shown as a hovercard (and a per-kind icon). Matching is whole-word and case-insensitive, prefers the longest name so "Jon Snow" wins over "Jon", and collapses repeated mentions to one chip. The chips render outside the finding's manuscript deep-link (no nested links) and appear on resolved findings too, so a continuity review can cross-reference in place. A series with no linked universe, or a finding that names no canon entity, shows no chips — existing behavior is unchanged. (`client/src/lib/editorialChecks.js`, `client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx`, `client/src/pages/PipelineEditorialChecks.jsx`)
- - **[issue-1630] Click a point on the editorial health-trend sparkline to drill into that revision — what was open then, and what changed since the prior run.** The score sparkline in the Editorial Health panel was read-only: you could watch the line dip after an edit pass but not see *why*. Every recorded revision is now a clickable point. Selecting one opens a drill-down showing that snapshot's score (with its delta vs the previous revision) and its open-finding breakdown by severity and category, plus a per-dimension diff against the prior revision — which severities, categories, and checks rose (regressed, in red) or fell (improved, in green), biggest change first. The first recorded revision says there's nothing to compare yet; a revision recorded before per-check tracking shipped omits the per-check diff rather than inventing an all-new baseline. (`client/src/components/pipeline/editorial/EditorialHealthPanel.jsx`, `client/src/lib/editorialHealth.js`, `server/services/pipeline/editorialScore.js`)
- - **[issue-1629] Each editorial check now wears a maturity / quality badge in the catalog, so you can tell a trustworthy check from a noisy or untested one at a glance.** With a series selected, every check card gains a compact quality strip: how many findings the check has produced for that series, the share you dismissed, its false-positive rate, and a maturity badge — **untested** (no findings yet, trust unknown), **unproven** (too few findings to judge — under 5), **noisy** (a proven sample you dismiss most of the time, ≥40% — the signal you most want surfaced so you can deprioritize or mute it, whether or not you tagged each one a false positive), or **reliable** (a proven sample you mostly keep). The numbers are derived purely from the findings you've already triaged (reusing the existing per-check grouping), so the catalog turns your dismissals into a trust signal without any new data model. The strip is hidden when no series is selected, since findings are per-series and every check would otherwise read "untested". (`client/src/lib/editorialChecks.js`, `client/src/components/pipeline/editorial/EditorialCheckCard.jsx`, `client/src/pages/PipelineEditorialChecks.jsx`)
- - **[issue-1625] The reading-level check now reports per-scene variance, not just a single whole-corpus number.** `style.reading-level` measured one Flesch–Kincaid grade for the entire series and flagged drift from the style-guide target — but a single average hides the modulation a skilled writer uses (a quiet introspective scene reads lower, an action scene higher) and conceals a lone scene that swings far outside the intended band. The check now also splits the manuscript into scenes (reusing the shared `splitScenes` divider parser — markdown headings including the stitcher's `# Issue N`, and centered rules like `***`), measures each, and flags any scene whose grade falls outside the target **band** (`target ± sceneTolerance`), reporting the widest swings first. Three new per-series knobs join the existing whole-corpus tolerance: **per-scene band tolerance** (default 4 — wider than the corpus tolerance since scenes legitimately modulate), **minimum scene words to measure** (default 120 — short fragments are too noisy for a reliable FK estimate), and **max per-scene findings** (default 5 — so a long manuscript can't flood the review). The original whole-corpus finding is unchanged, and a single-scene manuscript reports only that — so existing series behavior is preserved. (`server/lib/editorial/checkRegistry.js`)
- - **[issue-1622] The adverb, passive-voice, and repeated-gesture copy-edit checks are now series-tunable like their word-list siblings.** Clichés, said-bookisms, filter words, crutch words, hedge words, and gestures already accepted a house-style allowlist and an extra-words list, but `prose.adverbs` and `prose.passive-voice` didn't expose theirs (repeated-gestures already did). Now all three carry the same config: `prose.adverbs` gains an **extra-adverbs** list so a series can flag the real adverbs the `-ly` heuristic misses ("fast", "well", "hard"); `prose.passive-voice` gains a **house-style allowlist** (participles to never flag — archaic/adjectival "-ed" forms like "blessed", "beloved") and an **extra-participles** list (series-specific irregular participles the heuristic misses, e.g. "begun", "hewn"). A historical-fiction series can now whitelist archaic forms and a comedic series can mute gesture repetition without code changes. Additive config with empty-string defaults — existing series are unaffected. (`server/lib/editorial/proseTics.js`, `server/lib/editorial/checkRegistry.js`)
- - **[issue-1624] A new editorial check flags objects whose narrative weight is out of proportion to their prominence.** The existing `objects.*` checks are presence tests — is a significant object attached to someone, is an interaction motivated, does an attachment's origin contradict its character — but none asked whether an object's *weight* matches how much the plot actually leans on it. The new `objects.weight-proportionality` check (series-scope, LLM, default-on) weighs each object's prominence in the prose against the depth of backstory and significance the story invests in it, and flags two failures: **over-weighted** (a minor object handed a disproportionate backstory — "a one-line locket with a three-issue origin") and **under-established** (a prominent or decisive object resting on no lineage — "an heirloom that resolves the finale, never set up"). It reads the stitched manuscript plus the canon object↔character attachment summary, judging the *proportion* rather than the absolute amount, and carries each object's established weight across manuscript chunks so a backstory planted early is weighed against a payoff that lands late. Stays distinct from `objects.unmotivated-interaction` (a single unmotivated beat) and `objects.backstory-consistency` (a contradicted origin) — the gap here is the over- or under-writing of plot machinery. Ships the prompt + stage-config for fresh installs and a boot migration (143) so existing installs seed the stage. (`server/lib/editorial/checkRegistry.js`, `data.reference/prompts/stages/pipeline-editorial-object-weight-proportionality.md`, `scripts/migrations/143-editorial-object-weight-proportionality-stage.js`)
- - **[issue-1623] A new editorial check flags visually dense but emotionally empty scenes.** `sensory.balance` already flags all-visual scenes and sensory-*bare* scenes, but it missed the opposite failure: a scene rich in setting and physical detail that carries almost no POV reaction — "500 words of setting, zero interiority" reads just as flat as a bare one. The new `scene.interiority-balance` check (scene-scope, default-on) weighs each scene's *description-to-interiority ratio* and flags two cases — **description swamps reaction** (long passages of scenery/blocking with little interleaved thought, feeling, or appraisal) and **emotionally inert detail** (striking images that land with no reaction from the perceiving character). It reads the stitched manuscript plus the reverse-outline scene map and degrades to a whole-issue scan when no outline exists. It judges the *ratio*, not the absolute amount, so a richly described scene filtered through a reacting mind passes — and it stays distinct from `sensory.balance` (the five senses) and `interiority.protagonist` (whole-issue interiority absence). Ships the prompt + stage-config for fresh installs and a boot migration (142) so existing installs seed the stage. (`server/lib/editorial/checkRegistry.js`, `data.reference/prompts/stages/pipeline-editorial-interiority-balance.md`, `scripts/migrations/142-editorial-interiority-balance-stage.js`)
- - **[issue-1621] The copy-edit pass now flags hedge / weasel distance markers, and the filter-words check catches more perception phrases.** `prose.filter-words` only caught perception *verbs* (saw, noticed, felt…) and missed the other way prose quietly backs the reader out of a moment: metaphorical distance ("it was as if he knew", "somewhere deep inside", "almost felt"), dialogue/cognitive hedges ("I kind of think", "sort of felt", "more or less"), and cognitive weasel words ("surely", "no doubt", "obviously", "of course"). A new deterministic, default-on, series-tunable `prose.hedge-words` check (its own per-1000-word density threshold, house-style allowlist, and extra-words list, exactly like the sibling word-list checks) scores these as a separate hedge/weasel bucket. The filter-words list also gained the modal-perception and reflexive phrasings of the same tic — "could see/hear/feel", "found himself/herself". (`server/lib/editorial/proseTics.js`, `server/lib/editorial/checkRegistry.js`)
- - **[issue-1620] A new editorial check flags POV economy — too many viewpoints for the run length, and viewpoints introduced too late to earn their place.** `pov.justified` asks whether each *individual* viewpoint earns an arc, but nothing judged the viewpoint *roster* as a whole. The new `pov.economy` check (series-scope, deterministic, default-on) reads the reverse-outline POV-per-scene map and flags two structural problems: **too many POVs for the run length** (e.g. 8 viewpoints across 12 issues, each barely developed — gated by an absolute floor so a one- or two-POV book is never called a crowd) and a **late-introduced, underdeveloped POV** (first takes the viewpoint in the final stretch of the run and holds only a scene or two). The acceptable POV-to-issue ratio, the minimum run length to judge, and the late-introduction window are all per-series tunable. Purely structural over the outline — no LLM call, no manuscript corpus — and degrades to silence when the outline carries no issue numbers (without a run length neither signal can be judged). (`server/lib/editorial/checkRegistry.js`)
- - **[issue-1619] A new editorial check flags character-arc regression, circular arcs, and premature closure.** `arc.transitions` finds the change *moments* but never judged whether each arc holds together end to end. The new `arc.regression` check (series-scope, default-on) tracks each character's progress across the issues and flags an unmotivated **regression** (a character grows then reverts with no earned reason — distinct from a dramatized relapse), a **circular arc** (ends in the same state they began, the growth cancelled out), or **premature closure** (the arc resolves early — e.g. issue 3 of 10 — then stays flat, deflating the back half). It reads the stitched manuscript plus the reverse-outline scene map and the authored per-character arcs (`series.characterArcs`), gates its whole-arc verdicts to the final manuscript part so a mid-arc character whose later growth is still ahead is not false-flagged, and degrades to a prose-only scan when no outline or authored arcs exist. Ships the prompt + stage-config for fresh installs and a boot migration (141) so existing installs seed the stage. (`server/lib/editorial/checkRegistry.js`, `data.reference/prompts/stages/pipeline-editorial-arc-regression.md`, `scripts/migrations/141-editorial-arc-regression-stage.js`)
- - **[issue-1618] A new editorial check scores the series-wide pacing / intensity escalation curve.** `plot.structure-momentum` flags flat stakes as one of many macro pathologies, but nothing measured the *shape* of intensity across the whole series. The new `pacing.escalation-curve` check (series-scope, default-on) scores each issue's dramatic intensity and flags a curve that fails to build — **flat intensity** (issue 1 reads as intensely as issue N), a **front-loaded climax** (the biggest beat lands early and the back half coasts), **plateaued stakes**, or a **de-escalating arc**. It reads the stitched manuscript plus the reverse-outline scene map and a new deterministic per-issue conflict-marker density tally (a mechanical intensity proxy the model treats as a hint and confirms against the prose), gates its whole-curve verdict to the final manuscript part, and degrades to a prose-only scan when no outline exists. Subsumes "conflict escalation" as one signal of the same curve. Ships the prompt + stage-config for fresh installs and a boot migration (140) so existing installs seed the stage. (`server/lib/editorial/checkRegistry.js`, `data.reference/prompts/stages/pipeline-editorial-pacing-escalation-curve.md`, `scripts/migrations/140-editorial-pacing-escalation-stage.js`)
- - **[issue-1697] Health-panel deep-links now honor the triage's session-local check mute.** Muting a check from the Editorial Findings triage (#1602) hid its findings group but the health panel kept advertising that check/category row as clickable — clicking it scrolled to an empty filtered view. The session mute state (`hiddenCheckIds`) was lifted from `EditorialFindingsTriage` up to `PipelineEditorialChecks`, which now subtracts muted checks from the filterable sets the health panel receives; a category stays clickable only while a non-muted check still contributes an open finding to it. (`client/src/pages/PipelineEditorialChecks.jsx`, `client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx`)
- - **[issue-1667] Final-part editorial verdicts no longer lose their carried setup context on a packed last chunk.** The cross-chunk "setup so far" digest normally yields to manuscript coverage — but two whole-story checks (`arc.climax-agency`, `emotion.reaction-proportionality`) gate their verdict to the final part and anchor it on a snippet carried in that digest (the climax candidate / the unprocessed event). When the final chunk packed to within a few hundred chars of the provider window, the digest was silently dropped and the final-only finding was missed. These checks now opt into a `reserveSetupDigest` guarantee that trims the final chunk's manuscript tail to make room for the digest (the inverse of the usual yield), scoped to the final chunk and opt-in checks only — every other chunk and every non-reserving check keeps full manuscript coverage. (`server/lib/editorial/checkRegistry.js`)
- - **[issue-1614] Series Autopilot no longer wastes an LLM call refreshing the reverse outline for a check that won't run, and never proceeds on a stale one.** The pre-checks reverse-outline refresh decided "does any enabled check consume the outline?" from declared sources alone — so a check that's enabled but whose runtime gate declines for this series (no POV-tagged scenes, a canon-less roster) could still trigger a billed regeneration nothing would read. The refresh now evaluates each consumer's gate against the current outline and skips the regen when nothing that would actually run consumes it; a never-generated outline still bootstraps unconditionally. Separately, when the regen no-ops as cached the run re-confirms staleness against the live manuscript and forces one regen if a concurrent edit moved it — so the editorial checks never read a stale outline mid-run. (`server/services/pipeline/seriesAutopilot.js`, `server/services/pipeline/editorial/checkRunner.js`)
- - **[issue-1613] Series Autopilot can now pause when an editorial-checks pass surfaces too many High findings.** Previously the registry-driven editorial-checks step always reported "complete" regardless of finding count — a pass that surfaced 50 High findings looked clean and only the downstream health gate caught it, making the per-step signal misleading. A new, off-by-default **pause threshold** (`pipelineEditorialChecks.checkFindingsPauseThreshold`, also a per-run override and an Options field) makes the run pause for human review when the checks pass finds at least N High findings — gating like the verify/editorial loops, with the High findings carried as residual and a "high findings" badge in the panel. The step's progress frame now also reports the real High count instead of a hardcoded `0`. 0 = off, so existing runs are unchanged. (`server/services/pipeline/seriesAutopilot.js`, `server/services/pipeline/series.js`, `server/lib/validation.js`, `server/routes/pipeline/autopilot.js`, `client/src/components/pipeline/AutopilotPanel.jsx`)
- - **[issue-1615] Series Autopilot now actively notifies you when a run pauses, instead of going silent until you check the status page.** A paused run (budget exhausted, too many High findings, a convergence gate that couldn't auto-resolve, a failed child stage) previously only emitted a live SSE frame — so if you weren't watching the page, the run could sit indefinitely. Every pause now also posts an in-app notification (in the header notification center) with the pause reason and a one-click resume link to the series. A prior pause banner for the same series is cleared first, so a resume→pause cycle leaves exactly one current notification rather than a stack. This is the one autopilot signal that's **on by default** — it's a zero-cost informational banner — but it's overridable per run and via a persisted setting (`pipelineEditorialChecks.notifyOnPause`) and exposed as a "Notify me when a run pauses" checkbox in Options. (`server/services/pipeline/seriesAutopilot.js`, `server/services/notifications.js`, `server/lib/validation.js`, `server/routes/pipeline/autopilot.js`, `client/src/components/pipeline/AutopilotPanel.jsx`)
- - **[issue-1617] Stopping a Series Autopilot run now gives you immediate feedback instead of looking frozen mid-step.** Cancellation is cooperative — it's honored between steps, so a Stop pressed during a long LLM call was only acted on once that call returned, with no acknowledgement in between. The server now emits a `cancel:acknowledged` SSE frame the instant you press Stop; the button switches to a disabled "Cancelling…" spinner and the live status reads "finishing the active step…" until the run unwinds and the terminal frame lands. The active step still finishes first (no mid-stream interruption) — this is purely the missing acknowledgement, now documented on the cancel route. (`server/services/pipeline/seriesAutopilot.js`, `server/routes/pipeline/autopilot.js`, `client/src/components/pipeline/AutopilotPanel.jsx`)
+ - **PM2 standardization no longer overwrites a PM2 config PortOS didn't generate.** Standardizing an app used to always regenerate `ecosystem.config.cjs`, silently replacing a hand-written one — losing its custom ports and settings. A config PortOS didn't generate is now preserved by default (and its ports are left untouched in `.env`/Vite too); PortOS only regenerates its own previously-generated config. To deliberately replace a custom config, opt in with the overwrite flag when standardizing.
+ - **CoS TUI agents running `/do:release`/`/do:pr`/`/do:rpr` no longer get prematurely reaped as "done" while a reviewer is still working** — the idle-timeout reaper only special-cased the `/do:next --swarm` merge-queue wait (#2074); a slow multi-reviewer pass (e.g. codex reading a large diff) could go silent past the default 3-minute idle window and get finalized as a false `idle-complete` success before the release ever reached the merge gate, leaving the PR open with the task dashboard showing "completed" (observed on agent-61508f36, PR #2084, which sat open+unmerged for hours). Added a `createReviewLoopTracker` (`server/lib/tuiHandshake.js`) that latches on multi-reviewer-loop chrome — the review-plan status line (agent list in brackets), a review-pass counter (N of M), or the aggregate report heading — and extends the idle reaper's grace to 15 minutes while active — mirroring the merge-queue fix exactly, including surfacing a timeout as a needs-manual-finish failure (`reason: 'review-loop-idle-timeout'`) instead of a silent success. (Deliberately worded here without reproducing the literal trigger strings — this changelog entry itself would otherwise false-latch the tracker once a future release run reads it.)
+ - **[issue-2107] A song scored in a minor key now shows the correct key signature.** Typing `key: D minor` (or `Em`, `F# minor`, `Bbm`, …) into a song's score header used to render the signature for the *parallel major* instead — e.g. "D minor" showed D major's 2 sharps on a staff full of natural notes. Minor keys now resolve to their relative major's signature (D minor → F, 1 flat), and the reference-audio-to-score feature spells accidentals on the correct side for minor keys too. Plain major keys ("D", "D major", "Dmaj") are unaffected.
+
+## AI Providers
+
+- **A wrong local-model default now self-corrects instead of failing the run.** When an Ollama or LM Studio provider is pointed at a model that isn't actually installed (a stale or mis-typed `defaultModel`, or a model you've since deleted), an API call against it returned a dead-end "model not found" — the user had to notice, open settings, and pick a real model by hand. The shared `callProviderAISimple` path now catches that error, lists the backend's actually-installed models, picks the best fit (the editorial recommender's family/size ranking, skipping embedding-only weights), repoints the provider's `defaultModel` (and any tier slot pointing at a missing model), tells the user via a low-priority notification + activity log, and retries the call once — so the run succeeds and the bad config is fixed going forward. Remote/API and CLI providers are left untouched, since their installed models can't be enumerated. (`server/services/localModelHealing.js`, `server/lib/aiProvider.js`)
-
- ## Internal
-
- - **[issue-1627] Editorial checks can now share findings within a single run.** An editorial check may declare `dependsOn: [<checkId>...]`; the runner topologically orders the pass so declared dependencies run first and injects their findings into the dependent's `ctx.priorFindings` (+ `ctx.findingsByCheck(id)`), scoped to declared deps and frozen. This is the architecture for compound signals (a finding that references another check's finding); no check uses it yet, and a pass where nothing declares a dependency keeps the exact prior run order. Checks that declare no dependency stay pure functions of their `sources`. (`server/services/pipeline/editorial/checkRunner.js`, `server/lib/editorial/checkRegistry.js`)
- - **[issue-1628] Editorial checks can now declare more than one scope.** A check meaningful at multiple granularities may set `scope: ['series','issue']` instead of being split into two near-duplicate checks; the single-string form keeps working. `normalizeCheckScopes`/`primaryCheckScope` normalize either form, the load-time registry guard validates every member (rejecting empty arrays, unknown members, and duplicates), and `resolveCheckState` exposes both a primary `scope` string (for single-value consumers) and the full `scopes` array — so the catalog grouping and dry-run plan list a dual-scope check under each of its scopes. No built-in check is multi-scope yet; this is the architecture. (`server/lib/editorial/checkRegistry.js`, `server/services/pipeline/editorial/checkRunner.js`, `client/src/lib/editorialChecks.js`)
- - **[issue-1544] Dedup the arc-planner's season-tree grouping and episode-match logic.** Extracted `groupIssuesBySeasonTree` (backs both the arc-verify and beat-continuity context builders) and `seasonIdByNumberOf` + `matchIssueForEpisodeEdit` (back both the arc-resolve and beat-continuity episode-correction passes) into `arcPlanner/context.js`. Pure refactor — prompt output and match semantics are unchanged. (`server/services/pipeline/arcPlanner/`)
- - **Bump bundled slashdo to v3.18.0 — `/do:next --swarm` claims and ships several independent issues in parallel.** A new swarm mode drains multiple independent issues at once, each in its own worktree, gating each agent's merge on required CI passing before it lands. Builds on v3.17.2's dependency- and priority-aware backlog ordering: auto-pick skips an issue whose body declares an open `Depends on #N` / `Blocked by #N` (self-clearing once the blocker closes) and honors a `priority:<N>` label to sequence independent work, while `/do:replan` keeps blocked issues out of the stale-prune path and reconciles dependency markers. (`lib/slashdo` submodule)