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(#1583): carry climax candidate across chunks so the final-part verdict survives an early climax

[._.]/ Adam Eivy5c1d02777490
diff --git a/data.reference/prompts/stages/pipeline-editorial-climax-agency.md b/data.reference/prompts/stages/pipeline-editorial-climax-agency.md
index 96b3a21c35..d63c87ce68 100644
--- a/data.reference/prompts/stages/pipeline-editorial-climax-agency.md
+++ b/data.reference/prompts/stages/pipeline-editorial-climax-agency.md
@@ -78,16 +78,24 @@ in each header to attribute every finding to its `issueNumber`.
{{#finalPart}}
This is the FINAL part of the manuscript — the whole story is now in view, so the
-climax can be identified and judged. Make your climax verdict here.
+climax can be identified and judged. Make your climax verdict here. **The climax
+may have appeared in an EARLIER part, not in the text below.** When it did, the
+"setup so far" digest above carries it forward as the CLIMAX CANDIDATE — its
+verbatim snippet, its issue, who drives the resolution, and the core problem it
+resolves. Judge that carried-forward climax (and use its snippet as your
+`anchorQuote`) rather than forcing the verdict onto a quieter denouement scene
+that merely happens to be last. If the climax is in the text below, judge and
+quote it directly.
{{/finalPart}}
{{^finalPart}}
This is NOT the final part of the manuscript. The climax is a SINGLE whole-story
event that can only be identified once the entire story is in view — and an
earlier high-stakes scene (a mid-story battle, a per-issue turning point, a false
-victory) is NOT the climax, no matter how complete it looks in isolation. Do NOT
-report any climax finding in this part — return an empty `findings` array. The
-central problem and the protagonist's pattern of agency are carried forward and
-judged once the final part is in view.
+victory) is NOT necessarily the climax, no matter how complete it looks in
+isolation. Do NOT report any climax finding in this part — return an empty
+`findings` array. The most decisive resolution scene seen so far is carried
+forward as the climax candidate (with its verbatim snippet and who resolves it)
+and judged once the final part is in view.
{{/finalPart}}
```
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.js
index 8910b48f23..39e017e0b1 100644
--- a/server/lib/editorial/checkRegistry.js
+++ b/server/lib/editorial/checkRegistry.js
@@ -3471,11 +3471,25 @@ export const EDITORIAL_CHECKS = [
// their hardest active choice.
crossChunkDigest: true,
crossChunkSetup: true,
+ // The setup digest is a separate rolling-summary call (buildSetupDigestPrompt)
+ // whose output is fed into the FINAL chunk's prompt. The climax can land in a
+ // non-final chunk (followed by a denouement chunk), so the digest must carry
+ // the climax CANDIDATE forward — including a short verbatim snippet and who
+ // resolves it — or the final chunk would have only tail text + a summary and
+ // could neither judge nor quote the climax. This is what lets the final-part
+ // verdict stay accurate even when the climax is not physically in the last
+ // chunk (closing the false-negative the strict non-final gate would otherwise
+ // introduce).
setupFocus: 'Note the central problem/conflict the protagonist must personally resolve, '
+ 'the thematic question the story is asking, and the protagonist\'s pattern of agency so far '
- + '(do they drive events or do events happen to them) — so the final chunk can judge whether '
- + 'the climax is the protagonist\'s hardest, most active choice and whether it lands the '
- + 'emotional/thematic core, not just the plot.',
+ + '(do they drive events or do events happen to them). CRUCIALLY: track the single most '
+ + 'decisive turning/resolution scene seen so far as the CLIMAX CANDIDATE — record a SHORT '
+ + 'verbatim snippet (≤ 200 chars) of its decisive moment, which issue it is in, WHO drives the '
+ + 'resolution (the protagonist through a hard choice, or an ally/coincidence/the antagonist '
+ + 'self-destructing), and which core problem/theme it resolves — and REPLACE it only when a '
+ + 'later, higher-stakes resolution scene supersedes it. This lets the final part judge the '
+ + 'climax\'s agency + resolution power and quote it even if the climax is not physically in the '
+ + 'last chunk.',
});
},
},