refactor(pebble): convert orchestrator.py into a package (slice 0 of PR #191 carve) - #204
Open
jpb33333 wants to merge 1 commit into
Open
refactor(pebble): convert orchestrator.py into a package (slice 0 of PR #191 carve)#204jpb33333 wants to merge 1 commit into
jpb33333 wants to merge 1 commit into
Conversation
Pure refactor with zero behavior change. Renames pebble/orchestrator.py to pebble/orchestrator/_pipeline.py and adds an __init__.py that re-exports the seven symbols imported by callers outside the package today (ProspectBudgetTracker, research_single_prospect, score_source_richness, activate_foragers, quorum_verify_claims, synthesize_profile, verify_urls). Single-dot relative imports inside _pipeline.py become double-dot since the file now sits one level deeper. This is slice 0 of carving PR #191 (feat/pebble-l2-swarm) into focused slices off current dev. See ~/.claude/plans/pr191-carve-strategy.md. The orchestrator package is the foundation: future slices add sibling modules (schemas.py, planner.py, renderer.py, ...) under this same package. Verification: - pebble suite: 290 passed (unchanged) - financial_forecasting suite: 827 passed, 22 skipped (unchanged) - All seven re-exported symbols import cleanly: `from pebble.orchestrator import ProspectBudgetTracker, ...` succeeds with no warnings. Callers verified unchanged on dev: - pebble/main.py:591 — from .orchestrator import research_single_prospect - pebble/clusters/__init__.py:15 — from ..orchestrator import ProspectBudgetTracker - pebble/handlers/tier2.py:41 — from ..orchestrator import (score_source_richness, activate_foragers, ProspectBudgetTracker) - pebble/handlers/tier3.py:33 — from ..orchestrator import (research_single_prospect, quorum_verify_claims, synthesize_profile, verify_urls, ProspectBudgetTracker) - pebble/tests/test_clusters.py — 4 imports of ProspectBudgetTracker Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, push a new commit or reopen this pull request to trigger a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pure refactor with zero behavior change. Renames
pebble/orchestrator.py(862 lines, untouched in content) topebble/orchestrator/_pipeline.pyand addspebble/orchestrator/__init__.pythat re-exports the seven symbols imported by callers outside the package today.This is slice 0 of carving PR #191 (
feat/pebble-l2-swarm) into focused slices off currentdev. The orchestrator package is the foundation: future slices add sibling modules (schemas.py,planner.py,renderer.py, …) under this same package.Why
PR #191 currently can't be merged in any form — it's stale enough to phantom-delete CODEOWNERS, all home pages, and the entire projects-overhaul. Splitting it in place would carry those phantom deletions into every slice. So the strategy is carve: start fresh branches off current
dev, copy over only intentional L2 swarm additions. See~/.claude/plans/pr191-carve-strategy.mdfor the full 12-slice plan.This slice unblocks every subsequent orchestrator slice by making
pebble/orchestrator/an importable package instead of a single module.How tested
pytest pebble/tests/ -q— 290 passed (identical to dev baseline; no regressions).pytest financial_forecasting/tests/ -q— 827 passed, 22 skipped (unchanged).What changes mechanically
git mv pebble/orchestrator.py pebble/orchestrator/_pipeline.py— Git tracks as 99% similar rename._pipeline.py: single-dot relative imports (from .model_client) bump to double-dot (from ..model_client) since the file now sits one level deeper.pebble/orchestrator/__init__.py(28 lines) re-exports the public API.Callers verified unchanged on dev
pebble/main.py:591from .orchestrator import research_single_prospectpebble/clusters/__init__.py:15from ..orchestrator import ProspectBudgetTrackerpebble/handlers/tier2.py:41from ..orchestrator import (score_source_richness, activate_foragers, ProspectBudgetTracker)pebble/handlers/tier3.py:33from ..orchestrator import (research_single_prospect, quorum_verify_claims, synthesize_profile, verify_urls, ProspectBudgetTracker)pebble/tests/test_clusters.pyProspectBudgetTrackerAll keep working because
__init__.pyre-exports those exact names.Risk
Extremely low.
.to..).pebble.orchestrator), same public functions.pebble.orchestratoris now a package whose__init__.pyre-exports the API, instead of a flat module. Python resolves the imports identically from a caller's perspective.Rollback
Revert this single commit.
pebble/orchestrator.pyreturns to its previous location with identical content; the directory +__init__.pydisappear; all imports keep working because they were never broken to begin with.Next slices
pebble/orchestrator/schemas.py+ tests (Pydantic data models —Plan,FinalResponse,Citation, etc.). Foundation for the rest.~/.claude/plans/pr191-carve-strategy.mdfor the full sequence.🤖 Generated with Claude Code