Skip to content

chore(pi): organize mode implementations - #6362

Merged
BillLeoutsakosvl346 merged 2 commits into
stagingfrom
refactor/pi-mode-folders
Aug 8, 2026
Merged

chore(pi): organize mode implementations#6362
BillLeoutsakosvl346 merged 2 commits into
stagingfrom
refactor/pi-mode-folders

Conversation

@BillLeoutsakosvl346

@BillLeoutsakosvl346 BillLeoutsakosvl346 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • move PI implementations and colocated tests into explicit core, cloud, and local folders
  • update direct imports and test mocks for the relocated files
  • keep the existing PI handler, mode logic, execution behavior, and public interfaces unchanged

Type of Change

  • Refactor

Testing

  • PI executor and block suites (22 files, 360 tests)
  • full workspace type-check
  • lint, block registry, import specifiers, monorepo boundaries, and the complete pre-ship audit suite

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Existing tests pass after relocation
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 8, 2026 10:01pm

Request Review

@cursor

cursor Bot commented Aug 7, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Pure refactor with import path updates only; Pi handler routing and sandbox logic are unchanged, so risk is limited to missed import rewrites rather than functional regressions.

Overview
Reorganizes the Pi executor handler tree so shared code lives under core/, sandbox/GitHub modes under cloud/ (authoring, babysit, review, shared helpers), and local dev under local/, with tests moved alongside each module.

Import paths are updated everywhere that referenced the old flat filenames (e.g. keyscore/keys, cloud-backendcloud/authoring/backend, babysit-githubcloud/babysit/github, sim-toolslocal/sim-tools). The Pi block test now imports PI_SEARCH_PROVIDERS from core/keys to keep block and executor registries aligned.

pi-handler and all affected Vitest mocks point at the new locations; runtime behavior, mode routing, and public types are unchanged—this is structure and references only.

Reviewed by Cursor Bugbot for commit 6c94d74. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR reorganizes the PI executor implementation into explicit core, cloud, and local areas without changing its public handler interface.

  • Moves shared contracts, event handling, key resolution, SDK integration, and redaction into core/.
  • Groups cloud authoring, review, babysit, GitHub, and shared sandbox code under cloud/.
  • Groups local execution and tool implementations under local/.
  • Updates runtime imports, test imports, and mocks to use the relocated modules.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/executor/handlers/pi/pi-handler.ts Preserves the PI handler entry point while redirecting mode and shared-module imports to the new folder structure.
apps/sim/executor/handlers/pi/cloud/authoring/backend.ts Relocates cloud authoring execution and updates its internal dependencies without behavioral changes.
apps/sim/executor/handlers/pi/cloud/review/backend.ts Relocates cloud review execution and consistently updates imports for review tools, GitHub helpers, and core services.
apps/sim/executor/handlers/pi/cloud/babysit/backend.ts Relocates babysit execution and updates its cloud and core dependency paths.
apps/sim/executor/handlers/pi/local/backend.ts Relocates local PI execution and redirects shared and SSH-tool imports to the organized modules.
apps/sim/executor/handlers/pi/core/backend.ts Relocates shared PI backend contracts while preserving their definitions and updating type dependencies.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Registry[Executor handler registry] --> Handler[PI handler]
  Handler --> Core[core: contracts, context, events, keys, SDK, redaction]
  Handler --> CloudAuthoring[cloud/authoring]
  Handler --> CloudReview[cloud/review]
  Handler --> Local[local: backend and tools]
  CloudAuthoring --> CloudShared[cloud/shared]
  CloudAuthoring --> Babysit[cloud/babysit]
  CloudAuthoring --> GitHub[cloud/github-pr]
  CloudReview --> CloudShared
  CloudReview --> GitHub
  CloudAuthoring --> Core
  CloudReview --> Core
  Local --> Core
  Handler --> Search[search]
  Search --> Core
Loading

Reviews (3): Last reviewed commit: "chore(pi): organize mode implementations" | Re-trigger Greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cursor review

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c193a14. Configure here.

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cursor review

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c212383. Configure here.

…olders

# Conflicts:
#	apps/sim/executor/handlers/pi/cloud/authoring/backend.ts
#	apps/sim/executor/handlers/pi/cloud/babysit/round.ts
#	apps/sim/executor/handlers/pi/cloud/review/backend.ts
#	apps/sim/executor/handlers/pi/local/backend.test.ts
#	apps/sim/executor/handlers/pi/local/backend.ts
@BillLeoutsakosvl346
BillLeoutsakosvl346 merged commit a477a52 into staging Aug 8, 2026
29 checks passed
@waleedlatif1
waleedlatif1 deleted the refactor/pi-mode-folders branch August 9, 2026 00:01
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