Skip to content

fix(rebuild): preserve serving profile provenance - #11461

Closed
Adr1an04 wants to merge 3 commits into
NVIDIA:mainfrom
Adr1an04:fix/rebuild-profile-provenance
Closed

Adr1an04 wants to merge 3 commits into
NVIDIA:mainfrom
Adr1an04:fix/rebuild-profile-provenance

Conversation

@Adr1an04

@Adr1an04 Adr1an04 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Outcome

Rebuild preserves the sandbox's saved serving profile metadata instead of dropping it when creating the replacement session.

Reason

The session reset omitted servingProfileProvenance, so the replacement session received null even when the sandbox registry contained the metadata.

Related issues

Fixes #11417

Changes

  • Carry the target sandbox's saved metadata into the replacement session.
  • Add four regression cases covering present and missing metadata with matching and unrelated sessions.

Verification

npx --no-install vitest run --project cli \
  src/lib/actions/sandbox/rebuild-flow-target-session.test.ts \
  -t 'profile metadata' --reporter verbose
  • All four selected cases pass; six unrelated cases are filtered out.
Screenshot 2026-09-10 at 1 39 19 PM
  • Removing the fix makes both preservation cases fail. Restoring it makes them pass.
  • A surrounding run across eight relevant test files had 138 passing tests and one existing failure because the local Docker daemon was stopped. That failure also occurred before the fix.
  • CLI type-checking, pre-commit checks, and commitlint passed.
  • The diff contains no secrets, API keys, or credentials.

Review notes

Validation used local tests with external operations mocked. A live DGX Spark rebuild was not tested.

image

Thanks for the report and for taking a look!

  • Adrian Osorio

Signed-off-by: Adrian Osorio [email protected]

Summary by CodeRabbit

  • Bug Fixes
    • Recreated sandbox sessions now retain serving-profile provenance from the saved sandbox configuration.
    • Preserved provenance takes precedence over outdated session metadata, while sessions without saved provenance remain unchanged.

Signed-off-by: Julie Yaunches [email protected]

@copy-pr-bot

copy-pr-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4834142b-2c9a-4ae9-acdc-c3bbbb701df5

📥 Commits

Reviewing files that changed from the base of the PR and between 42e1f10 and 96e318c.

📒 Files selected for processing (1)
  • src/lib/actions/sandbox/rebuild-recreate-phase.ts

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

Changes

The rebuild flow now copies servingProfileProvenance from the sandbox registry into the recreated session. Tests cover saved provenance, stale session metadata, and absent sandbox provenance.

Serving profile provenance preservation

Layer / File(s) Summary
Preserve provenance during session recreation
src/lib/actions/sandbox/rebuild-recreate-phase.ts, src/lib/actions/sandbox/rebuild-flow-target-session.test.ts
Session recreation copies provenance from the sandbox registry. Parameterized tests verify that saved provenance overrides stale session metadata and that missing sandbox provenance remains null.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: ericksoa, laitingsheng, apurvvkumaria

Merge Risk: ⚪ Minimal · up to 96e31

The change preserves sandbox serving provenance during rebuild, with focused regression coverage and validation passing; it is mergeable.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving serving profile provenance during sandbox rebuilds.
Linked Issues check ✅ Passed Issue #11417 requires successful rebuilds to preserve serving profile, recipe, and catalog digest provenance. runRebuildRecreatePhase now passes sb.servingProfileProvenance to `onboardSession.crea…
Out of Scope Changes check ✅ Passed The reviewed changes are limited to the rebuild session provenance assignment and regression tests for issue #11417. The tests directly verify the required rebuild behavior. No unrelated production or…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@wscurran wscurran added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression labels Sep 10, 2026
@wscurran

Copy link
Copy Markdown
Contributor

✨ Thanks for the fix and regression tests. This preserves serving profile provenance during sandbox rebuild, addressing the regression from #11417.


Related open issues:

@Adr1an04
Adr1an04 force-pushed the fix/rebuild-profile-provenance branch 5 times, most recently from 80f6155 to 750f2fa Compare September 11, 2026 02:24
@Adr1an04
Adr1an04 force-pushed the fix/rebuild-profile-provenance branch from 750f2fa to b317d10 Compare September 11, 2026 16:05
@Adr1an04

Copy link
Copy Markdown
Contributor Author

Noticed the same failed checks are also on other forks, happy to provide any additional validation or changes if you all need 🫡

@Adr1an04
Adr1an04 force-pushed the fix/rebuild-profile-provenance branch from b317d10 to d4eb1c3 Compare September 11, 2026 16:36

@rsliter rsliter 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 d4eb1c3. Rebuild now seeds the replacement session from the target sandbox registry entry, whose serving-profile provenance has already passed registry normalization. Saved provenance wins over stale session metadata, while an absent registry value clears unrelated stale session state. Exact focused validation passed all four profile-metadata cases.

