Skip to main content

Bounded Context Canvas

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).

Following the ddd-crew Bounded Context Canvas v5. Every message row comes from contexts[dock-scheduling] → 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 with no named consumer (analytics only). Channel names are abbreviated; the tables carry the exact route, topic and CloudEvents type.

Inbound​

Outbound​

Derived from: model.yaml → contexts[dock-scheduling].inbound, .rest, .publishes, .consumes, .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.

Name​

Dock Scheduling (dock-scheduling, code DS, CloudEvents subdomain wms).

Purpose​

Own the door calendar of every site: every booked time window on every dock door, inbound and outbound, from booking through arrival to door release, the no-double-booking rule, door opening hours and closures, ETA-driven risk and no-shows. It owns the future of a door; yard-management owns the present of the yard. Each keeps an event-fed local copy of what it needs from the other, and neither records the other's facts.

Strategic Classification​

AxisVerdict
DomainSupporting (see Core Domain Chart).
Business ModelCost reducer (carrier wait, detention, idle dock labour) and revenue protector (on-time inbound).
EvolutionProduct.

Domain Roles​

RoleEvidence in the model
Specification (door calendar)DockCalendar holds operating hours, closures and settings; every booking is checked against it; GetDockCalendar and GetDoorAvailability publish it.
Gateway for carriers (Open Host Service)The carrier scheduler books, reschedules, cancels and reports ETAs over REST (relationship: OHS); any context queries over REST (OHS); agent clients reach the same reads and the booking writes over MCP and the A2A skill (built, switched off).
Analysis (adherence)Read model AdherenceReport: on-time, early, late and no-show share per site and carrier, built from the analytics topic; route GET /reports/schedule-adherence.

Inbound Communication​

The Kafka types are read from each producer's AsyncAPI and the service dispatches on the full type string (process-path-management is in the wes tier: com.warehouse.wes.process-path-management.cptschedule.CPTScheduleChanged).

CollaboratorMessageTypeChannelRelationship
Carrier scheduler (carrier portal)BookAppointmentCommandREST POST /appointmentsOHS
Carrier scheduler (carrier portal)RescheduleAppointmentCommandREST POST /appointments/{appointmentId}/reschedulesOHS
Carrier scheduler (carrier portal)CancelAppointmentCommandREST POST /appointments/{appointmentId}/cancellationsOHS
Carrier scheduler (carrier portal)ReportEtaCommandREST POST /appointments/{appointmentId}/eta-reportsOHS
Dock plannerRescheduleAppointmentCommandREST POST /appointments/{appointmentId}/reschedulesUI
Dock plannerCancelAppointmentCommandREST POST /appointments/{appointmentId}/cancellationsUI
Dock plannerDeclareOperatingHoursCommandREST PUT /sites/{siteId}/dock-calendar/operating-hoursUI
Dock plannerDeclareCalendarSettingsCommandREST PUT /sites/{siteId}/dock-calendar/settingsUI
Dock plannerScheduleDoorClosureCommandREST POST /sites/{siteId}/dock-calendar/closuresUI
Dock plannerLiftDoorClosureCommandREST POST /sites/{siteId}/dock-calendar/closures/{closureId}/liftsUI
Any contextListAppointmentsQueryREST GET /appointmentsOHS
Any contextGetAppointmentQueryREST GET /appointments/{appointmentId}OHS
Any contextGetDoorAvailabilityQueryREST GET /doors/{doorCode}/availabilityOHS
Any contextGetDockCalendarQueryREST GET /sites/{siteId}/dock-calendarOHS
Scheduler (cron)MarkNoShowCommandREST POST /no-show-sweepsUI
warehouse-ops-agent, AI clientsListAppointments, GetAppointment, GetDoorAvailability, GetDockCalendar, ListAtRisk, GetDockBriefing, ListCarriers, GetCarrier (L1 tools; the ops agent wires seven of the eight)QueryMCP /api/mcp/dock-scheduling (Agent Router, rewritten to /mcp)OHS
AI clientspropose_reschedule_plan, propose_late_arrival_actions (L2 tools: a stored proposal, no change)QueryMCP /api/mcp/dock-schedulingOHS
AI clientsBookAppointment, RescheduleAppointment, CancelAppointment, ReportEta, ApplyReschedulePlan, RegisterCarrier, SuspendCarrier, ReinstateCarrier (L3 tools, each with idempotencyKey and initiated_by)CommandMCP /api/mcp/dock-schedulingOHS
Delegating agent (warehouse-ops-agent with DOCK_SCHEDULING_A2A_URL set, or any agent client)appointment_options (L1 skill)QueryA2A /api/a2a/dock-scheduling (Agent Router, rewritten to /)OHS
Delegating agentbook_or_reschedule_appointment (L3 skill: BookAppointment or RescheduleAppointment)CommandA2A /api/a2a/dock-schedulingOHS
yard-managementVisitCheckedInEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.yardvisit.VisitCheckedInCustomer/Supplier
yard-managementVisitRejectedEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.yardvisit.VisitRejectedCustomer/Supplier
yard-managementTrailerDockedEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.trailer.TrailerDockedCustomer/Supplier
yard-managementTrailerUndockedEventKafka warehouse.yard-management.events, com.warehouse.wms.yard-management.trailer.TrailerUndockedCustomer/Supplier
facility-layoutLocationSlotRegisteredEventKafka warehouse.facility.eventsConformist
facility-layoutLocationSlotDecommissionedEventKafka warehouse.facility.eventsConformist
facility-layoutZoneRegisteredEventKafka warehouse.facility.eventsConformist
inbound-receivingASNRegisteredEventKafka warehouse.inbound-receiving.eventsConformist
inbound-receivingASNCancelledEventKafka warehouse.inbound-receiving.eventsConformist
process-path-managementCPTScheduleChangedEventKafka warehouse.process-path-management.eventsConformist

