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 prose.hedge-words editorial check + broaden filter-words (#1621)

[._.]/ Adam Eivyde34a5932d96
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index b905389a2e..1bebd5750f 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -23,6 +23,7 @@
## Editorial checks
+- **[issue-1621] The copy-edit pass now flags hedge / weasel distance markers, and the filter-words check catches more perception phrases.** `prose.filter-words` only caught perception *verbs* (saw, noticed, felt…) and missed the other way prose quietly backs the reader out of a moment: metaphorical distance ("it was as if he knew", "somewhere deep inside", "almost felt"), dialogue/cognitive hedges ("I kind of think", "sort of felt", "more or less"), and cognitive weasel words ("surely", "no doubt", "obviously", "of course"). A new deterministic, default-on, series-tunable `prose.hedge-words` check (its own per-1000-word density threshold, house-style allowlist, and extra-words list, exactly like the sibling word-list checks) scores these as a separate hedge/weasel bucket. The filter-words list also gained the modal-perception and reflexive phrasings of the same tic — "could see/hear/feel", "found himself/herself". (`server/lib/editorial/proseTics.js`, `server/lib/editorial/checkRegistry.js`)
- **[issue-1620] A new editorial check flags POV economy — too many viewpoints for the run length, and viewpoints introduced too late to earn their place.** `pov.justified` asks whether each *individual* viewpoint earns an arc, but nothing judged the viewpoint *roster* as a whole. The new `pov.economy` check (series-scope, deterministic, default-on) reads the reverse-outline POV-per-scene map and flags two structural problems: **too many POVs for the run length** (e.g. 8 viewpoints across 12 issues, each barely developed — gated by an absolute floor so a one- or two-POV book is never called a crowd) and a **late-introduced, underdeveloped POV** (first takes the viewpoint in the final stretch of the run and holds only a scene or two). The acceptable POV-to-issue ratio, the minimum run length to judge, and the late-introduction window are all per-series tunable. Purely structural over the outline — no LLM call, no manuscript corpus — and degrades to silence when the outline carries no issue numbers (without a run length neither signal can be judged). (`server/lib/editorial/checkRegistry.js`)
- **[issue-1619] A new editorial check flags character-arc regression, circular arcs, and premature closure.** `arc.transitions` finds the change *moments* but never judged whether each arc holds together end to end. The new `arc.regression` check (series-scope, default-on) tracks each character's progress across the issues and flags an unmotivated **regression** (a character grows then reverts with no earned reason — distinct from a dramatized relapse), a **circular arc** (ends in the same state they began, the growth cancelled out), or **premature closure** (the arc resolves early — e.g. issue 3 of 10 — then stays flat, deflating the back half). It reads the stitched manuscript plus the reverse-outline scene map and the authored per-character arcs (`series.characterArcs`), gates its whole-arc verdicts to the final manuscript part so a mid-arc character whose later growth is still ahead is not false-flagged, and degrades to a prose-only scan when no outline or authored arcs exist. Ships the prompt + stage-config for fresh installs and a boot migration (141) so existing installs seed the stage. (`server/lib/editorial/checkRegistry.js`, `data.reference/prompts/stages/pipeline-editorial-arc-regression.md`, `scripts/migrations/141-editorial-arc-regression-stage.js`)
- **[issue-1618] A new editorial check scores the series-wide pacing / intensity escalation curve.** `plot.structure-momentum` flags flat stakes as one of many macro pathologies, but nothing measured the *shape* of intensity across the whole series. The new `pacing.escalation-curve` check (series-scope, default-on) scores each issue's dramatic intensity and flags a curve that fails to build — **flat intensity** (issue 1 reads as intensely as issue N), a **front-loaded climax** (the biggest beat lands early and the back half coasts), **plateaued stakes**, or a **de-escalating arc**. It reads the stitched manuscript plus the reverse-outline scene map and a new deterministic per-issue conflict-marker density tally (a mechanical intensity proxy the model treats as a hint and confirms against the prose), gates its whole-curve verdict to the final manuscript part, and degrades to a prose-only scan when no outline exists. Subsumes "conflict escalation" as one signal of the same curve. Ships the prompt + stage-config for fresh installs and a boot migration (140) so existing installs seed the stage. (`server/lib/editorial/checkRegistry.js`, `data.reference/prompts/stages/pipeline-editorial-pacing-escalation-curve.md`, `scripts/migrations/140-editorial-pacing-escalation-stage.js`)
diff --git a/server/lib/editorial/README.md b/server/lib/editorial/README.md
index 1351465b3e..f593b8e1e2 100644
--- a/server/lib/editorial/README.md
+++ b/server/lib/editorial/README.md
@@ -197,7 +197,7 @@ runner-injected `ctx.callInlineLLM` (an inline-prompt sibling of
| `nameSimilarity.js` | Pure, dependency-free name-confusability primitives for `naming.dissimilar-names` (#1291): `normalizeName`, `vowelSkeleton`, `soundex` (phonetic key), `levenshtein` (edit distance), `nameSimilaritySignals` (the per-pair signal list, with option toggles), and `firstLetterHistogram` / `findFirstLetterClusters` (cast first-letter crowding). |
| `cliches.js` | Pure, dependency-free cliché + overwriting primitives for `prose.cliches` and `prose.modifier-stacking` (#1308): `CLICHE_PHRASES` (seed stock-simile/idiom list), `findCliches` (whole-word phrase scan with house-style allow/extra lists), and `findModifierStacking` (cumulative no-comma runs of 3+ stacked adjectives/adverbs). The LLM sibling `prose.dead-metaphor` handles the judgment cases (mixed/dead metaphor, novel clichés, purple prose). |
| `italicThoughts.js` | Pure, dependency-free italic-thought primitive for `prose.italic-thoughts` (#1300): `findItalicThoughts` (multi-word markdown `*…*` / `_…_` italic runs, dedup + word-count threshold so single-word emphasis, bold, and `snake_case` are skipped). The LLM siblings (`opening.wrong-start`, `prose.mirror-description`, `dialogue.pleasantries`, `prose.kill-your-darlings`) handle the judgment cases in the #1300 anti-pattern bundle. |
-| `proseTics.js` | Pure, dependency-free copy-edit prose-tic primitives for the #1306 line-edit group: `tokenizeWords` / `splitSentences` (shared tokenization), `findFilterWords` (`prose.filter-words`), `findCrutchWords` (`prose.crutch-words`), `findAdverbs` (`prose.adverbs` — `-ly` adverbs + dialogue-tag adverbs), `findPassiveVoice` (`prose.passive-voice` — be-verb + past-participle heuristic; classifies each hit `weak`/`stative`/`mood` + `byAgent` so #1593 context tuning can suppress intentional passive) and its `filterPassiveVoice` companion (drops `stative` predicate-adjectives + `mood` setting images unless `suppressIntentional` is off), `findGestures` (`prose.repeated-gestures` — gesture tally + body-part autonomy), plus the seed `FILTER_WORDS` / `CRUTCH_WORDS` / `GESTURE_WORDS` lists. The LLM sibling `prose.telling-emotion` handles the named-emotion judgment case. |
+| `proseTics.js` | Pure, dependency-free copy-edit prose-tic primitives for the #1306 line-edit group: `tokenizeWords` / `splitSentences` (shared tokenization), `findFilterWords` (`prose.filter-words`), `findHedgeWords` (`prose.hedge-words` — hedge/weasel distance markers: metaphorical distance, dialogue hedges, cognitive weasel words), `findCrutchWords` (`prose.crutch-words`), `findAdverbs` (`prose.adverbs` — `-ly` adverbs + dialogue-tag adverbs), `findPassiveVoice` (`prose.passive-voice` — be-verb + past-participle heuristic; classifies each hit `weak`/`stative`/`mood` + `byAgent` so #1593 context tuning can suppress intentional passive) and its `filterPassiveVoice` companion (drops `stative` predicate-adjectives + `mood` setting images unless `suppressIntentional` is off), `findGestures` (`prose.repeated-gestures` — gesture tally + body-part autonomy), plus the seed `FILTER_WORDS` / `HEDGE_WORDS` / `CRUTCH_WORDS` / `GESTURE_WORDS` lists. The LLM sibling `prose.telling-emotion` handles the named-emotion judgment case. |
| `repetition.js` | Pure, dependency-free word-echo & rhythm primitives for #1306: `findWordEchoes` (`prose.word-echoes` — distinctive word repeated within a window), `findRepeatedOpeners` (runs of sentences sharing an opener, "He… He… He…"), and `measureSentenceRhythm` (`prose.sentence-rhythm` — sentence-length variation). Reuses `tokenizeWords` / `splitSentences` from `proseTics.js`. |
| `comicPacing.js` | Pure, dependency-free comic-pacing primitives for the #1314 comic-pacing group: `isSplashPage`, `comicSpreadLayout` (recto/verso + spread + `beginsSpread` page-turn map), `summarizeComicPages`, `analyzePanelRhythm` (`comic.panel-rhythm` — splash overuse / back-to-back splashes / overcrowded pages / grid monotony), `comicPageTurnSummary` + `authoredRevealSummary` (LLM-context renderers for `comic.page-turn-beats`). Operates on already-parsed comic pages (the runner parses each issue's stored comic script and injects them as the `comicScript` source) so the editorial dir stays import-pure. |
| `shotContinuity.js` | Pure, dependency-free storyboard shot-continuity primitives for the deterministic `visual.shot-continuity` check (#1315): `findAxisReversals` (180°-rule axis flips across a continuity-linked shot pair using `screenDirection`) and `findShotTypeMonotony` (a scene whose classified shots all share one `shotType`). Also `summarizeStoryboardShots` (#1466) — renders the collected `{ issueNumber, scene }` storyboard list into a compact per-scene shot block shared by the LLM siblings `visual.eyeline-match` (gaze reciprocity / eyeline-vs-screen-direction) and `visual.appearance-continuity` (#1467 — diffs the same entity's wardrobe/prop/setting descriptions across shots for contradictions). Reads the shot-grammar fields from `server/lib/shotGrammar.js`. |
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.js
index f0a1a9d54f..84089b9a89 100644
--- a/server/lib/editorial/checkRegistry.js
+++ b/server/lib/editorial/checkRegistry.js
@@ -39,6 +39,7 @@ import { findSaidBookisms, findUnattributedDialogueRuns, attributeDialogueByOwne
import { findItalicThoughts } from './italicThoughts.js';
import {
findFilterWords,
+ findHedgeWords,
findCrutchWords,
findAdverbs,
findPassiveVoice,
@@ -5472,6 +5473,41 @@ export const EDITORIAL_CHECKS = [
suggestion: 'Collapse to direct experience — "she saw the door open" → "the door opened" — or add intentional uses to the allowlist.',
}),
},
+ {
+ id: 'prose.hedge-words',
+ sources: ['manuscript'],
+ label: 'Hedge / weasel words (distance markers)',
+ description:
+ 'Flags hedge and weasel constructions that soften prose and back the reader out of the moment — metaphorical distance ("as if", "somewhere deep inside", "almost", "part of him"), dialogue/cognitive hedges ("kind of", "sort of", "I suppose", "more or less"), and cognitive weasel words ("surely", "no doubt", "obviously", "of course"). Density-scaled per-1000-word frequency: an occasional hedge is fine, a steady drumbeat reads as a narrator who won\'t commit. Separate from the perception-verb bucket in prose.filter-words.',
+ scope: 'issue',
+ kind: 'deterministic',
+ category: 'style',
+ severityDefault: 'low',
+ defaultEnabled: true,
+ needsManuscript: true,
+ configSchema: z.object({
+ // Per-1000-word rate at/above which a section is flagged.
+ densityPer1000: z.number().min(0).max(50).default(7),
+ // Cap findings per run so a heavy draft can't flood the review.
+ maxFindings: z.number().int().min(1).max(50).default(20),
+ // House-style allowlist / extra hedge words (comma- or newline-separated).
+ allowWords: z.string().default(''),
+ extraWords: z.string().default(''),
+ }),
+ configFields: [
+ { key: 'densityPer1000', label: 'Hedge-word rate to flag (per 1000 words)', type: 'number', min: 0, max: 50, step: 1, help: 'Flag a section whose hedge/weasel-word frequency per 1000 words is at or above this. One "perhaps" is fine; a steady drumbeat is the tic.' },
+ { key: 'maxFindings', label: 'Max findings per run', type: 'number', min: 1, max: 50, step: 1, help: 'Cap findings so a heavy draft can not flood the review.' },
+ { key: 'allowWords', label: 'House-style allowlist', type: 'text', help: 'Hedge words to leave alone (comma-separated or one per line).' },
+ { key: 'extraWords', label: 'Extra hedge words to flag', type: 'text', help: 'Series-specific hedges/weasel words to add (comma-separated or one per line).' },
+ ],
+ gate: (ctx) => (ctx.manuscript || '').trim().length > 0,
+ run: (ctx) => runDensityCheck(ctx, {
+ scan: (text, cfg) => findHedgeWords(text, { allowWords: splitPhraseList(cfg.allowWords), extraWords: splitPhraseList(cfg.extraWords) }),
+ noun: 'hedge words',
+ problem: (count, rate, anchor) => `${count} hedge/weasel word${count === 1 ? '' : 's'} (e.g. "${anchor}") — about ${rate}/1000 words. Hedges and weasel words soften the prose and distance the reader from a committed, dramatized moment.`,
+ suggestion: 'Commit to the moment — drop the hedge or dramatize the feeling directly ("part of him almost felt" → "he felt") — or add intentional uses to the allowlist.',
+ }),
+ },
{
id: 'prose.crutch-words',
sources: ['manuscript'],
diff --git a/server/lib/editorial/checkRegistry.test.js b/server/lib/editorial/checkRegistry.test.js
index 29c094c3e6..376dde5e3e 100644
--- a/server/lib/editorial/checkRegistry.test.js
+++ b/server/lib/editorial/checkRegistry.test.js
@@ -4596,6 +4596,7 @@ describe('prose.cliches / prose.modifier-stacking / prose.dead-metaphor (#1308)'
describe('copy-edit prose-tic bundle (#1306)', () => {
const FILTER = 'prose.filter-words';
+ const HEDGE = 'prose.hedge-words';
const CRUTCH = 'prose.crutch-words';
const ADVERBS = 'prose.adverbs';
const PASSIVE = 'prose.passive-voice';
@@ -4603,9 +4604,9 @@ describe('copy-edit prose-tic bundle (#1306)', () => {
const ECHOES = 'prose.word-echoes';
const RHYTHM = 'prose.sentence-rhythm';
const TELLING = 'prose.telling-emotion';
- const DETERMINISTIC = [FILTER, CRUTCH, ADVERBS, PASSIVE, GESTURES, ECHOES, RHYTHM];
+ const DETERMINISTIC = [FILTER, HEDGE, CRUTCH, ADVERBS, PASSIVE, GESTURES, ECHOES, RHYTHM];
- it('registers all eight as manuscript style checks of the right kind', () => {
+ it('registers all deterministic prose-tic checks as manuscript style checks of the right kind', () => {
for (const id of DETERMINISTIC) {
const c = getCheck(id);
expect(c.kind, id).toBe('deterministic');
@@ -4635,6 +4636,23 @@ describe('copy-edit prose-tic bundle (#1306)', () => {
expect(getCheck(FILTER).run({ sections, config: { densityPer1000: 6 }, severityDefault: 'low' })).toEqual([]);
});
+ it('prose.hedge-words flags hedge/weasel markers above the density threshold and anchors to the issue', () => {
+ // 4 hedge markers ("as if", "part of him", "almost", "no doubt") in ~13 words.
+ const sections = [{ number: 5, content: 'It was as if part of him almost knew, no doubt of it.' }];
+ const findings = getCheck(HEDGE).run({ sections, config: {}, severityDefault: 'low' });
+ expect(findings).toHaveLength(1);
+ expect(findings[0].issueNumber).toBe(5);
+ expect(findings[0].category).toBe('style');
+ expect(/hedge\/weasel/i.test(findings[0].problem)).toBe(true);
+ expect(findings[0].anchorQuote.toLowerCase()).toBe('as if');
+ });
+
+ it('prose.hedge-words stays silent below the density threshold', () => {
+ const filler = Array.from({ length: 200 }, (_, i) => `w${i}`).join(' ');
+ const sections = [{ number: 1, content: `It was as if true. ${filler}` }];
+ expect(getCheck(HEDGE).run({ sections, config: { densityPer1000: 7 }, severityDefault: 'low' })).toEqual([]);
+ });
+
it('prose.crutch-words excludes "that" unless includeThat is set', () => {
const sections = [{ number: 1, content: 'It was just really very that thing that he saw.' }];
const off = getCheck(CRUTCH).run({ sections, config: { densityPer1000: 0 }, severityDefault: 'low' });
diff --git a/server/lib/editorial/proseTics.js b/server/lib/editorial/proseTics.js
index 9b1940aa27..c5947c68e1 100644
--- a/server/lib/editorial/proseTics.js
+++ b/server/lib/editorial/proseTics.js
@@ -6,6 +6,7 @@
* Word-level scanners backing the deterministic "copy-edit" check group in
* checkRegistry.js:
* - findFilterWords() → `prose.filter-words` (distancing verbs)
+ * - findHedgeWords() → `prose.hedge-words` (hedge / weasel distance markers)
* - findCrutchWords() → `prose.crutch-words` (intensifiers / fillers)
* - findAdverbs() → `prose.adverbs` (-ly adverbs + dialogue-tag adverbs)
* - findPassiveVoice() → `prose.passive-voice` (be-verb + past-participle heuristic)
@@ -31,6 +32,35 @@ export const FILTER_WORDS = Object.freeze([
'saw', 'watched', 'noticed', 'realized', 'realised', 'felt', 'heard',
'seemed', 'looked', 'wondered', 'thought', 'knew', 'decided', 'sensed',
'observed', 'spotted', 'glimpsed', 'began to', 'started to',
+ // Modal-perception and reflexive constructions are the same distancing tic in
+ // phrase form ("she could see the door" → "the door stood open"; "he found
+ // himself running" → "he ran"). Matched as whole phrases (longest-first).
+ 'could see', 'could hear', 'could feel', 'could smell', 'could tell',
+ 'found himself', 'found herself', 'found themselves', 'found myself',
+]);
+
+// Hedge / weasel distance markers (#1621) — the SECOND distancing bucket that
+// `prose.filter-words` (perception verbs) misses. Three families of softeners
+// that quietly back the reader out of the moment:
+// - metaphorical distance — "it was as if he knew", "somewhere deep inside",
+// "almost felt", "part of him";
+// - dialogue / cognitive hedges — "I kind of think", "sort of felt",
+// "more or less", "I suppose";
+// - cognitive weasel words — "surely", "no doubt", "obviously", "of course".
+// Density-scaled like the other word lists and user-extendable (extraWords) /
+// mutable (allowWords). Multi-word entries match as whole phrases with flexible
+// internal whitespace, longest-first (so "as if" wins over a bare "if").
+export const HEDGE_WORDS = Object.freeze([
+ // Metaphorical distance — narration that gestures AT a feeling from arm's length.
+ 'as if', 'as though', 'almost', 'somehow', 'somewhat', 'deep inside',
+ 'deep down', 'somewhere inside', 'somewhere deep', 'part of him',
+ 'part of her', 'part of them', 'something inside', 'in a way', 'in some way',
+ // Dialogue / cognitive hedges — the speaker (or narrator) softens the claim.
+ 'kind of', 'sort of', 'more or less', 'i guess', 'i suppose', 'i think',
+ 'i feel like', 'maybe', 'perhaps', 'possibly', 'probably',
+ // Cognitive weasel words — assert certainty in place of earning it on the page.
+ 'surely', 'no doubt', 'obviously', 'clearly', 'of course', 'naturally',
+ 'undoubtedly', 'evidently', 'presumably', 'needless to say', 'arguably',
]);
// Crutch / filler words — intensifiers and hedges that almost always delete
@@ -245,6 +275,18 @@ export function findFilterWords(text, opts = {}) {
return scanList(text, FILTER_WORDS, opts);
}
+/**
+ * Hedge / weasel distance-marker occurrences (#1621). One entry per match. Shares
+ * the same allow/extra plumbing as the other word lists, so a series can mute a
+ * noisy default ("almost") or add house-style hedges.
+ * @param {string} text
+ * @param {{ allowWords?: string[], extraWords?: string[] }} [opts]
+ * @returns {Array<{ entry: string, index: number, anchor: string }>}
+ */
+export function findHedgeWords(text, opts = {}) {
+ return scanList(text, HEDGE_WORDS, opts);
+}
+
/**
* Crutch/filler-word occurrences. Bare "that" is included only when
* `opts.includeThat` is true (off by default — grammatical "that" is noisy).
diff --git a/server/lib/editorial/proseTics.test.js b/server/lib/editorial/proseTics.test.js
index 73624d3060..b396173fdf 100644
--- a/server/lib/editorial/proseTics.test.js
+++ b/server/lib/editorial/proseTics.test.js
@@ -3,12 +3,14 @@ import {
tokenizeWords,
splitSentences,
findFilterWords,
+ findHedgeWords,
findCrutchWords,
findAdverbs,
findPassiveVoice,
filterPassiveVoice,
findGestures,
FILTER_WORDS,
+ HEDGE_WORDS,
CRUTCH_WORDS,
} from './proseTics.js';
@@ -63,12 +65,51 @@ describe('findFilterWords', () => {
expect(findFilterWords('The sawmill was loud.')).toEqual([]);
});
+ it('flags modal-perception phrase additions ("could see", "found himself")', () => {
+ const entries = findFilterWords('She could see the door; he found himself running.').map((h) => h.entry);
+ expect(entries).toContain('could see');
+ expect(entries).toContain('found himself');
+ });
+
it('seed list is frozen and lowercase', () => {
expect(Object.isFrozen(FILTER_WORDS)).toBe(true);
for (const w of FILTER_WORDS) expect(w).toBe(w.toLowerCase());
});
});
+describe('findHedgeWords', () => {
+ it('flags metaphorical-distance, hedge, and weasel markers', () => {
+ const entries = findHedgeWords(
+ 'It was as if he knew. Part of him almost felt it. I kind of think so, no doubt.',
+ ).map((h) => h.entry);
+ expect(entries).toContain('as if');
+ expect(entries).toContain('part of him');
+ expect(entries).toContain('almost');
+ expect(entries).toContain('kind of');
+ expect(entries).toContain('no doubt');
+ });
+
+ it('matches multi-word phrases whole, longest-first ("as if" not bare "if")', () => {
+ const hits = findHedgeWords('She moved as if weightless.');
+ expect(hits.map((h) => h.anchor.toLowerCase())).toContain('as if');
+ });
+
+ it('respects allowWords and extraWords', () => {
+ expect(findHedgeWords('Almost there.', { allowWords: ['almost'] })).toEqual([]);
+ const extra = findHedgeWords('It was basically fine.', { extraWords: ['basically'] });
+ expect(extra.map((h) => h.entry)).toContain('basically');
+ });
+
+ it('does not match substrings (almsot/almost boundary)', () => {
+ expect(findHedgeWords('The almshouse stood empty.')).toEqual([]);
+ });
+
+ it('seed list is frozen and lowercase', () => {
+ expect(Object.isFrozen(HEDGE_WORDS)).toBe(true);
+ for (const w of HEDGE_WORDS) expect(w).toBe(w.toLowerCase());
+ });
+});
+
describe('findCrutchWords', () => {
it('flags intensifiers but excludes bare "that" by default', () => {
const hits = findCrutchWords('It was just really very that thing.');