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
feat: surface check kind + description in editorial findings triage (#1604)
[._.]/ Adam Eivy2bff6748f184
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 8b3f61642b..a9cefad53f 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -57,6 +57,8 @@## Editorial checks+- **[issue-1604] The findings triage now shows each check's kind and documented purpose, so you can tell a hard rule from an LLM judgement while triaging.** A finding listed its check's label and problem text but never the check's documented description — and custom checks were especially opaque, since you had to recall your own prompt to know what the check even looks for. Each check group header now carries a **rule / LLM** kind badge (the same badge the catalog card uses, now a shared `CheckKindBadge` component) plus an **info toggle** that expands the check's registry description inline — pulled from the catalog manifest the page already fetched, so it works even when the check is disabled. The toggle is only offered when the check actually ships a description; the kind badge always shows. Knowing whether a finding came from a deterministic heuristic or a model judgement makes false-positive triage faster. (`client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx`, `client/src/components/pipeline/editorial/CheckKindBadge.jsx`, `client/src/components/pipeline/editorial/EditorialCheckCard.jsx`, `client/src/lib/editorialChecks.js`)+- **[issue-1602] You can now mute a noisy check straight from the findings triage — no round-trip to the catalog.** When a check is generating false-positive spam, silencing it used to mean leaving the triage view, scrolling the catalog to find the check, toggling it off, and coming back. Each finding group now carries a **Disable** action: one click turns the check off (so it's skipped on future runs) and immediately hides its findings group, with an **undo** toast if you change your mind. It's only offered for currently-enabled checks (an already-disabled check has nothing to mute), and disabling never deletes existing findings — it's a sync-safe enabled-flag flip, so re-enabling (via undo, or from the catalog) brings the group back. A hidden group's findings also drop out of the bulk-action selection so nothing gets accepted/dismissed unseen, and the count line + empty-state copy reflect the muted groups. (`client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx`, `client/src/pages/PipelineEditorialChecks.jsx`)- **[issue-1601] Opening an editorial finding now scrolls the manuscript to the flagged passage and flashes it, instead of leaving you to hunt for the text.** A finding anchors to manuscript text by a verbatim quote, but opening it (from the findings triage deep-link, the sidebar index, a pin chip, or stepping prev/next through a triage pass) only ever scrolled the note *card* into view — the offending words themselves weren't called out, so on a long scene you still re-read paragraphs to find what the note was about. The editor now scrolls the anchored text to center and plays a brief tint **flash** over the exact words on open and on every prev/next step, in both view modes: **Review** mode reveals + flashes the highlighted span, and **Live** mode reveals + flashes the underlined text (and keeps it tinted while its card stays open). When the anchor quote isn't found verbatim in the current draft (the section was edited since the review), it falls back gracefully to the previous behavior of scrolling the note card into view — no jump, no flash. The scroll-and-flash is a small reusable hook (`useAnchorReveal`) and honors `prefers-reduced-motion`. (`client/src/hooks/useAnchorReveal.js`, `client/src/components/pipeline/manuscript/ManuscriptHighlightedProse.jsx`, `client/src/components/pipeline/manuscript/ManuscriptLiveSection.jsx`, `client/src/components/pipeline/manuscript/AnnotatedManuscriptSection.jsx`, `client/src/index.css`)diff --git a/client/src/components/pipeline/editorial/CheckKindBadge.jsx b/client/src/components/pipeline/editorial/CheckKindBadge.jsxnew file mode 100644index 0000000000..94dd461d92--- /dev/null+++ b/client/src/components/pipeline/editorial/CheckKindBadge.jsx@@ -0,0 +1,23 @@+/**+ * The catalog kind → human label + tone for an editorial check, shared by the+ * catalog card (EditorialCheckCard) and the findings-triage group header+ * (EditorialFindingsTriage, #1604) so "rule vs LLM" reads identically in both.+ * A deterministic/rule check is a hard heuristic; an LLM check is a model+ * judgement — surfacing the distinction helps the user triage false positives.+ */+import { memo } from 'react';++const KIND_BADGE = {+ deterministic: 'bg-sky-500/15 text-sky-300 border-sky-500/30',+ llm: 'bg-purple-500/15 text-purple-300 border-purple-500/30',+};++function CheckKindBadge({ kind, className = '' }) {+ return (+ <span className={`text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded border ${KIND_BADGE[kind] || KIND_BADGE.deterministic} ${className}`}>+ {kind === 'llm' ? 'LLM' : 'rule'}+ </span>+ );+}++export default memo(CheckKindBadge);diff --git a/client/src/components/pipeline/editorial/EditorialCheckCard.jsx b/client/src/components/pipeline/editorial/EditorialCheckCard.jsxindex d467ff4df1..f1ff5989b1 100644--- a/client/src/components/pipeline/editorial/EditorialCheckCard.jsx+++ b/client/src/components/pipeline/editorial/EditorialCheckCard.jsx@@ -19,11 +19,8 @@import { memo, useEffect, useState } from 'react';import { ChevronDown, ChevronRight, Loader2, Pencil, Sliders, Trash2 } from 'lucide-react';import ToggleSwitch from '../../ToggleSwitch';+import CheckKindBadge from './CheckKindBadge';-const KIND_BADGE = {- deterministic: 'bg-sky-500/15 text-sky-300 border-sky-500/30',- llm: 'bg-purple-500/15 text-purple-300 border-purple-500/30',-};const SEVERITY_BADGE = {high: 'bg-rose-500/15 text-rose-300',medium: 'bg-amber-500/15 text-amber-300',@@ -107,9 +104,7 @@ function EditorialCheckCard({<div className="min-w-0 space-y-1"><div className="flex flex-wrap items-center gap-1.5"><span className="text-sm font-medium text-gray-100">{check.label}</span>- <span className={`text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded border ${KIND_BADGE[check.kind] || KIND_BADGE.deterministic}`}>- {check.kind === 'llm' ? 'LLM' : 'rule'}- </span>+ <CheckKindBadge kind={check.kind} /><span className={`text-[10px] px-1.5 py-0.5 rounded ${SEVERITY_BADGE[check.severityDefault] || SEVERITY_BADGE.low}`}>{check.severityDefault}</span>diff --git a/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx b/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsxindex 6ea237c16a..87ed0a5f92 100644--- a/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx+++ b/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx@@ -15,8 +15,9 @@* bulk-dismisses the selection — each result reactively updates local state.*/import { Link, useSearchParams } from 'react-router-dom';-import { ChevronDown, ChevronRight, ExternalLink, History, Check, X, Loader2, GitCompareArrows, Search, Ban, Undo2 } from 'lucide-react';+import { ChevronDown, ChevronRight, ExternalLink, History, Check, X, Loader2, GitCompareArrows, Search, Ban, Undo2, Info } from 'lucide-react';import { useEffect, useMemo, useRef, useState } from 'react';+import CheckKindBadge from './CheckKindBadge';import {groupFindingsByCheck,findingManuscriptLink,@@ -241,6 +242,11 @@ function FindingRow({ seriesId, comment, onCommentChange, selected, onToggleSele// behind a collapsed header and make the filtered view look empty.function CheckGroup({ seriesId, group, onCommentChange, selectedIds, onToggleSelect, onSelectMany, forceOpen = false, canDisable = false, onDisableCheck }) {const [open, setOpen] = useState(group.open > 0);+ // The check's documented purpose/kind, surfaced inline so the user can tell a+ // hard rule from a heuristic while triaging (#1604). Collapsed by default to+ // keep the group header scannable; the registry only ships a description for+ // some checks, so the toggle is offered only when one exists.+ const [showInfo, setShowInfo] = useState(false);const expanded = forceOpen || open;const openIds = useMemo(() => group.comments.filter(isOpenFinding).map((c) => c.id),@@ -269,6 +275,7 @@ function CheckGroup({ seriesId, group, onCommentChange, selectedIds, onToggleSel<span className="flex items-center gap-1.5 min-w-0">{expanded ? <ChevronDown size={14} className="shrink-0" /> : <ChevronRight size={14} className="shrink-0" />}<span className="text-sm font-medium text-gray-100 truncate">{group.label}</span>+ {group.kind ? <CheckKindBadge kind={group.kind} className="shrink-0" /> : null}<span className="text-[10px] text-gray-500 shrink-0">{group.open} open · {group.total} total</span></span><span className="flex items-center gap-1.5 shrink-0">@@ -276,6 +283,23 @@ function CheckGroup({ seriesId, group, onCommentChange, selectedIds, onToggleSel<CountPills counts={group.counts} /></span></button>+ {group.description ? (+ // Reveal the check's documented purpose without leaving triage (#1604).+ <button+ type="button"+ onClick={() => setShowInfo((v) => !v)}+ aria-expanded={showInfo}+ aria-label={`${showInfo ? 'Hide' : 'Show'} description for ${group.label}`}+ title="Show what this check looks for"+ className={`inline-flex shrink-0 items-center rounded border px-1.5 py-0.5 text-[10px] ${+ showInfo+ ? 'border-port-accent/50 text-port-accent'+ : 'border-port-border text-gray-500 hover:border-port-accent/40 hover:text-gray-200'+ }`}+ >+ <Info size={11} />+ </button>+ ) : null}{canDisable && onDisableCheck ? (// Mute a noisy/false-positive check without leaving the triage view// (#1602): disables it (skipped on future runs) and hides its findings@@ -292,6 +316,11 @@ function CheckGroup({ seriesId, group, onCommentChange, selectedIds, onToggleSel</button>) : null}</div>+ {showInfo && group.description ? (+ <p className="border-t border-port-border/60 px-2.5 py-2 text-[11px] leading-relaxed text-gray-400">+ {group.description}+ </p>+ ) : null}{expanded ? (<ul className="divide-y divide-port-border/60 border-t border-port-border/60">{group.comments.map((c) => (diff --git a/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsx b/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsxindex 5e4968e402..8a42026c47 100644--- a/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsx+++ b/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsx@@ -17,7 +17,12 @@ vi.mock('../../../services/api', () => ({}));const checksById = {- 'naming.dissimilar-names': { label: 'Character name dissimilarity', scope: 'series', kind: 'deterministic' },+ 'naming.dissimilar-names': {+ label: 'Character name dissimilarity',+ scope: 'series',+ kind: 'deterministic',+ description: 'Flags character names that are too visually similar to tell apart.',+ },};const renderTriage = (props) => render(@@ -48,6 +53,30 @@ describe('EditorialFindingsTriage', () => {expect(link.getAttribute('href')).toBe(findingManuscriptLink('ser-1', comments[0]));});+ it('shows the check kind badge and toggles its description in the group header (#1604)', () => {+ const comments = [+ { id: 'c1', checkId: 'naming.dissimilar-names', status: 'open', severity: 'high', problem: 'Confusable names' },+ ];+ renderTriage({ comments });+ // Kind badge is always visible so the user can tell rule from LLM at a glance.+ expect(screen.getByText('rule')).toBeTruthy();+ // Description is collapsed until the info toggle is clicked.+ expect(screen.queryByText(/too visually similar/i)).toBeNull();+ fireEvent.click(screen.getByRole('button', { name: /show description for/i }));+ expect(screen.getByText(/too visually similar/i)).toBeTruthy();+ // Toggling again hides it.+ fireEvent.click(screen.getByRole('button', { name: /hide description for/i }));+ expect(screen.queryByText(/too visually similar/i)).toBeNull();+ });++ it('omits the description toggle when the check has no documented description (#1604)', () => {+ const comments = [+ { id: 'c1', checkId: 'unknown.check', status: 'open', severity: 'low', problem: 'Orphan finding' },+ ];+ renderTriage({ comments });+ expect(screen.queryByRole('button', { name: /show description for/i })).toBeNull();+ });+it('renders a stale badge (group + per-finding) when an open finding is stale (#1345)', () => {const comments = [{ id: 'c1', checkId: 'naming.dissimilar-names', status: 'open', severity: 'high', problem: 'Stale finding', stale: true },diff --git a/client/src/lib/editorialChecks.js b/client/src/lib/editorialChecks.jsindex a4ba37446e..d382836940 100644--- a/client/src/lib/editorialChecks.js+++ b/client/src/lib/editorialChecks.js@@ -44,12 +44,12 @@ const emptyCounts = () => ({ high: 0, medium: 0, low: 0 });* Group review comments that came from an editorial check into per-check* sections for the triage view. Only comments carrying a `checkId` are* included (completeness findings have none). Returns- * `[{ checkId, label, scope, kind, comments, open, total, counts, stale }]`+ * `[{ checkId, label, description, scope, kind, comments, open, total, counts, stale }]`* ordered by the catalog's scope order then label, with `counts` tallying the* OPEN comments by severity and `stale` counting the OPEN findings whose* analyzed content has drifted since the check ran (#1345). `rowsById` is a- * Map/object of catalog rows so each group can show its human label even when- * the check is currently disabled.+ * Map/object of catalog rows so each group can show its human label, kind, and+ * documented purpose (#1604) even when the check is currently disabled.*/export function groupFindingsByCheck(comments = [], rowsById = {}) {const lookup = rowsById instanceof Map ? rowsById : new Map(Object.entries(rowsById || {}));@@ -61,6 +61,7 @@ export function groupFindingsByCheck(comments = [], rowsById = {}) {groups.set(c.checkId, {checkId: c.checkId,label: row?.label || c.checkId,+ description: row?.description || null,scope: row?.scope || 'other',kind: row?.kind || null,comments: [],diff --git a/client/src/lib/editorialChecks.test.js b/client/src/lib/editorialChecks.test.jsindex 4d73fcdbc8..aec36b07b3 100644--- a/client/src/lib/editorialChecks.test.js+++ b/client/src/lib/editorialChecks.test.js@@ -33,7 +33,7 @@ describe('groupChecksByScope', () => {describe('groupFindingsByCheck', () => {const rows = {- 'a.series': { label: 'Series check', scope: 'series', kind: 'deterministic' },+ 'a.series': { label: 'Series check', scope: 'series', kind: 'deterministic', description: 'Checks the whole series.' },'b.issue': { label: 'Issue check', scope: 'issue', kind: 'llm' },};const comments = [@@ -54,9 +54,20 @@ describe('groupFindingsByCheck', () => {expect(series.counts).toEqual({ high: 1, medium: 0, low: 1 });});- it('falls back to the checkId as label when the check is unknown', () => {+ it('carries the catalog kind + description onto each group (#1604)', () => {+ const groups = groupFindingsByCheck(comments, rows);+ const series = groups.find((g) => g.checkId === 'a.series');+ const issue = groups.find((g) => g.checkId === 'b.issue');+ expect(series.kind).toBe('deterministic');+ expect(series.description).toBe('Checks the whole series.');+ // A row without a description falls back to null, not undefined/''.+ expect(issue.description).toBeNull();+ });++ it('falls back to the checkId as label and null description when the check is unknown', () => {const groups = groupFindingsByCheck([{ id: '9', checkId: 'gone.check', status: 'open', severity: 'low' }], {});expect(groups[0].label).toBe('gone.check');+ expect(groups[0].description).toBeNull();});it('accepts a Map of rows as well as a plain object', () => {