System Design Atlas

Development platform for builds and artifacts

05 / 10Worked example

Authoritative data and states

What prevents an expired worker from finalising late?

The interfaces require authoritative state. Approval and delivery refer to the same immutable artifact digest. A worker cannot finalise successfully after authorisation expires, and incomplete artifacts cannot be approved. The table separates current states from the evidence that established them.

Starting point Keep a stable job identity and a new identity for each attempt.

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.

Data relationships and permitted transitions

Build job, attempt generation and immutable artifact

Build B-151C-151 + D-5
Attempt generation 2Current lease
A-151 · H-151Immutable bytes
Provenance recordSource + attempt
Approval F-151Digest + findings
wartend → läuft → erfolgreichläuft → fehlgeschlagen / abgebrochenerfolgreich → freigegeben → ausgeliefert

B-151 references C-151 and D-5; attempt generation 2 records A-151/H-151; F-151 binds that exact digest.

An expired worker reports success. Bind finalisation to the current generation and deadline. Only the current attempt can finalise successfully.

Entities and relationships

EntityAuthoritative dataResponsibility
Build job B-151Source revision, build definition, input digest and stateA job may have several separate execution attempts.
Build attemptWorker, start, expiry and resultThe attempt result remains immutable.
Artifact A-151H-151, size and storage referenceBytes under digest are immutable.
Provenance recordSource, definition, worker identity, inputBinds the artifact to the actual build.
Approval F-151Digest, validation results and authorised personDoes not apply to a branch.

Build job B-151

Authoritative data
Source revision, build definition, input digest and state
Responsibility
A job may have several separate execution attempts.

Build attempt

Authoritative data
Worker, start, expiry and result
Responsibility
The attempt result remains immutable.

Artifact A-151

Authoritative data
H-151, size and storage reference
Responsibility
Bytes under digest are immutable.

Provenance record

Authoritative data
Source, definition, worker identity, input
Responsibility
Binds the artifact to the actual build.

Approval F-151

Authoritative data
Digest, validation results and authorised person
Responsibility
Does not apply to a branch.

Permitted state transitions

Starting pointTargetCondition
angenommenwartendBuild job durably queued.
wartendläuftA worker receives a time-limited execution permission.
läufterfolgreichArtifact and provenance record fully stored.
läuftfehlgeschlagenThe build reports an evidenced failure.
läuftabgebrochenExecution terminated and worker authorization withdrawn.
erfolgreichfreigegebenRelease owners confirm the digest and validation evidence.
freigegebenausgeliefertThe target system confirms the same digest.
fehlgeschlagen or abgebrochen or ausgeliefertterminalA retry creates a new attempt or job with an explicit reference.

angenommen

Target
wartend
Condition
Build job durably queued.

wartend

Target
läuft
Condition
A worker receives a time-limited execution permission.

läuft

Target
erfolgreich
Condition
Artifact and provenance record fully stored.

läuft

Target
fehlgeschlagen
Condition
The build reports an evidenced failure.

läuft

Target
abgebrochen
Condition
Execution terminated and worker authorization withdrawn.

erfolgreich

Target
freigegeben
Condition
Release owners confirm the digest and validation evidence.

freigegeben

Target
ausgeliefert
Condition
The target system confirms the same digest.

fehlgeschlagen or abgebrochen or ausgeliefert

Target
terminal
Condition
A retry creates a new attempt or job with an explicit reference.

Fence out the old worker

Fence out the old worker

Bind completion to the current generation and deadline.

An expired worker reports success.

Only the current attempt can complete validly.

Alternative considered
Scheduler reassignment alone does not stop an old worker.
Trade-off
The datastore must check authorisation atomically.
Reassess
Other execution models change the contract.

Terms in this step

Fence out the old worker
Only the current attempt can complete validly.

Try it yourself

An old worker reports success at 60,000 ms, when its authorisation has expired. Determine the datastore response and requirements for a new 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
Finalisation is rejected because authorisation is valid only before 60,000 ms.
Second part of the solution
A new worker needs a higher current generation. Existing artifact bytes do not permit the old process to record a valid completion.

Apply to your project

Which corresponding assumption would you test first in your project? Consider this trigger: Other execution models change the contract.

Step 6 examines build isolation.