Skip to content

chore: bring the knip baseline to zero and run knip in J5 CI - #815

Merged
Jacksondr5 merged 4 commits into
j5/mainfrom
fix/812-knip-baseline
Oct 31, 2026
Merged

Jacksondr5 merged 4 commits into
j5/mainfrom
fix/812-knip-baseline

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Problem

vp run check:changed failed its knip steps on a clean j5/main: 6 unused files and 142 unused exports. J5 CI didn't run knip:check, so the count kept growing, and every agent saw a knip FAIL that wasn't theirs. Closes #812.

What changed

Upstream's CI runs knip:check and upstream's pin is clean, so every finding came from J5's own edits:

  • 132 exports used only inside their own file lose export. That includes 9 that J5 had added to upstream files (ThreadLaunchService.make, ALL_MCP_CAPABILITIES, RIGHT_PANEL_KINDS, the desktop scheme constants, APP_DISPLAY_NAME/APP_BUNDLE_ID, J5_PROMPT_LINK_ORIGIN, DEFAULT_SKILL_CATALOG_SOURCE, and the artifact tool classes). For those files this brings the code back toward upstream.
  • Dead J5 code is deleted: apps/server/src/j5/a2a/index.ts (an unused barrel), A2A_DELIVERY_CONFIG_VERSION, J5_CODEX_COORDINATION_MCP_SERVER_CONFIG, useIsOwner, and ExchangeAnalytics.manualLayer. The ExchangeAnalytics diff is mostly re-indentation (git diff -w shows it): with manualLayer gone, its layer factory lost its now-constant daemon flag.
  • J5 scripts run by path are knip entries: fleet-load.ts and devDeliverySeedRunner.ts (run from scripts/j5/*.sh), and scripts/j5/migrate-codex-fixtures.mjs (run by hand, kept per FORK.md).
  • Upstream code whose only callers J5 removed is left alone and ignored in knip.jsonc: both T3 wordmarks, the thread CLI command, configuredHostedAppUrl, useNpmReleasePublished and buildT3ProjectFileJsonSchema. Deleting them would only add merge conflicts on every advance.
  • J5 CI runs knip:check in the "Format, lint, and typecheck" job, as upstream's CI does, so the baseline stays at zero.

Upstream impact

  • knip.jsonc: new FORK.md case 95 and a ledger row. Each J5 addition there is marked J5:.
  • apps/desktop/scripts/electron-launcher.mjs, apps/desktop/src/electron/ElectronProtocol.ts, apps/server/src/mcp/McpInvocationContext.ts, apps/server/src/orchestration-v2/ThreadLaunchService.ts, apps/web/src/rightPanelStore.ts, packages/contracts/src/settings.ts, packages/shared/src/promptLinks.ts: each only drops a J5-added export, which shrinks J5's diff. Their existing FORK.md records still hold. Case 2 named ALL_MCP_CAPABILITIES as an export, and that sentence is corrected.

Docs to review: FORK.md case 95, its ledger row, the one-sentence fix to case 2, and two new steps in docs/j5/process/upstream-merge.md. The first leaves upstream code J5 stops calling in place and ignores it in knip. The second runs knip on every advance and prunes stale ignores.

Checklist

  • One concern: the description has no "also" (the CI step is the issue's second half: it keeps this baseline at zero)
  • Tests cover the changed behavior (no behaviour change; check:changed ran typecheck on 36 packages and 66 test files beside the changes, all passing)
  • UI changes: n/a
  • Live testing: n/a, no runtime behaviour changes
  • Upstream-owned files: knip.jsonc recorded as case 95; the others only shrink existing edits
  • Upstream product: n/a
  • Surfaces: n/a
  • Docs: FORK.md case 95; the upstream merge checklist

vp run check:changed: format, lint, both knip passes, graphql, typecheck (36 packages) and tests (66 files) pass.

Claude Opus 5.5 in Claude Code (J5 Code).

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Oct 31, 2026 5:14pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 effective changed lines (test files excluded in mixed PRs). labels Oct 31, 2026
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 44b3e27 and 7c241b2.

Files selected for processing: 83
  • .github/workflows/j5-ci.yml
  • FORK.md
  • apps/desktop/scripts/electron-launcher.mjs
  • apps/desktop/src/electron/ElectronProtocol.ts
  • apps/server/src/cloud/j5/legacyBootService.ts
  • apps/server/src/j5/a2a/AgentCrewProposalService.ts
  • apps/server/src/j5/a2a/ArchiveCrewService.ts
  • apps/server/src/j5/a2a/ClientReadsService.ts
  • apps/server/src/j5/a2a/CrewLaunchService.ts
  • apps/server/src/j5/a2a/CrewProposalService.ts
  • apps/server/src/j5/a2a/CrewRuntimeRequestService.ts
  • apps/server/src/j5/a2a/CrewSeatFinishNotifier.ts
  • apps/server/src/j5/a2a/CrewStopService.ts
  • apps/server/src/j5/a2a/DeliveryTransport.ts
  • apps/server/src/j5/a2a/DeliveryWorker.ts
  • apps/server/src/j5/a2a/LifecycleService.ts
  • apps/server/src/j5/a2a/MachineParticipantService.ts
  • apps/server/src/j5/a2a/MachineSenderHttp.ts
  • apps/server/src/j5/a2a/SendService.ts
  • apps/server/src/j5/a2a/contracts.ts
  • apps/server/src/j5/a2a/crewSeatArchiveGuard.ts
  • apps/server/src/j5/a2a/crewSeatIds.ts
  • apps/server/src/j5/a2a/index.ts
  • apps/server/src/j5/a2a/mcp/codexToolApproval.ts
  • apps/server/src/j5/a2a/mcp/handlers.ts
  • apps/server/src/j5/a2a/mcp/j5ToolPreapproval.ts
  • apps/server/src/j5/a2a/mcp/orchestratorSurface.ts
  • apps/server/src/j5/a2a/mcp/tools.ts
  • apps/server/src/j5/a2a/runtimeLayer.ts
  • apps/server/src/j5/agents/agentPersonaArtifacts.ts
  • apps/server/src/j5/agents/agentPersonaOrchestration.ts
  • apps/server/src/j5/agents/agentPersonaRuntime.ts
  • apps/server/src/j5/analytics/ExchangeAnalytics.ts
  • apps/server/src/j5/artifacts/ArtifactRunFinalizationObserver.ts
  • apps/server/src/j5/artifacts/ArtifactWorkspace.ts
  • apps/server/src/j5/cli/a2a.ts
  • apps/server/src/j5/persistence/MigrationSnapshot.ts
  • apps/server/src/j5/playbooks/PlaybookCrewRelay.ts
  • apps/server/src/j5/playbooks/PlaybookStore.ts
  • apps/server/src/j5/settlementActivity.ts
  • apps/server/src/j5/sharing/AccessGate.ts
  • apps/server/src/j5/sharing/CommandAdmission.ts
  • apps/server/src/j5/sharing/GuestProjectIcons.ts
  • apps/server/src/j5/sharing/GuestView.ts
  • apps/server/src/j5/sharing/LinkHttp.ts
  • apps/server/src/j5/sharing/McpApproval.ts
  • apps/server/src/j5/sharing/PairingIntents.ts
  • apps/server/src/j5/sharing/PersonAccess.ts
  • apps/server/src/j5/sharing/SharedConversation.ts
  • apps/server/src/j5/skills/skillCatalogInstaller.ts
  • apps/server/src/j5/skills/skillLinks.ts
  • apps/server/src/j5/test-support/threadLaunchHarness.ts
  • apps/server/src/mcp/McpInvocationContext.ts
  • apps/server/src/mcp/toolkits/artifacts/tools.ts
  • apps/server/src/orchestration-v2/ThreadLaunchService.ts
  • apps/web/src/j5/a2a/HumanInboxPage.tsx
  • apps/web/src/j5/agents/agentDraftState.ts
  • apps/web/src/j5/fleet/fleet.logic.ts
  • apps/web/src/j5/highlights/seenHighlights.ts
  • apps/web/src/j5/logicalProjects.ts
  • apps/web/src/j5/notifications/completionSound.ts
  • apps/web/src/j5/sharing/PersonAvatar.tsx
  • apps/web/src/j5/sharing/ShareLinkPanel.tsx
  • apps/web/src/j5/sharing/access.ts
  • apps/web/src/j5/sharing/sharedTimeline.logic.ts
  • apps/web/src/j5/skills/SkillLinksPanel.tsx
  • apps/web/src/j5/threads/useThreadRowReads.ts
  • apps/web/src/rightPanelStore.ts
  • knip.jsonc
  • packages/client-runtime/src/j5/agentPersonas.ts
  • packages/client-runtime/src/j5/playbooks.ts
  • packages/client-runtime/src/j5/scopedThreadReadStore.ts
  • packages/client-runtime/src/j5/sharing.ts
  • packages/client-runtime/src/j5/userMessagePresentation.ts
  • packages/contracts/src/j5.ts
  • packages/contracts/src/j5/agentPersona.ts
  • packages/contracts/src/j5/artifacts.ts
  • packages/contracts/src/j5/peerPoll.ts
  • packages/contracts/src/j5/skillCatalog.ts
  • packages/contracts/src/settings.ts
  • packages/provider-core/src/j5/playbookInstructions.ts
  • packages/shared/src/j5/agentMention.ts
  • packages/shared/src/promptLinks.ts
Files with no reviewable changes: 2
  • apps/server/src/j5/a2a/mcp/codexToolApproval.ts
  • apps/server/src/j5/a2a/index.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

Walkthrough

This change adds a Knip check to J5 CI and updates its configuration. It also makes many helpers, constants, errors, and RPC declarations module-local. ExchangeAnalytics now always subscribes to committed ledger events.

Changes: Knip check and export cleanup

Layer / File(s) Summary
Contract and package exports
packages/contracts/src/j5*, packages/contracts/src/settings.ts, packages/client-runtime/src/j5/*, packages/provider-core/src/j5/playbookInstructions.ts, packages/shared/src/*
Constants and RPC declarations become module-local. Their values, schemas, and described behavior remain unchanged.
A2A module exports
apps/server/src/j5/a2a/...
A2A helpers, errors, constants, and tool declarations become module-local. The A2A barrel file and coordination MCP configuration are removed.
Server service exports
apps/server/src/cloud/j5/legacyBootService.ts, apps/server/src/j5/{agents,artifacts,cli,persistence,playbooks,sharing,skills}/..., apps/server/src/mcp/..., apps/server/src/orchestration-v2/ThreadLaunchService.ts
Helpers and declarations become module-local across these server modules.
Analytics ledger subscription
apps/server/src/j5/analytics/ExchangeAnalytics.ts
ExchangeAnalytics removes the daemon-dependent layer factory and manual layer. Its layer always subscribes to committed ledger events.
Web and desktop exports
apps/desktop/scripts/electron-launcher.mjs, apps/desktop/src/electron/ElectronProtocol.ts, apps/web/src/j5/..., apps/web/src/rightPanelStore.ts
Constants, helpers, hooks, and state values become module-local. The useIsOwner helper is removed.
Knip configuration and CI
knip.jsonc, .github/workflows/j5-ci.yml, FORK.md
The Knip configuration adds workspace entries and exclusions. J5 CI runs knip:check after typechecking. FORK.md documents the check and its configuration.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Merge Risk: Minimal · up to 7c241

The change adds the unused-code check and narrows exports. No merge-blocking issue is established.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Issue #812 requires three coding outcomes: (1) the knip baseline reaches zero, by deleting unused code or adding reasoned knip.jsonc ignores; (2) upstream-owned code stays unchanged unless J5 edits ma… Provide readable content for knip.jsonc and .github/workflows/j5-ci.yml at the reviewed head. Confirm that each new ignore entry states a reason and that the CI job runs knip:check. Provide knip output at the reviewed head that reports zero…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title names the two halves of the change: clearing the knip baseline to zero and running knip in J5 CI. The changeset matches both, since it removes unused exports and dead code and adds a knip:ch…
Out of Scope Changes check Passed Each changed area connects to issue #812 or to its CI requirement:
- Export removals in J5 and upstream files address knip unused-export findings. Upstream files changed only drop exports that J5 adde…
Description check Passed The description is complete and follows the required structure. It identifies the problem and issue, explains the changes, documents upstream impact, records testing, addresses UI and live-testing app…
Full details: Title check

Explanation

The title names the two halves of the change: clearing the knip baseline to zero and running knip in J5 CI. The changeset matches both, since it removes unused exports and dead code and adds a knip:check step to the CI workflow. The title is a single short sentence, but 'chore:' prefix is generic and it lists two items. It is specific enough for a teammate to understand the primary change.

Full details: Out of Scope Changes check

Explanation

Each changed area connects to issue #812 or to its CI requirement:

  • Export removals in J5 and upstream files address knip unused-export findings. Upstream files changed only drop exports that J5 added or that have no external callers.
  • Deleted J5 code (the a2a barrel, unused constants, useIsOwner, manualLayer) is unused code that knip reports. The deletions remove no used behavior.
  • knip.jsonc entries and the FORK.md case 94 record support the baseline work and the ignores for upstream code.
  • The j5-ci.yml change adds the knip:check step that issue #812 asks for.

ExchangeAnalytics.ts (diff read directly): manualLayer is removed. The layer export keeps the previous makeLayer(true) behavior: it subscribes to ledger.subscribeCommitted and runs handleCommitted. The indentation changes come from removing the factory wrapper. This matches the PR's statement of no runtime behavior change for this file.

No change found that is unrelated to #812. One residual point: the summary lists no test file changes for the removal of manualLayer, and the comment on it says tests used it. The author reports that typecheck and tests pass. This review did not confirm that independently.

Full details: Description check

Explanation

The description is complete and follows the required structure. It identifies the problem and issue, explains the changes, documents upstream impact, records testing, addresses UI and live-testing applicability, completes the checklist, and names the model and harness. The supplied summaries mention FORK.md case 94, while the description states case 95; verify the case number before merge.

Full details: Linked Issues check

Explanation

Issue #812 requires three coding outcomes: (1) the knip baseline reaches zero, by deleting unused code or adding reasoned knip.jsonc ignores; (2) upstream-owned code stays unchanged unless J5 edits made it unused, in which case its entries are ignored instead; (3) J5 CI runs knip:check.

Evidence that supports the changes (AI-generated PR summary; ExchangeAnalytics.ts diff read directly):

  • Many unused exports lost export across J5 and upstream files. Upstream files changed only drop J5-added exports.
  • Dead J5 code is deleted: apps/server/src/j5/a2a/index.ts, A2A_DELIVERY_CONFIG_VERSION, J5_CODEX_COORDINATION_MCP_SERVER_CONFIG, useIsOwner, and ExchangeAnalytics manualLayer.
  • The summary lists upstream code kept and ignored in knip.jsonc: both T3 wordmarks, the thread CLI command, configuredHostedAppUrl, useNpmReleasePublished, and buildT3ProjectFileJsonSchema.
  • The summary lists script entries in knip.jsonc: fleet-load.ts, devDeliverySeedRunner.ts, and migrate-codex-fixtures.mjs.
  • The summary reports a CI step, pnpm exec vp run knip:check, added to .github/workflows/j5-ci.yml.

Unresolved uncertainty:

  • The diffs for knip.jsonc and .github/workflows/j5-ci.yml could not be read. The changed blobs are missing from the checkout. The content of the ignore entries, their stated reasons, and the CI step rests on the AI-generated summary only.
  • Knip cannot be run in this review. The zero-finding baseline is the author's report that check:changed passed. It is not confirmed here.
  • The summary does not give a per-finding mapping from the 6 unused files and 142 unused exports to the changes. Completeness cannot be checked.

Resolution

Provide readable content for knip.jsonc and .github/workflows/j5-ci.yml at the reviewed head. Confirm that each new ignore entry states a reason and that the CI job runs knip:check. Provide knip output at the reviewed head that reports zero unused files and zero unused exports, or the result of vp run knip:check on that head.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Jacksondr5 and others added 4 commits October 31, 2026 13:13
knip:check failed on a clean j5/main with 6 unused files and 142 unused
exports, and J5 CI didn't run it. J5 code no longer exports what only its own
file uses; dead J5 exports and the unused a2a barrel are deleted; J5 scripts
run by path are knip entries. Upstream code whose callers J5 removed is left
as written and ignored in knip.jsonc (FORK.md case 94). J5 CI now runs
knip:check, as upstream's CI does.

Closes #812

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tidy case 94

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jacksondr5
Jacksondr5 force-pushed the fix/812-knip-baseline branch from d13963b to 37ebee3 Compare October 31, 2026 17:14
@Jacksondr5
Jacksondr5 merged commit 728b2fe into j5/main Oct 31, 2026
33 checks passed
@Jacksondr5
Jacksondr5 deleted the fix/812-knip-baseline branch October 31, 2026 19:59

This branch was successfully deployed

1 active deployment
Preview — 37ebee37 Deployed Oct 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (test files excluded in mixed PRs). 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.

knip fails on clean j5/main, so every local check:changed shows a failure

1 participant