Order sourcing changes inventory, shipment topology, promise dates, and customer commitments. OpenOMS keeps that commit path deterministic and exposes it to agents as a constrained tool surface instead of delegating fulfillment decisions to an LLM.

The implemented architecture

The tool surface covers inventory lookup, committed sourcing, radius relaxation, dry-run option comparison, re-sourcing diffs, and trace-backed explanations. There is no model call in the repository’s sourcing or reservation path.

Why CP-SAT instead of per-line ranking

For every feasible line and node, the solver creates a Boolean assignment. It requires exactly one node per line and caps aggregate demand when multiple lines compete for the same SKU at the same node. The objective makes policy visible:

objective = weighted distance
          + capacity pressure
          + nodes used × split penalty

A high split penalty can reduce boxes while increasing distance. OpenOMS retains a nearest-first greedy baseline so that tradeoff can be measured rather than hidden behind an “AI score.”

Commit, options, and recovery boundaries

source_order retrieves candidates for every line, solves them jointly, calculates a promise per shipment, creates line-aware reservations, saves the decision, and appends lifecycle events. get_sourcing_options compares speed and consolidation profiles without reservations or persistence.

relax_and_source_order tries a configured search-radius cascade until inventory becomes feasible. That is bounded retry logic, not durable agent orchestration: attempts live in process memory and cannot resume after restart.

Re-sourcing is also precise in scope. A caller creates a later decision and explain_resourcing compares stored traces. The system does not automatically monitor and re-source orders.

Repeated benchmark results

The evaluator reused the seeded Hearthline network: 200 nodes, 500 SKUs, and 30,522 inventory records. Each scenario ran 20 times at the normal 200 ms service limit on Python 3.14.4 and Apple Silicon.

ScenarioFeasibleCP-SAT p50 / p95ShipmentsDistance tradeoff
50 lines, low split penalty20/20170.2 / 180.1 ms6 vs greedy 6Equal at 831.0 mi
50 lines, consolidation pressure20/20176.9 / 184.2 ms3 vs greedy 6CP-SAT +483.8 mi
Four constrained lines20/201.8 / 2.0 ms2 vs greedy 3CP-SAT +490.8 mi

All 60 service-limit runs reported OPTIMAL. Greedy was much faster—roughly 0.005–0.058 ms p50—and matched CP-SAT in the low-contention case. The optimizer earned its latency only when consolidation policy or cross-line inventory interactions mattered.

Failure and security boundaries

FailureImplemented behaviorRequired for production
Invalid order or tool inputPydantic/FastMCP rejectionStable external error contract
No feasible inventoryNo decision savedDurable retry or escalation
Duplicate reservation keyExisting in-memory reservation returnedCross-process idempotency
Later reservation failsEarlier line reservations can remainAtomic transaction or compensation
Unauthorized callerNot implemented in reference buildAuthentication, tenant authorization, tool policy

MemoryStore is the active runtime. The Postgres and Redis files are scaffolding, not the execution path. State and idempotency disappear on restart, and multi-line reservation is not transactional.

Observability and AI economics

Decision traces include solver status and wall time, assignments, inventory-before values, split count, and reservation IDs. An in-memory event log records the major phases. There is no exported tracing backend or durable audit retention.

The commit path has no model cost because its decisions and explanations are deterministic. An external agent may incur model cost, but OpenOMS does not record that usage, so cost per agent-assisted task is unknown.

What the evidence supports

The evaluation shows where CP-SAT earns its latency: the system exposes policy tradeoffs, keeps probabilistic reasoning outside inventory mutation, and makes failure boundaries inspectable.

Production hardening priorities are transactional persistence, concurrency control, authentication, durable recovery, exported telemetry, and evaluation on representative operational data.

Open source and evaluator ↗Evaluation methodology ↗