contribute-api
Berkontribusi pada permukaan API publik NeMo Fabric secara aman, dengan mempertimbangkan paritas Rust, CLI, Python, skema, adaptor, dan dokumentasi
npx skills add https://github.com/nvidia/nemo-fabric --skill contribute-apiContribute A New API Surface
Companion Guidance
Use karpathy-guidelines alongside this skill for implementation or review
work. Keep changes scoped, surface assumptions, and define focused validation
before editing.
Use this skill when contributing a public API addition or behavior change to the runtime or bindings.
Default Guidance
- Start from the shared Rust core behavior first
- Decide whether the CLI, PyO3 binding, Python SDK, type stubs, schemas, or the Python and TypeScript adapter-contract bindings must expose the new surface
- Keep every affected public surface in parity
RunRequest.relay_session_rootis forwarded as the typedAgentRunRequest.relay_session_rootfield. Keep Rust, Python, TypeScript, and schema representations in parity. Context keys do not control Relay propagation; preserve the adapter fallback for unusable UUIDs.- OpenShell task commands serialize public SDK config/request/handle/result mappings. Keep forwarding buffered and preserve task-generated IDs, normalized failed results, telemetry references, and declared artifacts. Do not normalize an SDK result as an adapter result. Task paths remain POSIX strings; host artifact destinations stay separate. Unknown outcomes bind the immutable sandbox identity through reattachment and must not be replayed.
- Runtime discovery uses the typed public
Fabric.runtime_status()operation andsdk/runtime-status-reportschema. Keepfabric-agent-ctl statusdelegated to that SDK operation and OpenShell status routed through the existing provider command transport. Preserve recorded lifecycle state separately from health observations, use null handles for stopped records, and exclude environment variables and arbitrary provider metadata from discovery snapshots. Each client caps all runtime records, including pending starts, at 128; evict only stopped records and reject full-capacity starts withruntime_limit_reachedbefore runtime effects. - Hermes and OpenClaw cold resume take an optional
session_refdirectly at runtime start. Omission starts a fresh conversation.runtime.keep_statecontrols retention. Keep SDK, managed commands, and adapter contexts aligned. Native-only Hermes configurations retain state, advertisesession_resume: false, and reject explicit SDK session selection. - Metadata inspection takes canonical descriptors in memory. Python
inspect_adapterreturnsAdapterInspection; consume the nestedcapability_profileonly after checkingissues. Compatibility failures return issues by default (diagnostics=True); supportdiagnostics=Falsefor exception-based rejection. Malformed inputs raise in both modes. Keep startup validation rules shared and preserve malformed-input errors. Inspection and planning share Relay ATIF admission: requested output requires descriptor support and exactly one observability component. - Update docs and examples in the same branch
Minimum Acceptance
- Public behavior is clearly described
- Every affected public surface is covered
- The validation matrix matches the changed surfaces
- PR notes explain the user-facing change
References
-
validate-change -
review-doc-style -
docs/python-sdk-contract.md -
schemas/SCHEMA.md -
justfile -
Software provenance uses
FabricConfig.provenanceand optionalRunResult.execution. Keep Rust, shared Python evidence dataclasses innemo-fabric-evidence, SDK result mappings, generated TypeScript types and the canonicalschemas/evidence/execution-evidence.schema.jsonaligned. The shared schema is generated from Rust and consumed by both NB and SB bindings; keep the TypeScript adapter-contract schema copy byte-identical. Preserve strict adapter result shapes: lifecycle evidence is carried beside the outcome. Optional report failure must not replace invocation outcomes.