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

fix: close two world-check false-negative holes from codex review (#2175)

[._.]/ Adam Eivy6b019f5929e3
diff --git a/data.reference/prompts/stages/pipeline-editorial-world-cost-free-power.md b/data.reference/prompts/stages/pipeline-editorial-world-cost-free-power.md
index 06c6eabf1c..e64db23fbd 100644
--- a/data.reference/prompts/stages/pipeline-editorial-world-cost-free-power.md
+++ b/data.reference/prompts/stages/pipeline-editorial-world-cost-free-power.md
@@ -7,16 +7,20 @@ than powers.* A magic or technology that always works, at any scale, with no
drawback drains tension from every scene it touches — the reader stops fearing
for anyone.
-Flag a use when ALL of these hold:
+Flag a use when BOTH of these hold:
- An **ability, technology, or magic** is used at a **decisive moment** —
resolving a conflict, escaping danger, saving someone, or turning a scene.
- The use pays **no cost or limitation on the page** — no fuel, blood, memory,
time, reputation, physical toll, risk, or hard cap on scale/range is spent or
even acknowledged.
-- The world canon / established rules give that system a cost or limit it is
- **supposed** to carry (see below) — OR the prose itself has established one
- elsewhere — and this decisive use quietly skips it.
+
+This is a finding **whether or not** the system has a defined cost: a power the
+canon / prose says should exact a price and this use skips it is the clearest
+case, but a power that has **never** been given any cost or limit — anywhere — is
+also cost-free by construction and drains tension the same way. Reserve the
+canon / established-cost reference below for judging WHICH price was skipped and
+for the exceptions — not as a precondition for flagging.
Do NOT flag: a use that DOES pay its established price (that is the system
working as designed); a power the canon explicitly defines as limitless for a
diff --git a/data.reference/prompts/stages/pipeline-editorial-world-unforeshadowed-solution.md b/data.reference/prompts/stages/pipeline-editorial-world-unforeshadowed-solution.md
index 60df76baaa..a7c5dd5270 100644
--- a/data.reference/prompts/stages/pipeline-editorial-world-unforeshadowed-solution.md
+++ b/data.reference/prompts/stages/pipeline-editorial-world-unforeshadowed-solution.md
@@ -17,10 +17,18 @@ Flag a solution when ALL of these hold:
- That mechanism was **never planted** — not demonstrated, explained, or even
hinted at before the moment it saves the day.
-A mechanism counts as **planted** (do NOT flag) when the prose established it
-earlier — the reader saw the power used, was told the rule, or the artifact
-appears in the world canon below — even if the specific application is new. A
-clever new *use* of an established rule is good craft, not a cheat.
+A mechanism counts as **planted** (do NOT flag) only when the **prose itself**
+showed it to the reader earlier — the reader saw the power used, was told the
+rule, or met the artifact on the page before it resolved the problem — even if
+the specific application is new. A clever new *use* of a rule the reader has
+already seen is good craft, not a cheat.
+
+The world canon below is the author's reference for what the world's mechanics
+ARE — use it to understand a mechanism and judge internal consistency. But a
+mechanism appearing in the canon does **NOT** by itself count as planted: canon
+is not the manuscript, and the reader has not read it. A solution built on a
+canon rule the **prose never surfaced before the solving moment is still
+unforeshadowed** — flag it.
{{#finalPart}}
This is the **final part** of the manuscript, so you can now judge the whole
@@ -42,7 +50,7 @@ special world mechanic; a deliberately mysterious power the story is clearly
still withholding for a planned later reveal.
{{#canonWorld}}
-## World canon (already established)
+## World-bible reference (mechanics only — NOT proof the reader saw them)
{{canonWorld}}
{{/canonWorld}}
diff --git a/server/lib/editorial/checkInfra.js b/server/lib/editorial/checkInfra.js
index d1b5eead6b..4e2d157b44 100644
--- a/server/lib/editorial/checkInfra.js
+++ b/server/lib/editorial/checkInfra.js
@@ -996,9 +996,15 @@ export function canonWorldSummary(canon) {
}
if (!objectLines.length && !placeLines.length) return '';
const blocks = [];
- if (objectLines.length) blocks.push(`Established artifacts / objects (with their significance):\n${objectLines.join('\n')}`);
- if (placeLines.length) blocks.push(`Established places (with their recurring details):\n${placeLines.join('\n')}`);
- return `World canon (already established in the story bible — a rule, power, or artifact drawn from here is FORESHADOWED; do NOT flag its use as unearned):\n\n${blocks.join('\n\n')}`;
+ if (objectLines.length) blocks.push(`Named artifacts / objects (with their significance):\n${objectLines.join('\n')}`);
+ if (placeLines.length) blocks.push(`Named places (with their recurring details):\n${placeLines.join('\n')}`);
+ // Neutral framing: this is the author's reference for what the world's
+ // mechanics ARE, so a check can judge internal consistency. It deliberately
+ // does NOT assert the reader has seen these — each consuming prompt sets that
+ // interpretation (the unforeshadowed-solution check must still flag a canon
+ // rule the PROSE never surfaced; the cost-free-power check reads it for the
+ // costs a system is supposed to carry).
+ return `World-bible reference (the author's record of the world's artifacts, places, and mechanics — use it to understand what a thing is and does; it is NOT the manuscript and does not prove the reader has seen any of it):\n\n${blocks.join('\n\n')}`;
}
// Render the authored reader-map cliffhangers (#1298) into a compact text block
diff --git a/server/lib/editorial/checks/world.test.js b/server/lib/editorial/checks/world.test.js
index 376740d683..8025dbfe77 100644
--- a/server/lib/editorial/checks/world.test.js
+++ b/server/lib/editorial/checks/world.test.js
@@ -57,11 +57,16 @@ describe('canonWorldSummary (#2175)', () => {
objects: [{ name: 'The Ember Key', significance: 'burns the bearer to open a door' }],
places: [{ name: 'The Ashfall', recurringDetails: 'perpetual grey snow' }],
});
- expect(out).toContain('World canon');
+ // Neutral framing (codex P2): the block is the author's world-bible
+ // reference, explicitly NOT proof the reader has seen these — so the
+ // unforeshadowed-solution check still flags a canon rule the prose never
+ // surfaced.
+ expect(out).toContain('World-bible reference');
+ expect(out).toContain('does not prove the reader has seen');
expect(out).toContain('The Ember Key: burns the bearer to open a door');
expect(out).toContain('The Ashfall: perpetual grey snow');
- expect(out).toContain('Established artifacts / objects');
- expect(out).toContain('Established places');
+ expect(out).toContain('Named artifacts / objects');
+ expect(out).toContain('Named places');
});
it('falls back to description and slugline, and tolerates non-string fields', () => {
@@ -100,7 +105,7 @@ describe('worldbuilding-doctrine prompt rendering (#2175)', () => {
worldRules: '',
finalPart: '',
});
- expect(out).not.toContain('World canon (already established)');
+ expect(out).not.toContain('World-bible reference (mechanics only');
expect(out).toContain('reading the manuscript in PARTS');
expect(out).not.toContain('{{');
});
@@ -117,4 +122,23 @@ describe('worldbuilding-doctrine prompt rendering (#2175)', () => {
expect(out).toContain('RULES_BLOCK');
expect(out).not.toContain('{{');
});
+
+ // Codex P2 false-negative fixes — pin the corrected craft logic so a future
+ // prompt edit can't quietly re-introduce the holes.
+ it('unforeshadowed-solution: bible-only canon does NOT count as reader foreshadowing', () => {
+ const prompt = readStage('pipeline-editorial-world-unforeshadowed-solution.md');
+ const out = applyTemplate(prompt, { manuscript: 'M', canonWorld: 'C', worldRules: '', finalPart: 'true' });
+ // Only the PROSE plants for the reader; a canon rule the prose never
+ // surfaced is still unforeshadowed.
+ expect(out).toContain('prose itself');
+ expect(out).toContain('does **NOT** by itself count as planted');
+ });
+
+ it('cost-free-power: flags a power with NO established cost anywhere (not only a skipped one)', () => {
+ const prompt = readStage('pipeline-editorial-world-cost-free-power.md');
+ const out = applyTemplate(prompt, { manuscript: 'M', canonWorld: '', worldRules: '' });
+ // The finding does not require a pre-defined cost to skip.
+ expect(out).toContain('whether or not');
+ expect(out).toContain('never** been given any cost or limit');
+ });
});