Reports: GET /reports/schedule-adherence and GET /reports/freshness are served by the separate reports binary from apis/openapi-reports.yaml (read-only, on the analytics database) and have an inbound row of their own (dock planner, query).

The MCP and A2A rows are as built on develop 096db0a (read 2026-12-02; service ADRs 0007, 0012, 0015 and 0016), not rows of the model: the 18 MCP tools (8 L1, 2 L2, 8 L3) and the two A2A skills call the same use cases as their REST twins, listed on Use Cases. Both surfaces are built on develop and switched off: mcp.enabled: false in warehouse-infra, no a2a block there, and v0.1.3 ships the MCP server with 14 tools and no A2A agent (see Status).

Outbound Communication​

Topics are warehouse.dock-scheduling.events for integration events (each also goes, as a twin, to the analytics topic) and warehouse.dock-scheduling.analytics for the events the model marks analytics only. The relationship column is the model's for yard-management and this pack's reading for the others.

CollaboratorMessageTypeChannelRelationship
yard-management, warehouse-planning, inbound-receiving, outbound-shippingDockAppointmentBookedEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentBookedyard-management: Customer/Supplier; the others: OHS + PL (reading)
yard-management, warehouse-planning, inbound-receivingDockAppointmentRescheduledEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentRescheduledsame
yard-management, warehouse-planning, inbound-receivingDockAppointmentCancelledEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentCancelledsame
yard-management, warehouse-planning, exception-managementDockAppointmentNoShowEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentNoShowsame
inbound-receivingDockAppointmentDoorReassignedEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentDoorReassignedOHS + PL (reading); integration since 2026-11-09 (service ADR 0010)
yard-managementDoorClosureScheduledEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockcalendar.DoorClosureScheduledCustomer/Supplier
yard-managementDoorClosureLiftedEventKafka warehouse.dock-scheduling.events, com.warehouse.wms.dock-scheduling.dockcalendar.DoorClosureLiftedCustomer/Supplier
analytics onlyDockAppointmentCheckedInEventKafka warehouse.dock-scheduling.analytics, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentCheckedInPL, no in-org consumer
analytics onlyDockAppointmentCompletedEventKafka warehouse.dock-scheduling.analytics, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentCompletedPL, no in-org consumer
analytics onlyDockAppointmentAtRiskEventKafka warehouse.dock-scheduling.analytics, com.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentAtRiskPL, no in-org consumer
analytics onlyDoorOperatingHoursDeclaredEventKafka warehouse.dock-scheduling.analytics, com.warehouse.wms.dock-scheduling.dockcalendar.DoorOperatingHoursDeclaredPL, no in-org consumer
none(no synchronous calls)n/async_calls: []n/a

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

