Skip to content

ci(knip): enforce server exports - #10282

Merged
juliusmarminge merged 1 commit into
mainfrom
cleanup-server/knip-gate
Sep 8, 2026
Merged

ci(knip): enforce server exports#10282
juliusmarminge merged 1 commit into
mainfrom
cleanup-server/knip-gate

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 6, 2026

Copy link
Copy Markdown
Member

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.

@cursor

cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 6, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 6, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 13.6 KiB −16 B (−0.1%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB −10 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.6 KiB 6.6 KiB −6 B (−0.1%) 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 57.1 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 10 10 0 (0.0%) 21
Claude Total thread wire 13.6 KiB 13.6 KiB +33 B (+0.2%) 15.1 KiB
Claude Thread snapshot wire 7.1 KiB 7.1 KiB 0 B (0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 6.5 KiB +33 B (+0.5%) 7.8 KiB
Claude Live turn WebSocket decoded 57.8 KiB 57.8 KiB +44 B (+0.1%) 66.4 KiB
Claude Live turn messages 8 9 +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.

@juliusmarminge
juliusmarminge force-pushed the cleanup-server/knip-gate branch from f64e2e5 to 6e9b8ad Compare September 8, 2026 07:51
@macroscopeapp
macroscopeapp Bot dismissed their stale review September 8, 2026 07:51

Dismissing prior approval to re-evaluate 6e9b8ad

@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Sep 8, 2026
@juliusmarminge
juliusmarminge force-pushed the cleanup-server/knip-gate branch from 6e9b8ad to 8c7c205 Compare September 8, 2026 07:53
@cursor

cursor Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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.

@juliusmarminge
juliusmarminge force-pushed the cleanup-server/knip-gate branch from 8c7c205 to e7ec5ca Compare September 8, 2026 07:53
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

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 72f32c8 and e7ec5ca.

📒 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 name Status Explanation
Docstring Coverage ✅ Passed No 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 ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the primary change: enforcing server export checks with Knip.
Description check ✅ Passed The 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.

@juliusmarminge
juliusmarminge force-pushed the cleanup-server/knip-gate branch from e7ec5ca to e7226e4 Compare September 8, 2026 08:11
@juliusmarminge
juliusmarminge force-pushed the cleanup-server/knip-gate branch from e7226e4 to e7b0e1e Compare September 8, 2026 08:12
Base automatically changed from cleanup-server/mcp-preview-internals to main September 8, 2026 08:17
@juliusmarminge
juliusmarminge force-pushed the cleanup-server/knip-gate branch from e7b0e1e to 7137c7d Compare September 8, 2026 08:17
@cursor

cursor Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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.

@juliusmarminge
juliusmarminge force-pushed the cleanup-server/knip-gate branch from 7137c7d to 1535b27 Compare September 8, 2026 08:18

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All clear

Posted via Macroscope — Effect Service Conventions

@macroscopeapp

macroscopeapp Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

All clear

Posted via Macroscope — Effect Service Conventions

@juliusmarminge
juliusmarminge merged commit 7d62050 into main Sep 8, 2026
23 checks passed
@juliusmarminge
juliusmarminge deleted the cleanup-server/knip-gate branch September 8, 2026 08:21
maarco pushed a commit to maarco/marcode that referenced this pull request Sep 8, 2026
The Check job failed on `knip:check` with seven unused exports. All seven
are this merge's: upstream's pingdotgg#10282 added `apps/server` and `apps/desktop`
to the `--exports` workspace list, and the merge took that widened scope,
so exports that were never imported became visible for the first time.

Six were dead and are now module-private, which is also how upstream
declares the three it shares:

- electron-launcher.mjs `APP_DISPLAY_NAME` / `APP_BUNDLE_ID`. The merge
  kept Marcode's `export` on the reasoning that Marcode exports them, but
  nothing ever imported either one — the `APP_DISPLAY_NAME` that web code
  imports is a different symbol in apps/web/src/branding.ts. Upstream has
  both as plain `const`.
- http.ts `authenticateRawRouteWithScope`, used only by the route it sits
  next to. Upstream and the merge base both have it as `const`.
- commandInvariants.ts `workspaceLayoutRejectionDetail`,
  `findWorkspaceLayoutEntryInAnyProject`, `isWorkspaceLayoutContainerKind`.
  Marcode-owned, each used only inside that module. The client-runtime
  reference to `workspaceLayoutRejectionDetail` is a doc comment naming
  the wire shape, not an import.

The seventh, `defineMarcodeMigration`, keeps its export and gains a test.
It is the constructor that holds the reserved >= 9000 namespace open, and
its registry is deliberately empty, so it has no caller by design — the
reason a future sync could renumber an applied migration is precisely that
this reads as dead code. The test exercises the guard instead, which both
gives the export a consumer and pins the invariant.

Local verification had missed this because dependencies were installed
with --ignore-scripts, so `prepare` never ran and `knip:check` was never
part of the focused scope. Re-verified the way CI runs it: `vp run
knip:check` clean, `vp check` 0 errors, and `vpr typecheck` clean across
all 15 packages with the effect-tsgo patch applied and the Effect
language-service diagnostics active. Migrations, commandInvariants, http,
httpResponseErrorGuard, electron-launcher and projectWorkspace tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U3kz6cvULzXAHG2jfiVRWf
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 8, 2026
## What's Changed
* feat(chat): attach files to question answers by @shivamhwp in pingdotgg/t3code#9871
* feat(desktop): refresh macOS installer with aurora artwork by @saphid in pingdotgg/t3code#10632
* fix(server): give completed turns a full session idle window by @StiensWout in pingdotgg/t3code#10689
* feat(web): add pull request merge defaults by @Bil0000 in pingdotgg/t3code#8088
* fix(usage): keep account columns aligned across limit rows by @juliusmarminge in pingdotgg/t3code#10690
* fix(web): chat text no longer shows through a 1px gap under composer banners by @vitalyiegorov in pingdotgg/t3code#10635
* refactor(server): classify runtime exports by @juliusmarminge in pingdotgg/t3code#10274
* refactor(server): classify orchestration exports by @juliusmarminge in pingdotgg/t3code#10275
* refactor(server): classify service exports by @juliusmarminge in pingdotgg/t3code#10276
* refactor(server): classify telemetry exports by @juliusmarminge in pingdotgg/t3code#10277
* refactor(server): classify provider exports by @juliusmarminge in pingdotgg/t3code#10278
* refactor(server): classify source control exports by @juliusmarminge in pingdotgg/t3code#10279
* refactor(server): classify source control registry API by @juliusmarminge in pingdotgg/t3code#10280
* refactor(server): classify preview toolkit exports by @juliusmarminge in pingdotgg/t3code#10281
* ci(knip): enforce server exports by @juliusmarminge in pingdotgg/t3code#10282
* feat(web): add previous/next turn navigation in minimap by @UtkarshUsername in pingdotgg/t3code#8531
* fix(web): stop the settings sidebar shifting when switching pages by @t3dotgg in pingdotgg/t3code#10705
* fix(web): copy terminal selection with Ctrl+Insert by @iamshadmantaqi in pingdotgg/t3code#8541
* fix(web): show the same project icon in the command palette as everywhere else by @t3dotgg in pingdotgg/t3code#10712
* fix(web): stop sidebar rows flashing and shifting on click by @t3dotgg in pingdotgg/t3code#10713
* refactor(web): pass the project record to ProjectFavicon so icons cannot drift by @t3dotgg in pingdotgg/t3code#10714

## New Contributors
* @iamshadmantaqi made their first contribution in pingdotgg/t3code#8541

**Full Changelog**: pingdotgg/t3code@v0.0.41-nightly.20260908.1387...v0.0.41-nightly.20260908.1400

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.41-nightly.20260908.1400
NoahHendrickson pushed a commit to NoahHendrickson/t3code that referenced this pull request Sep 8, 2026
Upstream now rejects unused files, dependencies and exports (pingdotgg#9962, pingdotgg#10282).
Declare the override shadow tree as knip entries, exempt the vendored
design-mode engine like upstream's _generated/, drop the export keyword on
fork symbols only used in their own module, delete the two stage-backdrop
exports the fork never rendered, and remove the msw devDependency upstream
already retired. The sidebar's stale-scope cleanup now waits for every
project snapshot, which is what upstream's snapshot-readiness hook was for.

The pre-ready platform test asserts upstream's Linux desktop entry name and
display name; fenced to the fork's.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant