Skip to main content

Dock Scheduling

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

Supporting

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​

PageWhat it holdsddd-crew tool it follows
Business ContextThe problem, the actors, the decisions, what is out of scope— (narrative)
Ubiquitous LanguageDock Appointment, Door Window, Door Calendar, Closure, Arrival Status, No-Show, SCAC, CPT and the neighbour terms used here— (glossary)
Core Domain ChartWhy this context is Supportingcore-domain-charts
Bounded Context CanvasPurpose, classification, roles, every inbound and outbound messagebounded-context-canvas v5
Context MapEvery upstream and downstream neighbour with its pattern and channelcontext-mapping
Aggregate Design CanvasDockAppointment and DockCalendar: states, invariants, commands, eventsaggregate-design-canvas v1.1
Domain EventsThe eleven published (seven integration, four analytics only) and ten consumed events, with full CloudEvents types— (event catalogue)
Domain Message FlowBooking, arrival to completion, late ETA and no-show, closure and ASN cancellation, a reschedule delegated over A2Adomain-message-flow-modelling
EventStormingProcess-level boards with hotspotseventstorming-glossary-cheat-sheet
Use CasesOne section per command: trigger, adapter, flow, errors, events— (application layer)
Class DiagramDomain types and the hexagonal ports and adapters of the built service— (UML)
Entity RelationshipThe Postgres schema of the built service (OLTP and analytics)— (ER)
Sequence DiagramsOne runtime sequence per command use case— (UML)

In numbers (from the model)​

ItemCountWhere it is listed
Aggregates2: DockAppointment (5 states), DockCalendar (1 state)Aggregate Design Canvas
Invariants with an Err name16 (12 + 4)same page
Commands12 (8 + 4)Use Cases
REST routes15Bounded Context Canvas
Published events11: 7 on warehouse.dock-scheduling.events (and its analytics twin), 4 analytics onlyDomain Events
Consumed events10same page
Policies10 (one of them phase 2, half built)same page
Read models5Aggregate Design Canvas

Status​

  • Service: built on develop (merged 2026-11-08, DockAppointmentDoorReassigned on the integration topic since 2026-11-09; develop read at 096db0a on 2026-12-02) in IQVO/dock-scheduling; registered in warehouse-infra develop (terraform/apps.yaml entry with a database and analytics, helm-values/dock-scheduling.yaml, a dashboard, alert rules and the image pinned to the v0.1.3 commit a1a029c in terraform/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 commit d5db895; checked 2026-12-02: dock-scheduling 1/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 projector dock-scheduling-analytics, Kong routes /api/dock-scheduling and /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 no a2a block, so the A2A agent is not deployed, and the infra values still set config.dockLegacyImportConsumerGroup: "", a dead key since the importer and the chart value were removed in ADR 0011 (on develop and 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.md in 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's as_built block records the same. The contracts are copied under yard/apis/dock-scheduling/ and scripts/check_model.py compares the model with them. Seven binaries on develop: api, mcp, a2a, projector, relay, reports and sweep (v0.1.3 ships six, without a2a). Sixteen ADRs on develop (0001 to 0016); the ADR page indexes the first eleven.
  • MCP: the service ships its own MCP server (cmd/mcp, ADR 0007: Streamable HTTP on port 8090, open GET /healthz, no auth; every tool declares its authority in tools/list _meta com.warehouse/authority, Agentic Standard v2) with 18 tools on develop (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's register_carrier, suspend_carrier and reinstate_carrier of ADR 0012, and apply_reschedule_plan, which applies a person-approved plan once), every write behind an idempotencyKey with initiated_by attribution, via mcp; since ADR 0016 the appointment facts an agent write raises carry initiated_by on 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-scheduling through 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 (name dock-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, over GetDockCalendar, GetCarrier, ListAppointments and GetDoorAvailability; changes nothing) and book_or_reschedule_appointment (L3, "Book or reschedule a carrier appointment": BookAppointment with operation=book or RescheduleAppointment with operation=reschedule, the MCP twins of the write, behind the same idempotency guard; the human approval is held by the caller and named by proposalId and approvedBy, and the appointment facts it raises carry initiated_by with via a2a, 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 of cmd/api. Route /api/a2a/dock-scheduling through the Agent Router, rewritten to /. Built on develop (first commit d78d414, 2026-12-02), not in v0.1.3 and not deployed: the chart component is off by default and warehouse-infra has no a2a block. Catalogued on the fleet A2A Agents page; the authority levels are the fleet's Agentic Standard.
  • Agent clients: warehouse-ops-agent develop (abc8472, checked 2026-12-02) builds a dock-scheduling MCP client from DOCK_SCHEDULING_MCP_ENDPOINT (cmd/agent/wire_clients.go, its seven read tools, its ADR 0032) and reads it in RescheduleOutlook (internal/application/usecases/reschedule_outlook.go, its ADR 0035: list_at_risk_appointments, get_dock_calendar, get_door_availability) and YardDockBrief (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. With DOCK_SCHEDULING_A2A_URL set the agent also delegates one human-approved reschedule (POST /yard-dock/reschedule/proposals/{proposalId}/approvals) to book_or_reschedule_appointment with operation=reschedule and agentId warehouse-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 on develop and 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) and exception-management (new consumer), all three built on develop, outbound-shipping (new consumer, built), warehouse-ops-agent (the MCP tools and the A2A write skill, wired on its develop, see Status), warehouse-console (Dock Calendar remote) and warehouse-floor-client.