Skip to main content

EventStorming (design level)

Uses the sticky colours of the ddd-crew EventStorming glossary cheat sheet. Design level: every command, aggregate, event, policy and read model below is a real identifier in this repository. Hotspots are gaps already recorded in ADRs or code comments, not invented ones.

Legend​

Process 1 — shift-start planning​

Source: internal/application/usecases/propose_path_plan.go, commit_shift_plan.go, internal/domain/shiftplan/shift_plan.go, internal/adapters/outbound/kafka/publisher.go, internal/adapters/outbound/fulfillmentexecution/permissive.go. Omits: the analytics copy of every event, the outbox relay, and the rejection outcomes (listed in Invariants).

Process 2 — intra-shift assignment and the associate day​

Source: internal/application/usecases/*.go, internal/domain/associate/associate_shift.go, internal/domain/assignment/labor_assignment.go, internal/adapters/inbound/kafka/analytics_consumer.go, migrations/analytics/0001_report.up.sql. Omits: the MCP assign_labor path into AssignLabor and the per-associate events' flow into labor_rollup (all associate events project there too).

Sticky inventory​

StickyKindCode evidence
Shift leadActorcallers of the REST routes in internal/adapters/inbound/http/router.go; the console remote in web/
ProposePathPlanCommandusecases.ProposePathPlan, POST /paths/{pathId}/plan-proposals, MCP propose_path_heads
CommitShiftPlanCommandusecases.CommitShiftPlan, POST /shift-plans
StartAssociateShift, CertifyAssociate, StartBreak, EndBreak, EndAssociateShiftCommandmatching structs in internal/application/usecases/
AssignLaborCommandusecases.AssignLabor, POST /associates/{id}/assignments, MCP assign_labor
ShiftPlan, AssociateShift, LaborAssignmentAggregateinternal/domain/{shiftplan,associate,assignment}
the ten eventsDomain eventinternal/domain/shared/events.go; full type strings in internal/adapters/kafka/cloudevents/types.go
Fall back to measured ratePolicyProposePathPlan.Execute (plannedRate <= 0 branch), ADR 0012
Idle-share trimPolicyProposePathPlan.applyIdleShareTrim, IDLE_SHARE_TRIM_THRESHOLD (default 0.30), ADR 0020
One message per linePolicykafka.Publisher.Encode
Close active assignment on shift endPolicyEndAssociateShift.Execute
Flag, never movePolicyshared.PathUnderstaffed doc comment, ADR 0002
Process-path catalogueRead modelpathcatalog.Catalogue, kafkacatalog adapter
StaffingGapRead modelusecases.StaffingGap
labor_rollup reportRead modelmigrations/analytics/0001_report.up.sql, GET /reports/labor
labor-performance, fulfillment-execution, wes-work-planning, warehouse-planning, warehouse-ops-agentExternal systeminternal/adapters/outbound/{laborperformance,laborperformancecache,fulfillmentexecution}; sibling consumers named in Context map
installedStations unverifiableHotspotshiftplan.ErrExceedsInstalledCapacity doc comment, ADR 0014
Permissive capacity mode rejects every commitHotspotfulfillmentexecution.PermissiveClient doc comment: a caller must opt into INSTALLED_CAPACITY_MODE=http to commit at all
DLQ without alerting or replayHotspotADR 0022 consequences ("out of scope")
MCP per-process session stateHotspotADR 0024 (cmd/mcp excluded from autoscaling)