@Adr1an04

Copy link
Copy Markdown
Contributor Author

Reviewed exact head d4eb1c3. Rebuild now seeds the replacement session from the target sandbox registry entry, whose serving-profile provenance has already passed registry normalization. Saved provenance wins over stale session metadata, while an absent registry value clears unrelated stale session state. Exact focused validation passed all four profile-metadata cases.

Thank you!! Hope to continue learning more!

@Adr1an04
Adr1an04 force-pushed the fix/rebuild-profile-provenance branch from d4eb1c3 to 74a2258 Compare September 12, 2026 21:30
@jyaunches

Copy link
Copy Markdown
Contributor

Alternative review completed for exact head 42e1f108ada35299d082b980fa0c2a6c9d10ace2. The local PR Review Advisor was attempted twice but produced no specialist artifacts because OpenShell sandbox creation stopped at sandbox is not ready with SSH exit 255; both owned sandboxes were cleaned up.

Alternative method: reviewed the full two-file diff against trusted origin/main, including registry normalization, session parsing/cloning, null behavior, security boundaries, regression coverage, and test selection. CodeRabbit independently reported no actionable finding for the unchanged source diff.

Results: all 10 tests in src/lib/actions/sandbox/rebuild-flow-target-session.test.ts passed on this head, including all four #11417 cases; npm run validate:pr passed, including formatting, lint, repository checks, secret scan, publication build, and CLI type-check. The source tree is identical to parent 74a225831a8bef6e54186d167fd937f7673e4e96; this head adds only a Verified signed DCO commit.

Residual limitations: no local Advisor specialist artifact is available, and no live DGX Spark rebuild was run. Hosted CI, automated review collection, and repository-prescribed E2E remain pending.

@jyaunches

Copy link
Copy Markdown
Contributor

Thank you, @Adr1an04, for the fix and the regression tests. We preserved your contribution in #11686, and the replacement commit keeps you as its author. NemoClaw’s trusted CI and PR E2E workflows only run for branches in NVIDIA/NemoClaw because those jobs use reviewed SDK packages and protected credentials. Full CI/CD therefore cannot complete on this fork PR. I’m closing this PR in favor of #11686 so the complete checks can run. Thank you for contributing this fix.

@jyaunches jyaunches closed this Sep 13, 2026
jyaunches added a commit that referenced this pull request Sep 14, 2026
## Outcome

Rebuild preserves the target sandbox's saved serving profile provenance
when it creates the replacement session.

This PR adopts Adrian Osorio Blanchard's reviewed contribution from
#11461 onto a repository-owned branch. The move lets the full trusted CI
and E2E workflows evaluate the change.

## Reason

The rebuild path omitted `servingProfileProvenance`, so a replacement
session received `null` when the sandbox registry contained valid
metadata.

Fork PRs cannot access the reviewed OpenShell SDK package or the
credentials used by trusted PR E2E jobs. Repository policy therefore
requires this adoption before full CI/CD can run.

### Related issues

Fixes #11417

Adopts #11461

## Changes

- Pass the target sandbox's normalized provenance into the replacement
session.
- Add four regression cases for present and absent provenance with
matching and unrelated current sessions.
- Preserve Adrian Osorio Blanchard as the commit author.

## Verification

- `npm exec -- vitest run --project cli
src/lib/actions/sandbox/rebuild-flow-target-session.test.ts` — all 10
tests passed.
- The pre-push hook — publication validation and CLI TypeScript checks
passed. Unselected plugin and JavaScript checks were skipped.
- Tree comparison — the adopted commit matches the latest source tree
from #11461.
- The diff contains no secrets, API keys, or credentials.

## Review notes

The local Advisor could not start its OpenShell sandbox. It reported
`sandbox is not ready` and SSH exit 255. The authorized alternative
review covered the full diff, correctness, security boundaries,
regression coverage, and test selection. No actionable finding remained.

The original PR has human approval and a successful CodeRabbit review
for the same source tree. This replacement still requires its own
trusted CI and E2E results.

---
Signed-off-by: Julie Yaunches <[email protected]>


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

## Summary by CodeRabbit

- **Bug Fixes**
- Preserved serving-profile provenance when recreating sandbox sessions.
- Prevented stale session metadata from overwriting the correct
provenance.
- Ensured missing provenance remains absent when no value is available.
- **Tests**
- Added coverage for current and non-current session recreation
scenarios.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Adrian Osorio Blanchard <[email protected]>
Signed-off-by: Julie Yaunches <[email protected]>
Co-authored-by: Adrian Osorio Blanchard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DGX Spark][Sandbox] rebuild drops serving profile provenance from the sandbox registry

5 participants