Skip to content

test(e2e): add source-sandbox negative control for clone pairing - #7652

Merged
cv merged 38 commits into
mainfrom
codex/fix-restored-clone-pairing-gate
Aug 3, 2026
Merged

test(e2e): add source-sandbox negative control for clone pairing#7652
cv merged 38 commits into
mainfrom
codex/fix-restored-clone-pairing-gate

Conversation

@cv

@cv cv commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

The snapshot-command E2E test for #7608 did not distinguish a restored-clone pairing probe from one run in the source sandbox. The test now installs a source-sandbox negative control and requires one authenticated clone-fixture request, no negative-control request, and no source-sandbox session.

Related PR

Follow-up to #7608.

Changes

  • The test installs a source-sandbox marker before restored-clone pairing verification.
  • If the pairing probe enters the source sandbox, it sends a distinct negative-control model request and exits before the ordinary agent run.
  • The test requires one authenticated clone-fixture request, no source-sandbox negative-control request, clone session presence, and source-sandbox session absence.
  • The evidence records fixed request counts and session-ownership booleans. An asserted finally block removes the marker.

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: This PR changes one live E2E test and no user-visible behavior or supported contract.
  • 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: Codex Desktop reviewed commit 9146a55fa3d4fc1aa495ce0c15727705222b82bf against base SHA 4cd4d64fe67143b57707f874afa0b9d269dfeff2. Each of the nine categories received PASS, with no findings. Security review.
  • 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: Commit 9146a55fa3d4fc1aa495ce0c15727705222b82bf changes only test/e2e/live/snapshot-commands.test.ts. It adds a source-sandbox negative control for restored-clone pairing verification and changes no command, flag, configuration, output contract, API, protocol, policy schema, or supported behavior. The changed test contract, identifiers, artifact names, and assertion labels were reviewed against the repository writing rules.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

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

Verification

GitHub CI is authoritative and is still running for commit 9146a55fa3d4fc1aa495ce0c15727705222b82bf. Required checks must pass before merge; no non-success result is waived. No broad local tests were run for this review.

  • 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 or justification: GitHub CI is still running for commit 9146a55fa3d4fc1aa495ce0c15727705222b82bf.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: Not applicable to this one-file live E2E test change.
  • 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: Carlos Villela cvillela@nvidia.com

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression v0.0.96 labels Jul 27, 2026
@cv cv self-assigned this Jul 27, 2026
@coderabbitai

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

Restored-clone auto-pair approval now handles gated device-list failures by reading clone-local pending state, validates request identity, and limits approvals. Tests expand coverage for state propagation, receipts, environment usage, bounded scopes, stored-auth behavior, primary-state preservation, and CLI module-cache isolation.

Changes

Restored-clone approval flow

Layer / File(s) Summary
Gated-list fallback and request validation
src/lib/actions/sandbox/auto-pair-approval.ts
localDeviceOnly approval forces one approval, falls back to clone-local pending.json after matching gateway failures, and rejects mismatched pending requests.
Behavioral gating scenarios
src/lib/actions/sandbox/auto-pair-approval.test.ts
The sandbox harness models list gating, pending-state propagation, environment logging, receipts, and approval or rejection markers.
Cold-clone approval verification
test/helpers/openclaw-real-device-self-approval-proof.ts, test/openclaw-device-stored-auth-patch.test.ts
Runtime checks verify bounded scopes, request identifiers, transport options, successor requests, and unchanged primary state.
CLI dispatch cache isolation
test/package-contract/cli/config-set-cli-dispatch.test.ts
The dispatch test reloads and restores the public-dispatch and config-set command modules through a shared cache helper.

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

Sequence Diagram(s)

sequenceDiagram
  participant AutoPairApprovalScript
  participant OpenClawGateway
  participant ClonePendingState
  participant DeviceApproval
  AutoPairApprovalScript->>OpenClawGateway: request devices list
  OpenClawGateway-->>AutoPairApprovalScript: gated list failure
  AutoPairApprovalScript->>ClonePendingState: read pending.json
  ClonePendingState-->>AutoPairApprovalScript: matching pending request
  AutoPairApprovalScript->>DeviceApproval: approve bounded request
  DeviceApproval-->>AutoPairApprovalScript: approval receipt and scopes
Loading

Possibly related PRs

  • NVIDIA/NemoClaw#7658: Updates CI routing for changes to auto-pair-approval.ts, which is substantially modified here.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes a real testing aspect of the changes, but it does not identify the primary restored-clone pairing approval fix.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-restored-clone-pairing-gate

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

@github-code-quality

github-code-quality Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 9146a55 in the codex/fix-restored-c... branch remains at 96%, unchanged from commit 8c542b2 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 9146a55 in the codex/fix-restored-c... branch remains at 81%, unchanged from commit 8c542b2 in the main branch.

Show a code coverage summary of the most impacted files.
File main 8c542b2 codex/fix-restored-c... 9146a55 +/-
src/lib/messagi...etup-applier.ts 78% 68% -10%
src/lib/state/sandbox.ts 85% 81% -4%
src/lib/onboard...eway-service.ts 86% 82% -4%
src/lib/onboard...erfile-patch.ts 95% 93% -2%
src/lib/onboard.ts 31% 31% 0%
src/lib/actions...flight-phase.ts 96% 99% +3%
src/lib/platform.ts 84% 89% +5%
src/lib/onboard...shboard-port.ts 90% 96% +6%
src/lib/domain/.../connect-env.ts 89% 97% +8%
src/lib/onboard...eway-cutover.ts 70% 90% +20%

Updated August 03, 2026 16:17 UTC

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

🧹 Nitpick comments (3)
src/lib/actions/sandbox/auto-pair-approval.test.ts (1)

43-44: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Nit: keep negative assertions in one style.

Line 43 uses not.toContain while Line 44 uses includes(...).toBe(false); toContain/not.toContain also yields a better failure message than a bare boolean.

♻️ Suggested tweak
     expect(ordinary).not.toContain("local_identity_public_key");
-    expect(ordinary.includes("load_clone_local_pending")).toBe(false);
+    expect(ordinary).not.toContain("load_clone_local_pending");
🤖 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/actions/sandbox/auto-pair-approval.test.ts` around lines 43 - 44, In
the negative assertions for the ordinary result, update the
load_clone_local_pending check to use the same not.toContain matcher style as
the local_identity_public_key check, preserving the existing assertion target
and expected absence.
src/lib/actions/sandbox/auto-pair-approval.ts (2)

202-209: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional: single source for the clone state directory.

load_clone_local_pending re-derives OPENCLAW_STATE_DIR or '/sandbox/.openclaw', duplicating the same resolution in localDeviceFilter (Line 324). Emitting one shared state_dir helper in the prelude avoids the two copies drifting apart.

🤖 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/actions/sandbox/auto-pair-approval.ts` around lines 202 - 209,
Extract the OPENCLAW_STATE_DIR/default resolution into one shared
state-directory helper in the prelude, then update load_clone_local_pending and
localDeviceFilter to reuse it. Remove their duplicated fallback expressions
while preserving the existing pending-file lookup and state-directory behavior.

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

Link the retirement issue for this bounded fallback.

The comment states observable exit criteria (pinned OpenClaw release exposing a bootstrap/list API) but no GitHub issue/PR tracks retirement, so the clone-only path can outlive its window silently.

As per path instructions for src/**: "Retain an old path only for a demonstrated external/persisted-data contract or a bounded confidence/rollback window... link the retirement issue or PR in GitHub, and state observable exit criteria."

🤖 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/actions/sandbox/auto-pair-approval.ts` around lines 172 - 178, Update
the SOURCE_OF_TRUTH_REVIEW comment for the restored-clone gated-list fallback to
include a link to the GitHub issue or PR tracking its retirement. Preserve the
existing observable exit criterion requiring the pinned OpenClaw release to
expose a bootstrap/list API.

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 `@test/helpers/openclaw-real-device-self-approval-proof.ts`:
- Around line 1407-1423: Fix the primary-state isolation check around
primaryDevicesDir and the byte comparison by either wiring ${stateDir}-primary
into approveDevicePairing and the child process’s OPENCLAW_STATE_DIR/runtime
resolution so the comparison observes actual state, or removing this synthetic
directory and comparison. Preserve the meaningful coldPendingAfter.unrelated
assertion, and do not retain setup that can pass without exercising
primary-state isolation.

---

Nitpick comments:
In `@src/lib/actions/sandbox/auto-pair-approval.test.ts`:
- Around line 43-44: In the negative assertions for the ordinary result, update
the load_clone_local_pending check to use the same not.toContain matcher style
as the local_identity_public_key check, preserving the existing assertion target
and expected absence.

In `@src/lib/actions/sandbox/auto-pair-approval.ts`:
- Around line 202-209: Extract the OPENCLAW_STATE_DIR/default resolution into
one shared state-directory helper in the prelude, then update
load_clone_local_pending and localDeviceFilter to reuse it. Remove their
duplicated fallback expressions while preserving the existing pending-file
lookup and state-directory behavior.
- Around line 172-178: Update the SOURCE_OF_TRUTH_REVIEW comment for the
restored-clone gated-list fallback to include a link to the GitHub issue or PR
tracking its retirement. Preserve the existing observable exit criterion
requiring the pinned OpenClaw release to expose a bootstrap/list API.
🪄 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: e4a9c4e6-6705-4adb-a0d7-bdc7c941e858

📥 Commits

Reviewing files that changed from the base of the PR and between 3d88c04 and 2ff7866.

📒 Files selected for processing (4)
  • src/lib/actions/sandbox/auto-pair-approval.test.ts
  • src/lib/actions/sandbox/auto-pair-approval.ts
  • test/helpers/openclaw-real-device-self-approval-proof.ts
  • test/openclaw-device-stored-auth-patch.test.ts

Comment thread test/helpers/openclaw-real-device-self-approval-proof.ts Outdated
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

github-actions Bot commented Jul 27, 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 · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized terminology decisions differ; normalized E2E selections differ; severity counts match.
4 terminology differences from the second opinion

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

  • negative control at test/e2e/live/snapshot-commands.test.ts:344: selected only by the second-opinion lane as established.
  • source sandbox at test/e2e/live/snapshot-commands.test.ts:54: selected only by the second-opinion lane as established.
  • source pairing at test/e2e/live/snapshot-commands.test.ts:50: selected only by the second-opinion lane as justified.
  • clone-fixture at test/e2e/live/snapshot-commands.test.ts:344: selected only by the second-opinion lane as define.
1 additional E2E selection from the second opinion

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

  • security-posture: 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.

2 semantic terminology decisions

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

  • justified — source-pairing negative control at test/e2e/live/snapshot-commands.test.ts:50: Keep the term. The modifier identifies the source-sandbox contrast required by the test evidence.
  • justified — clone-fixture request at test/e2e/live/snapshot-commands.test.ts:344: Keep the term. The clone modifier distinguishes the expected request from the negative-control request.

E2E guidance

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

Recommended E2E: snapshot-commands

1 optional E2E recommendation
  • state-backup-restore

Workflow run details

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

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions github-actions Bot added v0.0.97 and removed v0.0.96 labels Jul 27, 2026
cv added 3 commits July 27, 2026 13:05
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request Jul 27, 2026
<!-- markdownlint-disable MD041 -->
## Summary

The trusted PR E2E controller evaluates risk-planner code from protected
`main`, not from the PR under review. Before #7652 can receive exact
`snapshot-commands` coverage, `main` must know that changes to the clone
pairing approval runtime require that job.

## Changes

- Map the exact `src/lib/actions/sandbox/auto-pair-approval.ts` runtime
path to the existing `snapshot-commands` E2E job.
- Add a focused deterministic risk-plan regression proving the
production path selects that job while the adjacent unit test does not.
- Keep authorization, dispatch, exact-SHA binding, workflow permissions,
and runtime behavior unchanged.

Dependency for #7652.

## Type of Change

- [x] 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

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: This internal CI-only change
adds one exact source path to existing deterministic E2E coverage. It
changes no user or contributor procedure, runtime contract, interface,
configuration, default, or schema.
- [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: Codex Desktop completed
the nine-category security review on exact SHA `5fe83a58e`; all
categories passed with no actionable findings. The mapping broadens
required coverage, not authorization or privilege.
- [ ] 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: `no-docs-needed`
- Evidence: No documentation change: this internal CI-only diff adds one
source path to existing deterministic `snapshot-commands` coverage and a
focused regression; no user or contributor procedure, interface,
configuration, runtime contract, or schema changed.
- Agent: Codex Desktop
<!-- docs-review-head-sha: 5fe83a5 -->
<!-- docs-review-agents-blob-sha: be20a09 -->

## DGX Station Hardware Evidence

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

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — command/result or justification: `npx
vitest run --project integration test/pr-risk-plan.test.ts` passed
67/67; `npm run build:cli` passed; `npm run typecheck:cli` passed; `npm
run check:diff` passed.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result:
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Carlos Villela <cvillela@nvidia.com>


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

## Summary by CodeRabbit

* **Bug Fixes**
* Updated end-to-end test selection so changes to restored gateway
pairing approval logic correctly focus the `snapshot-commands` job.
* Improved risk planning to associate these changes with the appropriate
focused E2E test family.

* **Tests**
* Added coverage verifying the runtime file-to-test job mapping and risk
plan behavior.

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

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor
✅ 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: Carlos Villela <cvillela@nvidia.com>
Comment thread src/lib/actions/sandbox/auto-pair-approval.test.ts Fixed

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

Maintainer security review refresh — exact head 5b350b1058b74117a1b8115401b1a61fd17d4f26 against base 795de982e26b400009bf1fc0f3826845d79acc4d: PASS. No security findings. Diff fingerprint: aff4010d694bd283db41465be96be6eeed3cdf91d560c469a6694297090a95da.

The verified merge commit preserves the exact reviewed patch (5792cf89c010ff3f32a600be740df6c73ced810a before and after refresh), and current main changed none of the ten PR files. The prior exact-head nine-category review therefore remains applicable.

I also checked the partial low-confidence second-opinion findings against the implementation. They do not change the PASS verdict: the timeout/concurrent-success paths re-read pinned post-approval state and require a rotated token different from previous_approval_token; inherited descriptors are deliberately clone-scoped, opened with O_DIRECTORY/O_NOFOLLOW/O_CLOEXEC, identity-checked, and passed only to the canonical approval child to close pathname races; and the alternate paired-token path is the accepted, one-approval compatibility path with pinned loopback, exact device/request/scope matching, and a documented removal condition.

The controller-selected protected E2E plan is appropriate for this credential and restored-clone boundary: cloud-inference, cloud-onboard, security-posture, onboard-repair, onboard-resume, and snapshot-commands (plan 49d007f6fce3addb3eb8d7cc1162a3667c699a2bfef2255229c361adb83ab301).

@cjagwani

Copy link
Copy Markdown
Collaborator

Exact-head protected evidence is now complete for 13b4f0c66f3eb7175ecbc82c6bf4c73850fe694d against base d52d4599a18490e7f8efc6e8062296fffcbea4a7 (plan 12cc8d7e...). Five selected jobs passed: cloud-inference, cloud-onboard, security-posture, onboard-repair, and onboard-resume. snapshot-commands failed, so I cannot approve this head.

The failure is in the changed restore contract, not an advisor or ordinary-CI issue: snapshot restore --to e2e-snapshot-clone returned exit 1 / restored-pairing-unverified. Its fixed diagnostic was:

Failure layer: supervisor not running - gateway restart failed for 'e2e-snapshot-clone'.
SUPERVISOR_NOT_RUNNING
State restored into 'e2e-snapshot-clone', but gateway pairing could not be verified.
Details: could not establish gateway pairing for 'e2e-snapshot-clone': supervisor not running

Run: https://github.com/NVIDIA/NemoClaw/actions/runs/30499870513/job/90737087871
Artifact: https://github.com/NVIDIA/NemoClaw/actions/runs/30499870513/artifacts/8743189426

This is also the second protected snapshot attempt to fail around the clone's managed-supervisor/config-guard handoff, though the exact symptom differs from the pre-refresh attempt. Please make the newly created/restored clone reach the trusted managed-supervisor availability boundary before beginning the deliberately non-retrying authorization sequence, and add a deterministic test for a clone that reports OpenShell Ready before its replacement supervisor/control session is usable. The authorization sequence itself should remain one bounded attempt with one verifier, as required by #7608.

I am not submitting a Changes Requested review and I am not modifying the branch (maintainer edits are disabled). I also reviewed and resolved the test-only CodeQL discussion with a false-positive explanation; the repository-wide alert was not dismissed.

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

@cjagwani

cjagwani commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Exact-head babysitting update for a54764576080997f7df767f1c14115352e01638f (plain comment; no Changes Requested review): ordinary CI is blocked only because the pre-commit formatter would modify test/e2e/live/snapshot-commands.test.ts. Biome wraps clonePairingRequests.filter((request) => request.auth === "ok").length so .length begins on the next line in the phase-4-pairing-inference-request-deltas.json object. All other ordinary-CI lanes passed. Please run the repository formatter and push that one mechanical change. The current net diff against the captured base is test-only and strengthens clone-vs-primary inference ownership evidence; it does not by itself provide the previously missing protected snapshot-commands success. The captured base 387cb08644fe030bb85146255f4b77e3c54697d2 is no longer current, so I did not rerun stale CI/E2E or approve this head.

cv added 3 commits August 3, 2026 01:22
@cv

cv commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict

PASS — Commit 9146a55fa3d4fc1aa495ce0c15727705222b82bf changes one live E2E test and introduces no production security surface. The source-sandbox negative control strengthens the test's sandbox-boundary evidence. The review found no security findings. Pending GitHub checks remain a separate merge gate.

Findings

No findings.

Detailed Analysis

  1. Secrets and Credentials — PASS. The new request contains fixed non-secret test data. The authenticated probe retains redactionValues: [inference.apiKey]; request artifacts record classifications and sizes, not authorization values or raw bodies.
  2. Input Validation and Data Sanitization — PASS. New shell substitutions use JSON.stringify on fixed path and request values. Sandbox names remain validated. Cleanup passes the fixed path as a direct rm argument, so no user-controlled shell input is added.
  3. Authentication and Authorization — PASS. The production authentication path is unchanged. The test still requires one clone request classified as authenticated and now also requires no source-sandbox negative-control request or source-owned session.
  4. Dependencies and Third-Party Libraries — PASS. No dependency, image, or package change.
  5. Error Handling and Logging — PASS. Setup, probe, and cleanup have fixed assertion labels. The emitted evidence contains counts and booleans. The fake inference recorder stores method, path, body size, authentication classification, authorization presence, model, and stream state; it does not store the credential or raw body.
  6. Cryptography and Data Protection — PASS. No cryptographic or persistent-data contract changes.
  7. Configuration and Security Headers — PASS. No production configuration, policy, port, container, or HTTP-header behavior changes. The marker is created inside the source sandbox with umask 077 and contains no data.
  8. Security Testing — PASS. The test now distinguishes clone execution from source-sandbox execution with a unique model request, requires exactly one clone-fixture request, and records zero negative-control requests. No broad local tests were run; GitHub CI is authoritative.
  9. System Security — PASS. The marker is installed before the awaited clone probe and removed in an asserted finally block through direct rm -f. The fake server records a request synchronously before responding, and the test reads the request delta only after the probe returns. The bounded interval between marker creation and its child-entry check is confined to the controlled test sandbox and does not add a production TOCTOU boundary.

Files Reviewed

Changed file:

  • test/e2e/live/snapshot-commands.test.ts

Supporting contracts:

  • test/e2e/fixtures/clients/sandbox.ts
  • test/e2e/fixtures/fake-openai-compatible.ts
  • test/e2e/lib/fake-openai-compatible-api.mts
  • test/e2e/live/snapshot-commands-helpers.ts

@cv cv changed the title fix(snapshot): approve restored clone pairing from local state test(e2e): add source-sandbox negative control for clone pairing Aug 3, 2026
@cjagwani

cjagwani commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Exact-head follow-up for 9146a55fa3d4fc1aa495ce0c15727705222b82bf: the eligible CI retry passed, selected snapshot-commands E2E passed, and replacement coordination check 91746289003 reports success. Approval is still blocked because the native required E2E / PR Gate remains red from observer job 91637336232, and its captured base 4cd4d64fe67143b57707f874afa0b9d269dfeff2 is behind current main 8c542b214f15561f71b262523d80a61ed4a5e9c7. Please refresh the branch so the repository can produce a fresh current-base required-gate result. This is a gate-status comment, not a Changes Requested review.

@github-actions github-actions Bot added v0.0.102 and removed v0.0.101 labels Aug 3, 2026

@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 the exact current revision. The live E2E negative control uses a fixed, JSON-quoted source-only marker, creates it with restrictive permissions, checks it synchronously before the pairing probe, and removes it in an asserted finally path. A misrouted probe emits a unique recorded model request and exits, while the expected clone path requires exactly one authenticated fixture request, clone-session presence, and source-session absence. The effective diff is test-only; current main did not change the supporting sandbox, fake-inference, or helper contracts. CI, CodeQL, advisors, platform checks, and the selected E2E gate pass. No blocking correctness, security, compatibility, or regression defect found.

@cv
cv merged commit 103b21f into main Aug 3, 2026
117 of 129 checks passed
@cv
cv deleted the codex/fix-restored-clone-pairing-gate branch August 3, 2026 23:37
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 area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants