fix(onboard): harden managed bootstrap ownership and recovery - #8225
Conversation
Reconstruct the net #8077 terminal-outcome slice on current main. Signed-off-by: Aaron Erickson <aerickson@nvidia.com> (cherry picked from commit ce6f313e9f7705aa9374c0184710ca995dafdfa8)
Reconstruct the net #8078 shared-state authority slice on current main. Signed-off-by: Aaron Erickson <aerickson@nvidia.com> (cherry picked from commit 31236f767aa79c9e110be55bc1bf56b5396b227a)
Reconstruct the net #8080 journal-compatibility slice on current main. Signed-off-by: Aaron Erickson <aerickson@nvidia.com> (cherry picked from commit c52370db1119ec1b8f3365a0ce4c22beebdd28e4)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughManaged bootstrap now coordinates terminal commit and rollback outcomes, validates receipts and legacy manifests, strengthens Docker shared-state rollback authority, validates replacement images, and propagates sandbox commit failures. ChangesManaged bootstrap lifecycle
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant DockerRuntime
participant TerminalFinalizer
participant FinalizeSequence
participant SharedStateRollback
DockerRuntime->>TerminalFinalizer: claim commit or rollback
TerminalFinalizer->>FinalizeSequence: finalize claimed outcome
FinalizeSequence->>SharedStateRollback: inspect status or restore state
SharedStateRollback-->>FinalizeSequence: receipt result or failure
FinalizeSequence-->>DockerRuntime: resolve or reject finalization
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit b3973ce in the TypeScript / code-coverage/cliThe overall coverage in commit b3973ce in the Show a code coverage summary of the most impacted files.
Updated |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/onboard/docker-gpu-sandbox-create.ts`:
- Around line 383-391: Preserve terminal commit failures in commitAfterReady so
duplicate calls remain rejected: update the early-commit failure path in
src/lib/onboard/docker-gpu-sandbox-create.ts lines 383-391 and the
backup-removal failure path in lines 429-446 to retain failed state after
throwing, then extend
src/lib/onboard/docker-gpu-sandbox-create-lifecycle.test.ts lines 162-162 to
call commitAfterReady again after backup removal failure and assert rejection,
and lines 180-205 to do the same after early rollback.
In `@src/lib/onboard/managed-bootstrap/docker-shared-state.ts`:
- Around line 631-641: In
src/lib/onboard/managed-bootstrap/docker-shared-state.ts lines 631-641, capture
the boolean returned by rollbackManagedStartupSharedState() in both failure
branches and call removeFailedUnbackedContainer() only when that result is
false, while preserving the existing patchResult and
retainContainerAfterRollback checks. In
src/lib/onboard/managed-bootstrap/docker-shared-state-rollback-authority.test.ts
lines 159-249, add assertions that dockerRm is not called after pending-receipt
rollback and in the default non-retained failed-commit path.
🪄 Autofix
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: da664ccb-b7a8-4c88-ace1-0cf917ac9e59
📒 Files selected for processing (26)
src/lib/onboard/docker-gpu-local-inference.test.tssrc/lib/onboard/docker-gpu-local-inference.tssrc/lib/onboard/docker-gpu-sandbox-create-lifecycle.test.tssrc/lib/onboard/docker-gpu-sandbox-create.tssrc/lib/onboard/docker-startup-command-sandbox-create.test.tssrc/lib/onboard/managed-bootstrap/README.mdsrc/lib/onboard/managed-bootstrap/adapter.test.tssrc/lib/onboard/managed-bootstrap/adapter.tssrc/lib/onboard/managed-bootstrap/docker-journal.test.tssrc/lib/onboard/managed-bootstrap/docker-journal.tssrc/lib/onboard/managed-bootstrap/docker-runtime.test.tssrc/lib/onboard/managed-bootstrap/docker-runtime.tssrc/lib/onboard/managed-bootstrap/docker-shared-state-rollback-authority.test.tssrc/lib/onboard/managed-bootstrap/docker-shared-state.test.tssrc/lib/onboard/managed-bootstrap/docker-shared-state.tssrc/lib/onboard/managed-bootstrap/docker-test-fixture.tssrc/lib/onboard/managed-bootstrap/docker.test.tssrc/lib/onboard/managed-bootstrap/docker.tssrc/lib/onboard/managed-bootstrap/index.tssrc/lib/onboard/managed-bootstrap/managed-bootstrap-test-fixture.tssrc/lib/onboard/managed-bootstrap/runtime-create.test.tssrc/lib/onboard/managed-bootstrap/runtime-create.tssrc/lib/onboard/managed-startup-shared-state-transaction.test.tssrc/lib/onboard/managed-startup/shared-state-transaction.tssrc/lib/onboard/sandbox-create-launch.tstest/runtime-provider-source-shape.test.ts
💤 Files with no reviewable changes (1)
- src/lib/onboard/managed-bootstrap/docker-journal.ts
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
6 terminology differences from the second opinionAdvisory only. These are normalized differences from the primary terminology receipt.
2 additional E2E selections from the second opinionAdvisory only. The primary lane did not select these E2E jobs or targets.
Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate. 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
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>
## Summary Hardens managed-image publication evidence and adds the trusted protected multi-architecture qualification lane while keeping it fail-closed and inert. This is the consolidated B3-B batch stacked on #8225; it does not add the activation marker, select the lane for candidate changes, or advertise buildless support. ## Related Issue Refs #7744 Depends on #8225. ## Changes - Pass bounded reviewed Git pathspec families directly and keep publication assertions semantic. - Share the complete OpenClaw, Hermes, and DCode base-image contract export through one fail-closed helper. - Define the exact all-agent `linux/amd64` and `linux/arm64` protected build, platform-digest, cohort, and evidence contracts. - Add the trusted protected workflow graph and direct-start harness for both architectures. - Keep risk selection limited to the absent future `ci/protected-managed-image-multiarch-activation-v1.json` marker, so this candidate cannot select or execute its own newly introduced trusted lane. - Keep the dormant lane out of the release E2E denominator until its exact candidate activation path exists, using a generic workflow-declared activation contract rather than a lane-specific release switch. - Preserve source heads under `backup/podman-stack/pr8065-source-2860766e`, `backup/podman-stack/pr8065-public-head-eea54e92`, `backup/podman-stack/pr8068-source-2060e9cc`, `backup/podman-stack/pr8075-source-5976d9d0`, and `backup/podman-stack/pr3-14b2a-source-c9a92ae7`. The shared publication and protected-lane contracts are required by all three managed-image consumers. Per-agent workflow copies or candidate-authored dispatch would allow schema drift or weaken the trusted-main boundary. The managed base-contract, publication workflow, protected contract, risk-plan, direct-input, workflow-boundary, release-evidence, and publication-support tests protect the shared seam. ## Type of Change - [ ] 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: - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [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: Maintainer-authored B3-B scope under #7744; exact-head advisors, CodeRabbit, CI, and protected workflow review must still clear before merge. - [ ] 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: Updated `.agents/skills/nemoclaw-maintainer-cut-release-tag/SKILL.md` and `.agents/skills/nemoclaw-maintainer-policies/references/release-train.md`. Both now define that `RELEASE_E2E_ACTIVATION_PATH` admits an explicit-only job and its matrix executions into the release denominator only when the exact relative path exists at the candidate SHA. They consistently direct maintainers not to dispatch or require evidence for a dormant lane. - Agent: Codex Desktop <!-- docs-review-head-sha: b166aeb --> <!-- docs-review-agents-blob-sha: 3dd7c24 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## 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: Focused image, workflow, release, parity, and policy tests passed 172/172; the final release-policy subset passed 30/30 at `b166aebdd`. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Authoritative sharded CI is pending for the exact head. - [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) - [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) --- 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 protected multi-architecture startup validation for managed images on AMD64 and ARM64. * Added verified image contracts, digest-pinned base images, and agent-specific contract publication. * Added stricter managed base-image index and workflow validation. * **Bug Fixes** * Dormant release E2E jobs are excluded when activation markers are missing. * Strengthened release evidence, dispatch validation, and workflow integrity checks. * **Tests** * Added coverage for image contracts, activation gating, multi-architecture startup, and release preflight behavior. <!-- 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
Hardens the dormant managed-bootstrap path so create outcomes are explicit, shared-state rollback remains transaction-owned, and recovery receipts replay durably across runtime providers. This consolidates the additive source work from #8077, #8078, #8080, and the already-incorporated behavior from #8083 without registering or activating a managed runtime.
Related Issue
Refs #7744
Changes
backup/podman-stack/pr8077-source-83e7fe53,backup/podman-stack/pr8078-source-9d4dc59c,backup/podman-stack/pr8080-source-9096a968, andbackup/podman-stack/pr8083-source-a2ae901b.The adapter contract is currently required by managed-bootstrap journal and runtime construction consumers. A Docker-local change is insufficient because later Podman and MXC-style providers must compare the same durable receipts without central runtime switches. The managed-bootstrap adapter, runtime, journal, shared-state, and source-shape tests protect that boundary.
Type of Change
Quality Gates
Documentation Writer Review
docs-updatedsrc/lib/onboard/managed-bootstrap/README.md. The managed-bootstrap provider remains unregistered and unsupported in production, so no user-facingdocs/change is required.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 unavailableb3973cebb50d.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result: Localnpm testwas attempted and encountered widespread unrelated five-second timeouts across existing installer, package-contract, rebuild, inference, and policy tests; authoritative sharded CI is pending.npm run docsbuilds without warnings (doc changes only)Signed-off-by: Aaron Erickson aerickson@nvidia.com
Summary by CodeRabbit
Bug Fixes
Compatibility
Reliability