Skip to content

feat(onboard): define dormant transactional managed bootstrap - #8036

Merged
ericksoa merged 169 commits into
mainfrom
feat/managed-bootstrap-protocol
Aug 3, 2026
Merged

feat(onboard): define dormant transactional managed bootstrap#8036
ericksoa merged 169 commits into
mainfrom
feat/managed-bootstrap-protocol

Conversation

@ericksoa

@ericksoa ericksoa commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Defines the dormant, provider-neutral transaction and image bootstrap boundary
for managed-image workloads. Preparation remains non-destructive; activation is
authorized only by immutable provider, sandbox, image, startup-profile,
supervisor, and transaction receipts.

This is internal groundwork only. No production onboarding path imports it, no
runtime becomes selectable, and no partial buildless, Docker, Podman, or MXC
support is advertised.

Related Issue

Part of #7744

Changes

  • Define exact bootstrap plan, prepared bootstrap replacement, activation, commit,
    rollback, cleanup, and completion-receipt contracts.
  • Require a validated Ready receipt with the exact materialized sandbox identity
    before an incomplete createHeldWorkload call becomes cleanup-eligible.
  • Bind envelope, completion, cleanup, and rollback authority to immutable image,
    profile, shared-state, bootstrap, sandbox, and supervisor identities.
  • Keep the coordinator driver-neutral and exercise OpenClaw, Hermes, and
    LangChain Deep Agents Code through an MXC-named fake provider.
  • Add a freestanding Linux amd64/arm64 native entrypoint with no ELF interpreter,
    dynamic section, undefined runtime symbol, or C-library startup.
  • Carry the complete supervisor environment through a bounded, sealed memfd
    instead of argv; close that descriptor for application/verification helpers
    and mark it close-on-exec before the long-lived supervisor starts.
  • Preserve exact environment order, duplicate assignments, GPU and local
    inference settings, loader/shell process controls, and supervisor argv only at
    the final supervisor execve.
  • Add hostile-control, all-agent, restart/tamper, exact-environment, descriptor,
    and count/entry/aggregate-boundary tests.
  • Keep every registered runtime provider bootstrap-unsupported and all native
    assets out of production compilation, packaging, and selection.

Type of Change

  • 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

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: The internal protocol README is
    updated, but this dormant slice changes no user-facing behavior or support
    claim.
  • 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: Independent review covered native
    pre-loader isolation, environment secrecy in argv/helpers, memfd sealing and
    bounds, exact environment restoration, helper descriptor containment,
    close-on-exec, all-agent behavior, immutable identity binding, rollback, and
    exact cleanup authority.
  • Non-success, skipped, or missing CI check accepted by maintainer — check
    name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: src/lib/onboard/managed-bootstrap/README.md documents the dormant driver-neutral protocol, rollback and exact-cleanup ownership, packaging dormancy, all-agent scope, and deferred activation tracked by [Epic] Support native Podman with buildless managed onboarding #7744; the final exact-head commits add only regression tests for failed-preparation retry cleanup, independent discovery-versus-inspection disagreement, and branchless exact-ownership cleanup, plus a shared test authority-key helper; they do not change user-visible behavior or support claims.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • Exact locally validated head/base:
    0c91e0b98871b4001ebf3d51aed7c2f4b47696f9 /
    4cd4d64fe67143b57707f874afa0b9d269dfeff2.
  • Review budget: 11 files, +4,307/-2.
  • Stable patch ID: fd914f4150efb33d7d7afffabc1e91beb7dba60a.
  • Raw binary-diff SHA-256:
    bcef7150982f7f66d9e0dcb6937bb8cfc8f14583366f585ac2fcfec90ba97cbe.
  • Current-main append-only restack: signed+DCO merge 1155c1f9a has protected
    fix parent e9bdd6d45 and exact-main parent 4cd4d64fe; the managed-bootstrap
    blobs were unchanged by the merge.
  • Protocol, envelope, trampoline, and source-boundary suites passed 45 tests
    on the exact current-main head; the 9 native-Linux cases were expected skips
    on macOS.
  • Native Linux arm64 managed-bootstrap qualification passed 9/9, including
    all agents, hostile loader/shell controls, exact environment restoration,
    sealed-descriptor attacks, restart/tamper, and every configured bound.
  • Independent amd64 toolchain builds produced static x86-64 executables with
    no interpreter, dynamic section, or undefined symbols. Local emulated amd64
    behavioral qualification was inconclusive because the emulator/compiler
    signaled; native amd64 CI remains mandatory and the exactness test was not
    weakened.
  • npm run validate:pr, CLI typecheck, source-shape and test-size budgets,
    repository/config checks, shellcheck, Markdown lint, secret scan, DCO, and
    git diff --check passed on the exact head.
  • Every appended commit is SSH-signed, DCO-compliant, and GitHub Verified.
  • Production import and packaging guards prove the protocol remains dormant
    with no central Docker, Podman, or MXC switch.
  • Applicable broad gate passed — exact-head native CI, both advisors,
    CodeRabbit, and protected E2E remain the remote qualification gates.

Maintainer Architectural Disposition

The dormant coordinator is an intentional sequencing boundary. Wiring it now
would activate a partial runtime before provider, image, rollback, recovery,
GPU/local-inference, multiarch, installer, and protected-E2E support are
complete. Removing it would make the first concrete provider define central
transaction semantics and undermine MXC/runtime pluggability.

This sequencing is a binding acceptance criterion from epic #7744 and the
maintainer-approved incremental stack. #8037 is the immediate provider-specific
source consumer of this contract and also remains inert. The advisor suggestion
to wire this slice directly into production or remove it is therefore explicitly
dispositioned as non-applicable: either action would violate the one-thesis slice
boundary or activate partial runtime support before qualification.

Production source-shape tests therefore require onboarding to remain
disconnected, registered providers to remain bootstrap-unsupported, and native
assets to remain unpackaged. A later complete provider/image/rollback slice must
replace those assertions with all-agent registered-provider and protected-E2E
qualification.

Risk Plan

  • Primary risk: inherited root process controls execute before validation, the
    complete supervisor environment leaks through argv/helpers, destructive
    activation occurs before durable identity, or cleanup targets a reused name.
  • Containment: freestanding startup precedes any dynamic loader; exact state is
    carried in a sealed bounded descriptor; helpers cannot inherit it; activation
    requires immutable authority; cleanup requires the exact Ready sandbox ID.
  • Regression risk: accidental production import or packaging could enable an
    incomplete runtime path. Source-shape tests fail on either change.
  • Rollback: revert this dormant contract slice; no production runtime selects
    it.

Stack

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

Summary by CodeRabbit

  • New Features

    • Added a secure, provider-neutral managed bootstrap workflow with validated requests, identity tracking, activation, completion, rollback, and cleanup.
    • Preserved supervisor arguments and environment data during bootstrap and restart operations.
    • Added canonical request and completion message handling with schema, size, and integrity validation.
  • Security

    • Added protections against tampered metadata, unsafe environment variables, malformed inputs, unsupported agents, and unauthorized activation.
  • Documentation

    • Documented the bootstrap protocol, lifecycle, validation rules, and current platform limitations.
  • Tests

    • Added extensive coverage for transactions, serialization, failures, rollback, environment handling, and Linux startup behavior.

ericksoa added 30 commits July 30, 2026 14:50
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>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@ericksoa I will review the current head f22358b3874ee4b345d84acd1552992e17c172c8.

✅ 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: 3

🧹 Nitpick comments (1)
test/managed-bootstrap-trampoline.test.ts (1)

202-223: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the nullability guards around hostileLoader.

