Repository navigation
fix(node-host): honor umask in Git transfer mode assertions - #140771
Conversation
Keep full permission assertions aligned with Git checkout's umask-filtered file creation, while retaining exact modes for chmod'ed downloads. Proof: node scripts/run-vitest.mjs src/node-host/node-worker-transfer-client.git.test.ts Passes locally under normal and 002 masks and on Testbox (12 passed).
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 12:29 AM ET / 04:29 UTC. ClawSweeper reviewWhat this changesThe PR makes Git-transfer permission assertions respect the process umask while retaining exact permissions for downloaded replacements. Merge readiness✅ Ready for maintainer review This remains a useful, narrowly scoped correction: current main retains the faulty permission expectations. No actionable correctness or security findings were found. Priority: P2 Review scores
Verification
How this fits togetherNode workers reconstruct workspaces from Gateway manifests, Git objects, and downloaded files. These tests verify the resulting files, permissions, symlinks, and workspace replacement behavior. flowchart TD
A[Gateway workspace manifest] --> B[Worker workspace transfer]
C[Git objects] --> B
B --> D[Git checkout applies umask]
B --> E[Downloaded files receive chmod]
D --> F[Workspace assertions]
E --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +4. Total +4 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep permission assertions aligned with each file-creation path while preserving the existing transfer integrity and replacement coverage. Do we have a high-confidence way to reproduce the issue? Yes: the current-main suite assumes 0644/0755, while its Git checkout path produces 0664/0775 under umask 0002. The supplied body reports this reproduction; this review did not execute it. Is this the best way to solve the issue? Yes: adjusting the expectations to Git's creation contract is narrower than changing production permissions or forcing the test environment's umask. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 91764e29f154. 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.
|
…#140771) Keep full permission assertions aligned with Git checkout's umask-filtered file creation, while retaining exact modes for chmod'ed downloads. Proof: node scripts/run-vitest.mjs src/node-host/node-worker-transfer-client.git.test.ts Passes locally under normal and 002 masks and on Testbox (12 passed).
Related: #140696, #140628
What Problem This Solves
Resolves a problem where native Testbox landing gates fail seven node-worker Git transfer cases under umask
0002, including PRs that do not change node-host. The tests expected literal0644/0755, while Git correctly checked out0664/0775.Why This Change Was Made
Worker workspace manifests and file matching use Git executable-bit semantics, as documented in
docs/gateway/cloud-workers.md. Git-base materialization delegates togit checkout-index, whose file creation uses0666or0777subject to umask. The test now derives those full permission expectations fromprocess.umask(). Downloaded replacements still require exact0755, matching the client's explicit chmod.The canonical materialization and matching owners remain unchanged. No production behavior, public API, configuration, or compatibility export changes.
User Impact
No runtime behavior change. Maintainers can validate unrelated changes on Testbox without these false permission failures. Executable-bit changes, unchanged-base blob reuse, contents, symlinks, and atomic replacement remain covered.
Evidence
Clean-main baseline
a7f2413c4b0b899e7b9733fea6070d027bbac1b7: focused Testbox suite failed 7 cases, with 5 passed and 1 existing Windows-only test skipped. Errors were436 != 420and509 != 493.Provider
blacksmith-testbox, leasetbx_01m1wyd1knvd25jx20byc3zehh, Actions run 34079614439.Same-lease probes:
umaskreturned0002;git config --show-origin --get-all core.sharedRepositoryreturned no values;stat -c '%a %n'showed a fresh regular file664, a Git-checked-out regular file664, and Git-checked-out executable775. Global/system config is disabled for worker Git commands.Baseline command:
node scripts/crabbox-wrapper.mjs run --id tbx_01m1wyd1knvd25jx20byc3zehh --timing-json -- node scripts/run-vitest.mjs src/node-host/node-worker-transfer-client.git.test.ts.Local focused suite passed under the normal mask and under
umask 002: 12 passed, 1 existing Windows-only test skipped each. The unpatched suite reproduced all seven failures locally underumask 002.Codex autoreview through P2: no actionable findings.
Patched Testbox focused suite: 12 passed, 1 existing Windows-only test skipped, using
node scripts/crabbox-wrapper.mjs run --timing-json -- node scripts/run-vitest.mjs src/node-host/node-worker-transfer-client.git.test.ts. Providerblacksmith-testbox, leasetbx_01m1x0k1fqnyc6y25ksyrt3qsz, Actions run 34081747692.node scripts/check-changed.mjs: passed. The first run encountered seven unrelated type errors from a stale local@openclaw/fs-safe 0.8.1install;pnpm install --frozen-lockfilealigned it with the branch's existing0.8.3pin, and the retry passed. No Windows execution was performed for this POSIX-only assertion change.Native review artifacts validated with
READY FOR /prepare-prand zero findings.OPENCLAW_TESTBOX=1 scripts/pr prepare-run 140771passed using hosted evidence for published head9ab6eef9d8a6a398447f46a2976eb9d4ba584d1e.node scripts/watch-pr-ci.mjs 140771 9ab6eef9d8a6a398447f46a2976eb9d4ba584d1ereturned GREEN,pending=0, for CI run 34082418079.