feat(policy): declarative host mount schema, validation, and CLI (#1045)#1189
Draft
AddyM wants to merge 1 commit intoNVIDIA:mainfrom
Draft
feat(policy): declarative host mount schema, validation, and CLI (#1045)#1189AddyM wants to merge 1 commit intoNVIDIA:mainfrom
AddyM wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This was referenced Apr 1, 2026
Contributor
|
✨ Thanks for submitting this pull request, which proposes a way to implement declarative host mount schema, validation, and CLI. Possibly related open issues: |
…VIDIA#1045) - Add mounts: section to openclaw-sandbox.yaml policy schema - Add MountConfig type, validateMountPath, loadPolicyMounts in runner.ts - Refactor buildPlan() as single source of truth for plan construction - Add bin/lib/mounts.js for policy YAML mount management - Add mount-list and mount-add CLI commands to nemoclaw CLI - Emit warning when mounts declared but OpenShell lacks --volume support - Add test coverage for validation and YAML parsing - Runtime enforcement pending upstream NVIDIA/OpenShell#500
a8eceb3 to
2e86405
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the NemoClaw-side contract for declarative host filesystem mounts, as proposed in #1045. This PR adds the policy schema, validation, CLI commands, and runner integration — everything except runtime enforcement, which is pending upstream OpenShell
--volumesupport (NVIDIA/OpenShell#500).What's included
Policy schema — New
mounts:section inopenclaw-sandbox.yamlalongside existingnetwork:andfilesystem:policies. Each entry declareshost_path,container_path, and optionalread_only.Validation —
validateMountPath()enforces absolute paths, rejects..traversal and null bytes. Implemented in bothrunner.ts(TypeScript plugin) andbin/lib/mounts.js(CLI layer) with sync comments to prevent drift.Runner integration — Extracted
buildPlan()as a shared helper so bothactionPlanandactionApplyuse a single source of truth. Mounts are loaded, validated, and threaded throughRunPlan. No duplicate YAML reads.CLI commands —
nemoclaw <name> mount-add <host-path> <container-path> [--read-only]andnemoclaw <name> mount-listwith deduplication, usage hints, and guidance on OpenShell#500 status.Warning path — When mounts are declared,
actionApplyemits a clear stderr warning referencingNVIDIA/OpenShell#500instead of passing unsupported--volumeflags.Tests — 11 passing tests covering
validateMountPathandparseMountsFromYaml.addMountToPolicytests are skipped pending a CJS/ESM mock interop fix (documented in TODO).What's NOT included
Runtime enforcement via
--volumeonopenshell sandbox create. OpenShell#500 was closed as not planned. I intend to open a narrowly scoped upstream proposal for a minimal bind mount flag. This PR becomes the first consumer when that lands.Why ship the interface ahead of enforcement
The schema, validation, and CLI are independently valuable — they let the community converge on the contract now so there's no second design cycle when OpenShell adds volume support.
Closes #1045 (Phase 1)