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: expose adverb/passive word lists as series config (#1622)
[._.]/ Adam Eivyb9f4f66a137f
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 1bebd5750f..01478ddf77 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -23,6 +23,7 @@## Editorial checks+- **[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-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`)diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.jsindex 84089b9a89..94428eff91 100644--- a/server/lib/editorial/checkRegistry.js+++ b/server/lib/editorial/checkRegistry.js@@ -5560,12 +5560,14 @@ export const EDITORIAL_CHECKS = [densityPer1000: z.number().min(0).max(80).default(15),maxFindings: z.number().int().min(1).max(50).default(20),allowWords: z.string().default(''),+ extraWords: z.string().default(''),flagReportingTags: z.boolean().default(false),}),configFields: [{ key: 'densityPer1000', label: 'Adverb rate to flag (per 1000 words)', type: 'number', min: 0, max: 80, step: 1, help: 'Flag a section whose -ly adverb frequency per 1000 words is at or above this.' },{ 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: 'Adverbs to leave alone (comma-separated or one per line).' },+ { key: 'extraWords', label: 'Extra adverbs to flag', type: 'text', help: 'Series-specific adverbs the -ly heuristic misses, e.g. "fast", "well", "hard" (comma-separated or one per line).' },{ key: 'flagReportingTags', label: 'Also flag reporting tags', type: 'boolean', help: 'By default only emotion-telling dialogue tags ("said angrily") are flagged; reporting tags ("said quietly") are treated as invisible stage directions. Enable to flag every adverb-laden tag.' },],gate: (ctx) => (ctx.manuscript || '').trim().length > 0,@@ -5574,6 +5576,7 @@ export const EDITORIAL_CHECKS = [const max = cfg.maxFindings ?? 20;const density = cfg.densityPer1000 ?? 15;const allowWords = splitPhraseList(cfg.allowWords);+ const extraWords = splitPhraseList(cfg.extraWords);// Reporting tags ("said quietly") read as invisible stage directions, so by// default only the emotion-telling bucket ("said angrily") trips the// higher-severity tag signal (#1592). Opt back into the old flag-every-tag@@ -5586,7 +5589,7 @@ export const EDITORIAL_CHECKS = [const text = s?.content || '';const words = countWords(text);if (words === 0) continue;- const hits = findAdverbs(text, { allowWords });+ const hits = findAdverbs(text, { allowWords, extraWords });if (!hits.length) continue;const rate = Math.round((hits.length / words) * 1000 * 10) / 10;const tagHits = hits.filter((h) => h.dialogueTag && (flagReportingTags || h.tagAdverbKind === 'emotion'));@@ -5643,15 +5646,22 @@ export const EDITORIAL_CHECKS = [densityPer1000: z.number().min(0).max(50).default(10),maxFindings: z.number().int().min(1).max(50).default(20),suppressIntentional: z.boolean().default(true),+ allowWords: z.string().default(''),+ extraWords: z.string().default(''),}),configFields: [{ key: 'densityPer1000', label: 'Passive-voice rate to flag (per 1000 words)', type: 'number', min: 0, max: 50, step: 1, help: 'Flag a section whose passive-construction frequency per 1000 words is at or above this. Advisory — passive voice is sometimes the right choice.' },{ 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: 'suppressIntentional', label: 'Suppress intentional passive', type: 'boolean', help: 'On by default — skip predicate-adjective states ("she was exhausted") and setting/weather mood images ("the sky was streaked"), which are rarely weak passive. Turn off to count every be-verb + participle (the raw heuristic).' },+ { key: 'allowWords', label: 'House-style allowlist', type: 'text', help: 'Participles to never treat as passive — archaic/adjectival "-ed" forms like "blessed", "beloved" (comma-separated or one per line).' },+ { key: 'extraWords', label: 'Extra participles to flag', type: 'text', help: 'Series-specific irregular participles the heuristic misses, e.g. "begun", "hewn" (comma-separated or one per line).' },],gate: (ctx) => (ctx.manuscript || '').trim().length > 0,run: (ctx) => runDensityCheck(ctx, {- scan: (text, cfg) => filterPassiveVoice(findPassiveVoice(text), { suppressIntentional: cfg?.suppressIntentional !== false }),+ scan: (text, cfg) => filterPassiveVoice(+ findPassiveVoice(text, { allowWords: splitPhraseList(cfg?.allowWords), extraWords: splitPhraseList(cfg?.extraWords) }),+ { suppressIntentional: cfg?.suppressIntentional !== false },+ ),noun: 'passive constructions',problem: (count, rate, anchor) => `${count} passive construction${count === 1 ? '' : 's'} (e.g. "${anchor}") — about ${rate}/1000 words. Heavy passive voice distances the reader from who is acting.`,suggestion: 'Rephrase to active voice where it sharpens the prose ("the door was opened by Sam" → "Sam opened the door"). Keep passive where the actor is unknown or beside the point.',diff --git a/server/lib/editorial/checkRegistry.test.js b/server/lib/editorial/checkRegistry.test.jsindex 376dde5e3e..4824e48889 100644--- a/server/lib/editorial/checkRegistry.test.js+++ b/server/lib/editorial/checkRegistry.test.js@@ -4693,6 +4693,16 @@ describe('copy-edit prose-tic bundle (#1306)', () => {expect(/adverb-laden/i.test(tag.problem)).toBe(true);});+ it('prose.adverbs flags an extraWords adverb the -ly heuristic misses', () => {+ // "fast" is a real adverb without an -ly suffix; a series adds it via extraWords.+ const sections = [{ number: 4, content: 'He ran fast. She ran fast. They drove fast.' }];+ const off = getCheck(ADVERBS).run({ sections, config: { densityPer1000: 0 }, severityDefault: 'low' });+ expect(off).toEqual([]);+ const on = getCheck(ADVERBS).run({ sections, config: { densityPer1000: 0, extraWords: 'fast' }, severityDefault: 'low' });+ expect(on).toHaveLength(1);+ expect(on[0].anchorQuote.toLowerCase()).toBe('fast');+ });+it('prose.passive-voice flags above the rate threshold', () => {const sections = [{ number: 1, content: 'The door was opened. The vase was broken. It was forgotten.' }];const findings = getCheck(PASSIVE).run({ sections, config: { densityPer1000: 0 }, severityDefault: 'low' });@@ -4711,6 +4721,24 @@ describe('copy-edit prose-tic bundle (#1306)', () => {expect(/3 passive constructions/.test(raw[0].problem)).toBe(true);});+ it('prose.passive-voice mutes an allow-listed participle', () => {+ // "was blessed" trips the raw heuristic; allow-listing it silences the check.+ const sections = [{ number: 1, content: 'She was blessed. He was blessed. They were blessed.' }];+ const raw = getCheck(PASSIVE).run({ sections, config: { densityPer1000: 0, suppressIntentional: false }, severityDefault: 'low' });+ expect(raw).toHaveLength(1);+ const allowed = getCheck(PASSIVE).run({ sections, config: { densityPer1000: 0, suppressIntentional: false, allowWords: 'blessed' }, severityDefault: 'low' });+ expect(allowed).toEqual([]);+ });++ it('prose.passive-voice recognizes a series-specific irregular participle via extraWords', () => {+ const sections = [{ number: 1, content: 'The beam was hewn. The post was hewn. The plank was hewn by hand.' }];+ const off = getCheck(PASSIVE).run({ sections, config: { densityPer1000: 0, suppressIntentional: false }, severityDefault: 'low' });+ expect(off).toEqual([]);+ const on = getCheck(PASSIVE).run({ sections, config: { densityPer1000: 0, suppressIntentional: false, extraWords: 'hewn' }, severityDefault: 'low' });+ expect(on).toHaveLength(1);+ expect(/passive/i.test(on[0].problem)).toBe(true);+ });+it('prose.repeated-gestures tallies a gesture across the manuscript and flags body-part autonomy', () => {const sections = [{ number: 1, content: Array(5).fill('He nodded.').join(' ') + ' Her eyes followed him across the room.' },diff --git a/server/lib/editorial/proseTics.js b/server/lib/editorial/proseTics.jsindex c5947c68e1..5536b43ec1 100644--- a/server/lib/editorial/proseTics.js+++ b/server/lib/editorial/proseTics.js@@ -318,18 +318,21 @@ function isLyAdverb(lower) {* bucket on tags by default.** @param {string} text- * @param {{ allowWords?: string[] }} [opts] allowWords mutes specific adverbs.+ * @param {{ allowWords?: string[], extraWords?: string[] }} [opts] allowWords mutes+ * specific adverbs; extraWords flags series-specific words that the `-ly`+ * heuristic misses (irregular adverbs like "fast"/"well"/"hard").* @returns {Array<{ word: string, index: number, anchor: string, dialogueTag: boolean, tagAdverbKind: ('reporting'|'emotion'|null) }>}*/export function findAdverbs(text, opts = {}) {const tokens = tokenizeWords(text);if (!tokens.length) return [];const allow = new Set((Array.isArray(opts.allowWords) ? opts.allowWords : []).map(normalizeWord).filter(Boolean));+ const extra = new Set((Array.isArray(opts.extraWords) ? opts.extraWords : []).map(normalizeWord).filter(Boolean));const tagSet = new Set(DIALOGUE_TAGS);const out = [];for (let i = 0; i < tokens.length; i += 1) {const t = tokens[i];- if (!isLyAdverb(t.lower) || allow.has(t.lower)) continue;+ if ((!isLyAdverb(t.lower) && !extra.has(t.lower)) || allow.has(t.lower)) continue;const prev = i > 0 ? tokens[i - 1].lower : '';const dialogueTag = tagSet.has(prev);const tagAdverbKind = dialogueTag@@ -405,12 +408,21 @@ function hasSettingSubject(tokens, i) {* an intervening adverb, "decorated elaborately by Mira").** @param {string} text+ * @param {{ allowWords?: string[], extraWords?: string[] }} [opts] allowWords mutes+ * participles a series never wants flagged (archaic/house-style "-ed" forms read+ * as adjectives — "blessed", "beloved"); extraWords adds domain-specific irregular+ * participles the "-ed"/known-irregular heuristic misses ("begun", "hewn").* @returns {Array<{ index: number, anchor: string, be: string, participle: string, classification: ('weak'|'stative'|'mood'), byAgent: boolean }>}*/-export function findPassiveVoice(text) {+export function findPassiveVoice(text, opts = {}) {const tokens = tokenizeWords(text);if (!tokens.length) return [];const beSet = new Set(BE_VERBS);+ const allow = new Set((Array.isArray(opts.allowWords) ? opts.allowWords : []).map(normalizeWord).filter(Boolean));+ const extra = new Set((Array.isArray(opts.extraWords) ? opts.extraWords : []).map(normalizeWord).filter(Boolean));+ // A participle is recognized when the heuristic OR a series `extraWords` entry+ // matches, unless the series allow-listed it.+ const isParticiple = (lower) => (isPastParticiple(lower) || extra.has(lower)) && !allow.has(lower);const out = [];for (let i = 0; i < tokens.length; i += 1) {if (!beSet.has(tokens[i].lower)) continue;@@ -418,7 +430,7 @@ export function findPassiveVoice(text) {let j = i + 1;let skipped = 0;while (j < tokens.length && skipped < 2 && isLyAdverb(tokens[j].lower)) { j += 1; skipped += 1; }- if (j < tokens.length && isPastParticiple(tokens[j].lower) && !beSet.has(tokens[j].lower)) {+ if (j < tokens.length && isParticiple(tokens[j].lower) && !beSet.has(tokens[j].lower)) {const start = tokens[i].index;const end = tokens[j].index + tokens[j].word.length;const participle = tokens[j].lower;diff --git a/server/lib/editorial/proseTics.test.js b/server/lib/editorial/proseTics.test.jsindex b396173fdf..b4b6d6092f 100644--- a/server/lib/editorial/proseTics.test.js+++ b/server/lib/editorial/proseTics.test.js@@ -168,6 +168,18 @@ describe('findAdverbs', () => {const hits = findAdverbs('She ran quickly.', { allowWords: ['quickly'] });expect(hits).toEqual([]);});++ it('flags non-ly adverbs supplied via extraWords', () => {+ // "fast" is a real adverb the -ly heuristic misses; the series can add it.+ expect(findAdverbs('She ran fast.')).toEqual([]);+ const hits = findAdverbs('She ran fast.', { extraWords: ['fast'] });+ expect(hits.map((h) => h.word.toLowerCase())).toContain('fast');+ });++ it('allowWords still wins over an extraWords entry', () => {+ const hits = findAdverbs('She ran fast.', { extraWords: ['fast'], allowWords: ['fast'] });+ expect(hits).toEqual([]);+ });});describe('findPassiveVoice', () => {@@ -254,6 +266,24 @@ describe('findPassiveVoice', () => {expect(hit.byAgent).toBe(false);expect(hit.classification).toBe('stative');});++ it('mutes an allow-listed participle (archaic/adjectival -ed form)', () => {+ // "blessed" trips the bare -ed heuristic; a series can allow-list it.+ expect(findPassiveVoice('She was blessed.').map((h) => h.participle)).toContain('blessed');+ expect(findPassiveVoice('She was blessed.', { allowWords: ['blessed'] })).toEqual([]);+ });++ it('recognizes a series-specific irregular participle via extraWords', () => {+ // "hewn" is an irregular participle the -ed/known-irregular heuristic misses.+ expect(findPassiveVoice('The beam was hewn from oak.')).toEqual([]);+ const hits = findPassiveVoice('The beam was hewn from oak.', { extraWords: ['hewn'] });+ expect(hits.map((h) => h.participle)).toContain('hewn');+ });++ it('allowWords wins over extraWords for participle recognition', () => {+ const hits = findPassiveVoice('The beam was hewn.', { extraWords: ['hewn'], allowWords: ['hewn'] });+ expect(hits).toEqual([]);+ });});describe('filterPassiveVoice', () => {