Skip to content

fix(onboard): require journal for not-ready repair - #8027

Open
HOYALIM wants to merge 6 commits into
NVIDIA:mainfrom
HOYALIM:codex/issue-6492-not-ready-fallback
Open

fix(onboard): require journal for not-ready repair#8027
HOYALIM wants to merge 6 commits into
NVIDIA:mainfrom
HOYALIM:codex/issue-6492-not-ready-fallback

Conversation

@HOYALIM

@HOYALIM HOYALIM commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the legacy unjournaled same-name sandbox cleanup path
  • fail closed before deletion when a not-ready repair has no journal authority
  • retain journal-owned recreation and repair event handling

Contributes to #6492. This is the final legacy-fallback removal after #7788 journal-bound rebuild and re-onboard adoption.

Validation

  • npm run build:cli
  • npm run typecheck:cli
  • 146 focused CLI/integration tests
  • PR hooks: format, lint, secrets, source-shape, and test-size checks passed

npm run check:diff reaches an unrelated current-main repository budget failure: src/lib/core/ports.ts fan-in is 85 while its stale limit is 86. This change does not touch that file or dependency boundary.

Summary by CodeRabbit

  • Bug Fixes

    • Sandbox recovery now requires a verified recreation transaction, preventing unsafe or incomplete recovery actions.
    • Not-ready sandboxes are safely rejected when recreation cannot be verified, without creating sandboxes, removing records, or recording misleading repair activity.
    • Improved handling of sandbox configuration and routing changes during recovery.
  • Refactor

    • Simplified sandbox reuse and recovery flows by removing obsolete repair-related configuration.
    • Strengthened recreation tracking and validation for more consistent recovery behavior.

Signed-off-by: Ho Lim subhoya@gmail.com

Signed-off-by: Ho Lim <subhoya@gmail.com>
Copilot AI review requested due to automatic review settings July 31, 2026 20:34
@copy-pr-bot

copy-pr-bot Bot commented Jul 31, 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.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 31, 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

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: 20472390-c23c-47ed-9ed3-3947b05f98ca

📥 Commits

Reviewing files that changed from the base of the PR and between d8ddee1 and 89551b7.

📒 Files selected for processing (2)
  • src/lib/onboard/machine/handlers/sandbox-resume.test.ts
  • src/lib/onboard/machine/handlers/sandbox-resume.ts

📝 Walkthrough

Walkthrough

The onboarding sandbox flow removes recorded-sandbox repair APIs and dependencies. Not-ready sandboxes now require journal-bound recreation. Tests provide gateway authority and recreate observations, and verify fail-closed behavior.

Changes

Sandbox recreation flow

Layer / File(s) Summary
Remove recorded-sandbox repair contracts
src/lib/onboard.ts, src/lib/onboard/sandbox-reuse.ts, src/lib/onboard/machine/handlers/sandbox.ts, src/lib/onboard/machine/handlers/sandbox-resume.ts, ci/source-architecture-budget.json
Removed repair callbacks, dashboard cleanup dependencies, helper bindings, and the repairRecordedSandbox export. Reduced the architecture fan-in budget from 89 to 88.
Require journal-bound recreation
src/lib/onboard/machine/handlers/sandbox-resume.ts
Not-ready sandboxes now select repair-and-recreate. Applying that decision throws when no journal-bound recreate transaction exists.
Update recreation fixtures and coverage
src/lib/onboard/machine/handlers/*test.ts, src/lib/onboard/machine/handlers/sandbox-test-fixtures.ts, src/lib/onboard/sandbox-reuse.test.ts
Tests establish gateway authority, provide recreate observations, verify fail-closed behavior, validate recreate transaction metadata, and update transition traces.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: apurvvkumaria, cv

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: requiring a journal for not-ready sandbox repair.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@github-actions

github-actions Bot commented Jul 31, 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): Completed · high confidence · 0 blockers · 1 warning · 0 suggestions
  • Model comparison: normalized findings differ; normalized terminology decisions differ; normalized E2E selections differ; Nemotron reported the same number of blockers, 1 more warning, the same number of suggestions.
1 terminology difference from the second opinion

Advisory only. These are normalized differences from the primary terminology receipt.

  • journal-bound at src/lib/onboard/machine/handlers/sandbox-resume.ts:301: selected only by the second-opinion lane as established.
2 additional E2E selections from the second opinion

Advisory only. The primary lane did not select these E2E jobs or targets.

  • sandbox-operations: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • rebuild-openclaw: The completed second-opinion lane identified E2E coverage that the primary lane omitted.

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

Since last review: 0 prior items resolved · 0 still apply · 0 new items found

2 semantic terminology decisions

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

  • established — not-ready repair at src/lib/onboard/machine/handlers/sandbox-resume.test.ts:273: Keep the established term for journaled recovery of a not-ready sandbox.
  • justified — journal-bound recreate transaction at src/lib/onboard/machine/handlers/sandbox-resume.ts:301: Keep the modifier because it distinguishes the required authority for destructive recreation.

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.

@HOYALIM

HOYALIM commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@cv @NVIDIA/nemoclaw-maintainer Could you please help with the protected E2E disposition for exact head fcacdc3?

  • The ordinary reported checks are green.
  • There are no active non-outdated review threads or exact-head human change requests.
  • E2E / PR Gate failed only after timing out for roughly six hours while waiting for the trusted verdict from coordination run 91264671331.

I cannot authorize or repair that trusted-run path from the fork. I will keep this head unchanged so checks are not reset again. Please either authorize/retrigger the repository-supported E2E path for this exact head, identify any remaining code or evidence blocker I can address, or mark the PR superseded if its outcome is no longer wanted.

@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 fcacdc3. The change removes the unjournaled direct sandbox-delete and registry-removal fallback while preserving the journal-owned recreate and repair-event path; missing journal authority now refuses before deletion. The required E2E failure is a trusted-verdict coordination timeout rather than a product test failure. I found no blocking correctness or security defect.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
agents/hermes/Dockerfile (1)

1021-1027: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Security Misconfiguration (CWE-732): Incorrect Permission Assignment for Critical Resource

Reachability: Internal · Exploitability: Moderate

Replace the Darwin-wide permission change with scoped access.

With NEMOCLAW_DARWIN_VM_COMPAT=1, the block changes /sandbox/.hermes/.env and config.yaml from 0640 to 0666, and makes state directories world-writable. Non-root startup then rejects the world-writable .env before runtime repair. Use UID/group-scoped permissions and add negative-path access 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 `@agents/hermes/Dockerfile` around lines 1021 - 1027, Update the
NEMOCLAW_DARWIN_VM_COMPAT permission block in the Dockerfile to avoid
recursive/world-writable access, preserving restrictive modes for .hermes/.env
and config.yaml while granting only the required runtime UID/group access to
NemoClaw state paths. Add negative-path tests that verify world-writable
.env/configuration files and state directories are rejected while the intended
scoped access succeeds.

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.

Outside diff comments:
In `@agents/hermes/Dockerfile`:
- Around line 1021-1027: Update the NEMOCLAW_DARWIN_VM_COMPAT permission block
in the Dockerfile to avoid recursive/world-writable access, preserving
restrictive modes for .hermes/.env and config.yaml while granting only the
required runtime UID/group access to NemoClaw state paths. Add negative-path
tests that verify world-writable .env/configuration files and state directories
are rejected while the intended scoped access succeeds.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2cac9bd6-5e3b-4a24-bea6-8829fd2f1854

📥 Commits

Reviewing files that changed from the base of the PR and between fcacdc3 and 1dd0480.

📒 Files selected for processing (2)
  • agents/hermes/Dockerfile
  • ci/source-architecture-budget.json

@wscurran wscurran added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression labels Aug 4, 2026
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: 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.

6 participants