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

docs([extract-use-universe-load-hook]): remove from PLAN.md and log to changelog

[._.]/ Adam Eivyf8ed9aef54f8
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 530cd05e1b..7ba885f1f4 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -24,6 +24,7 @@
- **[series-merge-season-rehoming] Merging two series now keeps each issue in its season.** When you merge a duplicate series into another, issues that belonged to a season are placed into the surviving series' matching season (paired by season number) instead of all landing un-grouped for you to re-file by hand. Issues that had no season stay un-grouped, as before.
- **[merge-cascade-no-rollback] A merge that fails partway no longer leaves a broken half-merge — just re-run it.** If re-pointing a duplicate universe's child series (or moving a duplicate series' issues) fails mid-merge, the duplicate is now kept intact instead of being deleted over records that didn't move, and the merge reports exactly which children are stuck. Because every step is idempotent, simply running the merge again finishes the job cleanly.
- **[conflict-journal-deep-diff] The Sharing → Conflicts tab now shows which sub-entry changed, not a wall of JSON.** For structured fields — universe categories and canon (characters/places/objects), series arc and seasons, issue stages — a conflict now breaks down into one focused before/after diff per changed entry, labelled by its name or key (e.g. just the character "Alice", or the "tone" category), instead of diffing the entire field as a single JSON blob. Restoring and merging still operate on the whole field.
+- **[extract-use-universe-load-hook] Internal refactor: the duplicated "load the linked universe" logic in pipeline stages now sits behind one reusable hook.** No user-visible change.
- **[conflict-journal-issues] Sync conflicts on individual issues are now captured and restorable, like universes and series.** When two of your machines independently edit the same issue while offline and then sync, the older edit is no longer silently overwritten — it's archived in Sharing → Conflicts where you can review what differs and restore your version (covering the issue's title, status, arc placement, length, and stage content such as prose and comic pages). Previously only universe and series conflicts were journaled; child issues rode last-write-wins silently.
- **[manuscript-editorial-jump-pinned-overlay] Jumping to an editorial comment in the Manuscript editor now keeps that comment on screen.** Clicking "Jump" (or the issue link) on an editorial feedback item still scrolls the manuscript to its anchor, but the comment is now also pinned as a floating, dismissable overlay over the manuscript — so its note, suggestion, and Generate-fix/Accept/Dismiss actions travel with the scroll instead of being lost off-screen (previously the sidebar card stayed put on desktop and was pushed far below the fold on mobile's stacked layout). The overlay reuses the existing comment card, auto-closes when the comment is accepted or dismissed, and dismisses on Escape or its close button.
diff --git a/PLAN.md b/PLAN.md
index 0304c1d31a..dd2ca1f07b 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -36,7 +36,6 @@ Claimable, well-specified, no decision needed — `/claim`-able. Unordered.
- [ ] [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.
- [ ] [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.
-- [ ] [extract-use-universe-load-hook] **Extract a `useUniverse(universeId)` load hook.** `client/src/components/pipeline/stages/StoryboardsStage.jsx` (~line 57) and `NounsStage.jsx` (~line 149) now run a byte-identical `useMounted` + `let cancelled` + `getUniverse(series.universeId).then(...).catch(...)` effect to load the linked universe record. Extract a `client/src/hooks/useUniverse.js` returning `[universe, loading, error]` (handling the mount/cancel guards internally), register it in the hooks `index.js` barrel + README, and migrate both call sites. Deferred from the wardrobe-picking PR: migrating `NounsStage` is outside that diff's scope and the new module trips the barrel maintenance rule. Surfaced by /simplify (reuse, 2026-06-01).
- [ ] [vo-mux-preserve-clip-audio-under-ducked-vo] **Preserve + duck stitched-clip audio under VO.** `muxVoLines` (`server/services/pipeline/audioMux.js`) currently *replaces* the episode's audio track with the VO mix (+ optional ducked music bed), matching the prior `muxMusicBed` behavior. AI-gen clips are silent today, but LTX-2 audio-to-video can carry a clip soundtrack that this drops. Mix the stitched video's `0:a` into the final graph as a third `amix` input, ducked under VO via the same sidechain key. Deferred from the 4d.2 PR to keep the initial filter graph bounded. Surfaced during implementation (2026-06-01).
- [ ] [create-issue-preload-series-for-batch] **`createIssue`'s renumber pass re-reads the series on every call — preload it for batch episode seeding.** `createIssue` (`server/services/pipeline/issues.js`) calls `getSeries()` inside its `renumberInline` pass on every invocation. `commitEpisodesToIssues` (`server/services/pipeline/arcPlanner.js`) creates one issue per episode in a loop, so a 12-episode season does 12 redundant `getSeries()` reads of an unchanging record (and `generateIssuesFromArc` already fetched it once). Add a `createIssueWithPreloadedSeries(series, input)` variant (or a `{ preloadedSeries }` option) that threads the already-fetched series into `renumberInline`, and route the batch loop through it. Pre-existing in `createIssue` (the Pipeline season-episodes route pays the same cost); LLM-bound batch so the realized win is small — surfaced by /simplify (efficiency) during the story-builder-issue-llm-seeding PR (2026-06-01). Deferred because it touches the `issues.js` renumber internals beyond this diff's scope.
- [ ] [extract-single-flight-map-helper] **Extract a shared single-flight / in-flight-coalescing helper.** Three sites now hand-roll the `Map<key, Promise>` "share the in-flight result, delete on settle" idiom: `server/lib/sseDownload.js` (`inFlight` keyed by repo, line ~12), `server/lib/promptRunner.js` (`_fallbackMarkAndPickInFlight` keyed by failed provider id), and the read-coalescing half of `server/lib/aiToolkit/providers.js#loadProviders` (`providersLoadInFlight`). A small `server/lib/singleFlight.js` (`createSingleFlight()` returning `run(key, fn)` that returns the shared promise and auto-clears on settle) would dedupe the boilerplate and standardize the cleanup. Note the three sites differ in shape — providers.js layers a TTL snapshot cache on top, promptRunner does keyed side-effectful work — so the helper must stay minimal (just the keyed coalesce) and not try to absorb the TTL/cache concern. Deferred from the coalesce-fallback PR: it's a new public lib module (barrel + README maintenance) that also touches an unrelated file, so it warrants its own PR. Surfaced by /simplify (reuse, 2026-06-01).