Skip to content

test: expand core and CLI coverage#454

Merged
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
willkill07:wkk_test/core-cli-coverage
Jul 16, 2026
Merged

test: expand core and CLI coverage#454
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
willkill07:wkk_test/core-cli-coverage

Conversation

@willkill07

@willkill07 willkill07 commented Jul 16, 2026

Copy link
Copy Markdown
Member

Overview

Add focused core and CLI tests for deterministic error, plugin, event, file-I/O, and Guardrails execution paths.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Add core coverage for dynamic plugin validation and teardown errors, type editor defaults, upstream failures, and local Guardrails LLM/tool paths.
  • Add CLI coverage for event normalization, bounded file reads, snapshot restoration, and hook response failures.
  • Move dynamic-host unit tests out of the production source file so coverage reflects runtime code only.

Where should the reviewer start?

  • crates/core/tests/unit/plugin_dynamic_host_tests.rs for the dynamic plugin coverage and source-test relocation.
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs for end-to-end local Guardrails coverage.
  • crates/cli/tests/coverage/shared/events_tests.rs for CLI event normalization coverage.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • Relates to: none

Summary by CodeRabbit

  • Tests
    • Added/expanded coverage for bounded regular-file reads/streaming, directory-path rejection messaging, and backup/snapshot restore behavior (including restoring a missing-file snapshot).
    • Added coverage for stable agent metadata naming and JSON path helper behavior (nested extraction, owned values, and string conversion rules).
    • Added guardrail/“fail closed” hook handling verification across multiple HTTP status/error combinations.
    • Improved unit test coverage for dynamic plugin host behavior (poisoned-registry cleanup, specification validation, error context messaging, and retained runtime error details) and for editor list-item default representations.
    • Added Unix-only local backend tests validating LLM/tool request rewriting and blocked input early-fail behavior.

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07
willkill07 requested a review from a team as a code owner July 16, 2026 13:22
@github-actions github-actions Bot added size:L PR is large Test Test related lang:rust PR changes/introduces Rust code labels Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Added CLI and core coverage tests, moved dynamic plugin host tests into an external module, and expanded local NeMo Guardrails tests for request rewriting and blocked rails.

Changes

Coverage and test organization

