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
plan: capture 3 codex iter-2 findings as catalog follow-ups
[._.]/ Adam Eivy164ac8bba75d
diff --git a/PLAN.md b/PLAN.mdindex 058af3462f..b07be5c291 100644--- a/PLAN.md+++ b/PLAN.md@@ -32,6 +32,9 @@ The v1 catalog hardcodes six types (`character|place|object|idea|scene|concept`)- [x] [catalog-export-bundle] **Export a catalog slice as a portable bundle.** _Shipped 2026-05-29: `GET /api/catalog/export?refKind=&refId=&format=json|markdown|yaml` hydrates ingredients + scraps + ref-links, sets `Content-Disposition: attachment`. Relations + media-refs deferred to those PLAN items._- [x] [catalog-cmdk-ask-voice-discovery] **Surface catalog ingredients in ⌘K / Ask / voice (cross-surface discovery).** _Partially shipped 2026-05-29: ⌘K palette renders live catalog hits under a "Catalog" group (debounced search); voice tool `catalog_lookup({ query, type?, limit? })` registered with intent-gated loading. **Ask retrieval still open — see `[catalog-ask-retrieval]`.**_- [ ] [catalog-ask-retrieval] **Wire catalog ingredients into `/api/ask` context (token-budgeted, top-K hybrid search).** Deferred from `[catalog-cmdk-ask-voice-discovery]` — needs a research pass on the existing Ask retriever + budgeter before implementing so the catalog slice shares the same scoring/budget model as memory/universe context.+- [ ] [catalog-export-bundle-import-refs] **JSON export bundles don't recreate ref links on re-import.** `parseJsonBulk` (in `server/lib/catalogBulkParsers.js`) unwraps `{ ingredients }` from an export bundle, but the route only stamps refLinks from `defaults.*Ref` — so when a user re-imports a bundle through `/catalog/ingest` → "Bulk Import", new ingredients land *without* the bundle's `ref` link and each row's per-row `roleForExportedRef` is dropped. Result: the imported slice is invisible to `listIngredientsForRef` and to future slice exports. Fix: have `parseJsonBulk` attach `bundleRef = { kind, id }` (non-enumerable, like `warnings`) when it detects a bundle root; have the bulk-import route fall back to `bundleRef` for refLinks when no `defaults.*Ref` overrides it, and (separately) propagate `roleForExportedRef` per row instead of the batch-level `defaults.role || bulk-<kind>` default. Surfaced by codex iter-2 review on PR #552.+- [ ] [catalog-markdown-roundtrip-fences-scraps] **Markdown export → re-import loses non-primary payload keys + scraps.** `ingredientToMarkdown` (`catalogBulkParsers.js:303`) emits a ` ```json … ``` ` fence for non-primary payload keys (e.g. character `personality`) and a `### Scraps` subsection; but `parseMarkdownBulk` only recognizes the heading + `tags:` line and appends every other line to the primary content body, so re-importing pollutes `description`/`summary` with fence text and JSON. Fix: in `parseMarkdownBulk`, recognize ` ``` ` as a fence start/end and either skip (current behavior — but cleanly) or parse the JSON fence into `payload.*`; treat `### Scraps` as a body terminator and either preserve as a sibling `scraps[]` (full round-trip) or skip cleanly (lossy but not corrupt). Pairs with `[catalog-export-bundle-import-refs]` for the broader "round-trip lossy → round-trip fidelity" pass. Surfaced by codex iter-2.+- [ ] [catalog-cast-panel-multi-role-unlink] **`CatalogCastPanel` unlink removes every row with the matching ingredient id, ignoring `role`.** `client/src/components/CatalogCastPanel.jsx:99` filters `r.ingredient.id !== ingredient.id` — but the ref table key is `(ingredient_id, ref_kind, ref_id, role)`, so an ingredient linked to the same record under multiple roles (which the API allows) loses all rows from local state on a single-role unlink until reload. Fix: filter by `!(r.ingredient.id === ingredient.id && r.role === role)`. Today the panel's role-mapping always picks one role per ingredient type, so this is latent — but peer-sync or future role-aware UI can populate multi-role rows. Surfaced by codex iter-2.- [ ] [catalog-source-kinds-url-file-voice] **Expand scrap `source_kind` beyond `paste|brain-bridge|importer-handoff`.** The column is already a free `VARCHAR(32)`, but the only ingest path that hits it is the textarea paste. Add: (a) URL ingest — paste a URL, server fetches + extracts main text via the existing browser service, source_kind `url`, metadata carries the URL + fetched title. (b) File ingest — `.txt`/`.md`/`.pdf` upload, source_kind `file`, metadata carries the original filename + mime. (c) Voice ingest — record a memo, Whisper transcribes, source_kind `voice-memo`, metadata carries the audio media_key (pairs with `[catalog-ingredient-media-refs]`). Each reuses the existing extraction pipeline and emits the same `catalog:extract:progress` frames.- [ ] [catalog-scrap-chunking] **Chunk long scraps into multiple `(parent_scrap_id, chunk_index)` rows.** Today `raw_text` is a single TEXT column with no enforced cap, but a 50k-word screenplay paste lands as one row and one LLM call — context overflow is silent and extraction degrades. Add `chunk_index INT DEFAULT 0` + `parent_scrap_id TEXT REFERENCES catalog_scraps(id)` and split inputs over ~12k chars into N child rows; the extractor processes each child and unions the results, dedup by name+type. Surfaced by anticipation, not yet by user pain — defer until a long-input failure is reported.