Repository navigation
fix(review): support Git null device on Windows - #1303
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 8:27 PM ET / August 30, 2026, 00:27 UTC. ClawSweeper reviewWhat this changesThe PR uses Git for Windows’ Merge readinessThis is a narrow, correct Windows compatibility repair with sufficient native and POSIX behavior evidence; it remains open for normal maintainer landing. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s review reader invokes Git to collect repository evidence before a model review. Its environment and command-line settings isolate those reads from inherited Git configuration, hooks, and ancestry overrides. flowchart LR
A[Local review request] --> B[Hardened Git reader]
B --> C[Platform device selection]
C --> D[Isolated Git command]
D --> E[Repository evidence]
E --> F[Review decision]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep the platform-specific isolation boundary and land the focused repair once the draft is ready for maintainer approval. Do we have a high-confidence way to reproduce the issue? Yes — the captured native Windows trace reproduces the incompatible device spelling on the fetched main behavior and shows the Is this the best way to solve the issue? Yes — choosing the device spelling at the existing reader boundary preserves all isolation controls and leaves POSIX on its prior AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9f4da9302aea. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Summary
Fixes native Windows local committed-range review after hardened Git reads were introduced. The hardened reader now uses Git-for-Windows'
NULdevice spelling on Windows and retains Node'sos.devNullvalue on POSIX.Problem
Node 24 reports
os.devNullas\\\\.\\nulon Windows. Git for Windows 2.52 rejects that spelling when it is supplied throughGIT_CONFIG_GLOBAL, soreadReviewGitfailed before the trusted-input scanner could infer the local range.Implementation
gitNullDevicevalue insrc/pr-review-evidence.ts.core.hooksPath,GIT_CONFIG_GLOBAL, andGIT_GRAFT_FILEnull-device targets.Platform classification
This is a category-1 product/runtime defect in native Windows local review only. It is not a hosted-workflow or repository-wide cross-platform CI change. POSIX keeps its previous
/dev/nullbehavior.Validation
pnpm run build,node --test test/pr-review-evidence.test.ts, and an independent rawreadReviewGitinvocation passed. Direct Git reproduction showedGIT_CONFIG_GLOBAL=NULsucceeds whileGIT_CONFIG_GLOBAL=\\\\.\\nulfails withfatal: unable to access '\\\\.\\nul': Invalid argument.pnpm run build:allpassed.pnpm exec oxlint src/pr-review-evidence.ts --tsconfig tsconfig.json --type-aware --deny-warnings --report-unused-disable-directives -D correctness -D preserve-caught-errorpassed.pnpm exec oxlint test/pr-review-evidence.test.ts --deny-warnings --report-unused-disable-directives -D correctness -D preserve-caught-errorpassed.pnpm exec oxfmt --check src/pr-review-evidence.ts test/pr-review-evidence.test.tsandgit diff --check origin/main...HEADpassed.pnpm run review -- --local-range --target-repo openclaw/clawsweeper --base origin/maincompleted locally for the one committed range:decision=keep_open,confidence=high.origin/mainfound no actionable issues.Real Behavior Proof
Claim: hardened raw Git reads work on native Windows without weakening isolation, and POSIX retains its null-device behavior.
Surface/scenario: a malformed inherited
GIT_CONFIG_GLOBALwould normally make Git fail; the reader must provide its own compatible null device for raw reads. The focused test creates a temporary Git repository, sets a malformed parent global config, callsreadReviewGit(..., ["rev-parse", "--is-inside-work-tree"]), and checks both successful output and parent-env preservation.Native trace: Windows Node v24.13.0 / Git for Windows 2.52.0 ran the focused test successfully. Independent device experiment:
GIT_CONFIG_GLOBAL=NULreturnedtruewith exit 0;GIT_CONFIG_GLOBAL=\\\\.\\nulexited 128 with Git's invalid-argument error.Hosted POSIX trace: Crabbox AWS/Linux run
run_1a8c9178a38a, leasecbx_8b6e29cb4336(crimson-shrimp), c7a.8xlarge, promoted AMIami-0461d919be7deb53cin eu-west-1. The exact two-file dirty worktree was synced (dirty_delta=2) with--no-hydrate; remote command wascorepack enable && pnpm install --frozen-lockfile,pnpm run build, thennode --test test/pr-review-evidence.test.ts. Exit 0; frozen install, build, and the one POSIX test passed. Timing JSON: lease 58.289s, sync 18.281s, command 11.278s, total 31.590s, end-to-end 90.854s. Crabbox reportedleaseStopped=true; a subsequent lease listing did not containcbx_8b6e29cb4336.Limits: the hosted run proves retained POSIX behavior, while the focused native test and direct Git experiment prove the Windows device contract. The broader native unit fixtures still contain unrelated direct uses of Node's Windows null-device spelling; this change intentionally does not expand into those separate surfaces.
Risk and rollout
Low risk: the patch changes only the spelling passed to the already-hardened reader on Windows. It does not alter source validation, network isolation, scanner behavior, hosted workflows, or platform policy. User-visible outcome is that local committed-range review can progress to the scanner/model phases on native Windows.
Related: CSW-143 and CSW-145 were blocked by this independent local-review regression.