Skip to content

refactor: group Pi provider modules by owner - #41162

Merged
nwparker merged 2 commits into
mainfrom
module-layout-v2/pi-owners-8ae4
Nov 11, 2026
Merged

nwparker merged 2 commits into
mainfrom
module-layout-v2/pi-owners-8ae4

Conversation

@nwparker

@nwparker nwparker commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Pi's integration now groups its existing code by managed extensions, RPC sessions and transcripts. Callers import each operation from its defining module.

Files Added Deleted Net
Test 63 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​112 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2545 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2433
Prod 73 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​263 $\color{#cf222e}{\Huge{\mathbf{−}}}$​284 $\color{#cf222e}{\Huge{\mathbf{−}}}$​21

What Changed

  • Move 81 files into concrete domains; retain three substantive provider definition/metadata/registration owners at the root.
  • Remove seven borrowed exports and redirect 17 binding slots to defining owners, including the titlebar service's safety alias.
  • Keep captured RPC recordings with their consumers. Repair TypeScript includes, runtime smoke entries, workflow history triggers and exact baseline/timing/admission selectors.
  • Apply repository test policy: retire 43 complete registrations across 17 whole Programs and partial suites (23 own / 20 required external); preserve 53 registrations (33 own / 20 external). Remove exact retired metadata rows and newly unused fixture bindings. Keep the canonical-provider early-exit case unchanged: its dispatch count observes the public provider boundary.

Why

The flat provider directory mixed emitted agent extensions, live RPC controllers, launch/options/history/prompt handling and transcript import. Domain owners make those responsibilities visible without new barrels or compatibility aliases.

Linked Issue

Maintainer-requested module layout cleanup.

Visual Proof

N/A — production visual and interaction behavior is preserved.

Testing

  • Full typecheck, formatting and basic lint pass. The existing regexp-style warning in the moved prompt owner remains outside changed-code diagnostics.
  • On actual main f820fdf8, all 28 retained owning suites and 77 examples pass in 9.52 seconds with two workers, per-file isolation and background launch. This includes the restored public-provider early-exit case. Two existing rendered E2E registrations are retained and were not run locally.
  • CLI and production Electron builds pass on macOS.
  • All ten JSONL recordings retain exact bytes. Ten actual generated extension/bridge variants and emitted filename constants exactly match native 8ae4823; the actual embedded smoke-tool stdin entry bundles successfully.
  • Source/initialization and independent candidate audits preserve generated-source composers, defining-owner bindings, runtime metadata identity, lazy adapter creation and canonical state owners. The actual Electron/Orcad graph keeps implementation owners; standalone imports shed incidental pure initialization, as reviewed.
  • Final pnpm check:changed --timeout=3 --maxWorkers=2 passes all 33 non-test checks. The broad related-test selection times out at three minutes without reported assertion/collection failures; this is incomplete test evidence, not a pass. The focused 28-suite run above passes on the exact rebased candidate.
  • Rebased onto actual CI-repair squash f820fdf8. Independent whole-tree carry preserves every accepted Pi file/resource and the native deletions/metadata unions. Prior typecheck/build/generated-output evidence applies to byte-identical production source; fresh hosted checks remain required before merge.

Risk

Level: Low for production. Import/resource/selector mistakes could break provider startup, generated extension installation or Pi/OMP/Prime reporting. Exact resource/generated-source comparisons, concrete binding audits, builds and existing public behavior tests cover these boundaries. A plain revert restores the previous layout.

Test retirement intentionally reduces coverage. Several retired cases mixed forbidden copy, internal counts or derived oracles with useful checks for retry recovery, launch identity, prompt/image handling, titlebar lifecycle and PTY integration. No equivalent replacement coverage is claimed; retained callbacks and setup are reconciled individually without assertion surgery.

Review

Original Pi scope provenance is explicit: all 48 original production identities and nine original recordings survive; historical test absences receive no new authored retirement credit. Original and native-added current identities remain individually accounted for.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer material copied or translated.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Pi managed-extension and RPC imports now match their nested module paths. The change updates related build, workflow, test, and CI configuration paths. It adds focused tests for RPC launch validation and prompt rejection cases. It also removes selected tests across PTY, Pi, agent-session, and end-to-end areas, with corresponding test-inventory updates.

Merge Risk: Low · up to f5b8e

This is a file-layout refactor with no runtime logic changes shown. Some regression coverage for the PTY early-exit registration path was removed, and the broader test run did not complete, so owners should be aware before merging.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: grouping Pi provider modules by owner.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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 The description is mostly complete. It includes ELI5, change scope, rationale, testing evidence, visual-proof status, risk, review context, and the agent-skill boundary. The Notes and Checklist sectio…
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 50 files. (39 skipped: 5 unsupported, 34 over the file limit.)

Full details: Description check

Explanation

The description is mostly complete. It includes ELI5, change scope, rationale, testing evidence, visual-proof status, risk, review context, and the agent-skill boundary. The Notes and Checklist sections are missing, and the Linked Issue section does not contain an issue reference; however, the stated maintainer context may permit omitting a new issue.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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

Additional comments: 1

src/main/ipc/pty/pty-controller-ownership-routing.test.ts: 1

81-81: Trivial · Maintainability & Code Quality · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Restore the early-exit registration test.

The removed test checked that an owner exiting before the spawn reply is not registered and that its pending registration is cancelled. The PR reports no equivalent replacement. Retain this test to protect the admission and cancellation sequence.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 36ff1d85-84fc-453c-ad7d-070f7ee6ffd2
Commits

Reviewing files that changed from the base of the PR and between 8ae4823 and f5b8edd.

Files selected for processing: 136

  • .github/workflows/pi-provider-runtime.yml
  • config/flaky-test-pattern-baseline.txt
  • config/main-sync-fs-baseline.txt
  • config/scripts/ci/sharding/ci-shard-timings.json
  • config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs
  • config/tsconfig.tc.web.json
  • config/tsconfig.web.json
  • src/main/agent-hooks/wsl-relay/wsl-hook-relay-deps.ts
  • src/main/ai-vault/structured-chat-cli-fork.ts
  • src/main/ipc/pty-claude-agent-view-readiness.test.ts
  • src/main/ipc/pty-degraded-fallback-single-ingest.test.ts
  • src/main/ipc/pty-spawn-saved-resume-admission.test.ts
  • src/main/ipc/pty/host-env/assembly.ts
  • src/main/ipc/pty/host-env/opencode-hook-installation.test.ts
  • src/main/ipc/pty/provider/state-cleanup.ts
  • src/main/ipc/pty/pty-closed-pane-spawn-refusal.test.ts
  • src/main/ipc/pty/pty-controller-ownership-routing.test.ts
  • src/main/ipc/pty/pty-controller-spawn-admission.test.ts
  • src/main/ipc/pty/pty-daemon-spawn-session-identity.test.ts
  • src/main/ipc/pty/pty-pane-reservation-settlement.test.ts
  • src/main/ipc/pty/pty-pane-restart-replace.test.ts
  • src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts
  • src/main/ipc/pty/pty-runtime-ssh-binding-persistence.test.ts
  • src/main/ipc/pty/pty-session-liveness-and-ownership.test.ts
  • src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts
  • src/main/ipc/pty/pty-ssh-stop-verdict.test.ts
  • src/main/ipc/pty/pty-write-ipc-validation.test.ts
  • src/main/native-chat/agent-session-journal/history-import/adopted-transcript-source.ts
  • src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-options-read-scaling.test.ts
  • src/main/pi/agent-status-compaction.test.ts
  • src/main/pi/agent-status-omp-plan-review.test.ts
  • src/main/pi/agent-status-reload-delivery.test.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-compaction-source.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-completion-delivery.test.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-extension-nested-run-settlement.test.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-extension-session-change.test.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-extension-source.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-extension-test-harness.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-handler-source.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-input-redaction-source.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-input-redaction.test.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-post-queue-source.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-runtime-detection-source.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-session-boundary-source.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-subagent-event-fixtures.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-subagent-roster-source.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-ui-prompt-source.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-wsl-curl-source.ts
  • src/main/pi/managed-extensions/agent-status/omp-model-command-source.test.ts
  • src/main/pi/managed-extensions/agent-status/omp-model-command-source.ts
  • src/main/pi/managed-extensions/agent-status/omp-plan-review-source.ts
  • src/main/pi/managed-extensions/agent-status/omp-session-status-owner-source.ts
  • src/main/pi/managed-extensions/legacy-omp-overlay-migration.ts
  • src/main/pi/managed-extensions/prefill-extension-source.ts
  • src/main/pi/managed-extensions/titlebar-extension-lifetime-source.ts
  • src/main/pi/managed-extensions/titlebar-extension-service.test.ts
  • src/main/pi/managed-extensions/titlebar-extension-service.ts
  • src/main/pi/managed-extensions/titlebar-extension-source.ts
  • src/main/pi/omp-transcript-metadata.test.ts
  • src/main/pi/rpc-launch.test.ts
  • src/main/pi/rpc-prompt.test.ts
  • src/main/pi/rpc-runtime-metadata.ts
  • src/main/pi/rpc-runtime-registration.ts
  • src/main/pi/rpc-session-adapter.test.ts
  • src/main/pi/rpc/__fixtures__/background-work.jsonl
  • src/main/pi/rpc/__fixtures__/command-only.jsonl
  • src/main/pi/rpc/__fixtures__/compaction.jsonl
  • src/main/pi/rpc/__fixtures__/dialogs.jsonl
  • src/main/pi/rpc/__fixtures__/provider-fetch-error.jsonl
  • src/main/pi/rpc/__fixtures__/provider-socket-error.jsonl
  • src/main/pi/rpc/__fixtures__/signed-out.jsonl
  • src/main/pi/rpc/__fixtures__/steer-followup.jsonl
  • src/main/pi/rpc/__fixtures__/stop-mid-tool.jsonl
  • src/main/pi/rpc/__fixtures__/subagent-wake.jsonl
  • src/main/pi/rpc/background-work/rpc-background-work-bridge-source.ts
  • src/main/pi/rpc/background-work/rpc-background-work-bridge.ts
  • src/main/pi/rpc/background-work/rpc-background-work.test.ts
  • src/main/pi/rpc/background-work/rpc-background-work.ts
  • src/main/pi/rpc/history/rpc-history-capture.ts
  • src/main/pi/rpc/history/rpc-history-catch-up.ts
  • src/main/pi/rpc/history/rpc-history-import.ts
  • src/main/pi/rpc/history/rpc-history-journal-view.ts
  • src/main/pi/rpc/history/rpc-session-file-tail.ts
  • src/main/pi/rpc/launch/rpc-launch-resolution.ts
  • src/main/pi/rpc/launch/rpc-launch.test.ts
  • src/main/pi/rpc/launch/rpc-launch.ts
  • src/main/pi/rpc/options/rpc-model-catalog-probe.ts
  • src/main/pi/rpc/options/rpc-model-options.ts
  • src/main/pi/rpc/options/rpc-model-schema.ts
  • src/main/pi/rpc/options/rpc-options.ts
  • src/main/pi/rpc/pi-scripted-child.test-fixture.ts
  • src/main/pi/rpc/prompts/rpc-prompt-delivery.test.ts
  • src/main/pi/rpc/prompts/rpc-prompt-delivery.ts
  • src/main/pi/rpc/prompts/rpc-prompt.test.ts
  • src/main/pi/rpc/prompts/rpc-prompt.ts
  • src/main/pi/rpc/rpc-compaction.ts
  • src/main/pi/rpc/rpc-context-usage.ts
  • src/main/pi/rpc/rpc-dialog-callbacks.ts
  • src/main/pi/rpc/rpc-exit-classification.ts
  • src/main/pi/rpc/rpc-extension-dialogs.ts
  • src/main/pi/rpc/rpc-failure-cleanup.ts
  • src/main/pi/rpc/rpc-idle-check.ts
  • src/main/pi/rpc/rpc-message-dispatch.ts
  • src/main/pi/rpc/rpc-messages.test.ts
  • src/main/pi/rpc/rpc-messages.ts
  • src/main/pi/rpc/rpc-protocol.ts
  • src/main/pi/rpc/rpc-retry-activity.ts
  • src/main/pi/rpc/rpc-session-adapter.test-fixture.ts
  • src/main/pi/rpc/rpc-session-adapter.ts
  • src/main/pi/rpc/rpc-session-rename.test.ts
  • src/main/pi/rpc/rpc-session-startup.test.ts
  • src/main/pi/rpc/rpc-session-startup.ts
  • src/main/pi/rpc/rpc-session.ts
  • src/main/pi/rpc/rpc-startup-open.ts
  • src/main/pi/rpc/rpc-startup-outcome.ts
  • src/main/pi/rpc/rpc-turn-races.test.ts
  • src/main/pi/rpc/rpc-turns.ts
  • src/main/pi/titlebar-extension-source.test.ts
  • src/main/pi/transcripts/pi-session-history.ts
  • src/main/pi/transcripts/pi-transcript-import.ts
  • src/main/pty/shell-startup/pi-process-owner-env.test.ts
  • src/main/runtime/agent-session/launch/structured-agent-launch-composition.test-support.ts
  • src/main/runtime/agent-session/model-catalog/structured-agent-model-catalog-owner.test.ts
  • src/main/runtime/agent-session/structured-agent-session-adapter-start-failure.test.ts
  • src/main/runtime/agent-session/structured-agent-session-pi-signed-out-start.test.ts
  • src/main/runtime/agent-session/structured-agent-session-transport-overrides.ts
  • src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-continuation-context.test.ts
  • tests/e2e/omp-child-session-recovery.unit.test.ts
  • tests/e2e/omp-completion-retry-status.spec.ts
  • tests/e2e/omp-prefill-runtime.spec.ts
  • tests/e2e/pty-spawn-cwd-folder-owner.unit.test.ts
  • tests/tools/omp-completion-runtime-smoke.mjs
  • tests/tools/omp-config-root-local-shell.test.mjs
  • tests/tools/omp-model-runtime-smoke.mjs
  • tests/tools/omp-transcript-runtime-smoke.mjs
  • tests/tools/pi-owner-runtime-smoke.mjs
Files with no reviewable changes: 23

  • src/main/pi/managed-extensions/agent-status/agent-status-input-redaction.test.ts
  • src/main/ipc/pty-claude-agent-view-readiness.test.ts
  • config/flaky-test-pattern-baseline.txt
  • src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-options-read-scaling.test.ts
  • tests/e2e/omp-child-session-recovery.unit.test.ts
  • src/main/pi/rpc-session-adapter.test.ts
  • src/main/runtime/agent-session/model-catalog/structured-agent-model-catalog-owner.test.ts
  • src/main/pi/agent-status-omp-plan-review.test.ts
  • src/main/pi/rpc-launch.test.ts
  • src/main/pi/rpc-prompt.test.ts
  • src/main/pi/titlebar-extension-source.test.ts
  • src/main/runtime/agent-session/structured-agent-session-pi-signed-out-start.test.ts
  • src/main/pty/shell-startup/pi-process-owner-env.test.ts
  • src/main/pi/agent-status-reload-delivery.test.ts
  • src/main/ipc/pty-degraded-fallback-single-ingest.test.ts
  • src/main/runtime/agent-session/structured-agent-session-adapter-start-failure.test.ts
  • src/main/pi/managed-extensions/agent-status/agent-status-completion-delivery.test.ts
  • tests/tools/omp-config-root-local-shell.test.mjs
  • tests/e2e/pty-spawn-cwd-folder-owner.unit.test.ts
  • src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-continuation-context.test.ts
  • src/main/pi/agent-status-compaction.test.ts
  • src/main/pi/rpc/rpc-messages.test.ts
  • src/main/pi/omp-transcript-metadata.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@nwparker
nwparker force-pushed the module-layout-v2/pi-owners-8ae4 branch from f5b8edd to 9e0e3cd Compare November 11, 2026 16:39
@nwparker
nwparker merged commit 4b241c1 into main Nov 11, 2026
62 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant