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 dialogue.reported-speech editorial check (#3592)

[._.]/ Adam Eivy029867efe974
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index d273ee5a2b..9bdc2e1355 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -201,3 +201,4 @@
- **[issue-3594] The drafting prompt now teaches how to write a scene, not just how much scene to write.** The craft doctrine injected into both drafting stages — the prose pipeline and Writers Room live continuation — was entirely negative: eleven "avoid X" rules plus the Stability Trap countermeasures. One of those rules carries a measurable target with no technique attached ("at least 70% in-scene, not summary"), and a model told to dramatize more with no construction recipe reaches for longer description, which is exactly the white-room, zero-interiority draft the editorial checks then have to catch. A new "Zoom into the moment" section — the first positive-instruction block in the partial, placed right after the rule it operationalizes — gives it the recipe in five elements: name the location with one concrete noun rather than an inventory, say what the character is doing in present-moment verbs, render thoughts raw in the character's own diction instead of essay register, show emotion on the body rather than naming the feeling, and quote dialogue that is worth quoting instead of narrating that someone spoke. Each element ships with the failure mode that makes it a rule rather than a suggestion. Because the partial is a file on disk that existing installs already have, and both `setup-data.js` and the original seed migration only ever copy it when it is *missing*, the section arrives through a hash-gated migration: an install still running the shipped version is upgraded in place, and a hand-edited partial is left exactly as it is and told what to merge.
- **[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)
diff --git a/data.reference/prompts/stage-config.json b/data.reference/prompts/stage-config.json
index 9873b9c2bf..6d1ed0ad0e 100644
--- a/data.reference/prompts/stage-config.json
+++ b/data.reference/prompts/stage-config.json
@@ -807,6 +807,13 @@
"returnsJson": true,
"variables": []
},
+ "pipeline-editorial-reported-speech": {
+ "name": "Pipeline — Editorial Check: Reported speech where a quoted line belongs",
+ "description": "Editorial check (#3592): flags a character's decisive utterance delivered as narrated report instead of a quoted line — summarized speech at a turning point (\"she told him she was leaving\"), reported reaction to speech, and confrontations narrated indirectly with no line ever quoted. The inverse of on-the-nose dialogue: too little dialogue on the page rather than dialogue with too little under it. Reads the stitched manuscript; severity is advisory; skips deliberate compression of routine exchanges, between-scene bridges, POV constraints, and free-indirect-discourse voices. Findings name which moment to quote rather than drafting the line. Returns issue-anchored findings.",
+ "model": "default",
+ "returnsJson": true,
+ "variables": []
+ },
"pipeline-editorial-voice-distinctiveness": {
"name": "Pipeline — Editorial Check: Character voice distinctiveness",
"description": "Editorial check (#1307): samples each character dialogue and flags interchangeable voices (everyone sounds like one narrator) plus drafted lines that contradict the canon speechPattern/speechAccent. Reads the stitched manuscript + authored voice profiles; rolls a per-character voice-sample digest across chunks. Returns issue-anchored findings naming differentiating tics.",
diff --git a/data.reference/prompts/stages/pipeline-editorial-reported-speech.md b/data.reference/prompts/stages/pipeline-editorial-reported-speech.md
new file mode 100644
index 0000000000..e9b8e509a3
--- /dev/null
+++ b/data.reference/prompts/stages/pipeline-editorial-reported-speech.md
@@ -0,0 +1,85 @@
+# Pipeline — Editorial Check: Reported speech where a quoted line belongs
+
+You are a line editor doing a single focused pass for ONE problem: **a
+character's decisive utterance delivered as narrated report instead of a quoted
+line**. Every other dialogue check judges the dialogue that is already on the
+page; you are the only one that flags the line that is *missing* — the moment
+the reader is told what was said instead of hearing it.
+
+> My manager was very happy with my work.
+
+instead of
+
+> My manager looked up from the deck and said, "That's the best presentation
+> you've ever given."
+
+Flag a passage when the narration:
+
+- **Summarizes speech at a turning point** — "she told him she was leaving",
+ "he explained why the deal fell through", "the doctor gave them the news."
+ The words themselves are the beat, and the reader never gets them.
+- **Reports a reaction to speech** — "my friend was furious about it", "they
+ were thrilled when I said yes" — where the character's actual words are what
+ would land.
+- **Narrates a confrontation indirectly** — an argument, a negotiation, a
+ confession played out in the third person with no line ever quoted.
+
+Do NOT flag:
+
+- **Deliberate compression of routine exchanges** — logistics, greetings, small
+ talk. Quoting those is exactly what the pleasantries check cuts.
+- Reported speech used to **skip between scenes** ("they spent the drive
+ arguing about money" as a bridge into the scene that matters).
+- A **POV constraint** where the viewpoint character genuinely did not hear the
+ words (overheard through a wall, relayed secondhand, remembered hazily).
+- A scene that **already quotes the decisive line** and reports only the
+ surrounding chatter.
+- A **free-indirect-discourse voice** where reported speech is the consistent,
+ deliberate mode of the whole narration.
+
+Severity is **advisory**: most findings are `low`; reserve `medium` for a
+reported line at a pivotal beat where the quote would clearly raise the tension,
+and `high` only when the scene's central dramatic turn happens entirely in
+summarized speech.
+
+## 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 reported speech worth promoting to a quoted line. 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 why the quoted line would land
+harder here, and name **which moment to quote** — the specific utterance that
+should go on the page. Do NOT draft the dialogue for the author; point at the
+beat and let them write it.
+
+Be specific and cite the text. If the decisive beats are already quoted, 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 reported speech appears (e.g. 'Issue 3 — the kitchen argument')",
+ "problem": "1–3 sentences naming the reported line and why the quoted version would land harder",
+ "suggestion": "1–3 sentences naming which moment to quote — not the dialogue itself",
+ "anchorQuote": "short verbatim quote from the manuscript (≤ 200 chars)"
+ }
+ ]
+}
+```
diff --git a/scripts/migrations/229-editorial-reported-speech-stage.js b/scripts/migrations/229-editorial-reported-speech-stage.js
new file mode 100644
index 0000000000..bc4a0d7f77
--- /dev/null
+++ b/scripts/migrations/229-editorial-reported-speech-stage.js
@@ -0,0 +1,18 @@
+/**
+ * Seed the reported-speech editorial-check stage into existing installs (#3592).
+ *
+ * Mirrors `227-editorial-summary-not-scene-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
+ * `dialogue.reported-speech` 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-reported-speech');
diff --git a/scripts/migrations/229-editorial-reported-speech-stage.test.js b/scripts/migrations/229-editorial-reported-speech-stage.test.js
new file mode 100644
index 0000000000..fe9e5c9ffe
--- /dev/null
+++ b/scripts/migrations/229-editorial-reported-speech-stage.test.js
@@ -0,0 +1,16 @@
+import { describe } from 'vitest';
+
+import migration from './229-editorial-reported-speech-stage.js';
+import { runSeedStageMigrationTests } from './_seedStageTestHelpers.js';
+
+// The reported-speech editorial check's stage (#3592). The drift catch is the
+// point: if the reference template or its stage-config entry ever stops
+// shipping, the `dialogue.reported-speech` check would throw "Stage not found"
+// at runtime on a fresh install with nothing failing here first.
+describe('migration 229 — seed the reported-speech editorial stage', () => {
+ runSeedStageMigrationTests({
+ migration,
+ stages: ['pipeline-editorial-reported-speech'],
+ prefix: 'migration-229-',
+ });
+});
diff --git a/server/lib/editorial/checkInfra/craftStages.js b/server/lib/editorial/checkInfra/craftStages.js
index b31b4136ca..77e60ab139 100644
--- a/server/lib/editorial/checkInfra/craftStages.js
+++ b/server/lib/editorial/checkInfra/craftStages.js
@@ -115,6 +115,16 @@ export const TELLING_EMOTION_STAGE = 'pipeline-editorial-telling-emotion';
export const ON_THE_NOSE_STAGE = 'pipeline-editorial-on-the-nose';
export const VOICE_DISTINCTIVENESS_STAGE = 'pipeline-editorial-voice-distinctiveness';
+// Stage name for the reported-speech LLM check (#3592): a character's decisive
+// utterance delivered as narrated report ("she told him she was leaving")
+// instead of the quoted line that would carry the beat. Ships in
+// data.reference/prompts/stages/ + stage-config.json (fresh installs via
+// setup-data.js) and migrates to existing installs via migration 229 (boot runs
+// migrations but NOT setup-data, so the migration is required). The INVERSE of
+// ON_THE_NOSE_STAGE above — that one judges dialogue with too little under it,
+// this one flags the line that never made it onto the page at all.
+export const REPORTED_SPEECH_STAGE = 'pipeline-editorial-reported-speech';
+
// Finding subtypes for `dialogue.on-the-nose` (#1626) — the stage prompt classifies
// each subtext-free line into *why* it reads on-the-nose so the writer gets specific,
// actionable feedback instead of a flat "on-the-nose" label. Surfaced on the finding
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.js
index f45f8cdf8d..1ea5e9434b 100644
--- a/server/lib/editorial/checkRegistry.js
+++ b/server/lib/editorial/checkRegistry.js
@@ -81,6 +81,7 @@ export {
PLOT_STRUCTURE_STAGE,
PROSE_SYNC_PROSE_CHAR_CAP,
REACTION_PROPORTIONALITY_STAGE,
+ REPORTED_SPEECH_STAGE,
SAFE_CUT_TYPES,
SECONDARY_ARC_STAGE,
SENSORY_BALANCE_STAGE,
@@ -227,6 +228,7 @@ const CHECK_ORDER = Object.freeze([
'dialogue.attribution-clarity',
'dialogue.tag-variety',
'dialogue.on-the-nose',
+ 'dialogue.reported-speech',
'dialogue.voice-distinctiveness',
'style.voice-consistency',
'style.voice-drift',
diff --git a/server/lib/editorial/checkRegistry.test.js b/server/lib/editorial/checkRegistry.test.js
index e5879a315c..7c5376e38d 100644
--- a/server/lib/editorial/checkRegistry.test.js
+++ b/server/lib/editorial/checkRegistry.test.js
@@ -64,6 +64,7 @@ const SENSORY_BALANCE = 'sensory.balance';
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 PLOT_STRUCTURE = 'plot.structure-momentum';
const PACING_ESCALATION = 'pacing.escalation-curve';
const HEAD_HOPPING = 'pov.head-hopping';
@@ -826,6 +827,92 @@ describe('narration.summary-not-scene — summary-vs-scene LLM check (#3591)', (
});
});
+describe('dialogue.reported-speech — reported-speech LLM check (#3592)', () => {
+ const MANUSCRIPT = '# Issue 1\n\nThey argued about the money for an hour, and in the end she told him she was leaving.';
+ 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 dialogue category', () => {
+ const check = getCheck(REPORTED_SPEECH);
+ expect(check.kind).toBe('llm');
+ expect(check.scope).toBe('issue');
+ expect(check.category).toBe('dialogue');
+ 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(REPORTED_SPEECH);
+ 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 dialogue 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 — the money argument',
+ problem: 'The confrontation is narrated instead of quoted.',
+ suggestion: 'Quote the moment she says she is leaving.',
+ anchorQuote: 'she told him she was leaving',
+ }],
+ },
+ };
+ },
+ });
+ const findings = await getCheck(REPORTED_SPEECH).run(ctx);
+ expect(seenOverhead).toBeGreaterThan(0);
+ expect(seenVars.manuscript).toBe(MANUSCRIPT);
+ // Manuscript-only check — no scene map rides along.
+ expect(seenVars.sceneMap).toBeUndefined();
+ expect(findings).toHaveLength(1);
+ expect(findings[0].category).toBe('dialogue');
+ expect(findings[0].issueNumber).toBe(1);
+ expect(findings[0].suggestion).toContain('Quote the moment');
+ // 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 manuscript whose decisive beats are already quoted', async () => {
+ const findings = await getCheck(REPORTED_SPEECH).run(wholeCtx({
+ manuscript: '# Issue 1\n\n"I\'m leaving," she said.',
+ }));
+ 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(REPORTED_SPEECH).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/dialogue.js b/server/lib/editorial/checks/dialogue.js
index 3ad210b25b..a77c870c15 100644
--- a/server/lib/editorial/checks/dialogue.js
+++ b/server/lib/editorial/checks/dialogue.js
@@ -5,6 +5,7 @@ import {
EDITORIAL_PROMPT_OVERHEAD_TOKENS,
ON_THE_NOSE_STAGE,
ON_THE_NOSE_SUBTYPES,
+ REPORTED_SPEECH_STAGE,
VOICE_DISTINCTIVENESS_STAGE,
characterVoiceProfiles,
findDialogueTagVariety,
@@ -283,6 +284,35 @@ export const dialogueChecks = [
subtypes: ON_THE_NOSE_SUBTYPES,
}),
},
+ {
+ id: 'dialogue.reported-speech',
+ sources: ['manuscript'],
+ label: 'Reported speech where a quoted line belongs (LLM)',
+ description:
+ 'LLM scan for a character\'s decisive utterance delivered as narrated report instead of a quoted line — summarized speech at a turning point ("she told him she was leaving"), reported reaction to speech ("my friend was furious about it"), and confrontations narrated indirectly with no line ever quoted. The inverse of the other dialogue checks: they judge the dialogue that is on the page, this one flags the line that never made it there. Skips deliberate compression of routine exchanges (that is dialogue.pleasantries\' job), between-scene bridges, POV constraints where the character did not hear the words, and free-indirect-discourse voices. Findings name which moment to quote rather than drafting the line.',
+ scope: 'issue',
+ kind: 'llm',
+ category: 'dialogue',
+ 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 reported beat = one spot), so this stays
+ // a plain per-chunk run with no cross-chunk digest — mirrors dialogue.on-the-nose.
+ run: (ctx) => runManuscriptLlmCheck(ctx, {
+ stage: REPORTED_SPEECH_STAGE,
+ category: 'dialogue',
+ overheadTokens: EDITORIAL_PROMPT_OVERHEAD_TOKENS,
+ buildVars: (manuscript) => ({ manuscript }),
+ }),
+ },
{
id: 'dialogue.voice-distinctiveness',
sources: ['manuscript', 'canon'],
diff --git a/server/lib/promptStageCallSites.generated.json b/server/lib/promptStageCallSites.generated.json
index 0bc7cb3216..8aadccd3f7 100644
--- a/server/lib/promptStageCallSites.generated.json
+++ b/server/lib/promptStageCallSites.generated.json
@@ -189,6 +189,9 @@
"pipeline-editorial-reaction-proportionality": [
"server/lib/editorial/checkInfra/structureStages.js"
],
+ "pipeline-editorial-reported-speech": [
+ "server/lib/editorial/checkInfra/craftStages.js"
+ ],
"pipeline-editorial-secondary-arc": [
"server/lib/editorial/checkInfra/structureStages.js"
],