Skip to main content

EventStorming

Built, released at v0.1.3, applied to k3s (reduced footprint); MCP and A2A built, not deployed

Built on develop (merged 2026-11-08) in IQVO/dock-scheduling, released at v0.1.3 (first release v0.1.0 on 2026-11-09; applied to the k3s cluster on 2026-11-10 at v0.1.2 in a reduced footprint, and the image pinned to the v0.1.3 commit a1a029c in warehouse-infra since 2026-11-16, checked 2026-12-02): dock-scheduling runs its API only (it relays inline); yard-management runs its API and relay. The MCP server (18 tools on develop 096db0a, 14 in v0.1.3) is registered in warehouse-infra but switched off until the cluster has room; the A2A agent (two skills) is built on develop (2026-12-02), not released and not deployed (the chart carries it off by default and warehouse-infra has no a2a block); the analytics projectors, report services and sweeps are registered but switched off, so the KPI reports of yard-management ADR 0011 are released, not yet served. The page still derives from yard/model/model.yaml; where the as-built service differs, the model and this page say so (see the as-built notes).

Process-level EventStorming in the ddd-crew EventStorming glossary & cheat sheet notation. Every sticky comes from model.yaml. Hotspots were the genuine open questions or risks in the model when this pack was written; the source of each is in the hotspot table, whose last column says how the built service settled it. The boards keep the hotspot stickies as they were drawn.

Legend​

ColourStickyHex
BlueCommand#a5d8ff
YellowAggregate#ffec99
OrangeDomain Event#ffc078
LilacPolicy#d0bfff
GreenRead Model#b2f2bb
PinkExternal System (a sibling context or an actor)#fcc2d7
RedHotspot#ff8787

1. Booking, rescheduling and cancelling​

Derived from: model.yaml → contexts[dock-scheduling].aggregates[DockAppointment], .read_models, .inbound, .publishes[*].consumers.

Omitted: the refusals (ErrInvalidDoorCode, ErrInvalidCarrier, ErrInvalidWindow, ErrWindowInPast, ErrUnknownDoor, ErrDoorFlowMismatch, ErrDoorDoubleBooked, ErrDoorUnavailable, ErrUnknownAsn, ErrMissingOutboundRef). DockAppointmentCancelled also reaches inbound-receiving; DockAppointmentRescheduled does not.

2. Arrival at the gate and a different door​

Derived from: model.yaml → contexts[dock-scheduling].policies[ArrivalFromGate, ActualDoorWins], .aggregates[DockAppointment], .publishes.

Omitted: DockAppointmentCheckedIn and AtRisk are analytics only; no context reacts to them. DoorReassigned is also on the integration topic since service ADR 0010 (inbound-receiving reads it). E5 is raised for the overlapped appointment, with cause DOOR_REASSIGNED_OVERLAP.

3. Door release and out-of-order yard facts​

Derived from: model.yaml → contexts[dock-scheduling].policies[CompleteOnDoorRelease, OutOfOrderYardFacts], .aggregates[DockAppointment], .publishes[DockAppointmentCompleted].

Omitted: DockAppointmentCompleted is analytics only. OutOfOrderYardFacts is drawn into RecordDoorRelease because it defines the BOOKED to COMPLETED path; it also says a late VisitCheckedIn for a COMPLETED appointment is ignored and that any yard fact for a CANCELLED or NO_SHOW appointment is ignored and counted.

4. ETA risk and no-show​

Derived from: model.yaml → contexts[dock-scheduling].policies[EtaRisk, NoShowSweep], .aggregates[DockAppointment], .publishes[*].consumers.

Omitted: DockAppointmentNoShow also triggers NoShowFreesHolding in yard-management, drawn in Domain Message Flow.

5. ASN cancellation​

Derived from: model.yaml → contexts[dock-scheduling].policies[CancelWhenAllAsnsCancelled], .read_models[AsnView], .reasons[CancellationReason], .publishes[DockAppointmentCancelled].

Omitted: only an INBOUND BOOKED appointment whose ASNs are all cancelled is cancelled by the policy; the reason is ASN_CANCELLED.

6. The door calendar​

Derived from: model.yaml → contexts[dock-scheduling].aggregates[DockCalendar], .read_models[DoorView], .publishes, .consumes.

