ci(knip): enforce server exports#10282

merged1
main
cleanup-server/knip-gate
openedSep 6, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 3d ago

The server export audit was clean locally but was not part of the long-term Knip gate. This adds apps/server to the runtime-export check and documents the explicit rules for exported types, Effect schemas, and canonical Effect service construction APIs.

This is layer 9 of 9 in the server Knip cleanup stack.

Verification after rebasing onto current main: server typecheck and the server-only Knip export audit pass. Changed-file lint and formatting pass, with one existing lint warning. Focused auth, provider, source-control, preview toolkit, orchestration, and Knip preprocessor tests pass: 90 tests across 9 files. This changes server export visibility and static analysis; screenshots do not apply.

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

Summary by CodeRabbit

  • Documentation

    • Updated unused-code guidance to cover server workspace checks.
    • Clarified that publicly marked service construction APIs remain exported.
  • Chores

    • Expanded automated unused-code checks to include the server workspace.

Note

Enforce Knip unused-export checks on apps/server

  • Adds apps/server to the export-analysis portion of the root knip:check script in package.json and documents the expanded coverage in development.md.
  • Converts preview toolkit bindings (12 tool declarations in tools.ts and the handler layer in handlers.ts) from exported to module-local.
  • Marks the makeWithProviders function in SourceControlProviderRegistry.ts with a @public JSDoc tag so Knip recognizes it as a canonical public API.
  • Risk: any out-of-tree or cross-workspace consumer importing the now-internal preview toolkit bindings (PreviewStatusTool, PreviewOpenTool, etc.) will break; in-tree usages are already updated.

Macroscope summarized 1535b27.

Synced from GitHub

Bugbot is paused β€” on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

Synced from GitHub

Approvability

Verdict: Approved at 6e9b8ad

Macroscope's review found this PR approvable β€” This PR only expands an existing Knip export check to the server workspace and documents the convention; it does not change product runtime behavior or defaults. Its impact is limited to CI and developer validation failures for newly detected unused exports.

No code changes detected at 1535b27. Prior analysis still applies.

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

Synced from GitHub

Thread transfer impact

βœ… Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire13.6 KiB13.6 KiBβˆ’16 B (βˆ’0.1%)15.1 KiBβœ…
CodexThread snapshot wire7.0 KiB7.0 KiBβˆ’10 B (βˆ’0.1%)7.3 KiBβœ…
CodexLive turn WebSocket wire6.6 KiB6.6 KiBβˆ’6 B (βˆ’0.1%)7.8 KiBβœ…
CodexLive turn WebSocket decoded57.1 KiB57.1 KiB0 B (0.0%)66.4 KiBβœ…
CodexLive turn messages10100 (0.0%)21βœ…
ClaudeTotal thread wire13.6 KiB13.6 KiB+33 B (+0.2%)15.1 KiBβœ…
ClaudeThread snapshot wire7.1 KiB7.1 KiB0 B (0.0%)7.3 KiBβœ…
ClaudeLive turn WebSocket wire6.5 KiB6.5 KiB+33 B (+0.5%)7.8 KiBβœ…
ClaudeLive turn WebSocket decoded57.8 KiB57.8 KiB+44 B (+0.1%)66.4 KiBβœ…
ClaudeLive turn messages89+1 (+12.5%)21βœ…

Baseline: 1f0a14c Β· PR result: 1535b27 Β· 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.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

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

Synced from GitHub

Bugbot is paused β€” on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

Synced from GitHub

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 634465cb-dee1-4939-8b93-2a283b71868b

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 72f32c81d5c3a5a09acbd0da96dd0d2299c5e789 and e7ec5ca95f447307914a87a89f02774ed74b86de.

πŸ“’ Files selected for processing (2)
  • docs/operations/development.md
  • package.json

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


πŸ“ Walkthrough

Walkthrough

The Knip check now scans apps/server. The development guide documents the expanded scan and the @public exemption for canonical Effect service construction APIs.

Changes

Knip coverage

Layer / File(s)Summary
Configure and document Knip coverage
package.json, docs/operations/development.md
The knip:check script adds apps/server. The development guide documents runtime-export checks and @public annotations.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: βšͺ Minimal Β· up to 1535b

This expands unused-export checking to the server workspace and documents the existing public API annotation convention. The change does not alter runtime behavior and is ready to merge.

Suggested reviewers: t3dotgg

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check nameStatusExplanation
Docstring Coverageβœ… PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues checkβœ… PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkβœ… PassedCheck skipped because no linked issues were found for this pull request.
Title checkβœ… PassedThe title clearly identifies the primary change: enforcing server export checks with Knip.
Description checkβœ… PassedThe description explains what changed, why it changed, verification results, test coverage, and why screenshots do not apply. It does not use the template headings or include the checklist, but the re…
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup-server/knip-gate

Comment @coderabbitai help to get the list of available commands.

Synced from GitHub

Bugbot is paused β€” on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

Added 1 commit

  • ci(knip): enforce server exports1535b27