Skip to content

fix: align typed adapter contracts - #188

Open
zhongxuanwang-nv wants to merge 1 commit into
NVIDIA:mainfrom
zhongxuanwang-nv:fix/typed-contract-followups
Open

fix: align typed adapter contracts#188
zhongxuanwang-nv wants to merge 1 commit into
NVIDIA:mainfrom
zhongxuanwang-nv:fix/typed-contract-followups

Conversation

@zhongxuanwang-nv

@zhongxuanwang-nv zhongxuanwang-nv commented Aug 7, 2026

Copy link
Copy Markdown
Member

Overview

Addresses the reported typed adapter-contract regressions with narrowly scoped fixes.

  • Keep diagnostic planning non-fatal while strict planning retains compatibility enforcement.
  • Preserve the raw lifecycle config, expose the validated model separately, and surface actionable validation diagnostics.
  • Restore the NAT adapter's local model-role and MCP-server-name guards, plus registered workflow compatibility.
  • Align the affected SDK snapshots, artifact metadata, path validation, result schema, and contract model.

Where should the reviewer start?

Start with crates/fabric-core/src/config.rs, adapters/common/src/nemo_fabric_adapters/common/lifecycle.py, and external/nat/src/nemo_fabric_adapters/nat/adapter.py. Their regression tests cover the diagnostic/enforcement boundary, typed lifecycle payload behavior, and the restored NAT checks.

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

  • Relates to the typed adapter-contract follow-up review.

  • 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.

Summary by CodeRabbit

  • New Features

    • Added optional metadata support for artifact references.
    • Added validated agent configuration access in run plans.
    • Added support for legacy NAT workflow entrypoints alongside factory configurations.
    • Successful runs may explicitly return error: null.
  • Bug Fixes

    • Prevented duplicate tool fields from overwriting known values.
    • Improved configuration diagnostics and compatibility handling.
    • Corrected Windows path recognition, empty-name validation, and null extension handling.
  • Documentation

    • Clarified configuration payloads, lifecycle behavior, protocol handling, and NAT workflow configuration.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

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

Use the following commands to manage reviews:

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

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The changes update adapter contracts, typed lifecycle payloads, NAT workflow compatibility, SDK model normalization, tool-definition validation, compatibility diagnostics, and succeeded-run schema handling.

Changes

Contract and adapter integration

