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

feat: add interiority.register editorial check (#3593)

[._.]/ Adam Eivy13ccf41dbc13
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 9bdc2e1355..62e0cb35fe 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -202,3 +202,4 @@
- **[issue-3591] Editorial checks now catch a pivotal moment that got narrated instead of played out.** The drafting prompts have long carried the rule that a draft should be at least 70% in-scene, not summary — but nothing on the review side ever checked it, so the most common structural failure in a draft went unflagged: a decision, confrontation or reveal delivered from helicopter altitude ("Over the next week they argued about it, and eventually she agreed to go") where the scene would have landed. The new **Narrated summary where a scene belongs** check reads your drafted manuscript and names four modes of it — a compressed-away turning point, reported action the reader never physically enters, habitual mode ("every night she would…") wrapped around what was really a single decisive event, and result-first narration that states the outcome and skips the scene. Each finding quotes a verbatim anchor and, rather than just saying "dramatize this", names the concrete moment to zoom into. It reads the reverse-outline scene segmentation as context so honest between-scene compression is left alone — the target is a beat that never became a scene at all, which is invisible to the existing scene checks precisely because they only judge scenes that exist. Deliberate montages, brief time-skips, backstory summary (that belongs to info-dumping) and beats too minor to be worth the words are explicitly out of scope. Enabled by default at medium severity under Create → Editorial Checks; the new `pipeline-editorial-summary-not-scene` stage prompt ships and migrates for existing installs. (#3591)
- **[issue-3574] A parked perpetual task now reports the same park state to the schedule UI and to the daemon's wake-up planner.** "Which scopes of a perpetual task are parked, and when does the soonest one recheck?" was answered by three separate walks of the same records: one for the Schedule page's parked/draining badge, one for the upcoming-tasks eligibility that decides when the daemon wakes, and a third inline read of a single record's `parkedUntil` in the due check. They had already drifted — the badge only ever folded the top-level execution record in when its park hadn't elapsed, while the wake-up planner folded in any top-level record carrying a park at all — so a global park that had just come due could read as "nothing parked" in one and "due now" in the other. All of it now projects from one aggregate whose global-record inclusion rule is written down in exactly one place: every per-app record is a tracked scope, and the top-level record is a tracked scope only when it carries its own park. Each caller's existing behavior is unchanged; the two are pinned to the same fixtures by tests so they can't diverge again.
- **[issue-3592] Editorial checks now catch the line a character should have said out loud.** Six dialogue checks judge the dialogue that is already on the page — its subtext, its tags, its attribution, whether the cast sounds different — and none of them could see the opposite problem: a character's decisive utterance handed to the reader as narrated report instead of a quoted line. "My manager was very happy with my work" lands nowhere near "My manager looked up from the deck and said, 'That's the best presentation you've ever given.'", and nothing in PortOS flagged the first one. `prose.telling-emotion` is the nearest neighbour and explicitly carves dialogue out of its scope, so "he told me he was leaving" sailed past it too. The new **Reported speech where a quoted line belongs** check reads your drafted manuscript and names three modes of it: speech summarized at a turning point ("she told him she was leaving", "the doctor gave them the news"), a reaction to speech reported where the words themselves were the beat, and a confrontation narrated in the third person with no line ever quoted. Each finding quotes a verbatim anchor and names *which* moment to quote rather than drafting the dialogue for you. Deliberate compression of routine exchanges is left alone — quoting those is exactly what the pleasantries check cuts — as are reported speech used to bridge between scenes, a POV where the character genuinely did not hear the words, a scene that already quotes its decisive line, and free-indirect-discourse voices where reported speech is the consistent mode. Enabled by default at low (advisory) severity under Create → Editorial Checks; the new `pipeline-editorial-reported-speech` stage prompt ships and migrates for existing installs. (#3592)
+- **[issue-3593] Editorial checks now catch interiority that sounds written rather than thought.** Three checks already judged a character's inner life and every one of them judged quantity or placement: whether the four POV dimensions are developed at all, whether description swamps interiority inside a scene, whether rendered thought is italicized consistently. So a manuscript could pass all three while its thoughts read *"I thought: this represents a supreme opportunity"* — present, well-proportioned, correctly formatted, and completely unbelievable as something a human being thought. Real interiority is raw, fragmentary, self-interrupting and often petty; polished-essay interiority is a distinct and common failure mode that nothing in PortOS could see. The new **Interiority register** check reads your drafted manuscript for four modes of it: thought composed in balanced subordinate-clause sentences where a character under pressure would think in fragments, author intrusion articulating a theme the character would never consciously articulate, a register mismatch measured against how that character actually *speaks* elsewhere in the manuscript — a plain-spoken character thinking in literary prose is the strongest signal there is — and an inner voice indistinguishable across the entire cast, flagged once rather than per passage. A genuinely erudite POV character whose formality is consistent and characterized is left alone, as are deliberate free indirect discourse, calm reflective beats where measured thought is what the moment calls for, and transitional summary interiority. Each finding quotes the thought and names the register shift instead of rewriting the line for you. The prompt states its borders with `prose.telling-emotion` and the two other interiority checks explicitly, so four checks reading the same paragraph don't return four findings on it. Enabled by default at low (advisory) severity under Create → Editorial Checks; the new `pipeline-editorial-interiority-register` stage prompt ships and migrates for existing installs. (#3593)
diff --git a/data.reference/prompts/stage-config.json b/data.reference/prompts/stage-config.json
index 6d1ed0ad0e..5716f95248 100644
--- a/data.reference/prompts/stage-config.json
+++ b/data.reference/prompts/stage-config.json
@@ -800,6 +800,13 @@
"returnsJson": true,
"variables": []
},
+ "pipeline-editorial-interiority-register": {
+ "name": "Pipeline — Editorial Check: Interiority register",
+ "description": "Editorial check (#3593): flags rendered thought written in an authored, essayistic register instead of the character's own voice — analytical full-sentence thought where a character under pressure would think in fragments, author intrusion articulating a theme the character would not, register mismatch against how that character speaks elsewhere, and an indistinguishable inner voice across the whole cast (flagged once). The register layer above the other interiority checks, which judge presence and ratio. Reads the stitched manuscript; severity is advisory; skips characterized formality, free indirect discourse, calm reflective beats, and transitional summary interiority. Findings name the register shift rather than rewriting the passage. Returns issue-anchored findings.",
+ "model": "default",
+ "returnsJson": true,
+ "variables": []
+ },
"pipeline-editorial-on-the-nose": {
"name": "Pipeline — Editorial Check: On-the-nose / subtext-free dialogue",
"description": "Editorial check (#1307): the judgment layer for dialogue that states feeling/meaning outright with no subtext and \"maid-and-butler\" exchanges where characters tell each other what they both already know. Reads the stitched manuscript; severity is advisory; skips earned directness, functional exchanges, and dialogue whose subtext already works. Returns issue-anchored findings.",
diff --git a/data.reference/prompts/stages/pipeline-editorial-interiority-register.md b/data.reference/prompts/stages/pipeline-editorial-interiority-register.md
new file mode 100644
index 0000000000..efe047dca9
--- /dev/null
+++ b/data.reference/prompts/stages/pipeline-editorial-interiority-register.md
@@ -0,0 +1,104 @@
+# Pipeline — Editorial Check: Interiority register
+
+You are a line editor doing a single focused pass for ONE problem: **rendered
+thought written in an authored, essayistic register instead of the character's
+own voice**. Other checks ask whether interiority is *present* and whether there
+is *enough* of it; you are the only one that asks whether it sounds like a human
+being actually thinking.
+
+> I thought: this represents a supreme opportunity.
+
+instead of
+
+> Wait. This is it. This is the one.
+
+Real interiority is raw, fragmentary, self-interrupting, and often petty,
+repetitive, or neurotic. Polished-essay interiority is grammatical, balanced and
+composed — and completely unbelievable as thought.
+
+Flag a passage when the rendered thought shows:
+
+- **Essayistic / analytical register** — thought composed in full, balanced,
+ subordinate-clause sentences with formal vocabulary ("This represents a
+ considerable opportunity", "I found myself reflecting on the implications")
+ where a character under pressure would think in fragments.
+- **Author intrusion** — the thought articulates a theme, moral or summary the
+ character would never consciously articulate. The narrator is thinking, not
+ the character.
+- **Register mismatch against the character** — an established plain-spoken,
+ uneducated, panicked, drunk or exhausted character thinking in polished
+ literary prose. Reconcile against how that character *speaks* elsewhere in the
+ manuscript: a wide gap between their dialogue and their thought, with no
+ narrative reason for it, is the strongest signal you have. Cite both sides of
+ the gap when you have them.
+- **Uniform interiority across the cast** — every POV character's inner voice
+ indistinguishable, as if one essayist were thinking on all their behalf. Flag
+ this **once**, describing it in the `problem` text as a series-level pattern —
+ do not emit a finding per passage.
+
+Do NOT flag:
+
+- A **genuinely erudite, reflective or clinical POV character** whose formal
+ inner voice is consistent with how they speak and is clearly characterized.
+ Formality is only a problem when it is unearned.
+- **Free indirect discourse** in a deliberately literary narrative voice where
+ the blend of narrator and character is the consistent mode of the book.
+- A **calm reflective beat** — a character alone, unhurried, deliberately taking
+ stock — where measured thought is what the moment calls for.
+- **Brief summary interiority** used transitionally between scenes.
+- A **named emotion** told rather than dramatized ("she felt afraid"). That is
+ `prose.telling-emotion`'s job, and duplicating it here wastes the writer's
+ attention. You judge the *diction* of thought that is on the page, not whether
+ emotion was shown or told.
+- **Missing interiority** — a scene that develops no inner life at all. That is
+ `interiority.protagonist` (presence) and `scene.interiority-balance` (ratio).
+ You only judge thought that exists. If there is no rendered thought in a
+ passage, there is nothing here to flag.
+
+Severity is **advisory**: most findings are `low`; reserve `medium` for a
+pivotal beat whose essayistic thought deflates the tension, and `high` only for
+a sustained register mismatch that misrepresents who the character is.
+
+## Manuscript
+
+The manuscript is stitched from the drafted issues. Section headers attribute
+each chunk to an issue (e.g. `# Issue 3 — Title (prose)`). Use the issue number
+in each section header to attribute every finding to its `issueNumber`.
+
+```
+{{manuscript}}
+```
+
+## Task
+
+Find the rendered thought that sounds authored rather than thought. For each
+one, quote a short verbatim anchor from the text (≤ 200 characters) so the
+editor can jump to it, name the issue number it appears in, explain what the
+register is doing wrong — against the character's own speech where the
+manuscript gives you it — and suggest the **register shift** ("let him think in
+fragments here, in the same blunt vocabulary he argues in"). Do NOT rewrite the
+passage for the author; name the direction and let them write it.
+
+Be specific and cite the text. If the interiority reads as genuine thought in
+each character's own voice, return an empty `findings` array — do not invent
+problems.
+
+## Output contract
+
+Return ONLY valid JSON matching this shape — no prose, no markdown fence, no
+commentary:
+
+```json
+{
+ "findings": [
+ {
+ "severity": "high|medium|low",
+ "issueNumber": 3,
+ "location": "string — where the thought appears (e.g. 'Issue 3 — Mara in the stairwell')",
+ "problem": "1–3 sentences naming the register problem and, where the manuscript shows it, the gap against how this character speaks",
+ "suggestion": "1–3 sentences naming the register shift — not a rewrite",
+ "anchorQuote": "short verbatim quote from the manuscript (≤ 200 chars)"
+ }
+ ]
+}
+```
diff --git a/scripts/migrations/230-editorial-interiority-register-stage.js b/scripts/migrations/230-editorial-interiority-register-stage.js
new file mode 100644
index 0000000000..08ce1a6617
--- /dev/null
+++ b/scripts/migrations/230-editorial-interiority-register-stage.js
@@ -0,0 +1,18 @@
+/**
+ * Seed the interiority-register editorial-check stage into existing installs (#3593).
+ *
+ * Mirrors `229-editorial-reported-speech-stage.js`: copies the `.md` template
+ * from `data.reference/prompts/stages/` and merges its stage-config entry into
+ * `data/prompts/stage-config.json`. Boot runs migrations (server/index.js) but
+ * NOT `setup-data.js`, so an upgrade that pulls + `pm2 restart`s (rather than
+ * running `update.sh`) would otherwise leave the stage unseeded and the
+ * `interiority.register` editorial check would throw "Stage not found" the
+ * first time it runs.
+ *
+ * Customization-safe + idempotent per `_seedStageHelpers.js` — the template is
+ * copied only when missing and the config entry merged only when absent.
+ */
+
+import { makeSeedMigration } from './_seedStageHelpers.js';
+
+export default makeSeedMigration('pipeline-editorial-interiority-register');
diff --git a/scripts/migrations/230-editorial-interiority-register-stage.test.js b/scripts/migrations/230-editorial-interiority-register-stage.test.js
new file mode 100644
index 0000000000..1918bf83dc
--- /dev/null
+++ b/scripts/migrations/230-editorial-interiority-register-stage.test.js
@@ -0,0 +1,16 @@
+import { describe } from 'vitest';
+
+import migration from './230-editorial-interiority-register-stage.js';
+import { runSeedStageMigrationTests } from './_seedStageTestHelpers.js';
+
+// The interiority-register editorial check's stage (#3593). The drift catch is
+// the point: if the reference template or its stage-config entry ever stops
+// shipping, the `interiority.register` check would throw "Stage not found" at
+// runtime on a fresh install with nothing failing here first.
+describe('migration 230 — seed the interiority-register editorial stage', () => {
+ runSeedStageMigrationTests({
+ migration,
+ stages: ['pipeline-editorial-interiority-register'],
+ prefix: 'migration-230-',
+ });
+});
diff --git a/server/lib/editorial/README.md b/server/lib/editorial/README.md
index 015b879bd6..abbbdb1566 100644
--- a/server/lib/editorial/README.md
+++ b/server/lib/editorial/README.md
@@ -124,6 +124,20 @@ Before adding an editorial rule, check whether an existing registry entry covers
it. To add a new built-in check, append an entry to `EDITORIAL_CHECKS` in
`checkRegistry.js` (the fail-fast guards enforce shape, enum, and unique-id).
+The interiority family is the worked example of how close two checks can sit
+without overlapping — four checks read the same paragraphs and each judges a
+different axis, so a new one has to name which axis is still unclaimed:
+`interiority.protagonist` (#1294) judges **presence** (are the four POV
+dimensions developed at all), `scene.interiority-balance` (#1623) judges
+**ratio** (does description swamp inner life inside a scene),
+`prose.italic-thoughts` judges **formatting** consistency of rendered thought,
+and `interiority.register` (#3593) judges **diction** — whether the thought that
+is on the page sounds like that character thinking or like the author writing an
+essay, reconciled against how the character speaks. The boundary is enforced in
+the prompt bodies (each names the others' territory in its do-NOT-flag list) and
+pinned by `checks/proseStyle.test.js`, because nothing in the registry stops
+three checks from returning three findings on one paragraph.
+
Declare every input the check's `run(ctx)` reads in its `sources` array (a
non-empty subset of `EDITORIAL_SOURCES`: `manuscript`, `canon`,
`series.styleGuide`, `series.arc.tickingClock`, `series.arc.readerMap`,
diff --git a/server/lib/editorial/checkInfra/craftStages.js b/server/lib/editorial/checkInfra/craftStages.js
index 77e60ab139..b8b3961ff6 100644
--- a/server/lib/editorial/checkInfra/craftStages.js
+++ b/server/lib/editorial/checkInfra/craftStages.js
@@ -105,6 +105,17 @@ export const ARC_REGRESSION_STAGE = 'pipeline-editorial-arc-regression';
// prose.sentence-rhythm) need no stage.
export const TELLING_EMOTION_STAGE = 'pipeline-editorial-telling-emotion';
+// Stage name for the interiority-register LLM check (#3593): rendered thought
+// written in an authored, essayistic register ("I thought: this represents a
+// supreme opportunity") instead of the character's own raw, fragmentary voice.
+// Ships in data.reference/prompts/stages/ + stage-config.json (fresh installs
+// via setup-data.js) and migrates to existing installs via migration 230 (boot
+// runs migrations but NOT setup-data, so the migration is required). The third
+// axis of interiority: INTERIORITY_STAGE (revealForeshadowing.js) judges whether
+// thought is PRESENT, INTERIORITY_BALANCE_STAGE above judges how MUCH of a scene
+// it occupies, and this one judges how it SOUNDS.
+export const INTERIORITY_REGISTER_STAGE = 'pipeline-editorial-interiority-register';
+
// Stage names for the two dialogue-craft LLM checks (#1307): on-the-nose /
// subtext-free dialogue, and per-character voice distinctiveness. Each prompt
// ships in data.reference/prompts/stages/ + stage-config.json (fresh installs via
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.js
index 1ea5e9434b..168cb83566 100644
--- a/server/lib/editorial/checkRegistry.js
+++ b/server/lib/editorial/checkRegistry.js
@@ -68,6 +68,7 @@ export {
HEAD_HOPPING_STAGE,
INFO_DUMPING_STAGE,
INTERIORITY_BALANCE_STAGE,
+ INTERIORITY_REGISTER_STAGE,
INTERIORITY_STAGE,
KILL_YOUR_DARLINGS_STAGE,
MIRROR_DESCRIPTION_STAGE,
@@ -220,6 +221,7 @@ const CHECK_ORDER = Object.freeze([
'prose.structural-tics',
'prose.burstiness',
'prose.telling-emotion',
+ 'interiority.register',
'prose.dead-metaphor',
'opening.wrong-start',
'prose.mirror-description',
diff --git a/server/lib/editorial/checkRegistry.test.js b/server/lib/editorial/checkRegistry.test.js
index 7c5376e38d..364f2165b4 100644
--- a/server/lib/editorial/checkRegistry.test.js
+++ b/server/lib/editorial/checkRegistry.test.js
@@ -65,6 +65,7 @@ const WHITE_ROOM = 'scene.white-room';
const INTERIORITY_BALANCE = 'scene.interiority-balance';
const SUMMARY_NOT_SCENE = 'narration.summary-not-scene';
const REPORTED_SPEECH = 'dialogue.reported-speech';
+const INTERIORITY_REGISTER = 'interiority.register';
const PLOT_STRUCTURE = 'plot.structure-momentum';
const PACING_ESCALATION = 'pacing.escalation-curve';
const HEAD_HOPPING = 'pov.head-hopping';
@@ -913,6 +914,95 @@ describe('dialogue.reported-speech — reported-speech LLM check (#3592)', () =>
});
});
+describe('interiority.register — interiority-register LLM check (#3593)', () => {
+ // A plain-spoken character whose dialogue and whose rendered thought sit in two
+ // different registers — the strongest signal the prompt asks the model for.
+ const MANUSCRIPT = '# Issue 1\n\n"Ain\'t no way," Dell said. "Not for that money."\n\nI thought: this represents a supreme opportunity, one whose implications I would do well to consider.';
+ const wholeCtx = (overrides = {}) => ({
+ manuscript: MANUSCRIPT,
+ config: { maxFindings: 12 },
+ severityDefault: 'low',
+ planManuscriptChunks: async () => [overrides.manuscript ?? MANUSCRIPT],
+ callStagedLLM: async () => ({ content: { findings: [] } }),
+ ...overrides,
+ });
+
+ it('is registered as an issue-scoped manuscript LLM check in the style category', () => {
+ const check = getCheck(INTERIORITY_REGISTER);
+ expect(check.kind).toBe('llm');
+ expect(check.scope).toBe('issue');
+ expect(check.category).toBe('style');
+ expect(check.severityDefault).toBe('low');
+ expect(check.defaultEnabled).toBe(true);
+ expect(check.needsManuscript).toBe(true);
+ expect(check.sources).toEqual(['manuscript']);
+ });
+
+ it('gates on a non-empty manuscript', () => {
+ const check = getCheck(INTERIORITY_REGISTER);
+ expect(check.gate({ manuscript: '' })).toBe(false);
+ expect(check.gate({ manuscript: MANUSCRIPT })).toBeTruthy();
+ });
+
+ it('budgets the fixed prompt overhead when planning chunks and stamps findings with the style category', async () => {
+ let seenVars = null;
+ let seenOverhead = 0;
+ const ctx = wholeCtx({
+ planManuscriptChunks: async (_stage, opts) => {
+ // No trimmable context rides along, so the template reserve is passed as
+ // `overheadTokens` — unbudgeted, a long manuscript plans chunks that
+ // overflow the provider window once the prompt is added.
+ seenOverhead = opts.overheadTokens;
+ return [MANUSCRIPT];
+ },
+ callStagedLLM: async (_stage, vars) => {
+ seenVars = vars;
+ return {
+ content: {
+ findings: [{
+ severity: 'low',
+ issueNumber: 1,
+ location: 'Issue 1 — Dell at the table',
+ problem: 'Dell speaks in clipped fragments but thinks in balanced essay prose.',
+ suggestion: 'Let him think in the same blunt vocabulary he argues in.',
+ anchorQuote: 'I thought: this represents a supreme opportunity',
+ }],
+ },
+ };
+ },
+ });
+ const findings = await getCheck(INTERIORITY_REGISTER).run(ctx);
+ expect(seenOverhead).toBeGreaterThan(0);
+ expect(seenVars.manuscript).toBe(MANUSCRIPT);
+ // Manuscript-only check — no scene map or canon voice profiles ride along.
+ expect(seenVars.sceneMap).toBeUndefined();
+ expect(findings).toHaveLength(1);
+ expect(findings[0].category).toBe('style');
+ expect(findings[0].issueNumber).toBe(1);
+ // The mismatch against how the character SPEAKS is what the finding must cite.
+ expect(findings[0].problem).toContain('speaks');
+ // The anchor is a verbatim slice of the manuscript so the editor can jump to it.
+ expect(MANUSCRIPT).toContain(findings[0].anchorQuote);
+ });
+
+ it('returns no findings for a consistently erudite POV character (no false positive on characterized formality)', async () => {
+ const findings = await getCheck(INTERIORITY_REGISTER).run(wholeCtx({
+ manuscript: '# Issue 1\n\n"The implications are considerable," Dr. Aurel said. "One hesitates to speculate."\n\nOne hesitates, she thought. One always hesitates, and the hesitation is the diagnosis.',
+ }));
+ expect(findings).toEqual([]);
+ });
+
+ it('respects maxFindings as a whole-run cap', async () => {
+ const many = Array.from({ length: 30 }, (_, i) => ({ severity: 'low', problem: `p${i}`, anchorQuote: `a${i}` }));
+ const ctx = wholeCtx({
+ config: { maxFindings: 4 },
+ callStagedLLM: async () => ({ content: { findings: many } }),
+ });
+ const findings = await getCheck(INTERIORITY_REGISTER).run(ctx);
+ expect(findings).toHaveLength(4);
+ });
+});
+
describe('interiority.protagonist — LLM check (#1294)', () => {
const wholeCtx = (overrides = {}) => ({
manuscript: '# Issue 1\n\nShe walked into the room and sat down.',
diff --git a/server/lib/editorial/checks/proseStyle.js b/server/lib/editorial/checks/proseStyle.js
index e7bb474883..1eae4caed0 100644
--- a/server/lib/editorial/checks/proseStyle.js
+++ b/server/lib/editorial/checks/proseStyle.js
@@ -6,6 +6,7 @@ import {
DEAD_METAPHOR_STAGE,
EDITORIAL_PROMPT_OVERHEAD_TOKENS,
INFO_DUMPING_STAGE,
+ INTERIORITY_REGISTER_STAGE,
KILL_YOUR_DARLINGS_STAGE,
MIRROR_DESCRIPTION_STAGE,
STYLE_CONFORMANCE_STAGE,
@@ -873,6 +874,37 @@ export const proseStyleChecks = [
buildVars: (manuscript) => ({ manuscript }),
}),
},
+ {
+ id: 'interiority.register',
+ sources: ['manuscript'],
+ label: 'Interiority register (thoughts that sound authored, not thought)',
+ description:
+ "LLM scan for rendered thought written in an authored, essayistic register instead of the character's own voice — analytical full-sentence thought where a character under pressure would think in fragments (\"I thought: this represents a supreme opportunity\"), author intrusion articulating a theme the character would never consciously articulate, a plain-spoken character thinking in polished literary prose that contradicts how they speak elsewhere, and an inner voice indistinguishable across the whole cast (flagged once, not per passage). The register layer above the other interiority checks: interiority.protagonist judges whether thought is present, scene.interiority-balance how much of a scene it occupies, this one how it sounds. Skips characterized formality in a genuinely erudite POV, deliberate free indirect discourse, calm reflective beats, and transitional summary interiority — and leaves told emotion to prose.telling-emotion. Findings name the register shift rather than rewriting the passage.",
+ scope: 'issue',
+ kind: 'llm',
+ category: 'style',
+ severityDefault: 'low',
+ defaultEnabled: true,
+ needsManuscript: true,
+ configSchema: z.object({
+ // Cap findings per run so a long manuscript can't flood the review.
+ maxFindings: z.number().int().min(1).max(50).default(12),
+ }),
+ configFields: [
+ { key: 'maxFindings', label: 'Max findings per run', type: 'number', min: 1, max: 50, step: 1, help: 'Cap findings so a long manuscript can not flood the review.' },
+ ],
+ gate: (ctx) => (ctx.manuscript || '').trim().length > 0,
+ // Localized prose-level findings (one essayistic thought = one spot), so this
+ // stays a plain per-chunk run with no cross-chunk digest — mirrors
+ // prose.telling-emotion. The prompt reconciles a character's thought against
+ // their dialogue, which lives in the same chunk as the thought itself.
+ run: (ctx) => runManuscriptLlmCheck(ctx, {
+ stage: INTERIORITY_REGISTER_STAGE,
+ category: 'style',
+ overheadTokens: EDITORIAL_PROMPT_OVERHEAD_TOKENS,
+ buildVars: (manuscript) => ({ manuscript }),
+ }),
+ },
{
id: 'prose.dead-metaphor',
sources: ['manuscript'],
diff --git a/server/lib/editorial/checks/proseStyle.test.js b/server/lib/editorial/checks/proseStyle.test.js
new file mode 100644
index 0000000000..f5f2e01e67
--- /dev/null
+++ b/server/lib/editorial/checks/proseStyle.test.js
@@ -0,0 +1,39 @@
+import { readFileSync } from 'fs';
+import { dirname, join } from 'path';
+import { fileURLToPath } from 'url';
+
+import { describe, it, expect } from 'vitest';
+
+import { getCheck } from '../checkRegistry.js';
+
+const STAGE_DIR = join(dirname(fileURLToPath(import.meta.url)), '../../../../data.reference/prompts/stages');
+const readStage = (file) => readFileSync(join(STAGE_DIR, file), 'utf-8');
+
+// Three checks now judge interiority and a fourth judges told emotion, all over
+// the same passages. The only thing keeping them from returning duplicate
+// findings on one paragraph is that each prompt names the others' territory as
+// out of scope — so the boundaries are asserted here rather than left to drift
+// the next time one of these prompts is edited (#3593).
+describe('interiority.register — prompt boundaries against its neighbours (#3593)', () => {
+ const prompt = readStage('pipeline-editorial-interiority-register.md');
+
+ it('renders the manuscript variable the check feeds it', () => {
+ expect(prompt).toContain('{{manuscript}}');
+ });
+
+ it('scopes told emotion out to prose.telling-emotion and missing interiority out to its siblings', () => {
+ const doNotFlag = prompt.slice(prompt.indexOf('Do NOT flag:'));
+ expect(doNotFlag).toContain('prose.telling-emotion');
+ expect(doNotFlag).toContain('interiority.protagonist');
+ expect(doNotFlag).toContain('scene.interiority-balance');
+ });
+
+ it('tells the model to flag the uniform-cast pattern once rather than per passage', () => {
+ expect(prompt).toMatch(/do not emit a finding per passage/i);
+ });
+
+ it('asks for a register shift rather than a rewrite, matching the registry description', () => {
+ expect(prompt).toMatch(/do NOT rewrite the/i);
+ expect(getCheck('interiority.register').description).toContain('rather than rewriting the passage');
+ });
+});
diff --git a/server/lib/promptStageCallSites.generated.json b/server/lib/promptStageCallSites.generated.json
index 8aadccd3f7..0ea10e925a 100644
--- a/server/lib/promptStageCallSites.generated.json
+++ b/server/lib/promptStageCallSites.generated.json
@@ -156,6 +156,9 @@
"pipeline-editorial-interiority-balance": [
"server/lib/editorial/checkInfra/craftStages.js"
],
+ "pipeline-editorial-interiority-register": [
+ "server/lib/editorial/checkInfra/craftStages.js"
+ ],
"pipeline-editorial-kill-your-darlings": [
"server/lib/editorial/checkInfra/craftStages.js"
],