Skip to content

fix(adaptive): reuse stable ACG scaffolds#481

Draft
teerthsharma wants to merge 2 commits into
NVIDIA:mainfrom
teerthsharma:fix/acg-stable-scaffold-reuse
Draft

fix(adaptive): reuse stable ACG scaffolds#481
teerthsharma wants to merge 2 commits into
NVIDIA:mainfrom
teerthsharma:fix/acg-stable-scaffold-reuse

Conversation

@teerthsharma

@teerthsharma teerthsharma commented Jul 20, 2026

Copy link
Copy Markdown

Overview

ACG currently includes the first non-system message in its learning key. That fragments otherwise identical system/tool/output scaffolds whenever the first user task changes, so observations never converge into a reusable profile.

This draft keeps the change inside the existing ACG path:

  • bucket learning by the full stable system/tool/structured-output scaffold while preserving the prior task seed for requests without a scaffold;

  • populate the existing structured_output_schema_id and model the response format as a stable IR block;

  • bind learned reuse fingerprints to the exact scaffold key, and conservatively to the full source request when a learned prefix extends beyond that scaffold;

  • fail open for legacy, missing, shorter, or mismatched fingerprints.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.

  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

The implementation deliberately excludes the governor, drift detector, convergence machinery, configuration expansion, and public binding helpers proposed in #322. It uses the current learner, storage, hot cache, and provider translators.

Coverage includes variable first-user tasks, changed system/tool/output contracts, canonical structured output, raw-whitespace changes hidden by normalized IR, prefixes extending beyond the scaffold, legacy persisted state, same-run aggregation, fresh-cache rehydration, Redis backend restart, and serialization compatibility.

Validation completed locally:

  • cargo test -p nemo-relay-adaptive --quiet: 482 unit, 8 surface, and 12 runtime-integration tests passed; doctests passed.
  • cargo clippy -p nemo-relay-adaptive -p nemo-relay-python --all-targets -- -D warnings passed.
  • just test-python: 531 passed, 4 skipped.
  • just test-node: 263 passed, 2 skipped.
  • Redis 7 restart test passed using a disposable container.
  • Independent read-only review found no Critical or Important issues after fixes.

Repository-wide limitations on this Windows host are not hidden: just test-rust reaches unrelated existing CLI/DACL filesystem failures, just test-go requires an unavailable clang/lld, and docs validation reports zero content errors before a later Windows libuv assertion. CI should provide the authoritative Linux matrix.

No provider-cache, cost, or latency improvement is claimed by this PR. A prior interleaved three-arm run demonstrated the internal fragmentation (144 keys/0 hints versus 1 key/120 hints) but used an older main revision and a benchmark overlay, so it is not presented as final performance evidence for this diff.

Persisted JSON remains backward-compatible through an optional fingerprint field. The added field is source-visible to downstream Rust code that constructs StabilityAnalysisResult with a struct literal.

Where should the reviewer start?

Start with crates/adaptive/src/acg_profile.rs for the learning-key boundary, then crates/adaptive/src/acg/stability.rs and crates/adaptive/src/acg_component.rs for exact reuse validation. The focused behavior tests are in crates/adaptive/tests/unit/acg_profile_tests.rs and crates/adaptive/tests/unit/acg_component_tests.rs.

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

Summary by CodeRabbit

  • New Features
    • Added support for structured output schemas with canonicalized identifiers and deterministic prompt blocks.
    • Added stable-prefix fingerprinting to improve adaptive profile reuse and learning-key bucketing across scaffold and response-format changes.
  • Bug Fixes
    • Prevented intent bundle creation when stored stability fingerprints are missing or don’t match the current prompt.
    • Improved persistence/restoration of stability data after backend restarts.
  • Tests
    • Added unit/integration coverage for structured outputs, canonicalization, fingerprint validation, and persisted scaffold profile reuse.

Signed-off-by: teerthsharma <teerths57@Gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added size:L PR is large Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code labels Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

