Resumability
Smithers workflows survive process termination. When restarted, execution continues from where it left off.Stable Operation Identifiers
Every operation has a deterministic identifier based on:| Entity | Identifier Strategy |
|---|---|
| Execution | SMITHERS_EXECUTION_ID env var or UUID |
| Phase | (execution_id, name, iteration) |
| Step | (execution_id, phase_id, name) |
| Agent | UUID, tracked via phase_id and execution_id |
| Task | (execution_id, scope_id, component_name) |
What Gets Persisted
All state lives in SQLite. Eight entity types are tracked:Execution Record
Phase/Step/Task Records
Each tracks:status: Current state (pending,running,completed,failed,skipped)started_at/completed_at: Timestamps for duration calculationduration_ms: Computed on completion
How Step Completion is Determined
- Step status is
'completed' - Step belongs to current phase (via
phase_id) - Step name matches (for named steps)
What Happens on Restart
Restart Flow
Idempotency Patterns for VCS Operations
VCS operations (commits, snapshots) need special handling because Git/Jujutsu state exists outside SQLite.Pattern 1: Check Before Commit
Pattern 2: Use Step VCS Tracking
Steps track VCS state viasnapshot_before, snapshot_after, and commit_created:
Pattern 3: Commit Hash Deduplication
The VCS module usesINSERT OR REPLACE for commits:
Pattern 4: Worktree Isolation
For parallel VCS operations, use worktrees to isolate changes:<Worktree> component creates a git worktree at .worktrees/{branch} and provides the worktree context to children.
Best Practices
Use named steps for resumability
Use named steps for resumability
Named steps can be matched on restart:
Check for existing work before VCS operations
Check for existing work before VCS operations
Use SMITHERS_EXECUTION_ID for deterministic IDs
Use SMITHERS_EXECUTION_ID for deterministic IDs
Set via environment for control plane integration:The same ID on restart ensures continuity.
Always complete or fail steps
Always complete or fail steps
Incomplete steps block phase advancement: