Repository navigation
Description
Epic: graph-2026-10-fundamentals Tier: mechanical Execution: sequant_run Blocked by: #1502
Problem
eslint.config.js carries three rules at warn under the comment "Temporarily relaxed rules for gradual adoption", added 2026-01-11. Nine months later they produce 3 warnings in the whole tree. The relaxation can end. Separately, nothing in the repo reports unused exports: the dormant surface found in the usage audit (6 commands, 64 of 89 flags, 26 of 65 settings) was visible only through run logs. knip is the standard tool; it lands advisory with a numeric baseline in F-01's report (OQ-9 default), not as a blocking check.
Acceptance Criteria
- AC-1: No relaxed rule remains and lint is green. Evidence:
grep -cE '"(@typescript-eslint/no-unused-vars|@typescript-eslint/no-empty-object-type|prefer-const)": "warn"' eslint.config.js→0 - AC-2: Lint passes with the rules at
error(constraint: green today, must stay green after AC-1). Evidence:npm run lint > /dev/null 2>&1 && echo green→green - AC-3: knip is installed and configured. Evidence:
jq -e '.devDependencies.knip' package.json > /dev/null && test -f knip.json && echo ok→ok - AC-4: knip runs as an advisory job. Evidence:
grep -A14 '^ knip-advisory:' .github/workflows/ci.yml | grep -c 'continue-on-error: true'→1 - AC-5: The health report carries the unused-export count and the baseline records it. Evidence:
npx tsx scripts/qa/health-report.ts --json | jq -e '.unusedExports >= 0' > /dev/null && jq -e '.unusedExports >= 0' scripts/qa/health-baseline.json > /dev/null && echo ok→ok
Prior fixes / producers
- Prior fixes:
git log -S "Temporarily relaxed" --format='%h %ad %s' -- eslint.config.js→ one commit (2026-01-11), never revisited. Isolated. - Producers of
eslint.config.js: F-02, F-04, F-07, F-08 each append one config block (§8 style rule). This node edits only the existing "relaxed" block and adds nothing else.
May touch
eslint.config.js (the relaxed block only), package.json (knip devDependency, one lint:knip script line), package-lock.json, knip.json (new), .github/workflows/ci.yml (one appended job), scripts/qa/health-report.ts (the unusedExports key), scripts/qa/health-baseline.json (regenerated with --write-baseline, I-4), and the ≤ 3 source lines the warnings point at.
Non-Goals
- No removal of any export knip reports (F-10, D-2).
- No knip
ignoreentries beyond entry points and generated files; noise is carried as the baseline number, not hidden. - No edits under
plugin/,.claude/skills/,templates/skills/(I-1).
Done when
npm run lint is green with no warn relaxation, and the knip-advisory check appears on the PR.
Activity
admarble commentedon Oct 19, 2026
Runner context, 2026-10-19, before launch (fundamentals W1, beside #1521/#1528 and the judgment set; stop-at-PR). main = ec9d583.
Changed since filing:
scripts/qa/health-report.ts,health-baseline.json, thehealth-advisoryjob andlint:healthall landed in feat(qa): health-report.ts — one script prints the fundamentals baseline, --check fails a raised metric, advisory CI job, release-checklist line #1502 (11cb5e4).unusedExportskey to that script's format. Owner ruling on feat(qa): health-report.ts — one script prints the fundamentals baseline, --check fails a raised metric, advisory CI job, release-checklist line #1502:emptyCatch.byFile.*stays ungated.health-advisoryinci.yml.eslint.config.jsblock. Edit only the pre-existing relaxed block.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, and this wave runs 7 issues at once. Prefer the targetednpx vitest run <files>for the ACs.CHANGELOG: add
[Unreleased]lines, notchangelog.d/fragments. #1370 has not merged.Freeze: nothing under
plugin/,.claude/skills/ortemplates/skills/.Health baseline: if this PR changes a measured metric, regenerate
scripts/qa/health-baseline.jsonwithnpx tsx scripts/qa/health-report.ts --write-baselineafter the last source change. Never hand-edit it.npm run lint:healthmust print "no metric rose".admarble commentedon Oct 19, 2026
Complexity: Standard (5 ACs, 5 directories)
AC Quality Check
All five ACs carry a command-shaped
Evidence:; each was run against main (ec9d583):3, not0)npm run lintis already green,--max-warnings 0)knip.json)knip-advisoryjob)-A14window must containcontinue-on-error: trueexactly once, so keep the job ≤14 lines after its headerunusedExportskey)One gap: AC-5 checks the key is
>= 0but not that it matches the knip count. Plan adds a test for that (see AC-5).Scope Assessment
Non-Goals: present (no export removal, no
ignorebeyond entry points/generated files, nothing underplugin/,.claude/skills/,templates/skills/)..github/workflows,scripts/qa,src≤3 lines, lockfile)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: No relaxed rule remains
Verification: Integration Test (grep command)
Scenario: Given
eslint.config.jslines 29-32 → When the threewarnentries and the "Temporarily relaxed" comment are removed → Then the grep prints0Assumptions: Removing the entries means the rules fall back to the
typescript-eslintrecommended preset, whereno-unused-varsandno-empty-object-typeareerrorandprefer-constiserrorviaeslint.configs.recommended/preset. Verify in the config which presets are spread above the block; if one is not, set the rule to"error"explicitly. Otherwise AC-2 stays green while enforcement is silently off.AC-2: Lint passes at
errorVerification: Integration Test (
npm run lint)Scenario: Given AC-1 applied → When
npm run lint→ Then exit 0Assumptions: The issue says 3 warnings remain; on main lint prints none under
--max-warnings 0, so the ≤3 source-line fix may already be unnecessary. Confirm by running lint with the rules aterrorbefore touching source. Mutation check: add an unused var in a scratch file, confirm lint fails, remove it.AC-3: knip installed and configured
Verification: Integration Test (jq + file test)
Scenario: Given no knip → When
npm i -D knipand addknip.json→ Then evidence printsokAssumptions: Entry points:
bin/cli.ts,src/index.ts,scripts/**runnable files, vitest test globs;ignoreonly for generated/dist. Add onelint:knipscript (knip). Lockfile diff must contain only knip and its deps (discard unrelatedlibcchurn).AC-4: knip runs as advisory job
Verification: Integration Test (grep on ci.yml)
Scenario: Given
ci.yml→ Whenknip-advisory:job appended afterhealth-advisorywithcontinue-on-error: true→ Then grep count is1Assumptions: Mirror
health-advisory(pinned action SHAs,if: pull_request, Node 22.x,npm ci). Pinned SHAs must be copied from the existing job, not retyped.AC-5: Health report carries
unusedExports; baseline records itVerification: Unit Test (
scripts/qa/health-report.test.ts) + command evidenceScenario: Given knip configured → When
health-report.ts --json→ Then.unusedExportsis a number ≥ 0 andhealth-baseline.jsonhas the same keyAssumptions:
unusedExports: numberadded toHealthMetricsandcollectMetrics, computed by spawningnpx knip --reporter json(exit code non-zero on findings is normal, so parse stdout, don't trust the status) and summing exports + types entries. The key is gated by default (not inUNGATED), consistent with the ratchet; the CI job stays advisory. Fixture-tree tests inhealth-report.test.tsruncollectMetricson a temp root with no knip config: the counter must return0(not throw) there, and the fixture-key assertions must be updated. Regenerate the baseline with--write-baselineafter the last source change; never hand-edit.Implementation Plan
Phase 1: Retire the relaxation (AC-1, AC-2)
eslint.config.js:29-32: delete the comment and threewarnentries (the block only; refactor(commands): split initCommand, doctorCommand, syncCommand and updateCommand to ≤ 200 counted lines; max-lines-per-function ratchet for src/commands #1509 appends its own block later). Check the presets above supplyerrorfor all three; else set explicit"error".npm run lint; fix any finding (≤3 source lines per "May touch").Phase 2: knip (AC-3, AC-4)
npm i -D knip; addknip.jsonand thelint:knipscript line.npx kniponce locally to confirm entry points are sane (noise is carried as the baseline number, not hidden).knip-advisoryto.github/workflows/ci.ymlafterhealth-advisory.Phase 3: Health report (AC-5)
unusedExportscounter + type field inscripts/qa/health-report.ts; extendhealth-report.test.ts(fixture returns 0; a stubbed knip JSON of N entries yields N).npx tsx scripts/qa/health-report.ts --write-baseline, thennpm run lint:healthmust print "no metric rose". CHANGELOG[Unreleased]lines (notchangelog.d/).Targeted run only:
npx vitest run scripts/qa/health-report.test.ts; full suite at most once, foreground, undertimeout, after a WIP commit.Design Review
eslint.config.js/knip.json; the metric in the existing health-report script that feat(qa): health-report.ts — one script prints the fundamentals baseline, --check fails a raised metric, advisory CI job, release-checklist line #1502 created, not a new script.health-advisoryjob + ratchet-metric pattern from feat(qa): health-report.ts — one script prints the fundamentals baseline, --check fails a raised metric, advisory CI job, release-checklist line #1502.git log -S "Temporarily relaxed"= one commit; no prior fix issues. Not a re-patch.--jsonoutput, and the baseline must come from the same producer. A second challenge is runtime, since knip adds seconds tolint:health; measure it and note it in the PR.HealthMetrics: producercollectMetrics(one); consumersrun/format/compare,health-report.test.ts,health-baseline.json, thehealth-advisoryjob, the release checklist line.comparetreats keys absent from the baseline as non-rises, so ordering is safe.Feature Quality Planning
All standard checks pass. Notable items:
npx knipinsidecollectMetricsneeds knip installed in thehealth-advisoryjob;npm cicovers it once the lockfile is updated.Mutation-verified:for the AC-5 test (delete the counter, confirm the named test fails, restore) in the PR body, with the file path before the first>.Open Questions
errorwith no source edits, the PR touches nosrc/at all. Impact: none.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Mechanical tier, config plus one metric. AC-5 declares a unit-test-shaped check but is a small extension of an existing tested script; targeted tests in exec suffice, so testgen is skipped.
Label Review
Current: graph-2026-10-fundamentals
Recommended: + planned
Reason: Plan posted.
Quality Loop: Won't auto-enable (SCOPE_OK).
admarble commentedon Oct 19, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 5/5 met
Gaps:
Suggestions:
knip-advisoryrunsnpx knip || trueand also setscontinue-on-error: true. Because of the|| true, the job is always green, so no signal appears in the checks list even when knip finds something. Dropping|| truewould let the job show up as a failed but non-blocking check.lint:healthrun and everyhealth-reportrun now spawns knip, which takes about 2.5 s. That's fine, but worth knowing.admarble commentedon Oct 19, 2026
Execution Verification (runner, 2026-10-19), PR #1550 @ 7e7649e
The runner re-ran every Evidence command verbatim in the worktree:
0greenok1ok;unusedExports= 342 is recorded in the baseline.npm run lint:health: no metric rose. The baseline diff adds onlyunusedExports; the ungatedtestRatio28ddrifted.The lockfile diff is knip and its dependencies. The codex entries were rewritten at the same versions (0.162.1), and there is no
libcchurn.knip-advisorypassed on the head. Its|| truekeeps it green on purpose: knip exits 1 with 342 unused exports today, and the ratchet isunusedExportsinlint:health. The owner rules on keeping it.ci(#1503): knip-advisory shows its findings as a failed advisory chec…