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

feat: stream per-check editorial telemetry up the autopilot SSE (#1578)

[._.]/ Adam Eivy1d58052d5ad0
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index e1b7873584..34e93df941 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -57,6 +57,7 @@
- **[issue-1573] Series Autopilot now flags editorial checks that errored instead of reporting a silent "clean" run.** Each editorial check runs inside a boundary guard so one bad check (a malformed prompt, a provider timeout, a missing context) can't abort the whole pass — but a check that *threw* produced no findings, and the autopilot's per-pass broadcast always reported "0 blocking" and completed as if everything had run. A check that errored every run looked clean until someone inspected the raw per-check results. The editorial-checks round frame now carries an **errored count + the failing check ids**, and a run that finished with any errored check is qualified on the terminal summary and the persisted status banner (a caution, not "production-ready") so the partial failure is visible — the dimension that errored was never actually evaluated. The standalone "run editorial checks" panel surfaces the same errored aggregate on its completion frame. (`server/services/pipeline/seriesAutopilot.js`, `server/services/pipeline/editorial/checkRunner.js`, `server/services/pipeline/series.js`, `client/src/components/pipeline/AutopilotPanel.jsx`)
- **[issue-1574] Series Autopilot now retries a failed beats/text child run before giving up, instead of marking it attempted and silently skipping it.** When the autopilot delegates to a child runner (volume beats or per-issue text/scripts), the child can finish with its target stage still empty because the underlying LLM call failed. Previously the work was marked *attempted* before the result was inspected, so the resolver skipped it on the next pass — a failed beats run wasn't caught until a downstream stage tripped over the empty `idea`, and a failed text run only paused after the fact. The autopilot now **verifies the child actually produced its output** (every issue in the volume has a beat sheet / the issue's required script stages landed) and, on a miss, **retries the child once** (skip-existing, so the retry only fills the gap) before marking the work attempted. Each attempt is budget-gated and bills one action like any other step; if the output is still missing after the retry the run emits an escalation frame and **pauses for review with the missing stages as residual findings** rather than marching on toward a "done" with no script. A per-run **`maxChildRetries`** option tunes the retry budget (0 restores the legacy single-attempt behavior). (`server/services/pipeline/seriesAutopilot.js`)
- **[issue-1575] Series Autopilot can now run a subset of editorial checks for a single run, without touching the global enabled set.** The editorial-checks pass always ran *every* enabled check, so piloting one new check — or skipping an expensive one for a single run — meant toggling checks globally and remembering to flip them back. The autopilot start payload now accepts an optional **`editorialCheckIds`** array; when present, that run's editorial-checks pass evaluates only those check ids (unknown or disabled ids are ignored), and the same subset drives the budget gate so billing and execution agree on the set. Absent or empty falls back to the full enabled set (the unchanged default). The dry-run plan also names the subset (e.g. *"per-run subset of 2 editorial check(s)"*) instead of implying the whole enabled set will run. (`server/services/pipeline/seriesAutopilot.js`, `server/routes/pipeline/autopilot.js`)
+- **[issue-1578] Series Autopilot now streams per-check editorial progress, not just a single end-of-pass total.** The editorial-checks pass runs every enabled check across the manuscript and previously broadcast only one terminal frame — a total finding count with `0 blocking` — so during a long (issues × checks) pass the UI could show only "running" until the whole pass finished, with no signal about which check was executing or what it found. The autopilot now forwards the runner's **per-check `check:start` / `check:complete` frames** up its live progress stream, each carrying the check's label and a **high/medium/low severity breakdown** of that check's findings, so the panel shows real-time progress like *"Editorial check: Info dumping — 3 finding(s) (1H/2M/0L)"* as each check completes (errored and gated-skip checks are labeled distinctly). The same severity breakdown is now attached to each entry in the run's `perCheck` summary. (`server/services/pipeline/editorial/checkRunner.js`, `server/services/pipeline/seriesAutopilot.js`, `client/src/components/pipeline/AutopilotPanel.jsx`)
## Providers
diff --git a/client/src/components/pipeline/AutopilotPanel.jsx b/client/src/components/pipeline/AutopilotPanel.jsx
index 9362bc7842..6f18fc9901 100644
--- a/client/src/components/pipeline/AutopilotPanel.jsx
+++ b/client/src/components/pipeline/AutopilotPanel.jsx
@@ -98,6 +98,16 @@ function frameLabel(f) {
case 'step:complete': return `${stepLabel(f.kind)} done`;
case 'step:skip': return `Skipped ${stepLabel(f.kind)}${f.reason ? ` — ${f.reason}` : ''}`;
case 'verify:round': return `${f.scope} check — ${f.blocking} blocking of ${f.findings} finding(s)${f.errored > 0 ? ` · ⚠️ ${f.errored} errored` : ''}`;
+ // #1578 — per-check telemetry forwarded from the editorial-checks runner.
+ case 'check:start': return `Editorial check: ${f.label || f.checkId}…`;
+ case 'check:complete': {
+ const name = f.label || f.checkId;
+ if (f.error) return `Editorial check: ${name} — ⚠️ errored`;
+ if (f.skipped) return `Editorial check: ${name} — skipped`;
+ const s = f.bySeverity;
+ const sev = s && (s.high || s.medium || s.low) ? ` (${s.high}H/${s.medium}M/${s.low}L)` : '';
+ return `Editorial check: ${name} — ${f.count} finding(s)${sev}`;
+ }
case 'render:queued': return `Queued draft render: ${f.target}`;
case 'gap:filed': return `Filed CoS task (${f.gapKind})`;
case 'paused': return `Paused — ${f.reason}`;
diff --git a/client/src/components/pipeline/AutopilotPanel.test.jsx b/client/src/components/pipeline/AutopilotPanel.test.jsx
index be76e2761a..beea91935a 100644
--- a/client/src/components/pipeline/AutopilotPanel.test.jsx
+++ b/client/src/components/pipeline/AutopilotPanel.test.jsx
@@ -210,6 +210,15 @@ describe('AutopilotPanel', () => {
expect(screen.getByText(/Verifying arc/i)).toBeInTheDocument();
});
+ // #1578 — per-check editorial telemetry forwarded up the autopilot SSE stream
+ // renders as a live label with the severity breakdown, not the raw frame type.
+ it('renders a forwarded per-check editorial frame with its severity breakdown', async () => {
+ getPipelineAutopilotStatus.mockResolvedValue({ autopilot: { status: 'running' }, active: true });
+ sseLatest = { type: 'check:complete', scope: 'editorialChecks', checkId: 'prose.info-dumping', label: 'Info dumping', count: 3, bySeverity: { high: 1, medium: 2, low: 0 } };
+ renderPanel({ id: 's1', targetFormat: 'comic' });
+ expect(await screen.findByText(/Editorial check: Info dumping — 3 finding\(s\) \(1H\/2M\/0L\)/i)).toBeInTheDocument();
+ });
+
it('renders canon readiness gaps with a link to the issue Nouns page', async () => {
getPipelineSeriesCanonReadiness.mockResolvedValue({
ready: false,
diff --git a/server/services/pipeline/editorial/checkRunner.js b/server/services/pipeline/editorial/checkRunner.js
index a89090d360..40654e850d 100644
--- a/server/services/pipeline/editorial/checkRunner.js
+++ b/server/services/pipeline/editorial/checkRunner.js
@@ -32,6 +32,21 @@ import { recordTrendSnapshot } from '../editorialScore.js';
import { readReadinessGate } from '../../../lib/editorial/index.js';
import { canonicalStringify } from '../../../lib/objects.js';
+// Per-check severity breakdown for telemetry (#1578). Bucket a check's findings
+// by severity so the autopilot SSE stream can show a per-check high/medium/low
+// breakdown mid-run, not just a total count. Mirror manuscriptReview's
+// sanitizeComment normalization (unknown/absent → 'medium') so the live frame
+// agrees with how the findings ultimately score in the review.
+const SEVERITY_BUCKETS = Object.freeze(['high', 'medium', 'low']);
+function severityBreakdown(findings) {
+ const counts = { high: 0, medium: 0, low: 0 };
+ for (const f of Array.isArray(findings) ? findings : []) {
+ const sev = SEVERITY_BUCKETS.includes(f?.severity) ? f.severity : 'medium';
+ counts[sev] += 1;
+ }
+ return counts;
+}
+
// Source-content fingerprinting for finding staleness (#1345, #1387). Each finding
// is stamped with a hash of the exact content its check analyzed; the manuscript
// editor / triage view flags a finding `stale` once that content drifts.
@@ -513,7 +528,7 @@ export async function runEditorialChecks(seriesId, options = {}) {
try {
if (typeof check.gate === 'function' && !check.gate(ctx)) {
perCheck.push({ checkId: check.id, count: 0, skipped: true });
- onProgress?.({ type: 'check:complete', checkId: check.id, count: 0, skipped: true });
+ onProgress?.({ type: 'check:complete', checkId: check.id, label: check.label, count: 0, skipped: true });
continue;
}
const raw = (await check.run(ctx)) || [];
@@ -525,13 +540,14 @@ export async function runEditorialChecks(seriesId, options = {}) {
// for fresh-mode reconciliation. LLM checks stay merge-only (an absent
// finding could just be sampling noise).
if (check.kind === 'deterministic') deterministicRanIds.add(check.id);
- perCheck.push({ checkId: check.id, count: stamped.length });
- onProgress?.({ type: 'check:complete', checkId: check.id, count: stamped.length });
+ const bySeverity = severityBreakdown(stamped);
+ perCheck.push({ checkId: check.id, count: stamped.length, bySeverity });
+ onProgress?.({ type: 'check:complete', checkId: check.id, label: check.label, count: stamped.length, bySeverity });
} catch (err) {
const message = (err?.message || String(err)).slice(0, 500);
console.error(`❌ editorial check ${check.id} failed — series=${String(seriesId).slice(0, 12)} ${message}`);
perCheck.push({ checkId: check.id, error: message });
- onProgress?.({ type: 'check:complete', checkId: check.id, error: message });
+ onProgress?.({ type: 'check:complete', checkId: check.id, label: check.label, error: message });
}
// Re-check AFTER the (possibly long-running LLM) check so a cancellation
// during the final check is caught before the seed below — otherwise a
diff --git a/server/services/pipeline/editorial/checkRunner.test.js b/server/services/pipeline/editorial/checkRunner.test.js
index 4470149ced..b48f9dc4cb 100644
--- a/server/services/pipeline/editorial/checkRunner.test.js
+++ b/server/services/pipeline/editorial/checkRunner.test.js
@@ -145,6 +145,29 @@ describe('runEditorialChecks', () => {
expect(naming.count).toBeGreaterThan(0);
});
+ // #1578 — per-check telemetry: a severity breakdown on each completed check.
+ it('reports a per-check severity breakdown that sums to the count', async () => {
+ const result = await runEditorialChecks('s1');
+ const naming = result.perCheck.find((p) => p.checkId === 'naming.dissimilar-names');
+ expect(naming.bySeverity).toEqual(expect.objectContaining({ high: expect.any(Number), medium: expect.any(Number), low: expect.any(Number) }));
+ const { high, medium, low } = naming.bySeverity;
+ expect(high + medium + low).toBe(naming.count);
+ });
+
+ // #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 () => {
+ const frames = [];
+ await runEditorialChecks('s1', { onProgress: (e) => frames.push(e) });
+ const starts = frames.filter((f) => f.type === 'check:start');
+ const completes = frames.filter((f) => f.type === 'check:complete');
+ expect(starts.length).toBeGreaterThan(0);
+ expect(completes.length).toBe(starts.length);
+ const naming = completes.find((f) => f.checkId === 'naming.dissimilar-names');
+ expect(naming.label).toBeTruthy();
+ expect(naming.bySeverity).toEqual(expect.objectContaining({ high: expect.any(Number), medium: expect.any(Number), low: expect.any(Number) }));
+ });
+
it('re-running dedups findings (checkId-aware key)', async () => {
await runEditorialChecks('s1');
const afterFirst = seedStore.length;
diff --git a/server/services/pipeline/seriesAutopilot.js b/server/services/pipeline/seriesAutopilot.js
index b7921a0525..bf8b1c5ae4 100644
--- a/server/services/pipeline/seriesAutopilot.js
+++ b/server/services/pipeline/seriesAutopilot.js
@@ -1051,7 +1051,13 @@ async function runEditorialChecksPass(sId, record) {
// (the runner re-checks `signal.aborted` after each check). A live getter
// reflects `record.cancelRequested` without a separate controller to manage.
const signal = { get aborted() { return record.cancelRequested; } };
- const result = await runEditorialChecks(sId, { ...providerOverrideOpts(record), checkIds, settings, signal }).catch((err) => {
+ // #1578 — forward the runner's per-check check:start/check:complete frames up
+ // the autopilot SSE stream (tagged scope:'editorialChecks' so the UI groups
+ // them with the editorialChecks verify:round). Without this the only signal
+ // during a long (issues × checks) pass is the single terminal verify:round
+ // total — no per-check progress or severity breakdown.
+ const onProgress = (event) => broadcast(sId, { ...event, scope: 'editorialChecks' });
+ const result = await runEditorialChecks(sId, { ...providerOverrideOpts(record), checkIds, settings, signal, onProgress }).catch((err) => {
console.log(`⚠️ autopilot: editorial checks failed for ${sId.slice(0, 12)}: ${err.message}`);
return null;
});
diff --git a/server/services/pipeline/seriesAutopilot.test.js b/server/services/pipeline/seriesAutopilot.test.js
index 51aa824339..060a58d1e8 100644
--- a/server/services/pipeline/seriesAutopilot.test.js
+++ b/server/services/pipeline/seriesAutopilot.test.js
@@ -1443,6 +1443,19 @@ describe('autopilot conductor', () => {
);
});
+ // #1578 — the checks pass forwards the runner's per-check progress frames up
+ // the autopilot SSE stream, so it must hand runEditorialChecks an onProgress
+ // callback (without it the only signal during a long pass is the terminal total).
+ it('passes an onProgress forwarder to the editorial checks runner (#1578)', async () => {
+ const { seriesId } = await seedComplete();
+ await autopilot.startSeriesAutopilot(seriesId, { includeVisual: false });
+ await waitFor(runFinished(seriesId));
+ expect(checkRunnerSpies.runEditorialChecks).toHaveBeenCalledWith(
+ seriesId,
+ expect.objectContaining({ onProgress: expect.any(Function) }),
+ );
+ });
+
it('files a CoS gap task when a verify gate stalls (fileGaps)', async () => {
verifyFindings = [{ severity: 'high', problem: 'unresolved plot hole' }];
const { seriesId } = await seedComplete();