fix(onboard): preserve shared-state commit authority - #8078
Conversation
Accept only the exact historical schema-v1 manifest for legacy null-identity recovery. Fence Docker rollback with the existing host-visible durable receipt probe. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Append the exact #8077 head without rewriting the validated feedback slice. The slice patch relative to the new base remains unchanged. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
📝 WalkthroughWalkthroughThe change adds canonical parsing for identity-free schema-v1 manifests and strengthens Docker shared-state rollback handling. Rollback now checks transaction status, protects commit receipts, and avoids reverting durable commits. Tests cover both behaviors. ChangesShared-state transactions
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ReplacementContainer
participant ProtectedHostReceipt
participant SharedStateTransaction
ReplacementContainer->>ProtectedHostReceipt: Copy writable-layer commit receipt
ReplacementContainer->>SharedStateTransaction: Probe transaction status
alt committed transaction
SharedStateTransaction-->>ReplacementContainer: Report durable commit
ReplacementContainer-->>ReplacementContainer: Reject rollback
else pending transaction
ReplacementContainer->>SharedStateTransaction: Invoke rollback with receipt
SharedStateTransaction-->>ReplacementContainer: Restore shared state
end
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 9d4dc59 in the TypeScript / code-coverage/cliThe overall coverage in commit 9d4dc59 in the Show a code coverage summary of the most impacted files.
Updated |
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. 3 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>
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/onboard/managed-bootstrap/docker-shared-state.test.ts (1)
109-166: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAdd coverage for the commit-failure rollback path that reuses a preserved receipt.
This suite covers
supervisorReady: falsewith a committed state and with a pending state. It does not coversupervisorReady: truefollowed by a commit failure. That path callsrollbackManagedStartupSharedStatewith a non-undefinedpreservedReceiptPath(docker-shared-state.tsLine 620). This is the specific mechanism this PR introduces to avoid re-copying the receipt and to still recheck the durable-commit status before restoring.Add a test that drives
finalizeDockerManagedStartupSharedStatewithsupervisorReady: true, makes the logical commit validation fail after the receipt is copied, and asserts that:
- rollback proceeds using the already-copied receipt (no second
cpfrom the pending-transaction path), and- rollback still throws if the container reports
"committed"on the re-probe, instead of silently restoring stale state.🤖 Prompt for 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. In `@src/lib/onboard/managed-bootstrap/docker-shared-state.test.ts` around lines 109 - 166, Extend the Docker shared-state rollback tests with a supervisorReady: true scenario where logical commit validation fails after the receipt is copied. Configure the fixture to report committed during the rollback re-probe, then assert finalizeDockerManagedStartupSharedState throws the durable-commit error, rollback uses the preserved receipt without a second pending-transaction copy, and the expected rollback/status commands and events are recorded.
🤖 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.
Nitpick comments:
In `@src/lib/onboard/managed-bootstrap/docker-shared-state.test.ts`:
- Around line 109-166: Extend the Docker shared-state rollback tests with a
supervisorReady: true scenario where logical commit validation fails after the
receipt is copied. Configure the fixture to report committed during the rollback
re-probe, then assert finalizeDockerManagedStartupSharedState throws the
durable-commit error, rollback uses the preserved receipt without a second
pending-transaction copy, and the expected rollback/status commands and events
are recorded.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 440e9c95-f650-4310-96a1-706708b1ba72
📒 Files selected for processing (5)
src/lib/onboard/managed-bootstrap/README.mdsrc/lib/onboard/managed-bootstrap/docker-shared-state.test.tssrc/lib/onboard/managed-bootstrap/docker-shared-state.tssrc/lib/onboard/managed-startup-shared-state-transaction.test.tssrc/lib/onboard/managed-startup/shared-state-transaction.ts
Advance onto the exact append-only #8077 head after its lifecycle composition test. The parent-relative shared-state patch remains unchanged. Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
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 9d4dc59. Shared-state publication retains single-writer commit authority and rejects stale or mismatched transactions, with focused transaction and Docker shared-state coverage. I found no blocking security or correctness regression. The inherited npm dependency failure and pending coordination signal are not evidence of a defect in this delta.
## 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 - Return terminal managed-bootstrap outcomes and preserve explicit rollback evidence through Docker sandbox creation. - Keep application environment and shared-state rollback authority inside the managed-startup transaction, including environment-neutral status and rollback probes. - Move receipt comparison into the provider-neutral adapter, validate pre-journal snapshot identity, and retain exact atomic leftovers for durable replay. - Add focused lifecycle, transaction, compatibility, replay, and source-shape coverage while keeping the candidate provider inert. - Preserve the donor heads under `backup/podman-stack/pr8077-source-83e7fe53`, `backup/podman-stack/pr8078-source-9d4dc59c`, `backup/podman-stack/pr8080-source-9096a968`, and `backup/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 - [ ] 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: No user-visible provider is registered or activated in this additive slice; the internal managed-bootstrap README documents the architecture change. - [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 implementation scope under #7744; the provider remains inert and repository advisors must still clear the exact head 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 `src/lib/onboard/managed-bootstrap/README.md`. The managed-bootstrap provider remains unregistered and unsupported in production, so no user-facing `docs/` change is required. - Agent: Codex Desktop <!-- docs-review-head-sha: b3973ce --> <!-- 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: Targeted Vitest run covering all 12 changed test files passed 175/175 tests at `b3973cebb50d`. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Local `npm test` was attempted and encountered widespread unrelated five-second timeouts across existing installer, package-contract, rebuild, inference, and policy tests; authoritative sharded CI is pending. - [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> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Commit and rollback failures now surface reliably instead of being silently ignored. * Improved recovery when runtime finalization or supervisor reconnection fails. * Prevented mismatched container images from advancing through setup. * Strengthened rollback protection after a commit becomes durable. * **Compatibility** * Added support for valid legacy transaction manifests while rejecting malformed or incomplete data. * **Reliability** * Repeated commit or rollback requests now produce consistent results, including after acknowledgement failures. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
|
Superseded by clean consolidated replacement #8225, now merged. The donor head remains preserved under backup/podman-stack/pr8078-source-9d4dc59c. |
Summary
Recover the exact historical shared-state manifest without weakening identity-bound bootstrap, and fence Docker rollback with durable commit authority copied from the owning container. This prevents a restarted or failed managed bootstrap from rolling back state that already committed while preserving the legacy null-identity path.
Related Issue
Part of #7744.
Stack Position
83e7fe53a05619bfc5c1401701ec844bbde818d99d4dc59c331aca42f4ead7bc8831db61d1deee0ecfaa19326c2bec368ac0ecc4870f20164d48c37dChanges
bootstrapIdentity, and map it to null identity solely for the legacy unbound path.--volumes-fromexposes the replacement writable-layer/var/libreceipt.supervisorReady: truecommit-failure path: preserve exactly one available pending receipt, reuse that host copy for rollback, and reject rollback or container removal when the quiesced replacement re-probes as committed.The compatibility path is required because pre-
bootstrapIdentityschema-v1 manifests can remain on disk during upgrade. A direct current-schema-only parse would strand valid legacy rollback state, while treating every missing identity as current authority would be unsafe.managed-startup-shared-state-transaction.test.tsprotects the exact historical shape and rejection boundary;docker-shared-state.test.tsprotects the host-copy commit fence.Type of Change
Quality Gates
Documentation Writer Review
docs-updatedsrc/lib/onboard/managed-bootstrap/README.mddocuments exact legacy null-identity schema-v1 acceptance, rejection of extra/missing/identity-bound adoption, and the Docker protected host-copy boundary required because--volumes-fromcannot expose the replacement writable layer. Independent review found the wording complete and architecturally consistent with the exact implementation diff.DGX Station Hardware Evidence
Verification
9d4dc59c331aca42f4ead7bc8831db61d1deee0eis signed-DCO and GitHub Verified on exact fix(onboard): claim bootstrap terminal outcomes #8077 base83e7fe53a05619bfc5c1401701ec844bbde818d9; the stable parent-relative slice patch remainscfaa19326c2bec368ac0ecc4870f20164d48c37dat 5 files, +423/-28. Fresh exact-head CI, advisors, CodeRabbit, managed-image builds, and protected E2E are running.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 unavailableifstatements. The earlier advisor remediation adds the missing no-authority cleanup regression. The current implementation adds preserved-receipt reuse and committed-on-reprobe rollback-fence coverage; the focused Docker shared-state suite passes (5/5), together with Biome, CLI type-checking, repository checks, the exact test-conditional scan, commit hooks, and pre-push gates. The refreshed exact head additionally passes both affected suites, 30/30 tests, CLI typecheck,git diff --check, and the normal pre-push TypeScript/version gates.npm run docsbuilds without warnings (doc changes only)Signed-off-by: Aaron Erickson aerickson@nvidia.com
Summary by CodeRabbit