Layer / File(s) Summary
CLI helper coverage
crates/cli/src/events/mod.rs, crates/cli/tests/coverage/shared/*
Adds event metadata and JSON path tests, file I/O and snapshot tests, and hook status handling coverage.
Core error and configuration coverage
crates/core/tests/coverage/error_tests.rs, crates/core/tests/unit/types_tests.rs
Tests upstream failure classification and editor list-item default representations.
Externalized dynamic host tests
crates/core/src/plugin/dynamic/host.rs, crates/core/tests/unit/plugin_dynamic_host_tests.rs
Moves inline tests to a dedicated module and covers poisoned-registry cleanup, validation, error context, and retained runtime errors.
Local NeMo Guardrails integration coverage
crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
Adds runtime setup/reset helpers and tests request rewriting, tool-call rewriting, and blocked input rails.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the test-coverage expansion.
Description check ✅ Passed The description matches the template structure and covers overview, details, reviewer start, and issue linkage.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@willkill07 willkill07 self-assigned this Jul 16, 2026
@willkill07 willkill07 added this to the 0.6 milestone Jul 16, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/cli/tests/coverage/shared/events_tests.rs`:
- Around line 24-27: Extend the tests for value_at_any and string_at_any with
cases where both candidate paths are valid, asserting that each function returns
the value from the first candidate. Keep the existing missing/invalid fallback
assertions unchanged, and place the new cases alongside the current
candidate-precedence tests.

In `@crates/core/tests/coverage/error_tests.rs`:
- Around line 56-78: Run the required validation before handoff: cargo fmt
--all, cargo clippy --workspace --all-targets -- -D warnings, just test-rust,
validate-change, uv run pre-commit run --all-files, and the full
Rust/Python/Go/Node.js test matrix for this crates/core change.

In `@crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs`:
- Around line 628-659: Update the LLM and tool blocking tests around
llm_call_execute and tool_call_execute to track each downstream callback with an
AtomicBool, setting it when invoked. After asserting the blocked-rail errors,
also assert both flags remain false, confirming the callbacks were never
executed while preserving the existing error assertions.
- Around line 528-534: Update reset_plugin_runtime() to return an RAII teardown
guard that restores the plugin configuration, shared runtime owner,
global_context, and thread scope stack when dropped. Ensure both affected tests
retain this guard until after test assertions and before test_mutex() is
released, including panic paths, and add or preserve coverage for cross-request
isolation where relevant.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: e184a199-54a8-4c73-bb96-916fcc6ac179

📥 Commits

Reviewing files that changed from the base of the PR and between 0c654b4 and c424378.

📒 Files selected for processing (9)
  • crates/cli/src/events/mod.rs
  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/cli/tests/coverage/shared/file_io_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/core/tests/coverage/error_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/unit/types_tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (18)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/cli/src/events/mod.rs
  • crates/core/tests/coverage/error_tests.rs
  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/cli/tests/coverage/shared/file_io_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions in Rust and Python: use snake_case.

Files:

  • crates/cli/src/events/mod.rs
  • crates/core/tests/coverage/error_tests.rs
  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/cli/tests/coverage/shared/file_io_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,py,js,mjs,cjs,ts,tsx}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • crates/cli/src/events/mod.rs
  • crates/core/tests/coverage/error_tests.rs
  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/cli/tests/coverage/shared/file_io_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use language-appropriate naming conventions: Rust snake_case, C FFI exports prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • crates/cli/src/events/mod.rs
  • crates/core/tests/coverage/error_tests.rs
  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/cli/tests/coverage/shared/file_io_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding // comment form.

Files:

  • crates/cli/src/events/mod.rs
  • crates/core/tests/coverage/error_tests.rs
  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/cli/tests/coverage/shared/file_io_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
{crates/**/src/**/*.rs,python/**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Do not add tests under src; Rust tests belong in crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • crates/cli/src/events/mod.rs
  • crates/core/src/plugin/dynamic/host.rs
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • crates/cli/src/events/mod.rs
  • crates/core/tests/coverage/error_tests.rs
  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/cli/tests/coverage/shared/file_io_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

Files:

  • crates/cli/src/events/mod.rs
  • crates/core/tests/coverage/error_tests.rs
  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/cli/tests/coverage/shared/file_io_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
{crates/core,crates/adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changes to crates/core or crates/adaptive must run the full language matrix

Files:

  • crates/core/tests/coverage/error_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
crates/core/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

If the change touched crates/core or shared runtime semantics, also use validate-change for broader validation

Files:

  • crates/core/tests/coverage/error_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
crates/{core,adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If crates/core or crates/adaptive changed, run the full validation matrix across Rust, Python, Go, and Node.js.

Files:

  • crates/core/tests/coverage/error_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
crates/{core,adaptive}/**/*.rs

⚙️ CodeRabbit configuration file

crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.

Files:

  • crates/core/tests/coverage/error_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/core/src/plugin/dynamic/host.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/core/tests/coverage/error_tests.rs
  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugin_dynamic_host_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/cli/tests/coverage/shared/file_io_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
{crates/core/src/plugin/dynamic/**,crates/plugin/**,crates/worker/**,crates/worker-proto/**,crates/types/**,python/plugin/**,examples/rust-native-plugin/**,examples/python-grpc-worker-plugin/**,docs/build-plugins/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Keep the stable boundary explicit: native plugins cross a C ABI, and worker plugins cross grpc-v1.

Files:

  • crates/core/src/plugin/dynamic/host.rs
{crates/core/src/plugin/dynamic/**/*.rs,examples/rust-native-plugin/**/*.rs}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Do not pass Rust runtime types, trait objects, futures, or allocator-owned strings across the native dynamic-library boundary.

