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,claude): gate runs on enable-save, block disabled checks from targeted runs

[._.]/ Adam Eivyfbeea22953a2
diff --git a/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsx b/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsx
new file mode 100644
index 0000000000..0541019b45
--- /dev/null
+++ b/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsx
@@ -0,0 +1,32 @@
+import { describe, it, expect } from 'vitest';
+import { render, screen } from '@testing-library/react';
+import { MemoryRouter } from 'react-router-dom';
+import EditorialFindingsTriage from './EditorialFindingsTriage';
+import { findingManuscriptLink } from '../../../lib/editorialChecks';
+
+const checksById = {
+ 'naming.dissimilar-names': { label: 'Character name dissimilarity', scope: 'series', kind: 'deterministic' },
+};
+
+const renderTriage = (props) => render(
+ <MemoryRouter><EditorialFindingsTriage seriesId="ser-1" checksById={checksById} {...props} /></MemoryRouter>,
+);
+
+describe('EditorialFindingsTriage', () => {
+ it('shows the empty state when there are no check-sourced findings', () => {
+ renderTriage({ comments: [{ id: 'x', problem: 'no checkId', status: 'open' }] });
+ expect(screen.getByText(/No editorial-check findings yet/i)).toBeTruthy();
+ });
+
+ it('groups findings by check with an open/total header and deep-links each finding', () => {
+ const comments = [
+ { id: 'c1', checkId: 'naming.dissimilar-names', status: 'open', severity: 'high', issueNumber: 5, problem: 'Confusable names: Alice / Adam' },
+ { id: 'c2', checkId: 'naming.dissimilar-names', status: 'dismissed', severity: 'low', issueNumber: null, problem: 'Old finding' },
+ ];
+ renderTriage({ comments });
+ expect(screen.getByText('Character name dissimilarity')).toBeTruthy();
+ expect(screen.getByText(/1 open · 2 total/)).toBeTruthy();
+ const link = screen.getByText('Confusable names: Alice / Adam').closest('a');
+ expect(link.getAttribute('href')).toBe(findingManuscriptLink('ser-1', comments[0]));
+ });
+});
diff --git a/client/src/pages/PipelineEditorialChecks.jsx b/client/src/pages/PipelineEditorialChecks.jsx
index 6eacfab20e..3080c57297 100644
--- a/client/src/pages/PipelineEditorialChecks.jsx
+++ b/client/src/pages/PipelineEditorialChecks.jsx
@@ -135,9 +135,17 @@ export default function PipelineEditorialChecks() {
const handleToggle = useCallback((checkId, nextEnabled) => {
const apply = (val) => setChecks((rows) => rows.map((r) => (r.id === checkId ? { ...r, enabled: val } : r)));
apply(nextEnabled);
+ // Drop a now-disabled check from the targeted-run selection so "Run selected"
+ // can't carry an id the server will silently filter out.
+ if (!nextEnabled) setSelectedIds((s) => { if (!s.has(checkId)) return s; const n = new Set(s); n.delete(checkId); return n; });
+ // Track in savingIds like config saves — the run endpoint reads persisted
+ // settings, so the run buttons must gate on this PATCH landing (and the card
+ // shows its saving spinner for the toggle too).
+ setSavingIds((s) => new Set(s).add(checkId));
patchEditorialCheck(checkId, { enabled: nextEnabled }, { silent: true })
.then((row) => { if (row) setChecks((rows) => rows.map((r) => (r.id === checkId ? row : r))); })
- .catch((err) => { apply(!nextEnabled); toast.error(err.message || 'Failed to update check'); });
+ .catch((err) => { apply(!nextEnabled); toast.error(err.message || 'Failed to update check'); })
+ .finally(() => setSavingIds((s) => { const n = new Set(s); n.delete(checkId); return n; }));
}, []);
const handleConfigSave = useCallback((checkId, nextConfig) => {
@@ -157,8 +165,18 @@ export default function PipelineEditorialChecks() {
// ---- Run / cancel. ----
const runChecks = (subsetIds = null) => {
if (!seriesId) { toast.error('Pick a series to run checks against'); return; }
+ // The server runs only ENABLED checks even from a named subset, so drop any
+ // disabled ids up front — otherwise a selection of disabled checks completes
+ // as a silent no-op the user reads as "0 findings".
+ let ids = subsetIds;
+ if (ids) {
+ const enabledIds = ids.filter((id) => checksById[id]?.enabled);
+ if (!enabledIds.length) { toast.error('Those checks are disabled — enable them or pick others'); return; }
+ if (enabledIds.length < ids.length) toast('Skipped disabled checks from your selection');
+ ids = enabledIds;
+ }
setRunStarting(true);
- startEditorialChecksRun(seriesId, subsetIds ? { checkIds: subsetIds } : {}, { silent: true })
+ startEditorialChecksRun(seriesId, ids ? { checkIds: ids } : {}, { silent: true })
.then((res) => {
if (res?.alreadyRunning) toast('A run is already in progress for this series');
setRunActive(true);
@@ -264,9 +282,11 @@ export default function PipelineEditorialChecks() {
type="checkbox"
id={`sel-${check.id}`}
checked={selectedIds.has(check.id)}
+ disabled={!check.enabled}
onChange={() => toggleSelected(check.id)}
+ title={check.enabled ? 'Select for a targeted run' : 'Enable this check to include it in a run'}
aria-label={`Select ${check.label} for a targeted run`}
- className="mt-3.5 shrink-0 accent-port-accent"
+ className="mt-3.5 shrink-0 accent-port-accent disabled:opacity-40"
/>
<div className="min-w-0 flex-1">
<EditorialCheckCard
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.js
index b87d905b97..97bbcd0b6c 100644
--- a/server/lib/editorial/checkRegistry.js
+++ b/server/lib/editorial/checkRegistry.js
@@ -31,7 +31,10 @@ const SEVERITIES = Object.freeze(['high', 'medium', 'low']);
// `configSchema` (a Zod schema) stays the validation authority on the server;
// `configFields` is the wire-safe *render* descriptor the Editorial Checks UI
// reads to build the per-check config form (the Zod schema can't cross the wire).
-export const CHECK_FIELD_TYPES = Object.freeze(['number', 'boolean', 'text', 'select']);
+// Keep this in lockstep with the controls EditorialCheckCard's ConfigField
+// renders — only advertise a type the UI can actually draw (no 'select' until
+// the <select> control + an `options` contract land).
+export const CHECK_FIELD_TYPES = Object.freeze(['number', 'boolean', 'text']);
// Stage name for the info-dumping LLM check. The prompt ships in
// data.reference/prompts/stages/ and its config in stage-config.json; both
diff --git a/server/lib/editorial/checkRegistry.test.js b/server/lib/editorial/checkRegistry.test.js
index ed3560f8e6..b4879744b6 100644
--- a/server/lib/editorial/checkRegistry.test.js
+++ b/server/lib/editorial/checkRegistry.test.js
@@ -127,7 +127,7 @@ describe('editorial check registry — config + state resolution', () => {
for (const f of row.configFields) {
expect(f.key, `${row.id} field key`).toBeTruthy();
expect(f.label, `${row.id} field label`).toBeTruthy();
- expect(['number', 'boolean', 'text', 'select'], `${row.id} field type`).toContain(f.type);
+ expect(['number', 'boolean', 'text'], `${row.id} field type`).toContain(f.type);
}
}
});