← Back to Pull requests

feat: one-command migration of storage.sdkPath #839

Open
unknown opened this pull request with 334 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 27, 2026 10:05 UTC
Author

Background

Updating storage.sdkPath via vfox config only changes the setting and leaves previously installed SDKs behind. Moving an install root to another location requires manually relocating files, updating existing symlinks and environment paths, or reinstalling SDKs.

Summary of the fix

Adds vfox migrate <path> (cmd/commands/migrate.go) backed by Manager.MigrateSdkPath (internal/sdk_path_migrate.go) to validate the destination, move entries from the current install root, and write the new storage.sdkPath to the user config. Cross-device moves fall back to a copy preserving symlinks and junctions, directory links pointing into the old root are retargeted in the global sdks dir, the invoking project's .vfox/sdks, and session dirs under $VFOX_HOME/tmp (links in other projects are not touched; rerun vfox use there), absolute symlinks inside the moved SDKs that point into the old root are rewritten, only vfox-managed SDK directories move (anything else in the root is refused), migration refuses while an install lock is held, and failures prior to saving config roll back moved entries and links. On Windows, env.RewriteInstallRootInRegistry rewrites matching path prefixes in HKEY_CURRENT_USER\Environment (warning without rollback on error). Updates Clink completions, documentation, and unit/CLI tests.

Verification

Ran gofmt -l cmd/cmd.go cmd/commands/cli_test.go cmd/commands/migrate.go cmd/commands/migrate_cli_test.go internal/env/registry.go internal/env/registry_stub.go internal/env/registry_utils.go internal/env/registry_utils_test.go internal/env/registry_windows.go internal/sdk_path_migrate.go internal/sdk_path_migrate_test.go internal/shell/clink_test.go with no unformatted files reported. Ran go vet ./cmd/... ./cmd/commands/... ./internal/... ./internal/env/... ./internal/shell/... with no issues reported. Ran go test ./cmd/... ./cmd/commands/... ./internal/... ./internal/env/... ./internal/shell/... and all test packages passed. Ran go test ./internal/sdk -v in a Linux container (golang:1.24) for the vfox newCmd change; it passed. The tests in cmd/commands/cli_test.go, cmd/commands/migrate_cli_test.go and internal/env/registry_utils_test.go and the other changed tests fail without the fix in the vfox newCmd change (checked by reverting the source changes).

The changed test cmd/commands/cli_test.go did not run here: no test runner for it was available. The new test cmd/commands/migrate_cli_test.go did not run here: no test runner for it was available. The changed test internal/env/registry_utils_test.go did not run here: no test runner for it was available.

Fixes #307

Diff: 334 lines (+250 / -84) across 4 files Reviewer: mvanhorn Review duration: 4609m
All Vouch review confidence checks passed
Residual risk 0.35 = Change Risk (0.65) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.65 · 334 lines diff across 4 files
0.65
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.348
Shallow Review Depth shallow_review_depth
0.344
Sensitive Paths sensitive_paths
0.065
Real PR Conversation Timeline
1 comments
"Review active on #839"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 65.3% (HIGH) · Higher = larger blast radius
65.3%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 34.8% · Safe to merge
34.8%