Layer / File(s) Summary
Configuration and execution contracts
adapter-contract/..., schemas/adapter-contract/..., crates/fabric-core/src/{agent_execution.rs,schema.rs}, tests/adapter_contract/*
Extension mappings discard None values. Artifact paths require ASCII drive letters. ArtifactRef supports JSON metadata. Succeeded results allow error: null.
Typed lifecycle configuration payloads
adapters/common/..., adapters/common/README.md, docs/adapter-contract/execution.md, skills/nemo-fabric-build-adapter/SKILL.md, tests/adapters/test_adapters_common_lifecycle.py
Typed validation preserves the raw mapping in payload["config"] and stores the validated model in payload["agent_config"]. Validation failures log diagnostics and expose sanitized metadata.
Compatibility validation and diagnostics
crates/fabric-core/src/config.rs, crates/fabric-core/src/doctor.rs
Tool-definition and agent-config-extension checks run only when compatibility enforcement is enabled. Diagnostic coverage reports unsupported tool definitions.
NAT workflow entrypoint support
external/nat/fabric-adapter.json, external/nat/src/.../adapter.py, external/nat/README.md, tests/adapters/test_external_nat_adapter.py
The adapter supports Fabric ReAct and legacy nat_workflow entrypoints. It resolves workflow references and rejects empty or whitespace-padded model and MCP server names.
SDK run-plan and tool models
python/src/nemo_fabric/{models.py,types.py}, docs/reference/api/python-library-reference/nemo_fabric.types.md, tests/python/test_sdk_contract.py, tests/python/test_{runtime,sdk_runtimes,streaming}.py
RunPlan.agent_config is normalized as a required JSON mapping. Tool-definition collisions are rejected. Tool definitions use plain mappings, and empty artifact metadata is retained during serialization.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LifecycleHost
  participant AgentConfig
  participant Runtime
  LifecycleHost->>AgentConfig: validate typed configuration
  AgentConfig-->>LifecycleHost: validated AgentConfig or validation error
  LifecycleHost->>Runtime: start with raw config and agent_config
Loading

Possibly related PRs

  • NVIDIA/NeMo-Fabric#186: Directly refines the typed adapter contract, lifecycle configuration flow, runtime plans, result schema, and NAT adapter.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.19% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the allowed fix type, a concise imperative summary, lowercase formatting, and stays within 72 characters.
Description check ✅ Passed The description includes the required overview, reviewer starting points, related-work statement, and confirmation checkboxes.
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.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@adapter-contract/src/nemo_fabric_adapter_contract/models.py`:
- Around line 320-328: The _validate_model_roles validator currently permits
whitespace-only role names; change its name check to reject values whose
stripped content is empty. Add a " " model-role case in
tests/adapter_contract/test_agent_config.py lines 134-159, verifying the typed
contract rejects it.

In `@adapters/common/src/nemo_fabric_adapters/common/lifecycle.py`:
- Around line 235-258: Remove the raw traceback output from the lifecycle
validation error handling in lifecycle.py, replacing it with a fixed message or
sanitized validation details that cannot include rejected configuration values.
Update test_adapters_common_lifecycle.py at lines 213-217 to submit a
secret-like invalid value and assert that stderr does not contain it.

In `@crates/fabric-core/src/agent_config.rs`:
- Around line 17-45: Apply the same name validation used by
non_empty_name_map_schema and unpadded_name_map_schema during Rust
deserialization and validate_config for the model, MCP-server, and
tool-definition maps, rejecting whitespace-only keys while preserving each map’s
intended trimming rules. Ensure project_agent_config only propagates validated
names, update the model-role check to use the shared validation rather than
is_empty(), and add direct deserialization tests covering whitespace-only keys
for all three map types.

In `@crates/fabric-core/src/config.rs`:
- Around line 1257-1259: Update the model-role validation in the visible
configuration parsing flow to use trimmed emptiness, rejecting whitespace-only
roles while preserving the existing invalid_config response. Apply the same
validation consistently in the related model-role handling path, and add a
regression case covering a whitespace-only role.

In `@python/src/nemo_fabric/types.py`:
- Line 1338: Update the RunPlan parsing logic around the agent_config mapping to
require the agent_config field instead of defaulting missing values to an empty
object; use the existing required-field validation pattern so payloads missing
agent_config are rejected while preserving valid mappings. Update legacy RunPlan
test fixtures to include both config and resolved agent_config.
🪄 Autofix

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: 74a0c7fd-bec1-4278-bf09-dccb531fefd6

📥 Commits

Reviewing files that changed from the base of the PR and between 5e2ab49 and 848b414.

📒 Files selected for processing (23)
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • adapters/common/README.md
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • crates/fabric-core/src/agent_config.rs
  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/config.rs
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/schema.rs
  • docs/adapter-contract/execution.md
  • external/nat/README.md
  • external/nat/fabric-adapter.json
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • python/src/nemo_fabric/models.py
  • python/src/nemo_fabric/types.py
  • schemas/adapter-contract/agent-config.schema.json
  • schemas/adapter-contract/agent-run-result.schema.json
  • schemas/run-plan.schema.json
  • skills/nemo-fabric-build-adapter/SKILL.md
  • tests/adapter_contract/test_agent_config.py
  • tests/adapter_contract/test_agent_execution.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapters/test_external_nat_adapter.py
  • tests/python/test_sdk_contract.py
📜 Review details
⏰ Context from checks skipped due to timeout. (16)
  • GitHub Check: Preview docs
  • GitHub Check: Pre-commit
  • GitHub Check: Test (Python 3.14, macos-arm64)
  • GitHub Check: Test (Python 3.11, windows-amd64)
  • GitHub Check: Test (Python 3.12, linux-amd64)
  • GitHub Check: Test (Python 3.14, linux-amd64)
  • GitHub Check: Test (Python 3.11, linux-amd64)
  • GitHub Check: Test (Python 3.11, macos-arm64)
  • GitHub Check: Test (Python 3.13, linux-amd64)
  • GitHub Check: Test (Python 3.13, windows-amd64)
  • GitHub Check: Test (Python 3.14, linux-arm64)
  • GitHub Check: Test (Python 3.13, linux-arm64)
  • GitHub Check: Test (Python 3.12, windows-amd64)
  • GitHub Check: Test (Python 3.12, macos-arm64)
  • GitHub Check: Test (Python 3.13, macos-arm64)
  • GitHub Check: Test (Python 3.12, linux-arm64)
🧰 Additional context used
📓 Path-based instructions (42)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Implement new runtime or binding behavior in the shared Rust core first.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • crates/fabric-core/src/config.rs
**/*.{rs,py,pyi,json,yaml,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Determine and update every affected public surface, including the CLI, PyO3 bindings, Python SDK, type stubs, schemas, and adapter contract, so they remain in parity.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • tests/adapters/test_external_nat_adapter.py
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • external/nat/fabric-adapter.json
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • schemas/adapter-contract/agent-run-result.schema.json
  • schemas/adapter-contract/agent-config.schema.json
  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/config.rs
  • tests/python/test_sdk_contract.py
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • python/src/nemo_fabric/types.py
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • schemas/run-plan.schema.json
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
  • python/src/nemo_fabric/models.py
**/*

📄 CodeRabbit inference engine (.agents/skills/karpathy-guidelines/SKILL.md)

**/*: Before implementing, explicitly state assumptions, surface ambiguity and tradeoffs, present multiple interpretations when relevant, and ask for clarification rather than silently deciding or proceeding when requirements are unclear.
Prefer the minimum code needed to solve the requested problem: avoid speculative features, unnecessary abstractions, unrequested flexibility, and handling of impossible scenarios; simplify overcomplicated solutions.
When editing existing code, make surgical changes only: do not modify unrelated code, comments, formatting, or pre-existing dead code; match the existing style, and remove only unused imports, variables, or functions introduced by your changes.
Define verifiable success criteria for each task, such as writing regression tests for bugs and invalid-input tests for validation, then verify the implementation against those criteria. For multi-step work, state a brief plan with a verification check for each step.

**/*: Always spell NVIDIA in all caps; do not use Nvidia, nvidia, nVidia, nVIDIA, or NV.
Use an NVIDIA before a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol after NVIDIA when referring to the company; use trademark symbols with product names only when required by the document type or legal guidance.
Verify official capitalization, spacing, hyphenation, and spelling for NVIDIA and third-party product names; do not rewrite official product names for grammar or title-case rules.
Precede NVIDIA product names with NVIDIA on first mention when natural and accurate, and link the first mention when the destination helps the reader.
On first use, include the company name and full model qualifier when it helps identify the model; preserve official capitalization and punctuation, and use shorter family names only after establishing the full name.
For learning-oriented and developer content, do not force trademark symbols unless explicitly required; for press, ...

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • tests/adapters/test_external_nat_adapter.py
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • adapters/common/README.md
  • external/nat/README.md
  • external/nat/fabric-adapter.json
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • schemas/adapter-contract/agent-run-result.schema.json
  • schemas/adapter-contract/agent-config.schema.json
  • skills/nemo-fabric-build-adapter/SKILL.md
  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/config.rs
  • tests/python/test_sdk_contract.py
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • python/src/nemo_fabric/types.py
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • docs/adapter-contract/execution.md
  • schemas/run-plan.schema.json
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
  • python/src/nemo_fabric/models.py
**/*.{rs,toml}

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

For any Rust change, run just test-rust and cargo fmt --all -- --check.

For Rust core, CLI, or shared runtime semantic changes, run Rust formatting and tests, and add Python tests when behavior is exposed through the SDK.

Use Rust stable tooling; format Rust code with cargo fmt --all, verify formatting with cargo fmt --all -- --check, and compile with cargo check --workspace --locked.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • crates/fabric-core/src/config.rs
**/*.{rs,py}

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

For native binding changes, run cargo check -p fabric-python --locked.

Use snake_case for functions and variables; use PascalCase for Rust types and Python classes.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • tests/adapters/test_external_nat_adapter.py
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/config.rs
  • tests/python/test_sdk_contract.py
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • python/src/nemo_fabric/types.py
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
  • python/src/nemo_fabric/models.py
crates/fabric-core/**/*.{rs,py}

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

Changes under crates/fabric-core must run both the Rust and Python test suites.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • crates/fabric-core/src/config.rs
**/*.{rs,rmeta}

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

If Rust code changes, run cargo fmt --all -- --check and just test-rust.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • crates/fabric-core/src/config.rs
crates/fabric-core/**/*.rs

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

If crates/fabric-core changes in a way exposed through Python, run both the Rust and Python suites.

For Rust API reference changes, update Rust documentation comments under crates/fabric-core/ instead of generated API reference files.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • crates/fabric-core/src/config.rs
**/*.{rs,py,pyi}

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

**/*.{rs,py,pyi}: If public configuration types change, confirm schema snapshot tests in just test-rust pass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes under schemas/ and generated API references.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • tests/adapters/test_external_nat_adapter.py
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/config.rs
  • tests/python/test_sdk_contract.py
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • python/src/nemo_fabric/types.py
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
  • python/src/nemo_fabric/models.py
**/*.{py,pyi,rs}

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

For Python SDK or PyO3 binding changes, use python-tests, run focused pytest tests first, then just test-python; rebuild with just build-python when native code or packaging changes.

Public contract changes must keep native Python binding declarations synchronized with their Rust implementations.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • tests/adapters/test_external_nat_adapter.py
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/config.rs
  • tests/python/test_sdk_contract.py
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • python/src/nemo_fabric/types.py
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
  • python/src/nemo_fabric/models.py
**/*.{rs,py,toml}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

When editing version helpers, verify every nemo-fabric-* workspace package through Cargo metadata and reject a static version in python/pyproject.toml.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • tests/adapters/test_external_nat_adapter.py
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/config.rs
  • tests/python/test_sdk_contract.py
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • python/src/nemo_fabric/types.py
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
  • python/src/nemo_fabric/models.py
**/*.{toml,rs,py}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

Avoid blind repository-wide replacement of version-like strings; distinguish package-version references from examples and unrelated dependency versions.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • tests/adapters/test_external_nat_adapter.py
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/config.rs
  • tests/python/test_sdk_contract.py
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • python/src/nemo_fabric/types.py
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
  • python/src/nemo_fabric/models.py
**/*.{md,mdx,yml,py,rs,sh}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Keep documentation aligned with current NeMo Fabric behavior, repository layout, entry points, commands, package names, APIs, bindings, and support claims.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • tests/adapters/test_external_nat_adapter.py
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • adapters/common/README.md
  • external/nat/README.md
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • skills/nemo-fabric-build-adapter/SKILL.md
  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/config.rs
  • tests/python/test_sdk_contract.py
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • python/src/nemo_fabric/types.py
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • docs/adapter-contract/execution.md
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
  • python/src/nemo_fabric/models.py
crates/fabric-core/src/**/*.rs

⚙️ CodeRabbit configuration file

crates/fabric-core/src/**/*.rs: Review the Rust core for runtime lifecycle correctness, handle validation, capability routing accuracy, schema stability, and error semantics.
Public API changes should match committed schemas, tests, and documentation.

Files:

  • crates/fabric-core/src/agent_execution.rs
  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/doctor.rs
  • crates/fabric-core/src/agent_config.rs
  • crates/fabric-core/src/config.rs
**/*.{py,pyi}

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

If Python code or a Python-facing adapter changes, run just test-python.

In Python SDK, adapters, examples, and tests, follow the existing style, use type annotations for public APIs, and keep native binding declarations synchronized with their Rust implementations.

Files:

  • tests/adapters/test_external_nat_adapter.py
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapter_contract/test_agent_config.py
  • tests/python/test_sdk_contract.py
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • python/src/nemo_fabric/types.py
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
  • python/src/nemo_fabric/models.py
tests/adapters/**/*.py

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

tests/adapters/**/*.py: If an adapter or integration changes, run its focused tests.
For adapter behavior changes, run focused adapter tests under tests/adapters, then run just test-python.

Files:

  • tests/adapters/test_external_nat_adapter.py
  • tests/adapters/test_adapters_common_lifecycle.py
tests/**/*.{rs,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When adding functionality, include tests in the corresponding Rust crate or the relevant area under tests/.

Files:

  • tests/adapters/test_external_nat_adapter.py
  • tests/adapter_contract/test_agent_config.py
  • tests/python/test_sdk_contract.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
tests/**/*.py

📄 CodeRabbit inference engine (.agents/skills/python-tests/SKILL.md)

tests/**/*.py: Use pytest to run Python tests.
Do not add @pytest.mark.asyncio to tests; async tests are automatically detected by the async runner.
Do not add -> None return type annotations to test functions.
When mocking a class, use unittest.mock.MagicMock or AsyncMock, using the spec argument when necessary, rather than defining a new class.
Prefix mocked class names with mock, not fake.
Prefer pytest fixtures over helper methods.
If a fixture is needed in multiple test files, define it once in conftest.py rather than repeating it.
Define fixtures using @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and a <fixture_name>_fixture function; specify scope only when it is not function.
Prefer pytest.mark.parametrize over separate tests for different input types.
Use @pytest.mark.usefixtures when a fixture is needed but its returned value is unused or it returns no value.
Avoid defensive programming in tests; access expected values directly so missing data raises a clear failure, such as using results["data"] instead of results.get("data").
When adapter installation metadata changes, packaging metadata tests must directly assert that the root project depends unconditionally on the exact-version nemo-fabric-runtime distribution.
Packaging metadata tests must verify that each root harness extra delegates to the matching version of the leaf adapter's harness extra.
Packaging metadata tests must verify that bare leaf dependencies remain adapter-owned and that the root adapter-tests dependency group installs each leaf through its harness extra.
Packaging metadata tests must verify that every leaf provides full; only adapters importing NeMo Relay Python APIs provide relay, while adapters using an external Relay executable have full equal to harness.

Files:

  • tests/adapters/test_external_nat_adapter.py
  • tests/adapter_contract/test_agent_config.py
  • tests/python/test_sdk_contract.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
{tests/**,python/tests/**}

⚙️ CodeRabbit configuration file

{tests/**,python/tests/**}: Tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.

Files:

  • tests/adapters/test_external_nat_adapter.py
  • tests/adapter_contract/test_agent_config.py
  • tests/python/test_sdk_contract.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/adapter_contract/test_agent_execution.py
**/*.{md,rst}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Update documentation and examples in the same branch as the public API change.

Files:

  • adapters/common/README.md
  • external/nat/README.md
  • skills/nemo-fabric-build-adapter/SKILL.md
  • docs/adapter-contract/execution.md
**/*.{md,mdx,rst}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)

**/*.{md,mdx,rst}: For NeMo Fabric documentation, verify technical claims against the current repository, public API, or documented command before reviewing style.
Always spell NVIDIA in all caps; do not use Nvidia, nvidia, or NV.
Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text; avoid raw URLs and weak anchors such as here or read more.
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative, parallel steps; split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English while preserving necessary technical precision.
Use can for possibility and reserve may for permission.
Use after for temporal relationships instead of once, and prefer refer to over see when directing readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical documentation.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values; use numerals for 10 or greater and commas in thousands.
Do not add trademark symbols to learning-oriented documentation unless the source, platform, or legal guidance explicitly requires them.
Do not replace precise technical terms with simpler words when doing so would lose precision.
Do not flag passive voice when the actor is unknown or the action is the important part.
Do not rewrite API names, package names, command flags, or code literals for style.

**/*.{md,mdx,rst}: Use consistent title case for technical-document headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title ...

Files:

  • adapters/common/README.md
  • external/nat/README.md
  • skills/nemo-fabric-build-adapter/SKILL.md
  • docs/adapter-contract/execution.md
**/*.{md,rst,txt,adoc}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-language-mechanics.md)

**/*.{md,rst,txt,adoc}: For technical documentation, use professional, active, conversational, engaging, precise, and plain-English prose. Prefer active voice, present tense, short sentences, and scannable paragraphs. Avoid casual or imprecise language, swearing, threats, insults, jokes, puns, culture-specific idioms, marketing exaggeration, and unsupported third-party comparisons.
Use can for possibility and reserve may for permission; use after for temporal order; use refer to for cross-references; prefer short direct sentences and specific verbs; avoid unnecessary please in technical documentation.
Prefer active voice when the actor matters. Passive voice is acceptable when the actor is unknown or irrelevant, when the action or result is the focus, or in programmer documentation.
Use natural contractions in conversational technical prose, but do not force them in formal legal copy, API references, or generated text.
Prefer simpler English over Latinisms: use for example or such as instead of e.g., and so on instead of etc., that is instead of i.e., compared to instead of vs., and by, through, or using instead of via. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Use that without commas for essential clauses, and which with commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such as June 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space before a.m. or p.m.; use ET and PT for needed time zones; avoid 24/7; and prefer from 12:30 to 1:00 p.m. for prose ranges.
Format numbers consistently: spell out zero through nine in body text, use numerals for 10 or greater and for technical values, use commas in thousands, do not begin a sentence with a numeral, spell out ordinals, and use numerals consistently within a category wh...

Files:

  • adapters/common/README.md
  • external/nat/README.md
  • skills/nemo-fabric-build-adapter/SKILL.md
  • docs/adapter-contract/execution.md
**/*.{md,mdx}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

**/*.{md,mdx}: Use the full product name NVIDIA NeMo Fabric on first use, typically in the title and H1; use NeMo Fabric thereafter. Use fabric alone only for the CLI tool and surround it with backticks.
Treat incorrect or stale commands, package names, paths, APIs, support claims, procedures, examples, terminology, or public behavior documentation as blocking issues.
Capitalize NVIDIA correctly and format code, commands, paths, and filenames as inline code where needed.
Use title case for technical-documentation headings.
Introduce code blocks, tables, and lists with complete lead-in sentences; ensure examples match current APIs and build commands.
Use descriptive anchor text, avoid raw URLs and generic labels such as here, and use repository-relative .mdx paths for links within docs/.
Prefer active voice, present tense, short sentences, plain English, consistent terminology, and imperative, parallel, scannable procedures.
Use after instead of once when expressing temporal sequence, and use can rather than may when describing possibility rather than permission.
Avoid ambiguous numeric dates and ordinal dates in body text.
For learning-oriented documentation, do not force trademark symbols unless the source document explicitly requires them.
When reporting documentation-review findings, lead with Must fix, Should fix, and Nice to have categories; include file path, line reference, current problem, rationale, and a concrete rewrite or direction.

Files:

  • adapters/common/README.md
  • external/nat/README.md
  • skills/nemo-fabric-build-adapter/SKILL.md
  • docs/adapter-contract/execution.md
**/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update relevant SDK, API reference, adapter, example, integration, and support documentation when the corresponding public surface changes.

Files:

  • adapters/common/README.md
  • external/nat/README.md
  • skills/nemo-fabric-build-adapter/SKILL.md
  • docs/adapter-contract/execution.md
**/*.{html,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

HTML and Markdown files must use the specified SPDX HTML-comment header.

Files:

  • adapters/common/README.md
  • external/nat/README.md
  • skills/nemo-fabric-build-adapter/SKILL.md
  • docs/adapter-contract/execution.md
adapters/*/{README.md,fabric-adapter.json}

📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)

Document installation, supported configuration, harness-only settings, credentials, lifecycle, telemetry, artifacts, limitations, and focused test commands; keep documentation consistent with descriptor claims.

Files:

  • adapters/common/README.md
adapters/*/README.md

📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)

Provide a credential-free fixture covering plan, doctor, and run, plus a canonical typed SDK example and, when required, a canonical harness-native YAML fixture.

Files:

  • adapters/common/README.md
{adapters/**,examples/**}

⚙️ CodeRabbit configuration file

{adapters/**,examples/**}: Review adapter and example changes for command correctness, config/schema consistency, artifact handling, and compatibility with the public NeMo Fabric contracts.

Files:

  • adapters/common/README.md
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
{*.md,**/*.md,**/*.mdx,**/*.ipynb}