hostileLoader returns a non-optional object. Every call site still treats the result as nullable: loader?.library ?? "" at Line 626, ...(loader ? {...} : {}) at Lines 360-366 and 741-746, and loader && fs.existsSync(...) at Lines 375-376 and 754-755. These branches never take the null path, so they add no coverage. Line 755 is the clearest case: expect(loader && fs.existsSync(loader.afterTrace)).toBe(loader ? true : null) reduces to expect(existsSync(afterTrace)).toBe(true).

The risk is that a future change to the helper silently turns strict assertions into vacuous ones. Assert the outcomes directly.

♻️ Proposed simplification
-      expect(loader && fs.existsSync(loader.earlyTrace)).not.toBe(true);
-      expect(loader && fs.existsSync(loader.afterTrace)).toBe(loader ? true : null);
+      expect(fs.existsSync(loader.earlyTrace)).toBe(false);
+      expect(fs.existsSync(loader.afterTrace)).toBe(true);

Apply the same direct form at Lines 375-376, and replace the conditional spreads with plain properties.

As per path instructions: "Flag copied production algorithms, broad mocks that bypass the behavior under test, and conditionals that make a test pass without exercising its claim."

🤖 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 `@test/managed-bootstrap-trampoline.test.ts` around lines 202 - 223, Remove
nullability checks for the non-optional result of hostileLoader. Update all call
sites to access loader.library, loader.afterTrace, and loader.earlyTrace
directly, replace conditional spreads with unconditional properties, and assert
fs.existsSync results directly without loader-dependent expectations.

Source: Path instructions

🤖 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 `@scripts/managed-bootstrap-entrypoint.c`:
- Around line 253-255: Update both raw_syscall3(SYSCALL_LSEEK, ...) calls in the
managed bootstrap entrypoint to pass the offset as the second argument and
SEEK_SET as the third argument, preserving the existing seek-to-start behavior.

In `@src/lib/onboard/managed-bootstrap/README.md`:
- Around line 82-94: Update the dormant architecture documentation surrounding
the native entrypoint and provider/image integration to include a real
repository GitHub issue or pull request reference for the deferred work.
Preserve the existing description of the uncompiled, un-packaged state and
clearly link the remaining integration work rather than leaving it untracked.

In `@test/managed-bootstrap-trampoline.test.ts`:
- Around line 382-452: Add an explicit 60,000 ms timeout to the compile-heavy
test “restores the exact supervisor environment only through the fixed resume
mode” and the adjacent test covering lines 334–380. Preserve their existing
assertions and cleanup while matching the timeout style already used by the
tests at lines 514, 606, and 782.

---

Nitpick comments:
In `@test/managed-bootstrap-trampoline.test.ts`:
- Around line 202-223: Remove nullability checks for the non-optional result of
hostileLoader. Update all call sites to access loader.library,
loader.afterTrace, and loader.earlyTrace directly, replace conditional spreads
with unconditional properties, and assert fs.existsSync results directly without
loader-dependent expectations.
🪄 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: d568ccfc-3531-4a12-8fac-66735a46b4f1

📥 Commits

Reviewing files that changed from the base of the PR and between 84df14a and f22358b.

📒 Files selected for processing (10)
  • ci/source-shape-test-budget.json
  • scripts/managed-bootstrap-entrypoint.c
  • scripts/managed-bootstrap-trampoline.sh
  • src/lib/onboard/managed-bootstrap/README.md
  • src/lib/onboard/managed-bootstrap/adapter.test.ts
  • src/lib/onboard/managed-bootstrap/adapter.ts
  • src/lib/onboard/managed-bootstrap/envelope.test.ts
  • src/lib/onboard/managed-bootstrap/envelope.ts
  • test/managed-bootstrap-trampoline.test.ts
  • test/runtime-provider-source-shape.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • ci/source-shape-test-budget.json
  • src/lib/onboard/managed-bootstrap/envelope.ts
  • src/lib/onboard/managed-bootstrap/adapter.ts
  • src/lib/onboard/managed-bootstrap/adapter.test.ts

