Skip to content

refactor: address Sonar findings and raise Rust coverage - #632

Closed
willkill07 wants to merge 8 commits into
NVIDIA:release/0.7from
willkill07:fix/sonar-coverage-release-0.7
Closed

refactor: address Sonar findings and raise Rust coverage#632
willkill07 wants to merge 8 commits into
NVIDIA:release/0.7from
willkill07:fix/sonar-coverage-release-0.7

Conversation

@willkill07

@willkill07 willkill07 commented Aug 1, 2026

Copy link
Copy Markdown
Member

Overview

Addresses the applicable Sonar findings reported for release/0.7 (excluding the GitHub Actions findings) and raises merged Rust patch coverage above 96%.

  • 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

  • refactor Rust, Go, JavaScript, and Python findings from the release/0.7 Sonar inventory
  • enforce Clippy cognitive complexity from the root workspace with a threshold of 18 and no lint allowances
  • split complex production and test helpers while preserving behavior
  • add and extend Rust coverage tests; merged Codecov Rust patch coverage is 96.26% (566/588 executable changed lines)
  • keep GitHub Actions findings out of scope as requested

Validation:

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --keep-going -- -D warnings
  • just test-rust
  • just --set ci true --set output_dir target/coverage test-rust (3,734 passed)
  • just --set ci true --set output_dir target/coverage test-python (70 Rust unit tests and 614 Python tests passed)
  • just test-go
  • just test-node (344 passed)
  • uv run pre-commit run --all-files

Where should the reviewer start?

Start with Cargo.toml and clippy.toml for the workspace lint policy, then review the production refactors in crates/core/src, crates/adaptive/src, and the corresponding coverage tests.

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

  • Relates to: none

Summary by CodeRabbit

  • Bug Fixes

    • Improved adaptive plugin and response-cache validation, replay handling, and edge-case behavior.
    • Strengthened logging rotation recovery, path validation, stream handling, and command-line argument parsing.
    • Improved configuration normalization and environment-sensitive workflows.
  • Documentation

    • Updated response-cache defaults and corrected an API documentation example.
  • Tests

    • Expanded coverage across codecs, streaming, plugins, observability, FFI, Python, Go, and native integrations.
    • Added regression coverage for cancellation, malformed inputs, lifecycle behavior, configuration loading, and error reporting.
  • Chores

    • Added a workspace lint rule to flag overly complex functions.

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07
willkill07 requested a review from a team as a code owner August 1, 2026 13:43
@github-actions github-actions Bot added size:XXL PR is very large Improvement improvement to existing functionality lang:go PR changes/introduces Go code lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code labels Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The PR enforces Clippy cognitive-complexity limits, extracts runtime logic into focused helpers, and expands coverage across adaptive caching, observability, plugins, FFI, Python, Go, Node, and CLI code.

Changes

Complexity cleanup and coverage expansion

Layer / File(s) Summary
Lint configuration and runtime helpers
Cargo.toml, clippy.toml, crates/adaptive/src/*, crates/cli/src/*, crates/core/src/*, crates/python/src/*
Clippy denies excessive cognitive complexity. Validation, cache-key bypass handling, replay, logging, observability, plugin, sanitizer, and stream logic now use dedicated helpers.
Adaptive and core coverage
crates/adaptive/tests/*, crates/core/tests/*
Tests add cache, logging, codec, native-plugin, observability, guardrail, subscriber, worker, and type edge cases. Large tests use focused assertion helpers.
FFI assertion standardization
crates/ffi/tests/*
FFI tests use shared assert_status! assertions and extracted helpers for callbacks, registries, activation, transports, and event accessors.
CLI and language-binding tests
crates/cli/tests/*, crates/python/tests/*, crates/plugin/tests/*, crates/node/*, go/nemo_relay/*, scripts/*, python/plugin/*
Tests extract repeated assertions, isolate working-directory-sensitive cases, normalize Go OpenTelemetry setup, and update Node promise handling and packaging argument parsing.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses valid Conventional Commits syntax, states the refactoring scope, uses an imperative summary, and is 56 characters long.
Description check ✅ Passed The description includes all required sections, explains the scope and changes, identifies review starting points, and lists validation results.
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 Aug 1, 2026
@willkill07 willkill07 added this to the 0.7 milestone Aug 1, 2026
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

License Diff

Compared against origin/release/0.7.

Lockfile license changes

Lockfile License Changes

Rust

Added

  • None

Removed

  • None

Updated/Changed

  • None

Node

Added

  • None

Removed

  • None

Updated/Changed

  • None

Python

Added

  • None

Removed

  • None

Updated/Changed

  • None
Status output
[license-diff] selected languages: rust, node, python
[license-diff] generating current inventory
[license-diff] current: generating Rust inventory
[license-diff] current: Rust inventory complete (449 packages)
[license-diff] current: generating Node inventory
[license-diff] current: Node inventory complete (367 packages)
[license-diff] current: generating Python inventory
[license-diff] current: Python inventory complete (105 packages)
[license-diff] current inventory complete
[license-diff] checking out base ref origin/release/0.7 into a temporary worktree
[license-diff] base: generating Rust inventory
[license-diff] base: Rust inventory complete (449 packages)
[license-diff] base: generating Node inventory
[license-diff] base: Node inventory complete (367 packages)
[license-diff] base: generating Python inventory
[license-diff] base: Python inventory complete (105 packages)
[license-diff] base inventory complete
[license-diff] removing temporary base worktree
[license-diff] comparing inventories
[license-diff] rendering Markdown output
[license-diff] done

@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: 7

🤖 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 `@Cargo.toml`:
- Around line 48-50: Update the [workspace.lints.clippy] configuration by
removing the deprecated cognitive_complexity lint and replacing it with a
supported equivalent such as excessive_nesting or too_many_lines, preserving the
existing deny-level enforcement.

In `@crates/core/src/plugin/dynamic/native.rs`:
- Around line 2264-2299: Update the native stream forwarding loop around
native_string_from_json so a serialization failure calls callback_guard.fail
with an appropriate error message instead of breaking and reporting successful
completion. Preserve the existing success terminal callback only for streams
that finish without serialization or stream errors.

In `@crates/ffi/tests/integration/api_tests.rs`:
- Around line 48-57: Add #[track_caller] to assert_native_status in both
crates/ffi/tests/integration/api_tests.rs (lines 48-57) and
crates/ffi/tests/unit/api_tests.rs (lines 49-58), preserving the existing
assert_status! call sites and assertion behavior while reporting failures at the
original test caller.

In `@crates/ffi/tests/unit/api/registry_tests.rs`:
- Around line 91-101: Update the expectation message in otlp_content_length to
explicitly mention that the request may be using transfer-encoding: chunked when
content-length is absent, while preserving the existing parsing behavior.

In `@crates/python/src/py_callable.rs`:
- Around line 1771-1791: Update call_event_sanitizer to match directly on
loop_affine rather than !loop_affine, and reorder the dispatch arms so each
branch condition clearly corresponds to the flag’s actual value while preserving
existing callback invocation behavior. Run cargo fmt --all, cargo clippy
--workspace --all-targets -- -D warnings, and just test-rust.

In `@crates/python/tests/coverage/py_types_coverage_tests.rs`:
- Around line 1984-1998: Update the assertions in the loop over the *_is_none
keys to require each decoded value equals Some(true), matching the adjacent
loop’s assert_eq! pattern. Keep the existing key list and error labels unchanged
so regressions where a field is no longer None fail the test.

In `@go/nemo_relay/test_helpers_test.go`:
- Around line 11-29: Add a doc comment immediately above
runTestInIsolatedWorkingDirectory stating that callers must not use it with
t.Parallel() because os.Chdir changes the process-wide working directory.
🪄 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: 4d029620-b0af-400b-a317-23b79703b8ea

📥 Commits

Reviewing files that changed from the base of the PR and between 31c4a5c and bbc2379.

📒 Files selected for processing (77)
  • Cargo.toml
  • clippy.toml
  • crates/adaptive/src/plugin_component.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/replay.rs
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/trie/builder_tests.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/plugins/mod.rs
  • crates/cli/src/process/launcher.rs
  • crates/cli/src/server/mod.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/tests/coverage/shared/plugins_lifecycle_tests.rs
  • crates/cli/tests/coverage/shared/plugins_schema_tests.rs
  • crates/cli/tests/coverage/shared/plugins_tests.rs
  • crates/core/src/api/runtime/scope_stack.rs
  • crates/core/src/logging/rotation.rs
  • crates/core/src/observability/otel_genai.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/plugin.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/src/plugins/nemo_guardrails/python.rs
  • crates/core/src/stream.rs
  • crates/core/tests/coverage/logging_rotation_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/otel_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/component_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/core/tests/unit/types_tests.rs
  • crates/ffi/tests/integration/api/coverage_sweeps_tests.rs
  • crates/ffi/tests/integration/api_tests.rs
  • crates/ffi/tests/integration/plugin_activation_tests.rs
  • crates/ffi/tests/unit/api/core_tests.rs
  • crates/ffi/tests/unit/api/coverage_sweeps_tests.rs
  • crates/ffi/tests/unit/api/execution_tests.rs
  • crates/ffi/tests/unit/api/plugin_tests.rs
  • crates/ffi/tests/unit/api/registry_tests.rs
  • crates/ffi/tests/unit/api_tests.rs
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/ffi/tests/unit/types_tests.rs
  • crates/node/adaptive.js
  • crates/node/tests/llm_tests.mjs
  • crates/node/tests/tools_tests.mjs
  • crates/node/tests/typed_tests.mjs
  • crates/plugin/tests/typed_callbacks.rs
  • crates/python/src/py_callable.rs
  • crates/python/tests/coverage/py_adaptive_coverage_tests.rs
  • crates/python/tests/coverage/py_api_coverage_tests.rs
  • crates/python/tests/coverage/py_plugin_coverage_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • go/nemo_relay/adaptive_plugin_test.go
  • go/nemo_relay/adaptive_runtime_test.go
  • go/nemo_relay/adaptive_test.go
  • go/nemo_relay/callbacks_test.go
  • go/nemo_relay/context_test.go
  • go/nemo_relay/coverage_gap_test.go
  • go/nemo_relay/llm_test.go
  • go/nemo_relay/nemo_relay.go
  • go/nemo_relay/otel_test.go
  • go/nemo_relay/plugin_activation_test.go
  • go/nemo_relay/test_helpers_test.go
  • python/plugin/build_backend.py
  • scripts/package_node_musllinux.mjs

Comment thread Cargo.toml
Comment thread crates/core/src/plugin/dynamic/native.rs
Comment thread crates/ffi/tests/integration/api_tests.rs
Comment thread crates/ffi/tests/unit/api/registry_tests.rs
Comment thread crates/python/src/py_callable.rs
Comment thread crates/python/tests/coverage/py_types_coverage_tests.rs
Comment thread go/nemo_relay/test_helpers_test.go
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: 5

🤖 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/coverage/logging_sink_tests.rs`:
- Around line 123-127: Update the queue-capacity test around file_sink and
build_logger_error to assert the specific validation message for each capacity:
`must be greater than 0` when capacity is 0 and `exceeds maximum` when it is
MAX_FILE_SINK_QUEUE_ENTRIES + 1. Replace the non-empty check while preserving
coverage of both invalid inputs.

In `@crates/core/tests/unit/dynamic_worker_tests.rs`:
- Around line 308-342: Add a success-case assertion in the existing
optional_json_from_invoke_response test for an InvokeResponse whose result is
InvokeResult::Empty, verifying it returns Ok(None). Keep the current failure
assertions unchanged and place the new coverage alongside them.
- Around line 127-157: Strengthen
python_worker_process_launch_uses_the_managed_interpreter_and_endpoint_file by
making the stub managed interpreter record its invocation and environment to a
temporary file without relying on $1, since the shell receives bootstrap
arguments positionally. After spawn_worker_process completes, assert the record
confirms the managed interpreter was used and NEMO_RELAY_WORKER_ENDPOINT_FILE
contains the expected endpoint_file path, while preserving the existing
successful-exit assertion.

In `@crates/core/tests/unit/native_plugin_tests.rs`:
- Around line 4391-4406: Strengthen the assertion in the async middleware
registration test by retaining the NemoRelayStatus::InvalidArg check and adding
assert_last_error_contains with the loader’s incompatible relay_compat contract
error substring. Use the existing helper pattern from nearby tests and keep the
cleanup unchanged.

In `@crates/core/tests/unit/observability/plugin_component_tests.rs`:
- Around line 651-703: Guard both tests’ unsafe environment-variable mutations
with the existing crate::observability::test_mutex() lock. In
crates/core/tests/unit/observability/plugin_component_tests.rs lines 651-703,
acquire the guard at the start of
atof_stream_header_validation_reports_invalid_values_and_environment_names; do
the same at lines 3391-3424 for
http_upload_config_rejects_endpoint_timeout_and_header_errors, and update that
test’s SAFETY comment to accurately describe the mutex protection.
🪄 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: 7b5b9f02-6fc2-4879-bd27-30ad07bf7705

📥 Commits

Reviewing files that changed from the base of the PR and between c4b4266 and d1cf979.

📒 Files selected for processing (9)
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/native_plugin_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/plugin_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_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 (19)
**/*.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/core/tests/unit/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_tests.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • crates/core/tests/unit/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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/core/tests/unit/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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/core/tests/unit/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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/core/tests/unit/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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/core/tests/unit/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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.

