fix: generate references for published packages#378
Conversation
Signed-off-by: Will Killian <wkillian@nvidia.com>
WalkthroughThe Python reference generator now handles multiple packages with package-scoped URLs, output paths, discovery, and generation flow. The Rust reference script expands its crate set dynamically. A docs redirect was added for the moved Python path. ChangesPython Library Reference Multi-Package Refactor
Rust Crate Registry Expansion
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Will Killian <2007799+willkill07@users.noreply.github.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/docs/generate_rust_library_reference.py (1)
23-38: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winUpdate stale downstream crate list text in
fern_cleanup.py.
CRATESnow includes 8 crates, butscripts/docs/fern_cleanup.py'sSUPPORT_API_REFERENCE_TEXTstill hardcodes only 4:nemo-relay,nemo-relay-adaptive,nemo-relay-pii-redaction,nemo-relay-ffi. That static doc text will now be inaccurate/stale relative to the generated reference.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/docs/generate_rust_library_reference.py` around lines 23 - 38, The downstream API reference text is stale because the hardcoded crate list no longer matches the full CRATES tuple used by generate_rust_library_reference.py. Update the support/reference text in fern_cleanup.py to derive or mirror the same crate set from CRATES, so it stays aligned with the generated Rust library reference and includes all eight crates instead of only the original four.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@scripts/docs/generate_rust_library_reference.py`:
- Around line 23-38: The downstream API reference text is stale because the
hardcoded crate list no longer matches the full CRATES tuple used by
generate_rust_library_reference.py. Update the support/reference text in
fern_cleanup.py to derive or mirror the same crate set from CRATES, so it stays
aligned with the generated Rust library reference and includes all eight crates
instead of only the original four.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 5faafd34-c6f1-434a-b756-98b8e79a5922
📒 Files selected for processing (3)
fern/docs.ymlscripts/docs/generate_python_library_reference.pyscripts/docs/generate_rust_library_reference.py
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
- GitHub Check: Check / Run
- GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (9)
{README.md,docs/**/*.{md,rst,txt},fern/**/*}
📄 CodeRabbit inference engine (.agents/skills/prepare-code-freeze/SKILL.md)
Search and update documentation source for references to the old version in
README.md,docs, andferndirectories, updating current-version install commands, package examples, and configuration examples to<next-version>
Files:
fern/docs.yml
**/*.{rs,py,js,ts,mjs,c,h,md,toml,yml,yaml,sh,json,go}
📄 CodeRabbit inference engine (AGENTS.md)
Keep SPDX headers on source files, documentation, scripts, and configuration files.
Files:
fern/docs.ymlscripts/docs/generate_rust_library_reference.pyscripts/docs/generate_python_library_reference.py
**/*.{rs,py,go,js,ts,jsx,tsx,md,mdx,toml,yaml,yml,html}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
All source files must include an SPDX license header using the comment syntax appropriate for the file type, with SPDX-FileCopyrightText for 2026 NVIDIA CORPORATION & AFFILIATES and SPDX-License-Identifier: Apache-2.0.
Files:
fern/docs.ymlscripts/docs/generate_rust_library_reference.pyscripts/docs/generate_python_library_reference.py
**/*.{rs,py,go,js,ts,md,mdx,toml,yaml,yml,json}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Avoid using
SONAR_IGNORE_START/SONAR_IGNORE_ENDexcept for documented false positives; keep the ignored block small, add a brief explanatory comment, and call it out in the PR description.
Files:
fern/docs.ymlscripts/docs/generate_rust_library_reference.pyscripts/docs/generate_python_library_reference.py
**
⚙️ CodeRabbit configuration file
**:AGENTS.md
This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.
Project Overview
NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go and the raw C FFI are experimental and source-first.
The shared runtime model is:
- Scope stacks decide where work belongs and which scope-local behavior is visible.
- Middleware registries decide what guardrails and intercepts run around managed calls.
- Plugins install reusable runtime behavior from configuration.
- Events record runtime behavior in ATOF form.
- Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.
Repository Structure
The repository layout separates the Rust runtime, language bindings,
documentation, integrations, and agent-facing skills.crates/ core/ # Rust core runtime crate, published as nemo-relay adaptive/ # Adaptive runtime primitives and plugin components python/ # PyO3 native extension for the Python package ffi/ # Raw C ABI layer used by downstream bindings such as Go node/ # NAPI Node.js binding and JavaScript/TypeScript entry points python/ nemo_relay/ # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers tests/ # Python tests go/ nemo_relay/ # Experimental Go CGo binding and tests fern/ # Fern documentation site scripts/ # Stable wrappers and helper scripts; build/test/docs entry points live in justfile skills/ # Published Codex/agent skills for NeMo Relay usage patternsPrerequisites
Insta...
Files:
fern/docs.ymlscripts/docs/generate_rust_library_reference.pyscripts/docs/generate_python_library_reference.py
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Follow Python naming conventions, including
snake_caseidentifiers and wrapper module API shapes.When changing the Python wrapper package, tests, or docs tooling, follow Ruff rules
E,F,W, andI, format with Ruff formatter (line length 120, double quotes), and satisfytytype checking.
Files:
scripts/docs/generate_rust_library_reference.pyscripts/docs/generate_python_library_reference.py
**/*.{rs,py,go,js,ts}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use the naming conventions appropriate to each language: Rust
snake_case, C FFI exports prefixednemo_relay_, GoPascalCase, Node.jscamelCase, and Pythonsnake_case.
Files:
scripts/docs/generate_rust_library_reference.pyscripts/docs/generate_python_library_reference.py
**/*.{rs,py,go,js,ts,wasm}
📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)
Ensure binding-native wrappers expose the same observability configuration knobs and lifecycle behavior across Rust, Python, Go, Node.js, and WebAssembly.
Files:
scripts/docs/generate_rust_library_reference.pyscripts/docs/generate_python_library_reference.py
{.github/**,.gitlab-ci.yml,.pre-commit-config.yaml,justfile,scripts/**}
⚙️ CodeRabbit configuration file
{.github/**,.gitlab-ci.yml,.pre-commit-config.yaml,justfile,scripts/**}: Review automation changes for reproducibility, pinned versions where appropriate, secret handling, and consistency with the documented validation matrix.
Pay attention to commands that need generated native artifacts, FFI libraries, or platform-specific environment variables.
Files:
scripts/docs/generate_rust_library_reference.pyscripts/docs/generate_python_library_reference.py
🪛 Ruff (0.15.20)
scripts/docs/generate_python_library_reference.py
[warning] 378-378: Use list.extend to create a transformed list
(PERF401)
[warning] 382-382: Too many branches (14 > 12)
(PLR0912)
[warning] 437-437: Avoid specifying long messages outside the exception class
(TRY003)
🔇 Additional comments (8)
scripts/docs/generate_rust_library_reference.py (1)
164-164: LGTM!scripts/docs/generate_python_library_reference.py (6)
19-44: LGTM!
63-87: LGTM!
241-302: LGTM!
324-346: LGTM!
353-369: 🩺 Stability & AvailabilityVerify package-root pages don't collide on
position.Every package's top-level module is the sole member of its parent group
(_package_slug(module.package),), so each package root receivesposition == 1. If Fern orders the package sections in the sidebar bypositionfrontmatter, two package roots sharing1can produce nondeterministic ordering. Confirm ordering is stable (e.g., driven by the landing-page list order rather thanposition).
432-457: 🩺 Stability & AvailabilityNo issue: the docs recipe already runs the generator from the repository root.
just docsanddocs-api-referencecdto$NEMO_RELAY_REPO_ROOTbefore invokingscripts/docs/generate_python_library_reference.py, and CI runs those recipes fromsource-checkout.> Likely an incorrect or invalid review comment.fern/docs.yml (1)
23-24: LGTM!
Overview
Generate complete API references for published NeMo Relay Rust crates and Python packages.
Details
nemo-relayandnemo-relay-plugin; the latter renders its public worker SDK symbols.Where should the reviewer start?
Start with
scripts/docs/generate_python_library_reference.pyandscripts/docs/generate_rust_library_reference.py, which declare the generated package and crate surfaces.Validation:
just docs;uv run pre-commit run --all-files.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
pii-redactionPython reference path now routes to the correctnemo-relaydestination.