Repository navigation
refactor(cli): normalize policy command ids - #2918
Conversation
This reverts commit 4ebeae4.
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR modernizes the CLI command registry and routing by adding a new ChangesCLI Command Routing Modernization
Sequence DiagramsequenceDiagram
participant User
participant Dispatch as resolveSandboxOclifDispatch
participant Handlers as Oclif Handlers
User->>Dispatch: sandbox doctor [args]
Dispatch->>Dispatch: Check action == "doctor"
Dispatch->>Handlers: Route to sandbox:doctor command
Handlers->>Handlers: Execute SandboxDoctorCliCommand
Handlers-->>User: Result
User->>Dispatch: sandbox policy-add --from-file file.yaml
Dispatch->>Dispatch: Check action == "policy-add"
Dispatch->>Handlers: Route to sandbox:policy:add command
Handlers->>Handlers: Execute PolicyAddCommand
Handlers-->>User: Result
User->>Dispatch: sandbox doctor --help
Dispatch->>Dispatch: Detect --help flag
Dispatch-->>User: Return help usage (public, not routed)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
## Summary Remove the stale legacy naming from the oclif dispatch helper now that sandbox and global commands route through explicit oclif adapters. This is a small naming cleanup in the architecture follow-up stack. ## Stack Navigation - Position: 24 of 60 - Previous PR: [#2916 — refactor(cli): extract public argv normalizer](#2916) - Next PR: [#2918 — refactor(cli): normalize policy command ids](#2918) ## Changes - Renamed `legacy-oclif-dispatch` to `oclif-dispatch`. - Updated the CLI entrypoint and dispatch tests to import the renamed module. - Kept dispatch behavior unchanged. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [x] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `make docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added sandbox `doctor` command for health diagnostics across Host, Gateway, Sandbox, Inference, Messaging, and Local services. * Enhanced logs command with `--tail/-n`, `--since` filtering, and `--follow` output controls. * Onboard now supports `--non-interactive` and `--fresh` flags. * Debug command adds `--quick/-q` option. * **Improvements** * Channel mutation, destroy, rebuild, and maintenance commands now support `-y` shorthand flag. * Share command refactored with dedicated `mount`, `unmount`, `status` subcommands. * Stricter argument validation across CLI commands. * Added command usage examples throughout CLI. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
## Summary Make oclif command metadata the enforced source for public command help basics. This adds a metadata guard and fills the remaining missing example on the deprecated deploy adapter. ## Stack Navigation - Position: 26 of 60 - Previous PR: [#2918 — refactor(cli): normalize policy command ids](#2918) - Next PR: [#2920 — refactor(cli): return typed debug parse results](#2920) ## Changes - Added a command metadata test for registered public oclif commands. - Required each public command class to provide summary, description, usage, and examples. - Added a deploy command example to satisfy the metadata contract. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [x] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `make docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added sandbox diagnostic command for health checks and troubleshooting * Enhanced log viewing with tail count, duration filtering, and follow options * Improved command structure with new dedicated commands for share, skill, and snapshot operations * **Documentation** * Updated CLI reference with additional flag options across multiple commands, including shorthand variants (`-y`, `-q`, `-v`) and new parameters * **Improvements** * Enhanced error handling and validation for CLI arguments * Expanded command examples throughout the interface <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Start normalizing sandbox-scoped internal command IDs by moving policy commands to topic-style IDs. Public CLI syntax stays unchanged (
policy-add,policy-remove,policy-list).Stack Navigation
Changes
sandbox:policy:add,sandbox:policy:remove, andsandbox:policy:list.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
New Features
sandbox:doctorCLI commandImprovements
sandbox:policy:add,sandbox:policy:list,sandbox:policy:removesandbox:config getwith JSON and YAML format options