0049. The charge forecast and the shift plan move to warehouse-planning
Date: 2026-11-18 Status: Accepted. Stages A-D implemented 2026-11-19 (PR #299, released as v2.0.3 with one release of the 410 tombstones); stage E — the routes' removal — implemented 2026-11-21.
Amends ADR-0006 (the ShiftPlan half; the
LaborPlanObserved projection stays), supersedes
ADR-0019 (the drift check moves
with the plan) and retires the commit-time lookup of
ADR-0017. Leaves
ADR-0018 untouched. Counterpart: warehouse-planning ADR 0023.
Context
This context holds two planning aggregates next to its execution model:
charge.ChargeForecast, the volume due by each CPT on a path, saved byReceiveChargeForecast;plan.ShiftPlan/plan.PathPlan, rate x heads x hours on a path with theplannedHeads <= installedStationsinvariant, saved byCommitShiftPlan.
Read on develop: no use case reads a ChargeForecast after saving it, and the only readers
of a ShiftPlan are the drift reconciliation of ADR-0019 and the plan's own GET. Release
(ReleaseNextWork), admission (WorkPool), flow balancing (RebalanceDecision, backlog
telemetry) and PathCapacityChanged use neither. The only caller of the two POST routes is the
fleet's warehouse-day simulation, which sends the same planner's morning to three contexts. The
published ChargeForecastReceived and plan.ShiftPlanCommitted carry only path_id, and no
context outside this one consumes them or PathPlanDriftDetected (this repo's own analytics
consumer acknowledges them).
Deciding a shift's forecast and heads is planning; releasing and balancing work against the live floor is execution. warehouse-planning, which already owns capacity plans, takes both (its ADR 0023) and publishes the result.
Decision
- Stage C cutover, after warehouse-planning's routes are on
developand the simulation uses them.POST /paths/{pathId}/chargeanswers410with problem typecharge-forecast-moved, whose detail names warehouse-planning'sPUT /workload-forecasts/{site_id}/{path_id}.POST /paths/{pathId}/plananswers410with problem typeshift-plan-moved, namingPUT /labour-plans/{site_id}/{shift_id}/{path_id}.- The two
GETroutes stay one release, markeddeprecated, then go in stage E. - The contract test excludes the two always-410 operations with a stage-E removal note.
- Removed:
ReceiveChargeForecast,CommitShiftPlan, the drift reconciliation inObserveLaborPlan(the projection intoLaborPlanObservedstays), their REST wiring, the travel-distance lookup of ADR-0017 and the pick-load annotations of a bucket and a plan (they were only echoed back in responses).TRAVEL_DISTANCE_MODEand its chart value go with the lookup, and so doesFACILITY_LAYOUT_BASE_URL(the REST sync edge to facility-layout) unless another feature still reads it, checked at implementation; the warehouse-infra values entries are removed in the same rollout. - Retired types, removed from both channels of
apis/asyncapi.yamland marked retired in the CloudEvents type catalogue (the fitness test keeps one row per type):com.warehouse.wes.work-planning.charge.ChargeForecastReceived,com.warehouse.wes.work-planning.plan.ShiftPlanCommitted,com.warehouse.wes.work-planning.pathplan.PathPlanDriftDetected. The analytics projector keeps acknowledging the historical types. Before removal, every sibling'sdevelopis grepped again for a non-test consumer; a hit stops the retirement. - Tables are kept. The charge and plan tables stop being written. Dropping them is destructive and waits for an explicit approval and its own migration.
- Unchanged:
WorkPool, waveless release, flow balancing, backlog telemetry,PathCapacityChanged(remaining admission capacity per path and CPT, ADR-0018),LaborPlanObservedand itsGET /paths/{pathId}/labor-plan-view, whichRebalanceDecisionstill returns as context. - Language. This context publishes remaining admission capacity (live, per path and CPT). Planned capacity is warehouse-planning's (per window). The glossary says so; no event is renamed.
Consequences
- The context keeps only what it executes with; the planner's morning no longer touches it.
- Two routes answer 410 for one release, then disappear with their
GETs. - Three published types leave the contract. Nothing outside this repo consumed them.
- The
plannedHeads <= installedStationsinvariant is not lost: it moves verbatim into warehouse-planning'sLabourPlan.
Alternatives rejected
- Keep the aggregates and also consume warehouse-planning's plan. Two copies of one decision, and a third reconciliation.
- Keep a local copy of the published labour plan "for later". Nothing here reads a plan; a copy nobody reads is dead state. A future rule that needs it (a WIP limit derived from planned heads) adds the copy with its own ADR.
- Import the stored rows into warehouse-planning. Both are overwritten every shift; the planner sends them again at the next shift boundary.