Skip to content

feat(runtime): persist host-local inference ownership - #8069

Draft
ericksoa wants to merge 11 commits into
feat/host-local-inference-routing-integrationfrom
feat/host-local-inference-durable-lifecycle
Draft

feat(runtime): persist host-local inference ownership#8069
ericksoa wants to merge 11 commits into
feat/host-local-inference-routing-integrationfrom
feat/host-local-inference-durable-lifecycle

Conversation

@ericksoa

@ericksoa ericksoa commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This draft persists canonical provider-neutral host-local inference ownership through onboarding and registry state for OpenClaw, Hermes, and Deep Agents Code. Snapshot and runtime-retirement behavior remains in the following lifecycle slice; production Podman selection stays dormant.

Changes

  • Persist a complete host-local inference receipt and validate the full secret-free schema on every durable read and write.
  • Reject arbitrary canonical JSON, incomplete receipts, unknown fields, and credential-like payloads at the registry boundary.
  • Reserve the proved receipt with the inference route and carry it through sandbox registration.
  • Preserve an existing receipt during same-name recreate while explicit null clears ownership; cover both paths directly.
  • Cover durable round trips, rejection, reservation, registration carry, and all-agent routing.
  • Exclude provider-owned inference-route receipts from the source registry fingerprint while proving the durable receipt remains present; route reservation changes must not invalidate same-source recreate authority.
  • Supply the durable receipt consumed and re-proved by stacked lifecycle PR feat(runtime): complete host-local inference lifecycle #8076.

Quality Gates

  • Tests added or updated for changed behavior
  • Docs not applicable: no user-visible runtime selection changes
  • Sensitive paths changed
  • Exact-head advisor, CI, and protected E2E refresh completed

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: pending exact-head refresh
  • Evidence: review requested for exact head 990a5f5634d3df19c7d60b96e0e4b8c438936f20; pending exact-head review.
  • Agent: Codex Desktop

Verification

  • Signed commits and DCO
  • Focused registry/onboarding suite: 7 files, 124 tests passed; the appended source-fingerprint regression proves host-local route ownership remains durable while recreate authority stays stable
  • CLI typecheck, repository checks, growth guard, and normal commit/push hooks passed
  • Exact-head GitHub qualification is running

Exact head: 990a5f5634d3df19c7d60b96e0e4b8c438936f20. Stable base-relative patch ID: e1e6e6798d7ca05c285798918afad402f08c3177.


Signed-off-by: Aaron Erickson aerickson@nvidia.com

Summary by CodeRabbit

  • New Features

    • Host-local inference receipts are now stored with sandbox reservations and registry entries.
    • Valid receipts are preserved across registration, persistence, and route updates.
    • Explicit receipt clearing is supported.
  • Bug Fixes

    • Invalid, malformed, oversized, or non-canonical receipts are rejected.
    • Receipt updates no longer alter sandbox registry fingerprints.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Host-local inference setup now serializes receipts and stores them with reserved sandbox routes. Registry registration, normalization, loading, and saving validate and preserve canonical receipts. Route fingerprints exclude the receipt. Tests cover transport, preservation, clearing, and malformed values.

Changes

Host-local inference receipt transport

