Skip to content

feat(policy): declarative host mount schema, validation, and CLI (#1045)#1189

Draft
AddyM wants to merge 1 commit intoNVIDIA:mainfrom
AddyM:feat/declarative-host-mounts
Draft

feat(policy): declarative host mount schema, validation, and CLI (#1045)#1189
AddyM wants to merge 1 commit intoNVIDIA:mainfrom
AddyM:feat/declarative-host-mounts

Conversation

@AddyM
Copy link
Copy Markdown

@AddyM AddyM commented Mar 31, 2026

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 --volume support (NVIDIA/OpenShell#500).

What's included

Policy schema — New mounts: section in openclaw-sandbox.yaml alongside existing network: and filesystem: policies. Each entry declares host_path, container_path, and optional read_only.

ValidationvalidateMountPath() enforces absolute paths, rejects .. traversal and null bytes. Implemented in both runner.ts (TypeScript plugin) and bin/lib/mounts.js (CLI layer) with sync comments to prevent drift.

Runner integration — Extracted buildPlan() as a shared helper so both actionPlan and actionApply use a single source of truth. Mounts are loaded, validated, and threaded through RunPlan. No duplicate YAML reads.

CLI commandsnemoclaw <name> mount-add <host-path> <container-path> [--read-only] and nemoclaw <name> mount-list with deduplication, usage hints, and guidance on OpenShell#500 status.

Warning path — When mounts are declared, actionApply emits a clear stderr warning referencing NVIDIA/OpenShell#500 instead of passing unsupported --volume flags.

Tests — 11 passing tests covering validateMountPath and parseMountsFromYaml. addMountToPolicy tests are skipped pending a CJS/ESM mock interop fix (documented in TODO).

What's NOT included

Runtime enforcement via --volume on openshell 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)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2cc24289-ac78-491d-9e09-0ccdbec33012

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@wscurran wscurran added status: triage For new items that haven't been reviewed yet. NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). enhancement: feature Use this label to identify requests for new capabilities in NemoClaw. and removed status: triage For new items that haven't been reviewed yet. labels Apr 1, 2026
@wscurran
Copy link
Copy Markdown
Contributor

wscurran commented Apr 1, 2026

✨ 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
@AddyM AddyM force-pushed the feat/declarative-host-mounts branch from a8eceb3 to 2e86405 Compare April 2, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement: feature Use this label to identify requests for new capabilities in NemoClaw. NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Declarative Interface for Host Filesystem Access and Volume Mounting (WSL/Local Dev)

2 participants