Repository navigation
test(infra): realpath sandbox migration temp root for macOS - #117261
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 2:32 AM ET / 06:32 UTC. ClawSweeper reviewWhat this changesThe PR canonicalizes the sandbox-migration test’s temporary home directory so macOS Merge readinessThis is a correct, narrowly scoped macOS test-infrastructure repair: the test builds paths from a raw temporary root while the state store canonicalizes workspace identities. Keep it open because the protected Priority: P3 Review scores
Verification
How this fits togetherThe Doctor workspace-migration suite creates a temporary OpenClaw home, derives sandbox workspace paths, and imports retired workspace state into SQLite. Sandbox layout helpers feed those paths into workspace-state identity code, which canonicalizes filesystem paths before migration assertions inspect the result. flowchart LR
A[Temporary macOS home] --> B[Test setup]
B --> C[Sandbox workspace layout]
C --> D[Doctor state migration]
D --> E[Canonical workspace identity]
E --> F[Migration assertions]
Decision needed
Why: The patch is source-supported and has no actionable review finding, but protected-label policy requires an explicit maintainer landing decision. Before merge
Agent review detailsSecurityNone. PR surfaceTests +2. Total +2 across 1 file. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the scoped setup-level canonicalization after maintainer confirmation of the reported macOS run, while leaving the generic temporary-directory helper unchanged for its unrelated consumers. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a high-confidence macOS path mismatch: the test seeds a raw Is this the best way to solve the issue? Yes. Normalizing once in this suite’s shared setup repairs every affected assertion at the boundary where the raw temporary path enters the test, without changing the generic helper’s behavior for unrelated callers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0a146d5a18f1. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
src/infra/state-migrations.workspace-setup-sandbox.test.tsfails 14 of 18 tests locally on macOS (passing on Linux CI) with/var/foldersvs/private/var/foldersmismatches. The suite builds all expectations from a rawmkdtemproot underos.tmpdir(), which on macOS is a/var → /private/varsymlink, while the production resolvers under test return canonical paths.Why This Change Was Made
Root
AGENTS.mdprescribes the exact fix for this class: "Tests asserting resolver/root-containment paths: fs.realpath mkdtemp/tmp roots first." The suite has a single temp-root construction site (setup()), so the fix is onefs.realpathSync(...)around it plus the required invariant comment. The sharedtest/helpers/temp-dir.tshelper is deliberately untouched — canonicalizing it would change every consumer, beyond this fix's scope.User Impact
None at runtime — test-only. Maintainers and agents on macOS get a green local run for this suite instead of 14 false failures.
Evidence
node scripts/run-vitest.mjs src/infra/state-migrations.workspace-setup-sandbox.test.ts— 18/18 pass on macOS (Darwin 27).realpathSyncis an identity transform on a non-symlinked tmpdir.🤖 Generated with Claude Code