fix(onboard): harden managed startup contracts - #7973
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>
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>
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>
Preserve the exact reviewed tree while moving the stacked base to merged PR3.3. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Preserve the exact reviewed tree while moving the stacked base to restacked PR3.4a. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Preserve the exact reviewed tree while moving the stacked base to restacked PR3.4b. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Carry the reviewed PR3.4b slice unchanged onto the CodeRabbit feedback fix for PR3.4a. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Carry the reviewed PR3.5 slice unchanged onto the CodeRabbit feedback restack through PR3.4b. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Carry the reviewed PR3.4b slice unchanged onto the serialized PR3.4a transaction contract. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Carry the reviewed PR3.5 slice unchanged onto the serialized PR3.4a transaction contract. The review patch remains unchanged through PR3.4b. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Restack PR3.4b without changing its review patch. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Restack PR3.5 without changing its review patch. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
There was a problem hiding this comment.
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 `@test/e2e/support/e2e-runtime-matrix.test.ts`:
- Around line 331-338: Update RuntimeReadinessEvidence to be a discriminated
union permitting both ready: true and ready: false variants, preserving the
existing evidence fields as appropriate. Then update
provider.environment.prepare in the runtime matrix test to return the unready
result directly and remove the as unknown as RuntimeReadinessEvidence assertion.
🪄 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: 0c339b23-f6d4-43cf-b5b9-9284e6a79e2c
📒 Files selected for processing (30)
ci/source-architecture-budget.jsonsrc/lib/actions/inference-set-provider.tssrc/lib/actions/inference-set.tssrc/lib/actions/sandbox/destroy-execution.tssrc/lib/actions/sandbox/destroy-flow.test.tssrc/lib/actions/sandbox/destroy.tssrc/lib/actions/sandbox/snapshot-restore-test-fixture.tssrc/lib/actions/sandbox/snapshot.test.tssrc/lib/actions/sandbox/snapshot.tssrc/lib/actions/sandbox/start.test.tssrc/lib/actions/sandbox/start.tssrc/lib/actions/sandbox/stop.test.tssrc/lib/onboard/managed-startup/onboard-profile.tssrc/lib/onboard/managed-startup/profile-builder.tssrc/lib/onboard/managed-startup/profile.tssrc/lib/onboard/runtime-provider/docker.tssrc/lib/onboard/runtime-provider/runtime-provider-contract.test.tssrc/lib/state/registry/persistence.tssrc/lib/state/registry/types.tssrc/lib/state/registry/workload.tstest/e2e/docs/README.mdtest/e2e/fixtures/e2e-test.tstest/e2e/fixtures/runtime-provider.tstest/e2e/support/e2e-parity-evidence.test.tstest/e2e/support/e2e-runtime-foundation-types.test.tstest/e2e/support/e2e-runtime-matrix.test.tstest/helpers/runtime-provider-bundle.tstest/image-cleanup.test.tstest/registry.test.tstest/runtime-provider-source-shape.test.ts
💤 Files with no reviewable changes (2)
- test/e2e/fixtures/e2e-test.ts
- src/lib/onboard/managed-startup/profile.ts
🚧 Files skipped from review as they are similar to previous changes (20)
- src/lib/actions/sandbox/snapshot.test.ts
- src/lib/actions/sandbox/stop.test.ts
- src/lib/actions/inference-set-provider.ts
- src/lib/actions/inference-set.ts
- src/lib/actions/sandbox/start.ts
- test/runtime-provider-source-shape.test.ts
- src/lib/state/registry/types.ts
- src/lib/onboard/managed-startup/profile-builder.ts
- src/lib/state/registry/workload.ts
- src/lib/actions/sandbox/snapshot-restore-test-fixture.ts
- test/e2e/support/e2e-runtime-foundation-types.test.ts
- src/lib/actions/sandbox/start.test.ts
- src/lib/onboard/runtime-provider/runtime-provider-contract.test.ts
- src/lib/actions/sandbox/destroy-flow.test.ts
- src/lib/onboard/runtime-provider/docker.ts
- src/lib/onboard/managed-startup/onboard-profile.ts
- src/lib/actions/sandbox/destroy-execution.ts
- test/e2e/fixtures/runtime-provider.ts
- src/lib/actions/sandbox/destroy.ts
- test/e2e/docs/README.md
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
Exact-head automated-review dispositionHead: All actionable CodeRabbit review threads are fixed, replied to with exact commit evidence, and resolved. This includes runtime readiness, mismatch cleanup for both identities, non-tautological parity coverage, current persisted provider identity, absent-registry handling, bounded Docker image removal, immutable-support assertions, the fixture cleanup block plan, and spy restoration. The later readiness-type finding is fixed by the The outside-diff major finding about silently dropping invalid workload receipts is fixed in Safe same-surface suggestions were adopted: inference mutation converts only provider-selection errors; start removes a non-null assertion; managed receipt versions are literal; managed repository validation derives from the canonical repository set; provider source-shape assertions name the source; agent capability tables own validation; proxy inputs are named by protocol; and unsupported lifecycle tests assert that no side effect runs. The remaining non-actionable suggestions are explicitly dispositioned:
No actionable automated-review finding remains at the time of this comment. New exact-head automated results will still be reviewed before merge. Security reviewCodex Desktop reviewed the complete exact-head diff. This is an agent review, not a human review.
No security finding remains. No hardware review is claimed. |
|
Exact-head automated-review disposition addendum for |
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
|
PR Review Advisor PRA-1 is addressed in 236d7e5. The new snapshot restore lifecycle regression forces the post-delete registry-removal outcome to |
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
|
PR Review Advisor PRA-1 from head |
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
|
Exact-head follow-up for |
<!-- markdownlint-disable MD041 --> ## Summary Adds the canonical dated changelog entry for `v0.0.100` so the maintainer release plan can verify the pre-tag documentation prerequisite. The entry summarizes the user-facing changes merged since `v0.0.99` and links to the relevant guides. ## Changes - Add `docs/changelog/2026-07-31.mdx` with the exact `## v0.0.100` heading. - Cover restored OpenClaw pairing, transactional replacement, Deep Agents Code, onboarding recovery, lifecycle cleanup, Hermes builds, host provenance, documentation, and trusted E2E evidence. - Distinguish active Docker and Kubernetes runtime-bundle enforcement from the still-inactive managed shared-state transaction foundation. ## Source Coverage The release entry maps the doc-impacting merged PRs in the `v0.0.99..main` release range to `docs/changelog/2026-07-31.mdx`: #8021, #8024, #7973, #8028, #7947, #7788, #7884, #8023, #7969, #8020, #7989, #8000, #7907, #7942, #7567, #8013, #7955, #8017, #8014, #8015, #7629, #7644, #7821, #7971, and #7991. PR #7974 was reviewed after the final rebase and excluded because it changes internal maintainer-skill attribution policy and tests only; it does not change a user-facing product or documentation surface. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [x] Existing tests cover changed behavior — justification: the changelog contract test validates the dated entry, version heading, SPDX form, and route constraints. - [ ] Tests not applicable — justification: - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] 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: `docs-updated` - Evidence: `docs/changelog/2026-07-31.mdx`; exact-head review passed for `6093f44f`; writing rules and documentation style reviewed; `npx vitest run test/changelog-docs.test.ts` passed 6/6; `npm run docs` passed with zero Fern errors and two generic Fern upgrade notices. - Agent: Codex Desktop <!-- docs-review-head-sha: 6093f44 --> <!-- docs-review-agents-blob-sha: 3dd7c24 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: Not applicable; no DGX Station host script changed. - 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: `npx vitest run test/changelog-docs.test.ts` passed 6/6 at `6093f44f`. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Not applicable to a dated prose-only release entry. - [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) — validation passed with zero errors; Fern emitted two generic upgrade notices. - [x] 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) — the changelog entry has the required parser-safe MDX SPDX header; dated changelog entries intentionally do not use page frontmatter. --- Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added release notes for v0.0.100. * Documented improvements to restore pairing, sandbox replacement, onboarding recovery, lifecycle cleanup, runtime handling, build support, host readiness, and end-to-end validation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Adds the inert, provider-neutral managed-workload rebuild transaction for the incremental buildless stack. The exact old workload and registry row remain authoritative through replacement preparation, readiness, state restore, and provider rebind. Only one exact compare-and-swap publishes the replacement, and old-runtime retirement happens afterward through provider-owned opaque handles. This slice does not wire a production rebuild caller or activate buildless onboarding. Snapshot/backup and durable recovery ownership remain tracked in #7744 and are required before activation. ## Related Issue Part of #7744 ## Changes - Capture a deep-frozen rebuild plan bound to the exact provider, shipped agent, platform, prior managed receipt, full durable-row revision, lifecycle generation, and live identity fingerprint. - Pre-render and validate the exact replacement image, startup profile, receipt, and safe metadata before provider mutation. - Define provider-neutral prepare, create, readiness, restore, provider-rebind, rollback, abort-preparation, and retire-previous phases using opaque exact handles rather than sandbox-name deletion. - Keep partial prepare/create cleanup transaction-idempotent and run abort cleanup even when post-prepare registry revalidation throws. - Publish only through exact old-authority CAS; reconcile ambiguous persistence against either the exact replacement or exact old row. - Preserve the staged replacement and return an immutable recovery task when publication is indeterminate, avoiding rollback of a replacement that may already be durable. - Retire the exact old runtime only after publication; return a durable-owner recovery task if retirement remains pending. - Bind replacement contracts and startup profiles to OpenClaw, Hermes, or DCode authority and reject provider, agent, platform, receipt, generation, or identity drift. - Reject malformed provider artifacts at every transition, stop before later phases, and prove exact transaction abort or exact staged-handle rollback. - Document the shared backup boundary and the durable recovery ownership tracked in #7744 before activation. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [x] 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: The transaction is inert with no production caller or support claim; the internal README records ownership boundaries for later slices. - [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: Exact-head audit covers immutable authority, pre-mutation validation, CAS ambiguity, abort cleanup, exact-handle rollback, and deferred recovery ownership. - [ ] 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: `docs-updated` - Evidence: The reviewed 23-file, `+4,272/-0` slice remains byte-identical after the append-only current-main refresh to `0de2789608a86e580d787991e81c03c5f0b14dbf` through `e97ecce48c7fcc1dfb398e1cfae8c81a859b7dcd`; stable patch ID remains `dd1c4a899fd9a62954a00d4e2e61da445a306e03`. The only documentation path is `src/lib/onboard/managed-workload/rebuild/README.md`. It accurately states that the transaction is dormant, has no CLI command or production-action importer, and does not activate buildless rebuilds. It assigns ambiguous publication and pending retirement to durable recovery, links recovery and snapshot/backup ownership to the live accepted epic #7744, and requires normalized backup manifests, restore validation, durable reconciliation, and protected qualification for OpenClaw, Hermes, and LangChain Deep Agents Code before activation. Production-import and command/action diff scans found no activation caller. Markdownlint passed with zero issues on the exact refreshed head. The append-only parent refresh to `362a70cda` preserves the exact reviewed slice diff and changes no reviewed documentation. - Agent: Codex Desktop <!-- docs-review-head-sha: 362a70c --> <!-- docs-review-agents-blob-sha: 3dd7c24 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification - Exact locally validated head/base: `e97ecce48c7fcc1dfb398e1cfae8c81a859b7dcd` / `0de2789608a86e580d787991e81c03c5f0b14dbf` - Review budget: 23 files, `+4,272/-0`. - Stable exact-slice patch ID: `dd1c4a899fd9a62954a00d4e2e61da445a306e03`. - [x] The six implementation/review commits and both maintainer refresh commits are SSH-signed and contain DCO trailers; GitHub-generated conflict-resolution merge commits preserve append-only branch history. - [x] `npm run validate:pr` passed on the exact clean head with Node 22.16.0. - [x] 132 focused rebuild transaction, workload authority, registry CAS, and source-boundary tests passed again on the exact refreshed head; CLI typecheck and repository checks also passed; changed test files add zero `if` statements. - [x] `npm run build:cli`, CLI typecheck through `validate:pr`, exact-base pre-commit, commitlint, and pre-push gates passed. - [x] Failure tests prove prepare/create ambiguity aborts exact transaction resources, staged failures roll back only exact staging authority, and indeterminate CAS never rolls back. - [x] Agent-binding tests reject cross-agent image/profile drift for all shipped managed-image agents. - [x] No snapshot manifest dependency, production rebuild callsite, runtime selection change, or public activation exists in this slice. - [ ] Applicable broad gate passed — exact-head required CI, advisors, CodeRabbit, multiarch, and protected E2E are the broad remote gates. ## Stack - Base: live `main` at `0de2789608a86e580d787991e81c03c5f0b14dbf`; PR3.1 through PR3.6 content is already landed, with #7976, #7988, and #7990 carried once through the final #7973 aggregate tree. - This slice: PR3.7 branch `feat/managed-workload-rebuild-parity` at `e97ecce48c7fcc1dfb398e1cfae8c81a859b7dcd`. - Epic #7744 tracks shared snapshot, backup, restore, and durable recovery ownership before activation. - Buildless support remains disabled until OpenClaw, Hermes, and DCode plus required multiarch and protected qualification pass together. 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 managed workload rebuild workflows with staged replacement, validation, rollback, recovery, and atomic commit handling. * Added authority validation for managed workloads, including receipt, image, platform, and startup configuration checks. * Added safe cloning and deep-freezing for supported immutable data. * Added safeguards against stale, conflicting, or incomplete workload state during rebuilds. * **Documentation** * Documented rebuild recovery behavior and activation requirements. * **Tests** * Added comprehensive coverage for rebuild transactions, authority validation, rollback, persistence reconciliation, and immutable data handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Aaron Erickson <aerickson@nvidia.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
Introduces the dormant provider-neutral runtime bundle and cross-runtime E2E foundation required by #7744 while preserving the currently shipped Docker and Kubernetes behavior. Runtime mutation and cleanup now fail closed when durable provider or workload authority cannot be proved, and the managed-startup, messaging, registry, and evidence boundaries reject ambiguous state before mutation.
Related Issue
Part of #7744. The accepted issue plan independently defines this slice's ownership, lifecycle, compatibility, security, and validation scope; GitHub merge state was not used as product approval.
Changes
runtime-provider-contract.test.tsandruntime-provider-source-shape.test.tsprotect the single-bundle contract and fail-closed authority boundary.test/e2e/docs/README.mdto document the inert foundation and artifact-redaction boundary without claiming production support.Type of Change
Quality Gates
047c5dcf316093204ccbde0a1af25d6d2b11b1a5; all nine repository security-review categories passed with no actionable finding. The final production fix narrows destructive cleanup by revalidating authority under the destination lock, and the subsequent test-only rewrite preserves that proof without adding conditional-growth debt. This is an agent review, not a human review.Documentation Writer Review
docs-updatedtest/e2e/docs/README.md; the reviewer confirmed the scenario, profile, matrix, provider-fixture, parity-evidence, non-dispatch, and artifact-redaction claims against the exact source, and confirmed the lock-bound authority recheck preserves the documented force-restore workflow.DGX 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 testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result: Local broad validation was attempted under task-local Node.js 22.19.0 and pinned Python dependencies. The unchanged Hermes forward-watcher host fixture did not pass locally; exact-head required GitHub checks remain the merge gate.npm run docsbuilds without warnings (doc changes only) — command exited successfully; Fern reported two warnings, so this stricter checkbox is not claimed.Exact-State Evidence
047c5dcf316093204ccbde0a1af25d6d2b11b1a5upstream/mainatffc1ae6f438a0a16f37a184b4e6198dacf9223aaafd4f65e7b51ec790ff11b4c34b829ee0548fb77incorporates currentupstream/mainwithout conflict or PR-scope change.APPROVED; existing approvals are preserved under maintainer direction, and no new approval is requested.scripts/prepare-dgx-station-host.shis unchanged. No hardware review is claimed.Signed-off-by: Aaron Erickson aerickson@nvidia.com
Signed-off-by: Senthil Ravichandran senthilr@nvidia.com