Loadcirclecommon.loadcircle

Logistics Ops

The Logistics Ops module is a digital workforce for freight: eight independent agents orchestrated by a central state machine over the shipment lifecycle. Every agent is deterministic and directly callable; the orchestrator is idempotent, so duplicate inbound events are harmless.

Shipment lifecycle

INTAKE ──► RATING ──► TENDER ──► DISPATCH ──► IN_TRANSIT ──► DELIVERED ──► INVOICED
                                                      │
   EXCEPTION ◄── DELAYED ◄── (from IN_TRANSIT)       │
   RESUME ──► IN_TRANSIT                             │
                                                      ▼
                                                   CANCELLED

Transitions are validated by the orchestrator. Reaching a state that is already current is an idempotent no-op (success, no side effects); invalid transitions are rejected with a reason.

Agents

Idempotency

Every inbound event must carry event_id and content_hash. The system rejects a hash that does not match the event payload, treats a repeated event_id as a no-op, and refuses to reuse an event_id with different content.

Endpoints

GET  /api/v1/logistics-ops                    list shipments
POST /api/v1/logistics-ops/intake            { text, channel }
GET  /api/v1/logistics-ops/:id               shipment detail
POST /api/v1/logistics-ops/tracking          { eventId, shipmentId, status, location }
POST /api/v1/logistics-ops/:id/rate          rate and move to tender stage
POST /api/v1/logistics-ops/:id/tender        open tender with top carrier
POST /api/v1/logistics-ops/:id/accept        { carrierId }
POST /api/v1/logistics-ops/:id/document      { type: "BOL"|"POD"|"INVOICE"|"RATE_CONFIRMATION" }
GET  /api/v1/logistics-ops/analytics         lane + carrier aggregates