Omitted: ErrInvalidOperatingHours, ErrOverlappingClosure and ErrClosureConflictsWithAppointments refusals. DeclareCalendarSettings raises no event; DoorOperatingHoursDeclared is analytics only.

7. Phase-2 pickups​

Derived from: model.yaml → contexts[dock-scheduling].policies[PickupFromCutoffs], .consumes, .read_models[CutoffView].

Omitted: the dotted arrow from PickupFromCutoffs is the policy keeping one OUTBOUND appointment per cutoff and operating day; the model names no command for it, and as built it does not exist: the schedule is stored and no appointment is created from it. The strangler import that this board once showed (policy LegacyImport, hotspot H11) was removed in dock-scheduling ADR 0011.

Hotspots​

#HotspotWhere it comes from in the modelGapAs built (2026-11-09)
H1CancellationReason has SITE_REQUEST, but the only inbound row for cancel is the carrier scheduler.aggregates[DockAppointment], reasons[CancellationReason], inbound[0]DS-G10Settled (D-5): the dock planner cancels with CARRIER_REQUEST or SITE_REQUEST through the same route.
H2DockAppointmentRescheduled carries door_code but no previous door; the model does not say a reschedule may change the door.publishes[DockAppointmentRescheduled].dataDS-G06Settled (D-4, X1): a reschedule may change the door; the event carries previous_door_code.
H3An appointment is one carrier visit, but VisitCheckedIn carries trailers, and the first TrailerUndocked completes the appointment.policies[CompleteOnDoorRelease], contexts[yard-management].publishes[VisitCheckedIn]DS-G03Settled (X3): one appointment covers exactly one trailer.
H4The arrival tolerance is a DockCalendar setting; yard-management's DirectOnCheckIn needs it and no event carries it.aggregates[DockCalendar].value_objects, contexts[yard-management].policies[DirectOnCheckIn]DS-G01Settled (X1): Booked and Rescheduled carry arrival_tolerance_minutes.
H5The out-of-order rules cover four cases; a second VisitCheckedIn, a TrailerDocked after completion and an implicit arrival in the adherence report are not covered.policies[OutOfOrderYardFacts, ArrivalFromGate]DS-G19Settled: the state machine decides; an already applied or terminal fact is ignored and counted, an implicit arrival is counted as ON_TIME (X6).
H6DockAppointmentAtRisk is analytics only and no read model or route exposes it, yet the console and the ops agent are meant to show at-risk appointments.publishes[DockAppointmentAtRisk], fleet_changesDS-G11Settled (D-6): the REST appointment exposes atRisk and atRiskCause, GET /appointments filters on atRisk and the MCP tool list_at_risk_appointments lists them.
H7NO_SHOW has no outgoing transition; a carrier that arrives after the sweep is ignored by this context.aggregates[DockAppointment].transitions, policies[OutOfOrderYardFacts]DS-G16Settled (D-9): terminal, a late carrier books anew.
H8TURNED_AWAY has no producer, and VisitRejected is not consumed here.reasons[CancellationReason], consumes, contexts[yard-management].publishes[VisitRejected]DS-G02Settled (X2): VisitRejected is consumed (policy CancelOnVisitRejected), TURNED_AWAY is its cancellation reason.
H9A closure is refused if it covers an active appointment; a change of operating hours and a decommissioned door are not.aggregates[DockCalendar].invariants, consumes[facility-layout]DS-G12, DS-G13Settled: new hours that strand an appointment are refused (D-8); a decommissioned door blocks new bookings only (D-7).
H10DeclareCalendarSettings raises no event, and no default is given for the arrival tolerance or the no-show grace.aggregates[DockCalendar], publishesDS-G07, DS-G01Settled (D-1): defaults 240, 15, 15 and 60 minutes, created lazily; the tolerance travels on the booking events.
H11ImportLegacyAppointment lists no invariants, and the effect of the legacy check-in, cancel and complete events is not stated.policies[LegacyImport], consumes[inbound-receiving]DS-G08Settled (D-2): no invariant is enforced; later legacy events move only legacy-import appointments. Moot since dock-scheduling ADR 0011: the importer was removed.
H12PickupFromCutoffs names PickupDoorRule and pickup_lead, defined nowhere, and creates an appointment with no carrier.policies[PickupFromCutoffs], aggregates[DockAppointment].invariantsDS-G04Open by decision (D-3): phase 2. The schedule is consumed and stored; no appointment is created.