⚙️ CodeRabbit configuration file

{*.md,**/*.md,**/*.mdx,**/*.ipynb}: Enforce the product name in user-facing prose: use "NVIDIA NeMo Fabric" on first use and "NeMo Fabric" thereafter. Flag standalone capitalized "Fabric" when it refers to the product. Do not flag the lowercase fabric CLI command, package/import/crate names, code identifiers, API symbols, configuration keys, file paths, or unrelated generic uses of the word.

Files:

  • adapters/common/README.md
  • external/nat/README.md
  • skills/nemo-fabric-build-adapter/SKILL.md
  • docs/adapter-contract/execution.md
**/*.{json,jsonschema}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Public contract changes must keep checked-in JSON Schema snapshots synchronized.

Files:

  • external/nat/fabric-adapter.json
  • schemas/adapter-contract/agent-run-result.schema.json
  • schemas/adapter-contract/agent-config.schema.json
  • schemas/run-plan.schema.json
adapters/*/src/**/*.py

📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)

adapters/*/src/**/*.py: Implement adapters using the existing Fabric python or process runner and normalized request/result contracts; do not add a runner or one-off abstraction for a single adapter.
Treat normalized config, Fabric-resolved plans, and runtime_context as authoritative; reserve harness.settings for adapter-wide behavior and apply precedence in the order: normalized config, plans/context, harness settings, descriptor/default values.
Reject conflicting duplicate declarations and unsupported behavior with actionable errors naming the field and supported alternatives; never silently drop configuration.
Validate dependency versions, hooks, and credentials before harness invocation, and never expose credential values in outputs, errors, events, logs, or fixtures.
Forward only required system, selected credential, telemetry, and documented harness-specific environment variables; never forward or log unrelated environment values.
Maintain one local adapter host per Fabric runtime across ordered startinvoke*stop operations. Emit one JSON lifecycle response per request on stdout and diagnostics on stderr.
Return harness-level invocation failures as successful lifecycle responses containing response: null, failed: true, and structured error fields (code, message, retryable, and optional metadata).
Do not emit NeMo Relay stream records on adapter stdout; return exactly one terminal lifecycle response while streaming occurs through the SDK-owned out-of-band endpoint.
Scope workspace, generated configuration, state, sessions, and artifacts to the resolved runtime context, and isolate stateful adapter instances by Fabric runtime ID.
Use start to initialize adapter-owned harness state, retain it for continuation across repeated invoke calls on the same runtime, and release it in stop.

Files:

  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
schemas/**/*

⚙️ CodeRabbit configuration file

schemas/**/*: Schemas are generated public contract snapshots. Check that schema diffs correspond to intentional Rust type changes and are covered by core tests.

Files:

  • schemas/adapter-contract/agent-run-result.schema.json
  • schemas/adapter-contract/agent-config.schema.json
  • schemas/run-plan.schema.json
**/SKILL.md

📄 CodeRabbit inference engine (.agents/skills/README.md)

Each maintainer skill file must begin with YAML frontmatter containing at least name and description.

Files:

  • skills/nemo-fabric-build-adapter/SKILL.md

⚙️ CodeRabbit configuration file

**/SKILL.md: Do not flag SKILL.md files for missing SPDX headers. Skill entrypoints intentionally start with YAML frontmatter instead.
Verify that every SKILL.md keeps valid YAML frontmatter with at least name and description fields before the Markdown body.

Files:

  • skills/nemo-fabric-build-adapter/SKILL.md
skills/**

📄 CodeRabbit inference engine (AGENTS.md)

skills/**: Keep consumer skills self-contained and dependent only on supported public Python SDK contracts and published documentation; do not include repository internals.
Do not add repository-internal contribution guidance to consumer skills.
Consumer skills must link to public GitHub documentation and example URLs rather than a docs-site domain so they remain portable when exported.

Files:

  • skills/nemo-fabric-build-adapter/SKILL.md
python/src/nemo_fabric/**/*.py

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

For Python API reference changes, update source docstrings under python/src/nemo_fabric/ instead of generated API reference files.

Files:

  • python/src/nemo_fabric/types.py
  • python/src/nemo_fabric/models.py
python/src/nemo_fabric/**/*.{py,rs}

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

Ensure native extension naming and placement remain compatible with downstream consumers, including the editable maturin build producing nemo_fabric._native.

Files:

  • python/src/nemo_fabric/types.py
  • python/src/nemo_fabric/models.py
python/src/nemo_fabric/**/*

⚙️ CodeRabbit configuration file