Comment thread scripts/managed-bootstrap-entrypoint.c Outdated
Comment thread src/lib/onboard/managed-bootstrap/README.md
Comment thread test/managed-bootstrap-trampoline.test.ts Outdated
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa

ericksoa commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the current exact head 852487f, including the fixes for all findings from review 4842941773.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@ericksoa I will review commit 852487f9bd0e19954960c9671371ba839b9e090d, including the fixes for review 4842941773.

✅ 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.

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

ericksoa commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review Please review the current exact head ff75541, including the added provider-contract retry-convergence test that addresses the exact-head advisor warning.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@ericksoa I will review commit ff7554191ad982e5795fbe6f0f845f7f0862341e. I will include the provider-contract retry-convergence test and the stated exact-head advisor warning fix.

✅ 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.

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

ericksoa commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review Please review the current exact head a841a45, including the independent discovery-versus-inspection disagreement regression, exact sandboxId:bootstrapIdentity retry ownership model, same-sandbox foreign-transaction preservation, and branchless cleanup assertion.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@ericksoa I will review commit a841a45767ea412d62a915c7ef699d669841eb8e. I will assess the stated regression and ownership, preservation, and cleanup assertions.

✅ 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.

🧹 Nitpick comments (1)
src/lib/onboard/managed-bootstrap/adapter.test.ts (1)

655-655: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract a shared helper for the authority-key template.

The ${sandboxId}:${bootstrapIdentity} template literal is constructed independently at Line 655, Line 656, Line 677, and Line 697. Extract a small authorityKeyFor(sandboxId, bootstrapIdentity) helper. This removes duplication and prevents the key format from silently drifting between call sites if the composition ever changes.

♻️ Proposed helper extraction
+const authorityKeyFor = (sandboxId: string, bootstrapIdentity: string) =>
+  `${sandboxId}:${bootstrapIdentity}`;
+
-    const targetAuthorityKey = `${sandbox().sandboxId}:${IDENTITY}`;
-    const unrelatedAuthorityKey = `${sandbox().sandboxId}:${"e".repeat(64)}`;
+    const targetAuthorityKey = authorityKeyFor(sandbox().sandboxId, IDENTITY);
+    const unrelatedAuthorityKey = authorityKeyFor(sandbox().sandboxId, "e".repeat(64));
-      const authorityKey = `${prepareInput.handle.sandbox.sandboxId}:${prepareInput.handle.bootstrapIdentity}`;
+      const authorityKey = authorityKeyFor(
+        prepareInput.handle.sandbox.sandboxId,
+        prepareInput.handle.bootstrapIdentity,
+      );
-      const authorityKey = `${finalizeInput.handle.sandbox.sandboxId}:${finalizeInput.handle.bootstrapIdentity}`;
+      const authorityKey = authorityKeyFor(
+        finalizeInput.handle.sandbox.sandboxId,
+        finalizeInput.handle.bootstrapIdentity,
+      );

Also applies to: 656-656, 677-677, 697-697

🤖 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/adapter.test.ts` at line 655, Extract an
authorityKeyFor(sandboxId, bootstrapIdentity) helper in the test module that
returns the shared `${sandboxId}:${bootstrapIdentity}` format, then replace the
duplicated authority-key template literals at the referenced call sites with
this helper.
🤖 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/adapter.test.ts`:
- Line 655: Extract an authorityKeyFor(sandboxId, bootstrapIdentity) helper in
the test module that returns the shared `${sandboxId}:${bootstrapIdentity}`
format, then replace the duplicated authority-key template literals at the
referenced call sites with this helper.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4a405db1-274d-4da5-b16f-75e91bbdcf9b

📥 Commits

Reviewing files that changed from the base of the PR and between ff75541 and a841a45.

📒 Files selected for processing (1)
  • src/lib/onboard/managed-bootstrap/adapter.test.ts

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

ericksoa commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review Please review the current exact head 0c91e0b, including the shared driver-neutral authority-key helper that addresses review 4843675201, the independent discovery-versus-inspection disagreement regression, and exact same-sandbox foreign-transaction preservation.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

