feat(runtime): define host-local inference receipts - #8060
Conversation
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 4b75eb4 in the TypeScript / code-coverage/cliThe overall coverage in commit 4b75eb4 in the Show a code coverage summary of the most impacted files.
Updated |
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
PR Review Advisor — InformationalAdvisor assessment: Informational / low confidence Model lanes
Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
apurvvkumaria
left a comment
There was a problem hiding this comment.
Approve — reviewed exact head 4b75eb4. The host-local inference receipt contract is declarative, bounded, and keeps mutation authority outside the receipt layer, with source-shape and behavioral coverage for accepted and rejected states. I found no blocking correctness, security, or compatibility defect. Core exact-head CI is green; the failed advisor lane does not report a demonstrated product breakage.
<!-- markdownlint-disable MD041 --> ## Summary This PR adds the dormant Podman GPU-qualification and inference-command translation boundary for the incremental runtime stack in #7744. It does not register Podman for production selection or advertise user-visible Podman support. ## Changes - Add an operation-scoped `host-local-inference` engine contract so runtime providers can request GPU-qualified execution without a Podman switch in central orchestration. Provider contract and source-shape tests protect this boundary. - Record the exact Podman authority and qualified CDI device inventory during preflight. Qualification now preserves the raw inventory through validation and fails closed on both exact and normalization-equivalent duplicate device identities before any deduplication can hide them. - Translate Docker-compatible inference GPU arguments into Podman CDI device arguments. Unit tests cover `all`, indexed GPUs, GPU UUIDs, MIG devices, container-name filters, and fail-closed rejection of unsupported NVIDIA runtime, duplicate, unqualified, or raw-device options. - Keep the new path dormant. Production provider selection, agent behavior, Docker behavior, and Kubernetes behavior do not change in this slice. ## Advisor disposition - The duplicate-CDI fail-closed finding is fixed at exact head `e74e262c2`; the denial test supplies the same canonical CDI identity from both endpoint inventory and the separately qualified inventory and proves qualification rejects it. - The dormant-translator suggestion is intentionally not applied in this slice. Epic #7744 defines this review unit as the inert GPU/translation contract; stacked PR #8061 supplies its named, operation-scoped host-local inference provider consumer. Production activation remains owned by the later qualification slice after every agent, GPU/local inference path, recovery path, and protected E2E pass. Removing the contract here or adding a central Podman switch would defeat that incremental, pluggable stack design. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: This slice adds an internal, dormant provider contract and does not activate or document a supported surface. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Independent exact-head review verified fail-closed CDI identity, endpoint authority, provider-neutral operation scope, and dormant production selection. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Advisor Disposition - Earlier PRA-1, which found duplicate CDI identities lost before normalization, is resolved by d4622df. Endpoint-reported and additional identities now remain in one raw array until normalizePodmanCdiInventory rejects normalized duplicates; the focused test covers both prefixed and shorthand collisions. - Earlier PRA-2, now published as the PRA-1 dormant-consumer suggestion, is explicitly retained for the maintainer-approved incremental stack. Wiring production here would violate the dormant review thesis for this slice and bypass the receipt authority that lands in #8060. Stacked #8061 is the named production-bound provider consumer and adds provider-level contract tests for qualified CDI devices. Current central selection still excludes Podman, and the source-shape test rejects Podman switches in central orchestration. ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `no-docs-needed` - Evidence: Independent review of the exact 13-file slice at e74e262 against base baa495a, WRITING.md, the controlled word list, and docs/CONTRIBUTING.md found no documentation update required. CURRENT_RUNTIME_PROVIDER_BUNDLES still contains only Docker and Kubernetes, the Podman provider still reports hostLocalInference false, and user-visible Podman support remains inactive. The duplicate-CDI repair collects endpoint and additional device identities before normalization and rejects normalized duplicates. Stable patch ID 681a1e01ee7d6328fef26c359ef7b75b88301c9e and binary diff SHA-256 4fc440a2a439e604553eb24aba928dbd507ec5558cfa8d31383795c49eb4098d bind the receipt. CLI build and typecheck, 97 focused CLI tests, 2 source-shape tests, repository checks, and git diff --check passed. - Agent: Codex Desktop <!-- docs-review-head-sha: e74e262 --> <!-- docs-review-agents-blob-sha: 3dd7c24 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: Not applicable; this slice remains dormant and protected runtime qualification is owned by the activation slice. - Station profile/scenario: Not applicable. - Result: Not applicable. - Supporting evidence: Not applicable. ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run validate:pr` passed after refreshing `origin/main` when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: At exact head e74e262 on base baa495a, six focused CLI files passed 97 tests; the runtime-provider source-shape file passed 2 tests; npm run build:cli, npm run typecheck:cli, npm run checks:repository, and git diff --check passed. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Exact-head CI and protected E2E are running. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Aaron Erickson <aerickson@nvidia.com> --------- Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Reconstructs B4-D of #7744 on current `main` and consolidates the former 4.5A–4.5D review slices into one dormant provider-owned Podman GPU and host-local inference batch. Ollama, NVIDIA NIM, and vLLM now share exact operation authority, durable secret-free lifecycle receipts, and provider-neutral `inference.local` startup integration for OpenClaw, Hermes, and LangChain Deep Agents Code. Podman remains absent from production registration and support claims. ## Related Issue Refs #7744. Consolidates the reviewed source intent from #8059, #8060, #8061, and #8066 into this existing PR. ## Changes - Bind each host-local inference operation to the exact Podman executable and safe parent chain, socket endpoint, server authority, provider-owned network, and physical NVIDIA CDI UUID inventory. Revalidation rejects executable, endpoint, CDI, launch-spec, or authority drift before mutation. - Translate only the bounded Podman inference command surface. The translator rejects Docker-named helper execution, raw mounts, host IPC, `--rm`, ambiguous GPU requests, mutable images, and secret-bearing argv. - Add canonical secret-free Ollama, NIM, and vLLM receipts bound to provider, engine, endpoint, immutable images, runtime identity, launch digest, CDI authority, provider-native HTTP/inference proof, and publication transaction. - Add fail-closed start, inspect, stop, preserve, resume, interrupted recovery, rollback, and destroy behavior through an injected runtime provider. Evidence is redacted before fallback or rollback; missing, reused, ambiguous, or indeterminate cleanup identity is rejected. - Route the three agents through the same `https://inference.local/v1` application contract while direct provider proof uses the inspected provider gateway. Startup and policy tests cover success, drift, rollback, stopped/running restoration, cleanup ambiguity, recovery, route allow/deny, and cross-engine exclusion. - Preserve only the two bounded OpenClaw continuity fields needed to prevent `missing-meta-vs-last-good` rollback; backup routes, providers, credentials, and arbitrary metadata never cross into the regenerated managed config. - Preserve Docker behavior and the socket-free MXC-style provider seam. `CURRENT_RUNTIME_PROVIDER_BUNDLES` remains Docker/Kubernetes only, the production host-local resolver remains null, and hidden `--temp-managed-runtime` behavior remains default-off and undocumented. The operation-scoped provider-owned selection is carried through the provider inference handler and all three startup flows, with current-provider null-path regressions. Per #7744's 4.5C/4.5D boundary, the production root intentionally injects no Podman selection in B4-D; durable ownership follows in B4-E and production Podman registration remains reserved for 4.6D. ## Reconstruction Safety - The original PR and donor heads were preserved before reconstruction under `backup/b4d-20260811/*` refs. - The public branch update is a fast-forward from the preserved #8061 head; no commit was rewritten and no force push was used. - Current `main` is included through signed merge commits, and the B4-D patch was reconstructed path-by-path instead of cherry-picking stale cross-cutting donors. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: Podman remains dormant, unregistered, default-off, and intentionally undocumented; no supported product workflow changes. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Independent exact-tree architecture and security audits found no P0/P1/P2 issue. They verified credential redaction, exact endpoint/CDI/executable authority, evidence-before-rollback ordering, cleanup fail-closed behavior, Docker/current-provider preservation, and dormant registration. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `no-docs-needed` - Evidence: Codex Desktop reviewed the complete 57-file exact diff for `a4fbaf82e` against `06ac446dd` after reconciling #8724 review recovery. The diff changes dormant injected Podman paths and internal OpenClaw continuity metadata only; production registration remains Docker/Kubernetes, and no documented command, flag, default, configuration, or supported workflow changes. - Agent: Codex Desktop <!-- docs-review-head-sha: a4fbaf8 --> <!-- docs-review-agents-blob-sha: c4923a3 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: Protected exact-head E2E pending. - Station profile/scenario: Podman physical NVIDIA CDI and local-inference qualification. - Result: Pending protected workflow evidence; no local synthetic result is claimed. - Supporting evidence: Pending exact-head workflow URL. ## Verification - [x] PR description includes a `Signed-off-by:` line and every newly published reconstruction commit appears as `Verified` in GitHub (`valid`). - [x] Pre-commit and pre-push hooks passed. Local whole-range commitlint additionally reports one preserved historical donor `style(...)` commit; the PR title conforms and GitHub's commit-lint workflow validates the title. - [x] Targeted behavior tests pass for the current change set — the prior B4-D changed-file suite passed 444 tests; the exact continuity fix additionally passed its 8-test regression file, all 128 generator tests, and 57 managed-startup tests. Typechecks, repository checks, catalog checks, test-structure gates, Biome, pre-commit, and pre-push hooks pass. - [x] Exact-head post-#8724 reconciliation passes 250 focused CLI tests across 14 files. The affected integration set passed 132/133 in the host environment; the sole Homebrew trust leak reproduced on exact base, and the isolated test passed on both head and base with host Homebrew excluded from `PATH`. Both typechecks, repository architecture checks, test size/title gates, Biome, diff hygiene, and pre-commit/pre-push hooks pass. Exact-head CodeRabbit found an assertion typing weakness; the shared mocks now use the real dependency signatures and the negative checks inspect strongly typed call tuples without casts. The four affected handler files pass 78 tests, and CLI typecheck passes on `a4fbaf82e`. After integrating current main, canonical catalog generation plus the merged-tree CLI set pass 132 tests; adjacent Docker authority, Ollama cleanup, vLLM catalog, platform, runner, and dispatch integration passes 143 tests, with both typechecks green. - [ ] Applicable broad gate passed — exact-head canonical CI, Advisor, CodeRabbit, managed-image/startup lanes, and protected E2E are pending. The local all-project run was non-diagnostic under host oversubscription; relevant failures passed serially, including the current-provider integration with Homebrew excluded from the child `PATH`. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [x] `npm run docs:prepare && npm run docs:validate` passed with zero errors and two standard Fern warnings. - [ ] Doc pages follow the style guide (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) Additional exact-head local gates: CLI build, standard and strict CLI typechecks, repository checks, config/catalog validation, source-shape budget, test-size budget, semantic E2E phase coverage (125 tests across 81 files), Biome, gitleaks, and docs validation. ## Exact Slice Identity - Head: `a4fbaf82e618c6f09afa30033560cb19c9be6b85` - Base: `06ac446ddaa8f4ebd790da463757f3ffd52a764b` - Delta: 57 files, +13,010/-344 --- Signed-off-by: Aaron Erickson <aerickson@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added host-local inference support for Ollama, NIM, and vLLM through managed Podman runtimes. * Added startup recovery, resume, rollback, canonical routing, GPU support, and provider-neutral inference checks. * Added secure, operation-scoped environment forwarding. * Preserved valid OpenClaw version metadata during configuration regeneration. * **Bug Fixes** * Prevented stale local-inference policies and unauthorized direct host access. * Detects executable, endpoint, runtime, network, GPU, and configuration changes. * Improved rollback, cleanup verification, redaction, and fail-closed behavior. * OpenClaw health checks now accept authenticated responses. * Fixed recovery for containers caught in restart loops. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Aaron Erickson <aerickson@nvidia.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> Co-authored-by: Apurv Kumaria <akumaria@nvidia.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Julie Yaunches <jyaunches@nvidia.com>
Summary
This PR adds a provider-neutral durable receipt contract for host-local Ollama, NVIDIA NIM, and vLLM inference. The contract remains dormant and does not activate Podman or any user-visible inference path.
Changes
The lifecycle command interface and provider implementation intentionally remain outside this receipt-only slice. They are introduced with their first consumer in stacked PR #8061.
Type of Change
Quality Gates
4b75eb4af615060a535c9354f17096109fa2fa93.Documentation Writer Review
no-docs-neededDGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpm test -- --run src/lib/onboard/runtime-provider/host-local-inference.test.ts test/runtime-provider-source-shape.test.tspassed 9/9 tests on4b75eb4af615060a535c9354f17096109fa2fa93.npm run build:cli,npm run typecheck:cli, andnpm run checks:repositorypassed on the exact head.npm run docsbuilds without warnings (doc changes only)Exact Slice Identity
4b75eb4af615060a535c9354f17096109fa2fa93e74e262c28f514bc9e782b157c2c2549a710ad8c1def8b6763adaaf86faec8bc90f60184fbf9dbd2e03b55f97e2f5f713252106de7f04320353345dd08c9d4464f1664c7e18ea5e3Advisor Disposition
Signed-off-by: Aaron Erickson aerickson@nvidia.com