Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
011519e
feat: scheduled pipelines + dependency cascade fix (#78)
Mar 11, 2026
0ec3f84
style: fix Biome formatting issues
Mar 11, 2026
231b848
fix(mcp-adapter): use null instead of undefined for nextRunAt fallbac…
Mar 11, 2026
68fdd62
refactor(schedule-manager): deduplicate timing validation in createSc…
Mar 11, 2026
3dcf586
fix(schedule-repo): add Zod validation for pipeline_task_ids boundary
Mar 11, 2026
5fd1f0a
docs: update dependency docs for cascade cancellation + add v0.6.0 re…
Mar 11, 2026
dea7739
refactor(schedule-handler): deduplicate afterScheduleId resolution + …
Mar 11, 2026
6838f90
test(schedule-manager): add cancelSchedule with cancelTasks=true cove…
Mar 11, 2026
44ba820
refactor: simplify resolver fixes — remove aliases, reuse helpers
Mar 11, 2026
39d78fe
fix(schedule-handler): record lastTaskId for pipeline execution chaining
Mar 11, 2026
af699a6
fix(dependency-handler): skip unblock when getDependencies fails in c…
Mar 11, 2026
0ddd669
fix(schedule-manager): store normalized paths for per-step workingDir…
Mar 11, 2026
e9329c8
fix(schedule-handler): remove double-wrapped error prefix in recordFa…
Mar 11, 2026
fdfe7ba
refactor(mcp-adapter): rename cancelledTasks to cancelTasksRequested
Mar 11, 2026
5760188
refactor(cli): reuse toMissedRunPolicy helper instead of duplicated t…
Mar 11, 2026
209c3dc
fix(schedule-handler): treat step-0 TaskDelegated failure as hard pip…
Mar 11, 2026
bd56703
fix(cli): error when --step used without --pipeline flag
Mar 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ When adding task dependencies:

### MCP Tools

All tools use PascalCase: `DelegateTask`, `TaskStatus`, `TaskLogs`, `CancelTask`, `ScheduleTask`, `ListSchedules`, `GetSchedule`, `CancelSchedule`, `PauseSchedule`, `ResumeSchedule`
All tools use PascalCase: `DelegateTask`, `TaskStatus`, `TaskLogs`, `CancelTask`, `ScheduleTask`, `ListSchedules`, `GetSchedule`, `CancelSchedule`, `PauseSchedule`, `ResumeSchedule`, `CreatePipeline`, `SchedulePipeline`

## File Locations

Expand All @@ -154,6 +154,7 @@ Quick reference for common operations:
| Schedule repository | `src/implementations/schedule-repository.ts` |
| Schedule handler | `src/services/handlers/schedule-handler.ts` |
| Schedule executor | `src/services/schedule-executor.ts` |
| Schedule manager | `src/services/schedule-manager.ts` |
| Cron utilities | `src/utils/cron.ts` |

## Documentation Structure
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ Once configured, use these tools in Claude Code:
| **ScheduleTask** | Schedule recurring or one-time tasks | `ScheduleTask({ prompt: "...", scheduleType: "cron", cronExpression: "0 2 * * *" })` |
| **ListSchedules** | List schedules with optional status filter | `ListSchedules({ status: "active" })` |
| **GetSchedule** | Get schedule details and execution history | `GetSchedule({ scheduleId })` |
| **CancelSchedule** | Cancel an active schedule | `CancelSchedule({ scheduleId, reason })` |
| **CancelSchedule** | Cancel an active schedule (optionally cancel in-flight tasks) | `CancelSchedule({ scheduleId, reason, cancelTasks? })` |
| **PauseSchedule** | Pause a schedule (resumable) | `PauseSchedule({ scheduleId })` |
| **ResumeSchedule** | Resume a paused schedule | `ResumeSchedule({ scheduleId })` |
| **ResumeTask** | Resume a failed/completed task with checkpoint context | `ResumeTask({ taskId, additionalContext? })` |
| **CreatePipeline** | Create sequential task pipelines | `CreatePipeline({ steps: [...] })` |
| **SchedulePipeline** | Create recurring/one-time scheduled pipelines | `SchedulePipeline({ steps: [...], cronExpression: "0 9 * * *" })` |

### CLI Commands

Expand Down Expand Up @@ -316,7 +318,8 @@ backbeat/
- [x] v0.3.3 - Test infrastructure and memory management
- [x] v0.4.0 - Task scheduling and task resumption
- [x] v0.5.0 - Multi-agent support (Claude, Codex, Gemini)
- [ ] v0.6.0 - Scheduled pipelines and loops
- [x] v0.6.0 - Scheduled pipelines
- [ ] v0.6.1 - Task/pipeline loops

See **[ROADMAP.md](./docs/ROADMAP.md)** for detailed plans and timelines.

Expand Down
44 changes: 44 additions & 0 deletions docs/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Last Updated: March 2026
- **PauseSchedule**: Pause an active schedule (can be resumed later)
- **ResumeSchedule**: Resume a paused schedule
- **CreatePipeline** (v0.4.1): Create sequential task pipelines with 2–20 steps, per-step delays, priority, and working directory overrides
- **SchedulePipeline** (v0.6.0): Create recurring or one-time scheduled pipelines with 2–20 steps, each trigger creates a fresh pipeline instance with linear task dependencies

### Schedule Types
- **CRON**: Standard 5-field cron expressions for recurring task execution
Expand Down Expand Up @@ -263,6 +264,29 @@ Last Updated: March 2026
- **`agent` field on DelegateTask**: Specify agent per task (e.g., `{ agent: "codex" }`)
- **Fallback**: Uses default agent when no agent specified

## ✅ Scheduled Pipelines (v0.6.0)

### Recurring & One-Time Pipelines
- **SchedulePipeline MCP Tool**: Create a single schedule that triggers a full pipeline (2–20 steps) on each execution
- **Cron + One-Time**: Supports both recurring cron expressions and single future execution
- **Linear Dependencies**: Each trigger creates fresh tasks wired with linear dependencies (step N depends on step N-1)
- **Per-Step Configuration**: Each step can have its own prompt, priority, working directory, and agent override (MCP only)
- **Shared Defaults**: Schedule-level agent, priority, and working directory apply to all steps unless overridden

### Pipeline Lifecycle
- **Dependency Failure Cascade**: When a pipeline step fails, all downstream steps are automatically cancelled
- **Cancel with Tasks**: `CancelSchedule` with `cancelTasks: true` cancels in-flight pipeline tasks from current execution
- **Concurrency Tracking**: Pipeline completion tracked via tail task — prevents overlapping pipeline executions
- **`afterScheduleId` Support**: Chain pipelines after other schedules (predecessor dependency injected on step 0)

### CLI Support
- `beat schedule create --pipeline --step "lint" --step "test" --cron "0 9 * * *"`: Create scheduled pipeline
- `beat schedule cancel <id> --cancel-tasks`: Cancel schedule and in-flight tasks

### Bug Fixes (v0.6.0)
- **Dependency Failure Cascade**: Failed/cancelled upstream tasks now cascade cancellation to dependents (was incorrectly unblocking them)
- **Queue Handler Race Condition**: Fast-path check prevents blocked tasks from being prematurely enqueued

## ❌ NOT Implemented (Despite Some Documentation Claims)
- **Distributed Processing**: Single-server only
- **Web UI**: No dashboard interface
Expand All @@ -274,6 +298,26 @@ Last Updated: March 2026

---

## 🆕 What's New in v0.6.0

### Scheduled Pipelines
- **`SchedulePipeline` MCP Tool**: Create cron or one-time schedules that trigger a full pipeline (2–20 steps) on each execution
- **Linear Task Dependencies**: Each trigger creates fresh tasks with `task[i].dependsOn = [task[i-1].id]`
- **Per-Step Agent Override**: MCP tool supports per-step `agent` field; CLI uses shared `--agent`
- **`cancelTasks` on CancelSchedule**: Optional flag to also cancel in-flight pipeline tasks from current execution
- **ListSchedules Enhancement**: Response includes `isPipeline` and `stepCount` indicators
- **GetSchedule Enhancement**: Response includes full `pipelineSteps` when present
- **CLI**: `--pipeline --step "..." --step "..."` flags for creating scheduled pipelines

### Bug Fixes
- **Dependency Failure Cascade**: When upstream task fails or is cancelled, dependent tasks are now cancelled instead of incorrectly unblocked (**breaking change**)
- **Queue Handler Race Condition**: Fast-path `dependencyState` check prevents blocked tasks from being enqueued before dependency rows are written to DB

### Database
- **Migration 8**: `pipeline_steps` column on `schedules` table, `pipeline_task_ids` column on `schedule_executions` table

---

## 🆕 What's New in v0.5.0

### Multi-Agent Support
Expand Down
31 changes: 13 additions & 18 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Items originally planned for v0.3.1 that were completed across v0.3.1–v0.4.0:
| Remove Cycle Detection from Repository Layer | Open | — |
| Consolidate Graph Caching | Open | — |
| JSDoc Coverage for dependency APIs | Open | — |
| Failed/Cancelled Dependency Propagation Semantics | Open | Needs design decision |
| Failed/Cancelled Dependency Propagation Semantics | ✅ Done | v0.6.0 (cascade cancellation) |

Open items are low priority — they'll be addressed opportunistically or when performance demands it.

Expand All @@ -57,26 +57,19 @@ Agent registry with pluggable adapters (Claude, Codex, Gemini), per-task agent s

---

### v0.6.0 - Scheduled Pipelines & Loops
**Goal**: Time-triggered pipelines and condition-driven iteration
**Priority**: High — completes the orchestration story
**Issues**: [#78](https://github.com/dean0x/backbeat/issues/78), [#79](https://github.com/dean0x/backbeat/issues/79)
### v0.6.0 - Scheduled Pipelines ✅
**Status**: **RELEASED** (2026-03-18)

#### Feature 1: Scheduled Pipelines (#78)
Run a multi-step DAG on a cron or one-time schedule. Today `beat schedule create` only supports single tasks and `CreatePipeline` only runs immediately — this connects the two.
Scheduled pipelines (`SchedulePipeline` MCP tool, `--pipeline --step` CLI), dependency failure cascade fix, queue handler race condition fix, `cancelTasks` on `CancelSchedule`. See [FEATURES.md](./FEATURES.md) for details.

```bash
beat schedule create --cron "0 9 * * *" --pipeline \
--step "lint the codebase" \
--step "run test suite" \
--step "deploy to staging"
```
---

- Each trigger creates a fresh pipeline instance (new task IDs)
- Steps inherit the schedule's agent unless overridden
- Execution history tracks which schedule triggered which pipeline
### v0.6.1 - Task/Pipeline Loops
**Goal**: Condition-driven iteration
**Priority**: High — completes the orchestration story
**Issue**: [#79](https://github.com/dean0x/backbeat/issues/79)

#### Feature 2: Task/Pipeline Loops (#79)
#### Task/Pipeline Loops (#79)
Repeat a task or pipeline until an exit condition is met — the [Ralph Wiggum Loop](https://ghuntley.com/loop/) pattern.

```bash
Expand All @@ -94,6 +87,7 @@ beat loop "implement next item from spec.md" \
- v0.4.0 schedules (cron/one-time), checkpoints, `continueFrom`
- v0.4.1 pipelines (`CreatePipeline`)
- v0.5.0 multi-agent per-task selection
- v0.6.0 scheduled pipelines

---

Expand Down Expand Up @@ -224,7 +218,8 @@ beat recipe create my-workflow # interactive recipe builder
| v0.3.1–3 | ✅ Released | Dependency optimizations + security |
| v0.4.0 | ✅ Released | Scheduling, Resumption, Rename to Backbeat |
| v0.5.0 | ✅ Released | Multi-Agent Support |
| v0.6.0 | 🎯 Next | Scheduled Pipelines + Loops |
| v0.6.0 | ✅ Released | Scheduled Pipelines |
| v0.6.1 | 🎯 Next | Task/Pipeline Loops |
| v0.7.0 | 📋 Planned | Agent Failover + Smart Routing |
| v0.8.0 | 📋 Planned | Workflow Recipes & Templates |
| v0.9.0 | 💭 Research | Monitoring + REST API + Dashboard |
Expand Down
Loading
Loading