python/src/nemo_fabric/**/*: Review Python SDK changes for typed API consistency, import-time dependency neutrality, async/session behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/src/nemo_fabric/types.py
  • python/src/nemo_fabric/models.py
{README.md,docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repository references, and build commands current in documentation and examples.

Files:

  • docs/adapter-contract/execution.md
{docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Update relevant getting-started, reference, adapter, and example documentation when the corresponding examples or adapters change.

Files:

  • docs/adapter-contract/execution.md
docs/**/*.{md,mdx,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Run just docs when the documentation site changes.

Files:

  • docs/adapter-contract/execution.md
docs/**

📄 CodeRabbit inference engine (AGENTS.md)

Run just docs after changing the documentation site.

Files:

  • docs/adapter-contract/execution.md
{docs/**,README.md,AGENTS.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,AGENTS.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency with generated schemas.
For links between files under docs/, require paths relative to the source file with the target file's .mdx extension so they work in both Fern builds and repository browsers. Flag Fern site-root links such as NeMo Fabric overview; use the repository-relative equivalent, such as NeMo Fabric overview.

Files:

  • docs/adapter-contract/execution.md
🧠 Learnings (6)
📚 Learning: 2026-06-29T22:34:52.407Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 27
File: adapters/codex-cli/fabric-adapter.json:13-15
Timestamp: 2026-06-29T22:34:52.407Z
Learning: In NeMo-Fabric adapter manifest files (e.g., `*/fabric-adapter.json`), keep `config.accepts` limited to the top-level Fabric capability sections that `resolve_capability_plan` consumes (such as `models`, `tools`, `mcp`, `skills`, `telemetry`). Do not add adapter-owned `harness.settings` keys to `config.accepts`; `harness.settings` should remain adapter-owned and be passed through unchanged.

Applied to files:

  • external/nat/fabric-adapter.json
📚 Learning: 2026-08-07T07:15:33.918Z
Learnt from: AnuradhaKaruppiah
Repo: NVIDIA/NeMo-Fabric PR: 186
File: schemas/adapter-contract/legacy/adapter-invocation.schema.json:176-176
Timestamp: 2026-08-07T07:15:33.918Z
Learning: For the NeMo Fabric v1alpha southbound adapter contract, treat the adapter descriptor's `contract_version` as the version of the complete contract, including `RuntimeContext`. Keep `RuntimeContext` strict by rejecting unknown properties, and require a negotiated contract-version change for additive shape changes.

Applied to files:

  • schemas/adapter-contract/agent-run-result.schema.json
  • schemas/adapter-contract/agent-config.schema.json
📚 Learning: 2026-08-07T07:15:35.305Z
Learnt from: AnuradhaKaruppiah
Repo: NVIDIA/NeMo-Fabric PR: 186
File: schemas/adapter-contract/agent-config.schema.json:374-381
Timestamp: 2026-08-07T07:15:35.305Z
Learning: For the NeMo Fabric southbound adapter contract schemas, treat `AdapterDescriptor.contract_version` as the single negotiated version for the entire contract, covering `AgentConfig`, `AgentRunRequest`, `AgentRunResult`, and `RuntimeContext` before adapter startup. Do not require individual version fields in these payloads; verify behavior against the maintained adapter-contract README.

Applied to files:

  • schemas/adapter-contract/agent-run-result.schema.json
  • schemas/adapter-contract/agent-config.schema.json
📚 Learning: 2026-06-28T04:03:32.877Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 26
File: python/tests/smoke_typed_config.py:163-177
Timestamp: 2026-06-28T04:03:32.877Z
Learning: In NVIDIA NeMo Fabric Python SDK serialization of `RuntimeCapabilities` (to satisfy the “parity contract” with Rust core and the CLI), do not emit metadata keys when the corresponding metadata is absent. Instead, omit those fields entirely so the produced JSON matches the Rust/CLI output (e.g., avoid `null`, empty objects, or placeholder metadata). During review, verify the serializer/builders follow this omission rule and that Python outputs/parity tests reflect the same shape.

Applied to files:

  • python/src/nemo_fabric/types.py
  • python/src/nemo_fabric/models.py
📚 Learning: 2026-08-07T07:15:59.993Z
Learnt from: AnuradhaKaruppiah
Repo: NVIDIA/NeMo-Fabric PR: 186
File: docs/adapter-contract/registration-and-discovery.md:103-104
Timestamp: 2026-08-07T07:15:59.993Z
Learning: Keep documentation files under docs/adapter-contract/ in portable Markdown (.md), not MDX. GitHub and the public authoring skill consume these files directly, and the NVIDIA NeMo Fabric documentation pipeline accepts them without conversion; do not flag the lack of MDX conversion for these files.

Applied to files:

  • docs/adapter-contract/execution.md
📚 Learning: 2026-08-07T16:20:01.603Z
Learnt from: AnuradhaKaruppiah
Repo: NVIDIA/NeMo-Fabric PR: 186
File: docs/adapter-contract/README.md:1-4
Timestamp: 2026-08-07T16:20:01.603Z
Learning: For maintained Markdown files under docs/adapter-contract/, Fern parses content as MDX. Write SPDX license headers as JSX comments (`{/* ... */}`), not HTML comments, because HTML comments cause Fern parsing failures. This JSX form is accepted by the repository copyright checker and validated by Docs Preview.

Applied to files:

  • docs/adapter-contract/execution.md
🪛 Ruff (0.16.1)
adapter-contract/src/nemo_fabric_adapter_contract/models.py

[warning] 207-209: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 247-247: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 326-326: Avoid specifying long messages outside the exception class

(TRY003)

🔇 Additional comments (22)
crates/fabric-core/src/doctor.rs (1)

548-553: LGTM!

Also applies to: 577-582

python/src/nemo_fabric/models.py (1)

658-669: LGTM!

python/src/nemo_fabric/types.py (1)

675-675: LGTM!

Also applies to: 1107-1108, 1313-1327, 1429-1429

tests/python/test_sdk_contract.py (1)

545-557: LGTM!

Also applies to: 591-606, 851-851, 873-874

adapter-contract/src/nemo_fabric_adapter_contract/models.py (1)

58-58: LGTM!

Also applies to: 201-211, 241-249, 375-377, 501-504

schemas/adapter-contract/agent-config.schema.json (1)

83-85: LGTM!

Also applies to: 293-295, 426-428, 478-478

schemas/run-plan.schema.json (1)

386-388: LGTM!

Also applies to: 518-520, 728-730, 2597-2597

crates/fabric-core/src/agent_execution.rs (1)

241-241: LGTM!

schemas/adapter-contract/agent-run-result.schema.json (1)

201-204: LGTM!

Also applies to: 259-259

tests/adapter_contract/test_agent_config.py (1)

85-92: LGTM!

Also applies to: 162-175

tests/adapter_contract/test_agent_execution.py (1)

13-13: LGTM!

Also applies to: 133-152

external/nat/fabric-adapter.json (1)

20-53: LGTM!

external/nat/README.md (1)

26-41: 📐 Maintainability & Code Quality

Should fix: Verify the documentation build.

Run just docs when practical. The changed adapter documentation must remain valid in the documentation toolchain.

Source: Coding guidelines

crates/fabric-core/src/config.rs (1)

1330-1335: LGTM!

Also applies to: 1467-1469

crates/fabric-core/src/schema.rs (1)

359-370: LGTM!

Also applies to: 395-399

adapters/common/src/nemo_fabric_adapters/common/lifecycle.py (1)

259-259: LGTM!

Also applies to: 420-422

adapters/common/README.md (1)

56-59: LGTM!

docs/adapter-contract/execution.md (1)

86-86: LGTM!

Also applies to: 100-112

skills/nemo-fabric-build-adapter/SKILL.md (1)

122-122: LGTM!

Also applies to: 140-142

tests/adapters/test_adapters_common_lifecycle.py (1)

151-173: LGTM!

external/nat/src/nemo_fabric_adapters/nat/adapter.py (1)

32-32: LGTM!

Also applies to: 78-78, 97-117

tests/adapters/test_external_nat_adapter.py (1)

247-251: LGTM!

Also applies to: 364-381, 399-399

Comment thread adapter-contract/src/nemo_fabric_adapter_contract/models.py Outdated
Comment thread adapters/common/src/nemo_fabric_adapters/common/lifecycle.py Outdated
Comment thread crates/fabric-core/src/agent_config.rs Outdated
Comment thread crates/fabric-core/src/config.rs Outdated
Comment thread python/src/nemo_fabric/types.py Outdated

@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: 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 `@external/nat/src/nemo_fabric_adapters/nat/adapter.py`:
- Around line 179-183: Update the role validation in the model configuration
path to reject whitespace-only and padded names by normalizing and validating
each role before storing it as an NAT llms key. Apply the same normalization and
validation contract to named model, MCP-server, and tool-definition keys, and
add regression coverage for whitespace-only and padded role names.
- Around line 99-100: In the legacy workflow branch of the NAT adapter, validate
entrypoint.ref before assigning it to workflow_ref, rejecting any value
containing whitespace and reporting the workflow.entrypoint.ref field. Preserve
the existing assignment for valid references.
🪄 Autofix

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: ddfc1a18-af56-45d9-afc8-700497e44310

📥 Commits

Reviewing files that changed from the base of the PR and between 848b414 and 2685686.

📒 Files selected for processing (6)
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • crates/fabric-core/src/config.rs
  • crates/fabric-core/src/schema.rs
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapter_contract/test_agent_config.py
  • tests/adapters/test_external_nat_adapter.py
📜 Review details
⏰ Context from checks skipped due to timeout. (18)
  • GitHub Check: Preview docs
  • GitHub Check: Test (Python 3.13, macos-arm64)
  • GitHub Check: Test (Python 3.14, macos-arm64)
  • GitHub Check: Test (Python 3.11, macos-arm64)
  • GitHub Check: Test (Python 3.12, linux-arm64)
  • GitHub Check: Test (Python 3.13, linux-amd64)
  • GitHub Check: Pre-commit
  • GitHub Check: Test (Python 3.14, linux-amd64)
  • GitHub Check: Test (Python 3.12, windows-amd64)
  • GitHub Check: Test (Python 3.12, macos-arm64)
  • GitHub Check: Test (Python 3.12, linux-amd64)
  • GitHub Check: Test (Python 3.11, linux-amd64)
  • GitHub Check: Test (Python 3.14, windows-amd64)
  • GitHub Check: Test (Python 3.13, windows-amd64)
  • GitHub Check: Test (Python 3.11, windows-amd64)
  • GitHub Check: Test (Python 3.11, linux-arm64)
  • GitHub Check: Test (Python 3.13, linux-arm64)
  • GitHub Check: Test (Python 3.14, linux-arm64)
🧰 Additional context used
📓 Path-based instructions (19)
**/*.{rs,py,pyi,json,yaml,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Determine and update every affected public surface, including the CLI, PyO3 bindings, Python SDK, type stubs, schemas, and adapter contract, so they remain in parity.

Files:

  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/schema.rs
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • crates/fabric-core/src/config.rs
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_external_nat_adapter.py
**/*

📄 CodeRabbit inference engine (.agents/skills/karpathy-guidelines/SKILL.md)

**/*: Before implementing, explicitly state assumptions, surface ambiguity and tradeoffs, present multiple interpretations when relevant, and ask for clarification rather than silently deciding or proceeding when requirements are unclear.
Prefer the minimum code needed to solve the requested problem: avoid speculative features, unnecessary abstractions, unrequested flexibility, and handling of impossible scenarios; simplify overcomplicated solutions.
When editing existing code, make surgical changes only: do not modify unrelated code, comments, formatting, or pre-existing dead code; match the existing style, and remove only unused imports, variables, or functions introduced by your changes.
Define verifiable success criteria for each task, such as writing regression tests for bugs and invalid-input tests for validation, then verify the implementation against those criteria. For multi-step work, state a brief plan with a verification check for each step.

**/*: Always spell NVIDIA in all caps; do not use Nvidia, nvidia, nVidia, nVIDIA, or NV.
Use an NVIDIA before a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol after NVIDIA when referring to the company; use trademark symbols with product names only when required by the document type or legal guidance.
Verify official capitalization, spacing, hyphenation, and spelling for NVIDIA and third-party product names; do not rewrite official product names for grammar or title-case rules.
Precede NVIDIA product names with NVIDIA on first mention when natural and accurate, and link the first mention when the destination helps the reader.
On first use, include the company name and full model qualifier when it helps identify the model; preserve official capitalization and punctuation, and use shorter family names only after establishing the full name.
For learning-oriented and developer content, do not force trademark symbols unless explicitly required; for press, ...

Files:

  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/schema.rs
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • crates/fabric-core/src/config.rs
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_external_nat_adapter.py
**/*.{rs,py}

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

For native binding changes, run cargo check -p fabric-python --locked.

Use snake_case for functions and variables; use PascalCase for Rust types and Python classes.

Files:

  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/schema.rs
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • crates/fabric-core/src/config.rs
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_external_nat_adapter.py
**/*.{py,pyi}

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

If Python code or a Python-facing adapter changes, run just test-python.

In Python SDK, adapters, examples, and tests, follow the existing style, use type annotations for public APIs, and keep native binding declarations synchronized with their Rust implementations.

Files:

  • tests/adapter_contract/test_agent_config.py
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_external_nat_adapter.py
**/*.{rs,py,pyi}

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

**/*.{rs,py,pyi}: If public configuration types change, confirm schema snapshot tests in just test-rust pass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes under schemas/ and generated API references.

Files:

  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/schema.rs
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • crates/fabric-core/src/config.rs
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_external_nat_adapter.py
**/*.{py,pyi,rs}

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

For Python SDK or PyO3 binding changes, use python-tests, run focused pytest tests first, then just test-python; rebuild with just build-python when native code or packaging changes.

Public contract changes must keep native Python binding declarations synchronized with their Rust implementations.

Files:

  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/schema.rs
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • crates/fabric-core/src/config.rs
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_external_nat_adapter.py
**/*.{rs,py,toml}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

When editing version helpers, verify every nemo-fabric-* workspace package through Cargo metadata and reject a static version in python/pyproject.toml.

Files:

  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/schema.rs
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • crates/fabric-core/src/config.rs
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_external_nat_adapter.py
**/*.{toml,rs,py}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

Avoid blind repository-wide replacement of version-like strings; distinguish package-version references from examples and unrelated dependency versions.

Files:

  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/schema.rs
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • crates/fabric-core/src/config.rs
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_external_nat_adapter.py
**/*.{md,mdx,yml,py,rs,sh}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Keep documentation aligned with current NeMo Fabric behavior, repository layout, entry points, commands, package names, APIs, bindings, and support claims.

Files:

  • tests/adapter_contract/test_agent_config.py
  • crates/fabric-core/src/schema.rs
  • adapter-contract/src/nemo_fabric_adapter_contract/models.py
  • crates/fabric-core/src/config.rs
  • external/nat/src/nemo_fabric_adapters/nat/adapter.py
  • tests/adapters/test_external_nat_adapter.py
tests/**/*.{rs,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When adding functionality, include tests in the corresponding Rust crate or the relevant area under tests/.

Files:

  • tests/adapter_contract/test_agent_config.py
  • tests/adapters/test_external_nat_adapter.py
tests/**/*.py

📄 CodeRabbit inference engine (.agents/skills/python-tests/SKILL.md)

tests/**/*.py: Use pytest to run Python tests.
Do not add @pytest.mark.asyncio to tests; async tests are automatically detected by the async runner.
Do not add -> None return type annotations to test functions.
When mocking a class, use unittest.mock.MagicMock or AsyncMock, using the spec argument when necessary, rather than defining a new class.
Prefix mocked class names with mock, not fake.
Prefer pytest fixtures over helper methods.
If a fixture is needed in multiple test files, define it once in conftest.py rather than repeating it.
Define fixtures using @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and a <fixture_name>_fixture function; specify scope only when it is not function.
Prefer pytest.mark.parametrize over separate tests for different input types.
Use @pytest.mark.usefixtures when a fixture is needed but its returned value is unused or it returns no value.
Avoid defensive programming in tests; access expected values directly so missing data raises a clear failure, such as using results["data"] instead of results.get("data").
When adapter installation metadata changes, packaging metadata tests must directly assert that the root project depends unconditionally on the exact-version nemo-fabric-runtime distribution.
Packaging metadata tests must verify that each root harness extra delegates to the matching version of the leaf adapter's harness extra.
Packaging metadata tests must verify that bare leaf dependencies remain adapter-owned and that the root adapter-tests dependency group installs each leaf through its harness extra.
Packaging metadata tests must verify that every leaf provides full; only adapters importing NeMo Relay Python APIs provide relay, while adapters using an external Relay executable have full equal to harness.

Files:

  • tests/adapter_contract/test_agent_config.py
  • tests/adapters/test_external_nat_adapter.py
{tests/**,python/tests/**}

⚙️ CodeRabbit configuration file

{tests/**,python/tests/**}: Tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.

Files:

  • tests/adapter_contract/test_agent_config.py
  • tests/adapters/test_external_nat_adapter.py
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Implement new runtime or binding behavior in the shared Rust core first.

Files:

  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/config.rs
**/*.{rs,toml}

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

For any Rust change, run just test-rust and cargo fmt --all -- --check.

For Rust core, CLI, or shared runtime semantic changes, run Rust formatting and tests, and add Python tests when behavior is exposed through the SDK.

Use Rust stable tooling; format Rust code with cargo fmt --all, verify formatting with cargo fmt --all -- --check, and compile with cargo check --workspace --locked.

Files:

  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/config.rs
crates/fabric-core/**/*.{rs,py}

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

Changes under crates/fabric-core must run both the Rust and Python test suites.

Files:

  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/config.rs
**/*.{rs,rmeta}

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

If Rust code changes, run cargo fmt --all -- --check and just test-rust.

Files:

  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/config.rs
crates/fabric-core/**/*.rs

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

If crates/fabric-core changes in a way exposed through Python, run both the Rust and Python suites.

For Rust API reference changes, update Rust documentation comments under crates/fabric-core/ instead of generated API reference files.

Files:

  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/config.rs
crates/fabric-core/src/**/*.rs

⚙️ CodeRabbit configuration file

crates/fabric-core/src/**/*.rs: Review the Rust core for runtime lifecycle correctness, handle validation, capability routing accuracy, schema stability, and error semantics.
Public API changes should match committed schemas, tests, and documentation.

Files:

  • crates/fabric-core/src/schema.rs
  • crates/fabric-core/src/config.rs
tests/adapters/**/*.py

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

tests/adapters/**/*.py: If an adapter or integration changes, run its focused tests.
For adapter behavior changes, run focused adapter tests under tests/adapters, then run just test-python.

Files:

  • tests/adapters/test_external_nat_adapter.py
🔇 Additional comments (6)
adapter-contract/src/nemo_fabric_adapter_contract/models.py (1)

58-58: LGTM!

Also applies to: 346-348, 472-475

crates/fabric-core/src/schema.rs (1)

382-386: LGTM!

tests/adapter_contract/test_agent_config.py (1)

85-90: LGTM!

crates/fabric-core/src/config.rs (1)

1458-1459: 🗄️ Data Integrity & Integration

Keep the diagnostic compatibility bypass. validate_config runs first and rejects blank or whitespace-only tool kind and ref values.

			> Likely an incorrect or invalid review comment.
external/nat/src/nemo_fabric_adapters/nat/adapter.py (1)

32-32: LGTM!

Also applies to: 78-78, 97-98, 101-106, 117-117, 381-385

tests/adapters/test_external_nat_adapter.py (1)

247-251: LGTM!

Also applies to: 364-392, 410-410, 584-594

Comment thread external/nat/src/nemo_fabric_adapters/nat/adapter.py Outdated
Comment thread external/nat/src/nemo_fabric_adapters/nat/adapter.py Outdated

@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: 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 `@adapters/common/src/nemo_fabric_adapters/common/lifecycle.py`:
- Around line 240-257: Sanitize validation metadata in the error-handling flow
around the `errors` callable before returning or logging it: in both the
keyword-argument and `TypeError` fallback branches, allow-list only
non-sensitive fields such as `type` and `loc`, excluding `msg` and other
credential-bearing values. Add a regression test using a validator sentinel
secret that verifies it is absent from both response metadata and stderr.

In `@tests/python/test_sdk_contract.py`:
- Around line 913-916: Expand the RunPlan.from_mapping test around
RunPlan._normalize to cover both missing and non-mapping agent_config values
such as []. Create and modify each plan before entering pytest.raises, keeping
each context manager to a single RunPlan.from_mapping statement to satisfy Ruff
PT012 and verify FabricConfigError with the existing message.
🪄 Autofix

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: f4662aed-014b-440a-947a-9fb6419e8449

📥 Commits

Reviewing files that changed from the base of the PR and between 2685686 and ee3e151.

📒 Files selected for processing (5)
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • docs/reference/api/python-library-reference/nemo_fabric.types.md
  • python/src/nemo_fabric/types.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/python/test_sdk_contract.py
📜 Review details
⏰ Context from checks skipped due to timeout. (20)
  • GitHub Check: Preview docs
  • GitHub Check: Pre-commit
  • GitHub Check: Test (Python 3.11, linux-amd64)
  • GitHub Check: Test (Python 3.12, macos-arm64)
  • GitHub Check: Test (Python 3.12, linux-arm64)
  • GitHub Check: Test (Python 3.11, linux-arm64)
  • GitHub Check: Test (Python 3.14, windows-amd64)
  • GitHub Check: Test (Python 3.13, windows-amd64)
  • GitHub Check: Test (Python 3.12, windows-amd64)
  • GitHub Check: Test (Python 3.11, windows-amd64)
  • GitHub Check: Test (Python 3.14, linux-arm64)
  • GitHub Check: Test (Python 3.12, linux-amd64)
  • GitHub Check: Test (Python 3.13, macos-arm64)
  • GitHub Check: Test (Python 3.14, macos-arm64)
  • GitHub Check: Test (Python 3.13, linux-amd64)
  • GitHub Check: Test (Python 3.11, macos-arm64)
  • GitHub Check: Test (Python 3.13, linux-arm64)
  • GitHub Check: Test (x86_64)
  • GitHub Check: Test (Python 3.14, linux-amd64)
  • GitHub Check: Test (arm64)
🧰 Additional context used
📓 Path-based instructions (31)
**/*.{md,rst}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Update documentation and examples in the same branch as the public API change.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
{README.md,docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repository references, and build commands current in documentation and examples.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
{docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Update relevant getting-started, reference, adapter, and example documentation when the corresponding examples or adapters change.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
docs/**/*.{md,mdx,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Run just docs when the documentation site changes.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
**/*

📄 CodeRabbit inference engine (.agents/skills/karpathy-guidelines/SKILL.md)

**/*: Before implementing, explicitly state assumptions, surface ambiguity and tradeoffs, present multiple interpretations when relevant, and ask for clarification rather than silently deciding or proceeding when requirements are unclear.
Prefer the minimum code needed to solve the requested problem: avoid speculative features, unnecessary abstractions, unrequested flexibility, and handling of impossible scenarios; simplify overcomplicated solutions.
When editing existing code, make surgical changes only: do not modify unrelated code, comments, formatting, or pre-existing dead code; match the existing style, and remove only unused imports, variables, or functions introduced by your changes.
Define verifiable success criteria for each task, such as writing regression tests for bugs and invalid-input tests for validation, then verify the implementation against those criteria. For multi-step work, state a brief plan with a verification check for each step.

**/*: Always spell NVIDIA in all caps; do not use Nvidia, nvidia, nVidia, nVIDIA, or NV.
Use an NVIDIA before a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol after NVIDIA when referring to the company; use trademark symbols with product names only when required by the document type or legal guidance.
Verify official capitalization, spacing, hyphenation, and spelling for NVIDIA and third-party product names; do not rewrite official product names for grammar or title-case rules.
Precede NVIDIA product names with NVIDIA on first mention when natural and accurate, and link the first mention when the destination helps the reader.
On first use, include the company name and full model qualifier when it helps identify the model; preserve official capitalization and punctuation, and use shorter family names only after establishing the full name.
For learning-oriented and developer content, do not force trademark symbols unless explicitly required; for press, ...

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • python/src/nemo_fabric/types.py
  • tests/python/test_sdk_contract.py
**/*.{md,mdx,rst}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)

**/*.{md,mdx,rst}: For NeMo Fabric documentation, verify technical claims against the current repository, public API, or documented command before reviewing style.
Always spell NVIDIA in all caps; do not use Nvidia, nvidia, or NV.
Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text; avoid raw URLs and weak anchors such as here or read more.
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative, parallel steps; split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English while preserving necessary technical precision.
Use can for possibility and reserve may for permission.
Use after for temporal relationships instead of once, and prefer refer to over see when directing readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical documentation.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values; use numerals for 10 or greater and commas in thousands.
Do not add trademark symbols to learning-oriented documentation unless the source, platform, or legal guidance explicitly requires them.
Do not replace precise technical terms with simpler words when doing so would lose precision.
Do not flag passive voice when the actor is unknown or the action is the important part.
Do not rewrite API names, package names, command flags, or code literals for style.

**/*.{md,mdx,rst}: Use consistent title case for technical-document headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title ...

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
**/*.{md,rst,txt,adoc}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-language-mechanics.md)

**/*.{md,rst,txt,adoc}: For technical documentation, use professional, active, conversational, engaging, precise, and plain-English prose. Prefer active voice, present tense, short sentences, and scannable paragraphs. Avoid casual or imprecise language, swearing, threats, insults, jokes, puns, culture-specific idioms, marketing exaggeration, and unsupported third-party comparisons.
Use can for possibility and reserve may for permission; use after for temporal order; use refer to for cross-references; prefer short direct sentences and specific verbs; avoid unnecessary please in technical documentation.
Prefer active voice when the actor matters. Passive voice is acceptable when the actor is unknown or irrelevant, when the action or result is the focus, or in programmer documentation.
Use natural contractions in conversational technical prose, but do not force them in formal legal copy, API references, or generated text.
Prefer simpler English over Latinisms: use for example or such as instead of e.g., and so on instead of etc., that is instead of i.e., compared to instead of vs., and by, through, or using instead of via. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Use that without commas for essential clauses, and which with commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such as June 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space before a.m. or p.m.; use ET and PT for needed time zones; avoid 24/7; and prefer from 12:30 to 1:00 p.m. for prose ranges.
Format numbers consistently: spell out zero through nine in body text, use numerals for 10 or greater and for technical values, use commas in thousands, do not begin a sentence with a numeral, spell out ordinals, and use numerals consistently within a category wh...

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
docs/reference/api/**/*

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Treat all files under docs/reference/api/ as generated output and do not modify them directly.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
**/*.{md,mdx,yml,py,rs,sh}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Keep documentation aligned with current NeMo Fabric behavior, repository layout, entry points, commands, package names, APIs, bindings, and support claims.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • python/src/nemo_fabric/types.py
  • tests/python/test_sdk_contract.py
**/*.{md,mdx}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

**/*.{md,mdx}: Use the full product name NVIDIA NeMo Fabric on first use, typically in the title and H1; use NeMo Fabric thereafter. Use fabric alone only for the CLI tool and surround it with backticks.
Treat incorrect or stale commands, package names, paths, APIs, support claims, procedures, examples, terminology, or public behavior documentation as blocking issues.
Capitalize NVIDIA correctly and format code, commands, paths, and filenames as inline code where needed.
Use title case for technical-documentation headings.
Introduce code blocks, tables, and lists with complete lead-in sentences; ensure examples match current APIs and build commands.
Use descriptive anchor text, avoid raw URLs and generic labels such as here, and use repository-relative .mdx paths for links within docs/.
Prefer active voice, present tense, short sentences, plain English, consistent terminology, and imperative, parallel, scannable procedures.
Use after instead of once when expressing temporal sequence, and use can rather than may when describing possibility rather than permission.
Avoid ambiguous numeric dates and ordinal dates in body text.
For learning-oriented documentation, do not force trademark symbols unless the source document explicitly requires them.
When reporting documentation-review findings, lead with Must fix, Should fix, and Nice to have categories; include file path, line reference, current problem, rationale, and a concrete rewrite or direction.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
**/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update relevant SDK, API reference, adapter, example, integration, and support documentation when the corresponding public surface changes.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
**/*.{html,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

HTML and Markdown files must use the specified SPDX HTML-comment header.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
docs/**

📄 CodeRabbit inference engine (AGENTS.md)

Run just docs after changing the documentation site.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
{docs/**,README.md,AGENTS.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,AGENTS.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency with generated schemas.
For links between files under docs/, require paths relative to the source file with the target file's .mdx extension so they work in both Fern builds and repository browsers. Flag Fern site-root links such as NeMo Fabric overview; use the repository-relative equivalent, such as NeMo Fabric overview.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
{*.md,**/*.md,**/*.mdx,**/*.ipynb}

⚙️ CodeRabbit configuration file

{*.md,**/*.md,**/*.mdx,**/*.ipynb}: Enforce the product name in user-facing prose: use "NVIDIA NeMo Fabric" on first use and "NeMo Fabric" thereafter. Flag standalone capitalized "Fabric" when it refers to the product. Do not flag the lowercase fabric CLI command, package/import/crate names, code identifiers, API symbols, configuration keys, file paths, or unrelated generic uses of the word.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.types.md
**/*.{rs,py,pyi,json,yaml,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Determine and update every affected public surface, including the CLI, PyO3 bindings, Python SDK, type stubs, schemas, and adapter contract, so they remain in parity.

Files:

  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • python/src/nemo_fabric/types.py
  • tests/python/test_sdk_contract.py
**/*.{rs,py}

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

For native binding changes, run cargo check -p fabric-python --locked.

Use snake_case for functions and variables; use PascalCase for Rust types and Python classes.

Files:

  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • python/src/nemo_fabric/types.py
  • tests/python/test_sdk_contract.py
**/*.{py,pyi}

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

If Python code or a Python-facing adapter changes, run just test-python.

In Python SDK, adapters, examples, and tests, follow the existing style, use type annotations for public APIs, and keep native binding declarations synchronized with their Rust implementations.

Files:

  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • python/src/nemo_fabric/types.py
  • tests/python/test_sdk_contract.py
**/*.{rs,py,pyi}

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

**/*.{rs,py,pyi}: If public configuration types change, confirm schema snapshot tests in just test-rust pass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes under schemas/ and generated API references.

Files:

  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • python/src/nemo_fabric/types.py
  • tests/python/test_sdk_contract.py
**/*.{py,pyi,rs}

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

For Python SDK or PyO3 binding changes, use python-tests, run focused pytest tests first, then just test-python; rebuild with just build-python when native code or packaging changes.

Public contract changes must keep native Python binding declarations synchronized with their Rust implementations.

Files:

  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • python/src/nemo_fabric/types.py
  • tests/python/test_sdk_contract.py
**/*.{rs,py,toml}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

When editing version helpers, verify every nemo-fabric-* workspace package through Cargo metadata and reject a static version in python/pyproject.toml.

Files:

  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • python/src/nemo_fabric/types.py
  • tests/python/test_sdk_contract.py
**/*.{toml,rs,py}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

Avoid blind repository-wide replacement of version-like strings; distinguish package-version references from examples and unrelated dependency versions.

Files:

  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
  • tests/adapters/test_adapters_common_lifecycle.py
  • python/src/nemo_fabric/types.py
  • tests/python/test_sdk_contract.py
adapters/*/src/**/*.py

📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)

adapters/*/src/**/*.py: Implement adapters using the existing Fabric python or process runner and normalized request/result contracts; do not add a runner or one-off abstraction for a single adapter.
Treat normalized config, Fabric-resolved plans, and runtime_context as authoritative; reserve harness.settings for adapter-wide behavior and apply precedence in the order: normalized config, plans/context, harness settings, descriptor/default values.
Reject conflicting duplicate declarations and unsupported behavior with actionable errors naming the field and supported alternatives; never silently drop configuration.
Validate dependency versions, hooks, and credentials before harness invocation, and never expose credential values in outputs, errors, events, logs, or fixtures.
Forward only required system, selected credential, telemetry, and documented harness-specific environment variables; never forward or log unrelated environment values.
Maintain one local adapter host per Fabric runtime across ordered startinvoke*stop operations. Emit one JSON lifecycle response per request on stdout and diagnostics on stderr.
Return harness-level invocation failures as successful lifecycle responses containing response: null, failed: true, and structured error fields (code, message, retryable, and optional metadata).
Do not emit NeMo Relay stream records on adapter stdout; return exactly one terminal lifecycle response while streaming occurs through the SDK-owned out-of-band endpoint.
Scope workspace, generated configuration, state, sessions, and artifacts to the resolved runtime context, and isolate stateful adapter instances by Fabric runtime ID.
Use start to initialize adapter-owned harness state, retain it for continuation across repeated invoke calls on the same runtime, and release it in stop.

Files:

  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
{adapters/**,examples/**}

⚙️ CodeRabbit configuration file

{adapters/**,examples/**}: Review adapter and example changes for command correctness, config/schema consistency, artifact handling, and compatibility with the public NeMo Fabric contracts.

Files:

  • adapters/common/src/nemo_fabric_adapters/common/lifecycle.py
tests/adapters/**/*.py

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

tests/adapters/**/*.py: If an adapter or integration changes, run its focused tests.
For adapter behavior changes, run focused adapter tests under tests/adapters, then run just test-python.

Files:

  • tests/adapters/test_adapters_common_lifecycle.py
tests/**/*.{rs,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When adding functionality, include tests in the corresponding Rust crate or the relevant area under tests/.

Files:

  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/python/test_sdk_contract.py
tests/**/*.py

📄 CodeRabbit inference engine (.agents/skills/python-tests/SKILL.md)

tests/**/*.py: Use pytest to run Python tests.
Do not add @pytest.mark.asyncio to tests; async tests are automatically detected by the async runner.
Do not add -> None return type annotations to test functions.
When mocking a class, use unittest.mock.MagicMock or AsyncMock, using the spec argument when necessary, rather than defining a new class.
Prefix mocked class names with mock, not fake.
Prefer pytest fixtures over helper methods.
If a fixture is needed in multiple test files, define it once in conftest.py rather than repeating it.
Define fixtures using @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and a <fixture_name>_fixture function; specify scope only when it is not function.
Prefer pytest.mark.parametrize over separate tests for different input types.
Use @pytest.mark.usefixtures when a fixture is needed but its returned value is unused or it returns no value.
Avoid defensive programming in tests; access expected values directly so missing data raises a clear failure, such as using results["data"] instead of results.get("data").
When adapter installation metadata changes, packaging metadata tests must directly assert that the root project depends unconditionally on the exact-version nemo-fabric-runtime distribution.
Packaging metadata tests must verify that each root harness extra delegates to the matching version of the leaf adapter's harness extra.
Packaging metadata tests must verify that bare leaf dependencies remain adapter-owned and that the root adapter-tests dependency group installs each leaf through its harness extra.
Packaging metadata tests must verify that every leaf provides full; only adapters importing NeMo Relay Python APIs provide relay, while adapters using an external Relay executable have full equal to harness.

Files:

  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/python/test_sdk_contract.py
{tests/**,python/tests/**}

⚙️ CodeRabbit configuration file

{tests/**,python/tests/**}: Tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.

Files:

  • tests/adapters/test_adapters_common_lifecycle.py
  • tests/python/test_sdk_contract.py
python/src/nemo_fabric/**/*.py

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

For Python API reference changes, update source docstrings under python/src/nemo_fabric/ instead of generated API reference files.

Files:

  • python/src/nemo_fabric/types.py
python/src/nemo_fabric/**/*.{py,rs}

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

Ensure native extension naming and placement remain compatible with downstream consumers, including the editable maturin build producing nemo_fabric._native.

Files:

  • python/src/nemo_fabric/types.py
python/src/nemo_fabric/**/*

⚙️ CodeRabbit configuration file

python/src/nemo_fabric/**/*: Review Python SDK changes for typed API consistency, import-time dependency neutrality, async/session behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/src/nemo_fabric/types.py
🧠 Learnings (1)
📚 Learning: 2026-06-28T04:03:32.877Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 26
File: python/tests/smoke_typed_config.py:163-177
Timestamp: 2026-06-28T04:03:32.877Z
Learning: In NVIDIA NeMo Fabric Python SDK serialization of `RuntimeCapabilities` (to satisfy the “parity contract” with Rust core and the CLI), do not emit metadata keys when the corresponding metadata is absent. Instead, omit those fields entirely so the produced JSON matches the Rust/CLI output (e.g., avoid `null`, empty objects, or placeholder metadata). During review, verify the serializer/builders follow this omission rule and that Python outputs/parity tests reflect the same shape.

Applied to files:

  • python/src/nemo_fabric/types.py
🪛 Ruff (0.16.1)
python/src/nemo_fabric/types.py

[warning] 1339-1339: Avoid specifying long messages outside the exception class

(TRY003)

tests/python/test_sdk_contract.py

[warning] 913-916: pytest.raises() block should contain a single simple statement

(PT012)

🔇 Additional comments (5)
python/src/nemo_fabric/types.py (1)

675-675: LGTM!

Also applies to: 1107-1108, 1313-1340

docs/reference/api/python-library-reference/nemo_fabric.types.md (1)

197-212: 📐 Maintainability & Code Quality

Should Fix — Verify Generated API Reference Output.

docs/reference/api/python-library-reference/nemo_fabric.types.md is generated output. Regenerate this page from python/src/nemo_fabric/types.py with just docs rather than editing it directly.

As per coding guidelines, run just docs when documentation changes. As per path instructions, files under docs/reference/api/ are generated output and must not be modified directly.

Sources: Coding guidelines, Path instructions

tests/python/test_sdk_contract.py (1)

545-557: LGTM!

Also applies to: 591-606, 851-874, 1034-1034

adapters/common/src/nemo_fabric_adapters/common/lifecycle.py (1)

235-239: LGTM!

Also applies to: 258-263, 424-426

tests/adapters/test_adapters_common_lifecycle.py (1)

151-155: LGTM!

Also applies to: 171-173, 176-182, 213-219

Comment thread adapters/common/src/nemo_fabric_adapters/common/lifecycle.py Outdated
Comment thread tests/python/test_sdk_contract.py
@AnuradhaKaruppiah

AnuradhaKaruppiah commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Restore the NAT adapter's local model-role and MCP-server-name guards, plus registered workflow compatibility.

Hello! Can you explain the purpose of this change?
It seems to be in direct conflict with the new adapter approach -

  1. NAT adapter shouldn't be doing validation (The invariants should be enforced once by the shared typed contract). That undermines the slim-adapter goal.
  2. Why was "nat_workflow" added back? Directionally, we want to avoid NAT-specific custom-agent semantics. The workflow_settings.kind has to be a (a) well known type owned by the Fabric core (such as react, rewoo, tool-calling) or (b) a python-entrypoint or (c) python module. We don't want the adapter using a top level "kind=nat_workflow" escape hatch to interpret the config thereby bypassing the Fabric core's planning and validation.

Comment thread external/nat/fabric-adapter.json Outdated
"type": "object",
"properties": {
"kind": {
"const": "nat_workflow",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we want to avoid having a toplevel escape hatch like "nat_workflow"

@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the fix/typed-contract-followups branch from 8c28d8a to 9f3f041 Compare August 10, 2026 17:14
@zhongxuanwang-nv

Copy link
Copy Markdown
Member Author

@AnuradhaKaruppiah Thanks Anuradha for catching this!! This is definitely a huge regression and I definitely should not have missed it during my review — everywhere's saying the kind should only accept the three things you said, but I think the backward compat thing came up as one of the review issues and the agent took it; this is some area i should pay deep attention to in the future!!

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the fix/typed-contract-followups branch from 85f6232 to 0e07c08 Compare August 10, 2026 18:18
@zhongxuanwang-nv zhongxuanwang-nv added this to the 0.2 milestone Aug 10, 2026
@zhongxuanwang-nv zhongxuanwang-nv self-assigned this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants