LEVEL 4 · SYSTEMS
Durable Agent Jobs
Build a persistent local report queue with versioned leases, immutable input, idempotent output receipts and reproducible worker-process crash recovery.
Create jobs with stable identityClaim with a lease and versionFinish or reclaim expired workWrite and recover atomic snapshots
YOU END UP WITH
Build a persistent local report queue with versioned leases, immutable input, idempotent output receipts and reproducible worker-process crash recovery.
USEFUL FOR
- Resume local report jobs after a worker crash
- Observe and test the gap between an output effect and durable completion
LEARN FIRST
- Go 1.22 or later on Linux or macOS
- Python 3.10 or later for the grader
- Go structs, pointers, errors and JSON files
- Basic process lifecycle and filesystem operations
PROJECT OUTLINE
Durable Agent Jobs in 4 stages
Persist job states and reject stale worker completions.
Create jobs with stable identity
Accept a bounded identifier and start every job in queued state with version zero.
starter · ~2 hours · Go
Validate IDInitial stateZero versionNo side effectClaim with a lease and version
Only queued work can be claimed.
core · ~2 hours · Go
Expected versionAttempt capLease arithmeticAtomic state mutationFinish or reclaim expired work
Finish succeeds only for the current running version before its lease expires.
core · ~2 hours · Go
Lease boundaryRequeue expiredIncrement versionFence stale workerWrite and recover atomic snapshots
Compose validated snapshots with locked enqueue, durable claims and crash-safe local receipt reuse.
core · ~2 hours · Go
Validate snapshotWrite tempFlush and renameRecover records