Skip to content

refactor(onboard): require a journal-bound source before pre-upgrade backup - #8073

Open
laitingsheng wants to merge 15 commits into
mainfrom
refactor/onboard-journal-bound-backup-select
Open

refactor(onboard): require a journal-bound source before pre-upgrade backup#8073
laitingsheng wants to merge 15 commits into
mainfrom
refactor/onboard-journal-bound-backup-select

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Pre-upgrade backup selection took unbound registry and gateway booleans and answered a registry/OpenShell disagreement by selecting no backup.
It now consumes the canonical recreate transaction and rejects an unproven source before reading a backup or mutating anything.

Related Issue

Fixes #7736

Changes

  • selectPreUpgradeBackupForCreate takes a journal-bound source proof instead of liveExists and hasExistingRegistryEntry.
  • assertSandboxRecreateSourceProof rejects an absent transaction, another sandbox or gateway, an absent or changed source registry row, and a live sandbox that is not the recorded source.
  • The installer upgrade path opens the recreate journal before selection, and abandonSandboxRecreateTransaction clears it when plugin provenance blocks recreation. Abandon refuses past revision zero.
  • A same-name replacement without a journal stops before sandbox repair, registry removal, backup selection, deletion, or creation.
  • pruneStaleSandboxEntry is removed because it dropped a registry row without ownership evidence.
  • Obsolete pre-journal registry-removal, repair, and rollback paths are removed; the source registry row remains intact until journaled replacement commits.
  • Resume tests now model the selected gateway authority, journal phases, source and replacement identities, persisted traced-runtime state, preserved registry state, and repair-event outcomes.

The installer upgrade path now writes a journal it never had, so an interrupted run is told to resume or repair rather than silently retargeting.
The live recreate path has behaved this way since #7788.

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: no user-facing command, configuration, supported surface, or documented workflow changed; the internal lifecycle contract map records the implementation boundary.
  • 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: nine-category security review passed on head 4e869ffadee58d8aa8719c06c0e41dd80f3195e9 and base 83870a9ef040ffe8792f82744176a023ecfcaa60; no findings.
  • 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: no-docs-needed
  • Evidence: Reviewed the exact 21-file PR diff from base 83870a9ef040ffe8792f82744176a023ecfcaa60 through head 4e869ffadee58d8aa8719c06c0e41dd80f3195e9, with AGENTS.md blob 3dd7c2425b70934b540c404d3939e3321f5c7558. Reviewed @cv commits f746c5378600c4ba724cc6857ddb9ebd357b991c and 05e8ea4832125fc8bce1b4b85dcda916eb3e223b, including production, fixture, lifecycle-trace, registry-preservation, repair-event, comment, and test-title changes. The production change removes pre-journal registry deletion and legacy repair side effects so same-name replacement remains owned by the recreate journal. This conforms to the existing documented contract rather than adding a command, flag, configuration, supported surface, or user workflow. Existing documentation already describes journal-bound same-name replacement, preservation until replacement commits, gateway and identity validation, registry mismatch rejection, and nonzero installer recovery failures. No user-facing docs/ file changed. The later base-only Hermes session-deletion and Jetson E2E-planning commits share no changed paths with this PR. Both @cv refresh merges have no conflict-resolution delta, and the current PR patch has the same stable patch ID, 7b50aa5d9ccb3a9b909af46c76bfaecac7dfabbd, as the fully reviewed previous range. Reviewed all changed explanatory text, comments, errors, internal contract text, and test titles; no findings remain. Ten focused CLI files passed 178/178, npm run validate:pr passed, npm run docs passed with 0 errors and 2 existing warnings, git diff --check passed, and the tracked tree is clean on the exact head.
  • Agent: Codex Desktop

