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: withhold reveal-gated canon by default (#9314)
[._.]/ Adam Eivy20d7f2e9bd5b
diff --git a/server/lib/universePromptRenderers.js b/server/lib/universePromptRenderers.jsindex ca284cbef7..5a5f6ee499 100644--- a/server/lib/universePromptRenderers.js+++ b/server/lib/universePromptRenderers.js@@ -188,7 +188,7 @@ const hoistPriorityEntries = (entries, priority) => {// Caps each section at CANON_PROMPT_ENTRIES_PER_KIND_MAX entries; an// "(… + N more)" footer signals truncation so the LLM doesn't assume the// canon is complete.-export function renderCanonForPrompt(world, { priorityCharacterIds = null, respectRevealGates = false } = {}) {+export function renderCanonForPrompt(world, { priorityCharacterIds = null, respectRevealGates = true } = {}) {if (!world || typeof world !== 'object') return '';const priority = asIdSet(priorityCharacterIds);const sections = [];@@ -409,7 +409,9 @@ function rankCharactersForNarrativeContext(characters, {* `spoiler` flag or a `revealIssue` has authored history the audience has NOT* earned yet, so the gated entry renders as a named placeholder rather than* handing a generation prompt the concealed origin. Author-side planning- * surfaces that already reason over the full bible leave it off. It is the SAME+ * surfaces must explicitly turn it off: the arc planner (`pipeline/arcPlanner/context.js`)+ * and FableLoom editorial (`fableLoom/editorial.js`) need the unrevealed canon.+ * The gate defaults ON in all three renderers. It is the SAME* predicate and allowlist the descriptive block uses (`concealCanonEntry`) —* see the gate comment above; do not add a second rule here.*@@ -420,7 +422,7 @@ function rankCharactersForNarrativeContext(characters, {export function renderCharacterNarrativeContext(characters, {max = CHARACTER_NARRATIVE_ARC_MAX,priorityIds = null,- respectRevealGates = false,+ respectRevealGates = true,reportOmitted = false,} = {}) {const { shown, omitted } = rankCharactersForNarrativeContext(characters, { max, priorityIds });diff --git a/server/lib/universePromptRenderers.test.js b/server/lib/universePromptRenderers.test.jsindex 4dd5293f56..695d606eb5 100644--- a/server/lib/universePromptRenderers.test.js+++ b/server/lib/universePromptRenderers.test.js@@ -199,7 +199,7 @@ describe('renderCharacterNarrativeContext (#6416)', () => {// reason over the whole bible still opt out.expect(renderCharacterNarrativeContext([{ ...gated, spoiler: false, revealIssue: 4 }], { respectRevealGates: true })).toContain('reveal-gated');- expect(renderCharacterNarrativeContext([gated])).toContain('Needing anyone');+ expect(renderCharacterNarrativeContext([gated], { respectRevealGates: false })).toContain('Needing anyone');});it('compacts a runaway field instead of letting one character own the prompt', () => {@@ -310,8 +310,17 @@ describe('the single reveal gate on the descriptive canon block (#6426)', () =>expect(ungated).toContain('LEAK-background');});- it('stays off by default so author-side planning still reasons over the whole bible', () => {- expect(renderCanonForPrompt(world())).toContain('LEAK-background');+ it('withholds gated canon by default in all three prompt renderers', () => {+ const canon = world({ lie: 'LEAK-lie' });+ for (const output of [+ renderCanonForPrompt(canon),+ renderCharacterNarrativeContext(canon.characters),+ renderStoryCanonDigest(canon),+ ]) {+ expect(output).toContain('reveal-gated');+ expect(output).not.toMatch(/LEAK-/);+ }+ expect(renderCanonForPrompt(canon, { respectRevealGates: false })).toContain('LEAK-background');});it('gates places and objects through the same projection', () => {diff --git a/server/services/pipeline/arcPlanner/context.js b/server/services/pipeline/arcPlanner/context.jsindex c9455b3827..1cd4d2fc2d 100644--- a/server/services/pipeline/arcPlanner/context.js+++ b/server/services/pipeline/arcPlanner/context.js@@ -81,7 +81,8 @@ export const NO_LINKED_UNIVERSE_PLACEHOLDER = '(none — series has no linked Unconst CHARACTER_FOUNDATION_PROMPT_MAX = CHARACTER_NARRATIVE_ARC_MAX;export function renderCharacterFoundationForArc(characters) {- return renderCharacterNarrativeContext(characters, { max: CHARACTER_FOUNDATION_PROMPT_MAX });+ // Author-side planning needs the unrevealed canon to plan the full arc.+ return renderCharacterNarrativeContext(characters, { max: CHARACTER_FOUNDATION_PROMPT_MAX, respectRevealGates: false });}export function appendCharacterFirstArcGuidance(shapeGuidance, characterFoundationText, characterArcs) {@@ -127,7 +128,8 @@ export async function loadWorldContext(series) {// Universe canon — named characters/places/objects the arc references by// name. Separate from categories because the LLM should treat these as// first-class entities, not exploratory variations.- worldCanonText: renderCanonForPrompt(scopedWorld) || '(none — no named entities are tied to this series yet)',+ // Author-side planning needs the unrevealed canon to plan the full arc.+ worldCanonText: renderCanonForPrompt(scopedWorld, { respectRevealGates: false }) || '(none — no named entities are tied to this series yet)',worldCharacterFoundationText: renderCharacterFoundationForArc(planningCanon.characters),// Compact one-line-per-kind synopsis of canon — intended for text stages// (prose/teleplay/comic-script) where the full canon dump would dominate