fix: align typed adapter contracts - #188
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe changes update adapter contracts, typed lifecycle payloads, NAT workflow compatibility, SDK model normalization, tool-definition validation, compatibility diagnostics, and succeeded-run schema handling. ChangesContract and adapter integration
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Fern docs preview: https://nvidia-preview-pull-request-188.docs.buildwithfern.com/nemo/fabric |
There was a problem hiding this comment.
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
📒 Files selected for processing (23)
adapter-contract/src/nemo_fabric_adapter_contract/models.pyadapters/common/README.mdadapters/common/src/nemo_fabric_adapters/common/lifecycle.pycrates/fabric-core/src/agent_config.rscrates/fabric-core/src/agent_execution.rscrates/fabric-core/src/config.rscrates/fabric-core/src/doctor.rscrates/fabric-core/src/schema.rsdocs/adapter-contract/execution.mdexternal/nat/README.mdexternal/nat/fabric-adapter.jsonexternal/nat/src/nemo_fabric_adapters/nat/adapter.pypython/src/nemo_fabric/models.pypython/src/nemo_fabric/types.pyschemas/adapter-contract/agent-config.schema.jsonschemas/adapter-contract/agent-run-result.schema.jsonschemas/run-plan.schema.jsonskills/nemo-fabric-build-adapter/SKILL.mdtests/adapter_contract/test_agent_config.pytests/adapter_contract/test_agent_execution.pytests/adapters/test_adapters_common_lifecycle.pytests/adapters/test_external_nat_adapter.pytests/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.rscrates/fabric-core/src/schema.rscrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rscrates/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.rscrates/fabric-core/src/schema.rstests/adapters/test_external_nat_adapter.pycrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rsexternal/nat/fabric-adapter.jsonadapters/common/src/nemo_fabric_adapters/common/lifecycle.pyschemas/adapter-contract/agent-run-result.schema.jsonschemas/adapter-contract/agent-config.schema.jsontests/adapter_contract/test_agent_config.pycrates/fabric-core/src/config.rstests/python/test_sdk_contract.pyadapter-contract/src/nemo_fabric_adapter_contract/models.pypython/src/nemo_fabric/types.pyexternal/nat/src/nemo_fabric_adapters/nat/adapter.pyschemas/run-plan.schema.jsontests/adapters/test_adapters_common_lifecycle.pytests/adapter_contract/test_agent_execution.pypython/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 spellNVIDIAin all caps; do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol afterNVIDIAwhen 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 withNVIDIAon 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.rscrates/fabric-core/src/schema.rstests/adapters/test_external_nat_adapter.pycrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rsadapters/common/README.mdexternal/nat/README.mdexternal/nat/fabric-adapter.jsonadapters/common/src/nemo_fabric_adapters/common/lifecycle.pyschemas/adapter-contract/agent-run-result.schema.jsonschemas/adapter-contract/agent-config.schema.jsonskills/nemo-fabric-build-adapter/SKILL.mdtests/adapter_contract/test_agent_config.pycrates/fabric-core/src/config.rstests/python/test_sdk_contract.pyadapter-contract/src/nemo_fabric_adapter_contract/models.pypython/src/nemo_fabric/types.pyexternal/nat/src/nemo_fabric_adapters/nat/adapter.pydocs/adapter-contract/execution.mdschemas/run-plan.schema.jsontests/adapters/test_adapters_common_lifecycle.pytests/adapter_contract/test_agent_execution.pypython/src/nemo_fabric/models.py
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
For any Rust change, run
just test-rustandcargo 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 withcargo fmt --all -- --check, and compile withcargo check --workspace --locked.
Files:
crates/fabric-core/src/agent_execution.rscrates/fabric-core/src/schema.rscrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rscrates/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_casefor functions and variables; usePascalCasefor Rust types and Python classes.
Files:
crates/fabric-core/src/agent_execution.rscrates/fabric-core/src/schema.rstests/adapters/test_external_nat_adapter.pycrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rsadapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapter_contract/test_agent_config.pycrates/fabric-core/src/config.rstests/python/test_sdk_contract.pyadapter-contract/src/nemo_fabric_adapter_contract/models.pypython/src/nemo_fabric/types.pyexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/adapters/test_adapters_common_lifecycle.pytests/adapter_contract/test_agent_execution.pypython/src/nemo_fabric/models.py
crates/fabric-core/**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes under
crates/fabric-coremust run both the Rust and Python test suites.
Files:
crates/fabric-core/src/agent_execution.rscrates/fabric-core/src/schema.rscrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rscrates/fabric-core/src/config.rs
**/*.{rs,rmeta}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Rust code changes, run
cargo fmt --all -- --checkandjust test-rust.
Files:
crates/fabric-core/src/agent_execution.rscrates/fabric-core/src/schema.rscrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rscrates/fabric-core/src/config.rs
crates/fabric-core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/fabric-corechanges 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.rscrates/fabric-core/src/schema.rscrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rscrates/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 injust test-rustpass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes underschemas/and generated API references.
Files:
crates/fabric-core/src/agent_execution.rscrates/fabric-core/src/schema.rstests/adapters/test_external_nat_adapter.pycrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rsadapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapter_contract/test_agent_config.pycrates/fabric-core/src/config.rstests/python/test_sdk_contract.pyadapter-contract/src/nemo_fabric_adapter_contract/models.pypython/src/nemo_fabric/types.pyexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/adapters/test_adapters_common_lifecycle.pytests/adapter_contract/test_agent_execution.pypython/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, thenjust test-python; rebuild withjust build-pythonwhen 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.rscrates/fabric-core/src/schema.rstests/adapters/test_external_nat_adapter.pycrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rsadapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapter_contract/test_agent_config.pycrates/fabric-core/src/config.rstests/python/test_sdk_contract.pyadapter-contract/src/nemo_fabric_adapter_contract/models.pypython/src/nemo_fabric/types.pyexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/adapters/test_adapters_common_lifecycle.pytests/adapter_contract/test_agent_execution.pypython/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 inpython/pyproject.toml.
Files:
crates/fabric-core/src/agent_execution.rscrates/fabric-core/src/schema.rstests/adapters/test_external_nat_adapter.pycrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rsadapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapter_contract/test_agent_config.pycrates/fabric-core/src/config.rstests/python/test_sdk_contract.pyadapter-contract/src/nemo_fabric_adapter_contract/models.pypython/src/nemo_fabric/types.pyexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/adapters/test_adapters_common_lifecycle.pytests/adapter_contract/test_agent_execution.pypython/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.rscrates/fabric-core/src/schema.rstests/adapters/test_external_nat_adapter.pycrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rsadapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapter_contract/test_agent_config.pycrates/fabric-core/src/config.rstests/python/test_sdk_contract.pyadapter-contract/src/nemo_fabric_adapter_contract/models.pypython/src/nemo_fabric/types.pyexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/adapters/test_adapters_common_lifecycle.pytests/adapter_contract/test_agent_execution.pypython/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.rscrates/fabric-core/src/schema.rstests/adapters/test_external_nat_adapter.pycrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rsadapters/common/README.mdexternal/nat/README.mdadapters/common/src/nemo_fabric_adapters/common/lifecycle.pyskills/nemo-fabric-build-adapter/SKILL.mdtests/adapter_contract/test_agent_config.pycrates/fabric-core/src/config.rstests/python/test_sdk_contract.pyadapter-contract/src/nemo_fabric_adapter_contract/models.pypython/src/nemo_fabric/types.pyexternal/nat/src/nemo_fabric_adapters/nat/adapter.pydocs/adapter-contract/execution.mdtests/adapters/test_adapters_common_lifecycle.pytests/adapter_contract/test_agent_execution.pypython/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.rscrates/fabric-core/src/schema.rscrates/fabric-core/src/doctor.rscrates/fabric-core/src/agent_config.rscrates/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.pyadapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapter_contract/test_agent_config.pytests/python/test_sdk_contract.pyadapter-contract/src/nemo_fabric_adapter_contract/models.pypython/src/nemo_fabric/types.pyexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/adapters/test_adapters_common_lifecycle.pytests/adapter_contract/test_agent_execution.pypython/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 undertests/adapters, then runjust test-python.
Files:
tests/adapters/test_external_nat_adapter.pytests/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.pytests/adapter_contract/test_agent_config.pytests/python/test_sdk_contract.pytests/adapters/test_adapters_common_lifecycle.pytests/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.asyncioto tests; async tests are automatically detected by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorAsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
If a fixture is needed in multiple test files, define it once inconftest.pyrather than repeating it.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a<fixture_name>_fixturefunction; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen 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 usingresults["data"]instead ofresults.get("data").
When adapter installation metadata changes, packaging metadata tests must directly assert that the root project depends unconditionally on the exact-versionnemo-fabric-runtimedistribution.
Packaging metadata tests must verify that each root harness extra delegates to the matching version of the leaf adapter'sharnessextra.
Packaging metadata tests must verify that bare leaf dependencies remain adapter-owned and that the rootadapter-testsdependency group installs each leaf through itsharnessextra.
Packaging metadata tests must verify that every leaf providesfull; only adapters importing NeMo Relay Python APIs providerelay, while adapters using an external Relay executable havefullequal toharness.
Files:
tests/adapters/test_external_nat_adapter.pytests/adapter_contract/test_agent_config.pytests/python/test_sdk_contract.pytests/adapters/test_adapters_common_lifecycle.pytests/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.pytests/adapter_contract/test_agent_config.pytests/python/test_sdk_contract.pytests/adapters/test_adapters_common_lifecycle.pytests/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.mdexternal/nat/README.mdskills/nemo-fabric-build-adapter/SKILL.mddocs/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 spellNVIDIAin all caps; do not useNvidia,nvidia, orNV.
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 ashereorread 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.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce, and preferrefer tooverseewhen 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.mdexternal/nat/README.mdskills/nemo-fabric-build-adapter/SKILL.mddocs/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.
Usecanfor possibility and reservemayfor permission; useafterfor temporal order; userefer tofor cross-references; prefer short direct sentences and specific verbs; avoid unnecessarypleasein 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: usefor exampleorsuch asinstead ofe.g.,and so oninstead ofetc.,that isinstead ofi.e.,compared toinstead ofvs., andby,through, orusinginstead ofvia. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Usethatwithout commas for essential clauses, andwhichwith commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such asJune 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space beforea.m.orp.m.; useETandPTfor needed time zones; avoid24/7; and preferfrom 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.mdexternal/nat/README.mdskills/nemo-fabric-build-adapter/SKILL.mddocs/adapter-contract/execution.md
**/*.{md,mdx}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
**/*.{md,mdx}: Use the full product nameNVIDIA NeMo Fabricon first use, typically in the title and H1; useNeMo Fabricthereafter. Usefabricalone 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.
CapitalizeNVIDIAcorrectly 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 ashere, and use repository-relative.mdxpaths for links withindocs/.
Prefer active voice, present tense, short sentences, plain English, consistent terminology, and imperative, parallel, scannable procedures.
Useafterinstead ofoncewhen expressing temporal sequence, and usecanrather thanmaywhen 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 withMust fix,Should fix, andNice to havecategories; include file path, line reference, current problem, rationale, and a concrete rewrite or direction.
Files:
adapters/common/README.mdexternal/nat/README.mdskills/nemo-fabric-build-adapter/SKILL.mddocs/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.mdexternal/nat/README.mdskills/nemo-fabric-build-adapter/SKILL.mddocs/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.mdexternal/nat/README.mdskills/nemo-fabric-build-adapter/SKILL.mddocs/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, andrun, 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.mdadapters/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 lowercasefabricCLI command, package/import/crate names, code identifiers, API symbols, configuration keys, file paths, or unrelated generic uses of the word.
Files:
adapters/common/README.mdexternal/nat/README.mdskills/nemo-fabric-build-adapter/SKILL.mddocs/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.jsonschemas/adapter-contract/agent-run-result.schema.jsonschemas/adapter-contract/agent-config.schema.jsonschemas/run-plan.schema.json
adapters/*/src/**/*.py
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
adapters/*/src/**/*.py: Implement adapters using the existing Fabricpythonorprocessrunner and normalized request/result contracts; do not add a runner or one-off abstraction for a single adapter.
Treat normalizedconfig, Fabric-resolved plans, andruntime_contextas authoritative; reserveharness.settingsfor 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 orderedstart→invoke*→stopoperations. Emit one JSON lifecycle response per request on stdout and diagnostics on stderr.
Return harness-level invocation failures as successful lifecycle responses containingresponse: null,failed: true, and structurederrorfields (code,message,retryable, and optionalmetadata).
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.
Usestartto initialize adapter-owned harness state, retain it for continuation across repeatedinvokecalls on the same runtime, and release it instop.
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.jsonschemas/adapter-contract/agent-config.schema.jsonschemas/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
nameanddescription.
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.pypython/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.pypython/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.pypython/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 docswhen 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.jsonschemas/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.jsonschemas/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.pypython/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 QualityShould fix: Verify the documentation build.
Run
just docswhen 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
848b414 to
2685686
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@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
📒 Files selected for processing (6)
adapter-contract/src/nemo_fabric_adapter_contract/models.pycrates/fabric-core/src/config.rscrates/fabric-core/src/schema.rsexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/adapter_contract/test_agent_config.pytests/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.pycrates/fabric-core/src/schema.rsadapter-contract/src/nemo_fabric_adapter_contract/models.pycrates/fabric-core/src/config.rsexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/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 spellNVIDIAin all caps; do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol afterNVIDIAwhen 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 withNVIDIAon 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.pycrates/fabric-core/src/schema.rsadapter-contract/src/nemo_fabric_adapter_contract/models.pycrates/fabric-core/src/config.rsexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/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_casefor functions and variables; usePascalCasefor Rust types and Python classes.
Files:
tests/adapter_contract/test_agent_config.pycrates/fabric-core/src/schema.rsadapter-contract/src/nemo_fabric_adapter_contract/models.pycrates/fabric-core/src/config.rsexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/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.pyadapter-contract/src/nemo_fabric_adapter_contract/models.pyexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/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 injust test-rustpass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes underschemas/and generated API references.
Files:
tests/adapter_contract/test_agent_config.pycrates/fabric-core/src/schema.rsadapter-contract/src/nemo_fabric_adapter_contract/models.pycrates/fabric-core/src/config.rsexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/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, thenjust test-python; rebuild withjust build-pythonwhen 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.pycrates/fabric-core/src/schema.rsadapter-contract/src/nemo_fabric_adapter_contract/models.pycrates/fabric-core/src/config.rsexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/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 inpython/pyproject.toml.
Files:
tests/adapter_contract/test_agent_config.pycrates/fabric-core/src/schema.rsadapter-contract/src/nemo_fabric_adapter_contract/models.pycrates/fabric-core/src/config.rsexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/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.pycrates/fabric-core/src/schema.rsadapter-contract/src/nemo_fabric_adapter_contract/models.pycrates/fabric-core/src/config.rsexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/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.pycrates/fabric-core/src/schema.rsadapter-contract/src/nemo_fabric_adapter_contract/models.pycrates/fabric-core/src/config.rsexternal/nat/src/nemo_fabric_adapters/nat/adapter.pytests/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.pytests/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.asyncioto tests; async tests are automatically detected by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorAsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
If a fixture is needed in multiple test files, define it once inconftest.pyrather than repeating it.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a<fixture_name>_fixturefunction; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen 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 usingresults["data"]instead ofresults.get("data").
When adapter installation metadata changes, packaging metadata tests must directly assert that the root project depends unconditionally on the exact-versionnemo-fabric-runtimedistribution.
Packaging metadata tests must verify that each root harness extra delegates to the matching version of the leaf adapter'sharnessextra.
Packaging metadata tests must verify that bare leaf dependencies remain adapter-owned and that the rootadapter-testsdependency group installs each leaf through itsharnessextra.
Packaging metadata tests must verify that every leaf providesfull; only adapters importing NeMo Relay Python APIs providerelay, while adapters using an external Relay executable havefullequal toharness.
Files:
tests/adapter_contract/test_agent_config.pytests/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.pytests/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.rscrates/fabric-core/src/config.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
For any Rust change, run
just test-rustandcargo 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 withcargo fmt --all -- --check, and compile withcargo check --workspace --locked.
Files:
crates/fabric-core/src/schema.rscrates/fabric-core/src/config.rs
crates/fabric-core/**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes under
crates/fabric-coremust run both the Rust and Python test suites.
Files:
crates/fabric-core/src/schema.rscrates/fabric-core/src/config.rs
**/*.{rs,rmeta}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Rust code changes, run
cargo fmt --all -- --checkandjust test-rust.
Files:
crates/fabric-core/src/schema.rscrates/fabric-core/src/config.rs
crates/fabric-core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/fabric-corechanges 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.rscrates/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.rscrates/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 undertests/adapters, then runjust 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 & IntegrationKeep the diagnostic compatibility bypass.
validate_configruns first and rejects blank or whitespace-only toolkindandrefvalues.> 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
2685686 to
ee3e151
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@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
📒 Files selected for processing (5)
adapters/common/src/nemo_fabric_adapters/common/lifecycle.pydocs/reference/api/python-library-reference/nemo_fabric.types.mdpython/src/nemo_fabric/types.pytests/adapters/test_adapters_common_lifecycle.pytests/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 docswhen 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 spellNVIDIAin all caps; do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol afterNVIDIAwhen 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 withNVIDIAon 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.mdadapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapters/test_adapters_common_lifecycle.pypython/src/nemo_fabric/types.pytests/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 spellNVIDIAin all caps; do not useNvidia,nvidia, orNV.
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 ashereorread 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.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce, and preferrefer tooverseewhen 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.
Usecanfor possibility and reservemayfor permission; useafterfor temporal order; userefer tofor cross-references; prefer short direct sentences and specific verbs; avoid unnecessarypleasein 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: usefor exampleorsuch asinstead ofe.g.,and so oninstead ofetc.,that isinstead ofi.e.,compared toinstead ofvs., andby,through, orusinginstead ofvia. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Usethatwithout commas for essential clauses, andwhichwith commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such asJune 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space beforea.m.orp.m.; useETandPTfor needed time zones; avoid24/7; and preferfrom 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.mdadapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapters/test_adapters_common_lifecycle.pypython/src/nemo_fabric/types.pytests/python/test_sdk_contract.py
**/*.{md,mdx}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
**/*.{md,mdx}: Use the full product nameNVIDIA NeMo Fabricon first use, typically in the title and H1; useNeMo Fabricthereafter. Usefabricalone 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.
CapitalizeNVIDIAcorrectly 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 ashere, and use repository-relative.mdxpaths for links withindocs/.
Prefer active voice, present tense, short sentences, plain English, consistent terminology, and imperative, parallel, scannable procedures.
Useafterinstead ofoncewhen expressing temporal sequence, and usecanrather thanmaywhen 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 withMust fix,Should fix, andNice to havecategories; 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 lowercasefabricCLI 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.pytests/adapters/test_adapters_common_lifecycle.pypython/src/nemo_fabric/types.pytests/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_casefor functions and variables; usePascalCasefor Rust types and Python classes.
Files:
adapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapters/test_adapters_common_lifecycle.pypython/src/nemo_fabric/types.pytests/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.pytests/adapters/test_adapters_common_lifecycle.pypython/src/nemo_fabric/types.pytests/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 injust test-rustpass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes underschemas/and generated API references.
Files:
adapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapters/test_adapters_common_lifecycle.pypython/src/nemo_fabric/types.pytests/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, thenjust test-python; rebuild withjust build-pythonwhen 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.pytests/adapters/test_adapters_common_lifecycle.pypython/src/nemo_fabric/types.pytests/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 inpython/pyproject.toml.
Files:
adapters/common/src/nemo_fabric_adapters/common/lifecycle.pytests/adapters/test_adapters_common_lifecycle.pypython/src/nemo_fabric/types.pytests/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.pytests/adapters/test_adapters_common_lifecycle.pypython/src/nemo_fabric/types.pytests/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 Fabricpythonorprocessrunner and normalized request/result contracts; do not add a runner or one-off abstraction for a single adapter.
Treat normalizedconfig, Fabric-resolved plans, andruntime_contextas authoritative; reserveharness.settingsfor 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 orderedstart→invoke*→stopoperations. Emit one JSON lifecycle response per request on stdout and diagnostics on stderr.
Return harness-level invocation failures as successful lifecycle responses containingresponse: null,failed: true, and structurederrorfields (code,message,retryable, and optionalmetadata).
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.
Usestartto initialize adapter-owned harness state, retain it for continuation across repeatedinvokecalls on the same runtime, and release it instop.
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 undertests/adapters, then runjust 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.pytests/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.asyncioto tests; async tests are automatically detected by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorAsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
If a fixture is needed in multiple test files, define it once inconftest.pyrather than repeating it.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a<fixture_name>_fixturefunction; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen 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 usingresults["data"]instead ofresults.get("data").
When adapter installation metadata changes, packaging metadata tests must directly assert that the root project depends unconditionally on the exact-versionnemo-fabric-runtimedistribution.
Packaging metadata tests must verify that each root harness extra delegates to the matching version of the leaf adapter'sharnessextra.
Packaging metadata tests must verify that bare leaf dependencies remain adapter-owned and that the rootadapter-testsdependency group installs each leaf through itsharnessextra.
Packaging metadata tests must verify that every leaf providesfull; only adapters importing NeMo Relay Python APIs providerelay, while adapters using an external Relay executable havefullequal toharness.
Files:
tests/adapters/test_adapters_common_lifecycle.pytests/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.pytests/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 QualityShould Fix — Verify Generated API Reference Output.
docs/reference/api/python-library-reference/nemo_fabric.types.mdis generated output. Regenerate this page frompython/src/nemo_fabric/types.pywithjust docsrather than editing it directly.As per coding guidelines, run
just docswhen documentation changes. As per path instructions, files underdocs/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
ee3e151 to
a5a42a2
Compare
a5a42a2 to
ccb6108
Compare
ccb6108 to
8c28d8a
Compare
Hello! Can you explain the purpose of this change?
|
| "type": "object", | ||
| "properties": { | ||
| "kind": { | ||
| "const": "nat_workflow", |
There was a problem hiding this comment.
we want to avoid having a toplevel escape hatch like "nat_workflow"
8c28d8a to
9f3f041
Compare
|
@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 |
9f3f041 to
115bd94
Compare
115bd94 to
85f6232
Compare
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
85f6232 to
0e07c08
Compare
Overview
Addresses the reported typed adapter-contract regressions with narrowly scoped fixes.
Where should the reviewer start?
Start with
crates/fabric-core/src/config.rs,adapters/common/src/nemo_fabric_adapters/common/lifecycle.py, andexternal/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
error: null.Bug Fixes
Documentation