refactor: codec-owned provider-surface detection via a built-in registry - #301
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout. (2)
🧰 Additional context used📓 Path-based instructions (14)**/*.rs📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Files:
**/{Cargo.toml,**/*.rs}📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Files:
**/*.{h,hpp,c,cpp,rs}📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Files:
{crates/core,crates/adaptive}/**/*📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Files:
**/*.{rs,toml}📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Files:
crates/core/**/*.rs📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
Files:
crates/{core,adaptive}/**📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Files:
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{rs,py,go,js,ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
crates/**/*.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
**⚙️ CodeRabbit configuration file
Files:
crates/{core,adaptive}/**/*.rs⚙️ CodeRabbit configuration file
Files:
{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)
Files:
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (2)
WalkthroughThe PR adds registry-backed surface descriptors for OpenAI Chat, OpenAI Responses, and Anthropic Messages, routes request/response normalization through the registry, and expands tests for hint-aware request detection and ambiguous response shapes. ChangesRegistry-backed codec surface detection
Estimated review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
7060394 to
a881241
Compare
a881241 to
005d547
Compare
005d547 to
8d45d8d
Compare
Move provider-surface detection out of the hard-coded if/else chains in codec::resolve into codec-owned SurfaceDescriptors iterated through a small built-in registry. resolve.rs is now provider-agnostic (no field-name literals); each built-in codec owns its detection and decode logic in a SURFACE_DESCRIPTOR const. Add detect_request_surface_with_hint(body, Option<&str>); detect_request_surface delegates to it with None for exact parity. A recognized provider hint can upgrade the ambiguous messages-only shape (the Anthropic detector claims it for provider "anthropic"), while registry priority order keeps it from overriding a strong input/instructions/system signal. The hint is not wired into adaptive, so behavior is preserved and all existing codec::resolve tests pass unchanged. Relates to RELAY-362 Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
8d45d8d to
261fc7e
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/core/src/codec/resolve.rs`:
- Around line 82-106: The exact-one response descriptor selection rule is
duplicated between detect_response_surface and normalize_response, so extract
that matching logic into a single private helper and have both functions use it.
Keep the helper responsible for iterating REGISTRY and returning the sole
matching descriptor only when there is exactly one match, then reuse it in both
detect_response_surface and normalize_response so any future change to matching
behavior stays consistent.
In `@crates/core/tests/unit/codec/resolve_tests.rs`:
- Around line 269-289: Add a response-side unit test for the “exactly one match”
behavior in detect_response_surface/normalize_response: create cases where a
response body matches zero detectors and where it matches two or more detectors,
and assert the result is None. Place the test near
hint_never_overrides_strong_signals so the new contract is covered alongside the
existing resolve_tests helpers and detector logic.
🪄 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: 3bb781d9-a210-4683-bd6e-49bb1898f05d
📒 Files selected for processing (5)
crates/core/src/codec/anthropic.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/openai_responses.rscrates/core/src/codec/resolve.rscrates/core/tests/unit/codec/resolve_tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
- GitHub Check: Check / Run
- GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (14)
**/*.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/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.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/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.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/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.rs
{crates/core,crates/adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.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/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
If the change touched
crates/coreor shared runtime semantics, also usevalidate-changefor broader validation
crates/core/**/*.rs: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin core runtime paths. Keep errors explicit and binding-appropriate at the wrapper layer.
Files:
crates/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.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/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.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/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.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/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.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/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.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/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.rs
crates/{core,adaptive}/**/*.rs
⚙️ CodeRabbit configuration file
crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.
Files:
crates/core/src/codec/openai_responses.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/resolve_tests.rscrates/core/src/codec/resolve.rscrates/core/src/codec/anthropic.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/core/tests/unit/codec/resolve_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}
⚙️ CodeRabbit configuration file
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.
Files:
crates/core/tests/unit/codec/resolve_tests.rs
🔇 Additional comments (6)
crates/core/src/codec/resolve.rs (2)
27-48: LGTM!
58-73: LGTM!crates/core/src/codec/openai_responses.rs (1)
46-55: LGTM!crates/core/src/codec/anthropic.rs (1)
47-60: LGTM!crates/core/src/codec/openai_chat.rs (1)
34-40: LGTM!crates/core/tests/unit/codec/resolve_tests.rs (1)
226-301: LGTM!
Extract the "exactly one matching response descriptor" selection into a private detect_response_descriptor helper so detect_response_surface and normalize_response use one source of truth instead of independently re-implementing the matches.next()/next() rule. This prevents detection and normalization from silently diverging if the rule is later changed. Add a normalize_response regression assertion for the ambiguous choices+output shape to guard the shared classifier. Relates to RELAY-362 Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
There was a problem hiding this comment.
LGTM, great work! This is a conditional approval pending Green CI. I did a focused pass on scope fit, resolver correctness, and regression risk. The registry refactor looks clean and behavior-preserving to me overall; I left one small API-doc clarity note for the new public hint entry point.
Add a normalize_request test for the OpenAI Responses surface so the registry decode_request closure is exercised, closing the codecov/patch gap on this PR's new source lines. Also name the accepted "anthropic" provider hint explicitly in the detect_request_surface_with_hint rustdoc, per review feedback. Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
|
/ok to test 7bb3cb6 |
|
/merge |
Thread the configured ACG provider into request-surface resolution as a disambiguation hint (via core's detect_request_surface_with_hint). A system-less Anthropic request (messages, no top-level system) is shape-identical to OpenAI Chat; with provider "anthropic" it now resolves to AnthropicMessages and receives Anthropic cache-hint translation instead of passing through unoptimized. Shape stays authoritative: a strong input/instructions/system signal is never overridden by the hint, so genuine provider/surface mismatches still pass through unchanged. Resolution stays shape-first (decode by the resolved surface, never provider-first), and the configured-provider config surface is unchanged. Relates to RELAY-362 (deferred follow-up to NVIDIA#301). Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
#### Overview Backfill regression and parity coverage for the shared extraction seams established by #291, #300, #301, #304, and #318, so agent-payload extraction, provider-schema normalization, and exporter projection cannot drift silently. Test-only: the only `src` edits are `#[cfg(test)]` module wiring for two new suites; no production behavior changes. - [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license. - [x] I searched existing issues and open pull requests, and this does not duplicate existing work. #### Details **Agent payload extraction** (`crates/cli/tests/coverage/adapters_tests.rs`, 15 tests): - Per-host partial-sparse payloads for Claude Code, Codex, and Hermes (real identifiers kept, absent fields synthesized or null at the adapter boundary). - Path-precedence fallback-chain walks for session IDs, event names, subagent IDs, tool-call IDs, and tool results/status. - Hermes tool result and status extraction (previously uncovered), including explicit-status vs event-name-derived status interaction. - Claude Code LLM-hint extraction and hint field precedence chains. - JSON-path primitive edge cases: empty-string filtering, array intermediates, deep nesting, all-paths-miss. **Provider request extraction** (`crates/cli/tests/coverage/alignment_tests.rs`, 6 tests): - First coverage for `request_affinity_key` (route-gated, length-bounded) and `gateway_turn_input` (Claude Code + Anthropic Messages only). - Header-only session-id routing on the Models and Count-Tokens routes, contrasted with the body fallbacks on the Responses/Chat routes. - Gateway route name round-trips. **Codec parity** (`crates/core/tests/unit/codec/parity_tests.rs`, new, 14 tests): Each test builds the same logical scenario in all three provider schemas (OpenAI Chat Completions, Anthropic Messages, OpenAI Responses) and asserts the normalized output agrees: model name, finish reasons, tool calls (full-struct equality), usage incl. cache-read tokens, provider-reported and catalog-estimated cost, hint hardening (`normalize_request_with_hint`), and request normalization. Schema-inherent divergences are asserted explicitly as part of the parity contract, e.g. Responses normalizes a tool-call turn to `Complete` (no tool-use terminal status), cache-write tokens are Anthropic-only, reasoning tokens are Responses-only. **Exporter parity** (`crates/core/tests/unit/observability/exporter_parity_tests.rs`, new, 9 tests): A shared harness feeds one event stream to the ATIF exporter, `OpenTelemetrySubscriber`, and `OpenInferenceSubscriber` (in-memory span exporters) and asserts the projected facts agree: cost totals, usage, model names, tool-call projection, replay-payload preservation, and the consolidated manual-fallback path — run against both OpenAI-Chat-shaped and Anthropic-shaped payloads. Intentional projection divergences are pinned with explicit assertions so drift fails loudly, notably: OTel emits no token-count attributes, reasoning facts are ATIF-only, ATIF sums cache read+write while OpenInference splits them, and OpenInference omits raw LLM request JSON. Cost-currency policy boundaries stay covered by the existing per-exporter tests from #304 and are not duplicated here. **Validation** - `just test-rust` — full workspace green - `cargo clippy --workspace --all-targets -- -D warnings` — clean - `cargo fmt --all --check` — clean - `uv run pre-commit run --files <changed files>` — all hooks green (SPDX, fmt, clippy, check, linkcheck) - Rebased onto current `main` and re-ran `cargo test -p nemo-relay` and `cargo test -p nemo-relay-cli` — green, including the parity suites against the latest observability changes - Binding matrix not run: the change is test-only; the `#[cfg(test)]` modules are not compiled into the library targets, so binding-facing behavior is unchanged **Breaking changes** None. #### Where should the reviewer start? `crates/core/tests/unit/observability/exporter_parity_tests.rs` — the `export_through_all_exporters` harness and the explicitly pinned divergences. These assertions encode current behavior. The OTel cost-only projection and the ATIF cache-sum vs OpenInference cache-split asymmetry match the token/cost field-semantics contract documented in #330; the remaining pinned divergences (reasoning projection being ATIF-only, OTel not flattening LLM tool calls, OpenInference omitting raw LLM request JSON) encode current behavior without a recorded decision — if any is ruled a defect, the fix should land together with flipping the pinning assertion. Then `crates/core/tests/unit/codec/parity_tests.rs` for the cross-schema normalization contract, and the adapter/alignment additions in `crates/cli/tests/coverage/`. #### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) - Relates to: none (test backfill for the extraction-strategy refactors #291, #300, #301, #304, #318) ## Summary by CodeRabbit * **Tests** * Added coverage for Hermes and Claude tool adapter/extractor precedence, partial payload handling, and hint/session/model/request-id resolution (including null/empty-string and fallback-chain behaviors). * Expanded gateway alignment tests for affinity-key/session-id gating and route/provider-specific prompt building. * Introduced core codec and observability cross-provider/exporter parity tests validating normalized fields, tool-call mapping, and consistent usage/cost/model/replay projections (with expected divergence checks). Authors: - Yuchen Zhang (https://github.com/yczhang-nv) Approvers: - Will Killian (https://github.com/willkill07) - Zhongxuan (Daniel) Wang (https://github.com/zhongxuanwang-nv) - Maryam Najafian (https://github.com/mnajafian-nv) URL: #355
Overview
Implements RELAY-362, the follow-up requested in review of #291: move provider-surface detection out of the hard-coded
if/elsechains incodec::resolveinto codec-owned descriptors iterated through a small built-in registry.resolve.rsis now provider-agnostic (no provider field-name literals), new built-in surfaces become additive, and a codec-owned provider hint can disambiguate the one ambiguous request shape (an Anthropic request without a top-levelsystem). The change is additive, Rust-core-only, and behavior-preserving: every existingcodec::resolvetest passes unchanged and the adaptive path is untouched.Details
codec::resolve— added apub(crate) SurfaceDescriptor(a hint-aware request detector, a response detector, and decode entry points) and a by-valuestatic REGISTRYordered by request-detection priority (Responses > Anthropic > Chat). The public functions are now provider-agnostic policy only: first registry match for requests, unique match for responses, fail-opennormalize_*.ProviderSurfaceand every existing public signature are unchanged.pub fn detect_request_surface_with_hint(body, Option<&str>)—detect_request_surfacedelegates to it withNonefor exact parity. A recognized hint can only upgrade the ambiguousmessages-only shape; registry priority order keeps it from overriding a stronginput/instructions/systemsignal.openai_chat,openai_responses,anthropic) owns its detectors (as closures) and decode entry points in aSURFACE_DESCRIPTORconst. Only Anthropic's request detector is hint-aware (it claims a system-lessmessagesbody when the hint is"anthropic"); the OpenAI detectors ignore the hint. Adding a future built-in surface (e.g. Gemini) means registering a descriptor, not editing detection logic.resolve_request_surface/build_semantic_request_viewwould change ACG pass-through behavior, so it is intentionally left to a separate follow-up. The shape-only ACG path and its source-guard test are untouched.Nonehint, the Anthropic upgrade, "never overrides a strong signal", non-object input); the existing detection/normalization tests are unchanged.No breaking changes. Local validation:
cargo test -p nemo-relay,-p nemo-relay-adaptive, and-p nemo-relay-pii-redactionpass;cargo clippy -p nemo-relay --all-features --all-targets,cargo fmt --check, andcargo doc -p nemo-relayare clean for the changed files. The full cross-language matrix is left to CI (no binding surfacescodec::resolve).Where should the reviewer start?
crates/core/src/codec/resolve.rs— theSurfaceDescriptor+REGISTRYand the detection-policy functions (detect_request_surface_with_hint,detect_response_surface). Then the per-codecSURFACE_DESCRIPTORblocks, especiallyanthropic.rs's hint-awaredetect_request: registry priority order (Responses before Anthropic) is what keeps the"anthropic"hint from overriding a stronginput/instructionssignal.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
New Features
Bug Fixes
Tests