Skip to main content

Bounded Context Canvas

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

Built on develop (merged 2026-11-08) in IQVO/yard-management, released at v0.1.4 (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.4 commit 44d605e in warehouse-infra since 2026-11-18, checked 2026-12-02): yard-management switches on its API and relay (at the check the relay was 1/1 and the API 0/1 Pending on the NotReady agent node k3s-agent2); dock-scheduling runs its API only (it relays inline). The MCP server (25 tools on develop 3bcfc22, 21 in v0.1.4) 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 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).

Following the ddd-crew Bounded Context Canvas v5. Every message row comes from contexts[yard-management] → inbound, rest, publishes, consumes and sync_calls (empty).

Canvas at a glance​

Two pictures of the sections below: first the collaborators that command, query or feed this context (with its purpose, roles and the decisions it enforces), then the collaborators it notifies. Arrows follow the message type: solid blue commands (cmd), dotted green queries (qry), thick orange events (evt). Box shapes mark the collaborator kind: rounded = people or any client; blue = sibling bounded context; grey = this context's own scheduler; dashed = published only on the analytics topic. Channel names are abbreviated; the tables carry the exact route, topic and CloudEvents type.

Inbound​

Outbound​

Derived from: model.yaml → contexts[yard-management].inbound, .rest, .publishes, .consumes, .policies, .business_decisions, .roles.

Omitted: assumptions, metrics, open questions and the glossary (sections below); the relationship pattern per message (see the tables); full CloudEvents types and routes (see the tables). There are no outbound commands or queries: sync_calls is empty, so this context calls no other context synchronously. DockAppointment x4 is DockAppointmentBooked, Rescheduled, Cancelled and NoShow; DoorClosure x2 is DoorClosureScheduled and DoorClosureLifted.

Name​

Yard Management (yard-management, code YM, CloudEvents tier wms).

Purpose​

Own everything physically on site outside the four walls: who passed the gate (visits), which trailer is where (spot, door or an open move), its load, seal and hold state, the moves hostlers and visiting drivers make, door work at the door, and yard checks. The source of dwell, door occupancy and yard truck productivity facts. dock-scheduling owns the future of a door; this context owns the present of the yard.

Strategic Classification​

AxisVerdict
DomainSupporting (see Core Domain Chart).
Business ModelCost reducer (detention, demurrage, lost trailers, idle dock labour) and throughput enabler.
EvolutionCustom-built.

Domain Roles​

RoleEvidence in the model
Execution (gate, moves, docking)Runs the visit lifecycle (CheckInVisit … CheckOutVisit), the move lifecycle (RequestMove … CompleteMove) and docking (ArriveAt, StartDoorWork, CompleteDoorWork, Depart); policies DirectOnCheckIn, CallToDoor, ClearDoorAfterWork.
Analysis (dwell, door utilisation)Publishes dwell, door-work and move facts on the analytics topic; read model YardKpiReport (dwell by kind, door utilisation, moves per hostler hour, driver wait); routes GET /reports/yard-dwell, /door-utilisation, /hostler-productivity.

Inbound Communication​

