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([unify-canoncard-variation-card-into-a-single]): archive to DONE.md
[._.]/ Adam Eivyab74862bf3dc
diff --git a/DONE.md b/DONE.mdindex 80b69a5253..be53a836c7 100644--- a/DONE.md+++ b/DONE.md@@ -8,6 +8,7 @@ For active roadmap see [PLAN.md](./PLAN.md). For project goals see [GOALS.md](./## 2026-05+- **[unify-canoncard-variation-card-into-a-single] Universe Builder — unify CanonCard + variation card into shared `EntryCard` shell.** New `client/src/components/universe/EntryCard.jsx` slot-based primitive (locked accent, title row, body, action column, optional thumbnail, optional footer). `CanonCard` now renders through it and surfaces a top-left thumbnail derived from `primaryImageRef` (falling back to the first `imageRefs[0]`) so each canon entry has a visual at-a-glance. The variation `<li>` in `CategoryEditor` is extracted into a `VariationCard` helper that also renders through `EntryCard` — view mode shows label + prompt + action column (promote / render / lock / edit / remove); edit mode swaps the body for an inline form. Visual consistency between the two card families now flows from the shared shell rather than parallel Tailwind class strings.- **[client-component-tests-for-categoryeditor-promote] Client component tests for `CategoryEditor` + `TrunkView`.** Wired up the first vitest-based client test suite (vitest 3 + jsdom + @testing-library/react + user-event) — new `client/vitest.config.js`, `client/src/test/setup.js`, `test` + `test:watch` scripts in `client/package.json`, CI step in `.github/workflows/ci.yml`. Named-exported `CategoryEditor` and `TrunkView` from `client/src/pages/UniverseBuilder.jsx` and added `client/src/pages/UniverseBuilder.test.jsx` covering: promote button disabled when `!canPromote` (parent's `!selectedId`); promote fires directly with no targetKind for a kinded bucket; clicking promote on a `bucketKind: null` ("other") variation opens the trunk picker; clicking a picker option calls `onPromote(variation, { targetKind })` with the correct kind; `TrunkView` "Bulk-render all" button disabled at zero count and enabled with the right count from variations. Three pre-existing orphaned client tests (`cleanPlatePrompt`, `clipboard`, `normalize`) now run too.- **CoS — explicit `init()` instead of module-level auto-init.** Dropped the `NODE_ENV !== 'test' && VITEST !== 'true'` guard from `server/services/cos.js`; `init` is now exported and called from `server/index.js` alongside the other startup `*.init()` calls. Test imports no longer spin up event listeners / timers as a side effect, and the prod boot path no longer branches on test-env vars.- **Universe Builder DRY — `resolveProviderAndModel` + `findBibleEntryByName`.** Two shared helpers landed in `server/lib/`. The first collapses four inlined `getProviderById/getActiveProvider/resolveEffectiveModel` chains across the universe-builder LLM entrypoints onto one helper; the second consolidates the "case-insensitive name OR alias" predicate at the promote duplicate-collision check. (The retired-characters bucket fold keeps its O(1) seen-set index since it folds entries into a growing array — a per-iteration linear scan would have made it O(n*m).)diff --git a/PLAN.md b/PLAN.mdindex b07a23c159..077b54e07c 100644--- a/PLAN.md+++ b/PLAN.md@@ -13,7 +13,6 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [DONE.md]- **Phase D — Polish & promotion.** ~~"Promote variation to canon" action~~ shipped: `POST /api/universe-builder/:id/promote-variation` LLM-expands a `{label, prompt}` variation into a full canon entry (per-kind `physicalDescription` / `slugline`+`palette` / `description`+`significance`) and atomically writes the canon append + variation removal in one `updateUniverse` patch. CategoryEditor renders a promote button per row; Other-tab buckets open a trunk picker (since `kind: 'other'` can't be auto-resolved). Duplicate-name collisions short-circuit with a 409 before the LLM call. Deferred: client component tests; standalone design doc (not warranted — CLAUDE.md notes + this PR's prose cover the contract).- **Phase C follow-ups (deferred from the Phase C PR):**- [ ] [auto-sort-with-ai-llm-classify-each-kind-other] **Auto-sort with AI** — LLM-classify each `kind: 'other'` bucket into characters/settings/objects + suggest a meaningful name. New server route `POST /api/universe-builder/:id/auto-sort` that sends bucket keys + variation labels to the active LLM and applies the classification. Currently the Other-tab button is a stub that points users at re-running Generate From Idea (Phase B's expand emits kind tags). Land in a follow-up to keep the Phase C PR scoped.- - [ ] [unify-canoncard-variation-card-into-a-single] **Unify `CanonCard` + variation card into a single `EntryCard`.** Phase C reuses `CanonCard` for canon and `CategoryEditor` for variations inside the same TrunkView. Visual consistency is achieved through shared Tailwind classes; an actual single-component unification (with thumbnail-from-`primaryImageRef`-or-recent-render) is the Phase D card-extraction task.- [ ] [extract-a-shared-tabpills-primitive-in-client-src] **Extract a shared `<TabPills>` primitive in `client/src/components/ui/`.** Phase C's `TabNav` in `UniverseBuilder.jsx` duplicates the pattern in `StoryboardPanel.jsx` `TabNav` + 5 inline tab-button pages (`Calendar.jsx`, `ChiefOfStaff.jsx`, `DigitalTwin.jsx`, `Messages.jsx`, etc.). One primitive that accepts `{ tabs: [{id,label,icon,count}], activeTab, onChange }` would consolidate. Cross-cutting refactor — defer until next time we touch tab UI somewhere.- [ ] [extract-descriptorforcanonentry-kind-entry-into] **Extract `descriptorForCanonEntry(kind, entry)` into `server/lib/canonPrompt.js` (mirror in client).** The new server-side `synthesizeCanonPrompt()` in `server/services/universeBuilder.js` duplicates the per-kind descriptor logic already present in `client/src/components/universe/UniverseCanonSection.jsx`'s `KINDS[].descFor` closures and overlaps with `server/lib/scenePrompt.js` (`settingFrags`). One helper would let canon-render synthesis, the canon UI summary, and scene-prompt framing all share the same field-precedence rules.2. **Step-by-step approval/lock UX across Universe → Series → Arc → Seasons → Episodes.** Iteration 1 shipped a single arc-level lock; extend to per-season + per-field locks, lock the bulk runners, surface stage-progress strip, enforce locks server-side before LLM invocations.