Skip to main content

Ubiquitous language

Every term of the context with the code identifier that implements it. Use these exact names in code, tests, ADRs and conversation. Terms marked (contract) are fixed by apis/ or an ADR rather than by a Go identifier.

TermMeaningCode or contract
StationThe place an operator works at. Dispatch in this fleet is per station (the claim carries a station_id), so hints are per station and the associate is not an input.stationtrip.StationID
StationTripThe aggregate, one per station: where the operator stands and the hint issued there.stationtrip.StationTrip
PositionThe site plus the end location (with geometry when known) of the last completed task.stationtrip.Position, StationTrip.Position()
CompletionA task finished at a station at an instant. Only a strictly newer one moves the position.StationTrip.RecordCompletion
HintThe short ranked list of candidate tasks issued to a station after a completion. Advisory, expiring, never an assignment.stationtrip.Hint, HintID (hint- + suffix)
Hint stateActive, Consumed, Expired, Superseded. The last three are terminal.stationtrip.HintState, StateActive, StateConsumed, StateExpired, StateSuperseded
CandidateOne ranked entry of a hint: Rank from 1, TaskID, TaskType, Location, DetourM.recommend.Candidate
DetourDistance in metres from the station's origin to the candidate's first location (FromLocation), rounded to 0.1 m. ToLocation never enters the ranking.Candidate.DetourM, travel.Round
OriginWhere the station stands now; the point distances are measured from. Without known geometry no hint can be computed.recommend.Input.Origin, ErrOriginUnknown
Open-task poolThe event-fed local copy of the tasks still open, with where each starts and ends. An input of the recommender, not aggregate state.[]recommend.OpenTask, ports.TaskPool, table task_pool
Priority bandAn opaque string equal across tasks that fulfillment-execution orders as peers. Carried, never interpreted here.TaskAvailable.priority_band (contract)
Tie-breakHow fulfillment-execution may use a hint: only inside one priority band, fail-open.ADR 0001 (consumed by fulfillment-execution since its ADR 0051)
InterleavingPolicyThe per-site settings, versioned, one per site.policy.Policy
Inert (site)A site that never declared a policy: no hint is issued for it.ADR 0002; repository.ErrPolicyNotFound, 404 policy-not-found
SettingsThe values an operator declares: max detour, max candidates, hint TTL, eligible task types, vertical weight.policy.Settings
Max detourLargest detour in metres a candidate may have; a detour equal to the limit qualifies.Settings.MaxDetourM
Max candidatesHow many candidates a hint lists at most, 1 to 5.Settings.MaxCandidates
Hint TTLHow long a hint stays valid; expires_at = issued_at + TTL.Settings.HintTTL, hintTtlSeconds on REST
Eligible task typesThe non-empty set of task types a hint may point at.Settings.EligibleTaskTypes, Policy.Eligible
Task typePICK, PACK, REBIN, SLAM, RELOCATE, REPLENISH, as fulfillment-execution names them.policy.TaskType
Vertical weightThe weight of height difference in the travel model; REST default 1, at least 0.Settings.VerticalWeight
SiteThe fleet's site code; a location's site is its zone's site.policy.SiteID
Travel modelThe replaceable port that measures distance between two places.travel.Model
rectilinear-v1The v1 model: |dx| + |dy| + verticalWeight * |dz| in metres, rounded to 0.1 m.travel.Rectilinear, travel.RectilinearV1
PlaceA location code with its geometry, when known.travel.Place
PointA position in the site's local frame, in metres (X, Y, Z).travel.Point
Unknown distanceThe answer for a place without usable geometry. Never 0, never a candidate.Place.Known(), Model.Distance second result
RecommenderThe pure function that ranks the pool: same input in any pool order, same output.recommend.Recommend
Consume (a hint)The hinted station claims one of its candidates while it is unexpired.StationTrip.RecordClaim, event HintConsumed
Expire (a hint)An Active hint reaches expires_at.StationTrip.Expire, event HintExpired
Supersede (a hint)A newer hint replaces the Active one. Raises no event of its own.StationTrip.IssueHint, HintIssued.SupersededHintID
SimulationA read-only run of the recommender, optionally from a what-if fromLocation; issues nothing.usecases.Recommend, POST /recommendations
Fail-openAn absent, expired or unknown hint means fulfillment-execution just proceeds with claimNext.ADR 0001
Domain eventA fact raised by the aggregate, not a wire message.stationtrip.Event, HintIssued, HintConsumed, HintExpired
OutboxThe transactional table the events are written to with the aggregate; a relay drains it to Kafka.table outbox_events, outboxrelay.Relay, events.Sink, ADR 0004
Local copyA durable table fed by a consumer (pool, claims, geometry), rebuilt by replaying its topic.tables task_pool, zones, locations; ports.TaskPool, ports.LocationBook, ADR 0003
Processed eventThe claim of a consumed CloudEvents id by one consumer, committed in the same transaction as the effect; a repeat is a duplicate.ports.ProcessedEvents, table processed_events, usecases.Intake
OutcomeWhat a consumer use case did with a message: applied, duplicate, stale, ignored.usecases.Outcome
Dead-letter topic<topic>.dlq, where a message goes after 5 failed attempts or at once when its payload can never be applied.kafka.DLQSuffix, headers x-dlq-*
Idempotency-KeyThe request header that makes POST /recommendations replayable in Postgres mode; first writer wins.http.Idempotency, table idempotency_keys
Attempt capFailures after which the relay stops claiming an outbox row (OUTBOX_MAX_ATTEMPTS, default 20).outboxrelay.WithMaxAttempts
Hint-expiry workerThe timer-driven adapter that expires due hints every HINT_EXPIRY_INTERVAL.expiry.Worker, usecases.ExpireHints

Words not to use​

Do not saySayWhy
assign, dispatch, commandhint, recommendThe context never assigns; claimNext is the only claim path.
worker, associate, picker (as an input)stationHints are per station.
distance 0 for missing geometryunknown distanceUnknown is never treated as zero.
route, path (as the model)rectilinear travel modelv1 has no aisle or cross-aisle routing.