chore(host-service,trpc,cli,desktop): decouple the app from v2_projects
Severs the app's remaining dependence on the cloud v2_projects table, so it can be dropped later and the projects name reclaimed for the cloud-only projects model. This PR does not drop the table.
Prior audit found zero v2Project.* callers in desktop/mobile/CLI/SDK/MCP — only host-service call sites remained. Re-verified before editing.
Removed
- dead
v2Projectprocedureslist/create/update(zero callers) + their orphaned helpers project.setup's cloud-lookup fallback: origin now comes from the local row or theoriginparam. When neither is present it throws a typed NOT_FOUND with a mode-specific message (same status the cloud lookup produced for this case, so no client behavior flips)- the "legacy adopt only"
linkRepoCloneUrlwrite-back and the fire-and-forgetv2Project.deletecleanup inproject.remove project-backfill's cloud arm — now a pure local sweep (kept: it still writes real names and emitsproject:changed, which readers depend on)- the automation router's
verifyProjectInOrg+ 4 call sites — already a no-op for local-first projects; real authorization isverifyHostAccess isInternalBuild()(zero callers after #6434) andplans/host-integration-test.md→plans/done/(it cited tests/docs deleted in #6434)
Kept, fenced: findByGitHubRemote in project.findByPath, reachable only via walkAllRemotes: true from the v1→v2 importer. Commented as the last v2_projects consumer, dying with the importer. Verified by grep: it is now the only production v2Project.* call repo-wide.
Callers updated to pass origin
- CLI
projects setup: new--repo-url/--nameflags plus automatic resolution (explicit flags → target host's project.list → this machine's host service → actionable error). Existing invocations keep working with no new flags - desktop v1-migration: passes
originfrom the candidatefindByPathalready returned, mirroringSetupProjectModal
Tests: adapted rather than deleted — cloud-fallback cases became origin-based equivalents, plus a new test asserting the failure path for both clone and import and that zero v2Project.* calls occur.
Verification: lint exit 0 · typecheck exit 0 (37/37) · sherif exit 0 · cli 99/99 · desktop 2695/2695 · host-service 1069 pass with 3 failures, all pre-existing/flaky under parallel load and in files untouched here (confirmed passing in isolation); the 5 modified test files run together 76/76.
Follow-up: v2Project.get/delete/linkRepoCloneUrl now have zero callers but were left in the router — they cost nothing until the table drop and can go with it.
Follows #6431, #6434, #6435 in the Sandbox Workspaces cleanup track.
Summary by cubic
Decouples the app from the cloud v2_projects table. project.setup no longer falls back to a cloud lookup; previously it used the cloud row, now it uses the local row or a caller-provided origin and returns NOT_FOUND when neither exists.
- Removes dead
v2Project.list/create/updateprocedures and cloud write-backs;project-backfillis now a pure local sweep. - Required migration: callers setting up a project on a host with no local row must pass
origin.repoCloneUrl(and optionallyorigin.name). - CLI
projects setupadds--repo-urland--name, with auto-resolution from the target or local host; existing invocations keep working. - Desktop v1 migration now supplies
origin. Automation router drops legacyverifyProjectInOrg; authorization remainsverifyHostAccess. - Keeps one fenced cloud use:
findByGitHubRemoteinproject.findByPath, reachable only via the v1→v2 importer. - Removes
isInternalBuild()and retiresplans/host-integration-test.md. Tests assert theoriginpath and zerov2Project.*calls.
Summary by CodeRabbit
-
New Features
- Project setup now accepts optional repository URL and project name values.
- Imported projects retain their repository origin and name during setup.
- Setup can automatically use available local project information.
-
Changes
- Project creation and updates are no longer available through the project API.
- Project setup and deletion now operate locally without cloud project synchronization.
- Setup reports a clear error when repository details are unavailable and must be provided manually.
-
Documentation
- Added an integration testing plan covering host sessions, persistence, restarts, and supported client flows.