Skip to content

refactor(pebble): convert orchestrator.py into a package (slice 0 of PR #191 carve) - #204

Open
jpb33333 wants to merge 1 commit into
devfrom
feat/pebble-orchestrator-package
Open

refactor(pebble): convert orchestrator.py into a package (slice 0 of PR #191 carve)#204
jpb33333 wants to merge 1 commit into
devfrom
feat/pebble-orchestrator-package

Conversation

@jpb33333

Copy link
Copy Markdown
Collaborator

Summary

Pure refactor with zero behavior change. Renames pebble/orchestrator.py (862 lines, untouched in content) to pebble/orchestrator/_pipeline.py and adds pebble/orchestrator/__init__.py that 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 current dev. 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.md for 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/ -q290 passed (identical to dev baseline; no regressions).
  • pytest financial_forecasting/tests/ -q827 passed, 22 skipped (unchanged).
  • All seven re-exported symbols import cleanly:
    from pebble.orchestrator import (
        ProspectBudgetTracker, research_single_prospect, score_source_richness,
        activate_foragers, quorum_verify_claims, synthesize_profile, verify_urls,
    )

What changes mechanically

  • git mv pebble/orchestrator.py pebble/orchestrator/_pipeline.py — Git tracks as 99% similar rename.
  • 6 lines in _pipeline.py: single-dot relative imports (from .model_client) bump to double-dot (from ..model_client) since the file now sits one level deeper.
  • New pebble/orchestrator/__init__.py (28 lines) re-exports the public API.

Callers verified unchanged on dev

Caller Import
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

All keep working because __init__.py re-exports those exact names.

Risk

Extremely low.

  • Zero behavior change. Same source code, same line numbers within the renamed file (only the import prefix flipped from . to ..).
  • Same module-level constants, same logger name (pebble.orchestrator), same public functions.
  • The only externally observable change is that pebble.orchestrator is now a package whose __init__.py re-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.py returns to its previous location with identical content; the directory + __init__.py disappear; all imports keep working because they were never broken to begin with.

Next slices

  • Slice 1: pebble/orchestrator/schemas.py + tests (Pydantic data models — Plan, FinalResponse, Citation, etc.). Foundation for the rest.
  • See ~/.claude/plans/pr191-carve-strategy.md for the full sequence.

🤖 Generated with Claude Code

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>
@jpb33333
jpb33333 requested a review from jacrev-pursuit as a code owner May 19, 2026 17:32

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

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.

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