chore: configure Knip workspace audits#9958

merged1
main
t3code/setup-nip-prune-unused-code
openedSep 5, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

We had no repo-wide way to find unused files, dependencies, or exports. Tests can keep otherwise-unused helpers reachable.

Add pinned Knip 6.34.0 with normal and production audit commands. Configure the existing pnpm workspaces, explicit Electron/service entrypoints, native codegen, subprocess fixtures, and private-package export auditing. Keep generated protocol exports and dependencies loaded by native or packaging code. Vendored reference repositories stay outside the project graph.

This setup layer intentionally reports two unused files and two redundant root dependencies; later layers remove them before enabling the CI gate. Full export findings remain available for incremental review, without a blanket ignore list or issue-count allowance.

Verification: installed successfully; both normal and production scans ran. The configured file/dependency scan identifies the four expected findings. An independent source audit checked runtime entrypoints and dependency exceptions. No runtime or visual behavior changed, so screenshots do not apply.

Leave this stack unmerged for maintainer review.

Model: gpt-6 astra. Harness: Codex in T3 Code.

Added 1 commit

  • chore: configure Knip workspace audits42073ba
Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire13.5 KiB13.5 KiB+25 B (+0.2%)15.1 KiB✅
CodexThread snapshot wire7.0 KiB7.0 KiB+1 B (+0.0%)7.3 KiB✅
CodexLive turn WebSocket wire6.5 KiB6.5 KiB+24 B (+0.4%)7.8 KiB✅
CodexLive turn WebSocket decoded57.0 KiB57.0 KiB0 B (0.0%)66.4 KiB✅
CodexLive turn messages880 (0.0%)21✅
ClaudeTotal thread wire13.5 KiB13.5 KiB0 B (0.0%)15.1 KiB✅
ClaudeThread snapshot wire7.0 KiB7.0 KiB−5 B (−0.1%)7.3 KiB✅
ClaudeLive turn WebSocket wire6.5 KiB6.5 KiB+5 B (+0.1%)7.8 KiB✅
ClaudeLive turn WebSocket decoded57.8 KiB57.8 KiB0 B (0.0%)66.4 KiB✅
ClaudeLive turn messages880 (0.0%)21✅

Baseline: eae770b · PR result: 42073ba · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a development-only Knip audit setup and does not alter product runtime behavior. Human review is required because the configuration introduces Knip directives that suppress dependency, binary, export, and type diagnostics.

You can add or adjust custom eligibility rules. Learn more.