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
address review (codex): key the maturity badge on dismissal rate, not just FP rate
[._.]/ Adam Eivy0ae0678f394a
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 0a04052bf7..de9ddc8170 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -57,7 +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-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 you dismiss most of the time, ≥40% — the signal you most want surfaced so you can deprioritize or mute it, whether or not you tagged each one a false positive), 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 bfe878f815..5c757ae070 100644--- a/client/src/components/pipeline/editorial/EditorialCheckCard.jsx+++ b/client/src/components/pipeline/editorial/EditorialCheckCard.jsx@@ -24,7 +24,7 @@ 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, checkMaturity, CHECK_NOISY_FP_RATE } from '../../../lib/editorialChecks';+import { SEVERITY_BADGE_CLASSES, checkMaturity, CHECK_NOISY_DISMISSAL_RATE } from '../../../lib/editorialChecks';const SEVERITY_LEVELS = ['high', 'medium', 'low'];@@ -34,7 +34,7 @@ const SEVERITY_LEVELS = ['high', 'medium', 'low'];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' },+ noisy: { label: 'noisy', className: 'border-port-warning/40 text-port-warning', title: 'You dismiss most of this check\'s findings — consider deprioritizing or muting' },reliable: { label: 'reliable', className: 'border-port-success/40 text-port-success', title: 'Proven sample the user mostly keeps' },};@@ -72,14 +72,14 @@ function CheckMaturityStrip({ stats, pending = false }) {{findings} finding{findings === 1 ? '' : 's'}</span><span aria-hidden="true">·</span>- <span title="Share of this check's findings the user dismissed">+ <span+ className={(dismissalRate || 0) >= CHECK_NOISY_DISMISSAL_RATE ? 'text-port-warning' : undefined}+ title="Share of this check's findings the user dismissed (drives the noisy badge)"+ >{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"- >+ <span title="Share of this check's findings flagged false-positive (a subset of dismissals)">{pct(falsePositiveRate)} FP</span></>diff --git a/client/src/lib/README.md b/client/src/lib/README.mdindex 2b62a30c73..70ff7e7dbe 100644--- a/client/src/lib/README.md+++ b/client/src/lib/README.md@@ -102,7 +102,7 @@ grep -i "what you want to do" client/src/lib/README.md| `colorMatch.js` | Pure grading core for the song system's color-match training mode: `buildColorMatchTimeline(score, { bpm })` → `{ notes, totalMs, msPerQuarter, bpm }` (each note's target frequency + onset/offset window in ms, keyed by the same global note index the renderer flattens, timing mirroring `scorePlayback`); `gradeNote(hz, targetHz)` classifies a sung pitch against a target into `in-tune`/`close`/`off`/`missed` (octave-folded, thresholds `MATCH_IN_TUNE_CENTS`/`MATCH_CLOSE_CENTS`); `noteAtTime(timeline, tMs, fromIdx)` finds the active note for a rAF cursor; `summarizeAccuracy(grades)` → `{ graded, counts, percentInTune, perNote }` per-take summary (`perNote` is the ordered grade list a saved take persists, mirroring the server sanitizer); `gradesFromPerNote(timeline, perNote)` is its inverse — rebuilds the noteIndex→grade map to repaint a saved take's grading on open without re-grading audio; plus `centsBetween` and the `GRADE` enum. No React, no audio — the `useColorMatch` hook drives it. || `pitchDetect.js` | Dependency-free vocal pitch-detection core for the song system (tuner / color-match / sing-to-score). `detectFrequency(frame, { sampleRate })` → `{ hz, clarity }` (McLeod NSDF; clarity gate rejects silence/noise); `frequencyToNote(hz, { a4 })` → `{ letter, accidental, octave, step, cents }` (cents ∈ [-50,+50], sharp positive; `step` reuses `scoreNotation`'s `diatonicStep` so detected notes align with the renderer); `noteToFrequency(note, { a4 })` inverse (color-match targets); `createPitchTracker(analyser, { onUpdate })` → `{ stop }` rAF/interval loop with median+EMA smoothing to kill octave jumps; `tuningQuality(cents)` → `{ level, label }` buckets a cents deviation into `in-tune`/`close`/`off`/`none` (thresholds `IN_TUNE_CENTS`/`CLOSE_CENTS`) for the tuner color readout. || `universeBuilderExpand.js` | `mergeExpandIntoDraft(draft, result)` — pure merge of a Universe Builder draft with the LLM expand-API response (lock honoring, category/sheet merge with `kind` precedence, canon dedupe by name/slugline/alias). Also exports `mergeVariations`, `mergeCanonByName`, and `extractPreservedFromDraft` for callers that need the building blocks (per-category Generate, save-time refetch+merge). |-| `editorialChecks.js` | Pure helpers for the Editorial Checks page (`/pipeline/editorial-checks`, #1285): `groupChecksByScope(checks)` buckets catalog rows into ordered Noun/Scene/Issue/Series sections; `groupFindingsByCheck(comments, rowsById)` groups check-sourced review comments per check with open/total + severity counts; `openFindingsTotal(groups)` sums open findings; `findingManuscriptLink(seriesId, comment)` builds the `?comment=` deep-link into the manuscript editor; the triage filter/sort helpers (#1600) `deriveFindingFacets(groups)` (enumerate present severities/statuses/scopes/checks/issues), `applyFindingsView(groups, filters, sort)` (filter + recount + sort findings and groups), `normalizeFindingSort`, `findingIssueKey`, and the `FINDING_SORT_OPTIONS` table; the per-check maturity/quality helpers (#1629) `checkDismissalRate(group)` and `checkMaturity(group)` (→ `{ findings, dismissalRate, falsePositiveRate, level }`, `level` ∈ new/unproven/noisy/reliable) plus the `CHECK_MATURITY_MIN_SAMPLE`/`CHECK_NOISY_FP_RATE` thresholds; plus `scopeLabel` and the `CHECK_SCOPE_ORDER`/`CHECK_SCOPE_LABELS` tables. No React/window — the page and its tests share them. |+| `editorialChecks.js` | Pure helpers for the Editorial Checks page (`/pipeline/editorial-checks`, #1285): `groupChecksByScope(checks)` buckets catalog rows into ordered Noun/Scene/Issue/Series sections; `groupFindingsByCheck(comments, rowsById)` groups check-sourced review comments per check with open/total + severity counts; `openFindingsTotal(groups)` sums open findings; `findingManuscriptLink(seriesId, comment)` builds the `?comment=` deep-link into the manuscript editor; the triage filter/sort helpers (#1600) `deriveFindingFacets(groups)` (enumerate present severities/statuses/scopes/checks/issues), `applyFindingsView(groups, filters, sort)` (filter + recount + sort findings and groups), `normalizeFindingSort`, `findingIssueKey`, and the `FINDING_SORT_OPTIONS` table; the per-check maturity/quality helpers (#1629) `checkDismissalRate(group)` and `checkMaturity(group)` (→ `{ findings, dismissalRate, falsePositiveRate, level }`, `level` ∈ new/unproven/noisy/reliable) plus the `CHECK_MATURITY_MIN_SAMPLE`/`CHECK_NOISY_DISMISSAL_RATE` thresholds; plus `scopeLabel` and the `CHECK_SCOPE_ORDER`/`CHECK_SCOPE_LABELS` tables. No React/window — the page and its tests share them. || `editorialHealth.js` | Pure presentation helpers for the editorial health panel (`/pipeline/editorial-checks`, #1316): `scoreBand(score)` bands a 0–100 health score into a label + Tailwind tone; `deltaDisplay(delta)` formats the revision-to-revision score change (arrow + tone); `sparklineGeometry(points, box)` projects the trend's score points into SVG polyline coords; `orderedCategories(openByCategory)` sorts the per-category open-finding breakdown; `orderedChecks(openByCheck, labelFor)` sorts the per-check breakdown resolving each id to its catalog label (#1597); `checkCountSeries(points, checkId)` extracts one check's count series across the trend points; `countSparklineGeometry(values, box)` projects a non-negative count series into SVG polyline coords normalized to its own max (per-check finding-count sparkline); `diffCountMaps(current, previous)` lists the buckets whose open-finding count changed between two snapshots (#1630); `snapshotDiff(point, previous)` builds a trend snapshot's drill-down (its own breakdown + per-severity/category/check diff vs the prior revision, null-aware for pre-#1597 per-check telemetry, #1630); plus the `SEVERITY_ORDER`/`SEVERITY_LABELS` and `READINESS_GATE_LABELS`/`READINESS_GATE_ORDER` tables. No React/window — the panel and its tests share them. || `lossSparkline.js` | `lossSparklineGeometry(series, box)` — projects an unbounded training-loss series (`{step,loss}[]`) into SVG polyline coords, normalized to its own min/max (unlike `editorialHealth.sparklineGeometry`'s fixed 0–100 axis). Returns `{ points, coords, last, min, max }`. Drives the Render Queue's training-row loss curve (#1408). No React. || `metronome.js` | Sample-accurate Web Audio metronome — the shared timing grid for the song system and first consumer of the song `tempo` field. `createMetronome({ bpm, beatsPerBar, countInBars, onBeat, onCountInComplete })` lookahead-schedules accented click tones on the shared `AudioContext` clock (same pattern as `songPlayback.js`), emits `{ beat, bar, accent, countIn, whenAudioTime }` per beat (the beat-clock callback color-match/sing-to-score subscribe to), and tears down all timers on `stop()`. Plus `clampBpm` (20–320), `secondsPerBeat`, `timeSignatureFromScore`, `beatDescriptor`. |diff --git a/client/src/lib/editorialChecks.js b/client/src/lib/editorialChecks.jsindex b2e8b2d20a..5c6a3bfefb 100644--- a/client/src/lib/editorialChecks.js+++ b/client/src/lib/editorialChecks.js@@ -186,9 +186,13 @@ export const checkDismissalRate = (group) => {// 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;+// At or above this *dismissal* rate (on a proven sample) the check is "noisy" —+// the signal users most want surfaced so they can deprioritize/mute it. Keyed on+// the overall dismissal rate, not just the false-positive subset: a check the+// user dismisses most of the time is low-signal whether or not they bothered to+// tag each one a broken-check false positive. Since false positives are a subset+// of dismissals, this strictly subsumes a high false-positive rate.+export const CHECK_NOISY_DISMISSAL_RATE = 0.4;/*** Per-check maturity / quality signal (#1629) — the trust descriptor surfaced in@@ -200,7 +204,7 @@ export const CHECK_NOISY_FP_RATE = 0.4;* 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+ * 'noisy' — proven sample the user dismisses a lot* 'reliable' — proven sample the user mostly keeps*/export function checkMaturity(group) {@@ -212,7 +216,7 @@ export function checkMaturity(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';+ else if ((dismissalRate || 0) >= CHECK_NOISY_DISMISSAL_RATE) level = 'noisy';return { findings, dismissalRate, falsePositiveRate, level };}diff --git a/client/src/lib/editorialChecks.test.js b/client/src/lib/editorialChecks.test.jsindex 329c68ca74..2990b4577e 100644--- a/client/src/lib/editorialChecks.test.js+++ b/client/src/lib/editorialChecks.test.js@@ -174,13 +174,22 @@ describe('checkMaturity (#1629)', () => {expect(m.findings).toBe(CHECK_MATURITY_MIN_SAMPLE - 1);});- it('reports "noisy" once a proven sample crosses the false-positive threshold', () => {+ it('reports "noisy" once a proven sample crosses the dismissal 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 "noisy" on a high dismissal rate even with zero false positives', () => {+ // The user dismisses most findings for reasons other than "broken check" —+ // still low-signal, so the badge must not stay "reliable".+ const m = checkMaturity({ total: 10, dismissed: 8, falsePositive: 0 });+ expect(m.level).toBe('noisy');+ expect(m.dismissalRate).toBe(0.8);+ expect(m.falsePositiveRate).toBe(0);+ });+it('reports "reliable" for a proven, mostly-kept check', () => {expect(checkMaturity({ total: 12, dismissed: 1, falsePositive: 0 }).level).toBe('reliable');});