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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: subtype on-the-nose dialogue findings (exposition/emotion-tell/relationship-report) (#1626)
[._.]/ Adam Eivy3c15c5aa7d85
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex dcced186b8..fea161d9d8 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -23,6 +23,7 @@## Editorial checks+- **[issue-1626] On-the-nose dialogue findings now say *why* a line is flat, not just that it is.** `dialogue.on-the-nose` flagged subtext-free dialogue but labeled every finding the same way — too broad to act on. Each finding is now sub-classified into one of three subtypes so the fix is obvious: **exposition** (info-dump / "maid-and-butler" lines that state facts to inform the reader), **emotion-tell** (a character naming their own feeling outright instead of letting it surface through behavior), and **relationship-report** (a line describing a bond instead of dramatizing it). The stage prompt classifies and emits the subtype, the runner validates it against an allow-list (a stray label falls back to none), and it renders as a small badge on the finding in both the manuscript comment card and the editorial triage list. Additive and backward-compatible — older findings and synced peers carry no subtype and render unchanged; existing installs pick up the new prompt via boot migration 144. (`server/lib/editorial/checkRegistry.js`, `data.reference/prompts/stages/pipeline-editorial-on-the-nose.md`, `server/services/pipeline/manuscriptReview.js`, `client/src/components/pipeline/manuscript/ManuscriptCommentCard.jsx`, `client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx`, `scripts/migrations/144-editorial-on-the-nose-subtype.js`)- **[issue-1625] The reading-level check now reports per-scene variance, not just a single whole-corpus number.** `style.reading-level` measured one Flesch–Kincaid grade for the entire series and flagged drift from the style-guide target — but a single average hides the modulation a skilled writer uses (a quiet introspective scene reads lower, an action scene higher) and conceals a lone scene that swings far outside the intended band. The check now also splits the manuscript into scenes (reusing the shared `splitScenes` divider parser — markdown headings including the stitcher's `# Issue N`, and centered rules like `***`), measures each, and flags any scene whose grade falls outside the target **band** (`target ± sceneTolerance`), reporting the widest swings first. Three new per-series knobs join the existing whole-corpus tolerance: **per-scene band tolerance** (default 4 — wider than the corpus tolerance since scenes legitimately modulate), **minimum scene words to measure** (default 120 — short fragments are too noisy for a reliable FK estimate), and **max per-scene findings** (default 5 — so a long manuscript can't flood the review). The original whole-corpus finding is unchanged, and a single-scene manuscript reports only that — so existing series behavior is preserved. (`server/lib/editorial/checkRegistry.js`)- **[issue-1622] The adverb, passive-voice, and repeated-gesture copy-edit checks are now series-tunable like their word-list siblings.** Clichés, said-bookisms, filter words, crutch words, hedge words, and gestures already accepted a house-style allowlist and an extra-words list, but `prose.adverbs` and `prose.passive-voice` didn't expose theirs (repeated-gestures already did). Now all three carry the same config: `prose.adverbs` gains an **extra-adverbs** list so a series can flag the real adverbs the `-ly` heuristic misses ("fast", "well", "hard"); `prose.passive-voice` gains a **house-style allowlist** (participles to never flag — archaic/adjectival "-ed" forms like "blessed", "beloved") and an **extra-participles** list (series-specific irregular participles the heuristic misses, e.g. "begun", "hewn"). A historical-fiction series can now whitelist archaic forms and a comedic series can mute gesture repetition without code changes. Additive config with empty-string defaults — existing series are unaffected. (`server/lib/editorial/proseTics.js`, `server/lib/editorial/checkRegistry.js`)- **[issue-1624] A new editorial check flags objects whose narrative weight is out of proportion to their prominence.** The existing `objects.*` checks are presence tests — is a significant object attached to someone, is an interaction motivated, does an attachment's origin contradict its character — but none asked whether an object's *weight* matches how much the plot actually leans on it. The new `objects.weight-proportionality` check (series-scope, LLM, default-on) weighs each object's prominence in the prose against the depth of backstory and significance the story invests in it, and flags two failures: **over-weighted** (a minor object handed a disproportionate backstory — "a one-line locket with a three-issue origin") and **under-established** (a prominent or decisive object resting on no lineage — "an heirloom that resolves the finale, never set up"). It reads the stitched manuscript plus the canon object↔character attachment summary, judging the *proportion* rather than the absolute amount, and carries each object's established weight across manuscript chunks so a backstory planted early is weighed against a payoff that lands late. Stays distinct from `objects.unmotivated-interaction` (a single unmotivated beat) and `objects.backstory-consistency` (a contradicted origin) — the gap here is the over- or under-writing of plot machinery. Ships the prompt + stage-config for fresh installs and a boot migration (143) so existing installs seed the stage. (`server/lib/editorial/checkRegistry.js`, `data.reference/prompts/stages/pipeline-editorial-object-weight-proportionality.md`, `scripts/migrations/143-editorial-object-weight-proportionality-stage.js`)diff --git a/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx b/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsxindex 0b164c937f..91d61b469a 100644--- a/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx+++ b/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx@@ -32,6 +32,7 @@ import {FINDINGS_TRIAGE_ANCHOR_ID,} from '../../../lib/editorialChecks';import { fixEditsOf, selectedEditsFor } from '../manuscript/ManuscriptCommentCard';+import { SUBTYPE_LABEL } from '../manuscript/constants';import InlineDiff from '../../ui/InlineDiff';import toast from '../../ui/Toast';import { useAsyncAction } from '../../../hooks/useAsyncAction';@@ -205,6 +206,11 @@ function FindingRow({ seriesId, comment, onCommentChange, selected, onToggleSele</span><span className="flex items-center gap-2">{comment.location ? <span className="block text-[11px] text-gray-500">{comment.location}</span> : null}+ {comment.subtype ? (+ <span className="inline-flex items-center rounded border border-port-border px-1 text-[10px] text-gray-400" title="Why this line was flagged">+ {SUBTYPE_LABEL[comment.subtype] || comment.subtype}+ </span>+ ) : null}{isOpen && comment.stale ? <StaleBadge /> : null}{comment.dismissReason === 'false-positive' ? (<span className="inline-flex items-center gap-1 text-[10px] text-port-warning"><Ban size={10} /> false positive</span>diff --git a/client/src/components/pipeline/manuscript/ManuscriptCommentCard.jsx b/client/src/components/pipeline/manuscript/ManuscriptCommentCard.jsxindex b7a32be7e8..32fa71f843 100644--- a/client/src/components/pipeline/manuscript/ManuscriptCommentCard.jsx+++ b/client/src/components/pipeline/manuscript/ManuscriptCommentCard.jsx@@ -23,7 +23,7 @@ import {patchPipelineManuscriptComment, generatePipelineManuscriptFix, acceptPipelineManuscriptFix,undoPipelineManuscriptFix,} from '../../../services/api';-import { SEVERITY_TONE, CATEGORY_LABEL } from './constants';+import { SEVERITY_TONE, CATEGORY_LABEL, SUBTYPE_LABEL } from './constants';// Truncated comment id + copy button — so a note that looks wrong can be quoted// by id when reporting/debugging.@@ -131,6 +131,11 @@ export function Badge({ comment }) {{comment.severity}</span><span className="text-[10px] uppercase tracking-wider text-gray-500">{CATEGORY_LABEL[comment.category] || comment.category}</span>+ {comment.subtype ? (+ <span className="text-[10px] px-1.5 py-0.5 rounded border border-port-border text-gray-400" title="Why this line was flagged">+ {SUBTYPE_LABEL[comment.subtype] || comment.subtype}+ </span>+ ) : null}{comment.dismissReason === 'false-positive' ? (<span className="text-[10px] px-1.5 py-0.5 rounded border border-port-warning/40 text-port-warning" title="Flagged as a false positive">false positivediff --git a/client/src/components/pipeline/manuscript/ManuscriptCommentCard.test.jsx b/client/src/components/pipeline/manuscript/ManuscriptCommentCard.test.jsxindex 5839162d67..cdeffdeb1b 100644--- a/client/src/components/pipeline/manuscript/ManuscriptCommentCard.test.jsx+++ b/client/src/components/pipeline/manuscript/ManuscriptCommentCard.test.jsx@@ -1,6 +1,6 @@import { describe, it, expect, vi, beforeEach } from 'vitest';import { render, screen, fireEvent, waitFor } from '@testing-library/react';-import ManuscriptCommentCard from './ManuscriptCommentCard';+import ManuscriptCommentCard, { Badge } from './ManuscriptCommentCard';import { Toaster, toast } from '../../ui/Toast';import {acceptPipelineManuscriptFix,@@ -230,3 +230,20 @@ describe('ManuscriptCommentCard — manual edit path (#1610)', () => {expect(screen.queryByLabelText(/Replacement \(editable\)/i)).toBeNull();});});++describe('ManuscriptCommentCard Badge — subtype (#1626)', () => {+ it('renders a labeled subtype badge when the finding carries one', () => {+ render(<Badge comment={{ ...baseComment, category: 'dialogue', subtype: 'emotion-tell' }} />);+ expect(screen.getByText('Emotion-tell')).toBeTruthy();+ });++ it('falls back to the raw subtype when unmapped', () => {+ render(<Badge comment={{ ...baseComment, category: 'dialogue', subtype: 'novel-kind' }} />);+ expect(screen.getByText('novel-kind')).toBeTruthy();+ });++ it('renders no subtype badge when absent', () => {+ render(<Badge comment={{ ...baseComment, category: 'dialogue', subtype: null }} />);+ expect(screen.queryByText('Emotion-tell')).toBeNull();+ });+});diff --git a/client/src/components/pipeline/manuscript/constants.js b/client/src/components/pipeline/manuscript/constants.jsindex a8c618ca14..e146552a6e 100644--- a/client/src/components/pipeline/manuscript/constants.js+++ b/client/src/components/pipeline/manuscript/constants.js@@ -58,6 +58,17 @@ export const CATEGORY_LABEL = {other: 'Note',};+// Per-check finding sub-classifications (#1626). A finding's optional `subtype`+// names *why* it was flagged within its category — currently only+// `dialogue.on-the-nose` sets one (exposition / emotion-tell / relationship-report)+// so writers get specific, actionable feedback. An unmapped subtype renders its+// raw value; a `null` subtype renders no badge.+export const SUBTYPE_LABEL = {+ exposition: 'Exposition',+ 'emotion-tell': 'Emotion-tell',+ 'relationship-report': 'Relationship-report',+};+// Approximate a textarea's height to its content so the manuscript reads as one// continuous scroll (lets jump-to-anchor scroll the page, not an inner box).export const rowsFor = (text) => Math.min(400, Math.max(8, (text || '').split('\n').length + 1));diff --git a/data.reference/prompts/stages/pipeline-editorial-on-the-nose.md b/data.reference/prompts/stages/pipeline-editorial-on-the-nose.mdindex e7f2ee571f..9b9a5eff65 100644--- a/data.reference/prompts/stages/pipeline-editorial-on-the-nose.md+++ b/data.reference/prompts/stages/pipeline-editorial-on-the-nose.md@@ -17,6 +17,10 @@ Flag a passage when the dialogue:ship lost its main engine in the war ten years ago"). Cross-references theinfo-dumping problem, but here the tell is the *flatness* of the exchange, notjust the backstory.+- **Reports a relationship instead of dramatizing it** — a line that narrates+ the bond between characters rather than letting it play out ("We've been best+ friends since we were six", "You're like a father to me, you know that") where+ the history would land harder shown through how they actually treat each other.- **Answers its own question** — on-the-nose dialogue where every line respondsliterally and completely, with no evasion, deflection, or hidden agenda.@@ -35,6 +39,21 @@ subtext-free line at a pivotal beat where subtext would clearly raise thetension, and `high` only when a key dramatic turn is delivered as a flaton-the-nose speech.+## Subtype++Classify each finding into exactly ONE `subtype` so the writer knows *why* the+line reads on-the-nose and how to fix it:++- `exposition` — info-dump / "maid-and-butler" lines where characters state+ facts (backstory, world rules, plot logistics) primarily to inform the reader.+- `emotion-tell` — a character names their own feeling or want outright instead+ of letting it surface through behavior, evasion, or a contradicting action.+- `relationship-report` — a line describes the bond or history between+ characters rather than dramatizing it through how they treat each other.++When a line spans more than one, pick the **dominant** failure — the one the+fix should target first.+## ManuscriptThe manuscript is stitched from the drafted issues. Section headers attribute@@ -49,10 +68,10 @@ in each section header to attribute every finding to its `issueNumber`.Find the on-the-nose / subtext-free dialogue worth reworking. 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 subtext would land-harder here, and suggest a concrete way to add it (what to leave unsaid, an-evasion, a contradicting action) — without rewriting the whole exchange for the-author.+jump to it, name the issue number it appears in, classify its `subtype`, explain+why subtext would land harder here, and suggest a concrete way to add it (what to+leave unsaid, an evasion, a contradicting action) — without rewriting the whole+exchange for the author.Be specific and cite the text. If the dialogue already works with subtext,return an empty `findings` array — do not invent problems.@@ -67,6 +86,7 @@ commentary:"findings": [{"severity": "high|medium|low",+ "subtype": "exposition|emotion-tell|relationship-report","issueNumber": 3,"location": "string — where the on-the-nose dialogue appears (e.g. 'Issue 3 — confession scene')","problem": "1–3 sentences naming the subtext-free line and why subtext would land harder",diff --git a/scripts/migrations/144-editorial-on-the-nose-subtype.js b/scripts/migrations/144-editorial-on-the-nose-subtype.jsnew file mode 100644index 0000000000..45eff12e98--- /dev/null+++ b/scripts/migrations/144-editorial-on-the-nose-subtype.js@@ -0,0 +1,59 @@+/**+ * Sub-classify `dialogue.on-the-nose` editorial findings (#1626).+ *+ * The original on-the-nose stage prompt flagged subtext-free dialogue but never+ * said *why* a line read on-the-nose — "on-the-nose" alone is too broad for a+ * writer to act on. This migration rewrites the stage prompt to classify each+ * finding into one of three subtypes — `exposition` (info-dump / maid-and-butler),+ * `emotion-tell` (a character naming their own feeling outright), and+ * `relationship-report` (a line describing a bond instead of dramatizing it) —+ * and to emit that label as a `subtype` field on every finding. The runner+ * validates the label against its allow-list and surfaces it in the finding's+ * triage/comment badge.+ *+ * `scripts/setup-data.js` only copies *missing* prompts, so existing installs+ * keep their old on-the-nose template until this migration rewrites it. Migration+ * 112 seeds the file but never tracks its hash, so this is the first hash-driven+ * update for it — no earlier migration's MD5 tables need resyncing.+ * Customization-safe: only installs whose copy still hashes to the prior shipped+ * version are auto-updated; customized prompts are left intact and warned about.+ *+ * Strategy: hash-driven prompt-replace via `./_lib.js`. Idempotent.+ */++import { makePromptReplaceMigration } from './_lib.js';++// Pre-change shipped hash: the original #1307 on-the-nose body (seeded by+// migration 112).+export const ACCEPTED_OLD_MD5 = {+ 'pipeline-editorial-on-the-nose.md': ['48182b49149e6b5829fbed71b3ffc242'],+};++// Post-change shipped hash (subtype taxonomy + `subtype` output field). This+// file's only prior migration (112) is a seed that tracks no hash, so there are+// no earlier MD5 tables to mirror into.+export const NEW_SHIPPED_MD5 = {+ 'pipeline-editorial-on-the-nose.md': '8d9038a2b197728f6edeedb84699f364',+};++const { applyMigration, up } = makePromptReplaceMigration({+ accepted: ACCEPTED_OLD_MD5,+ current: NEW_SHIPPED_MD5,+ label: 'editorial on-the-nose subtype',+ customizedHint: (filename) =>+ ` To classify findings manually, diff:\n` ++ ` data.reference/prompts/stages/${filename}\n` ++ ` against your current:\n` ++ ` data/prompts/stages/${filename}\n` ++ ` and add the "## Subtype" section plus the "subtype":\n` ++ ` "exposition|emotion-tell|relationship-report" field to the output contract.`,+ skipFooter: (count) =>+ `⚠️ ${count} on-the-nose prompt(s) could not be auto-updated because\n` ++ ` they were customized. The check still runs, but its findings will keep\n` ++ ` showing a flat "on-the-nose" label until you add the exposition /\n` ++ ` emotion-tell / relationship-report subtype classification.\n` ++ ` See data.reference/prompts/stages/pipeline-editorial-on-the-nose.md.`,+});++export { applyMigration };+export default { up };diff --git a/scripts/migrations/144-editorial-on-the-nose-subtype.test.js b/scripts/migrations/144-editorial-on-the-nose-subtype.test.jsnew file mode 100644index 0000000000..612a9b8954--- /dev/null+++ b/scripts/migrations/144-editorial-on-the-nose-subtype.test.js@@ -0,0 +1,14 @@+import { describe } from 'vitest';++import { runPromptMigrationTests } from './_testHelpers.js';+import migration, { applyMigration, ACCEPTED_OLD_MD5, NEW_SHIPPED_MD5 } from './144-editorial-on-the-nose-subtype.js';++describe('migration 144 — sub-classify editorial on-the-nose findings', () => {+ runPromptMigrationTests({+ migration,+ applyMigration,+ ACCEPTED_OLD_MD5,+ NEW_SHIPPED_MD5,+ prefix: 'migration-144-',+ });+});diff --git a/scripts/setup-data-drift.test.js b/scripts/setup-data-drift.test.jsindex aa677c315a..221e42390c 100644--- a/scripts/setup-data-drift.test.js+++ b/scripts/setup-data-drift.test.js@@ -44,6 +44,7 @@ const EXPECTED_STAGE_OLD = {'cos-agent-briefing.md': ['181b26838e526427173e4dccfc884d01', '3e1ca7f7b14b799f89a193c568003624', '699d053875472df455258724a0162bd5', '9bcd3a0167dd4aed7cfff7f404494dfb', 'af73fd50d6f29d561772474c12346e53', 'd761133753da290a0c02eca1c87709e4'],'pipeline-editorial-telling-emotion.md': ['2c5c33709732fe7ffa319d32b8755354'],'pipeline-editorial-chekhov.md': ['bfacbf343ba2b9a3f6037bb45b94e1bb'],+ 'pipeline-editorial-on-the-nose.md': ['48182b49149e6b5829fbed71b3ffc242'],'pipeline-tv-script.md': ['3f6fecc25573ed054b47db392250034a'],};const EXPECTED_STAGE_NEW = {@@ -67,6 +68,7 @@ const EXPECTED_STAGE_NEW = {'pipeline-manuscript-fix.md': 'e2baaf0f2f53c8aa1e934a428c0ca583','pipeline-editorial-telling-emotion.md': '871f7e8bea2a2d95f28875ab45a318e2','pipeline-editorial-chekhov.md': '1f8a1696b5e4f476051dc5b2e5737db9',+ 'pipeline-editorial-on-the-nose.md': '8d9038a2b197728f6edeedb84699f364','pipeline-tv-script.md': '376f779f4687b598f1c92ca4e770fd5a',};const EXPECTED_PARTIAL_OLD = {diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.jsindex e27d2f705e..35ec5e58ba 100644--- a/server/lib/editorial/checkRegistry.js+++ b/server/lib/editorial/checkRegistry.js@@ -383,6 +383,13 @@ 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';+// 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+// (and persisted comment) as `subtype`; the runner validates the model's value against+// this allow-list and drops anything off-list (→ null) so a stray label can't leak through.+export const ON_THE_NOSE_SUBTYPES = ['exposition', 'emotion-tell', 'relationship-report'];+// Stage name for the narrator voice / tone-consistency LLM check (#1586) — the// narration-level sibling of voice-distinctiveness (which covers per-CHARACTER// dialogue). Ships in data.reference/prompts/stages/ + stage-config.json (fresh@@ -1253,7 +1260,7 @@ export function buildSetupDigestPrompt({ focus, priorSummary, manuscript }) {// only — every other chunk, and every non-reserving check, keeps full manuscript// coverage. If the digest alone is larger than the whole window it still yields// (never prepended past the budget), preserving the no-overflow contract.-async function runChunkedManuscriptCheck(ctx, { chunks, category, max, callChunk, crossChunkDigest = false, summarizeChunk = null, reserveSetupDigest = false }) {+async function runChunkedManuscriptCheck(ctx, { chunks, category, max, callChunk, crossChunkDigest = false, summarizeChunk = null, reserveSetupDigest = false, subtypes = null }) {const usableChars = Number.isFinite(chunks?.usableChars) ? chunks.usableChars : Infinity;const merged = new Map();// The presence of `summarizeChunk` (set only when the check opts into the@@ -1306,6 +1313,7 @@ async function runChunkedManuscriptCheck(ctx, { chunks, category, max, callChunkcategory,max,withIssueNumber: true,+ subtypes,})) {const k = editorialFindingKey(f);if (!merged.has(k)) merged.set(k, f);@@ -1361,7 +1369,7 @@ async function runChunkedManuscriptCheck(ctx, { chunks, category, max, callChunk// check). Existing checks ignore the extra args. These checks are all// manuscript-scoped, so findings keep a model-supplied issue number// (`withIssueNumber: true`).-async function runManuscriptLlmCheck(ctx, { stage, category, overheadTokens = 0, context = null, buildVars, crossChunkDigest = false, crossChunkSetup = false, setupFocus = '', reserveSetupDigest = false }) {+async function runManuscriptLlmCheck(ctx, { stage, category, overheadTokens = 0, context = null, buildVars, crossChunkDigest = false, crossChunkSetup = false, setupFocus = '', reserveSetupDigest = false, subtypes = null }) {const max = ctx.config?.maxFindings ?? 12;// Chunks are planned at the full usable budget; the digest is fitted into each// later chunk's spare room inside runChunkedManuscriptCheck (it yields to the@@ -1396,6 +1404,7 @@ async function runManuscriptLlmCheck(ctx, { stage, category, overheadTokens = 0,crossChunkDigest,summarizeChunk,reserveSetupDigest,+ subtypes,callChunk: async (manuscript, meta) => {const { content } = await ctx.callStagedLLM(stage, buildVars(manuscript, meta, fittedContext), { returnsJson: true, source: stage });return content;@@ -1408,11 +1417,21 @@ async function runManuscriptLlmCheck(ctx, { stage, category, overheadTokens = 0,// check's `category`, coerce each string field, cap the count, and drop any// finding with no `problem`. `withIssueNumber` keeps a model-supplied issue// number (manuscript-scoped checks) vs. forcing null (canon-scoped checks).-function mapLlmFindings(raw, { severityDefault, category, max, withIssueNumber }) {+// `subtypes` (optional) is a per-check allow-list (#1626): when supplied, the+// model's `subtype` is validated against it and stamped on the finding (off-list+// or absent → null), letting a check sub-classify its findings (e.g. on-the-nose+// → exposition / emotion-tell / relationship-report) without a new field on every+// other check.+function mapLlmFindings(raw, { severityDefault, category, max, withIssueNumber, subtypes = null }) {const list = Array.isArray(raw) ? raw : [];+ const allowSubtype = Array.isArray(subtypes) && subtypes.length > 0;return list.slice(0, max).map((f) => ({severity: SEVERITIES.includes(f?.severity) ? f.severity : severityDefault,category,+ // Optional per-check sub-classification. Only set when the check declares an+ // allow-list AND the model returned a recognized value — null otherwise so a+ // check with no subtypes (and an unrecognized label) carries a clean null.+ subtype: allowSubtype && subtypes.includes(f?.subtype) ? f.subtype : null,location: typeof f?.location === 'string' ? f.location : '',problem: typeof f?.problem === 'string' ? f.problem : '',suggestion: typeof f?.suggestion === 'string' ? f.suggestion : '',@@ -6542,7 +6561,7 @@ export const EDITORIAL_CHECKS = [sources: ['manuscript'],label: 'On-the-nose / subtext-free dialogue (LLM)',description:- 'LLM scan for dialogue that states exactly what a character feels or means with no subtext, and "maid-and-butler" exchanges where characters tell each other what they both already know. Complements the info-dumping check (#1297) — that targets backstory exposition, this targets emotionally flat, subtext-free lines.',+ 'LLM scan for dialogue that states exactly what a character feels or means with no subtext, and "maid-and-butler" exchanges where characters tell each other what they both already know. Each finding is sub-classified (#1626) as exposition (info-dump), emotion-tell (naming a feeling outright), or relationship-report (describing a bond instead of dramatizing it) so the fix is actionable. Complements the info-dumping check (#1297) — that targets backstory exposition, this targets emotionally flat, subtext-free lines.',scope: 'issue',kind: 'llm',category: 'dialogue',@@ -6564,6 +6583,11 @@ export const EDITORIAL_CHECKS = [category: 'dialogue',overheadTokens: EDITORIAL_PROMPT_OVERHEAD_TOKENS,buildVars: (manuscript) => ({ manuscript }),+ // The prompt classifies each finding (#1626) into why it reads on-the-nose;+ // the runner validates the model's label against this set and stamps it as+ // `subtype` on the finding so the editor sees exposition / emotion-tell /+ // relationship-report instead of a flat "on-the-nose".+ subtypes: ON_THE_NOSE_SUBTYPES,}),},{diff --git a/server/lib/editorial/checkRegistry.test.js b/server/lib/editorial/checkRegistry.test.jsindex 43b42336cb..fd77edf950 100644--- a/server/lib/editorial/checkRegistry.test.js+++ b/server/lib/editorial/checkRegistry.test.js@@ -51,6 +51,7 @@ import {renderComicForProseSync,proseSyncPairs,PROSE_SYNC_PROSE_CHAR_CAP,+ ON_THE_NOSE_SUBTYPES,} from './checkRegistry.js';const NAMING = 'naming.dissimilar-names';@@ -5167,6 +5168,41 @@ describe('dialogue-craft bundle (#1307)', () => {expect(findings[0].category).toBe('dialogue');expect(findings[0].issueNumber).toBe(1);});++ it('stamps a recognized subtype on each finding (#1626)', async () => {+ const ctx = wholeCtx({+ callStagedLLM: async () => ({+ content: { findings: [{ severity: 'low', subtype: 'emotion-tell', issueNumber: 1, problem: 'names the feeling', anchorQuote: 'I am angry' }] },+ }),+ });+ const findings = await getCheck(ON_THE_NOSE).run(ctx);+ expect(findings).toHaveLength(1);+ expect(findings[0].subtype).toBe('emotion-tell');+ });++ it('drops an off-list subtype to null (#1626)', async () => {+ const ctx = wholeCtx({+ callStagedLLM: async () => ({+ content: { findings: [{ severity: 'low', subtype: 'made-up-label', issueNumber: 1, problem: 'on the nose', anchorQuote: 'I am angry' }] },+ }),+ });+ const findings = await getCheck(ON_THE_NOSE).run(ctx);+ expect(findings[0].subtype).toBeNull();+ });++ it('defaults subtype to null when the model omits it (#1626)', async () => {+ const ctx = wholeCtx({+ callStagedLLM: async () => ({+ content: { findings: [{ severity: 'low', issueNumber: 1, problem: 'on the nose', anchorQuote: 'I am angry' }] },+ }),+ });+ const findings = await getCheck(ON_THE_NOSE).run(ctx);+ expect(findings[0].subtype).toBeNull();+ });++ it('only declares the three documented subtypes', () => {+ expect(ON_THE_NOSE_SUBTYPES).toEqual(['exposition', 'emotion-tell', 'relationship-report']);+ });});describe('dialogue.voice-distinctiveness — LLM check', () => {@@ -5204,6 +5240,8 @@ describe('dialogue-craft bundle (#1307)', () => {expect(seenVars.voiceProfiles).toContain('clipped, profane');expect(findings).toHaveLength(1);expect(findings[0].category).toBe('dialogue');+ // A check that doesn't declare subtypes carries a clean null (#1626).+ expect(findings[0].subtype).toBeNull();});});diff --git a/server/services/pipeline/manuscriptReview.js b/server/services/pipeline/manuscriptReview.jsindex 5c1322df82..e9ee535aed 100644--- a/server/services/pipeline/manuscriptReview.js+++ b/server/services/pipeline/manuscriptReview.js@@ -147,6 +147,15 @@ function sanitizeComment(raw) {// additive → the synced review doc stays backward-compatible.nativeSeverity: ['high', 'medium', 'low'].includes(raw.nativeSeverity) ? raw.nativeSeverity : severity,category,+ // Optional per-check sub-classification of the finding (#1626) — e.g.+ // `dialogue.on-the-nose` tags each finding `exposition` / `emotion-tell` /+ // `relationship-report` so the editor sees *why* a line reads on-the-nose.+ // `null` for checks that don't sub-classify, legacy records, and older peers.+ // Validated by the producing check against its own allow-list, so a stray+ // value never reaches here; the clamp is a belt-and-suspenders bound for+ // hand-edited / older-peer files. Optional + additive → the synced review doc+ // stays backward-compatible (no schema bump needed).+ subtype: clampStr(raw.subtype, 40) || null,location: clampStr(raw.location, 200),problem,suggestion: clampStr(raw.suggestion, 8000),diff --git a/server/services/pipeline/manuscriptReview.test.js b/server/services/pipeline/manuscriptReview.test.jsindex e565270d50..fe3497bb57 100644--- a/server/services/pipeline/manuscriptReview.test.js+++ b/server/services/pipeline/manuscriptReview.test.js@@ -104,6 +104,25 @@ describe('manuscriptReview — record-event emission on write', () => {expect(merged.comments.find((c) => c.id === 'c1').status).toBe('dismissed');});+ it('persists a finding subtype and nulls absent/legacy ones (#1626)', async () => {+ const seeded = await seedReviewFromFindings('ser-subtype', [+ { category: 'dialogue', subtype: 'emotion-tell', problem: 'names the feeling', anchorQuote: 'I am angry' },+ { category: 'dialogue', problem: 'no subtype given', anchorQuote: 'plain line' },+ ]);+ const byProblem = Object.fromEntries(seeded.comments.map((c) => [c.problem, c]));+ expect(byProblem['names the feeling'].subtype).toBe('emotion-tell');+ expect(byProblem['no subtype given'].subtype).toBeNull();++ // A legacy/older-peer comment with no subtype field round-trips as null.+ const merged = await mergeReviewFromSync('ser-subtype-legacy', {+ schemaVersion: 1,+ comments: [+ { id: 'mrc-st', category: 'dialogue', problem: 'legacy dialogue note', status: 'open', updatedAt: '2026-06-02T00:00:00Z' },+ ],+ });+ expect(merged.comments.find((c) => c.id === 'mrc-st').subtype).toBeNull();+ });+it('persists replacementStrategy (explicit value, derived from category, and legacy fallback)', async () => {const seeded = await seedReviewFromFindings('ser-4', [{ category: 'comic-structure', problem: 'page is prose', suggestion: 'Panel 1 …', anchorQuote: 'PAGE 5' },