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
fix: keep visual prompts out of foundation canon
[._.]/ Adam Eivy6dec518ce102
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 509c188db3..d2905000a0 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -46,6 +46,8 @@## Fixed+- **The foundation judge no longer mistakes visual prompt families for binding story canon.** Universe Builder categories are additive image-prompt design systems, but the foundation judge rendered their labels beside the narrative bible and named canon, then penalized duplicate-looking creatures, vehicles, and artifacts even though its world-repair editor can only revise narrative world rules. That produced a structurally unwinnable loop: the critic demanded canon-tier metadata or inventory pruning from a repair path that could not—and must not—delete the user's visual assets. Foundation scoring now reads the universe logline, premise, style, influences, and named canon only; visual prompt families remain intact and available for rendering, but edits to them no longer invalidate or distort a narrative verdict.+- **A TUI provider that exhausts its own request retries no longer returns an error screen as successful story output.** Claude Code may retry a backend timeout ten times, render a final `Request timed out` banner, and still exit with code 0. One long foundation repair consequently spent nearly an hour, produced no response file, and then sent terminal chrome into the universe JSON parser as if it were a 13K-character bible. The one-shot TUI runner now distinguishes recoverable `Retrying … attempt N/10` banners from the terminal gutter-owned timeout, records the latter as a real timeout, and enters the existing fallback cascade. Genuine long-running model work keeps its configured ceiling; only the provider's explicit exhausted-retry state ends the call.- Foundation-judge completion logs now report the provider and model that actually produced the verdict after fallback, rather than the primary pair that was requested. The persisted snapshot already distinguished requested from actual routing; live Autopilot supervision now tells the same truth.diff --git a/server/services/pipeline/foundationJudge.js b/server/services/pipeline/foundationJudge.jsindex b6655be855..545ca94e85 100644--- a/server/services/pipeline/foundationJudge.js+++ b/server/services/pipeline/foundationJudge.js@@ -135,8 +135,7 @@ export function foundationInputs(series, universe, issues = []) {logline: universe.logline || '',premise: universe.premise || '',styleNotes: universe.styleNotes || '',- categories: universe.categories || {},- compositeSheets: universe.compositeSheets || [],+ influences: universe.influences || null,// Places/objects are rendered into the world summary the judge scores,// so a user edit to either must flip the pinned hash (otherwise a clean// verdict would wrongly fast-pass a changed world).@@ -512,21 +511,11 @@ function renderWorldFoundation(universe) {const influences = universe.influences && typeof universe.influences === 'object'? `Embrace: ${(universe.influences.embrace || []).join(', ') || '—'}; Avoid: ${(universe.influences.avoid || []).join(', ') || '—'}`: '(none)';- const categories = Object.entries(universe.categories || {})- .map(([name, category]) => {- const labels = (Array.isArray(category?.variations) ? category.variations : [])- .map((variation) => variation?.label)- .filter(Boolean)- .slice(0, 6);- return `${name}: ${labels.join(', ') || '(empty)'}`;- })- .join('\n');return [`Universe logline: ${universe.logline || '(none)'}`,`Universe premise: ${universe.premise || '(none)'}`,`Universe style: ${universe.styleNotes || '(none)'}`,`Influences: ${influences}`,- `Design systems:\n${categories || '(none)'}`,`Named canon: ${entities}`,].join('\n');}diff --git a/server/services/pipeline/foundationJudge.test.js b/server/services/pipeline/foundationJudge.test.jsindex 5fc105c5c6..42370e3073 100644--- a/server/services/pipeline/foundationJudge.test.js+++ b/server/services/pipeline/foundationJudge.test.js@@ -226,6 +226,19 @@ describe('foundationInputsHash + staleness — fast-pass pinning', () => {expect(foundationInputsHash({ ...series, characterArcs: [{ characterId: 'chr-1', want: 'belong' }] }, null, [issue])).not.toBe(base);expect(foundationInputsHash({ ...series, styleNotes: 'lyrical' }, null, [issue])).not.toBe(base);});+ it('ignores noncanonical visual design assets but tracks narrative influences', () => {+ const base = { logline: 'A city pays for magic with memory.' };+ const withVisualAssets = {+ ...base,+ categories: { rituals: { variations: [{ label: 'The Naming Tax', prompt: 'visual prompt tokens' }] } },+ compositeSheets: [{ id: 'sheet-1', prompt: 'contact sheet prompt tokens' }],+ };+ expect(foundationInputsHash({}, base)).toBe(foundationInputsHash({}, withVisualAssets));+ expect(foundationInputsHash({}, base)).not.toBe(foundationInputsHash({}, {+ ...base,+ influences: { embrace: ['labor songs'], avoid: ['cosmic abstraction'] },+ }));+ });it('isFoundationStale flags a complete snapshot whose pinned hash drifted', () => {expect(isFoundationStale({ status: 'complete', sourceInputsHash: 'a' }, 'b')).toBe(true);expect(isFoundationStale({ status: 'complete', sourceInputsHash: 'a' }, 'a')).toBe(false);@@ -367,7 +380,7 @@ describe('foundation repair prompt — bounded outline', () => {});describe('foundation judge context — complete planning altitude', () => {- it('shows the world bible premise and design systems that world repair can change', () => {+ it('shows narrative canon but omits noncanonical visual prompt families the repair cannot change', () => {const ctx = __testing.buildFoundationContext({series: { name: 'Example Series', seasons: [] },universe: {@@ -380,7 +393,7 @@ describe('foundation judge context — complete planning altitude', () => {contentMax: 30_000,});expect(ctx.worldEntitiesSummary).toContain('Every spell erases one shared fact.');- expect(ctx.worldEntitiesSummary).toContain('rituals: The Naming Tax');+ expect(ctx.worldEntitiesSummary).not.toContain('The Naming Tax');expect(ctx.characterRoster).toContain('wound: Abandoned during the Naming Tax');});