Skip to content

refactor(notebook): extract runtime selection workflows - #652

Merged
ewen-poch merged 1 commit into
mainfrom
refactor/notebook-runtime-selection-workflows
Aug 3, 2026
Merged

refactor(notebook): extract runtime selection workflows#652
ewen-poch merged 1 commit into
mainfrom
refactor/notebook-runtime-selection-workflows

Conversation

@ewen-poch

Copy link
Copy Markdown
Member

Problem

Notebook runtime selection behavior still lived inside Electron IPC registration: discovery, external-runtime validation, overlay preparation, persistence ordering, enablement, disable/revoke sequencing, usage projection, installation authorization, and manual interpreter catalog mutation. This made transport code the implicit application interface and obscured which component owned failure semantics.

Proposed change

Extract a transport-neutral RuntimeSelectionWorkflows module with nine application commands, then reduce runtime-ipc.ts to unchanged channel registration plus the one genuine Electron host adapter: the native interpreter picker.

flowchart LR
  E["Electron/local Web channels"] --> A["runtime-ipc adapter"]
  A --> W["RuntimeSelectionWorkflows: 9 commands"]
  A --> P["Electron native picker"]
  W --> S["Settings-owned persisted state"]
  W --> R["Runtime registry/discovery"]
  W --> O["Overlay preparation"]
  W --> V["Runtime revoke callback"]
Loading

The workflow owns:

  • survey, listEnvironments, setSelection, getEnablement, and describeUsage;
  • setEnvironmentEnabled, setInstallAuthorized, register, and unregister.

Scope and non-goals

  • Preserve the exact ten Electron/local Web channels: nine application commands plus runtime:pick-interpreter.
  • Preserve Remote Web availability: four reads remain available; five mutations and the native picker remain denied.
  • Preserve external Python validation and R managed-only rejection before persistence.
  • Preserve readiness -> prepare -> persist -> fresh survey -> selected-runtime readiness ordering.
  • Preserve disable persistence before revoke; revoke failure propagates without rolling back the durable disabled state.
  • Preserve native picker cancel/error-to-null behavior and application error identity through IPC.
  • Do not change src/main/ipc.ts, preload/Web/HTTP/CLI/shared contracts, wire schemas, persistence format, data relationships, UI, or capability availability.
  • Specialist, Permission, and Compute asymmetry is unchanged.
  • Issue [Feature]: Provider-neutral multi-agent research orchestration #458 remains forward-compatible only; no orchestration state, method, event, or relationship is added.

Commits and size

  1. refactor(notebook): extract runtime selection workflows

Final diff: four Notebook files. Production churn is 427 changed lines; test churn is 945 changed lines because behavior coverage moved from the IPC harness to the workflow seam. The production diff is within the 425–505 preflight estimate and below the 520 re-review stop and 700 hard stop.

Acceptance criteria and validation

Branch head 3274846 is based on origin/main 5cfd4d1, ahead/behind 1/0, with a clean worktree.

  • Nine-command workflow and exact ten-channel/picker/error adapter behavior -> focused workflow + IPC tests -> 20/20 passed.
  • Registry, runtime adapters, discovery, and overlay compatibility -> four focused files -> 49/49 passed.
  • Latest preload/generated Web/remote HTTP surface, including Global Search's new map entry -> final 10-file affected/surface suite -> 140/140 passed on 5cfd4d1.
  • Node/Web compile compatibility -> npm run typecheck -> passed on the final head.
  • Changed-file formatting/static policy -> Prettier plus ESLint --max-warnings=0 -> passed with zero findings.
  • Repository static policy -> npm run lint -> 0 errors; 18 warnings are unchanged baseline files.
  • Repository regression suite -> npm test -> passed on the final head. The pre-rebase full run reported 685 files passed / 15 skipped and 10,024 tests passed / 184 skipped; after the non-overlapping Global Search rebase, the exact final suite again exited successfully.
  • Patch integrity -> git diff --check -> passed.
  • Independent final review -> Spec: 0 findings; Standards: 0 findings. The initial Spec P2/P3 test-evidence gaps were fixed before final review.

The branch rebased without production/test conflicts from 38be3a8 to 5cfd4d1. The named pre-rebase stash remains as a temporary recoverable backup and is not part of the commit.

Review focus

  • Confirm application ordering has left IPC and the adapter only translates/forwards.
  • Confirm the native picker remains transport-owned without a speculative one-implementation port.
  • Confirm disable persists before revoke and revoke failure does not silently re-enable the runtime.
  • Confirm no remote capability, public contract, persisted state, or UI changed.

Residual risk

No live interpreter selection, packaged Electron picker, or manually paired remote-browser journey was run locally. Focused integration tests cover the workflow/adapter and surface contracts; exact-head CI remains the merge gate.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codex Review

Verdict: mergeable

No actionable findings.

Summary: Static inspection found no concrete merge-blocking defects in the pull request changes. Branch and title prechecks are valid; tests and validation commands were not run per instruction.

@github-actions github-actions Bot added the ready-to-merge All completed AI reviewers found this pull request mergeable. label Aug 3, 2026
@ewen-poch
ewen-poch merged commit 5be88bf into main Aug 3, 2026
23 checks passed
@ewen-poch
ewen-poch deleted the refactor/notebook-runtime-selection-workflows branch August 3, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge All completed AI reviewers found this pull request mergeable.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant