refactor: enforce cognitive complexity threshold - #636
Conversation
Signed-off-by: Will Killian <wkillian@nvidia.com>
WalkthroughThe PR enables workspace Clippy cognitive-complexity enforcement and refactors adaptive, core, Python, Go, and packaging code into focused helper functions. Existing validation, caching, streaming, observability, configuration, and argument-handling behavior remains represented in the extracted paths. ChangesComplexity refactor
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
There was a problem hiding this comment.
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 `@scripts/package_node_musllinux.mjs`:
- Around line 23-24: Update the argument parsing loop around argumentsFrom so it
validates args[index + 1] before assigning it to version, output, or platform:
reject undefined values and tokens beginning with the option prefix, and handle
the malformed invocation consistently with existing argument errors. Add
regression coverage confirming option tokens cannot be accepted as values.
🪄 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: bb2afe70-9766-41ac-bd70-3eee10309294
📒 Files selected for processing (13)
Cargo.tomlclippy.tomlcrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/observability/otel_genai.rscrates/core/src/observability/plugin_component.rscrates/core/src/plugin.rscrates/core/src/plugins/nemo_guardrails/python.rscrates/core/src/stream.rscrates/python/src/py_callable.rsgo/nemo_relay/nemo_relay.goscripts/package_node_musllinux.mjs
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
- GitHub Check: Check / Run
- GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (26)
**/*.toml
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Add the SPDX license header to all TOML files using the
#comment form.
Files:
clippy.tomlCargo.toml
**/*
📄 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, usemaintain-dynamic-pluginsand 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, preferuv run pre-commit run --files <changed files...>.
Before review or handoff, runuv run pre-commit run --all-files.
Files:
clippy.tomlCargo.tomlcrates/core/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rsscripts/package_node_musllinux.mjscrates/adaptive/src/response_cache/key.rscrates/python/src/py_callable.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rsgo/nemo_relay/nemo_relay.gocrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.rs
**/Cargo.toml
📄 CodeRabbit inference engine (.agents/skills/prepare-code-freeze/SKILL.md)
Confirm or infer the target release version from
upstream/main:Cargo.toml. Derive the release branch asrelease/<major>.<minor>.Keep Rust package names and workspace metadata in
Cargo.tomlinternally consistent across the project.OpenTelemetry and OpenInference dependencies must be unconditional rather than Cargo feature-gated.
Files:
Cargo.toml
Cargo.toml
📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)
In
Cargo.toml, treat[workspace.package].versionas the source of truth for the Rust workspace and Python build versioning, and keepworkspace.dependencies.nemo-relay.version,workspace.dependencies.nemo-relay-adaptive.version,workspace.dependencies.nemo-relay-pii-redaction.version,workspace.dependencies.nemo-relay-ffi.version, andworkspace.dependencies.nemo-relay-cli.versionaligned when the workspace version changes.
Files:
Cargo.toml
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor all FFI work since it is Rust work
Runjust test-rustto validate FFI changes
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting on FFI workWhen Rust files changed as part of Go work, also run
cargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allwhen Rust files are changed as part of Node work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files are changed as part of Node work
Runjust test-rustwhen Rust files are changed as part of Node workWhen changing the core Rust runtime or Rust-facing API surface, format Rust code with
cargo fmt(rustfmt defaults), keepcargo clippy -- -D warningsclean, and satisfycargo deny checkperdeny.toml.
**/*.rs: If any Rust code changed, always runjust test-rust.
If any Rust code changed, also runcargo fmt --all.
If any Rust code changed, also runcargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, runcargo fmt --allandcargo clippy --workspace --all-targets -- -D warningseven if relying on pre-commit.
Files:
crates/core/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/python/src/py_callable.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rscrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.rs
{crates/core,crates/adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/core/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rscrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
If the change touched
crates/coreor shared runtime semantics, also usevalidate-changefor broader validation
Files:
crates/core/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/core/src/stream.rscrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.rs
**/*.{rs,py}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions in Rust and Python: use
snake_case.
Files:
crates/core/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/python/src/py_callable.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rscrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{rs,py,js,mjs,cjs,ts,tsx}: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin 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/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rsscripts/package_node_musllinux.mjscrates/adaptive/src/response_cache/key.rscrates/python/src/py_callable.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rscrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.rs
**/*.{rs,py,go,js,ts,c,h}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use language-appropriate naming conventions: Rust
snake_case, C FFI exports prefixednemo_relay_, GoPascalCase, Node.jscamelCase, and Pythonsnake_case.
Files:
crates/core/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/python/src/py_callable.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rsgo/nemo_relay/nemo_relay.gocrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.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/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/python/src/py_callable.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rsgo/nemo_relay/nemo_relay.gocrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.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 cratetests/trees, and Python SDK tests belong underpython/tests.
Files:
crates/core/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/python/src/py_callable.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rscrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.rs
crates/{core,adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full validation matrix across Rust, Python, Go, and Node.js.
Files:
crates/core/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rscrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.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; resolveheader_envvalues 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 andjust test-rustwhen event fields change; runjust test-python,just test-go, andjust test-nodewhen binding-native configuration or lifecycle changes.
Files:
crates/core/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/python/src/py_callable.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rsgo/nemo_relay/nemo_relay.gocrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.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/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/python/src/py_callable.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rsgo/nemo_relay/nemo_relay.gocrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.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/src/observability/otel_genai.rscrates/core/src/plugin.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/adaptive/src/response_cache/replay.rscrates/core/src/stream.rscrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.rs
crates/adaptive/**
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep
crates/adaptivealigned with the canonical adaptive config schema, built-in section helpers, plugin lifecycle, and validation/report behavior.
Files:
crates/adaptive/src/plugin_component.rscrates/adaptive/src/response_cache/key.rscrates/adaptive/src/response_cache/replay.rs
{.github/**,.gitlab-ci.yml,.pre-commit-config.yaml,justfile,scripts/**}
⚙️ CodeRabbit configuration file
{.github/**,.gitlab-ci.yml,.pre-commit-config.yaml,justfile,scripts/**}: Review automation changes for reproducibility, pinned versions where appropriate, secret handling, and consistency with the documented validation matrix.
Pay attention to commands that need generated native artifacts, FFI libraries, or platform-specific environment variables.
Files:
scripts/package_node_musllinux.mjs
crates/{python,ffi,node}/**/*
⚙️ CodeRabbit configuration file
crates/{python,ffi,node}/**/*: Treat binding changes as public API changes. Check for parity with the other language bindings, FFI ownership/lifetime safety,
callback error propagation, stable type conversion, and consistent async/stream semantics.
Flag changes that update one binding without corresponding tests or documentation for the same surface elsewhere.
Files:
crates/python/src/py_callable.rs
go/nemo_relay/**/*.go
📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
go/nemo_relay/**/*.go: Format changed Go packages withcd go/nemo_relay && go fmt ./...
Run Go tests withjust test-goto build and test the NeMo Relay Go binding
Usejust build-gowhen you want an explicit build-only pass or need the artifact for other work
Usejust ci=true test-gowhen you need the CI-style coverage and JUnit path
On macOS, setDYLD_LIBRARY_PATHto the../../target/releasedirectory before running the rawgo testcommand directlyUse
PascalCasefor public Go APIs.
Files:
go/nemo_relay/nemo_relay.go
**/*.go
📄 CodeRabbit inference engine (CONTRIBUTING.md)
When changing the experimental Go binding, format Go code with
gofmtand keepgo vet ./...passing.
Files:
go/nemo_relay/nemo_relay.go
{crates/python/src/py_api/mod.rs,python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go,crates/node/src/api/**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Update the language-native bindings for every exposed surface in Python, Go, and Node.js.
Files:
go/nemo_relay/nemo_relay.go
{python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go}
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Update language wrapper helpers such as Python wrapper modules, Python type stubs, and Go shorthand packages when the new behavior belongs in those helper layers.
Files:
go/nemo_relay/nemo_relay.go
go/nemo_relay/**
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep shared plugin helpers in
go/nemo_relayaligned with plugin registration, composition, and lifecycle behavior.
Files:
go/nemo_relay/nemo_relay.go
**/*.{md,mdx,py,go,js,ts}
📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)
Examples and documentation must use each exporter's documented flush/deregister order before shutdown.
Files:
go/nemo_relay/nemo_relay.go
go/nemo_relay/**/*
⚙️ CodeRabbit configuration file
go/nemo_relay/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.
Files:
go/nemo_relay/nemo_relay.go
🧠 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/observability/otel_genai.rscrates/core/src/plugin.rscrates/core/src/stream.rscrates/core/src/observability/plugin_component.rscrates/core/src/plugins/nemo_guardrails/python.rs
🔇 Additional comments (14)
crates/adaptive/src/plugin_component.rs (2)
218-280: LGTM!
282-363: 📐 Maintainability & Code QualityProvide the required adaptive validation evidence.
Run
cargo fmt --all,cargo clippy --workspace --all-targets -- -D warnings, andjust test-rust. Also run the required Python, Go, and Node.js test targets for thiscrates/adaptivechange. Attach the command output or CI results before merge.As per coding guidelines, “Any Rust change must run
just test-rust,”cargo fmt --all, and strict Clippy. As per path instructions,crates/adaptivechanges require the full Rust, Python, Go, and Node.js validation matrix.Sources: Coding guidelines, Path instructions
crates/adaptive/src/response_cache/key.rs (1)
59-135: LGTM!crates/adaptive/src/response_cache/replay.rs (1)
195-252: LGTM!go/nemo_relay/nemo_relay.go (2)
2050-2070: LGTM!Also applies to: 2089-2093
2017-2021: 🎯 Functional CorrectnessKeep the current validation.
The FFI parser rejects whitespace-only endpoints before subscriber construction, and the Go tests already cover
" \t".> Likely an incorrect or invalid review comment.crates/core/src/observability/otel_genai.rs (1)
436-462: LGTM!crates/core/src/observability/plugin_component.rs (1)
1792-1877: LGTM!crates/core/src/plugin.rs (1)
1627-1685: LGTM!crates/python/src/py_callable.rs (1)
1730-1859: LGTM!crates/core/src/plugins/nemo_guardrails/python.rs (1)
1110-1263: LGTM!crates/core/src/stream.rs (1)
39-47: 🩺 Stability & AvailabilityKeep the structured log call. The workspace enables
logwith thekvfeature and resolves version0.4.29; this syntax is already used throughout the workspace.> Likely an incorrect or invalid review comment.clippy.toml (1)
1-4: LGTM!Cargo.toml (1)
48-50: 📐 Maintainability & Code Quality
> Likely an incorrect or invalid review comment.
| for (let index = 0; index < args.length; index += 2) { | ||
| const value = args[index + 1]; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- file outline ---'
ast-grep outline scripts/package_node_musllinux.mjs --view expanded || true
printf '%s\n' '--- target file ---'
cat -n scripts/package_node_musllinux.mjs
printf '%s\n' '--- related tests and call sites ---'
rg -n --glob '!node_modules' 'package_node_musllinux|argumentsFrom|--version|--out|--platform' . | head -200
printf '%s\n' '--- package and formatter configuration ---'
rg -n --glob 'package.json' --glob 'pyproject.toml' --glob 'package_node_musllinux.mjs' 'test|check|format|prettier|eslint|node' .Repository: NVIDIA/NeMo-Relay
Length of output: 21258
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- packaging invocation ---'
sed -n '1595,1630p' justfile
printf '%s\n' '--- downstream version handling ---'
sed -n '110,155p' scripts/package-node-bin.py
rg -n 'version|Version|metadata|output' scripts/package-node-bin.py | head -80
printf '%s\n' '--- node tests layout ---'
find crates/node/tests -maxdepth 1 -type f -print 2>/dev/null | sort | head -80
printf '%s\n' '--- target script references ---'
rg -n -C 3 'package_node_musllinux|package-node-musllinux|musllinux' justfile scripts README.md docs .github 2>/dev/null | head -160
printf '%s\n' '--- deterministic parser probe ---'
node - <<'JS'
function argumentsFrom(args) {
let version;
let output;
let platform;
for (let index = 0; index < args.length; index += 2) {
const value = args[index + 1];
if (args[index] === "--version") {
version = value;
} else if (args[index] === "--out") {
output = value;
} else if (args[index] === "--platform") {
platform = value;
} else {
throw new Error(`Unexpected argument: ${args[index]}`);
}
}
if (!version || !output || !platform) {
throw new Error("Usage");
}
return { output, platform, version };
}
for (const args of [
["--version", "--out", "--out", "out", "--platform", "linux"],
["--version", "1.2.3", "--out"],
["--version", "--platform", "--out", "out", "--platform", "linux"],
]) {
try {
console.log(JSON.stringify(args), "=>", JSON.stringify(argumentsFrom(args)));
} catch (error) {
console.log(JSON.stringify(args), "=> ERROR:", error.message);
}
}
JSRepository: NVIDIA/NeMo-Relay
Length of output: 17416
Reject option tokens used as values.
When args[index + 1] is another option, argumentsFrom stores it as version, output, or platform. This can pass values such as "--out" into package metadata and artifact filenames. Reject undefined and option tokens before assignment. Add regression coverage for the malformed invocation.
🤖 Prompt for 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.
In `@scripts/package_node_musllinux.mjs` around lines 23 - 24, Update the argument
parsing loop around argumentsFrom so it validates args[index + 1] before
assigning it to version, output, or platform: reject undefined values and tokens
beginning with the option prefix, and handle the malformed invocation
consistently with existing argument errors. Add regression coverage confirming
option tokens cannot be accepted as values.
Source: Path instructions
Overview
Enables Clippy cognitive-complexity enforcement at a threshold of 18 and refactors flagged production functions without suppressing the lint.
Details
Validation performed on the intended combined result:
Where should the reviewer start?
Start with Cargo.toml and clippy.toml, then review crates/core/src/plugin.rs and crates/python/src/py_callable.rs as representative refactors.
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
Refactor
Chores