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

address review (codex P2): make a pinned severity authoritative (#1596)

[._.]/ Adam Eivy6da3509db6e9
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 88c790597a..0e8635f914 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -51,7 +51,7 @@
## Editorial checks
-- **[issue-1596] Override any editorial check's severity to match a series' house style — without touching code.** Every check ships a fixed default severity (e.g. `prose.adverb-density` defaults to `low`), but a literary-fiction series may want adverb density flagged `high` while an action series wants it `low`. Each check in the catalog now has a **Severity** selector: leave it on **Default** to use the registry value, or pin it to `high` / `medium` / `low`. The chosen level is what the runner stamps onto that check's findings (deterministic checks that *escalate* from their base — name-similarity, lettering density, representation balance — escalate from your override too), and it feeds the editorial-health score and any severity-based autopilot gating exactly like a built-in level. The override is backward-compatible and additive (absent → the check's `severityDefault`), and the catalog badge shows the effective level with a `*` marker when it's been overridden. (`server/lib/editorial/checkRegistry.js`, `server/routes/pipeline/editorial.js`, `server/services/pipeline/editorial/checkRunner.js`, `server/lib/validation.js`, `client/src/components/pipeline/editorial/EditorialCheckCard.jsx`, `client/src/pages/PipelineEditorialChecks.jsx`)
+- **[issue-1596] Override any editorial check's severity to match a series' house style — without touching code.** Every check ships a fixed default severity (e.g. `prose.adverb-density` defaults to `low`), but a literary-fiction series may want adverb density flagged `high` while an action series wants it `low`. Each check in the catalog now has a **Severity** selector: leave it on **Default** to use the registry value, or pin it to `high` / `medium` / `low`. A pin is **authoritative** — every finding that check raises is stamped with the chosen level, consistently across deterministic *and* LLM checks (a pin overrides both a check's escalation-from-default and an LLM's own per-finding severity, so "pin this check to low" actually means low everywhere). The pinned level feeds the editorial-health score and any severity-based autopilot gating exactly like a built-in level. Leaving a check on **Default** preserves its native per-finding nuance untouched. The override is backward-compatible and additive (absent → the check's `severityDefault`), and the catalog badge shows the effective level with a `*` marker when it's been overridden. (`server/lib/editorial/checkRegistry.js`, `server/routes/pipeline/editorial.js`, `server/services/pipeline/editorial/checkRunner.js`, `server/lib/validation.js`, `client/src/components/pipeline/editorial/EditorialCheckCard.jsx`, `client/src/pages/PipelineEditorialChecks.jsx`)
- **[issue-1593] The passive-voice check now ignores intentional passive — predicate-adjective states and weather/setting mood images — so it flags far fewer false positives.** `prose.passive-voice` is a cheap be-verb + past-participle heuristic, and the heuristic alone can't tell weak agentive passive ("the door was opened") from passive constructions writers use on purpose: a predicate-adjective state of being ("she was exhausted", "he was determined") isn't an action done to the subject at all, and a setting/weather mood image ("the sky was streaked with red", "the room was bathed in light") is deliberate atmosphere, not flabby prose. Both used to inflate the per-1000-word passive rate and push otherwise-clean sections over the threshold. A context-tuning pass now classifies each candidate `weak` / `stative` / `mood` and, by default, counts only genuine weak passive toward the density score — an explicit "by <agent>" ("she was exhausted *by the climb*") still always counts as weak. The cheap heuristic stays the base tier: a new **Suppress intentional passive** toggle (on by default) can be turned off per series to fall back to counting every be-verb + participle. (`server/lib/editorial/proseTics.js`, `server/lib/editorial/checkRegistry.js`)
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.js
index e3172c4c19..60458df10c 100644
--- a/server/lib/editorial/checkRegistry.js
+++ b/server/lib/editorial/checkRegistry.js
@@ -6326,17 +6326,21 @@ export function getEnabledCheckRows(settings, subsetIds = null) {
/**
* The checks that should actually run for a given settings + optional subset.
- * Returns `{ check, config, severity }` pairs (the live registry entry, its
- * resolved config, and its EFFECTIVE severity — the stored override or the
- * registry default, #1596) for every enabled check, narrowed to `subsetIds`
- * when provided. The runner stamps `severity` (not `check.severityDefault`)
- * onto findings, so a per-check override is honored at run time.
+ * Returns `{ check, config, severity, severityOverride }` pairs (the live
+ * registry entry, its resolved config, its EFFECTIVE severity, and the RAW
+ * per-check override — null when defaulting, #1596) for every enabled check,
+ * narrowed to `subsetIds` when provided. The runner uses `severity` as the
+ * base (`ctx.severityDefault`) and, when `severityOverride` is set, force-stamps
+ * it onto every finding so a pin is authoritative even for LLM / explicit-
+ * severity checks (not just escalation-from-default ones).
*/
export function getEnabledChecks(settings, subsetIds = null) {
// Resolve against built-ins + custom checks (getCheck only knows built-ins).
const byId = new Map(getAllChecks(settings).map((c) => [c.id, c]));
return getEnabledCheckRows(settings, subsetIds)
- .map((row) => ({ check: byId.get(row.id), config: row.config, severity: row.severity }))
+ .map((row) => ({
+ check: byId.get(row.id), config: row.config, severity: row.severity, severityOverride: row.severityOverride,
+ }))
.filter((x) => x.check);
}
@@ -6351,12 +6355,12 @@ export function getEnabledChecks(settings, subsetIds = null) {
*
* Pure + side-effect-free. Returns the input array unchanged when `seriesOverrides`
* is absent/non-object, so a series that tunes nothing pays no allocation. The
- * effective `severity` carried by each pair (#1596) is preserved verbatim — the
- * per-series override layer only tunes `config`, not severity.
+ * severity fields carried by each pair (`severity` / `severityOverride`, #1596)
+ * are preserved verbatim — the per-series override layer only tunes `config`.
*
- * @param {Array<{check: object, config: object, severity?: string}>} enabled pairs from getEnabledChecks
+ * @param {Array<{check: object, config: object, severity?: string, severityOverride?: string|null}>} enabled pairs from getEnabledChecks
* @param {Record<string, object>|null|undefined} seriesOverrides series.editorialCheckConfig
- * @returns {Array<{check: object, config: object, severity?: string}>}
+ * @returns {Array<{check: object, config: object, severity?: string, severityOverride?: string|null}>}
*/
export function applySeriesCheckConfig(enabled, seriesOverrides) {
if (!Array.isArray(enabled)) return [];
diff --git a/server/lib/editorial/checkRegistry.test.js b/server/lib/editorial/checkRegistry.test.js
index ad0e510ebb..b71ed17178 100644
--- a/server/lib/editorial/checkRegistry.test.js
+++ b/server/lib/editorial/checkRegistry.test.js
@@ -331,17 +331,22 @@ describe('per-check severity override (#1596)', () => {
expect(resolveCheckSeverity(check, undefined)).toBe(check.severityDefault);
});
- it('getEnabledChecks threads the effective severity for the runner', () => {
+ it('getEnabledChecks threads the effective severity AND the raw override for the runner', () => {
const target = flip(NAMING);
- expect(getEnabledChecks(checksSettings(NAMING, target), [NAMING])[0].severity).toBe(target);
- expect(getEnabledChecks({}, [NAMING])[0].severity).toBe(getCheck(NAMING).severityDefault);
+ const pinned = getEnabledChecks(checksSettings(NAMING, target), [NAMING])[0];
+ expect(pinned.severity).toBe(target); // effective → ctx.severityDefault base
+ expect(pinned.severityOverride).toBe(target); // raw → authoritative force-stamp
+ const unpinned = getEnabledChecks({}, [NAMING])[0];
+ expect(unpinned.severity).toBe(getCheck(NAMING).severityDefault);
+ expect(unpinned.severityOverride).toBeNull(); // no override → no force-stamp
});
- it('applySeriesCheckConfig preserves the effective severity through a config overlay', () => {
+ it('applySeriesCheckConfig preserves the severity fields through a config overlay', () => {
const target = flip(LETTERING);
const enabled = getEnabledChecks(checksSettings(LETTERING, target), [LETTERING]);
const out = applySeriesCheckConfig(enabled, { [LETTERING]: { maxWordsPerBalloon: 12 } });
- expect(out[0].severity).toBe(target); // severity rides through untouched
+ expect(out[0].severity).toBe(target); // effective severity rides through untouched
+ expect(out[0].severityOverride).toBe(target); // raw override preserved for force-stamp
expect(out[0].config.maxWordsPerBalloon).toBe(12); // config still overlaid
});
});
diff --git a/server/services/pipeline/editorial/checkRunner.js b/server/services/pipeline/editorial/checkRunner.js
index 60c42a79af..b1758cc86e 100644
--- a/server/services/pipeline/editorial/checkRunner.js
+++ b/server/services/pipeline/editorial/checkRunner.js
@@ -552,12 +552,13 @@ export async function runEditorialChecks(seriesId, options = {}) {
// must dismiss their now-stale prior open comments.
const deterministicRanIds = new Set();
let canceled = false;
- for (const { check, config, severity } of enabledResolved) {
+ for (const { check, config, severity, severityOverride } of enabledResolved) {
if (signal?.aborted) { canceled = true; break; }
onProgress?.({ type: 'check:start', checkId: check.id, label: check.label });
// `severity` is the effective per-check level (#1596): the user's stored
- // override or the registry default. Fall back to the registry default if a
- // pair somehow arrives without one (defensive for older getEnabledChecks).
+ // override or the registry default. It seeds `ctx.severityDefault` so checks
+ // that escalate FROM the default honor the override. Fall back to the
+ // registry default if a pair somehow arrives without one (defensive).
const ctx = { ...baseCtx, config, severityDefault: severity || check.severityDefault };
// Boundary try/catch: a check's run() calls into arbitrary logic / LLM
// providers — one bad check must not abort the whole pass (mirrors the
@@ -570,7 +571,18 @@ export async function runEditorialChecks(seriesId, options = {}) {
}
const raw = (await check.run(ctx)) || [];
const sourceContentHash = fingerprintForCheck(check, resolvedSources);
- const stamped = raw.map((f) => ({ ...f, checkId: check.id, sourceContentHash }));
+ // A pinned per-check severity (#1596) is AUTHORITATIVE: force every finding
+ // to the chosen level so the pin is consistent across all check kinds —
+ // including LLM checks (which emit their own per-finding severity) and
+ // explicit-severity deterministic checks (e.g. lettering's overflowSeverity),
+ // not just escalation-from-default ones. No override → keep the emitted
+ // severity untouched, preserving each check's native per-finding nuance.
+ const stamped = raw.map((f) => ({
+ ...f,
+ ...(severityOverride ? { severity: severityOverride } : {}),
+ checkId: check.id,
+ sourceContentHash,
+ }));
findings.push(...stamped);
// A deterministic check is a pure function of its sources, so a finding it
// no longer produces is genuinely resolved (not provider variance) — mark it
diff --git a/server/services/pipeline/editorial/checkRunner.test.js b/server/services/pipeline/editorial/checkRunner.test.js
index 82e930c973..5e8d23c176 100644
--- a/server/services/pipeline/editorial/checkRunner.test.js
+++ b/server/services/pipeline/editorial/checkRunner.test.js
@@ -154,6 +154,26 @@ describe('runEditorialChecks', () => {
expect(high + medium + low).toBe(naming.count);
});
+ // #1596 — a pinned per-check severity is AUTHORITATIVE: it force-stamps every
+ // finding from that check, overriding even an LLM-emitted per-finding level
+ // (the mocked info-dump LLM returns 'medium'; the pin forces 'high').
+ it('force-stamps a per-check severity override onto findings, overriding the LLM level', async () => {
+ const result = await runEditorialChecks('s1', {
+ checkIds: ['prose.info-dumping'],
+ settings: { pipelineEditorialChecks: { checks: { 'prose.info-dumping': { severity: 'high' } } } },
+ });
+ const infoDump = result.findings.filter((f) => f.checkId === 'prose.info-dumping');
+ expect(infoDump.length).toBeGreaterThan(0);
+ expect(infoDump.every((f) => f.severity === 'high')).toBe(true);
+ });
+
+ it('keeps the native per-finding severity when a check has no severity override', async () => {
+ const result = await runEditorialChecks('s1', { checkIds: ['prose.info-dumping'] });
+ const infoDump = result.findings.filter((f) => f.checkId === 'prose.info-dumping');
+ expect(infoDump.length).toBeGreaterThan(0);
+ expect(infoDump.every((f) => f.severity === 'medium')).toBe(true); // the LLM's own level
+ });
+
// #1578 — the runner emits check:start / check:complete progress frames so the
// autopilot SSE stream can show per-check progress mid-pass, not just a total.
it('emits check:start and check:complete progress frames with a severity breakdown', async () => {