Skip to content

feat: fleet orchestration POC with worktree isolation#35

Closed
malpou wants to merge 6 commits into
computerlovetech:mainfrom
malpou:pm/fleet-poc
Closed

feat: fleet orchestration POC with worktree isolation#35
malpou wants to merge 6 commits into
computerlovetech:mainfrom
malpou:pm/fleet-poc

Conversation

@malpou
Copy link
Copy Markdown
Contributor

@malpou malpou commented Mar 22, 2026

Summary

⚠️ POC / Draft — This is exploratory work for fleet orchestration. The API and config format may change based on feedback.

Adds a ralph fleet CLI command group that launches multiple ralphs in parallel, each in its own git worktree, with basic process supervision and a fleet definition file (fleet.yml).

  • Fleet config (fleet.yml): Define fleet name, ralphs with file/branch/worktree/priority/depends_on, and settings (max_concurrent, stagger_start)
  • Worktree isolation: Each ralph gets its own git worktree with an isolated branch
  • Orchestration: Dependency-ordered launches with staggered starts and max concurrency
  • CLI commands: ralph fleet start, ralph fleet status, ralph fleet stop
  • Example: examples/fleet-todo-app/ with pm, dev, and qa ralphs demonstrating a multi-role workflow

Changes

  • src/ralphify/_fleet.py — Fleet config parsing, worktree lifecycle, orchestration class
  • src/ralphify/cli.pyralph fleet command group (start/status/stop)
  • tests/test_fleet.py — 41 tests covering config parsing, worktree lifecycle, and orchestration
  • examples/fleet-todo-app/ — Example fleet setup with fleet.yml and ralph files

Test plan

  • All 477 tests pass (uv run pytest)
  • Manual testing: run ralph fleet start with the example fleet config
  • Review fleet.yml schema and validate it covers common use cases
  • Test worktree cleanup on ralph fleet stop

malpou and others added 6 commits March 22, 2026 18:43
Add _fleet.py with FleetConfig, RalphEntry, and FleetSettings
dataclasses plus parse_fleet_config() for reading fleet.yml files.
Supports ralph entries with branch/worktree/priority/depends_on,
fleet-level settings (max_concurrent, stagger_start, merge_strategy),
and validation of all fields including dependency references.

Co-authored-by: Ralphify <noreply@ralphify.co>
Add functions for creating, removing, and pruning git worktrees for
fleet ralphs. Includes setup_fleet_worktrees to create all worktrees
from a fleet config and teardown_fleet_worktrees for cleanup.

Co-authored-by: Ralphify <noreply@ralphify.co>
Add FleetOrchestrator that manages the full fleet lifecycle: sets up
worktrees, builds RunConfigs from ralph RALPH.md files, launches ralphs
via RunManager with staggered starts and max_concurrent limits, resolves
dependency ordering via topological sort, and provides stop/status
methods. Also adds FleetStatus enum, RalphStatus dataclass, and
FleetConfigError for ralph config validation.

Co-authored-by: Ralphify <noreply@ralphify.co>
Add a typer sub-app for fleet management with three commands:
- fleet start: parses fleet.yml, sets up worktrees, launches ralphs
  with staggered starts and dependency ordering, blocks until Ctrl+C
- fleet status: displays a table of ralphs with branches, worktree
  settings, priorities, and dependency info
- fleet stop: guidance to use Ctrl+C on the running fleet process

Co-authored-by: Ralphify <noreply@ralphify.co>
… tests

Co-authored-by: Ralphify <noreply@ralphify.co>
Demonstrates a multi-role fleet where a PM ralph creates tasks, a dev
ralph implements them, and a QA ralph reviews PRs — all running in
parallel with dependency ordering and worktree isolation.

Co-authored-by: Ralphify <noreply@ralphify.co>
@malpou malpou closed this Mar 22, 2026
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