refactor(server): project reads and replay stats leave ProjectionSnapshotQuery - #14012
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR reroutes numerous production project reads, removes a shared projection writer, and changes WebSocket replay budgeting across the runtime dependency graph. The targeted tests are helpful, but the scope and runtime impact exceed an auto-approvable refactor. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
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. |
…shotQuery Project shells now come from ProjectStoreV2 when a caller needs only the row, and from ProjectService.getShell/listShells when it reads repository identity. Shell-resume replay stats come from OrchestrationEventStore.getReplayStats, which measures only the retained application events a resume replays. The Orchestrator, RuntimePolicy, thread title regeneration and the replay harness read ProjectStoreV2, so ProjectionProjectRepository is deleted along with the V1 pipeline's project projector, which nothing has run since the V1 engine went away. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
| }, | ||
| ) { | ||
| override get message(): string { | ||
| return `Active project '${this.conflictingProjectId}' already exists for workspace root '${this.workspaceRoot}'.`; |
There was a problem hiding this comment.
This error persists and displays the unrestricted workspace root from a command. Please keep the raw value out of the error's public attributes/message (and rejected receipt), using bounded safe context such as the conflicting project ID instead.
Posted via Macroscope — Effect Service Conventions
|
Correction to my Effect Service Conventions review: the comments on Posted via Macroscope — Effect Service Conventions |
13f83a8 to
d75890c
Compare
Stacked on #13960.
Project reads still went through the V1
ProjectionSnapshotQuery(and itsProjectionProjectRepository), and shell resume measured its replay range there too. That kept a V1 read service in every layer that touched a project, and it is the last thing blocking deletion of the snapshot query.What changed
ProjectStoreV2. These callers need only the row, not repository identity: ws/http shell snapshots and the archived shell, startup auto-pull, storage cleanup, the auto-pull policy, thread settlement, the thread PR sweep,refreshPushedPullRequests, the agent-session scanner and the project-favicon asset lookup.listShellsgains an optionalprojectIdsfilter.ProjectService.getShell/listShells. They return immediately available identity, as before. Callers are the shell-stream project delta, PR list/summary (PullRequestService),linkCreatedPullRequest, the MCP PR tools and ws PR-sync key resolution. Both methods live on ProjectService, not in free functions.OrchestrationEventStore.getReplayStats({ afterSequence, throughSequence })measures the same(after, through]range thatreadApplicationEventsreplays: project events plus V2 thread events, via the application high-water index. The old query also counted V1 rows the resume never replays, so on imported installs it could fall back to a full snapshot early.ProjectionProjectRepositoryis deleted. Orchestrator (PR-sync workspace check),RuntimePolicy(renamedlayerFromProjectStore), thread title regeneration and the replay harness now readProjectStoreV2. The V1ProjectionPipeline's project projector was its last writer, and nothing has bootstrapped that pipeline since refactor(server): project commands commit through EventSinkV2 #13960 removed the V1 engine, so the projector is removed too. The repository's "model selection JSON" regression moved toProjectStore.test.ts.server.tsprovidesProjectStore.layeronce at the runtime core. The auto-pull policy, settlement and PR workers no longer build their ownOrchestrationInfrastructureLayerLive. The run-finalization observer getsProjectServiceLayerLiveby reference, so it shares the runtime's single ProjectService.ProjectionSnapshotQuerynow has two readers left,searchThreadsand GitManager's thread → project lookup. Both are the next PR's scope.No wire or contract change.
Verification
vp exec tsc --noEmit -p .(apps/server): 0error TS/warning TS.vpr knip:check: clean.vp linton touched files: no new warnings (the remaining ones predate this branch).vp test run, in small groups, all passing:ProjectService.test.ts,ProjectService.deletion.test.ts,ProjectStore.test.ts(new),ProjectCommands.test.ts,ProjectionRepositories.test.ts,http.test.ts,cli/project.test.tslinkCreatedPullRequest.test.ts, MCPpullRequests/handlers.test.ts,McpHttpServer.test.ts,worktree/registration.test.ts,ThreadPullRequestService.test.ts,ThreadSettlementService.test.ts,PullRequestService.test.ts,PullRequestSyncReactor.test.ts,AgentSessionScanner.test.ts,RuntimePolicy.test.ts,ThreadTitleRegenerationService.test.ts,AgentAwarenessRelay.test.ts,GrokAdapterV2.test.ts,ThreadLaunchService.test.tsruntimeLayer.test.ts,serverRuntimeStartup.test.ts,storageCleanup.test.ts,ws.test.ts,VcsStatusBroadcaster.test.ts,integration/transferBudgetV2.integration.test.tsOrchestrationEventStore.test.ts(adds agetReplayStatsassertion that excludes V1 rows),OrchestrationEventStore.sequence.test.tsLegacyV1Cutover.integration.test.ts,LegacyV1ThreadImporter.test.ts,V1ImportBoundary.test.ts,ProjectSettingsUpgrade.integration.test.ts,055_*(3 files),056_*OrchestratorReplayFixtures.integration.test.ts+.contract.test.ts,OrchestratorReplayRecovery.integration.test.tsModel: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code