Ubiquitous Language​

Full glossary: Ubiquitous Language. Top terms: Dock Appointment, Door Window, Door Calendar, Closure, Arrival Status, No-Show.

Business Decisions​

  1. One owner of door time. Inbound and outbound appointments share one calendar per door; a door whose dockFlow is Both takes either direction.
  2. No overlap. No two active (BOOKED or CHECKED_IN) appointments overlap on the same door; windows are half-open (ErrDoorDoubleBooked, enforced by domain service DoorSchedule.CheckNoOverlap under a per-door advisory lock).
  3. Direction fits the door. ErrDoorFlowMismatch.
  4. Inside hours, outside closures. ErrDoorUnavailable.
  5. Physical facts are applied, never recorded. Arrival and door release come from yard-management events.
  6. No-show. A BOOKED appointment with no arrival by window_end plus the site's no-show grace becomes NO_SHOW.
  7. Late ETA is advisory. DockAppointmentAtRisk; nothing reschedules automatically.

Assumptions​

Each is an assumption of the model or of this pack's reading; the service's ADR 0002 and ADR 0003 state the ones it relies on.

  • facility-layout publishes every dock slot with its dockFlow and its zoneId, and every zone with its siteCode; a door reaches its site only through that join, never by parsing a location code (conventions.site_key).
  • inbound-receiving publishes ASNRegistered before an appointment names that ASN; otherwise a booking is refused with ErrUnknownAsn.
  • process-path-management publishes CPTScheduleChanged for a site before an outbound appointment names one of its cpt_id values.
  • Yard events can arrive in any order across partitions (they are keyed by visit or trailer, not by appointment); OutOfOrderYardFacts is the rule that absorbs it.
  • Consumers rebuild their views from events only; no sibling is called synchronously.
  • The retail network is out of reach: no retailnetwork.* topic is consumed.

Verification Metrics​

Targets are this page's proposal; neither the model nor the service sets any. The service exports the counters named below (for example dock_scheduling_ignored_facts_total and dock_scheduling_implicit_arrivals_total).

MetricTarget (proposed)Source
Active appointments that overlap on one door and are not flagged DOOR_REASSIGNED_OVERLAP0dock_appointments table, ActualDoorWins is the only allowed overlap
Share of appointments by ArrivalStatus (EARLY, ON_TIME, LATE) and by NO_SHOW, per site and carrierreport weeklyAdherenceReport
BOOKED appointments past window_end plus no-show grace0 after each sweepdock_appointments table
DockAppointmentAtRisk per ETA report, by causereport weeklyanalytics topic
Yard facts ignored and counted (unknown, terminal, CANCELLED, NO_SHOW)trend to 0use-case counter (policies ArrivalFromGate, OutOfOrderYardFacts)
Bookings refused, by Err... (ErrDoorDoubleBooked, ErrDoorUnavailable, ErrUnknownAsn)report weeklyuse-case error counter
Appointments completed with an implicit arrival (BOOKED to COMPLETED)trend to 0dock_appointments table
Lag from a yard-management event to the matching dock-scheduling eventset before buildevent timestamps

Closed questions​

The gaps this page used to list (DS-G01 to DS-G22) were decided before the build and are folded into the service; the decision per gap is in the Model Gap Register. In short: the arrival tolerance travels on Booked and Rescheduled (DS-G01); VisitRejected cancels with TURNED_AWAY (DS-G02); one appointment covers one trailer (DS-G03); PickupFromCutoffs is phase 2 and only the schedule is stored (DS-G04, DS-G05); a reschedule may change the door (DS-G06); the calendar is created lazily and open 24x7 until hours are declared (DS-G07); the legacy import (removed in dock-scheduling ADR 0011) enforced nothing (DS-G08); the planner may cancel and reschedule (DS-G10); the aggregate exposes atRisk (DS-G11); a decommissioned door blocks new bookings only and new hours that strand an appointment are refused (DS-G12, DS-G13); door codes are globally unique (DS-G15); NO_SHOW is terminal, a late carrier books anew (DS-G16); 409 for conflicts and 422 for value rules (DS-G17).