Skip to content

refactor: replace _build_recursive with orchestrator#323

Draft
Blackgaurd wants to merge 1 commit into04-17-feat_add_build_orchestratorfrom
04-17-refactor_replace__build_recursive_with_orchestrator
Draft

refactor: replace _build_recursive with orchestrator#323
Blackgaurd wants to merge 1 commit into04-17-feat_add_build_orchestratorfrom
04-17-refactor_replace__build_recursive_with_orchestrator

Conversation

@Blackgaurd
Copy link
Copy Markdown
Collaborator

@Blackgaurd Blackgaurd commented Apr 17, 2026

Wires run_build() into build_dataset() and deletes _build_recursive(). This is the switchover PR.

What changed

  • build_dataset() now delegates to run_build() (orchestrator) instead of _build_recursive()
  • Deleted _build_recursive() (~120 lines)
  • Moved NoValidTimestampsError and generate_timestamps to new service/timestamps.py to break circular import (builder -> orchestrator -> worker -> builder)
  • builder.py re-exports both for backward compatibility (api/routes.py, tests)
  • Updated test_builder.py: replaced 16 tests that tested _build_recursive internals with 3 delegation tests (behavior now covered by test_scheduler + test_worker + test_orchestrator)
  • Updated test_concurrent_builds.py: mock targets changed from service.builder.* to service.scheduler.registry + service.worker.*

Why

_build_recursive mixed scheduling (dependency resolution, start-date clamping, lookback expansion) with execution (timestamp check, builder subprocess, DB insert). The new architecture separates these concerns into scheduler, worker, and orchestrator.

Benefit

  • Clear separation: scheduler computes what to build, worker builds one dataset, orchestrator coordinates
  • All 302 tests pass (net -10 tests from deduplication, not lost coverage)
  • Integration tests unchanged
  • Concurrent build tests still exercise real locking through the full pipeline

🤖 Generated with Claude Code

Copy link
Copy Markdown
Collaborator Author

Blackgaurd commented Apr 17, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Blackgaurd Blackgaurd force-pushed the 04-17-feat_add_build_orchestrator branch from 0a97d64 to 6fb344e Compare April 18, 2026 00:06
@Blackgaurd Blackgaurd force-pushed the 04-17-refactor_replace__build_recursive_with_orchestrator branch from 6fdc1a6 to 4a73650 Compare April 18, 2026 00:06
@Blackgaurd Blackgaurd force-pushed the 04-17-refactor_replace__build_recursive_with_orchestrator branch from 4a73650 to 4aebc80 Compare April 25, 2026 04:18
@Blackgaurd Blackgaurd force-pushed the 04-17-feat_add_build_orchestrator branch from 6fb344e to 461b6ea Compare April 25, 2026 04:18
@Blackgaurd Blackgaurd force-pushed the 04-17-feat_add_build_orchestrator branch from 461b6ea to 3820536 Compare April 25, 2026 04:24
@Blackgaurd Blackgaurd force-pushed the 04-17-refactor_replace__build_recursive_with_orchestrator branch from 4aebc80 to 06c0672 Compare April 25, 2026 04:24
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