Milestone 1
1. Build a Durable Stateful Workflow Core
Weeks 1–6: turn existing backend skills into an agent workflow service that persists every meaningful transition and can resume interrupted work.
A versioned repository containing a TypeScript service, PostgreSQL migrations, architecture decision record, workflow-state diagram, REST API, deterministic fake model and tools, and a runnable demonstration of a multi-step task surviving process interruption. The data model must represent runs, steps, attempts, tool calls, outputs, timestamps, and terminal states.
Choose One Narrow Agent Job
Define a small workflow with a clear outcome, two or three tools, and at least one multi-step decision. Write its success and failure boundaries before implementing it.
A one-page scope document with example input, expected output, workflow steps, permitted tools, exclusions, and completion criteria.Model Workflow History in PostgreSQL
Design tables and constraints for runs, steps, attempts, tool calls, outputs, and state transitions.
Versioned SQL migrations plus a diagram or concise data-model document containing keys, relationships, status values, and invariants.Implement the Workflow State Machine
Build orchestration behind a REST API using deterministic fake model responses and tools first.
Endpoints to create, inspect, cancel, and resume runs, with state-transition logic separated from HTTP handlers.Add Recovery and Failure Tests
Exercise crashes, duplicate requests, tool timeouts, retry exhaustion, cancellation, and restart recovery.
Automated integration tests against PostgreSQL, including a test that interrupts and resumes an in-progress workflow.Review rubric · 5 criteria
State is durable
A reviewer can stop the service during a workflow, restart it, and resume without losing completed steps or duplicating committed effects.
Transitions are explicit
Every workflow state and allowed transition is documented and enforced in code; invalid transitions produce a defined error.
Agent records are inspectable
Database queries can reconstruct a run’s steps, attempts, tool calls, outputs, and final status in chronological order.
Failure semantics are defined
Timeout, retry, cancellation, and terminal-failure behavior have explicit limits and automated tests.
Setup is reproducible
A new reviewer can start the database, apply migrations, run the service, and execute the demo using documented commands.
