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

test([nav-tabbed-page-coverage-guard]): document flat-array assumption in the block extractor

[._.]/ Adam Eivy887026593214
diff --git a/PLAN.md b/PLAN.md
index 53233b9943..b287c93e15 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -7,6 +7,7 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [.changel
Claimable, well-specified, no decision needed — `/claim`-able. Unordered.
- [ ] [nav-tabbed-page-coverage-guard-post] **Extend the tabbed-page nav guard to cover the POST page (`/post/:tab/:subtab`).** The `nav-tabbed-page-coverage-guard` work added a `TABBED_PAGES` contract for the 7 single-tab pages (Calendar/Goals/Insights/Messages/Wiki/Settings/Sharing) but left POST out: its tab list isn't a clean `const TABS`/`SECTIONS` array in `Post.jsx` — the dispatch lives in `client/src/components/meatspace/tabs/PostTab.jsx` (and `Layout.jsx`), and POST has a second `:subtab` dimension (`/post/:tab/:subtab`) the current `ids`/`links` extractors don't model. Surface POST's canonical tab (and subtab) list as an exported constant, then add a `TABBED_PAGES` entry (likely a new extractor `kind` that emits `<prefix>/<tab>` and `<prefix>/<tab>/<subtab>` paths) so every POST tab round-trips to a `NAV_COMMANDS` path. Deferred from `nav-tabbed-page-coverage-guard` (2026-06-02): POST wasn't in that item's enumerated set and its two-level shape needs its own extractor.
+- [ ] [settings-header-switch-tab-parity-guard] **Assert the Settings tab bar and the Settings page switch stay in sync.** `client/src/components/settings/SettingsTabsHeader.jsx`'s `TABS` (the clickable tab bar, now the nav guard's source of truth for `/settings`) and `client/src/pages/Settings.jsx`'s independent `switch (activeTab)` are hand-kept in sync: a tab added to the header + nav but forgotten in the switch renders the default `general` view instead (and vice-versa), and neither the new `nav-tabbed-page-coverage-guard` nor any existing test catches that drift. Add a focused test (extend `server/lib/navManifest.test.js` or a client test) asserting that every header `to:` under `/settings/<id>` has a matching `case '<id>':` in `Settings.jsx`'s `renderTabContent` switch. Note the cross-links (`prompts` → `/prompts`, `providers` → `/ai`) legitimately have NO switch case, so the assertion is "every header link under `/settings/` has a case", not strict equality. Deferred from `nav-tabbed-page-coverage-guard` review (claude LOW, 2026-06-02): a distinct header↔switch invariant with its own switch-parsing surface, separate from the header↔nav guard this item shipped.
- [ ] [arccanvas-sync-shared-hook] **Cleanup: extract the ArcCanvas host-wiring into a shared hook.** `client/src/pages/PipelineSeries.jsx` and `client/src/pages/StoryBuilder.jsx` (the `StoryBuilderDetail` wiring added by `story-builder-embed-arccanvas`) both hand-roll the same `lastSavedRef` + `updateSeriesFromServer` + `handleIssuesUpdate` + `flushPending` contract ArcCanvas expects. The two `flushPending` field-sets diverge (PipelineSeries flushes 10 bible fields + cover/style overrides; StoryBuilder only 6 and treats it as a near-no-op), and PipelineSeries also carries `patchSeries`/`handleSave`. Extract `useArcCanvasSync({ series, setSeries, setIssues, flushFields })` → `{ updateSeriesFromServer, handleIssuesUpdate, flushPending }` in `client/src/hooks/` and migrate both callers. Deferred from the embed PR because it's a 2-file refactor (touches PipelineSeries) with its own review surface.
- [ ] [story-builder-extract-image-render-hook] **Cleanup: the image-render lifecycle is duplicated 5×.** `StepCharacters` (StoryBuilder.jsx) + `StyleProbeImage.jsx` each re-implement `getSettings → readPipelineImageSettings → imageCfg` + a single-render jobId lifecycle, and `StepCharacters` near-verbatim copies `UniverseCanonSection`'s styled-render-and-persist routine. Extract a `useImageRenderSettings()` + `useSingleImageRender({ buildPrompt, onComplete })` hook and a shared canon styled-render helper. Also: `ProviderModelPicker` (StoryBuilder.jsx) duplicates the Importer's `LlmPicker` + `SeriesLlmPicker`/`FeatureProviderPicker`/`StagePromptModelPicker` — promote one shared provider/model picker.
- [ ] [story-builder-refine-returns-provider] **`refineStep('readerMap')` drops `providerId`/`model` from the conductor's return.** Every other refine branch surfaces them so the route/UI can show which model ran; the readerMap branch destructures `runId` only. Two-line fix (local-review SC-6, 2026-05-27).
diff --git a/server/lib/navManifest.test.js b/server/lib/navManifest.test.js
index fc2361a153..286046d3f4 100644
--- a/server/lib/navManifest.test.js
+++ b/server/lib/navManifest.test.js
@@ -32,6 +32,10 @@ const TABBED_PAGES = [
// Pull the inner text of `export const <constName> = [ … ];` (requiring `export`
// also asserts the constant stays importable — a forgotten `export` fails loudly).
+// Assumes a FLAT array (entries are `{ id|to|path, label, icon }` objects, no
+// nested array literals): the non-greedy `]` stops at the first `];`, so a tab
+// object carrying a nested array would truncate the block and drop later tabs.
+// True for every tab/section constant today; revisit if a nested literal lands.
function extractConstArrayBlock(src, constName) {
const block = src.match(new RegExp(`export const ${constName}\\s*=\\s*\\[([\\s\\S]*?)\\];`));
if (!block) throw new Error(`No exported ${constName} array found`);