ACG prompt IR now includes canonicalized structured output, while learning/profile keys incorporate scaffold and response-format fingerprints. Stability results persist dominant prefix fingerprints, and intent construction validates live fingerprints before reuse. Tests cover key bucketing, persistence, serialization, and mismatch rejection.

Changes

ACG scaffold fingerprinting

Layer / File(s) Summary
Prompt scaffolds and key derivation
crates/adaptive/src/acg/ir_builder.rs, crates/adaptive/src/acg_profile.rs, crates/adaptive/tests/unit/acg/{ir_builder,acg_profile}_tests.rs, crates/adaptive/tests/unit/runtime_tests.rs
Structured output is canonicalized into prompt blocks and schema IDs; stable scaffolds use deterministic learning-key seeds, with response formats included when present.
Stability fingerprint computation and persistence
crates/adaptive/src/acg/{stability,acg_learner}.rs, crates/adaptive/tests/{integration,unit}/..., crates/python/tests/coverage/...
Stability results compute and serialize dominant prefix fingerprints, and learner, storage, Redis, and serialization tests validate their population and round trips.
Fingerprint-gated reuse and regression coverage
crates/adaptive/src/acg_component.rs, crates/adaptive/tests/unit/acg_component_tests.rs
Intent construction requires matching stored and live prefix fingerprints; tests cover rehydration, changed content, whitespace changes, missing fingerprints, and request-scoped fixtures.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AnnotatedLlmRequest
  participant build_prompt_ir
  participant AcgLearner
  participant RedisBackend
  participant build_intent_bundle
  AnnotatedLlmRequest->>build_prompt_ir: messages and response_format
  build_prompt_ir-->>AcgLearner: PromptIR and structured_output_schema_id
  AcgLearner->>AcgLearner: analyze stability and derive prefix fingerprint
  AcgLearner->>RedisBackend: persist observations and stability
  RedisBackend-->>build_intent_bundle: stored stability fingerprint
  build_intent_bundle->>build_intent_bundle: compare live and stored fingerprints
  build_intent_bundle-->>AnnotatedLlmRequest: intent bundle or skipped result
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.41% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the scaffold-reuse change.
Description check ✅ Passed The description includes the required overview, details, reviewer start, and related issue sections with substantive content.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@teerthsharma
teerthsharma marked this pull request as ready for review July 20, 2026 13:59
@teerthsharma
teerthsharma requested a review from a team as a code owner July 20, 2026 13:59

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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_profile.rs`:
- Around line 101-110: In the response_format_hash construction within the
profile-building logic, remove the unreachable has_stable_scaffold conditional
and short_hash call. Map response_format_fingerprint directly to an owned string
so the full fingerprint is always preserved, while keeping the existing optional
behavior unchanged.

In `@crates/adaptive/src/acg/stability.rs`:
- Around line 165-178: Update the fingerprint construction around
request_fingerprint so a deeper prefix (prefix_length > scaffold_length) returns
None when observation.source_request_hash is absent, rather than falling back to
"stable-scaffold"; retain the stable fallback for non-deeper prefixes. Add a
regression test covering a deeper prefix without source_request_hash and
asserting no fingerprint is produced.

In `@crates/adaptive/tests/integration/redis_tests.rs`:
- Around line 531-543: Update the restart assertions in the Redis integration
test to derive the scaffold-specific learning key from the request used by
process_run, then pass that key to restarted.load_observations and
restarted.load_stability. Keep the existing count and fingerprint assertions,
ensuring they validate the scaffold profile record rather than the plain
agent_id aggregate.
🪄 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: e2272280-9799-46b2-baf1-c68bd359d9c6

📥 Commits

Reviewing files that changed from the base of the PR and between 37efc33 and 6e11d11.

📒 Files selected for processing (23)
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/python/tests/coverage/py_storage_coverage_tests.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (15)
**/*.rs

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

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

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

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

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

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

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

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/python/tests/coverage/py_storage_coverage_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
{crates/core,crates/adaptive}/**/*

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

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

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/python/tests/coverage/py_storage_coverage_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/python/tests/coverage/py_storage_coverage_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/python/tests/coverage/py_storage_coverage_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/python/tests/coverage/py_storage_coverage_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
crates/adaptive/**

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

Keep crates/adaptive aligned with the canonical adaptive config schema, built-in section helpers, plugin lifecycle, and validation/report behavior.

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
**/*

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

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

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/python/tests/coverage/py_storage_coverage_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
crates/{core,adaptive}/**/*

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

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

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
**/*.{rs,py,go,js,ts}

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

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

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/python/tests/coverage/py_storage_coverage_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

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

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

Files:

  • crates/adaptive/tests/unit/intercepts_tests.rs
  • crates/python/tests/coverage/py_storage_coverage_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_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/intercepts_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_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/intercepts_tests.rs
  • crates/python/tests/coverage/py_storage_coverage_tests.rs
  • crates/adaptive/tests/unit/acg/economics_internal_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/tests/unit/storage_memory_internal_tests.rs
  • crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs
  • crates/adaptive/tests/unit/storage_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/acg/economics_policy_tests.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/types_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
crates/{python,ffi,node}/**/*

⚙️ CodeRabbit configuration file

crates/{python,ffi,node}/**/*: Treat binding changes as public API changes. Check for parity with the other language bindings, FFI ownership/lifetime safety,
callback error propagation, stable type conversion, and consistent async/stream semantics.
Flag changes that update one binding without corresponding tests or documentation for the same surface elsewhere.

Files:

  • crates/python/tests/coverage/py_storage_coverage_tests.rs
{crates/**/src/**/*.rs,python/**/*.py}

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

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

Files:

  • crates/adaptive/src/acg_learner.rs
  • crates/adaptive/src/acg_component.rs
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/ir_builder.rs
🔇 Additional comments (22)
crates/adaptive/src/acg/ir_builder.rs (1)

35-83: LGTM!

Also applies to: 263-284

crates/adaptive/src/acg_profile.rs (1)

33-46: LGTM!

Also applies to: 71-100, 225-232

crates/adaptive/tests/unit/acg/ir_builder_tests.rs (1)

191-251: LGTM!

crates/adaptive/tests/unit/acg_profile_tests.rs (1)

49-145: LGTM!

crates/adaptive/tests/unit/runtime_tests.rs (1)

416-417: LGTM!

Also applies to: 493-495

crates/adaptive/tests/unit/acg_learner_tests.rs (1)

231-267: LGTM!

crates/adaptive/tests/unit/runtime_features_tests.rs (1)

90-97: LGTM!

Also applies to: 123-127

crates/python/tests/coverage/py_storage_coverage_tests.rs (1)

143-143: LGTM!

crates/adaptive/tests/unit/acg/economics_internal_tests.rs (1)

124-124: LGTM!

crates/adaptive/tests/unit/acg_component_tests.rs (1)

50-50: LGTM!

Also applies to: 235-235, 266-266, 291-311, 454-458, 534-538, 584-605, 646-646, 677-681, 737-737, 815-846, 945-950, 982-1131, 1185-1185, 1240-1240, 1287-1291, 1390-1390, 1431-1435, 1569-1573

crates/adaptive/src/acg_component.rs (1)

136-162: LGTM!

crates/adaptive/tests/integration/runtime_integration_tests.rs (1)

516-517: LGTM!

crates/adaptive/src/acg/stability.rs (1)

42-145: LGTM!

crates/adaptive/src/acg_learner.rs (1)

108-114: 📐 Maintainability & Code Quality

Provide the required validation evidence.

The supplied summary does not confirm cargo fmt --all, just test-rust, or the required Rust/Python/Go/Node matrix for this crates/adaptive change. Please run and attach results for cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, just test-rust, and the repository’s full language matrix.

As per coding guidelines, “Any Rust change must run just test-rust,” “Any Rust change must run cargo fmt --all,” and “Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings.” As per path instructions, “Changes to crates/core or crates/adaptive must run the full language matrix.”

Sources: Coding guidelines, Path instructions

crates/adaptive/tests/unit/acg/stability_internal_tests.rs (1)

81-121: LGTM!

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

44-44: LGTM!

Also applies to: 200-208

crates/adaptive/tests/unit/acg/economics_policy_tests.rs (1)

87-87: LGTM!

crates/adaptive/tests/unit/acg/multi_breakpoint_tests.rs (1)

84-84: LGTM!

crates/adaptive/tests/unit/cache_diagnostics_tests.rs (1)

85-85: LGTM!

crates/adaptive/tests/unit/intercepts_tests.rs (1)

53-53: LGTM!

crates/adaptive/tests/unit/storage_memory_internal_tests.rs (1)

87-87: LGTM!

crates/adaptive/tests/unit/storage_tests.rs (1)

92-92: LGTM!

Comment thread crates/adaptive/src/acg_profile.rs Outdated
Comment thread crates/adaptive/src/acg/stability.rs
Comment thread crates/adaptive/tests/integration/redis_tests.rs
Signed-off-by: teerthsharma <teerths57@Gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/adaptive/tests/integration/redis_tests.rs (1)

551-553: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Assert fingerprint equality across the restart.

is_some() would also pass for a stale or changed fingerprint, so this test does not prove that the serialized value survived backend recreation. Capture the pre-restart fingerprint for learning_key and compare it with the reloaded value.

As per path instructions, “Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.”

🤖 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/tests/integration/redis_tests.rs` around lines 551 - 553,
Update the restart persistence test around the stability assertions to capture
the pre-restart stable_prefix_fingerprint for learning_key before recreating the
backend, then assert the reloaded fingerprint equals that captured value rather
than only checking is_some(). Preserve the existing observation-count
assertions.

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/tests/integration/redis_tests.rs`:
- Around line 551-553: Update the restart persistence test around the stability
assertions to capture the pre-restart stable_prefix_fingerprint for learning_key
before recreating the backend, then assert the reloaded fingerprint equals that
captured value rather than only checking is_some(). Preserve the existing
observation-count assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: bd62dbe9-c14b-4043-8324-462a452bb69d

📥 Commits

Reviewing files that changed from the base of the PR and between 6e11d11 and bf70abf.

📒 Files selected for processing (4)
  • crates/adaptive/src/acg/stability.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (14)
**/*.rs

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

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

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

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

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

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

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

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
{crates/core,crates/adaptive}/**/*

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

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

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
crates/adaptive/**

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

Keep crates/adaptive aligned with the canonical adaptive config schema, built-in section helpers, plugin lifecycle, and validation/report behavior.

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
**/*

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

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

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
crates/{core,adaptive}/**/*

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

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

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
**/*.{rs,py,go,js,ts}

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

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

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

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

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

Files:

  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.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/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.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/integration/redis_tests.rs
  • crates/adaptive/tests/unit/acg/stability_internal_tests.rs
{crates/**/src/**/*.rs,python/**/*.py}

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

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

Files:

  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/src/acg/stability.rs
🔇 Additional comments (4)
crates/adaptive/src/acg_profile.rs (1)

18-19: LGTM!

Also applies to: 33-46, 71-102, 216-224

crates/adaptive/src/acg/stability.rs (1)

42-46: LGTM!

Also applies to: 77-77, 98-118, 121-200

crates/adaptive/tests/integration/redis_tests.rs (1)

518-546: LGTM!

crates/adaptive/tests/unit/acg/stability_internal_tests.rs (1)

81-109: LGTM!

Also applies to: 111-121, 123-135

@teerthsharma
teerthsharma marked this pull request as draft July 20, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code size:L PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant