cmd/limactl: remove subdirectories in factory-reset #5899
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 229 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.325
Real PR Conversation Timeline
1 comments
"Review active on #5899"
general
weight: 0.35
AkihiroSuda
What This PR Changes
uses
os.RemoveAllinstead ofos.RemoveinfactoryResetAction(cmd/limactl/factory-reset.go) so non-empty instance subdirectories (swtpm/,sock/,cidata/) are cleaned up duringlimactl factory-reset, while still preservinglima-version,protected,vz-identifier, and.yaml/.ymlfiles.added a regression test in
cmd/limactl/factory-reset_test.go.Linked Issue (Required in most cases)
N/A (small fix: 1 line in
cmd/limactl/factory-reset.go+ unit test incmd/limactl/factory-reset_test.go)How I Tested This
environment: Linux Mint 22.3 (
x86_64),upstream/master(35e17bd8)<img width="866" height="559" alt="image" src="https://github.com/user-attachments/assets/34d2e6a8-68b8-4965-96a8-def8d238582c" />
verified with real
limactl factory-reset(LIMA_HOME=$(mktemp -d), instance with populatedswtpm/,sock/,cidata/subdirs):35e17bd8): loggedERRO[0000] remove .../cidata: directory not empty,.../sock: directory not empty,.../swtpm: directory not empty, leaving all three directories behind.bdb062b0): removedcidata,sock, andswtpmwith zero errors while keepingcloud-config.yaml,lima-version, andlima.yaml.not tested: macOS (
vz/vz-aux/vz-efi—GOOS=darwinrequires macOSvzcgo SDK) and Windowswsl2VM runs.AI Usage
Assisted-by: Antigravity