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): gate the maturity strip while findings load
[._.]/ Adam Eivy7fe97c286494
diff --git a/client/src/components/pipeline/editorial/EditorialCheckCard.jsx b/client/src/components/pipeline/editorial/EditorialCheckCard.jsxindex 6be3a3803f..bfe878f815 100644--- a/client/src/components/pipeline/editorial/EditorialCheckCard.jsx+++ b/client/src/components/pipeline/editorial/EditorialCheckCard.jsx@@ -44,7 +44,18 @@ const pct = (rate) => `${Math.round((rate || 0) * 100)}%`;// 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 }) {+// While `pending` (the series' findings are still loading) we render a neutral+// placeholder instead — `stats` would otherwise reflect the *previous* series'+// findings (or the initial empty array on a preselected series), making the+// badge claim stale counts or a misleading "untested".+function CheckMaturityStrip({ stats, pending = false }) {+ if (pending) {+ return (+ <div className="border-t border-port-border/60 pt-2 text-[10px] text-gray-600">+ Loading findings…+ </div>+ );+ }const { findings, dismissalRate, falsePositiveRate, level } = checkMaturity(stats);const badge = MATURITY_BADGE[level] || MATURITY_BADGE.new;return (@@ -139,7 +150,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,- stats = null, idScope = '',+ stats = null, statsPending = false, idScope = '',}) {const [expanded, setExpanded] = useState(false);// Base for this card's DOM ids. A dual-scope check (#1628) is fanned into more@@ -196,8 +207,10 @@ function EditorialCheckCard({{/* Per-check maturity / quality signal (#1629). Only meaningful with aseries selected — findings are per-series, so without one every check- would falsely read "untested". */}- {seriesId ? <CheckMaturityStrip stats={stats} /> : null}+ would falsely read "untested". While the series' findings are loading+ (`statsPending`), the strip shows a placeholder rather than the stale+ previous-series counts `stats` still holds. */}+ {seriesId ? <CheckMaturityStrip stats={stats} pending={statsPending} /> : null}{canSetSeverity ? (<div className="flex items-center gap-2">diff --git a/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsx b/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsxindex b5b154c886..caaf107e3c 100644--- a/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsx+++ b/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsx@@ -221,5 +221,23 @@ describe('EditorialCheckCard', () => {expect(screen.getByText(/60% dismissed/i)).toBeInTheDocument();expect(screen.getByText(/50% FP/i)).toBeInTheDocument();});++ it('shows a loading placeholder (not stale counts) while findings are pending', () => {+ // `stats` still holds the previous series' findings during the fetch; the+ // strip must not render those counts/badge — it shows a placeholder instead.+ render(+ <EditorialCheckCard+ check={check}+ onToggle={vi.fn()}+ onConfigSave={vi.fn()}+ seriesId="ser-2"+ statsPending+ stats={{ total: 10, dismissed: 6, falsePositive: 5 }}+ />,+ );+ expect(screen.getByText(/loading findings/i)).toBeInTheDocument();+ expect(screen.queryByText(/noisy/i)).toBeNull();+ expect(screen.queryByText(/10 findings/i)).toBeNull();+ });});});diff --git a/client/src/lib/README.md b/client/src/lib/README.mdindex 9008710e40..2b62a30c73 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; 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_FP_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/pages/PipelineEditorialChecks.jsx b/client/src/pages/PipelineEditorialChecks.jsxindex 014e68f1e5..bb0f8a9e88 100644--- a/client/src/pages/PipelineEditorialChecks.jsx+++ b/client/src/pages/PipelineEditorialChecks.jsx@@ -705,6 +705,7 @@ export default function PipelineEditorialChecks() {check={check}idScope={group.scope}stats={statsByCheck[check.id] || null}+ statsPending={loadingFindings}saving={savingIds.has(check.id)}onToggle={handleToggle}onConfigSave={handleConfigSave}