Event Spine Designer
The timeline is primary. Snapshots are projections of it.
A row that says status = 'complete' records that something is true now and destroys the record of how it became true, who decided, when, and what it was before. That information is not recoverable later, and it is the information every audit, dispute and forecast needs.
Hard rules
- Every state change is an event. Row updates alone are insufficient.
- Every event is attributable. No anonymous state change.
- Events are append-only. Correct with a new event; never rewrite one.
- Current state is derived, and its derivation is stated.
- A missing history is typed, never silently empty.
- Events name what happened, in the past tense, in domain language — not what the UI did.
inspection.failed, notform_submitted.
Anatomy of an event
Every event carries:
| Element | Requirement |
|---|---|
| Event identity | Stable unique id; never reused |
| Type | Past-tense domain verb, versioned when its shape changes |
| Subject | The entity this happened to, by reference |
| Actor / source | Who or what caused it — a person, a system, an external contract. Never absent; use a typed system or unknown_actor |
| Occurred at | When it happened in the world |
| Recorded at | When the system learned of it — distinct, and often different |
| Previous relationship | What state it moved from, where meaningful |
| Transformation | What changed, expressed as before → after |
| Evidence | Reference to what substantiates it, where a claim is being made |
| Reversibility | Whether a compensating event exists, and which |
occurred at and recorded at are two fields. Collapsing them makes backfilled and late-arriving history indistinguishable from real-time history.
Procedure
- Extract the verbs. Write the feature as sentences with actors: "the supervisor approved the quote". Each sentence is a candidate event.
- Name each event in past tense, domain language,
subject.verbform. - Identify the actor for each. If none can be named, the design is incomplete — find the actor or type the absence explicitly.
- Define the transformation each event performs: which relationship or value moves from what to what.
- Derive the snapshot. State how current state is computed from the stream. Store it only as a labelled projection with a named rebuild path.
- Name the consumers. An event with no producer or no consumer is dead architecture — either a real need exists or the event should not.
- Decide reversibility. For each event: is it compensable, and by what? Some are not. Say which.
- Type the missing history. For entities that existed before the stream did, record
history_before: not_capturedrather than presenting a partial timeline as complete.
Projections
A projection is a read model rebuilt from the stream. It may be a materialised table when reads demand it, under three conditions:
- it is labelled a projection in its name and its documentation;
- it can be dropped and rebuilt from the events alone;
- exactly one process writes it.
If a projection can be written by anything other than its rebuild path, it has become a second source of truth. That is the failure this skill exists to prevent.
Worked example
Request: "add an `assigned_to` field so we know who's on each job."
- Verbs. "the coordinator assigned the job to Priya", "Priya handed the job back", "the job was reassigned to Tom".
- Events.
job.assigned,job.unassigned,job.reassigned— or onejob.assignment_changedcarrying previous and current assignee. Prefer the single event when consumers care about the transition; prefer three when they react differently to each. - Actor. The coordinator, by reference. Not the assignee — the assignee is the subject of the change, not its cause.
- Transformation.
assignee: none → person:priya. - Projection.
job.current_assignee, derived, rebuildable, written only by the projector. - Consumers. Scheduling, notifications, payroll attribution, workload reporting.
- Result. The original request — a mutable
assigned_tocolumn — would have silently answered "who is on this job" while making "who has been on this job, and who kept changing it" permanently unanswerable.
Pressure tests
- For any current value, can you reconstruct what it was last Tuesday, and who changed it?
- Can any state change occur without producing an event? Trace every write path.
- Is any event produced that nothing consumes, or consumed from a producer that does not exist?
- If the projection table were dropped, could it be rebuilt exactly?
- Does any event carry an actor of "system" that actually had a human behind it?
- Is a partial timeline anywhere presented as if it were complete?
Stop conditions
- A state change has no nameable actor and the absence is not typed.
- The design requires editing or deleting a past event — stop; use supersession or a compensating event.
- A projection has more than one writer.
- The event stream would be optional — a "log for later" written beside the real update path. That is not an event spine; it is a diary that drifts.