Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
docs([wardrobe-appearance-id-route-validation]): remove from PLAN.md and log to changelog
[._.]/ Adam Eivyc3b8db6432a8
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex b44c2fa4c5..ea488cce11 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -44,6 +44,7 @@- **[insights-callprovider-nonjson-test]** Added regression-test coverage pinning the insights LLM client's non-JSON-error guard so a malformed provider response can't silently overwrite the cached cross-domain narrative or theme analysis, and consolidated the hand-rolled fetch-`Response` test mocks across the server suites onto one shared helper (no user-facing change).- **[cos-agent-output-write-amplification] Streamed CoS agent output no longer rewrites the entire agent-state file once per line.** A shared ~250ms output batcher now coalesces the runner's per-line output events and direct-CLI stdout/stderr into single state writes (draining before an agent is marked complete), cutting agent-state write churn on chatty agents from dozens of writes/sec to a few — with no change to the live output tail (no user-facing change).- **[subagent-spawner-top-level-side-effects]** The CoS agent spawner now initializes explicitly at server startup instead of as a side effect of being imported, so importing it (in tests or elsewhere) no longer re-arms its event listeners and timers (no user-facing change).+- **[wardrobe-appearance-id-route-validation] Rendering a storyboard scene with a stale outfit pick now fails clearly instead of silently ignoring it.** If a scene's wardrobe selection points at a character or outfit that no longer exists (e.g. it was deleted after the pick was made), the render returns a clear error instead of quietly rendering the character without that outfit.## Fixeddiff --git a/PLAN.md b/PLAN.mdindex c102bd1e24..e8006c348b 100644--- a/PLAN.md+++ b/PLAN.md@@ -55,7 +55,6 @@ Claimable, well-specified, no decision needed — `/claim`-able. Unordered.- [ ] [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).-- [ ] [wardrobe-appearance-id-route-validation] **Validate `characterAppearances` ids against the linked universe at the persistence boundary.** The generic `POST /issues/:id/stages/:stageId/visual` route (`visualGenerateSchema` in `server/routes/pipeline.js`) accepts `characterAppearances` and validates only shape (`characterId`/`wardrobeId` are non-empty strings), not that the ids actually resolve to a canon character + one of its wardrobes. Today `buildScenePrompt`'s defensive read silently drops unresolved picks (matches the existing scene pass-through convention for `shots`), so this is robustness/clarity, not correctness. If tightened later, resolve the ids against `loadBibleContext(issueId).canon.characters` at the route and 400 on a dangling id rather than relying on the prompt-builder's silent drop. Surfaced by /simplify (altitude, 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).