requested="0c91e0b98871b4001ebf3d51aed7c2f4b47696f9"

echo "== Checked-out HEAD =="
git rev-parse HEAD
echo "== Requested commit =="
git rev-parse "$requested^{commit}"

echo "== Commit metadata =="
git show --no-ext-diff --no-renames --format=fuller --stat "$requested"

echo "== Diff from prior requested head =="
git diff --no-ext-diff --no-renames --unified=80 \
  a841a45767ea412d62a915c7ef699d669841eb8e "$requested" -- \
  src/lib/onboard/managed-bootstrap/adapter.ts \
  src/lib/onboard/managed-bootstrap/adapter.test.ts

echo "== Adapter outline =="
ast-grep outline src/lib/onboard/managed-bootstrap/adapter.ts --items all --view expanded

echo "== Focused ownership/discovery/inspection/cleanup references =="
rg -n -C 8 --type ts \
  'authority|Authority|discovery|discover|inspection|inspect|cleanup|Cleanup|sandboxId|bootstrapIdentity|transactionId' \
  src/lib/onboard/managed-bootstrap/adapter.ts \
  src/lib/onboard/managed-bootstrap/adapter.test.ts

Length of output: 169372


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Diff validation =="
git diff --check a841a45767ea412d62a915c7ef699d669841eb8e 0c91e0b98871b4001ebf3d51aed7c2f4b47696f9

echo "== Coordinator rollback and finalization implementation =="
sed -n '1188,1448p' src/lib/onboard/managed-bootstrap/adapter.ts

echo "== Discovery/inspection disagreement regression =="
sed -n '380,440p' src/lib/onboard/managed-bootstrap/adapter.test.ts

echo "== Retry ownership and foreign-transaction preservation regression =="
sed -n '640,760p' src/lib/onboard/managed-bootstrap/adapter.test.ts

echo "== Exact changed-line blame and parent comparison =="
git diff --no-ext-diff --no-renames --word-diff=plain \
  a841a45767ea412d62a915c7ef699d669841eb8e \
  0c91e0b98871b4001ebf3d51aed7c2f4b47696f9 -- \
  src/lib/onboard/managed-bootstrap/adapter.test.ts

Length of output: 20828


@ericksoa I reviewed exact head 0c91e0b98871b4001ebf3d51aed7c2f4b47696f9.

I found no actionable issues.

The change is limited to src/lib/onboard/managed-bootstrap/adapter.test.ts. The shared authorityKeyFor helper now constructs all authority keys in the retry test. The test still verifies exact target cleanup and preservation of the foreign transaction in the same sandbox.

The discovery-versus-inspection regression rejects a runtime ID disagreement before replacement preparation. The coordinator also rolls back the held workload after this failure.

git diff --check completed without whitespace errors. I did not execute the test suite.

✅ 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.

@ericksoa
ericksoa merged commit c614c0d into main Aug 3, 2026
86 of 89 checks passed
@ericksoa
ericksoa deleted the feat/managed-bootstrap-protocol branch August 3, 2026 12:23
ericksoa added a commit that referenced this pull request Aug 3, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Adds the first narrowed PR3.10B review unit: dormant Docker bootstrap
transaction-journal and canonical launch-spec primitives. The preserved
monolithic #8037 source remains in append-only history, while this exact
head tree contains only the six-path primitive slice on current `main`.

No adapter, shared-state transaction, provider registration, production
import, or runtime activation is included. Existing Docker behavior and
all user-visible support claims remain unchanged.

## Related Issue

Part of #7744

## Changes

- Define a private monotonic Docker cutover journal with bounded
validation and legal transition rules.
- Define detached, deeply frozen canonical Docker launch-spec
normalization and validation so the retained object cannot diverge from
its canonical JSON or hash.
- Add focused adversarial tests for journal/spec validation, nested
mutation rejection, and input-alias isolation.
- Extend the managed-bootstrap source inventory and internal dormancy
documentation.
- Preserve the former 20-file source head at
`backup/podman-stack/pr8037-source-ad5397af`.
- Preserve this exact head at
`backup/podman-stack/pr8037b1-final-a352b710b` and the next split base
at `hold/podman-stack/pr8037b2-base-a352b710b`.

## 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:
- [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: Exact-tree review
covers journal monotonicity, canonical detached/frozen launch state,
bounded validation, and production dormancy.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Documentation Writer Review

- [x] Documentation writer reviewed the completed changes
- Result: `docs-updated`
- Evidence: Exact head `a352b710bd3fe57d5d28eb849d02c5d75b5a4d32` has
the same tree as clean current-main reconstruction
`149b3a244fe6707619010cddbad2976e880d89b2`. The internal
managed-bootstrap README accurately describes the dormant primitives;
the exact-head follow-up only hardens the canonical object/hash boundary
and adds its regression test. Source-shape coverage proves no production
import or registration, so no user-facing documentation surface changes.
- Agent: Codex Desktop
<!-- docs-review-head-sha: a352b71 -->
<!-- docs-review-agents-blob-sha:
3dd7c24 -->

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit:
- Station profile/scenario:
- Result:
- Supporting evidence:

## Verification

- Exact base/head: `d09b530ef1d3045b0c26b6d34462cb2175d9fb94` /
`a352b710bd3fe57d5d28eb849d02c5d75b5a4d32`.
- Review budget: six paths, `+1,062/-0`.
- Stable patch ID: `6aaa2ba4fec89d0e205d59b4a983929dfa499b95`.
- Binary diff SHA-256:
`18eedcc9bb68800c18e4100ef1edd8f224bb7f6a975c7b1803682239e691ccc1`.
- Clean current-main reconstruction:
`149b3a244fe6707619010cddbad2976e880d89b2`; final-tree equality is exact
at tree `439e941967a030b2ee54e8c0a0c9dd6a0e6d7823`.
- Append-only ancestry: prior live head
`345efce48244230c3293bfe5c47e7e469155f742` and current `main` are both
ancestors of the signed+DCO graft; no remote history was rewritten.
- Exact-tree focused journal/spec tests: 13/13 passed; runtime-provider
source-shape tests: 8/8 passed.
- Biome, diff-check, test-size, repository checks, `typecheck`,
`typecheck:cli`, normal commit hooks, and pre-push typechecks passed.
- Production source inventory proves no adapter, provider registration,
selectable runtime, or activation imports these primitives.

## Risk Plan

- Primary risk: accepting an invalid journal transition or allowing
retained launch state to diverge from its canonical hash before the
later adapter owns destructive cutover.
- Containment: bounded parsers, detached canonical serialization,
recursive freezing, explicit legal transitions, adversarial tests, and
source-shape dormancy enforcement.
- Regression risk: none to the active Docker path; the primitives have
no production consumer.
- Rollback: revert this inert six-path slice without changing runtime
behavior.

## Stack

- Merged base: PR3.10A #8036, followed by current `main`
`d09b530ef1d3045b0c26b6d34462cb2175d9fb94`.
- This slice: PR3.10B1 #8037,
`a352b710bd3fe57d5d28eb849d02c5d75b5a4d32`.
- Next: PR3.10B2 #8128, extracting the transactional
adapter/shared-state cutover and exact `createReceipt` cleanup binding;
it will be append-restacked onto this exact held base.
- PR3.11 #8040 remains held until both PR3.10B slices establish the new
handoff.
- Buildless and Podman support remain disabled until the complete
all-agent, multiarch, GPU/local-inference, recovery, installer, and
protected-E2E gates in #7744 pass.

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

---------

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
senthilr-nv added a commit that referenced this pull request Aug 4, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Adds the canonical dated `v0.0.101` changelog entry that was missing
when the release tag was cut. This post-release recovery records the
shipped behavior on current `main` without changing or replacing the
existing tag.

## Changes

- Add `docs/changelog/2026-08-03.mdx` with the exact `## v0.0.101`
heading, release summary, detailed behavior changes, support boundaries,
and links to durable documentation.
- [#7317](#7317) ->
`docs/changelog/2026-08-03.mdx`: Records experimental OpenClaw Google
Chat support and its restricted credential and webhook boundary.
- [#7715](#7715) ->
`docs/changelog/2026-08-03.mdx`: Records strict onboarding recovery
state and authoritative resume identity.
- [#7749](#7749) ->
`docs/changelog/2026-08-03.mdx`: Records the provider-neutral policy
seam and unchanged runtime support boundary.
- [#7817](#7817) ->
`docs/changelog/2026-08-03.mdx`: Records preserved Hermes home-channel
assignments across rebuilds.
- [#7820](#7820) ->
`docs/changelog/2026-08-03.mdx`: Records the SSH-session status field
correction.
- [#7847](#7847) ->
`docs/changelog/2026-08-03.mdx`: Records fail-closed credential
filtering for migration and rebuild backups.
- [#7870](#7870) ->
`docs/changelog/2026-08-03.mdx`: Records sandbox-qualified in-sandbox
host command hints.
- [#7875](#7875) ->
`docs/changelog/2026-08-03.mdx`: Records Microsoft Teams stop and start
E2E coverage.
- [#7885](#7885) ->
`docs/changelog/2026-08-03.mdx`: Records Hermes managed gateway
detection in status.
- [#7889](#7889) ->
`docs/changelog/2026-08-03.mdx`: Records policy-authenticated HTTPS Pin
Runtime route revocation.
- [#7891](#7891) ->
`docs/changelog/2026-08-03.mdx`: Records default fallback for negative
timeout and polling overrides.
- [#7993](#7993) ->
`docs/changelog/2026-08-03.mdx`: Records correct sibling detection
during uninstall.
- [#7995](#7995) ->
`docs/changelog/2026-08-03.mdx`: Records absent configuration-hash
handling before shields lock.
- [#8001](#8001) ->
`docs/changelog/2026-08-03.mdx`: Records the dormant atomic managed
workload replacement foundation.
- [#8029](#8029) ->
`docs/changelog/2026-08-03.mdx`: Records repository terminology review
in PR Review Advisor.
- [#8031](#8031) ->
`docs/changelog/2026-08-03.mdx`: Records provider-neutral managed
snapshot authority.
- [#8032](#8032) ->
`docs/changelog/2026-08-03.mdx`: Records immutable managed clone handoff
contracts.
- [#8034](#8034) ->
`docs/changelog/2026-08-03.mdx`: Records the dormant provider-owned
clone transaction surface.
- [#8035](#8035) ->
`docs/changelog/2026-08-03.mdx`: Records the dormant Hermes managed
clone broker boundary.
- [#8036](#8036) ->
`docs/changelog/2026-08-03.mdx`: Records the dormant transactional
managed bootstrap boundary.
- [#8037](#8037) ->
`docs/changelog/2026-08-03.mdx`: Records dormant Docker bootstrap
primitives and the unchanged provider support boundary.
- [#8070](#8070) ->
`docs/changelog/2026-08-03.mdx`: Records consolidated sandbox
resource-limit E2E coverage.
- [#8071](#8071) ->
`docs/changelog/2026-08-03.mdx`: Records escaped and bounded CLI
validation diagnostics.
- [#8081](#8081) ->
`docs/changelog/2026-08-03.mdx`: Records bounded linear snapshot Base64
validation.
- [#8085](#8085) ->
`docs/changelog/2026-08-03.mdx`: Records commit-bound workflow approval
for eligible same-repository maintainers.
- [#8088](#8088) ->
`docs/changelog/2026-08-03.mdx`: Records Hermes managed-policy E2E
selection.
- [#8090](#8090) ->
`docs/changelog/2026-08-03.mdx`: Records pinned CI search-tool
provisioning.
- [#8106](#8106) ->
`docs/changelog/2026-08-03.mdx`: Records fallback from failed managed
OpenShell gateway startup.
- [#8107](#8107) ->
`docs/changelog/2026-08-03.mdx`: Records Hermes adapter lifecycle E2E
selection.
- [#8128](#8128) ->
`docs/changelog/2026-08-03.mdx`: Records the dormant transactional
Docker bootstrap adapter and rollback authority.
- [#8140](#8140) ->
`docs/changelog/2026-08-03.mdx`: Records Slack conflict scope across
independent OpenShell gateways.
- [#8147](#8147) ->
`docs/changelog/2026-08-03.mdx`: Records completion of durable v0.0.100
documentation audit follow-ups.

## 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
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: This documentation-only
recovery does not change executable behavior.
- [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: Independently reviewed `docs/changelog/2026-08-03.mdx` at
commit `0bebe1f568e3dc85cf410aac1dfb8f8830070b85`. Its blob is
`82887920f9720eafd75db6b2271c35f7477edb9b`. The entry follows the
writing guide, controlled terminology, changelog structure, MDX SPDX
format, literal CLI-name rule, and root-absolute route requirements. It
accurately records the `v0.0.100...v0.0.101` release range, Announcement
#8162, accepted scope boundaries, and shipped security behavior. There
are no code samples. Focused changelog tests and the documentation build
pass for this commit.
- Agent: Codex Desktop independent documentation writer
<!-- docs-review-head-sha: 0bebe1f -->
<!-- docs-review-agents-blob-sha:
3dd7c24 -->

## Security Review

- Result: `PASS`
- Reviewed commit: `0bebe1f568e3dc85cf410aac1dfb8f8830070b85`
- Base commit: `643a4ab8b5f583d8555192a37927268b26022c51`
- Findings: None.
- Secrets and credentials: `PASS`. No credential values or secret files
are present.
- Input validation and data sanitization: `PASS`. No executable input
path changes.
- Authentication and authorization: `PASS`. No identity or permission
logic changes.
- Dependencies and third-party libraries: `PASS`. No dependency changes.
- Error handling and logging: `PASS`. No runtime path changes;
diagnostic-security claims are precise.
- Cryptography and data protection: `PASS`. No implementation changes.
- Configuration and security controls: `PASS`. No configuration,
container, port, or HTTP changes.
- Security testing: `PASS`. No coverage is removed; the entry records
shipped test and security behavior.
- System security: `PASS`. No runtime control changes; dormant and
non-activation boundaries are explicit.
- Agent: Codex Desktop independent security reviewer

## Verification

- [ ] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub — verification is pending after commit
`0bebe1f568e3dc85cf410aac1dfb8f8830070b85` is pushed.
- [ ] 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 — commit hooks passed; pre-push is pending.
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — tests are not applicable to this
documentation-only recovery.
- [x] Applicable broad gate passed — not applicable to this
documentation-only recovery.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, credentials, or private keys are added by
this diff.
- [ ] `npm run docs` builds without warnings (doc changes only) — GitHub
documentation checks are pending.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only) — independent documentation review passed.
- [x] New doc pages include SPDX header and frontmatter (new pages only)
— the native changelog entry uses the required parser-safe MDX SPDX
comment and intentionally has no frontmatter.

GitHub CI is authoritative.
Focused changelog tests and `npm run docs` passed after the merge
refresh.

---
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
  * Added experimental Google Chat support.
  * Improved runtime and session status visibility.
  * Added onboarding recovery and persistence safeguards.
  * Added snapshot validation and dormant managed-workload support.

* **Bug Fixes**
* Improved backup sanitization, route handling, and gateway reliability.

* **Documentation**
  * Added the v0.0.101 changelog and related updates.

* **Tests**
  * Expanded end-to-end coverage and strengthened trusted CI validation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Senthil Ravichandran <senthilr@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality platform: container Affects Docker, containerd, Podman, or images

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants