Case study / 02
Smart Agent Factory: durable delivery for AI-built software
A custom graph and execution runtime that turns a reviewed request into isolated implementation, real-data validation, and an evidence-backed draft pull request.
- Area
- Durable software delivery
- Role
- AI & Platform Engineer
Durable workflow architecture
Smart Agent Factory durable workflow
A custom Python runtime carries an approved request through human decisions, isolated construction, validation, and evidence-backed delivery.
- IntakeSlack hypothesis
- StatePersistent request
- DecisionHuman plan gate
- ConstructionIsolated worktree
- EvidenceValidation executor
- ReviewSample review
- DeliveryDraft PR
- StatePostgreSQL checkpoints
- OwnershipLeases + deduplication
- DeliveryTransactional outbox
- ControlBudgets + bounded retries
- RecoveryTime travel
- ProofWrite-once receipts
Problem
AI-assisted software delivery needs more than a sequence of model calls. A reviewed request must survive restarts, wait for human decisions, isolate code changes, validate against real evidence, and explain why a result can advance. I designed the system around that durable workflow.
Custom graph and state
The runtime is a custom Python graph. Persistent requests and append-only events record the workflow history. Checkpoints make nodes resumable, while node contracts define the state, evidence, and allowed transitions at each boundary.
Leases prevent concurrent workers from owning the same step. Deduplication makes repeated delivery safe, and a transactional outbox separates committed state from external notifications. Budgets and bounded retries keep execution finite and explicit.
Human-gated delivery
A hypothesis enters from Slack and becomes a persistent request. A human reviews the plan before construction begins in an isolated Git worktree. Tool policy limits what each stage can access. An external executor validates the implementation, a sample review checks the result, and the workflow creates a draft pull request only after the required evidence exists.
Time travel lets an operator return to a prior checkpoint and continue from preserved state. Compensable effects describe how reversible external actions are handled. Write-once receipts retain the decisions, validation results, and delivery evidence that support the final state.
My contribution
I designed the graph model and implemented the lifecycle, step runner, middleware chain, gates, budgets, durable state, reliability controls, time travel, validation path, and evidence receipts. The system was built from repository-backed requirements and omits private business data and operational credentials here.
Team credit
The case study describes repository-backed implementation work on this system and omits business data, private environments, and operational credentials.
System materials
Stack
- Python
- PostgreSQL
- GCP
- Cloud Run Jobs
- Git worktrees
- GitHub
- Slack
- OpenTelemetry