CollaboratorMessageTypeChannelRelationship
Gate clerk or kioskCheckInVisitCommandREST POST /visitsUI
Gate clerk or kioskRejectAtGateCommandREST POST /visit-rejectionsUI
Gate clerk or kioskCheckOutVisitCommandREST POST /visits/{visitId}/check-outsUI
Hostler (floor client)ClaimNextMoveCommandREST POST /moves/claimsUI
Hostler (floor client)CompleteMoveCommandREST POST /moves/{moveId}/completionsUI
Dock operator (floor client)StartDoorWorkCommandREST POST /trailers/{trailerId}/door-work-startsUI
Dock operator (floor client)CompleteDoorWorkCommandREST POST /trailers/{trailerId}/door-work-completionsUI
Yard supervisorRequestMoveCommandREST POST /movesUI
Yard supervisorCancelMoveCommandREST POST /moves/{moveId}/cancellationsUI
Yard supervisorPlaceHoldCommandREST POST /trailers/{trailerId}/holdsUI
Yard supervisorReleaseHoldCommandREST POST /trailers/{trailerId}/hold-releasesUI
Yard supervisorRecordSealCommandREST POST /trailers/{trailerId}/sealsUI
Yard supervisorDeclareYardPolicyCommandREST PUT /sites/{siteId}/yard-policyUI
Yard supervisorOpenYardCheckCommandREST POST /yard-checksUI
Yard supervisorRecordObservationCommandREST POST /yard-checks/{yardCheckId}/observationsUI
Yard supervisorCloseYardCheckCommandREST POST /yard-checks/{yardCheckId}/closuresUI
Any contextListVisitsQueryREST GET /visitsOHS
Any contextGetVisitQueryREST GET /visits/{visitId}OHS
Any contextListTrailersQueryREST GET /trailersOHS
Any contextGetTrailerQueryREST GET /trailers/{trailerId}OHS
Any contextListMovesQueryREST GET /movesOHS
Any contextGetYardBoardQueryREST GET /sites/{siteId}/yard-boardOHS
Any contextGetYardPolicyQueryREST GET /sites/{siteId}/yard-policyOHS
Scheduler (cron)DwellSweepCommandREST POST /dwell-sweepsUI
Scheduler (cron)ExpireLeaseCommandREST POST /move-lease-sweepsUI
warehouse-ops-agent, AI clientsGetYardBoard, ListTrailers, GetTrailer, ListMoves, ListVisits, GetVisit, GetYardPolicy, Reports.YardDwell, GetInspection, ListTrailerInspections, CheckTimeOnSite (L1 tools; the ops agent wires ten of the eleven)QueryMCP /api/mcp/yard-management (Agent Router, rewritten to /mcp)OHS
AI clientsRecommendNextDoor, ProposePickupPlan, ListGateRecordGaps (L2 tools: a recommendation, no change)QueryMCP /api/mcp/yard-managementOHS
AI clientsRequestMove, CancelMove, PlaceHold, ReleaseHold, RecordSeal, SecureTrailer, ReleaseTrailerSecuring, OpenYardCheck, OpenInspection, RecordInspectionItem, CompleteInspection (L3 tools, each with idempotencyKey and initiated_by)CommandMCP /api/mcp/yard-managementOHS
Delegating agent (any agent client; warehouse-ops-agent calls neither)yard_status (L1 skill: GetTrailer, ListTrailers, GetYardBoard)QueryA2A /api/a2a/yard-management (Agent Router, rewritten to /)OHS
Delegating agentrequest_yard_move (L3 skill: RequestMove)CommandA2A /api/a2a/yard-managementOHS
dock-schedulingDockAppointmentBookedEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentBookedCustomer/Supplier
dock-schedulingDockAppointmentRescheduledEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentRescheduledCustomer/Supplier
dock-schedulingDockAppointmentCancelledEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentCancelledCustomer/Supplier
dock-schedulingDockAppointmentNoShowEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentNoShowCustomer/Supplier
dock-schedulingDoorClosureScheduledEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockcalendar.DoorClosureScheduledCustomer/Supplier
dock-schedulingDoorClosureLiftedEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockcalendar.DoorClosureLiftedCustomer/Supplier
facility-layoutLocationSlotRegisteredEventKafka warehouse.facility.events, com.warehouse.wms.facility-layout.locationslot.LocationSlotRegisteredConformist
facility-layoutLocationSlotDecommissionedEventKafka warehouse.facility.events, com.warehouse.wms.facility-layout.locationslot.LocationSlotDecommissionedConformist
facility-layoutZoneRegisteredEventKafka warehouse.facility.events, com.warehouse.wms.facility-layout.zone.ZoneRegisteredConformist
inbound-receivingASNRegisteredEventKafka warehouse.inbound-receiving.events, com.warehouse.wms.inbound-receiving.asn.ASNRegisteredConformist
inbound-receivingASNCancelledEventKafka warehouse.inbound-receiving.events, com.warehouse.wms.inbound-receiving.asn.ASNCancelledConformist
inbound-receivingReceiptOpenedEventKafka warehouse.inbound-receiving.events, com.warehouse.wms.inbound-receiving.receipt.ReceiptOpenedConformist
inbound-receivingReceiptClosedEventKafka warehouse.inbound-receiving.events, com.warehouse.wms.inbound-receiving.receipt.ReceiptClosedConformist

