refactor(contracts): retire the legacy orchestration schemas - #14024
juliusmarminge merged 1 commit into
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The PR removes a large exported V1 orchestration contract and restructures shared contract modules across server and client packages. The retained wire schemas appear unchanged, but the public API removal and broad shared-infrastructure refactor merit human compatibility review. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
c3ed758 to
561a1d1
Compare
The still-used wire schemas move, byte for byte, into their own modules: thread pull request links, thread search, the dispatch error and title regeneration. ProjectFaviconPath joins project.ts. The wire is identical. The ./legacy-orchestration export and the duplicate index export go away with orchestration.ts. Server persistence keeps its receipt and runtime status literals locally. Client and test code that only borrowed V1 types for local shapes now names the fields it reads. Tests of still-live schemas move next to them; tests of V1 commands, events and read models go with the schemas. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2cd8372 to
1fe16e5
Compare
Stacked on #14018.
packages/contracts/src/orchestration.ts(1.7k lines) still held the whole V1 command, event and read-model vocabulary. It was exported twice from the index and again as@t3tools/contracts/legacy-orchestration, but after #13960–#14018 nothing on the server uses V1 commands or events. Only a handful of its schemas are still on the wire.What changed
threadPullRequest.ts:ThreadPullRequestLink,…Key,…LinkSource,…Snapshot,…Stack,…StackLayer,ThreadLinkedPullRequestthreadSearch.ts: search input, match, result, source, andOrchestrationSearchThreadsErrororchestrationDispatch.ts:OrchestrationDispatchCommandError, still in the project-clone RPC and read bywasBootstrapThread*threadTitle.ts:ThreadTitleRegeneration, used by the MCP thread metadataProjectFaviconPathjoinsproject.tsorchestration.ts, the./legacy-orchestrationexport and the duplicateexport *in the index.project | threadandaccepted | rejectedliterals locally, and so does the provider-runtime status. These are database row shapes, not wire types.derivePendingRequests,foldSubagentActivitiesand web'slatestWorkspaceMutationIdtake{ kind, payload, createdAt }-style structural inputs.codexFeedbackMessagereturns aLocalChatMessage.LocalThreadMessage; the pending-creation row drops the V1turnId, which the feed never read.PullRequestTestThreadforv2PullRequestThreadinstead of a V1 shell.modelSelection,checkpointDiff,chatAttachment(unknown and malformed attachment types, accessibility cap),orchestrationDispatch,threadPullRequest, and the project icon, monogram and favicon cases inproject.test.ts. Icon compatibility is now checked through the V2ProjectUpdatePayloadinstead of a V1 command. The composer-context test now uses the V2 conversation message andmessage.dispatch. Tests of V1 commands, events, shells, sessions and proposed plans were deleted along with the schemas.docs/orchestration-v2/README.mdno longer describes V1 as "still present".Dead code found (follow-up)
None of this is deleted here; each item only lost its V1 type:
packages/client-runtime/src/pendingRequests.ts:derivePendingRequestshas no production caller, and the./pending-requestssubpath export inpackages/client-runtime/package.jsonis never imported.packages/client-runtime/src/state/subagentRuntime.ts:foldSubagentActivities(and its helpers) has no production caller; the UI usesprojectedSubagentsToRuntime.apps/web/src/hooks/useWorkspaceMutationRefresh.ts:latestWorkspaceMutationIdis only called from its test.ChatViewderives the mutation id from turn items itself.apps/mobile/src/lib/threadActivity.ts: thelocalMessagesoption ofbuildThreadFeedis only passed by tests (anchoredMessagesis live).packages/client-runtime/src/state/threadSettled.ts:SettlementThreadShellis declared and never used (it predates this PR; lint flags it now that the file is touched). The unusedOrchestrationThreadShellimport in the same file was removed here because the type no longer exists.Verification
vp exec tsc --noEmit -p .in packages/contracts, packages/client-runtime, packages/shared, apps/web, apps/mobile, apps/server: 0error TS/warning TS.vpr knip:check: clean.vp linton touched files: no new warnings. The remaining ones (SettlementThreadShellabove, two_params inPullRequestSyncReactor.test.ts) predate this PR.vp test run, in small groups, all passing:modelSelection,orchestrationDispatch,checkpointDiff,chatAttachment,project,threadPullRequest(new or moved),composerContext,applicationEvent,rpc,orchestrationV2,assetspendingRequests,state/subagentRuntime,state/threadFeedback,state/threadSnoozed,errors/orchestration,state/threadSearchhooks/useWorkspaceMutationRefreshlib/threadActivity,state/thread-outbox,state/pending-thread-creationPullRequestSyncReactor, MCPpullRequests/handlers,linkCreatedPullRequest,ThreadSearch,ProjectService,ws,runtimeLayer,V1ImportBoundary,legacy/*,055_*(3 files),056_*, and replay (OrchestratorReplayFixtures.integration+.contract,OrchestratorReplayRecovery)Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code