ci: reject unused tailscale exports with Knip#10012

merged2
t3code/knip-stricter-entry-audit
t3code/knip-tailscale-export-gate
openedSep 5, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

CI currently rejects unused files and dependencies but does not reject unused exports. The Tailscale package is export-clean after the preceding layer, so it can now enforce those checks without a backlog baseline.

Extend the existing knip:check command with a Tailscale export/type audit. Keep the repository-wide file/dependency gate and existing entrypoint handling. Add no dependencies, suppressions, or baseline. Update the existing maintainer instructions so the checked scope is explicit and can grow workspace by workspace. The full repository export audit remains available and still reports the backlog.

Verification: the exact CI command passes. Temporarily re-exporting one unused value and type makes it exit 1 and name both findings; restoring the cleanup makes it pass again. Formatting and diff checks pass. No product behavior changes.

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


Note

Low Risk Tooling and CI script changes only; no runtime or product behavior is modified.

Overview CI now fails on unused exports and types in packages/tailscale, in addition to the existing repo-wide unused-file and dependency checks.

The root knip:check script chains a second Knip run (--workspace packages/tailscale --exports). The CI step is renamed to Check unused code with comments/docs that spell out the split: repo-wide files/deps vs export gates only for workspaces that are clean enough to enforce.

Maintainer docs note the full export audit is still optional and can grow workspace-by-workspace as backlogs shrink.

Reviewed by Cursor Bugbot for commit 7ccaaf0727aa68ed029b847f28b4730a981e7241. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Reject unused tailscale exports in knip:check CI script

  • Extends the knip:check script in package.json to run an export check scoped to packages/tailscale after the repo-wide files and dependencies check passes.
  • Updates docs/operations/development.md and renames the CI step in ci.yml to reflect the new check.
  • Behavioral Change: CI now fails if packages/tailscale contains unused exports or types.

Macroscope summarized 7ccaaf0.

Added 2 commits

  • ci: reject unused tailscale exports with Knipbed981b
  • ci: clarify the unused code check scope7ccaaf0
Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire—13.6 KiB—15.1 KiB✅
CodexThread snapshot wire—7.0 KiB—7.3 KiB✅
CodexLive turn WebSocket wire—6.5 KiB—7.8 KiB✅
CodexLive turn WebSocket decoded—57.0 KiB—66.4 KiB✅
CodexLive turn messages—9—21✅
ClaudeTotal thread wire—13.6 KiB—15.1 KiB✅
ClaudeThread snapshot wire—7.0 KiB—7.3 KiB✅
ClaudeLive turn WebSocket wire—6.5 KiB—7.8 KiB✅
ClaudeLive turn WebSocket decoded—57.8 KiB—66.4 KiB✅
ClaudeLive turn messages—9—21✅

Baseline: unavailable · PR result: 7ccaaf0 · 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: Approved at 7ccaaf0

Macroscope's review found this PR approvable — The PR adds a narrowly scoped Knip export/type gate for the already-clean Tailscale package and updates the corresponding CI label and maintainer documentation. Its effects are limited to CI and developer tooling, with no product runtime, deployment, schema, or default changes.

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