Change commands and retries
How does a stable build job differ from re-execution?
Scale alone does not ensure consistent retry behaviour. This proposed API binds the role, business object, change payload and expected state to each new intent. An idempotency key identifies the same intent after a response is lost.
Starting point Plan for at least 10 fully utilised workers plus a separate reserve.
Assumptions for the example case
A fictional example design with one repository, a precisely specified build job, an isolated worker, an immutable artifact identified by digest and explicit release approval. Figures and quality goals are illustrative test assumptions. Full software supply-chain certification, production orchestration and arbitrary privileged builds are outside the scope.
Retries and new intent
Build key, digest and provenance
The same build intent returns B-151; a different source revision conflicts; identical bytes at H-151 share only the stored object.
Proposed domain API contracts
- POST
/buildsBuild a fixed source revision.
- Input
- Development team, repository, C-151, D-5, input digest and key.
- Result
- B-151 with immutable inputs and a durable queue entry.
- Retry behaviour
- An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
- POST
/builds/{id}/attempts/claimClaim time-limited execution authorisation.
- Input
- Authenticated worker, B-151, expected job version and claim key.
- Result
- An attempt with the current generation and an exclusive expiry instant; a competing claim receives a conflict.
- Retry behaviour
- An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
- POST
/build-attempts/{id}/completeFinalise the artifact and provenance with valid authorisation.
- Input
- Worker identity, current generation, artifact A-151, full digest H-151, object-completion evidence, provenance and result.
- Result
- Success requires valid authorisation and complete evidence; an expired worker is rejected.
- Retry behaviour
- An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
- POST
/releasesApprove a validated digest.
- Input
- Release owner, H-151, validation records, source reference and approval key.
- Result
- F-151 applies to that exact digest; changing a filename does not approve different bytes.
- Retry behaviour
- An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
- POST
/deployment-evidenceConfirm the digest actually delivered.
- Input
- Authenticated target adapter, release reference, H-151 and unique result identifier.
- Result
- ausgeliefert only with a matching digest; a mismatch remains unresolved.
- Retry behaviour
- An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
- GET
/builds/{id}Read attempts and evidence.
- Input
- Authorised development team or release owner, B-151.
- Result
- Source revision, attempt history, artifact digest, provenance and approval state.
- Retry behaviour
- Repeating a read creates no business effect; the returned current state may change between requests.
Separate the job from its attempts
Keep a stable job identity and a new identity for each attempt.
A build is retried after a worker failure.
The original failure remains visible; the new attempt is unambiguous.
- Alternative considered
- Overwriting job history loses failure evidence.
- Trade-off
- More status objects need to be explained.
- Reassess
- Very short builds allow for simpler display.
Terms in this step
- Separate the job from its attempts
- The original failure remains visible; the new attempt is unambiguous.
Try it yourself
A worker fails and development retries the same source revision. Distinguish the job from its attempt.
A hint for your attempt
Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.
Compare with a possible solution
- First part of the solution
- B-151 holds the fixed inputs; the failed attempt remains historically visible.
- Second part of the solution
- A new attempt receives its own identity and justification, preserving the previous failure evidence.
Apply to your project
Which corresponding assumption would you test first in your project? Consider this trigger: Very short builds allow for simpler display.