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
surface per-check maturity/quality signal in the editorial catalog (#1629)
[._.]/ Adam Eivy492bb4cd18bf
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 4c06589b01..0a04052bf7 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -57,6 +57,7 @@- **[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-1631] Findings that name canon entities now link straight to the universe's canon section.** A continuity or character finding ("Aria's eye colour drifts between issues") named a canon entity in plain prose with no way to jump to that entity's record — you'd manually cross-reference. When the selected series has a linked universe, each finding now carries a **Canon** chip row: every character, place, or object whose name appears in the finding's problem/location text becomes a one-click link into the universe's canon section, with the entity's descriptor shown as a hovercard (and a per-kind icon). Matching is whole-word and case-insensitive, prefers the longest name so "Jon Snow" wins over "Jon", and collapses repeated mentions to one chip. The chips render outside the finding's manuscript deep-link (no nested links) and appear on resolved findings too, so a continuity review can cross-reference in place. A series with no linked universe, or a finding that names no canon entity, shows no chips — existing behavior is unchanged. (`client/src/lib/editorialChecks.js`, `client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx`, `client/src/pages/PipelineEditorialChecks.jsx`)- **[issue-1630] Click a point on the editorial health-trend sparkline to drill into that revision — what was open then, and what changed since the prior run.** The score sparkline in the Editorial Health panel was read-only: you could watch the line dip after an edit pass but not see *why*. Every recorded revision is now a clickable point. Selecting one opens a drill-down showing that snapshot's score (with its delta vs the previous revision) and its open-finding breakdown by severity and category, plus a per-dimension diff against the prior revision — which severities, categories, and checks rose (regressed, in red) or fell (improved, in green), biggest change first. The first recorded revision says there's nothing to compare yet; a revision recorded before per-check tracking shipped omits the per-check diff rather than inventing an all-new baseline. (`client/src/components/pipeline/editorial/EditorialHealthPanel.jsx`, `client/src/lib/editorialHealth.js`, `server/services/pipeline/editorialScore.js`)+- **[issue-1629] Each editorial check now wears a maturity / quality badge in the catalog, so you can tell a trustworthy check from a noisy or untested one at a glance.** With a series selected, every check card gains a compact quality strip: how many findings the check has produced for that series, the share you dismissed, its false-positive rate, and a maturity badge — **untested** (no findings yet, trust unknown), **unproven** (too few findings to judge — under 5), **noisy** (a proven sample with a high false-positive rate, ≥40% — the signal you most want surfaced so you can deprioritize or mute it), or **reliable** (a proven sample you mostly keep). The numbers are derived purely from the findings you've already triaged (reusing the existing per-check grouping), so the catalog turns your dismissals into a trust signal without any new data model. The strip is hidden when no series is selected, since findings are per-series and every check would otherwise read "untested". (`client/src/lib/editorialChecks.js`, `client/src/components/pipeline/editorial/EditorialCheckCard.jsx`, `client/src/pages/PipelineEditorialChecks.jsx`)- **[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/EditorialCheckCard.jsx b/client/src/components/pipeline/editorial/EditorialCheckCard.jsxindex 74f1e2eb8f..6be3a3803f 100644--- a/client/src/components/pipeline/editorial/EditorialCheckCard.jsx+++ b/client/src/components/pipeline/editorial/EditorialCheckCard.jsx@@ -24,10 +24,61 @@ import { memo, useEffect, useState } from 'react';import { ChevronDown, ChevronRight, Loader2, Pencil, Sliders, Trash2 } from 'lucide-react';import ToggleSwitch from '../../ToggleSwitch';import CheckKindBadge from './CheckKindBadge';-import { SEVERITY_BADGE_CLASSES } from '../../../lib/editorialChecks';+import { SEVERITY_BADGE_CLASSES, checkMaturity, CHECK_NOISY_FP_RATE } from '../../../lib/editorialChecks';const SEVERITY_LEVELS = ['high', 'medium', 'low'];+// Maturity badge styling (#1629) — the trust signal for a check, derived from its+// findings group. `new`/`unproven` are muted (don't trust the rate yet); `noisy`+// borrows the warning token (deprioritize/mute it); `reliable` the success token.+const MATURITY_BADGE = {+ new: { label: 'untested', className: 'border-port-border text-gray-500', title: 'No findings yet — trust unknown' },+ unproven: { label: 'unproven', className: 'border-gray-500/40 text-gray-400', title: 'Too few findings to judge signal quality yet' },+ noisy: { label: 'noisy', className: 'border-port-warning/40 text-port-warning', title: 'High false-positive rate — consider deprioritizing or muting' },+ reliable: { label: 'reliable', className: 'border-port-success/40 text-port-success', title: 'Proven sample the user mostly keeps' },+};++const pct = (rate) => `${Math.round((rate || 0) * 100)}%`;++// Compact per-check quality strip (#1629): findings count, dismissal rate, and+// false-positive rate plus a maturity badge, so a user can tell a high-signal+// check from a brand-new/noisy one without leaving the catalog. `stats` is the+// findings group for this check (per the selected series) or null when none.+function CheckMaturityStrip({ stats }) {+ const { findings, dismissalRate, falsePositiveRate, level } = checkMaturity(stats);+ const badge = MATURITY_BADGE[level] || MATURITY_BADGE.new;+ return (+ <div className="flex flex-wrap items-center gap-x-2 gap-y-1 border-t border-port-border/60 pt-2 text-[10px] text-gray-500">+ <span+ className={`inline-flex items-center rounded border px-1.5 py-0.5 uppercase tracking-wide ${badge.className}`}+ title={badge.title}+ >+ {badge.label}+ </span>+ {findings > 0 ? (+ <>+ <span title="Findings this check has produced for the selected series">+ {findings} finding{findings === 1 ? '' : 's'}+ </span>+ <span aria-hidden="true">·</span>+ <span title="Share of this check's findings the user dismissed">+ {pct(dismissalRate)} dismissed+ </span>+ <span aria-hidden="true">·</span>+ <span+ className={(falsePositiveRate || 0) >= CHECK_NOISY_FP_RATE ? 'text-port-warning' : undefined}+ title="Share of this check's findings flagged false-positive"+ >+ {pct(falsePositiveRate)} FP+ </span>+ </>+ ) : (+ <span>No findings yet for this series</span>+ )}+ </div>+ );+}+function ConfigField({ checkId, field, value, disabled, onCommit, resetNonce = 0 }) {const inputId = `cfg-${checkId}-${field.key}`;const [draft, setDraft] = useState(value);@@ -88,7 +139,7 @@ function ConfigField({ checkId, field, value, disabled, onCommit, resetNonce = 0function EditorialCheckCard({check, saving = false, onToggle, onConfigSave, onSeveritySave, onEdit, onDelete,seriesId = '', seriesConfig = null, seriesSaving = false, seriesResetNonce = 0, onSeriesConfigSave,- idScope = '',+ stats = null, idScope = '',}) {const [expanded, setExpanded] = useState(false);// Base for this card's DOM ids. A dual-scope check (#1628) is fanned into more@@ -143,6 +194,11 @@ function EditorialCheckCard({</div></div>+ {/* Per-check maturity / quality signal (#1629). Only meaningful with a+ series selected — findings are per-series, so without one every check+ would falsely read "untested". */}+ {seriesId ? <CheckMaturityStrip stats={stats} /> : null}+{canSetSeverity ? (<div className="flex items-center gap-2"><label htmlFor={`sev-${domBase}`} className="text-[11px] text-gray-400">Severity</label>diff --git a/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsx b/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsxindex 6904180db6..b5b154c886 100644--- a/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsx+++ b/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsx@@ -192,4 +192,34 @@ describe('EditorialCheckCard', () => {expect(onSeriesConfigSave).toHaveBeenCalledWith('naming.dissimilar-names', null);});});++ describe('per-check maturity / quality strip (#1629)', () => {+ it('hides the strip when no series is selected (findings are per-series)', () => {+ render(<EditorialCheckCard check={check} onToggle={vi.fn()} onConfigSave={vi.fn()} stats={{ total: 10, dismissed: 5, falsePositive: 5 }} />);+ expect(screen.queryByText(/finding/i)).toBeNull();+ expect(screen.queryByText(/untested|reliable|noisy|unproven/i)).toBeNull();+ });++ it('shows "untested" with a series but no findings for this check', () => {+ render(<EditorialCheckCard check={check} onToggle={vi.fn()} onConfigSave={vi.fn()} seriesId="ser-1" stats={null} />);+ expect(screen.getByText(/untested/i)).toBeInTheDocument();+ expect(screen.getByText(/no findings yet for this series/i)).toBeInTheDocument();+ });++ it('surfaces findings count, dismissal rate, and FP rate with a noisy badge', () => {+ render(+ <EditorialCheckCard+ check={check}+ onToggle={vi.fn()}+ onConfigSave={vi.fn()}+ seriesId="ser-1"+ stats={{ total: 10, dismissed: 6, falsePositive: 5 }}+ />,+ );+ expect(screen.getByText(/noisy/i)).toBeInTheDocument();+ expect(screen.getByText(/10 findings/i)).toBeInTheDocument();+ expect(screen.getByText(/60% dismissed/i)).toBeInTheDocument();+ expect(screen.getByText(/50% FP/i)).toBeInTheDocument();+ });+ });});diff --git a/client/src/lib/editorialChecks.js b/client/src/lib/editorialChecks.jsindex 680c63f814..b2e8b2d20a 100644--- a/client/src/lib/editorialChecks.js+++ b/client/src/lib/editorialChecks.js@@ -170,6 +170,52 @@ export const checkFalsePositiveRate = (group) => {return group.total > 0 ? group.falsePositive / group.total : null;};+/**+ * Per-check dismissal rate (#1629): the fraction of a check's findings the user+ * dismissed for ANY reason (the false-positive subset plus plain dismissals).+ * `null` when the check has surfaced nothing yet, so callers can distinguish "no+ * data" from a genuine 0% — a high dismissal rate flags a low-signal check even+ * when the user didn't bother tagging each one a false positive.+ */+export const checkDismissalRate = (group) => {+ if (!group || !group.total) return null;+ return group.dismissed / group.total;+};++// A check needs at least this many findings before its rates are statistically+// meaningful; below it the card shows an "unproven" badge instead of a rate the+// user shouldn't yet trust (#1629).+export const CHECK_MATURITY_MIN_SAMPLE = 5;+// At or above this false-positive rate (on a proven sample) the check is "noisy"+// — the signal users most want surfaced so they can deprioritize/mute it.+export const CHECK_NOISY_FP_RATE = 0.4;++/**+ * Per-check maturity / quality signal (#1629) — the trust descriptor surfaced in+ * the catalog card so a user can tell a brand-new/unreliable check from a proven+ * high-signal one. Pure over a findings group from `groupFindingsByCheck`.+ * Returns:+ * findings total findings this check has produced (for the series)+ * dismissalRate dismissed / total, or null when no findings+ * falsePositiveRate false-positive / total, or null when no findings+ * level 'new' — no findings yet (untested, trust unknown)+ * 'unproven' — too few findings to judge (< MIN_SAMPLE)+ * 'noisy' — proven sample with a high false-positive rate+ * 'reliable' — proven sample the user mostly keeps+ */+export function checkMaturity(group) {+ const findings = group?.total || 0;+ if (!findings) {+ return { findings: 0, dismissalRate: null, falsePositiveRate: null, level: 'new' };+ }+ const falsePositiveRate = checkFalsePositiveRate(group);+ const dismissalRate = checkDismissalRate(group);+ let level = 'reliable';+ if (findings < CHECK_MATURITY_MIN_SAMPLE) level = 'unproven';+ else if ((falsePositiveRate || 0) >= CHECK_NOISY_FP_RATE) level = 'noisy';+ return { findings, dismissalRate, falsePositiveRate, level };+}+/*** Deep-link a finding into the manuscript editor: focuses the finding's issue* (when it has one) and opens its comment card via the `?comment=` param thediff --git a/client/src/lib/editorialChecks.test.js b/client/src/lib/editorialChecks.test.jsindex a4161eb340..329c68ca74 100644--- a/client/src/lib/editorialChecks.test.js+++ b/client/src/lib/editorialChecks.test.js@@ -3,6 +3,9 @@ import {groupChecksByScope,groupFindingsByCheck,checkFalsePositiveRate,+ checkDismissalRate,+ checkMaturity,+ CHECK_MATURITY_MIN_SAMPLE,openFindingsTotal,findingManuscriptLink,scopeLabel,@@ -148,6 +151,41 @@ describe('checkFalsePositiveRate', () => {});});+describe('checkDismissalRate (#1629)', () => {+ it('is dismissed/total over every dismissal, not just false positives', () => {+ expect(checkDismissalRate({ total: 4, dismissed: 3 })).toBe(0.75);+ });++ it('returns null (not 0) with no findings, so "no data" stays distinct from 0%', () => {+ expect(checkDismissalRate({ total: 0, dismissed: 0 })).toBeNull();+ expect(checkDismissalRate(null)).toBeNull();+ });+});++describe('checkMaturity (#1629)', () => {+ it('reports "new" with no findings and null rates', () => {+ expect(checkMaturity(null)).toEqual({ findings: 0, dismissalRate: null, falsePositiveRate: null, level: 'new' });+ expect(checkMaturity({ total: 0 }).level).toBe('new');+ });++ it('reports "unproven" below the minimum sample even with a high FP rate', () => {+ const m = checkMaturity({ total: CHECK_MATURITY_MIN_SAMPLE - 1, dismissed: 2, falsePositive: 2 });+ expect(m.level).toBe('unproven');+ expect(m.findings).toBe(CHECK_MATURITY_MIN_SAMPLE - 1);+ });++ it('reports "noisy" once a proven sample crosses the false-positive threshold', () => {+ const m = checkMaturity({ total: 10, dismissed: 6, falsePositive: 5 });+ expect(m.level).toBe('noisy');+ expect(m.falsePositiveRate).toBe(0.5);+ expect(m.dismissalRate).toBe(0.6);+ });++ it('reports "reliable" for a proven, mostly-kept check', () => {+ expect(checkMaturity({ total: 12, dismissed: 1, falsePositive: 0 }).level).toBe('reliable');+ });+});+describe('findingManuscriptLink', () => {it('targets the finding\'s issue and opens its comment when it has an issueNumber', () => {expect(findingManuscriptLink('ser-1', { id: 'c9', issueNumber: 5 }))diff --git a/client/src/pages/PipelineEditorialChecks.jsx b/client/src/pages/PipelineEditorialChecks.jsxindex e1feadf66c..014e68f1e5 100644--- a/client/src/pages/PipelineEditorialChecks.jsx+++ b/client/src/pages/PipelineEditorialChecks.jsx@@ -21,7 +21,7 @@ import EditorialFindingsTriage from '../components/pipeline/editorial/EditorialFimport EditorialHealthPanel from '../components/pipeline/editorial/EditorialHealthPanel';import ProviderModelSelector from '../components/ProviderModelSelector';import TabPills from '../components/ui/TabPills';-import { groupChecksByScope, normCategory, canonEntitiesFromUniverse } from '../lib/editorialChecks';+import { groupChecksByScope, groupFindingsByCheck, normCategory, canonEntitiesFromUniverse } from '../lib/editorialChecks';import { usePipelineProgress } from '../hooks/usePipelineProgress';import useProviderModels from '../hooks/useProviderModels';import {@@ -104,6 +104,15 @@ export default function PipelineEditorialChecks() {);const enabledCount = useMemo(() => checks.filter((c) => c.enabled).length, [checks]);const scopeGroups = useMemo(() => groupChecksByScope(checks), [checks]);+ // Per-check maturity / quality stats (#1629): group the loaded findings by+ // check so each catalog card can show its findings count, dismissal rate, and+ // false-positive rate. Keyed by checkId; a check with no findings is simply+ // absent (the card renders its "untested" state). Findings are per-series, so+ // this empties out — and the cards hide the strip — when no series is selected.+ const statsByCheck = useMemo(() => {+ const groups = groupFindingsByCheck(comments, checksById);+ return Object.fromEntries(groups.map((g) => [g.checkId, g]));+ }, [comments, checksById]);// The check/category values the health panel can deep-link to (#1606). The// panel's "Open by check/category" rows count OPEN findings, and the triage only// lists check-sourced findings (it drops null-checkId completeness/legacy ones).@@ -695,6 +704,7 @@ export default function PipelineEditorialChecks() {<EditorialCheckCardcheck={check}idScope={group.scope}+ stats={statsByCheck[check.id] || null}saving={savingIds.has(check.id)}onToggle={handleToggle}onConfigSave={handleConfigSave}