Skip to content

fix(cli): preserve rebuild endpoint provenance - #7271

Closed
senthilr-nv wants to merge 1 commit into
NVIDIA:mainfrom
senthilr-nv:codex/fix-e2e-rebuild-endpoint-provenance
Closed

fix(cli): preserve rebuild endpoint provenance#7271
senthilr-nv wants to merge 1 commit into
NVIDIA:mainfrom
senthilr-nv:codex/fix-e2e-rebuild-endpoint-provenance

Conversation

@senthilr-nv

@senthilr-nv senthilr-nv commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Preserve compatible-endpoint provenance when an authoritative rebuild activates its provider-recovery receipt. Previously, the activation target dropped endpointSource, so the exact route check rejected an onboard-provenance receipt and the rebuild fell back to the default provider instead of reusing the OpenShell-stored credential.

Changes

  • Pass the current endpoint provenance into the registry route used to activate a rebuild recovery receipt.
  • Cover successful activation for matching onboard provenance and fail-closed rejection for mismatched inference-set provenance.
  • Detection gap: the existing activation test omitted endpoint provenance, so both receipt and target normalized to null and did not exercise the live E2E route identity.

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 restores the documented rebuild credential-reuse contract without changing the CLI or configuration surface.
  • 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: exact route matching remains fail closed; the new negative test verifies that mismatched endpoint provenance cannot activate a recovery receipt.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

DGX Station Hardware Evidence

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

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 check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — npx vitest run --project cli src/lib/onboard/authoritative-rebuild-target.test.ts (16 passed); npx vitest run --project integration test/onboard-remote-recreate-credential-reuse.test.ts (1 passed); npm run typecheck:cli passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • 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: Senthil Ravichandran senthilr@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved provider recovery rebuild handoffs by including the selected endpoint source in the ledger activation target route.
    • Recovery receipts now apply only when the receipt’s endpoint source matches the active session/flow context, avoiding stale or mismatched routing.
  • Tests

    • Updated provider recovery handoff tests to require matching endpoint source for authorized handoff and receipt activation.
    • Added a negative assertion to confirm no recovery receipt is returned when the flow context endpoint source is overridden.

@senthilr-nv senthilr-nv self-assigned this Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 098628b0-3011-4929-abb9-aa13e3ea52a9

📥 Commits

Reviewing files that changed from the base of the PR and between 93cefa7 and 25f4751.

📒 Files selected for processing (2)
  • src/lib/onboard/authoritative-rebuild-target.test.ts
  • src/lib/onboard/authoritative-rebuild-target.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/onboard/authoritative-rebuild-target.test.ts

📝 Walkthrough

Walkthrough

The provider-recovery rebuild flow now includes endpoint source metadata in receipt activation targets. Tests cover matching "onboard" provenance and reject a mismatched "inference-set" flow context.

Changes

Provider recovery endpoint provenance

Layer / File(s) Summary
Endpoint source matching and validation
src/lib/onboard/authoritative-rebuild-target.ts, src/lib/onboard/authoritative-rebuild-target.test.ts
Receipt activation targets include opts.endpointSource, defaulting to null. Tests define matching "onboard" metadata and verify mismatched "inference-set" context returns no provider recovery receipt.

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

Suggested labels: area: security, v0.0.89

Suggested reviewers: jyaunches, prekshivyas, cv

🚥 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 accurately reflects the main change: preserving endpoint provenance during rebuild handoff.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@senthilr-nv
senthilr-nv requested a review from jyaunches July 20, 2026 22:26
@senthilr-nv
senthilr-nv force-pushed the codex/fix-e2e-rebuild-endpoint-provenance branch from 6982f91 to 93cefa7 Compare July 20, 2026 22:28
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / high confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: No actionable findings remain in the canonical review ledger.

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 E2E selections differ; severity counts match.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

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

Recommended E2E: onboard-repair, onboard-resume, state-backup-restore, upgrade-stale-sandbox, cloud-onboard

2 optional E2E recommendations
  • sandbox-rebuild
  • inference-routing

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: Senthil Ravichandran <senthilr@nvidia.com>
@senthilr-nv
senthilr-nv force-pushed the codex/fix-e2e-rebuild-endpoint-provenance branch from 93cefa7 to 25f4751 Compare July 20, 2026 22:35
@senthilr-nv

Copy link
Copy Markdown
Collaborator Author

Live regression validation passed on the current verified head 25f4751a7: channels-add-remove E2E run 29784417976 completed successfully in 9m05s. This covers rebuild without a host COMPATIBLE_API_KEY, OpenShell-stored credential reuse, Telegram add/remove state, policy checks, and cleanup.

@senthilr-nv

Copy link
Copy Markdown
Collaborator Author

Required CI is currently blocked by an unrelated repository-wide dependency audit: reviewed-npm-audit detects the newly published critical node-tar advisory in the pre-existing reviewed OpenClaw archive graph. This PR changes only the authoritative rebuild target and its unit test; it does not modify package manifests, lockfiles, or the reviewed archive graph. No waiver is claimed here. All CLI test shards, type checks, CodeQL, automated reviews, and the focused live regression run passed.

@dfernandez365-rgb dfernandez365-rgb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Independent exact-head review: PASS on code merits.

The production blob is byte-identical to the direct-main hosted-verified candidate, the focused test is pre-fix-red and preserves fail-closed endpoint provenance, and exact-head channels-add-remove run 29784417976 passed 1/1 with recovery, inference, and cleanup evidence.

This approval does not waive the required reviewed-npm-audit failure. The pre-existing OpenClaw runtime graph still contains critical tar advisory GHSA-23hp-3jrh-7fpw; that repository-wide gate must be remediated before merge.

Non-blocking: adding Fixes #7256 would improve issue tracking.

@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: providers Inference provider integrations and provider behavior area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression labels Jul 21, 2026
@senthilr-nv

Copy link
Copy Markdown
Collaborator Author

Closing this because #7280 addresses the underlying vulnerability, so this PR is no longer required. Thanks for the work here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: providers Inference provider integrations and provider behavior 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.

3 participants