The CloudEvents type strings of the consumed events are the ones in each producer's AsyncAPI: apis/ for facility-layout and inbound-receiving, yard/apis/dock-scheduling/ for dock-scheduling (merged on develop).

The MCP and A2A rows are as built on develop 3bcfc22 (read 2026-12-02; service ADRs 0007, 0013, 0015, 0020 and 0021), not rows of the model: the 25 MCP tools (11 L1, 3 L2, 11 L3) and the two A2A skills call the same use cases as their REST twins, listed on Use Cases. The gate, hostler and dock operator actions are on neither surface. Both surfaces are built on develop and switched off: mcp.enabled: false in warehouse-infra, no a2a block there, and v0.1.4 ships the MCP server with 21 tools and no A2A agent (see Service and operations).

Outbound Communication​

CollaboratorMessageTypeChannelRelationship
dock-scheduling, inbound-receivingVisitCheckedInEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.yardvisit.VisitCheckedInCustomer/Supplier (dock-scheduling is the Customer; inbound-receiving is a Customer, this pack's reading)
dock-scheduling, outbound-shippingTrailerDockedEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.trailer.TrailerDockedCustomer/Supplier
dock-schedulingTrailerUndockedEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.trailer.TrailerUndockedCustomer/Supplier
dock-scheduling, exception-managementVisitRejectedEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.yardvisit.VisitRejectedCustomer/Supplier
exception-managementSealExceptionRaisedEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.trailer.SealExceptionRaisedCustomer/Supplier
exception-managementTrailerDwellExceededEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.trailer.TrailerDwellExceededCustomer/Supplier
exception-managementYardCheckClosedEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.yardcheck.YardCheckClosedCustomer/Supplier
analytics onlyVisitCheckedOutEventKafka warehouse.yard-management.analytics, com.warehouse.wms.yard-management.yardvisit.VisitCheckedOutPL, no named consumer
outbound-shippingDoorWorkCompleted, TrailerDepartedEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.trailer.<Event>Customer/Supplier (integration since 2026-11-09)
analytics onlyTrailerParked, DoorWorkStarted, TrailerHeld, TrailerHoldReleasedEventKafka warehouse.yard-management.analytics, com.warehouse.wms.yard-management.trailer.<Event>PL, no named consumer
analytics onlyYardMoveRequested, YardMoveClaimed, YardMoveLeaseExpired, YardMoveCompleted, YardMoveCancelledEventKafka warehouse.yard-management.analytics, com.warehouse.wms.yard-management.yardmove.<Event>PL, no named consumer
—(no synchronous calls)—sync_calls: []—

The relationship for exception-management, outbound-shipping and inbound-receiving is this pack's reading: the model lists them as consumers of the events and as fleet_changes, and the strategic context map marks the edges Customer/Supplier. All consumers are merged on develop. inbound-receiving consumes VisitCheckedIn only (its ADR 0021, commit 484490f); it is not a consumer of TrailerDocked: the optional consumer in the model was not built. Neither context's own inbound rows are in this model.

Full message details: Domain Events. Relationship evidence: Context Map.

Ubiquitous Language​

Full glossary: Ubiquitous Language. Top terms: Yard, Yard Visit (purposes DROP, LIVE_UNLOAD, LIVE_LOAD, PICKUP, BOBTAIL), Trailer, Spot, Dock Door, Hostler, Yard Move, Door Work, Dwell, Seal.

Business Decisions​

  1. One place per trailer. A trailer on site is at exactly one yard spot, one door, or one open move.
  2. One trailer per spot or door (ErrLocationOccupied, under a per-location advisory lock and a partial unique index).
  3. One open move per trailer (ErrTrailerHasOpenMove), and its destination is reserved when requested (ErrDestinationReserved).
  4. Moves are pulled. A hostler claims the next move with a lease and holds at most one (ErrHostlerBusy); only the lease holder completes it (ErrNotLeaseHolder).
  5. Check-out only when released and sealed. ErrTrailerNotReleased, ErrSealRequired.
  6. Walk-ins go to a holding spot unless the site's policy requires an appointment (ErrAppointmentRequired).
  7. Seal mismatch raises an exception; REJECT policy also rejects the visit.
  8. A trailer on hold is not docked (ErrTrailerOnHold); a docked trailer departs only when its door work is done (ErrDoorWorkOpen).
  9. A door under a closure takes no trailer (ErrDoorClosed); a loaded trailer docks only at a door whose flow allows its direction (ErrDoorFlowMismatch).
  10. At most one open yard check per site (ErrYardCheckOpen).

Assumptions​

  • facility-layout publishes every Yard and Dock slot with zoneId, role and dockFlow, and every zone with its siteCode; a door or spot is mapped to its site only through that join, never by parsing a location code.
  • dock-scheduling publishes an appointment's door_code, window and expected_seal_number, and its closures, before the carrier arrives.
  • inbound-receiving opens a receipt on the appointment with appointment_id and door_code (ReceiptOpened), and closes it (ReceiptClosed).
  • Yard events are keyed by visit or trailer id, so dock-scheduling may see them in any order across partitions (its policy OutOfOrderYardFacts).
  • Consumers rebuild their copies from events only; there is no synchronous call into or out of this context on a decision path.

Verification Metrics​

Neither the model nor the service states targets; the targets below are this page's proposal. The measures are the ones YardKpiReport names or the invariants imply.

MetricTargetSource
Trailers on site in more than one place0trailers check
Spots or doors holding more than one trailer0partial unique index, trailers check
Dwell by trailer kindreport weeklyTrailerDeparted.dwell_minutes on the analytics topic
Door utilisationreport weeklyTrailerDocked, TrailerUndocked, DoorWorkStarted, DoorWorkCompleted
Moves per hostler hourreport weeklyYardMoveCompleted.duration_seconds
Driver wait (arrival to door work started)report weeklyVisitCheckedIn.arrived_at, DoorWorkStarted.started_at
Expired leases per daytrend to 0POST /move-lease-sweeps result
ErrLocationOccupied or ErrDestinationReserved refusalstrend to 0use-case error counter
Late or unknown appointment facts ignored by dock-schedulingtrend to 0dock-scheduling ignored-and-counted metric
Lag from TrailerUndocked to the next YardMoveRequested for that doorp95 under one minuteevent timestamps

Closed questions​

The gaps this page used to list were decided before the build (decisions Y-1 to Y-14, X1 to X7; the register is Model Gap Register) and are in the service; how each was settled is in the hotspot table on EventStorming. In short: a lease expiry or a cancelled claimed move returns the trailer where it was (ReturnToOrigin, YM-G1); the gate creates the trailer IN_MOVE with a visiting-driver move that the gate clerk or dock operator completes (YM-G2, YM-G3); the arrival tolerance travels on the dock-scheduling booking events and the appointment copy marks itself CHECKED_IN and USED (YM-G5, YM-G6); a refused check-in creates nothing while RejectAtGate records a rejected visit (YM-G7); ArriveAt and the departure commands raise the location events (YM-G8); a live visit leaves from the door (YM-G28); the report routes have an inbound row of their own (YM-G26).