Repository navigation
Description
Epic: graph-2026-10-fundamentals Tier: mechanical Execution: sequant_run Blocked by: #1504, #1471
- Blocked by: feat(run): a dropped error leaves a trace — noteSuppressed() counts into the run log, batch-executor's 25 silent catches converted #1504
- Blocked by: refactor(logs): one run-log module — parseLogFile, listLogFiles, resolveLogDir, formatDuration defined once #1471
Problem
After F-03, 94 empty catch clauses remain across ~40 files (conventions-detector 6, state-hook 6, project-name 5, prompt 4, watch 4, …). Converting them and landing the lint in the same PR avoids a warn phase: one no-restricted-syntax rule holds one severity, and a second config block replaces the rule rather than extending it (D-B). no-empty cannot do this job because it treats a comment-only block as non-empty by design. The selector CatchClause > BlockStatement[body.length=0] was probed on 2026-10-18 and flags comment-only catches. sequant logs gains one line per run once #1471 has moved parseLogFile to run-logs.ts.
Acceptance Criteria
- AC-1: No empty catch remains. Evidence:
npx tsx scripts/qa/health-report.ts --json | jq '.emptyCatch.total'→0 - AC-2: Lint forbids them at
error. Evidence:grep -c 'CatchClause > BlockStatement\[body.length=0\]' eslint.config.js→≥ 1 - AC-3: Lint is green with the rule (constraint: green today, must stay green after AC-2). Evidence:
npm run lint > /dev/null 2>&1 && echo green→green - AC-4:
sequant logsprints the count. Evidence:npx vitest run src/commands/logs.test.ts -t "suppressed"→≥ 1 passed, 0 failed(new file, none exists today; a run-log fixture withsuppressed: {total: 3, byScope: {state: 2, progress: 1}}renders a line matchingSuppressed errors: 3 \(state 2, progress 1\); a log without the field renders no such line) - AC-4 is classified as a gate test by
isGateTestEvidence; the PR body carries itsSEQUANT_MUTATIONrecord (remove thesuppressedline from the renderer → the test fails; restore). - AC-5: The baseline moves down with the PR. Evidence:
jq '.emptyCatch.total' scripts/qa/health-baseline.json→0
Prior fixes / producers
Class tracked in #1504 (two prior fixes named there). This node is the mechanical remainder; the outcome AC (AC-1) covers every producer.
May touch
Every non-test file with an empty catch (list from health-report.ts --json | jq '.emptyCatch.byFile' at launch), eslint.config.js (one appended block, D-B), src/commands/logs.ts and src/commands/logs.test.ts (after #1471), scripts/qa/health-baseline.json (I-4), CHANGELOG entry.
Non-Goals
- Changing what any site does after the error.
- Files in refactor(logs): one run-log module — parseLogFile, listLogFiles, resolveLogDir, formatDuration defined once #1471/refactor(drivers,mcp): one killProcessGroup(child, { graceMs }) with SIGKILL escalation; pushLines on RingBuffer (closes the AsyncSubprocess trigger) #1472/refactor(workflow,locks): worktreeStatus tri-state replaces both isWorktreeDirty copies; one formatSignalLine #1475 scope other than
commands/logs.ts, which this node edits only after refactor(logs): one run-log module — parseLogFile, listLogFiles, resolveLogDir, formatDuration defined once #1471 has merged. - No edits under
plugin/,.claude/skills/,templates/skills/(I-1).
Done when
emptyCatch.total is 0, lint rejects a new empty catch, and sequant logs shows the per-run count.
Activity
admarble commentedon Oct 21, 2026
Runner context, 2026-10-21, before launch (fundamentals W3; stop-at-PR; mechanical tier). main = fc346aa (#1506 merged as #1576:
platforms/github.tschanged; it holds 4 of the empty catches).Count on main today:
emptyCatch.totalis 92 in 42 files, not 94. The baseline says 92. Take the list fromnpx tsx scripts/qa/health-report.ts --json | jq '.emptyCatch.byFile'.Lint scope. I probed the AC-2 selector over the lint surface. It flags 101 sites: the 92 that the health report counts, plus 9 in 6
scripts/files (mcp-launch.mjs3,analytics/ready-backtest.ts2, one each inanalytics/analyze-runs.ts,generate-constitution-dod.ts,probes/claude-cloud-probe.ts,spec/ground-check.ts). Tests are in the lint ignores, so they don't count. Apply the rule tosrc/**/*.tsandbin/**/*.tsonly, which is the set AC-1 measures. Leave the 9 script sites alone and name them in the PR body as out of scope.Flat config replaces the rule; it doesn't add to it (D-B). A later block that sets
no-restricted-syntaxreplaces every earlier selector for the files it matches. Two existing blocks set this rule: the globalrequire()ban and thephase-executor.tsconsole/stdout ban (#647). So:src/**+bin/**block must list therequire()selector again.phase-executor.tsblock.phase-executor.tsblock.Before you commit, prove each of these with a scratch edit and
npx eslint <file>, then revert:phase-executor.tserrors.console.loginphase-executor.tsstill errors.src/file errors.require()in asrc/file still errors.scripts/file does not error.Record the five results in the PR body.
Converting a site. Use
catch (err) { noteSuppressed("<scope>", err, "<context>"); }fromsrc/lib/workflow/suppressed.ts. Useotherwhen no scope fits. Don't change what happens after the error (Non-Goal). A comment-only body still fails the selector.suppressed.tsimports nothing, so importing it can't create a cycle. If a file must not depend onlib/workflow/(check the file's existing imports), use an explicit statement with a one-line reason instead, and list those sites in the PR body.AC-4.
src/commands/logs.test.tsdoesn't exist yet.parseLogFileis insrc/lib/run-logs.ts(#1471), and the run-log schema already hassuppressed(run-log-schema.ts:474). For the mutation record, remove the renderer line and confirm only the new test fails. Write the record with the file path first, in theSEQUANT_MUTATIONformat.For every phase, and the qa phase by name: run the full suite at most once, in the foreground, under
timeout, after a WIP commit. Each MCP-dispatched phase has a 30-minute wall, so commit at least every 10 minutes during exec. Prefer targetednpx vitest run <files>runs for the ACs.CHANGELOG: add
[Unreleased]lines under the existing headings, notchangelog.d/fragments, and never add a second heading of the same name.Lint: don't export what nothing imports (knip).
Health baseline: regenerate
scripts/qa/health-baseline.jsonwithnpx tsx scripts/qa/health-report.ts --write-baselineonly to record a metric that went down, hereemptyCatch.totalto 0 (AC-5). Ifnpm run lint:healthreports a rise in any other metric, restructure so it holds. If you can't, leave the baseline alone and name the rise in the PR body.PR body and commits: no
claude.ai/code/session_links anywhere (Gitleaks ruleclaude-session-url). The plain "Generated with Claude Code" line is fine.Freeze: nothing under
plugin/,.claude/skills/ortemplates/skills/.admarble commentedon Oct 21, 2026
Complexity: Standard (5 ACs, 4 directories)
AC Quality Check
Evidence:commands. Fine.grep -con the selector text passes with the rule only listed, at the wrong severity, or in a block thephase-executor.tsblock overrides (D-B). The runner comment's five scratch-edit proofs close that gap. Record them in the PR body.logs.test.tsfails today, so it gates. The-t "suppressed"filter needs the describe or test names to contain "suppressed".parseLogFileis insrc/lib/run-logs.ts, andsuppressedis insrc/lib/workflow/run-log-schema.ts:474.Scope Assessment
Non-Goals: Present in the issue (no behaviour change, no #1472/#1475 files, no
plugin/,.claude/skills/,templates/skills/).src/commands,src/lib/**,bin, config/scripts)Verdict:⚠️ SCOPE_WARNING. 92 mechanical sites in 42 files. The risk is breadth, not complexity.
Acceptance Criteria
AC-1: No empty catch remains
Verification: Integration Test (CLI).
health-report.ts --json | jq '.emptyCatch.total'→ 0 (92 today)Scenario: Given 92 sites in 42 files → When each is converted → Then total is 0.
Assumptions: The health counter and the lint selector agree on
src/**andbin/**. They do per the runner probe (101 − 9scripts/sites = 92).AC-2: Lint forbids them at
errorVerification: Integration Test.
grep -con the selector, plus 5 scratch-editnpx eslintproofs.Scenario: Given the new block → When an empty catch is added in
src/orphase-executor.ts→ Then eslint errors. Aconsole.loginphase-executor.tsand arequire()insrc/still error. Ascripts/empty catch does not.AC-3: Lint stays green
Verification: Integration Test.
npm run lintexits 0.AC-4:
sequant logsprints the suppressed countVerification: Unit Test, a gate test. New
src/commands/logs.test.ts.Scenario: Given a run log with
suppressed:{total:3,byScope:{state:2,progress:1}}→ WhendisplayLogSummaryrenders it → Then it printsSuppressed errors: 3 (state 2, progress 1). A log without the field prints no such line.Assumptions:
displayLogSummaryis not exported (logs.ts:48). Either export it, which knip forbids unless the test imports it (it will), or calllogsCommandwith a temp log dir and spy onconsole.log. Prefer the second, so there is no new export.AC-5: Baseline moves to 0
Verification: Integration Test.
jq '.emptyCatch.total' scripts/qa/health-baseline.json→ 0.Implementation Plan
Phase 1: Lint rule (do first, so it lists every remaining site)
eslint.config.js, add afiles: ["src/**/*.ts","bin/**/*.ts"]block before thephase-executor.tsblock (eslint.config.js:48). It lists therequire()selector andCatchClause > BlockStatement[body.length=0]aterror.phase-executor.tsblock as well. A later block replaces the rule instead of extending it.Phase 2: Convert the 92 sites (parallel by directory; see parallel-groups.md)
Groups: (a)
src/commands/*andbin/*(21 sites); (b)src/lib/*.tstop level (≈33); (c)src/lib/{relay,locks,upstream}/*(≈16); (d)src/lib/workflow/**(≈22).4. Use
catch (err) { noteSuppressed("<scope>", err, "<ctx>"); }, scopeotherif none fits. Do not change what happens after the error.5. Check each file's imports first.
bin/preflight.ts,fs.tsandprocess-group.tsmay not be allowed to depend onlib/workflow/. Use an explicit statement plus a one-line reason there and list those sites in the PR body.6. Commit after each group, at least every 10 minutes (30-minute MCP wall).
Phase 3:
sequant logsline and baselinedisplayLogSummary(src/commands/logs.ts). Print nothing when the field is absent.src/commands/logs.test.tswith a test whose name contains "suppressed".health-report.ts --write-baselineand confirm onlyemptyCatch.totalmoved. Add a CHANGELOG[Unreleased]line under an existing heading. Runnpm run lintandnpm run lint:health.SEQUANT_MUTATIONmarker in the PR body withsrc/commands/logs.test.tsfirst infailedTest.Design Review
eslint.config.js. The counter is the existingsrc/lib/workflow/suppressed.ts. The render goes incommands/logs.ts.no-empty(it allows comment-only bodies), and a warn-then-error ratchet (D-B means one severity per rule).noteSuppressedpattern. It is the mechanical remainder of the class tracked there, so it fixes the class and is not a local patch.scripts/too?" The runner scoped that out. The 9 script sites are named in the PR body. "Why doesnoteSuppressednow run on paths that never had a run log?" The counter is module-level and a no-op without a sink, and it never throws.emptyCatch.byFile, and the lint selector is the fence. Consumers arehealth-report.tsandhealth-baseline.json,LogWriter(persists the counts),run-log-schema.ts, andcommands/logs.ts. One counter is consumed by two readers, with no parity risk.Feature Quality Planning
All standard checks pass. Notable items:
sequant run. The counts are never persisted there, which is harmless and should be stated in the PR body.noteSuppressedin hot paths such asphase-executor.tsadds a counter increment only.Open Questions
bin/selector needignoresfor generated files? Recommendation: no, sincebin/is hand-written. Impact: lint fails on a newbinfile, caught by AC-3.lib/workflow/. Recommendation: use an explicit statement with a reason, listed in the PR body. Impact: a import cycle if wrong, so check imports per file.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Mechanical tier with a clear outcome metric. AC-4 is a gate test, so QA enforces the mutation record. No testgen: only one new test and the stubs are described above. The runner's context says to stop at the PR.
Label Review
Current: graph-2026-10-fundamentals⚠️ but mechanical.
Recommended: graph-2026-10-fundamentals (no change)
Quality Loop: Won't auto-enable. Scope is
admarble commentedon Oct 21, 2026
QA Verdict: NEEDS_VERIFICATION
AC coverage: 5/5 met
Gaps:
Needs human review:
chore(#1505): name each noteSuppressed context by its enclosing funct…