**/*.{rs,py,go,js,ts}: When observability configuration or lifecycle is exposed, keep FFI and Python, Go, and Node.js binding-native config objects and subscriber/exporter methods aligned in logical knobs and semantics.
Require every OpenTelemetry endpoint to have a type and nonblank destination; resolve header_env values at activation and reject missing, blank, or duplicate headers.
Concatenate layered ATOF sink, ATIF storage, and OpenTelemetry endpoint lists with higher-precedence entries first.
Preserve correct handling of mark events, start/end events, orphan cases, and span or trajectory fields derived from intended event data.
Run affected Rust tests and just test-rust when event fields change; run just test-python, just test-go, and just test-node when binding-native configuration or lifecycle changes.

Files:

  • crates/core/tests/unit/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_tests.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

📄 CodeRabbit inference engine (.agents/skills/add-middleware/SKILL.md)

Add tests covering registration and duplicate names, deregistration and missing names, priority ordering, callback failure policy, scope-local inheritance and cleanup, event payload semantics, immutable mark and scope fields, and parity across affected bindings.

Files:

  • crates/core/tests/unit/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/src/plugin/dynamic/native.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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/unit/plugin_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs
  • crates/core/tests/unit/plugins/nemo_guardrails/local_python_tests.rs
  • crates/core/tests/coverage/logging_sink_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/native_plugin_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/native.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/native.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/core/src/plugin/dynamic/native.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/native.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/native.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/native.rs
🧠 Learnings (1)
📚 Learning: 2026-07-28T20:07:29.880Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 571
File: crates/core/src/api/runtime/state.rs:996-1020
Timestamp: 2026-07-28T20:07:29.880Z
Learning: In NeMo Relay (RELAY-509), sanitizer callback failures must be treated as intentional fail-open behavior. When an event/tool (request/response) or LLM (request/response) sanitizer callback fails, the sanitizer chain should retain and publish the last valid event/payload snapshot (rather than dropping/invalidating the data) and log the failure including callback context (e.g., which sanitizer/callback failed and relevant identifiers). Apply this consistently across all sanitizer chains mentioned in the RELAY-509 documentation/migration guide.

Applied to files:

  • crates/core/src/plugin/dynamic/native.rs
🔇 Additional comments (21)
crates/core/tests/unit/llm_api_tests.rs (1)

149-158: LGTM!

Also applies to: 187-200

crates/core/tests/coverage/logging_sink_tests.rs (1)

5-13: LGTM!

Also applies to: 87-99, 101-122, 128-129, 131-148

crates/core/tests/unit/native_plugin_tests.rs (11)

540-602: LGTM!


3312-3314: LGTM!


3362-3377: LGTM!

Also applies to: 3405-3409


3954-3955: LGTM!

Also applies to: 4095-4118


4264-4374: LGTM!


4524-4571: LGTM!


4903-5014: LGTM!


5111-5111: LGTM!

Also applies to: 5126-5126, 5138-5183


5185-5302: LGTM!


5524-5533: LGTM!

Also applies to: 5561-5570, 5583-5585, 5608-5616, 5682-5682, 5700-5713, 5748-5751, 5776-5779, 5828-5837


3550-3579: 🩺 Stability & Availability

Keep native_string_free for this allocation. It reconstructs NativeHostString before dropping it, so the deallocator matches the allocation.

			> Likely an incorrect or invalid review comment.
crates/core/tests/unit/dynamic_worker_tests.rs (3)

6-8: LGTM!


195-206: LGTM!


344-367: LGTM!

Also applies to: 994-1015

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

2260-2275: LGTM!

crates/core/tests/unit/observability/plugin_component_tests.rs (1)

86-143: LGTM!

Also applies to: 637-649, 705-723, 3426-3476

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

710-736: LGTM!

Also applies to: 2287-2317

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

115-134: LGTM!

Also applies to: 732-749, 751-838, 839-871, 872-926, 927-947, 948-1035, 1077-1093

crates/core/tests/unit/plugins/nemo_guardrails/remote_coverage_tests.rs (1)

94-111: LGTM!

Also applies to: 226-241, 809-855, 932-950

Comment thread crates/core/tests/coverage/logging_sink_tests.rs Outdated
Comment thread crates/core/tests/unit/dynamic_worker_tests.rs
Comment thread crates/core/tests/unit/dynamic_worker_tests.rs
Comment thread crates/core/tests/unit/native_plugin_tests.rs
Comment thread crates/core/tests/unit/observability/plugin_component_tests.rs
Signed-off-by: Will Killian <wkillian@nvidia.com>
Signed-off-by: Will Killian <wkillian@nvidia.com>
Signed-off-by: Will Killian <wkillian@nvidia.com>
Signed-off-by: Will Killian <wkillian@nvidia.com>
Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07

Copy link
Copy Markdown
Member Author

Closing this combined PR in favor of the four scoped replacement PRs:

Recommended merge order: #633, #634, #635, then #636. Merging all four produces the same Git tree as this combined PR.

@willkill07 willkill07 closed this Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement improvement to existing functionality lang:go PR changes/introduces Go code lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code size:XXL PR is very large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant