fix(sandbox): strip group-write from staged Docker payloads - #7514
Conversation
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
📝 WalkthroughWalkthroughUpdated Docker-copy permission normalization to remove group and other write bits from directories and files while preserving readable and executable semantics. Expanded sandbox tests cover direct normalization and optimized and legacy staging. ChangesSandbox permissions
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Review Advisor — InformationalAdvisor assessment: Informational / high confidence Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: None 1 optional E2E recommendation
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Summary
A normal
0002checkout can stage executable Docker payloads as0775, so the exact metadata gate added by #7486 aborts a sandbox replacement build. This change clears group and other write bits while preserving owner write and executable intent, so permissive and restrictive source modes both produce canonical Docker payload modes without weakening the gate.Changes
normalizeReadModesForDockerCopy()before adding the read, traverse, and executable permissions required by Docker.0775directory and executable fixtures plus a0664non-executable fixture. The tests assert exact staged modes of0755and0644.0700directories and executables plus0600ordinary files.patch-bundled-npm-tar.mts, and perf(openclaw): collapse final image payload layers #7486 made its preserved0775mode fail the exact0755assertion.nc-july26from base SHA3b2f6d557. A transactional rebuild with0775and0664source inputs completed the strict payload metadata stage, replacement creation, state restore, policy restore, and deployment health checks.Type of Change
Quality Gates
Documentation Writer Review
no-docs-neededDGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpx vitest run test/sandbox-build-context.test.ts src/lib/onboard/build-context-stage.test.ts src/lib/actions/sandbox/rebuild-managed-image-preparation.test.ts(22/22 passed);npm run typecheck:clipassed; Brevnc-july26rebuild passed the strict Docker payload metadata stage and completed successfully.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Signed-off-by: Senthil Ravichandran senthilr@nvidia.com