Capacity composition
How the capacity of a process-path step is resolved. This page summarises ADR 0002 and ADR 0003; the ADRs are the authority.
Which path is resolved (ADR 0025)
A path_id resolves to its ACTIVE process flow (its steps are the flow's
stages' process_type values in order, kept in the event-fed process_flows
copy); since ADR 0025 stage 3 the local declaration is gone, so flows are the
only source and every path read says source: flow. A RETIRED flow, or an id
no ACTIVE flow has, does not resolve (404).
Window coverage
A window C covers a planning window W when C.start <= W.start and
C.end >= W.end (CapacityWindow.Covers; a window covers itself). A
registered constraint applies to a requested window by coverage, not by exact
match.
Why: the labor consumer registers one ProcessCapacity per fanned-out
ShiftPlanCommitted line with window [event.time, event.time + planned_hours).
Lines of one commit share the start and differ in their end (the ADR records
live data at SIM1: PICK +32h, REBIN +8h, PACK +24h), so an exact-window
lookup could never match a planning window.
Resolution among covering aggregates: per constraint type, the constraint
from the aggregate with the latest window start wins (tie: the narrower
window, i.e. the earlier end). An older or wider covering aggregate's
constraint of the same type is shadowed; constraints of other types still
apply. The aggregate's own identity stays an exact key, and the
register/get-effective endpoints (/process-capacities) keep exact window keys.
Station capacity
A station count tallied from facility-layout has no throughput. The
operator declares the throughput of one station (a StationStandard, for
example 180 PACKAGE per hour for PACK at SIM1), and the service composes
count x standard at read time:
station capacity = stationCount(location, activity = process) x StationStandard(location, process)
- A planning
locationis a site/building code such asSIM1; the zones of a site are the tally zones whose id starts with<location>-(for exampleSIM1-OPS-WC). - The derived STATION candidate exists only when both a station count above zero and a standard exist.
- Stations tallied but no standard declared: the step uses its registered constraints only and a warning is carried. A throughput is never invented.
- Nothing derived is stored, so the result converges, has no stale rows and handles late declarations.
Step composition (ComposeStepCapacity)
For a path step with process P at location L and window W:
- Candidates: the covering constraints (one per constraint type, as above) plus the derived STATION constraint, when present.
- Every candidate is normalized to ORDER per hour with the request's
WorkloadProfilebefore comparing (units per hour and packages per hour are not comparable raw). - The step's effective rate is the minimum, and its binding constraint type
(
LABOR,STATION, ...) is reported. Ties go to the earliest candidate: registered constraints in precedence order (newest covering aggregate first, registration order within one aggregate), then STATION. - No candidate at all:
ErrMissingStepCapacity(REST422 missing-step-capacity).
The path capacity is the minimum over the steps; the step that produces it is
the bottleneck step. GET /process-paths/{id}/capacity returns
normalized_rate, normalized_unit (ORDER), bottleneck_step, a per-step
step_breakdown and warnings.
Worked example
Using the figures from the OpenAPI examples and the REST rules: a path
pick-rebin-pack limited to 1000 ORDER per hour by REBIN, a planning window of
8 hours and 12000 assigned orders give a capacity_over_window of 8000 and a
shortage of 4000. Publishing that plan raises CapacityPlanPublished,
CapacityShortageDetected and BottleneckDetected (bottleneck step REBIN).
Inbound labour demand and observed capacity
Two inputs sit next to the ORDER capacity, never inside it (ADR 0017):
- Inbound labour demand.
dock-scheduling's INBOUND dock appointments (a local read model attributed to the events'site_id; an appointment counts in a window when its door window starts in[start, end), a reschedule moves it, a cancellation or no-show removes it) are priced with an operator-declared inbound labour standard per site and process path:minutes_per_appointmentplus an optionalminutes_per_asn. A plan storesinbound_appointments,inbound_labour_minutesandinbound_standard_missingand exposesinbound_average_heads(minutes over the window length). They are not added toassigned_demand: orders and labour minutes are different units. No standard declared means no demand and a visibleinbound standard missingwarning, never a guessed number. - Observed capacity.
fulfillment-execution'sTaskCompletedevents are aggregated per site, process step and minute.GET /capacity-plans/{id}/variance?tasks_per_order=compares the tasks completed for the plan's bottleneck step in its window with the plan's ORDER capacity over that window. It is advisory: nothing here changes a planned capacity or republishes a plan (automatic adjustment is a later ADR). No completions meanshas_data: false, not zero throughput; withouttasks_per_orderthe comparison iscomparable: false.
Storage positions are a read model
Storage positions per (zone, location type) and stations per
(zone, activity) are exposed by GET /storage-capacity?location=. They are
not process throughput and have no "consumed" figure: stock is never read from
inventory-storage.
Requirement versus capacity
Everything above is capacity: what the warehouse can process. Since ADR 0022 and ADR 0023 the context also states the requirement: how much labour the demand needs. The two are kept apart on purpose.
| Capacity | Requirement | |
|---|---|---|
| Question | can the path process the assigned demand in the window? | how many labour hours and heads does the demand need? |
| Unit | ORDER per hour, shortage in orders | labour hours per step; heads per path and shift |
| Built from | registered constraints (LABOR from workforce-management's committed heads, STATION from the tally x a station standard, ...) | labor-performance's engineered standards (per step), the workload forecast (per shift) |
| Where | ProcessCapacity, CapacityPlan (shortage, bottleneck) | CapacityPlan.labour_requirement, LabourPlan |
| Published | CapacityPlan*, ProcessCapacity* events | LabourPlanCommitted (and LabourPlanDriftDetected) |
The LABOR constraint is supply (the heads workforce-management committed, times their rate); the labour requirement is demand. Neither changes the other: the labour requirement never enters the ORDER shortage or the bottleneck, and the drift between the labour plan and the commitment is surfaced, never corrected.
Labour requirement per step (capacity plans)
When a capacity plan is created, each step of its path gets a labour
requirement (labour_requirement on POST /capacity-plans and
GET /capacity-plans/{id}, stored with the plan):
tasks = released lines of the counted orders (PICK, demand_source = orders)
= assigned_demand x tasks_per_order[step] (every other case)
required_labour_hours = tasks x standard_seconds / 3600
required_average_heads = required_labour_hours / window hours
standard_secondsis the labor-performance standard in force at the window start for the step's task type: a step whose process type isPICK,PACKorSLAMnames its task type; a site-scoped standard beats a fleet-wide one, then the latesteffective_from, then the latestas_of.- A step without a standard is
known: false,reason: no-labor-standard; a step without a task factor isknown: false,reason: no-task-factor. Never a guessed number. - The requirement is computed once, at creation: a later standard revision never rewrites a stored plan.
Heads per shift (labour plans)
A labour plan states the heads one path needs for one shift. Omitted heads are derived from the stored workload forecast:
planned_heads = ceil(units with cpt in [shift_start, shift_start + hours) / (rate_units_per_hour x hours))
Example from features/labour_plan.feature: buckets of 500 units at 07:00Z,
300 at 13:59Z and 999 at 14:00Z, a shift starting 06:00Z for 8 hours at 10
units per hour: the 14:00Z bucket is outside [06:00, 14:00), so 800 units
are due and ceil(800 / 80) = 10 heads. Zero buckets in the shift is no data:
422 missing-planned-heads, never zero heads. planned_heads never exceeds the
caller's installed_stations; the facility tally only adds a warning when it
knows at least one but fewer stations of the activity named like the path.