Files:

  • crates/core/src/plugin/dynamic/host.rs
{crates/core/src/plugin/dynamic/**,examples/rust-native-plugin/**,examples/python-grpc-worker-plugin/**,docs/build-plugins/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Native and worker plugins are trusted extensions; document that native plugins are in-process and unsandboxed, and worker plugins provide process isolation but not a security sandbox.

Files:

  • crates/core/src/plugin/dynamic/host.rs
{crates/core/src/plugin/dynamic/**/*.rs,crates/plugin/**/*.rs,crates/worker/**/*.rs,crates/worker-proto/**/*.rs,python/plugin/**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Manifest validation must cover kind, compatibility, load contract, integrity, capability mismatch, and disabled-plugin behavior.

Files:

  • crates/core/src/plugin/dynamic/host.rs
crates/core/src/plugin/dynamic/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

The native loader must keep libraries alive until registered callbacks are cleared and must deregister plugin kinds before unload.

Files:

  • crates/core/src/plugin/dynamic/host.rs
🔇 Additional comments (10)
crates/core/tests/coverage/error_tests.rs (1)

56-78: LGTM!

crates/core/tests/unit/types_tests.rs (1)

22-25: LGTM!

Also applies to: 563-571

crates/cli/src/events/mod.rs (1)

54-56: LGTM!

crates/cli/tests/coverage/shared/events_tests.rs (1)

1-15: LGTM!

crates/cli/tests/coverage/shared/file_io_tests.rs (1)

36-57: LGTM!

Also applies to: 59-82

crates/cli/tests/coverage/shared/installer_tests.rs (1)

218-247: LGTM!

crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs (2)

21-31: LGTM!

Also applies to: 506-526


536-665: 📐 Maintainability & Code Quality

Confirm the required Rust and core validation completed.

Please verify this change passed cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, just test-rust, validate-change, the full Rust/Python/Go/Node matrix, and the final all-files pre-commit pass.

As per coding guidelines, Rust changes require these Rust checks, and changes under crates/core require broader validation.

Source: Coding guidelines

crates/core/tests/unit/plugin_dynamic_host_tests.rs (1)

1-116: LGTM!

crates/core/src/plugin/dynamic/host.rs (1)

400-401: 🎯 Functional Correctness

#[cfg(test)] is preserved on the relocated mod tests It stays out of non-test builds.

			> Likely an incorrect or invalid review comment.

Comment thread crates/cli/tests/coverage/shared/events_tests.rs
Comment thread crates/core/tests/coverage/error_tests.rs
@github-actions

Copy link
Copy Markdown

Signed-off-by: Will Killian <wkillian@nvidia.com>
Signed-off-by: Will Killian <wkillian@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs`:
- Around line 542-545: Update both PluginRuntimeResetGuard::drop and
reset_plugin_runtime to handle the Result returned by clear_plugin_configuration
instead of discarding it. Ensure teardown failures are surfaced or otherwise
handled explicitly while preserving the remaining runtime and context reset
steps, so partial callback cleanup cannot silently contaminate later tests.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: ad2f5a3a-f405-4c1c-a59f-a5fc24fde341

📥 Commits

Reviewing files that changed from the base of the PR and between c954811 and a1c1a88.

📒 Files selected for processing (2)
  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (12)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions in Rust and Python: use snake_case.

Files:

  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,py,js,mjs,cjs,ts,tsx}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use language-appropriate naming conventions: Rust snake_case, C FFI exports prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding // comment form.

Files:

  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

Files:

  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/cli/tests/coverage/shared/events_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
{crates/core,crates/adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changes to crates/core or crates/adaptive must run the full language matrix

Files:

  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
crates/core/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

If the change touched crates/core or shared runtime semantics, also use validate-change for broader validation

Files:

  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
crates/{core,adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If crates/core or crates/adaptive changed, run the full validation matrix across Rust, Python, Go, and Node.js.

Files:

  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
crates/{core,adaptive}/**/*.rs

⚙️ CodeRabbit configuration file

crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.

Files:

  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
🔇 Additional comments (4)
crates/cli/tests/coverage/shared/events_tests.rs (2)

1-16: LGTM!

Also applies to: 28-31, 51-54


28-31: 📐 Maintainability & Code Quality

Run the required Rust validation before handoff.

Please run cargo fmt --all, just test-rust, cargo clippy --workspace --all-targets -- -D warnings, and uv run pre-commit run --all-files. As per coding guidelines, Rust changes require these formatting, test, lint, and pre-commit checks.

Also applies to: 51-54

Source: Coding guidelines

crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs (2)

4-4: 📐 Maintainability & Code Quality

Run the required Rust/core validation before handoff.

Verify cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, just test-rust, validate-change, the full Rust/Python/Go/Node matrix, and uv run pre-commit run --all-files.

As per coding guidelines, Rust changes under crates/core require these formatting, lint, test, validation, and pre-commit checks.

Source: Coding guidelines


15-15: LGTM!

Also applies to: 25-26, 571-571, 647-651, 653-680, 682-701

@mnajafian-nv mnajafian-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@coderabbitai coderabbitai Bot mentioned this pull request Jul 16, 2026
2 tasks
@willkill07

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit 29800ae into NVIDIA:main Jul 16, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang:rust PR changes/introduces Rust code size:L PR is large Test Test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants