Dock Scheduling
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).
Dock Scheduling (dock-scheduling, code DS, tier wms) owns the
door calendar of every site: every booked time window on every dock door,
inbound and outbound, from booking through arrival to door release. It keeps
one rule above all: no two active appointments (BOOKED or CHECKED_IN)
overlap on the same door, and it checks every booking against the door's
direction (dockFlow), its operating hours and its closures. It also owns
the ETA-driven advisory DockAppointmentAtRisk and the no-show sweep.
It owns the future of a door. Its sibling yard-management owns the
present of the yard (who and what is physically where). Neither records
the other's facts: arrival, docking and door release are physical facts that
this context only applies from yard-management events
(VisitCheckedIn, TrailerDocked, TrailerUndocked), never from its own
API. The model records the decision as YD-0004, "Physical facts win".
The appointment itself moves here from inbound-receiving (YD-0002): one
owner of door time for both directions, delivered through the strangler
stages A to E listed in fleet_changes. Stage E is done on develop: the
legacy appointment importer (stage A) was removed from this service in its
ADR 0011 and inbound-receiving removed its side in its ADR 0022 (2026-11-10).
This context's pages
| Page | What it holds | ddd-crew tool it follows |
|---|---|---|
| Business Context | The problem, the actors, the decisions, what is out of scope | — (narrative) |
| Ubiquitous Language | Dock Appointment, Door Window, Door Calendar, Closure, Arrival Status, No-Show, SCAC, CPT and the neighbour terms used here | — (glossary) |
| Core Domain Chart | Why this context is Supporting | core-domain-charts |
| Bounded Context Canvas | Purpose, classification, roles, every inbound and outbound message | bounded-context-canvas v5 |
| Context Map | Every upstream and downstream neighbour with its pattern and channel | context-mapping |
| Aggregate Design Canvas | DockAppointment and DockCalendar: states, invariants, commands, events | aggregate-design-canvas v1.1 |
| Domain Events | The eleven published (seven integration, four analytics only) and ten consumed events, with full CloudEvents types | — (event catalogue) |
| Domain Message Flow | Booking, arrival to completion, late ETA and no-show, closure and ASN cancellation, a reschedule delegated over A2A | domain-message-flow-modelling |
| EventStorming | Process-level boards with hotspots | eventstorming-glossary-cheat-sheet |
| Use Cases | One section per command: trigger, adapter, flow, errors, events | — (application layer) |
| Class Diagram | Domain types and the hexagonal ports and adapters of the built service | — (UML) |
| Entity Relationship | The Postgres schema of the built service (OLTP and analytics) | — (ER) |
| Sequence Diagrams | One runtime sequence per command use case | — (UML) |
In numbers (from the model)
| Item | Count | Where it is listed |
|---|---|---|
| Aggregates | 2: DockAppointment (5 states), DockCalendar (1 state) | Aggregate Design Canvas |
Invariants with an Err name | 16 (12 + 4) | same page |
| Commands | 12 (8 + 4) | Use Cases |
| REST routes | 15 | Bounded Context Canvas |
| Published events | 11: 7 on warehouse.dock-scheduling.events (and its analytics twin), 4 analytics only | Domain Events |
| Consumed events | 10 | same page |
| Policies | 10 (one of them phase 2, half built) | same page |
| Read models | 5 | Aggregate Design Canvas |
Status
- Service: built on
develop(merged 2026-11-08,DockAppointmentDoorReassignedon the integration topic since 2026-11-09;developread at096db0aon 2026-12-02) in IQVO/dock-scheduling; registered in warehouse-infra develop (terraform/apps.yamlentry with a database and analytics,helm-values/dock-scheduling.yaml, a dashboard, alert rules and the image pinned to the v0.1.3 commita1a029cinterraform/targets/k3s.images.yaml, since 2026-11-16). Applied to the k3s cluster since 2026-11-10 in a reduced footprint (first at v0.1.2, main commitd5db895; checked 2026-12-02:dock-scheduling1/1): only the api runs (it relays its outbox inline, so the dedicated relay is off), and the mcp, projector, reports and sweep components are switched off until the cluster has room. The helm values give the api four consumer groups (dock-scheduling-yard,dock-scheduling-facility,dock-scheduling-asn,dock-scheduling-cpt), the projectordock-scheduling-analytics, Kong routes/api/dock-schedulingand/api/dock-scheduling/reports, the Agent Router route/api/mcp/dock-scheduling(declared,mcp.enabled: false), a dedicated relay and the no-show sweep every five minutes; there is noa2ablock, so the A2A agent is not deployed, and the infra values still setconfig.dockLegacyImportConsumerGroup: "", a dead key since the importer and the chart value were removed in ADR 0011 (ondevelopand in v0.1.3; the v0.1.2 binary it was written for still contained the importer, switched off by the empty group). The yard-domain Kafka topics must be pre-created before the first sync (docs/kafka-topics-yard-dock.mdin warehouse-infra). An edge is live only when both ends run: the yard-management edges are live (both run), the others depend on the other end's deployment. The no-show sweep does not run while the sweep is off. The model'sas_builtblock records the same. The contracts are copied underyard/apis/dock-scheduling/andscripts/check_model.pycompares the model with them. Seven binaries ondevelop:api,mcp,a2a,projector,relay,reportsandsweep(v0.1.3 ships six, withouta2a). Sixteen ADRs ondevelop(0001to0016); the ADR page indexes the first eleven. - MCP: the service ships its own MCP server (
cmd/mcp, ADR 0007: Streamable HTTP on port 8090, openGET /healthz, no auth; every tool declares its authority intools/list_metacom.warehouse/authority, Agentic Standard v2) with 18 tools ondevelop(14 in v0.1.3): eight L1 reads (get_appointment,get_carrier,get_dock_calendar,get_door_availability,list_appointments,list_at_risk_appointments,list_carriers,get_dock_briefing), two L2 proposals that change nothing (propose_reschedule_plan,propose_late_arrival_actions, ADR 0016: one stored plan per door closure or late-arrival sweep, valid one hour) and eight L3 writes (book_appointment,reschedule_appointment,cancel_appointment,report_eta, the carrier registry'sregister_carrier,suspend_carrierandreinstate_carrierof ADR 0012, andapply_reschedule_plan, which applies a person-approved plan once), every write behind anidempotencyKeywithinitiated_byattribution,viamcp; since ADR 0016 the appointment facts an agent write raises carryinitiated_byon the event. Three resource templates (dock://sites/{siteId}/calendar,dock://sites/{siteId}/at-risk,dock://appointments/{appointmentId}) and five prompts (plan_dock_booking,triage_at_risk_appointments,reschedule_after_door_closure,handle_late_arrivals,pre_shift_dock_briefing). Arrival, door release, the calendar changes and the sweep are not exposed over MCP. Registered in warehouse-infra and switched off until the cluster has room:mcp.enabled: false, route/api/mcp/dock-schedulingthrough the Agent Router, rewritten to/mcp. Catalogued on the fleet Agent Catalogue. - A2A:
cmd/a2a(ADR 0015, accepted 2026-12-02) is a third inbound adapter beside REST and MCP, over the same use cases: JSON-RPC 2.0 over HTTP on port 8093 (/and/a2a), message-only, the agent card at/.well-known/agent-card.json(namedock-scheduling, provider IQVO, no security schemes, no streaming), no auth. Two goal-shaped skills, each with its authority as a card tag:appointment_options(L1, "Appointment options for a site, direction and window": the site's booking rules, the references the direction requires, whether the carrier may book and the free windows per door, overGetDockCalendar,GetCarrier,ListAppointmentsandGetDoorAvailability; changes nothing) andbook_or_reschedule_appointment(L3, "Book or reschedule a carrier appointment":BookAppointmentwithoperation=bookorRescheduleAppointmentwithoperation=reschedule, the MCP twins of the write, behind the same idempotency guard; the human approval is held by the caller and named byproposalIdandapprovedBy, and the appointment facts it raises carryinitiated_bywithviaa2a, ADR 0016). Cancellation, ETA reports, the carrier registry and the calendar changes stay on REST and MCP. Delegation only: the facts still leave as CloudEvents through the outbox and the relay ofcmd/api. Route/api/a2a/dock-schedulingthrough the Agent Router, rewritten to/. Built ondevelop(first commitd78d414, 2026-12-02), not in v0.1.3 and not deployed: the chart component is off by default and warehouse-infra has noa2ablock. Catalogued on the fleet A2A Agents page; the authority levels are the fleet's Agentic Standard. - Agent clients:
warehouse-ops-agentdevelop(abc8472, checked 2026-12-02) builds a dock-scheduling MCP client fromDOCK_SCHEDULING_MCP_ENDPOINT(cmd/agent/wire_clients.go, its seven read tools, its ADR 0032) and reads it inRescheduleOutlook(internal/application/usecases/reschedule_outlook.go, its ADR 0035:list_at_risk_appointments,get_dock_calendar,get_door_availability) andYardDockBrief(yard_dock_brief.go:list_at_risk_appointments), fail-open: with no endpoint the outlook cannot be built (ErrDockSchedulingNotConfigured) and the brief's dock section is omitted as not configured. WithDOCK_SCHEDULING_A2A_URLset the agent also delegates one human-approved reschedule (POST /yard-dock/reschedule/proposals/{proposalId}/approvals) tobook_or_reschedule_appointmentwithoperation=rescheduleandagentIdwarehouse-ops-agent; unset, the proposal stays a token-less L2. warehouse-infra sets neither variable (helm-values/warehouse-ops-agent.yaml), so both edges are wired ondevelopand off in the cluster.
Where the model was silent, the pages first said proposed and reported a gap with an id of the form DS-Gnn.
The service's decisions (ADR 0002 and ADR 0009, decisions D-1 to D-13 and X1 to X7) closed them: see the
Model Gap Register. A page that still says this pack's reading
marks a point the service does not state.
Elsewhere
- Industry basis for the yard design: benchmarks.
- The sibling pack for the present of the yard: yard-management Domain Events.
- Decisions in the model this context rests on: YD-0001 (two contexts),
YD-0002 (the appointment moves from
inbound-receiving), YD-0004 (physical facts win) and YD-0005 (outbound pickups come from the fleet's CPT schedule, never from the retail network). - Changes the model asks of existing contexts (
fleet_changes):inbound-receiving(ownership transfer),warehouse-planning(consumer source switch) andexception-management(new consumer), all three built ondevelop,outbound-shipping(new consumer, built),warehouse-ops-agent(the MCP tools and the A2A write skill, wired on itsdevelop, see Status),warehouse-console(Dock Calendar remote) andwarehouse-floor-client.