Layer / File(s) Summary
Receipt contract and canonicalization
src/lib/state/registry/types.ts, src/lib/state/registry/host-local-inference.ts, test/helpers/host-local-inference-receipt.ts, src/lib/state/registry/host-local-inference.test.ts
The sandbox entry stores an optional receipt. The registry canonicalizes valid serialized receipts and rejects invalid, incomplete, secret-bearing, or oversized values.
Registry transport and persistence
src/lib/state/registry.ts, src/lib/state/registry/persistence.ts, test/registry.test.ts
Registration and route reservation persist receipts. Runtime normalization and disk serialization validate receipts and retain canonical values.
Onboarding propagation and preservation
src/lib/onboard/setup-inference.ts, src/lib/onboard/sandbox-registration.ts, src/lib/onboard/sandbox-recreate-transaction.ts, test/onboard-host-local-inference-routing.test.ts, src/lib/onboard/*test.ts
Host-local setup serializes receipts after route preparation. Registration preserves existing receipts, supports explicit clearing, and excludes receipts from registry fingerprints. Routing tests verify stored receipt fields.

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

Suggested labels: feature, area: inference, area: onboarding, area: routing

Suggested reviewers: cv

Sequence Diagram(s)

sequenceDiagram
  participant HostLocalSetup
  participant RouteReservation
  participant SandboxRegistry
  participant RegistryPersistence
  HostLocalSetup->>HostLocalSetup: prepare and serialize host-local route receipt
  HostLocalSetup->>RouteReservation: submit route reservation with receipt
  RouteReservation->>SandboxRegistry: store receipt on sandbox entry
  SandboxRegistry->>RegistryPersistence: validate and serialize registry entry
  RegistryPersistence-->>SandboxRegistry: load canonical receipt
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: persisting host-local inference ownership through runtime state.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/host-local-inference-durable-lifecycle

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 990a5f5 in the feat/host-local-infe... branch remains at 96%, unchanged from commit d5b64a7 in the feat/host-local-infe... branch.

Show a code coverage summary of the most impacted files.
File feat/host-local-infe... d5b64a7 feat/host-local-infe... 990a5f5 +/-
nemoclaw/src/se...ntial-filter.ts 100% 0% -100%
nemoclaw/src/sh...er-boundary.cts 95% 0% -95%
nemoclaw/src/se...ot-sanitizer.ts 95% 0% -95%
nemoclaw/src/co...test-fixture.ts 81% 0% -81%
nemoclaw/src/co...ration-state.ts 93% 94% +1%

TypeScript / code-coverage/cli

The overall coverage in commit 990a5f5 in the feat/host-local-infe... branch remains at 81%, unchanged from commit d5b64a7 in the feat/host-local-infe... branch.

Show a code coverage summary of the most impacted files.
File feat/host-local-infe... d5b64a7 feat/host-local-infe... 990a5f5 +/-
src/lib/onboard...trap/adapter.ts 0% 63% +63%
src/lib/onboard...strap/docker.ts 0% 64% +64%
src/lib/onboard...ne-lifecycle.ts 0% 83% +83%
src/lib/onboard...cker-journal.ts 0% 83% +83%
src/lib/onboard...al-inference.ts 0% 85% +85%
src/lib/onboard...trap-journal.ts 0% 86% +86%
src/lib/actions...ne-providers.ts 0% 86% +86%
src/lib/onboard...-replacement.ts 0% 87% +87%
src/lib/onboard...-transaction.ts 0% 88% +88%
src/lib/onboard...test-fixture.ts 0% 96% +96%

Updated August 02, 2026 18:59 UTC

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · medium confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized terminology decisions differ; normalized E2E selections differ; severity counts match.
2 terminology differences from the second opinion

Advisory only. These are normalized differences from the primary terminology receipt.

  • host-local inference receipt at src/lib/state/registry.ts:119: selected only by the second-opinion lane as justified.
  • canonical provider-neutral receipt at src/lib/state/registry/types.ts:128: selected only by the second-opinion lane as justified.
6 additional E2E selections from the second opinion

Advisory only. The primary lane did not select these E2E jobs or targets.

  • ubuntu-repo-cloud-openclaw: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • ubuntu-repo-cloud-langchain-deepagents-code: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • ubuntu-repo-docker-post-reboot-recovery: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • ubuntu-policy-custom-missing-presets-negative: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • vllm-docker-storage: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • ollama-auth-proxy: The completed second-opinion lane identified E2E coverage that the primary lane omitted.

Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate.

2 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • established — host-local inference receipt at src/lib/onboard/sandbox-registration.ts:192: Keep the established term for registry transport and validation.
  • justified — provider-neutral receipt at src/lib/state/registry/types.ts:128: Keep the modifier because it distinguishes the shared receipt schema from provider-specific runtime logic.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: inference-routing, network-policy, onboard-repair, onboard-resume, cloud-onboard

Workflow run details

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>
@ericksoa ericksoa changed the title feat(runtime): persist host-local inference lifecycle authority feat(runtime): persist host-local inference ownership Aug 2, 2026
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>
@ericksoa

ericksoa commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@src/lib/state/registry.ts`:
- Line 234: Update the same-name route reservation handling around
hostLocalInferenceReceipt so an omitted field is not converted to null; only
overwrite the existing receipt when the route provides a string or explicit
null, allowing the existing spread to retain prior values. Add a regression test
covering an existing receipt followed by a reservation without
hostLocalInferenceReceipt, and verify the receipt remains available to
registerCreatedSandbox().
🪄 Autofix (Beta)

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: CHILL

Plan: Enterprise

Run ID: a69a50a1-ff56-467c-b4fa-d114f9138c8e

📥 Commits

Reviewing files that changed from the base of the PR and between b588f8b and ddb5feb.

📒 Files selected for processing (13)
  • src/lib/onboard/sandbox-recreate-transaction.test.ts
  • src/lib/onboard/sandbox-recreate-transaction.ts
  • src/lib/onboard/sandbox-registration.test.ts
  • src/lib/onboard/sandbox-registration.ts
  • src/lib/onboard/setup-inference.ts
  • src/lib/state/registry.ts
  • src/lib/state/registry/host-local-inference.test.ts
  • src/lib/state/registry/host-local-inference.ts
  • src/lib/state/registry/persistence.ts
  • src/lib/state/registry/types.ts
  • test/helpers/host-local-inference-receipt.ts
  • test/onboard-host-local-inference-routing.test.ts
  • test/registry.test.ts

Comment thread src/lib/state/registry.ts Outdated
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed commit 990a5f5634 in bottom-up stack order. This PR depends on #8066, which is not approval-ready. This ownership layer is still a draft and therefore cannot serve as an accepted base for qualification work. Review remains blocked until the parent is reconstructed or repaired, this branch is restacked on the accepted parent commit, and current CI, security, and documentation evidence passes for the resulting commit. No approval is granted for the current branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants