Skip to content

refactor(onboard): use strict runner for provider entry - #7677

Merged
cv merged 1 commit into
codex/onboard-fsm-core-effect-boundaryfrom
codex/onboard-fsm-provider-entry
Jul 28, 2026
Merged

refactor(onboard): use strict runner for provider entry#7677
cv merged 1 commit into
codex/onboard-fsm-core-effect-boundaryfrom
codex/onboard-fsm-provider-entry

Conversation

@cv

@cv cv commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

This final stack layer makes exact provider_selection entries use the strict FSM runner for fresh and resumed sessions. Compatibility replay remains for saved sessions already at inference, sandbox, a branch state, or a final-flow handoff state.

Stack layer 6 of 6. Base: codex/onboard-fsm-core-effect-boundary.

Related Issue

Refs #6224

Changes

  • Remove provider_selection from the resume compatibility state set.
  • Apply provider-selection, inference, sandbox, and branch transitions through the strict runner at exact entry.
  • Preserve compatibility repair for all downstream resume states.
  • Strengthen tests for context propagation, one sandbox effect, transition kinds, and the absence of compatibility recorders on strict entry.

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: Provider-entry runner ownership changes internally; commands, output, configuration, and supported onboarding behavior are unchanged.
  • 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: Independent Codex review of the exact six-commit stack found no actionable findings and verified strict entry, compatibility bounds, state durability, recovery, rollback, and fail-closed behavior.
  • 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: Exact provider entry now uses the strict runner with transition and context tests; downstream compatibility remains covered and existing lifecycle contracts stay accurate.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit: Not applicable
  • Station profile/scenario: Not applicable
  • Result: Not applicable; scripts/prepare-dgx-station-host.sh is unchanged.
  • Supporting evidence: Not applicable

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 — exact stack-head FSM selection: PASS (9 files, 112 tests); focused CLI Vitest: PASS (18 tests); focused integration Vitest: PASS (12 tests); CLI type-check: PASS.
  • Applicable broad gate passed — the exact-branch GitHub cli-tests aggregate passed.
  • 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

Summary by CodeRabbit

  • Bug Fixes

    • Improved onboarding flow behavior when resuming from a provider selection step.
    • Ensured resumed onboarding continues through the appropriate downstream phases without incorrectly reprocessing the provider selection step.
    • Improved consistency of final session state after sandbox completion.
  • Tests

    • Expanded coverage for fresh and resumed onboarding scenarios.
    • Added validation for phase execution order, state transitions, and strict-runner behavior.

@cv cv self-assigned this Jul 28, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ddb322c9-0251-4a4f-9c20-bff1de8770d6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/onboard-fsm-provider-entry

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

@github-code-quality

github-code-quality Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit d1793ee in the codex/onboard-fsm-pr... branch remains at 96%, unchanged from commit 2540869 in the codex/onboard-fsm-co... branch.

TypeScript / code-coverage/cli

The overall coverage in commit d1793ee in the codex/onboard-fsm-pr... branch remains at 81%, unchanged from commit 6c43fe2 in the codex/onboard-fsm-co... branch.

Show a code coverage summary of the most impacted files.
File codex/onboard-fsm-co... 6c43fe2 codex/onboard-fsm-pr... d1793ee +/-
src/lib/onboard...ne-recorders.ts 100% 89% -11%
src/lib/policy/...ne-exclusion.ts 97% 91% -6%
src/lib/onboard...e-flow-slice.ts 100% 95% -5%
src/lib/onboard...-flow-phases.ts 100% 96% -4%
src/lib/onboard...ime-boundary.ts 85% 84% -1%
src/lib/onboard.ts 31% 31% 0%
src/lib/onboard...-flow-phases.ts 83% 83% 0%
src/lib/onboard...finalization.ts 100% 100% 0%
src/lib/sandbox...rce-identity.ts 88% 88% 0%

Updated July 28, 2026 00:55 UTC

@github-actions

github-actions Bot commented Jul 28, 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 · medium confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Skipped

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

@cv
cv marked this pull request as ready for review July 28, 2026 01:39

@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/machine/core-flow-phases.ts (1)

262-272: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Link the retirement issue for this transitional fallback.

The comment states good exit criteria ("Remove this fallback once those checks are strict FSM recovery states and legacy machine step mutation is gone") but doesn't reference a tracking issue/PR. Since this PR only migrates the provider_selection slice of a larger fallback, the remaining teardown (inference/sandbox/branch/final-handoff states) should be linked to a GitHub issue.

As per path instructions, "Retain an old path only for a demonstrated external/persisted-data contract or a bounded confidence/rollback window. Keep the replacement authoritative, freeze the old path against new callers and features, link the retirement issue or PR in GitHub, and state observable exit criteria" and "If a PR intentionally migrates only a slice, it must say so and link the remaining work in GitHub."

🤖 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/core-flow-phases.ts` around lines 262 - 272, Update
the transitional fallback comment near runLiveOnboardFlowSlice to explicitly
link the GitHub issue or PR tracking retirement of the remaining inference,
sandbox/branch, and final-handoff fallback states. Preserve the existing exit
criteria and clarify that this change migrates only the provider_selection slice
while the linked work covers the remaining teardown.

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.

Nitpick comments:
In `@src/lib/onboard/machine/core-flow-phases.ts`:
- Around line 262-272: Update the transitional fallback comment near
runLiveOnboardFlowSlice to explicitly link the GitHub issue or PR tracking
retirement of the remaining inference, sandbox/branch, and final-handoff
fallback states. Preserve the existing exit criteria and clarify that this
change migrates only the provider_selection slice while the linked work covers
the remaining teardown.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: aeb7880f-a117-4917-a83d-107ba7bbe0f9

📥 Commits

Reviewing files that changed from the base of the PR and between bc6ddd3 and d1793ee.

📒 Files selected for processing (2)
  • src/lib/onboard/machine/core-flow-phases.test.ts
  • src/lib/onboard/machine/core-flow-phases.ts

@cv
cv merged commit be3764a into codex/onboard-fsm-core-effect-boundary Jul 28, 2026
109 of 110 checks passed
@cv
cv deleted the codex/onboard-fsm-provider-entry branch July 28, 2026 01:46
@wscurran wscurran added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: providers Inference provider integrations and provider behavior area: routing Request routing, policy routing, model selection, or fallback logic refactor PR restructures code without intended behavior change labels Jul 29, 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: providers Inference provider integrations and provider behavior area: routing Request routing, policy routing, model selection, or fallback logic refactor PR restructures code without intended behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants