feat: reuse topology-aware ACG cache prefixes#322
Conversation
Signed-off-by: Teerth Sharma <teerths57@gmail.com>
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds topology-aware convergence, drift, and governor support across adaptive runtime code, config schemas, SDK bindings, and tests. Stable-prefix fingerprints and structured-output contracts are used in ACG paths, and the new benchmark measures observation counts with and without convergence. ChangesTopology-Aware Adaptive Learning
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Observed aggregate E2E improved: 73.768s -> 61.131s, saving 12.637s over 100 paired tasks. However, tail latency regressed: |
|
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/adaptive/src/adaptive_hints_intercept.rs (1)
123-149: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftScope the hint governor by agent or root scope.
effective_agent_id()is resolved per request, but this intercept keeps one sharedHintGovernorfor all traffic. A hot agent can therefore raise the shared epsilon and suppress hint injection for unrelated agents/scopes that reuse the same runtime, which breaks isolation of adaptive behavior. Use per-agent or per-root-scope governor state instead of a single global mutexed governor. As per path instructions,crates/{core,adaptive}/**/*.rsshould be reviewed forscope isolation; as per coding guidelines,Root scope identity is used to isolate concurrent agents.Also applies to: 183-197, 235-258
🤖 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 `@crates/adaptive/src/adaptive_hints_intercept.rs` around lines 123 - 149, The shared HintGovernor in AdaptiveHintsIntercept is not scoped, so adaptive state can leak across agents and roots; update AdaptiveHintsIntercept::with_governor and the hint injection flow to keep governor state keyed by effective_agent_id or root scope instead of one global Arc<Mutex<HintGovernor>>. Use the per-request scope identity already resolved in effective_agent_id() to look up or create isolated governor state, and ensure the request path in the affected hint injection logic uses that scoped governor rather than the shared instance.Sources: Coding guidelines, Path instructions
🤖 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/adaptive/src/acg_learner.rs`:
- Around line 215-259: The cached convergence reuse in acg_learner.rs should be
gated by the active convergence config, not just persisted stability state.
Update the reuse check in the loop inside the learner logic to only enter the
cached-path when self.convergence is Some and enabled, in addition to the
existing stability_window and topology match conditions. Use the existing
symbols self.convergence, existing_stability, and the cached reuse branch around
profile_counts/profile_stability to keep disabled convergence from skipping
normal observation analysis.
In `@crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs`:
- Around line 377-389: The manual-override path in
adaptive_hints_intercept_tests only verifies the restored body payload and can
miss regressions where AGENT_HINTS_HEADER_KEY is not injected. Update the test
around manual_req_fn so it also asserts the header contains the same
latency_sensitivity value, using the existing manual_request result and the
header key constant to validate the intercept contract on this branch.
In `@crates/adaptive/tests/unit/tool_parallelism_learner_tests.rs`:
- Around line 343-358: The current test only checks the backend-loaded plan, but
not the in-memory cache updated by process_run. Extend the existing
tool_parallelism_learner test around backend.load_plan("agent-drift") to also
assert hot_cache.plan is refreshed/invalidated in the same drift scenario, using
the same expected group/tool-name checks so a cache/backend mismatch in
process_run is covered.
In `@crates/adaptive/tests/unit/types_tests.rs`:
- Around line 44-46: The fixture in types_tests is still using default values
for the newly added public fields, so it does not validate the updated
serialized schema. Update the sample used in the relevant test around the
observed Adaptive type fixture to give stable_prefix_fingerprint a non-default
Some(...) value and set converged to true, then keep the round-trip assertions
in sync so the test exercises the new wire fields through the type
constructors/serialization path.
In `@crates/node/adaptive.js`:
- Around line 89-123: The normalized config helpers in adaptive.js are letting
undefined values overwrite defaults because they spread config directly in
governorConfig, driftConfig, and convergenceConfig. Update these helpers so only
provided values override defaults, preserving epsilon, threshold, and
stability_window when callers pass undefined, and keep the normalization
behavior consistent with the Node contract used by the corresponding config
helpers.
---
Outside diff comments:
In `@crates/adaptive/src/adaptive_hints_intercept.rs`:
- Around line 123-149: The shared HintGovernor in AdaptiveHintsIntercept is not
scoped, so adaptive state can leak across agents and roots; update
AdaptiveHintsIntercept::with_governor and the hint injection flow to keep
governor state keyed by effective_agent_id or root scope instead of one global
Arc<Mutex<HintGovernor>>. Use the per-request scope identity already resolved in
effective_agent_id() to look up or create isolated governor state, and ensure
the request path in the affected hint injection logic uses that scoped governor
rather than the shared instance.
🪄 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: 07d5d50c-53a8-46fe-b912-e0099e75e388
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (49)
crates/adaptive/Cargo.tomlcrates/adaptive/benches/convergence_bench.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg/stability.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/acg_profile.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/config.rscrates/adaptive/src/lib.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/src/topology.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/node/adaptive.d.tscrates/node/adaptive.jscrates/node/tests/adaptive_tests.mjscrates/python/tests/coverage/py_storage_coverage_tests.rsgo/nemo_relay/adaptive.gogo/nemo_relay/adaptive/adaptive.gogo/nemo_relay/adaptive_test.gopython/nemo_relay/adaptive.pypython/nemo_relay/adaptive.pyipython/tests/test_adaptive.pypython/tests/test_adaptive_config.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (42)
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Use
snake_casenaming convention for Rust identifiers (e.g.,nemo_relay_tool_call)
**/*.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 work
**/*.rs: Runcargo fmt --allto format all Rust code
Runcargo clippy --workspace --all-targets -- -D warningsto enforce all clippy lints as errors
**/*.rs: Runcargo fmt --allwhen Rust files changed as part of WebAssembly work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files changed as part of WebAssembly work
**/*.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
Run Rust formatting withcargo fmt --all
Run Rust linting withcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Usecargo fmtfor Rust code formatting
Runcargo clippy -- -D warningsto lint Rust code and treat all warnings as errors
Use Rust snake_case naming convention for Rust identifiers
Include SPDX license header in all Rust source files using double-slash comment syntax
Validate Rust code withuv run pre-commit run --all-filesto enforce cargo fmt formatting check, cargo clippy lints, and cargo deny aud...
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**,python/nemo_relay/adaptive.py,python/nemo_relay/plugin.py,go/nemo_relay/adaptive/**,go/nemo_relay/!(adaptive)/**,**/node/**,**/wasm/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep adaptive surface in sync across crates/adaptive, shared plugin behavior in core and bindings, Python adaptive/plugin wrappers in python/nemo_relay/adaptive.py and python/nemo_relay/plugin.py, Go adaptive helpers under go/nemo_relay/adaptive plus shared plugin helpers in go/nemo_relay, and Node/WebAssembly adaptive helpers and plugin wrappers
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/node/tests/adaptive_tests.mjscrates/adaptive/Cargo.tomlcrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rsgo/nemo_relay/adaptive/adaptive.gocrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/node/adaptive.d.tscrates/adaptive/tests/unit/config_tests.rscrates/node/adaptive.jscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/plugin_component_tests.rspython/nemo_relay/adaptive.pycrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}: Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)
Keep plugin context surfaces aligned across all language implementations
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/node/tests/adaptive_tests.mjscrates/adaptive/Cargo.tomlcrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rsgo/nemo_relay/adaptive/adaptive.gocrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/node/adaptive.d.tscrates/adaptive/tests/unit/config_tests.rscrates/node/adaptive.jscrates/adaptive/tests/unit/storage_memory_internal_tests.rsgo/nemo_relay/adaptive.gocrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rsgo/nemo_relay/adaptive_test.gocrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**/*.rs,**/*test*.{rs,py,go,ts,js},**/*adaptive*test*.{rs,py,go,ts,js},docs/plugins/adaptive/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain documented and tested validation and report behavior for adaptive surfaces
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rspython/tests/test_adaptive_config.pycrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rspython/tests/test_adaptive.pycrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rsgo/nemo_relay/adaptive_test.gocrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/{Cargo.toml,**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Maintain consistency between Rust package names in
Cargo.tomland their actual usage across the codebase
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/adaptive/Cargo.tomlcrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{h,hpp,c,cpp,rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure FFI header and library naming follows consistent conventions across platform-specific builds
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.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/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/Cargo.tomlcrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Rust crate names and module prefixes during coordinated rename operations
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/adaptive/Cargo.tomlcrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/Cargo.tomlcrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}
📄 CodeRabbit inference engine (AGENTS.md)
Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/adaptive/Cargo.tomlcrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rspython/tests/test_adaptive_config.pycrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rsgo/nemo_relay/adaptive/adaptive.gocrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/node/adaptive.d.tscrates/adaptive/tests/unit/config_tests.rscrates/node/adaptive.jscrates/adaptive/tests/unit/storage_memory_internal_tests.rsgo/nemo_relay/adaptive.gocrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rspython/tests/test_adaptive.pycrates/adaptive/tests/unit/plugin_component_tests.rspython/nemo_relay/adaptive.pycrates/adaptive/tests/integration/runtime_integration_tests.rsgo/nemo_relay/adaptive_test.gocrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions: Rust and Python use
snake_case, C FFI exports prefixednemo_relay_, Go usesPascalCasefor public APIs, Node.js usescamelCase.
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rspython/tests/test_adaptive_config.pycrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rsgo/nemo_relay/adaptive/adaptive.gocrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/node/adaptive.d.tscrates/adaptive/tests/unit/config_tests.rscrates/node/adaptive.jscrates/adaptive/tests/unit/storage_memory_internal_tests.rsgo/nemo_relay/adaptive.gocrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rspython/tests/test_adaptive.pycrates/adaptive/tests/unit/plugin_component_tests.rspython/nemo_relay/adaptive.pycrates/adaptive/tests/integration/runtime_integration_tests.rsgo/nemo_relay/adaptive_test.gocrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Keep async behavior on the existing tokio-based model. Bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
UseJson = serde_json::Valuein Rust-facing runtime APIs for JSON payload handling.
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**
⚙️ CodeRabbit configuration file
**:AGENTS.md
This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.
Project Overview
NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go, WebAssembly, and the raw C FFI are experimental and source-first.
The shared runtime model is:
- Scope stacks decide where work belongs and which scope-local behavior is visible.
- Middleware registries decide what guardrails and intercepts run around managed calls.
- Plugins install reusable runtime behavior from configuration.
- Events record runtime behavior in ATOF form.
- Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.
Repository Structure
The repository layout separates the Rust runtime, language bindings, documentation,
integration patches, and agent-facing skills.crates/ core/ # Rust core runtime crate, published as nemo-relay adaptive/ # Adaptive runtime primitives and plugin components python/ # PyO3 native extension for the Python package ffi/ # Raw C ABI layer used by downstream bindings such as Go node/ # NAPI Node.js binding and JavaScript/TypeScript entry points wasm/ # wasm-bindgen WebAssembly binding and JS wrappers python/ nemo_relay/ # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers tests/ # Python tests go/ nemo_relay/ # Experimental Go CGo binding and tests fern/ # Fern documentation site scripts/ # Stable wrappers and helper scripts; build/test/docs entry points live in justfile third_party/ # P...
Files:
crates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/node/tests/adaptive_tests.mjscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/adaptive/Cargo.tomlcrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rspython/tests/test_adaptive_config.pycrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rsgo/nemo_relay/adaptive/adaptive.gocrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/node/adaptive.d.tscrates/adaptive/tests/unit/config_tests.rscrates/node/adaptive.jscrates/adaptive/tests/unit/storage_memory_internal_tests.rsgo/nemo_relay/adaptive.gocrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rspython/tests/test_adaptive.pycrates/adaptive/tests/unit/plugin_component_tests.rspython/nemo_relay/adaptive.pypython/nemo_relay/adaptive.pyicrates/adaptive/tests/integration/runtime_integration_tests.rsgo/nemo_relay/adaptive_test.gocrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_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/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rscrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/benches/convergence_bench.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/src/runtime/validation.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/src/lib.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_component.rscrates/adaptive/src/adaptive_hints_intercept.rscrates/adaptive/src/topology.rscrates/adaptive/src/tool_parallelism_learner.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/src/acg/stability.rscrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/src/plugin_component.rscrates/adaptive/src/acg_learner.rscrates/adaptive/src/runtime/features.rscrates/adaptive/src/config.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_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/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/node/tests/adaptive_tests.mjscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/adaptive/tests/unit/acg/multi_breakpoint_tests.rspython/tests/test_adaptive_config.pycrates/adaptive/tests/unit/acg/economics_internal_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/storage_tests.rscrates/adaptive/tests/unit/intercepts_tests.rscrates/adaptive/tests/unit/acg/economics_policy_tests.rscrates/adaptive/tests/unit/acg/stability_internal_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/topology_tests.rscrates/adaptive/tests/integration/topology_convergence_tests.rscrates/adaptive/tests/integration/tool_parallelism_plan_tests.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/tests/unit/storage_memory_internal_tests.rscrates/adaptive/tests/unit/runtime_tests.rspython/tests/test_adaptive.pycrates/adaptive/tests/unit/plugin_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rsgo/nemo_relay/adaptive_test.gocrates/adaptive/tests/unit/runtime_features_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/{python,ffi,node,wasm}/**/*
⚙️ CodeRabbit configuration file
crates/{python,ffi,node,wasm}/**/*: 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/node/tests/adaptive_tests.mjscrates/python/tests/coverage/py_storage_coverage_tests.rscrates/node/adaptive.d.tscrates/node/adaptive.js
crates/python/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-python-binding/SKILL.md)
If the native Rust bridge changed, add the Rust crate tests for
nemo-relay-python
Files:
crates/python/tests/coverage/py_storage_coverage_tests.rs
**/*.{py,txt,toml,cfg,yaml,yml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Python package names and top-level module imports during coordinated rename operations
Files:
crates/adaptive/Cargo.tomlpython/tests/test_adaptive_config.pypython/tests/test_adaptive.pypython/nemo_relay/adaptive.py
**/Cargo.toml
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update WebAssembly crate names and generated package names during coordinated rename operations
Confirm or infer the target release version from
upstream/main:Cargo.toml. Derive the release branch asrelease/<major>.<minor>.
**/Cargo.toml: MaintainCargo.toml[workspace.package].versionas the source of truth for the Rust workspace and Python build versioning
KeepCargo.toml[workspace.dependencies]self-references aligned with the workspace version when the workspace version changes
After updating workspace package entries, runcargo check --workspaceto refreshCargo.lock
Files:
crates/adaptive/Cargo.toml
{docs/**,README.md,**/Cargo.toml,**/package.json,**/*.md}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Ensure renamed public surfaces are reflected consistently in manifests and docs for large or public-facing changes
Files:
crates/adaptive/Cargo.toml
**/*.{md,mdx,py,sh,yaml,yml,toml,json}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Keep package names, repo references, and build commands current
Files:
crates/adaptive/Cargo.tomlpython/tests/test_adaptive_config.pypython/tests/test_adaptive.pypython/nemo_relay/adaptive.py
**/*.toml
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Include SPDX license header in TOML configuration files using hash comment syntax
Files:
crates/adaptive/Cargo.toml
**/test_*.{py,py}
📄 CodeRabbit inference engine (.agents/skills/add-integration/SKILL.md)
Relevant integration tests or smoke coverage must exist for the integration path
Files:
python/tests/test_adaptive_config.pypython/tests/test_adaptive.py
**/*config*.{rs,ts,py,go,js,json,yaml,yml}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Ensure dynamic config shape still matches the documented canonical model
Files:
python/tests/test_adaptive_config.pycrates/adaptive/tests/unit/config_tests.rscrates/adaptive/src/config.rs
{pyproject.toml,**/*.py}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Maintain consistency between Python package names in
pyproject.tomland import paths used throughout the codebase
Files:
python/tests/test_adaptive_config.pypython/tests/test_adaptive.pypython/nemo_relay/adaptive.py
python/**/*test*.py
📄 CodeRabbit inference engine (.agents/skills/test-python-binding/SKILL.md)
python/**/*test*.py: Do not add@pytest.mark.asyncioto any test in Python test files
Do not add a-> Nonereturn type annotation to test functions
When mocking a class, useunittest.mock.MagicMockorunittest.mock.AsyncMockwith thespecconstructor argument when necessary, rather than defining a new class
Prefix mocked class names withmock, notfake
Prefer pytest fixtures over helper methods in Python tests
Preferpytest.mark.parametrizeover creating individual tests for different input types
Files:
python/tests/test_adaptive_config.pypython/tests/test_adaptive.py
python/**/{conftest.py,*test*.py}
📄 CodeRabbit inference engine (.agents/skills/test-python-binding/SKILL.md)
When creating a fixture follow the pattern:
@pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) def <fixture_name>_fixture() -> <return_type>:and only specify the scope argument when the value is something other than "function"
Files:
python/tests/test_adaptive_config.pypython/tests/test_adaptive.py
**/*.py
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
**/*.py: Run Python formatting withuv run ruff format python
Run Python testing withuv run pytest -k "<pattern>"
**/*.py: Use Ruff with rule sets E, F, W, I for Python linting
Use Ruff formatter with line length 120 and double quotes for Python code formatting
Runtyfor Python type checking
Use Python snake_case naming convention for Python identifiers
Include SPDX license header in all Python source files using hash comment syntax
Validate Python code withuv run pre-commit run --all-filesto enforce Ruff linting and formatting, and ty type checking
Files:
python/tests/test_adaptive_config.pypython/tests/test_adaptive.pypython/nemo_relay/adaptive.py
go/nemo_relay/**/*.go
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Update Go wrapper in
go/nemo_relay/nemo_relay.gowith doc comment and shorthand package if the capability belongs there
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 directly
Files:
go/nemo_relay/adaptive/adaptive.gogo/nemo_relay/adaptive.gogo/nemo_relay/adaptive_test.go
go/**/*.go
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Use
PascalCasenaming convention for Go identifiers (e.g.,nemo_relay.ToolCall)Run Go formatting with
cd go/nemo_relay && go fmt ./...
Files:
go/nemo_relay/adaptive/adaptive.gogo/nemo_relay/adaptive.gogo/nemo_relay/adaptive_test.go
{python/nemo_relay/adaptive.py,python/nemo_relay/plugin.py,go/nemo_relay/adaptive/**,**/node/adaptive/**,**/wasm/adaptive/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Ensure typed helper constructors still map cleanly to the same config document in adaptive bindings across Python, Go, Node, and WebAssembly
Files:
go/nemo_relay/adaptive/adaptive.gopython/nemo_relay/adaptive.py
{go/nemo_relay/go.mod,go/**/*.go}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure Go module path in
go/nemo_relay/go.modmatches import statements in Go source files
Files:
go/nemo_relay/adaptive/adaptive.gogo/nemo_relay/adaptive.gogo/nemo_relay/adaptive_test.go
**/*.go
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Go module paths and package paths during coordinated rename operations
**/*.go: Usegofmtfor Go code formatting
Rungo vet ./...for Go static analysis
Use Go PascalCase naming convention for Go identifiers
Include SPDX license header in all Go source files using double-slash comment syntax
Validate Go code withuv run pre-commit run --all-filesto enforce gofmt formatting and go vet static analysis
Files:
go/nemo_relay/adaptive/adaptive.gogo/nemo_relay/adaptive.gogo/nemo_relay/adaptive_test.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/adaptive/adaptive.gogo/nemo_relay/adaptive.gogo/nemo_relay/adaptive_test.go
**/*.{wasm,js,ts}{,x}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure WebAssembly package naming conventions are consistent with generated package expectations and downstream consumption
Files:
crates/node/adaptive.d.tscrates/node/adaptive.js
crates/node/**/*.{js,ts,jsx,tsx,json}
📄 CodeRabbit inference engine (.agents/skills/test-node-binding/SKILL.md)
Format changed Node files with
npm run format --workspace=nemo-relay-node
Files:
crates/node/adaptive.d.tscrates/node/adaptive.js
crates/node/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.agents/skills/test-node-binding/SKILL.md)
Use
npm run check:docstrings --workspace=nemo-relay-nodeto validate public API docstring checks when surface docs changed
Files:
crates/node/adaptive.d.ts
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Run Node.js formatting with
npm run format --workspace=nemo-relay-nodeInclude SPDX license header in all JavaScript and TypeScript source files using double-slash comment syntax
Files:
crates/node/adaptive.d.tscrates/node/adaptive.js
crates/node/**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Node.js public entry points include the main runtime package plus
nemo-relay-node/typed,nemo-relay-node/plugin, andnemo-relay-node/adaptive.
Files:
crates/node/adaptive.d.tscrates/node/adaptive.js
{crates/python/src/py_api/**/*.rs,python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi}
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Update Python native binding in
crates/python/src/py_api/mod.rswith Python wrapper docstring inpython/nemo_relay/<module>.pyand type stubs inpython/nemo_relay/*.pyimodules
Files:
python/nemo_relay/adaptive.pypython/nemo_relay/adaptive.pyi
python/nemo_relay/**/*.py
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Use
snake_casenaming convention for Python identifiers (e.g.,nemo_relay.tools.call)Format changed Python wrapper and test files with
uv run ruff format pythonPython wrapper modules live under
python/nemo_relay/; the native extension is built fromcrates/pythonwithmaturin.
Files:
python/nemo_relay/adaptive.py
python/nemo_relay/**/*
⚙️ CodeRabbit configuration file
python/nemo_relay/**/*: Review Python wrapper changes for typed API consistency, contextvars-based scope isolation, async behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.
Files:
python/nemo_relay/adaptive.pypython/nemo_relay/adaptive.pyi
🧠 Learnings (1)
📚 Learning: 2026-05-07T18:04:44.387Z
Learnt from: mnajafian-nv
Repo: NVIDIA/NeMo-Flow PR: 67
File: integrations/openclaw/src/modules.ts:1-2
Timestamp: 2026-05-07T18:04:44.387Z
Learning: In NVIDIA/NeMo-Flow, TypeScript source files should use `//` line comments for SPDX headers (e.g., `// SPDX-FileCopyrightText: ...` and `// SPDX-License-Identifier: ...`) rather than C-style block comments (`/* ... */`). The repo’s copyright checker enforces this mapping, so `//` SPDX headers in `.ts` files should not be flagged as a style violation.
Applied to files:
crates/node/adaptive.d.ts
Signed-off-by: teerthsharma <teerths57@Gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/adaptive/src/acg_learner.rs (1)
215-295: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winReset the per-profile convergence detector when learning reopens.
If a cached converged profile fails the reuse check and drops into the recompute path,
record_stability_epochstill appends to the existing detector entry for thatprofile_key. The stale epochs already satisfystability_window, so topology/output-contract changes can re-converge immediately instead of forcing a fresh post-drift window.Proposed fix
if let Some(cached) = existing_stability.as_ref().filter(|stability| { self.convergence .as_ref() .is_some_and(|config| config.enabled) && stability.converged && stability.total_observations as usize >= stability_window && new_observations.iter().all(|observation| { Self::prompt_topology_matches_stability(stability, observation) }) }) { profile_counts.insert(profile_key.clone(), cached.total_observations); profile_stability.insert(profile_key.clone(), cached.clone()); // ... continue; } + + if existing_stability + .as_ref() + .is_some_and(|stability| stability.converged) + { + self.convergence_detectors + .write() + .map_err(|error| { + AdaptiveError::Internal(format!( + "convergence detector lock poisoned: {error}" + )) + })? + .remove(&profile_key); + } let existing = backend.load_observations(&profile_key).await?;🤖 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 `@crates/adaptive/src/acg_learner.rs` around lines 215 - 295, The recompute path in acg_learner::learn is reusing the old per-profile convergence detector state after a cached converged profile fails the reuse check. Reset or replace the detector entry for the current profile_key before calling record_stability_epoch when learning reopens, so stale epochs from the prior convergence do not immediately satisfy the new stability window. Use the existing profile_key handling in the grouped_observations loop and keep the reset scoped to the non-reuse path before analyze_stability/record_stability_epoch.Source: Path instructions
🤖 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/node/adaptive.js`:
- Around line 83-90: `mergeDefined` currently throws when `config` is `null`
because it calls `Object.entries(config)`, but the previous merge behavior
treated `null` as no overrides. Update `mergeDefined` in `adaptive.js` to
tolerate nullable configs by normalizing `config` to an empty object (or
returning `defaults` unchanged) before iterating, while preserving the existing
undefined-filtering behavior for real overrides.
---
Outside diff comments:
In `@crates/adaptive/src/acg_learner.rs`:
- Around line 215-295: The recompute path in acg_learner::learn is reusing the
old per-profile convergence detector state after a cached converged profile
fails the reuse check. Reset or replace the detector entry for the current
profile_key before calling record_stability_epoch when learning reopens, so
stale epochs from the prior convergence do not immediately satisfy the new
stability window. Use the existing profile_key handling in the
grouped_observations loop and keep the reset scoped to the non-reuse path before
analyze_stability/record_stability_epoch.
🪄 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: 1bdd79f7-5926-459c-9561-a5e356efa006
📒 Files selected for processing (7)
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/node/adaptive.jscrates/node/tests/adaptive_tests.mjs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (20)
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Use
snake_casenaming convention for Rust identifiers (e.g.,nemo_relay_tool_call)
**/*.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 work
**/*.rs: Runcargo fmt --allto format all Rust code
Runcargo clippy --workspace --all-targets -- -D warningsto enforce all clippy lints as errors
**/*.rs: Runcargo fmt --allwhen Rust files changed as part of WebAssembly work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files changed as part of WebAssembly work
**/*.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
Run Rust formatting withcargo fmt --all
Run Rust linting withcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Usecargo fmtfor Rust code formatting
Runcargo clippy -- -D warningsto lint Rust code and treat all warnings as errors
Use Rust snake_case naming convention for Rust identifiers
Include SPDX license header in all Rust source files using double-slash comment syntax
Validate Rust code withuv run pre-commit run --all-filesto enforce cargo fmt formatting check, cargo clippy lints, and cargo deny aud...
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**,python/nemo_relay/adaptive.py,python/nemo_relay/plugin.py,go/nemo_relay/adaptive/**,go/nemo_relay/!(adaptive)/**,**/node/**,**/wasm/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep adaptive surface in sync across crates/adaptive, shared plugin behavior in core and bindings, Python adaptive/plugin wrappers in python/nemo_relay/adaptive.py and python/nemo_relay/plugin.py, Go adaptive helpers under go/nemo_relay/adaptive plus shared plugin helpers in go/nemo_relay, and Node/WebAssembly adaptive helpers and plugin wrappers
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/node/adaptive.jscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/node/tests/adaptive_tests.mjscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}: Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)
Keep plugin context surfaces aligned across all language implementations
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/node/adaptive.jscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/node/tests/adaptive_tests.mjscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**/*.rs,**/*test*.{rs,py,go,ts,js},**/*adaptive*test*.{rs,py,go,ts,js},docs/plugins/adaptive/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain documented and tested validation and report behavior for adaptive surfaces
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/{Cargo.toml,**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Maintain consistency between Rust package names in
Cargo.tomland their actual usage across the codebase
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{h,hpp,c,cpp,rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure FFI header and library naming follows consistent conventions across platform-specific builds
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.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/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Rust crate names and module prefixes during coordinated rename operations
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}
📄 CodeRabbit inference engine (AGENTS.md)
Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/node/adaptive.jscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions: Rust and Python use
snake_case, C FFI exports prefixednemo_relay_, Go usesPascalCasefor public APIs, Node.js usescamelCase.
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/node/adaptive.jscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Keep async behavior on the existing tokio-based model. Bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
UseJson = serde_json::Valuein Rust-facing runtime APIs for JSON payload handling.
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**
⚙️ CodeRabbit configuration file
**:AGENTS.md
This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.
Project Overview
NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go, WebAssembly, and the raw C FFI are experimental and source-first.
The shared runtime model is:
- Scope stacks decide where work belongs and which scope-local behavior is visible.
- Middleware registries decide what guardrails and intercepts run around managed calls.
- Plugins install reusable runtime behavior from configuration.
- Events record runtime behavior in ATOF form.
- Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.
Repository Structure
The repository layout separates the Rust runtime, language bindings, documentation,
integration patches, and agent-facing skills.crates/ core/ # Rust core runtime crate, published as nemo-relay adaptive/ # Adaptive runtime primitives and plugin components python/ # PyO3 native extension for the Python package ffi/ # Raw C ABI layer used by downstream bindings such as Go node/ # NAPI Node.js binding and JavaScript/TypeScript entry points wasm/ # wasm-bindgen WebAssembly binding and JS wrappers python/ nemo_relay/ # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers tests/ # Python tests go/ nemo_relay/ # Experimental Go CGo binding and tests fern/ # Fern documentation site scripts/ # Stable wrappers and helper scripts; build/test/docs entry points live in justfile third_party/ # P...
Files:
crates/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/node/adaptive.jscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/node/tests/adaptive_tests.mjscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_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/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_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/adaptive/tests/unit/tool_parallelism_learner_tests.rscrates/adaptive/tests/unit/types_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/node/tests/adaptive_tests.mjscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{wasm,js,ts}{,x}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure WebAssembly package naming conventions are consistent with generated package expectations and downstream consumption
Files:
crates/node/adaptive.js
crates/node/**/*.{js,ts,jsx,tsx,json}
📄 CodeRabbit inference engine (.agents/skills/test-node-binding/SKILL.md)
Format changed Node files with
npm run format --workspace=nemo-relay-node
Files:
crates/node/adaptive.js
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Run Node.js formatting with
npm run format --workspace=nemo-relay-nodeInclude SPDX license header in all JavaScript and TypeScript source files using double-slash comment syntax
Files:
crates/node/adaptive.js
crates/node/**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Node.js public entry points include the main runtime package plus
nemo-relay-node/typed,nemo-relay-node/plugin, andnemo-relay-node/adaptive.
Files:
crates/node/adaptive.js
crates/{python,ffi,node,wasm}/**/*
⚙️ CodeRabbit configuration file
crates/{python,ffi,node,wasm}/**/*: 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/node/adaptive.jscrates/node/tests/adaptive_tests.mjs
Signed-off-by: teerthsharma <teerths57@Gmail.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
crates/adaptive/src/acg_learner.rs (2)
328-340: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winCompare normal candidates against the cached aggregate candidate.
After a cached profile wins
best_aggregate_stability, the next non-cached profile still compares againstbest_profile_seed, which may beNone; that lets a weaker profile replace the better cached aggregate in hot cache.Proposed fix
- let replace_best = best_profile_seed + let replace_best = best_aggregate_stability .as_ref() - .map(|(_, current)| { + .map(|current| { ( stability_result.stable_prefix_length, stability_result.total_observations, ) > (current.stable_prefix_length, current.total_observations)🤖 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 `@crates/adaptive/src/acg_learner.rs` around lines 328 - 340, The aggregate winner in the candidate selection flow is not being used as the baseline for later normal profiles, so a weaker non-cached profile can replace a better cached one. Update the replacement check in acg_learner.rs around the best_profile_seed / best_aggregate_stability selection logic so comparisons for non-cached candidates use the current cached aggregate as the reference when present, and keep best_profile_seed and best_aggregate_stability in sync in the candidate-evaluation path.
292-302: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winPersist observations before advancing the convergence detector.
record_stability_epochmutates in-memory detector state beforestore_observationscan fail. A transient storage error can count phantom epochs and later mark a profile converged with fewer durable observations than required.Proposed fix
- let converged_now = self.record_stability_epoch(&profile_key, &stability_result)?; - // Store the observations that produced this stability result. // On the epoch that first declares convergence these // observations are preserved; on subsequent runs the cached // converged result is reused and this path is skipped. backend .store_observations(&profile_key, &observations_vec) .await?; + + let converged_now = self.record_stability_epoch(&profile_key, &stability_result)?;As per path instructions, review the Rust runtime for event lifecycle regressions.
🤖 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 `@crates/adaptive/src/acg_learner.rs` around lines 292 - 302, Persist the observations before mutating the convergence state in acg_learner.rs: the current flow calls record_stability_epoch on the result from analyze_stability and only then awaits backend.store_observations, which can leave in-memory epochs advanced if storage fails. Reorder the logic in the learner path so backend.store_observations for the current profile_key and observations_vec completes successfully before calling record_stability_epoch, and keep the convergence decision based on the same observations/stability_result to avoid phantom epochs in record_stability_epoch and the cached converged-result path.Source: Path instructions
🤖 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.
Outside diff comments:
In `@crates/adaptive/src/acg_learner.rs`:
- Around line 328-340: The aggregate winner in the candidate selection flow is
not being used as the baseline for later normal profiles, so a weaker non-cached
profile can replace a better cached one. Update the replacement check in
acg_learner.rs around the best_profile_seed / best_aggregate_stability selection
logic so comparisons for non-cached candidates use the current cached aggregate
as the reference when present, and keep best_profile_seed and
best_aggregate_stability in sync in the candidate-evaluation path.
- Around line 292-302: Persist the observations before mutating the convergence
state in acg_learner.rs: the current flow calls record_stability_epoch on the
result from analyze_stability and only then awaits backend.store_observations,
which can leave in-memory epochs advanced if storage fails. Reorder the logic in
the learner path so backend.store_observations for the current profile_key and
observations_vec completes successfully before calling record_stability_epoch,
and keep the convergence decision based on the same
observations/stability_result to avoid phantom epochs in record_stability_epoch
and the cached converged-result path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 49666070-ab2c-40e9-99a7-7f46ee528049
📒 Files selected for processing (4)
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/node/adaptive.jscrates/node/tests/adaptive_tests.mjs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (20)
{crates/adaptive/**,python/nemo_relay/adaptive.py,python/nemo_relay/plugin.py,go/nemo_relay/adaptive/**,go/nemo_relay/!(adaptive)/**,**/node/**,**/wasm/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep adaptive surface in sync across crates/adaptive, shared plugin behavior in core and bindings, Python adaptive/plugin wrappers in python/nemo_relay/adaptive.py and python/nemo_relay/plugin.py, Go adaptive helpers under go/nemo_relay/adaptive plus shared plugin helpers in go/nemo_relay, and Node/WebAssembly adaptive helpers and plugin wrappers
Files:
crates/node/tests/adaptive_tests.mjscrates/node/adaptive.jscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}: Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)
Keep plugin context surfaces aligned across all language implementations
Files:
crates/node/tests/adaptive_tests.mjscrates/node/adaptive.jscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**
⚙️ CodeRabbit configuration file
**:AGENTS.md
This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.
Project Overview
NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go, WebAssembly, and the raw C FFI are experimental and source-first.
The shared runtime model is:
- Scope stacks decide where work belongs and which scope-local behavior is visible.
- Middleware registries decide what guardrails and intercepts run around managed calls.
- Plugins install reusable runtime behavior from configuration.
- Events record runtime behavior in ATOF form.
- Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.
Repository Structure
The repository layout separates the Rust runtime, language bindings, documentation,
integration patches, and agent-facing skills.crates/ core/ # Rust core runtime crate, published as nemo-relay adaptive/ # Adaptive runtime primitives and plugin components python/ # PyO3 native extension for the Python package ffi/ # Raw C ABI layer used by downstream bindings such as Go node/ # NAPI Node.js binding and JavaScript/TypeScript entry points wasm/ # wasm-bindgen WebAssembly binding and JS wrappers python/ nemo_relay/ # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers tests/ # Python tests go/ nemo_relay/ # Experimental Go CGo binding and tests fern/ # Fern documentation site scripts/ # Stable wrappers and helper scripts; build/test/docs entry points live in justfile third_party/ # P...
Files:
crates/node/tests/adaptive_tests.mjscrates/node/adaptive.jscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/{python,ffi,node,wasm}/**/*
⚙️ CodeRabbit configuration file
crates/{python,ffi,node,wasm}/**/*: 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/node/tests/adaptive_tests.mjscrates/node/adaptive.js
{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/node/tests/adaptive_tests.mjscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{wasm,js,ts}{,x}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure WebAssembly package naming conventions are consistent with generated package expectations and downstream consumption
Files:
crates/node/adaptive.js
crates/node/**/*.{js,ts,jsx,tsx,json}
📄 CodeRabbit inference engine (.agents/skills/test-node-binding/SKILL.md)
Format changed Node files with
npm run format --workspace=nemo-relay-node
Files:
crates/node/adaptive.js
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Run Node.js formatting with
npm run format --workspace=nemo-relay-nodeInclude SPDX license header in all JavaScript and TypeScript source files using double-slash comment syntax
Files:
crates/node/adaptive.js
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}
📄 CodeRabbit inference engine (AGENTS.md)
Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.
Files:
crates/node/adaptive.jscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions: Rust and Python use
snake_case, C FFI exports prefixednemo_relay_, Go usesPascalCasefor public APIs, Node.js usescamelCase.
Files:
crates/node/adaptive.jscrates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/node/**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Node.js public entry points include the main runtime package plus
nemo-relay-node/typed,nemo-relay-node/plugin, andnemo-relay-node/adaptive.
Files:
crates/node/adaptive.js
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Use
snake_casenaming convention for Rust identifiers (e.g.,nemo_relay_tool_call)
**/*.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 work
**/*.rs: Runcargo fmt --allto format all Rust code
Runcargo clippy --workspace --all-targets -- -D warningsto enforce all clippy lints as errors
**/*.rs: Runcargo fmt --allwhen Rust files changed as part of WebAssembly work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files changed as part of WebAssembly work
**/*.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
Run Rust formatting withcargo fmt --all
Run Rust linting withcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Usecargo fmtfor Rust code formatting
Runcargo clippy -- -D warningsto lint Rust code and treat all warnings as errors
Use Rust snake_case naming convention for Rust identifiers
Include SPDX license header in all Rust source files using double-slash comment syntax
Validate Rust code withuv run pre-commit run --all-filesto enforce cargo fmt formatting check, cargo clippy lints, and cargo deny aud...
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**/*.rs,**/*test*.{rs,py,go,ts,js},**/*adaptive*test*.{rs,py,go,ts,js},docs/plugins/adaptive/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain documented and tested validation and report behavior for adaptive surfaces
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/{Cargo.toml,**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Maintain consistency between Rust package names in
Cargo.tomland their actual usage across the codebase
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{h,hpp,c,cpp,rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure FFI header and library naming follows consistent conventions across platform-specific builds
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.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/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Rust crate names and module prefixes during coordinated rename operations
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Keep async behavior on the existing tokio-based model. Bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
UseJson = serde_json::Valuein Rust-facing runtime APIs for JSON payload handling.
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_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/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
🔇 Additional comments (4)
crates/node/tests/adaptive_tests.mjs (1)
221-233: LGTM!crates/node/adaptive.js (1)
83-91: LGTM!crates/adaptive/src/acg_learner.rs (1)
37-175: LGTM!Also applies to: 222-277
crates/adaptive/tests/unit/acg_learner_tests.rs (1)
286-407: LGTM!Also applies to: 751-798
Signed-off-by: teerthsharma <teerths57@Gmail.com>
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 `@crates/adaptive/src/acg_learner.rs`:
- Around line 145-153: Preserve converged stability results when comparing
aggregates: update should_replace_aggregate in acg_learner.rs so a current
converged StabilityAnalysisResult is not replaced by a non-converged candidate
when stable_prefix_length ties, even if candidate.total_observations is higher.
Apply the same tie-breaking/convergence-preserving rule consistently in the
other aggregate replacement sites referenced by the review so
guard.acg_stability cannot regress from converged to non-converged.
🪄 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: 121e98c9-44a9-4810-80d6-d2022af05866
📒 Files selected for processing (2)
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (15)
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Use
snake_casenaming convention for Rust identifiers (e.g.,nemo_relay_tool_call)
**/*.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 work
**/*.rs: Runcargo fmt --allto format all Rust code
Runcargo clippy --workspace --all-targets -- -D warningsto enforce all clippy lints as errors
**/*.rs: Runcargo fmt --allwhen Rust files changed as part of WebAssembly work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files changed as part of WebAssembly work
**/*.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
Run Rust formatting withcargo fmt --all
Run Rust linting withcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Usecargo fmtfor Rust code formatting
Runcargo clippy -- -D warningsto lint Rust code and treat all warnings as errors
Use Rust snake_case naming convention for Rust identifiers
Include SPDX license header in all Rust source files using double-slash comment syntax
Validate Rust code withuv run pre-commit run --all-filesto enforce cargo fmt formatting check, cargo clippy lints, and cargo deny aud...
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
{crates/adaptive/**,python/nemo_relay/adaptive.py,python/nemo_relay/plugin.py,go/nemo_relay/adaptive/**,go/nemo_relay/!(adaptive)/**,**/node/**,**/wasm/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep adaptive surface in sync across crates/adaptive, shared plugin behavior in core and bindings, Python adaptive/plugin wrappers in python/nemo_relay/adaptive.py and python/nemo_relay/plugin.py, Go adaptive helpers under go/nemo_relay/adaptive plus shared plugin helpers in go/nemo_relay, and Node/WebAssembly adaptive helpers and plugin wrappers
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}: Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)
Keep plugin context surfaces aligned across all language implementations
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
{crates/adaptive/**/*.rs,**/*test*.{rs,py,go,ts,js},**/*adaptive*test*.{rs,py,go,ts,js},docs/plugins/adaptive/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain documented and tested validation and report behavior for adaptive surfaces
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
**/{Cargo.toml,**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Maintain consistency between Rust package names in
Cargo.tomland their actual usage across the codebase
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
**/*.{h,hpp,c,cpp,rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure FFI header and library naming follows consistent conventions across platform-specific builds
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.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/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Rust crate names and module prefixes during coordinated rename operations
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}
📄 CodeRabbit inference engine (AGENTS.md)
Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions: Rust and Python use
snake_case, C FFI exports prefixednemo_relay_, Go usesPascalCasefor public APIs, Node.js usescamelCase.
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Keep async behavior on the existing tokio-based model. Bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
UseJson = serde_json::Valuein Rust-facing runtime APIs for JSON payload handling.
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.rs
**
⚙️ CodeRabbit configuration file
**:AGENTS.md
This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.
Project Overview
NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go, WebAssembly, and the raw C FFI are experimental and source-first.
The shared runtime model is:
- Scope stacks decide where work belongs and which scope-local behavior is visible.
- Middleware registries decide what guardrails and intercepts run around managed calls.
- Plugins install reusable runtime behavior from configuration.
- Events record runtime behavior in ATOF form.
- Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.
Repository Structure
The repository layout separates the Rust runtime, language bindings, documentation,
integration patches, and agent-facing skills.crates/ core/ # Rust core runtime crate, published as nemo-relay adaptive/ # Adaptive runtime primitives and plugin components python/ # PyO3 native extension for the Python package ffi/ # Raw C ABI layer used by downstream bindings such as Go node/ # NAPI Node.js binding and JavaScript/TypeScript entry points wasm/ # wasm-bindgen WebAssembly binding and JS wrappers python/ nemo_relay/ # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers tests/ # Python tests go/ nemo_relay/ # Experimental Go CGo binding and tests fern/ # Fern documentation site scripts/ # Stable wrappers and helper scripts; build/test/docs entry points live in justfile third_party/ # P...
Files:
crates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.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/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg_learner.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/adaptive/tests/unit/acg_learner_tests.rs
🔇 Additional comments (4)
crates/adaptive/src/acg_learner.rs (2)
37-37: 📐 Maintainability & Code QualityConfirm the required Rust/adaptive validation matrix.
This Rust change is under
crates/adaptive; please include the Rust checks and affected-binding matrix in PR validation notes:cargo fmt --all,cargo clippy --workspace --all-targets -- -D warnings,just test-rust,just test-python,just test-go,just test-node, andjust test-wasm.As per coding guidelines, "
**/*.rs: Any Rust change must runjust test-rust,cargo fmt --all, andcargo clippy --workspace --all-targets -- -D warnings." As per path instructions, "{crates/core,crates/adaptive}/**/*: Changes tocrates/coreorcrates/adaptivemust run the full language matrix."Sources: Coding guidelines, Path instructions
37-85: LGTM!Also applies to: 95-143, 157-187, 273-310
crates/adaptive/tests/unit/acg_learner_tests.rs (2)
314-316: LGTM!Also applies to: 393-410, 591-637, 723-765, 789-824, 921-971, 1079-1131
766-787: 🎯 Functional CorrectnessNo change needed here The test is included from
crates/adaptive/src/acg_learner.rsas an internal#[cfg(test)]module, so it can callAcgLearner::should_replace_aggregateeven though the helper is private.> Likely an incorrect or invalid review comment.
Signed-off-by: teerthsharma <teerths57@Gmail.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
crates/adaptive/src/acg_learner.rs (2)
318-326: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftMake convergence detector updates transactional with stability persistence.
record_stability_epochadvances the in-memory detector beforestore_stability. Ifstore_stabilityfails,process_runreturns an error but the detector epoch remains advanced, so retries can declare convergence for epochs that were never durably persisted.🤖 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 `@crates/adaptive/src/acg_learner.rs` around lines 318 - 326, Make the convergence detector update transactional with stability persistence in process_run: record_stability_epoch currently advances the in-memory state before store_stability, so a failed persistence leaves the detector ahead of durable data. Update the flow around record_stability_epoch and backend.store_stability so the detector state is only committed after a successful store, or is rolled back/recomputed on failure, and keep the converged_now/stability_result.converged handling consistent with that change.
262-266: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winKeep the persisted aggregate seed aligned when a cached profile wins.
The cached path updates
best_aggregate_stabilitybut leavesbest_profile_seedunchanged. If a weaker non-cached profile setbest_profile_seedearlier, lines 354-363 persist that weaker aggregate underself.agent_idwhile the hot cache receives the cached winner.Proposed fix
- let mut best_profile_seed: Option<( - Vec<PromptIR>, - crate::acg::stability::StabilityAnalysisResult, - )> = None; + let mut best_aggregate_observations: Option<Vec<PromptIR>> = None; let mut best_aggregate_stability: Option< crate::acg::stability::StabilityAnalysisResult, > = None; @@ let replace_best = Self::should_replace_aggregate(cached, best_aggregate_stability.as_ref()); if replace_best { + best_aggregate_observations = None; best_aggregate_stability = Some(cached.clone()); } @@ ); if replace_best { - best_profile_seed = Some((observations_vec.clone(), stability_result.clone())); + best_aggregate_observations = Some(observations_vec.clone()); best_aggregate_stability = Some(stability_result.clone()); } } - if let Some((aggregate_observations, aggregate_stability)) = best_profile_seed.as_ref() - { + if let Some(aggregate_stability) = best_aggregate_stability.as_ref() { // Persist the runtime seed entry under plain agent_id so registration can // rehydrate HotCache without scanning profile-specific keys. - backend - .store_observations(&self.agent_id, aggregate_observations) - .await?; + if let Some(aggregate_observations) = best_aggregate_observations.as_ref() { + backend + .store_observations(&self.agent_id, aggregate_observations) + .await?; + } backend .store_stability(&self.agent_id, aggregate_stability) .await?;Also applies to: 354-363
🤖 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 `@crates/adaptive/src/acg_learner.rs` around lines 262 - 266, The cached winner path in ACG learner updates best_aggregate_stability but leaves best_profile_seed pointing to an older non-cached profile, which can cause the wrong aggregate to be persisted. Update the cached-replacement branch in acg_learner.rs so that when Self::should_replace_aggregate returns true and cached.clone() becomes the new best aggregate, best_profile_seed is also kept in sync with that cached winner. Make sure the persistence logic later in the same flow uses the same winning seed/aggregate pair when writing under self.agent_id.
🤖 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.
Outside diff comments:
In `@crates/adaptive/src/acg_learner.rs`:
- Around line 318-326: Make the convergence detector update transactional with
stability persistence in process_run: record_stability_epoch currently advances
the in-memory state before store_stability, so a failed persistence leaves the
detector ahead of durable data. Update the flow around record_stability_epoch
and backend.store_stability so the detector state is only committed after a
successful store, or is rolled back/recomputed on failure, and keep the
converged_now/stability_result.converged handling consistent with that change.
- Around line 262-266: The cached winner path in ACG learner updates
best_aggregate_stability but leaves best_profile_seed pointing to an older
non-cached profile, which can cause the wrong aggregate to be persisted. Update
the cached-replacement branch in acg_learner.rs so that when
Self::should_replace_aggregate returns true and cached.clone() becomes the new
best aggregate, best_profile_seed is also kept in sync with that cached winner.
Make sure the persistence logic later in the same flow uses the same winning
seed/aggregate pair when writing under self.agent_id.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 00d3d81d-08e0-489e-a62b-ca8f5559f6a2
📒 Files selected for processing (2)
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (15)
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Use
snake_casenaming convention for Rust identifiers (e.g.,nemo_relay_tool_call)
**/*.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 work
**/*.rs: Runcargo fmt --allto format all Rust code
Runcargo clippy --workspace --all-targets -- -D warningsto enforce all clippy lints as errors
**/*.rs: Runcargo fmt --allwhen Rust files changed as part of WebAssembly work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files changed as part of WebAssembly work
**/*.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
Run Rust formatting withcargo fmt --all
Run Rust linting withcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Usecargo fmtfor Rust code formatting
Runcargo clippy -- -D warningsto lint Rust code and treat all warnings as errors
Use Rust snake_case naming convention for Rust identifiers
Include SPDX license header in all Rust source files using double-slash comment syntax
Validate Rust code withuv run pre-commit run --all-filesto enforce cargo fmt formatting check, cargo clippy lints, and cargo deny aud...
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**,python/nemo_relay/adaptive.py,python/nemo_relay/plugin.py,go/nemo_relay/adaptive/**,go/nemo_relay/!(adaptive)/**,**/node/**,**/wasm/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep adaptive surface in sync across crates/adaptive, shared plugin behavior in core and bindings, Python adaptive/plugin wrappers in python/nemo_relay/adaptive.py and python/nemo_relay/plugin.py, Go adaptive helpers under go/nemo_relay/adaptive plus shared plugin helpers in go/nemo_relay, and Node/WebAssembly adaptive helpers and plugin wrappers
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}: Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)
Keep plugin context surfaces aligned across all language implementations
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
{crates/adaptive/**/*.rs,**/*test*.{rs,py,go,ts,js},**/*adaptive*test*.{rs,py,go,ts,js},docs/plugins/adaptive/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain documented and tested validation and report behavior for adaptive surfaces
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/{Cargo.toml,**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Maintain consistency between Rust package names in
Cargo.tomland their actual usage across the codebase
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{h,hpp,c,cpp,rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure FFI header and library naming follows consistent conventions across platform-specific builds
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.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/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Rust crate names and module prefixes during coordinated rename operations
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}
📄 CodeRabbit inference engine (AGENTS.md)
Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions: Rust and Python use
snake_case, C FFI exports prefixednemo_relay_, Go usesPascalCasefor public APIs, Node.js usescamelCase.
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Keep async behavior on the existing tokio-based model. Bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
UseJson = serde_json::Valuein Rust-facing runtime APIs for JSON payload handling.
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_tests.rs
**
⚙️ CodeRabbit configuration file
**:AGENTS.md
This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.
Project Overview
NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go, WebAssembly, and the raw C FFI are experimental and source-first.
The shared runtime model is:
- Scope stacks decide where work belongs and which scope-local behavior is visible.
- Middleware registries decide what guardrails and intercepts run around managed calls.
- Plugins install reusable runtime behavior from configuration.
- Events record runtime behavior in ATOF form.
- Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.
Repository Structure
The repository layout separates the Rust runtime, language bindings, documentation,
integration patches, and agent-facing skills.crates/ core/ # Rust core runtime crate, published as nemo-relay adaptive/ # Adaptive runtime primitives and plugin components python/ # PyO3 native extension for the Python package ffi/ # Raw C ABI layer used by downstream bindings such as Go node/ # NAPI Node.js binding and JavaScript/TypeScript entry points wasm/ # wasm-bindgen WebAssembly binding and JS wrappers python/ nemo_relay/ # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers tests/ # Python tests go/ nemo_relay/ # Experimental Go CGo binding and tests fern/ # Fern documentation site scripts/ # Stable wrappers and helper scripts; build/test/docs entry points live in justfile third_party/ # P...
Files:
crates/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_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/adaptive/src/acg_learner.rscrates/adaptive/tests/unit/acg_learner_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/adaptive/tests/unit/acg_learner_tests.rs
🔇 Additional comments (1)
crates/adaptive/tests/unit/acg_learner_tests.rs (1)
291-297: LGTM!Also applies to: 318-326, 386-411, 789-810
Signed-off-by: teerthsharma <teerths57@Gmail.com>
Overview
Continuation of #282 with a narrowed focus: topology-aware ACG should learn reusable agent structure for cache reuse, not merely report faster convergence.
The practical target is repeated agent workflows where the stable prefix is reusable while the task suffix changes. That prefix can include system policy, tool schema, workflow scaffold, and output contract. The task-specific suffix remains variable.
Details
This branch keeps the topology-aware behavior inside
nemo-relay-adaptiveand updates ACG around that narrower cache/reuse model:Local validation on the cleaned commit:
A local interleaved Hermes Agent A/B run was also used to validate the new focus on cache/token movement:
The benchmark uses a local Anthropic-compatible cache-control emulator, so the cost claim is limited to token/cache movement and modeled provider time, not a real provider invoice.
Where should the reviewer start?
Start with the ACG learning and cache-reuse path:
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit