Skip to content

Commit faaf935

Browse files
committed
address review (claude): declare canon source on chekhov + wire finalPart on premature-reveal
Two contract fixes surfaced in local review: - chekhov.setups-payoffs now reads ctx.canon (reveal-gated payoffs), so 'canon' must be in its `sources` or an obsolete orphaned-payoff finding never goes stale after the reveal gate is edited away. - continuity.premature-reveal's buildVars never set finalPart, so the shipped prompt always rendered the "reading in PARTS" branch — even on a single-chunk whole-book run that has no setup digest. Mirror the sibling checks' meta.isFinal wiring.
1 parent f37149e commit faaf935

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

server/lib/editorial/checkRegistry.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,12 +797,14 @@ describe('chekhov.setups-payoffs — LLM check (#1299)', () => {
797797
...overrides,
798798
});
799799

800-
it('is registered as a series-scoped LLM check reading manuscript + reader-map + foreshadowing ledger', () => {
800+
it('is registered as a series-scoped LLM check reading manuscript + canon + reader-map + foreshadowing ledger', () => {
801801
const check = getCheck(CHEKHOV);
802802
expect(check.kind).toBe('llm');
803803
expect(check.scope).toBe('series');
804804
expect(check.category).toBe('continuity');
805-
expect(check.sources).toEqual(['manuscript', 'series.arc.readerMap', 'series.arc.foreshadowing']);
805+
// `canon` is a source since #2178 — reveal-gated canon folds into the
806+
// authored-payoffs block, so a canon edit must re-fingerprint this check.
807+
expect(check.sources).toEqual(['manuscript', 'canon', 'series.arc.readerMap', 'series.arc.foreshadowing']);
806808
expect(check.needsManuscript).toBe(true);
807809
});
808810

server/lib/editorial/checks/continuity.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,12 @@ export const continuityChecks = [
393393
},
394394
{
395395
id: 'chekhov.setups-payoffs',
396-
sources: ['manuscript', 'series.arc.readerMap', 'series.arc.foreshadowing'],
396+
// `canon` is a real source here (#2178): reveal-gated canon folds into the
397+
// authored-payoffs block via `revealGatedPayoffsSummary(ctx.canon)`, so a
398+
// canon edit (adding/removing a reveal gate, retitling a gated fact) must
399+
// re-fingerprint this check — otherwise an obsolete orphaned-payoff finding
400+
// never goes stale after the gate is edited away.
401+
sources: ['manuscript', 'canon', 'series.arc.readerMap', 'series.arc.foreshadowing'],
397402
label: "Chekhov's guns (setups & payoffs)",
398403
description:
399404
'Classifies each setup/payoff thread as paired, false-setup (planted, never fired — cut it), orphaned-payoff (fired, never planted — unearned), or distant (paid off so many issues after the setup the reader may have forgotten). Reconciles its detected setups/payoffs against the authored reader-map hooks/payoffs.',
@@ -528,7 +533,15 @@ export const continuityChecks = [
528533
stage: PREMATURE_REVEAL_STAGE,
529534
category: 'continuity',
530535
context: { revealGatedCanon },
531-
buildVars: (manuscript, _meta, c) => ({ manuscript, revealGatedCanon: c.revealGatedCanon }),
536+
// `finalPart` gates the shipped prompt's part-vs-whole guidance (a single-
537+
// chunk run is its own final part). Without it the prompt always renders
538+
// the "reading in PARTS" branch and points at a setup digest that doesn't
539+
// exist on a one-chunk run — mirror the sibling checks' meta.isFinal wiring.
540+
buildVars: (manuscript, meta, c) => ({
541+
manuscript,
542+
revealGatedCanon: c.revealGatedCanon,
543+
finalPart: meta?.isFinal ? 'true' : '',
544+
}),
532545
// A reveal can leak in an early issue for a fact due much later; the
533546
// findings digest keeps prior leaks in view so a later chunk doesn't
534547
// re-flag, and the setup digest rolls forward which gated facts have

0 commit comments

Comments
 (0)