Security Review

  • Verdict: PASS; no findings.
  • Reviewed head: 4e869ffadee58d8aa8719c06c0e41dd80f3195e9.
  • Reviewed base: 83870a9ef040ffe8792f82744176a023ecfcaa60.
  • Secrets and credentials: PASS; no credential material or credential logging changed.
  • Input validation and data sanitization: PASS; the transaction proof validates sandbox, gateway, registry fingerprint, and OpenShell identity before the operation proceeds.
  • Authentication and authorization: PASS; no authentication surface changed, and source ownership evidence is strengthened.
  • Dependencies and third-party libraries: PASS; the PR adds no dependency.
  • Error handling and logging: PASS; missing, stale, foreign, unknown, or failed replacement evidence stops with bounded non-secret errors while preserving the source registry row.
  • Cryptography and data protection: PASS; the PR adds no cryptography and persists only fingerprints and secret-free journal metadata.
  • Configuration and security headers: PASS; the PR changes no service exposure, container permission, network policy, or HTTP configuration.
  • Security testing: PASS; denial paths cover absent journals, foreign identities, changed registry rows, wrong gateways, missing OpenShell IDs, unjournaled legacy repair, failed creation, and persisted journal tracing.
  • System security: PASS; destructive same-name replacement now fails closed before repair or registry mutation, and transaction phase and identity checks prevent stale-source and time-of-check/time-of-use bypasses.

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • 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
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result: ten focused CLI test files passed 178/178 on 4e869ffadee58d8aa8719c06c0e41dd80f3195e9; npm run validate:pr passed on the exact head.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: local default and one-worker runs were stopped after unrelated host/process timing failures; required GitHub CI remains authoritative.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved sandbox recreation safety by validating ownership, gateway identity, registry state, and live-state evidence before making changes.
    • Prevented unauthorized same-name replacements and ensured invalid recovery attempts fail without modifying existing resources.
    • Added safer handling for interrupted or unsuccessful recreation flows, including cleanup of unused recovery transactions.
    • Removed stale sandbox registry pruning to avoid deleting entries during lifecycle handling.
  • Tests

    • Added regression coverage for ownership validation, source verification, recovery failures, and journal lifecycle behavior.

…backup

Pre-upgrade backup selection took unbound registry and gateway booleans and
answered a registry/OpenShell disagreement with no backup, hiding a protocol
violation behind a temporary guard. Selection now consumes the recreate
transaction and rejects an absent transaction, another sandbox or gateway, a
missing or changed source registry row, and a live sandbox that is not the
recorded source, always before backup lookup or any mutation.

The installer upgrade path, where the registry row survives an absent sandbox,
replaced that row with no journal at all. It now opens the canonical journal
first and abandons it when the custom-image plugin-provenance check blocks
recreation, so a blocked run leaves no transaction behind.

Once a run binds a gateway authority, a same-name replacement that cannot open
a journal stops instead of deleting the sandbox or removing its registry row.
The stale-entry prune, which dropped a registry row with no ownership proof and
had no production caller, is gone, and a repository check pins every
openshell sandbox delete call site so a new caller cannot bypass the
transaction unnoticed.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@laitingsheng laitingsheng added refactor PR restructures code without intended behavior change area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow labels Aug 2, 2026
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Sandbox recreation now uses journal-bound source proofs for backup selection and replacement. Recreate journals can be abandoned safely when unused. Same-name replacement requires gateway-authorized ownership. Legacy stale-sandbox pruning is removed.

Changes

Sandbox replacement lifecycle

