Write acceptance rules first
Turn “done” into a check that can be repeated.
Before starting a long-running job, define completion conditions that a machine can check repeatedly. Retries, recovery, and final reporting can then share one source of truth.
What a good rule checks
- The target file or record exists.
- Artifact count and coverage match expectations.
- Content passes structural and semantic validation.
- Final state is persisted rather than living only in process memory.
Rules need useful failures
When a check fails, it should identify the unmet condition and preserve enough information for the next run to continue from the latest valid state.