Layer / File(s) Summary
Source-proof journal lifecycle
src/lib/onboard/sandbox-recreate-transaction.ts, src/lib/onboard/onboard-recreate-journal.ts, src/lib/onboard/*test.ts
Recreate transactions expose source proofs, validate source identity, and support guarded abandonment.
Journal-bound backup selection
src/lib/onboard/sandbox-recreate-protection.ts, src/lib/onboard/not-ready-recreate.ts, src/lib/onboard.ts, src/lib/onboard/*test.ts, src/lib/onboard/lifecycle-contracts.md
Backup selection requires journal, gateway, registry, and live-observation data. Journal creation is centralized, and failed selection abandons unused journals.
Replacement authority guards
src/lib/onboard/machine/handlers/sandbox-resume.ts, src/lib/onboard/machine/handlers/sandbox.ts, src/lib/onboard/machine/handlers/sandbox-recreate-journal.test.ts
Same-name replacement rejects unjournaled ownership when gateway authority is present. Non-replacing resume remains allowed.
Lifecycle API cleanup
src/lib/onboard/sandbox-lifecycle.ts, src/lib/onboard.ts, test/onboard-sandbox-build.test.ts
The stale-sandbox pruning helper and its integration test are removed.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5913: The change extends sandbox resume and recreate orchestration introduced by that PR.
  • NVIDIA/NemoClaw#7853: The change uses the sandbox resume and recreation decision flow modified by that PR.
  • NVIDIA/NemoClaw#8027: Both changes enforce journal-bound authority in sandbox recreation flows.

Suggested labels: area: sandbox, area: security

Suggested reviewers: cv

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.26% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR replaces unbound drift guards with journal-bound proofs, fails closed before mutation, updates replacement paths, and adds regression coverage for #7736.
Out of Scope Changes check ✅ Passed The changes remain within #7736, including journal lifecycle updates, stale-pruning removal, contract documentation, and related tests.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: requiring a journal-bound source before selecting a pre-upgrade backup.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/onboard-journal-bound-backup-select

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

@github-code-quality

github-code-quality Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 4e869ff in the refactor/onboard-jou... branch remains at 96%, unchanged from commit 83870a9 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 4e869ff in the refactor/onboard-jou... branch remains at 81%, unchanged from commit 3a7899f in the main branch.

Show a code coverage summary of the most impacted files.
File main 3a7899f refactor/onboard-jou... 4e869ff +/-
src/lib/onboard...eate-journal.ts 97% 90% -7%
src/lib/policy/...ne-exclusion.ts 96% 92% -4%
src/lib/onboard...-transaction.ts 96% 93% -3%
src/lib/private-networks.ts 93% 90% -3%
src/lib/actions.../gateway-rpc.ts 92% 91% -1%
src/lib/shields/index.ts 68% 68% 0%
src/lib/onboard...lers/sandbox.ts 97% 97% 0%
src/lib/onboard...est-fixtures.ts 93% 94% +1%
src/lib/onboard...ox-lifecycle.ts 48% 54% +6%
src/lib/domain/.../connect-env.ts 89% 97% +8%

Updated August 04, 2026 16:38 UTC

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

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

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Failed

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

3 semantic terminology decisions

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

  • justified — journal-bound at src/lib/onboard/lifecycle-contracts.md:144: Keep `journal-bound` when the source-and-gateway binding distinguishes this journal from an ordinary journal.
  • define — source proof at src/lib/onboard/lifecycle-contracts.md:147: Keep the term and retain the adjacent field list that defines its required evidence.
  • established — same-name replacement at src/lib/onboard/lifecycle-contracts.md:158: Keep the established term for journal-protected replacement paths.

E2E guidance

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

Recommended E2E: cloud-onboard, onboard-repair, onboard-resume

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@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: 2

🧹 Nitpick comments (2)
test/sandbox-replacement-journal-discovery.test.ts (1)

34-35: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add the tracked issue suffix to the suite title.

Append (#7736) to the parent describe title. Child tests inherit the parent issue reference.

As per coding guidelines, “Use behavior-oriented test titles and put local issue references in a final (#1234) suffix.” Based on learnings, a parent describe(...) suffix is sufficient for child tests.

🤖 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/sandbox-replacement-journal-discovery.test.ts` around lines 34 - 35,
Update the parent describe title in the “same-name sandbox replacement audit”
suite to append the tracked issue suffix “(`#7736`)”, leaving the child test title
unchanged.

Sources: Coding guidelines, Learnings

src/lib/onboard/machine/handlers/sandbox-resume.ts (1)

94-97: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Make replacesSameNameSandbox exhaustive.

A recreate decision with removeRegistryEntry: false can reach createSandbox, but that path records a recreate journal before deletion. Keep this decision returning false. Use an exhaustive switch so new decision kinds cannot silently bypass the guard.

🤖 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/machine/handlers/sandbox-resume.ts` around lines 94 - 97,
Update replacesSameNameSandbox to use an exhaustive switch over
SandboxResumeDecision.kind, returning true for repair-and-recreate, returning
decision.removeRegistryEntry for recreate, and preserving false when recreate
has removeRegistryEntry false. Ensure the switch cannot silently accept newly
added decision kinds.
🤖 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/checks/sandbox-replacement-journal.mts`:
- Around line 102-113: The countSandboxDeleteCalls audit must count only
executed, transaction-authorized sandbox deletion commands, not inert array
literals. Update countSandboxDeleteCalls to inspect the command execution
boundary and require the replacement deletion to remain guarded by the
transaction authority while preserving approved path and count checks. In
test/sandbox-replacement-journal-discovery.test.ts lines 39-73, add coverage for
inert arrays and for a same-count replacement that removes the transaction
guard.

In `@src/lib/onboard/machine/handlers/sandbox-recreate-journal.test.ts`:
- Around line 395-437: Rename the test title around handleSandboxState to
explicitly describe the gateway-authority/name mismatch that triggers the
rejection, rather than implying any bound authority is sufficient. Also add
companion coverage for a non-replacing decision, verifying that create or reuse
paths where replacesSameNameSandbox returns false do not trigger the
no-transaction guard.

---

Nitpick comments:
In `@src/lib/onboard/machine/handlers/sandbox-resume.ts`:
- Around line 94-97: Update replacesSameNameSandbox to use an exhaustive switch
over SandboxResumeDecision.kind, returning true for repair-and-recreate,
returning decision.removeRegistryEntry for recreate, and preserving false when
recreate has removeRegistryEntry false. Ensure the switch cannot silently accept
newly added decision kinds.

In `@test/sandbox-replacement-journal-discovery.test.ts`:
- Around line 34-35: Update the parent describe title in the “same-name sandbox
replacement audit” suite to append the tracked issue suffix “(`#7736`)”, leaving
the child test title unchanged.
🪄 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: b4b60c5c-7e90-4aaa-b6f6-41a78b4cf036

📥 Commits

Reviewing files that changed from the base of the PR and between d5b64a7 and ae38595.

📒 Files selected for processing (17)
  • scripts/checks/run.mts
  • scripts/checks/sandbox-replacement-journal.mts
  • src/lib/onboard.ts
  • src/lib/onboard/lifecycle-contracts.md
  • src/lib/onboard/machine/handlers/sandbox-recreate-journal.test.ts
  • src/lib/onboard/machine/handlers/sandbox-resume.ts
  • src/lib/onboard/machine/handlers/sandbox.ts
  • src/lib/onboard/not-ready-recreate.test.ts
  • src/lib/onboard/not-ready-recreate.ts
  • src/lib/onboard/onboard-recreate-journal.ts
  • src/lib/onboard/sandbox-lifecycle.ts
  • src/lib/onboard/sandbox-recreate-protection.test.ts
  • src/lib/onboard/sandbox-recreate-protection.ts
  • src/lib/onboard/sandbox-recreate-transaction.test.ts
  • src/lib/onboard/sandbox-recreate-transaction.ts
  • test/onboard-sandbox-build.test.ts
  • test/sandbox-replacement-journal-discovery.test.ts
💤 Files with no reviewable changes (2)
  • test/onboard-sandbox-build.test.ts
  • src/lib/onboard/sandbox-lifecycle.ts

Comment thread scripts/checks/sandbox-replacement-journal.mts Outdated
Comment thread src/lib/onboard/machine/handlers/sandbox-recreate-journal.test.ts Outdated
Selecting a pre-upgrade backup asked for the source proof before reading the
installer restore signal, so a run that restores nothing still opened a
transaction the create path then had to complete. Ask for the proof after the
signal, and drop the sandbox-delete source scan in favour of the behavior tests
that already refuse an unjournaled same-name replacement.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>

@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/sandbox-recreate-protection.ts (1)

85-99: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Track whether this call opened the journal.

selectPreUpgradeBackupForCreate requests the proof once today, but sourceProof is a callback. A second request would open and replace the journal runtime. The resume path passes an already-journaled runtime with openJournal: null; the catch block must not abandon caller-owned runtimes. Restrict abandonment and journal opening to the runtime created here.

♻️ Proposed change
       let runtime = binding.runtime;
+      let openedHere = false;
       try {
         const backupPath = selectPreUpgradeBackup({
           sourceProof: () => {
-            if (binding.openJournal) runtime = binding.openJournal();
+            if (binding.openJournal && !openedHere) {
+              runtime = binding.openJournal();
+              openedHere = true;
+            }
             return runtime.sourceProof;
           },
...
-        if ("abandon" in runtime) (runtime as { abandon(): void }).abandon();
+        if (openedHere && "abandon" in runtime) (runtime as { abandon(): void }).abandon();
🤖 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/sandbox-recreate-protection.ts` around lines 85 - 99, Update
the runtime handling around selectPreUpgradeBackup to track whether this call
opened a journal. In sourceProof, invoke binding.openJournal only once and
record that the runtime was created here; reuse it on subsequent proof requests.
In the catch block, call abandon only for that locally created runtime, never
for an already-journaled caller-owned runtime.
🤖 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/sandbox-recreate-protection.ts`:
- Around line 85-99: Update the runtime handling around selectPreUpgradeBackup
to track whether this call opened a journal. In sourceProof, invoke
binding.openJournal only once and record that the runtime was created here;
reuse it on subsequent proof requests. In the catch block, call abandon only for
that locally created runtime, never for an already-journaled caller-owned
runtime.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: dac7bde9-5c19-4717-a442-bc1684382a1c

📥 Commits

Reviewing files that changed from the base of the PR and between ae38595 and f0c319e.

📒 Files selected for processing (7)
  • src/lib/onboard.ts
  • src/lib/onboard/lifecycle-contracts.md
  • src/lib/onboard/machine/handlers/sandbox-recreate-journal.test.ts
  • src/lib/onboard/not-ready-recreate.test.ts
  • src/lib/onboard/not-ready-recreate.ts
  • src/lib/onboard/sandbox-recreate-protection.test.ts
  • src/lib/onboard/sandbox-recreate-protection.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/lib/onboard/lifecycle-contracts.md
  • src/lib/onboard.ts
  • src/lib/onboard/not-ready-recreate.test.ts

Source-proof validation folded a live sandbox with no reported Id into the same
null identity a journal records for an absent source, so unknown OpenShell state
could pass as proof before backup selection. Reject it instead of comparing it.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Every same-name replacement deletes through SandboxRecreateRuntime.beginDelete,
but the no-transaction runtime reported the source as present, so a caller that
never opened the journal would delete an unproven sandbox. Refuse at that edge
and cover the refusal.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>

@apurvvkumaria apurvvkumaria left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed current head b55e942. Journal-bound source proof validates gateway authority, registry fingerprint, and live OpenShell identity before backup selection, and deletion re-observes identity at the destructive boundary. Missing IDs and transaction-less same-name replacement fail closed. Ordinary required CI passes; the cloud-onboard E2E failure is an unrelated hosted endpoint HTTP 403. I found no blocking defect.

@laitingsheng laitingsheng added the v0.0.102 Release target label Aug 4, 2026
@cjagwani

cjagwani commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Exact-head disposition for b55e942: the selected cloud-onboard lane failed during Other OpenAI-compatible endpoint validation, before the journal-bound pre-upgrade recreate path changed by this PR was exercised. That makes the failure appear external/adjacent, but the required gate is still terminal red and I am not rerunning it without authoritative endpoint-health evidence or a maintainer waiver. Separately, the PR body still marks sensitive-path security review pending and the documentation-writer review result blocked, so the existing approval does not establish merge readiness. Please add exact-head security and documentation-writer receipts and reconcile the live failure through the supported gate path.

prekshivyas and others added 8 commits August 4, 2026 04:46
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>

@cjagwani cjagwani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed exact head 4e869ffadee58d8aa8719c06c0e41dd80f3195e9. The advisor's ownership TOCTOU blocker remains in current code: createSandboxRecreateProtection closes over sandboxEntry before the journal opens and passes that same object as registryEntry after binding.openJournal() returns. The only commits after the advisor-reviewed head are base refreshes, and there is still no post-journal registry lookup.

Please pass a current registry lookup into the selection boundary, re-read the source row after the recreate journal opens and immediately before assertSandboxRecreateSourceProof, then add a regression test that changes/removes the row between journal creation and proof validation and proves backup lookup never runs. The exact-head docs/security receipts are present, but they do not resolve this correctness and source-ownership defect.

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 refactor PR restructures code without intended behavior change v0.0.102 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(onboard): remove legacy not-ready recreation guards

5 participants