Karyo
Documentation/ Architecture

Source record: the Karyo 2.0.0 distribution

Karyo 2.1.1rendered at build time
On this page

This record states the repository's source truth once: what the Karyo distribution, shipping from the Karyo 2.0.0 release, is made of. It exists so the structure of the one distribution is documented in one place, in prose that is safe to show to any approved reader of this repository.

One distribution, all capabilities included

At the Karyo 2.0.0 release the product is one Apache-2.0 distribution. The complete set of ten engine capabilities - wave fulfilment, cross-docking, order streaming, cartonization, document templates, event monitors, 3PL billing, demand forecasting, slotting and reorder simulation - ships as nine -core modules beside the modules they extend:

Capability Module Files
Event monitors services/monitoring-service/karyo-monitors-core detectors, alert delivery, Floor Assessment (bottleneck scoring, ranking and record context over open alerts, on the Monitors page; design note)
3PL billing services/monitoring-service/karyo-monitors-core (com.karyo.threepl) rate card, billing read service
Demand forecasting services/forecasting-service/karyo-forecasting-core EWMA model, forecast and reorder services
Slotting services/slotting-service/karyo-slotting-core Loci client and contract builder, warehouse-fact readers, slotting service
Reorder simulation services/simulation-service/karyo-simulation-core reorder-policy backtester
Cross-docking services/crossdock-service/karyo-crossdock-core matching, staging, equipment routing
Wave fulfilment services/wave-service/karyo-wave-core wave lifecycle, selection rules, sort, pack-out
Order streaming services/streaming-service/karyo-streaming-core micro-batch release
Document templates services/document-service/karyo-doctemplates-core template overrides
Cartonization services/fulfillment-service/karyo-cartonization-core line/amount-limited packout

Each module ships with its CDI resources (META-INF/beans.xml) and its tests. The application test suites live in services/karyo-app/src/test/kotlin/com/karyo/**, and the end-to-end suites in tests/e2e/tests/.

The equipment adapter seam

The com.karyo.tasks.spi.equipment package (the equipment adapter SPI: EquipmentAdapter, EquipmentAdapterFactory, ExecutorType) is declared in services/task-service/karyo-tasks-api, where the equipment adapter SPI belongs under the -api/-core rule (ADR 0006); it depends on nothing but the Kotlin standard library. The selection logic over its factories (EquipmentAdapterResolver) lives with the cross-docking engine. No end-to-end dependency path crosses a module boundary as a result.

The slotting module

karyo-slotting-core is Karyo's side of the slotting boundary (see the engine boundaries): Karyo owns the warehouse facts, the hard constraints, authorization and the screen; Loci, an independently deployable Apache-2.0 engine that slotting advice requires, owns the analysis, prioritization and slot-class advice, and is never asked for an exact bin. Its pieces:

Piece What it does
SlottingService Refuses the request as not configured (a 503 problem, slotting-engine-not-configured) when karyo.slotting.loci.base-url is unset, before any fact is read; otherwise builds WarehouseFacts from the readers and sends them to Loci (unless there is nothing to rank, when Loci is not asked and the envelope says none); turns a SKU pinned by a fix assignment into HOLD whatever Loci said; answers SlottingAdviceDto, which names Loci and its level
LociContractBuilder / LociClient Map the facts to Loci's neutral contract 1.0.0 (demand, placements in whole units or without a quantity when a SKU's amount is fractional, locations with zone and proximity rank, fixedLocation constraints, class thresholds) and POST it as multipart to Loci's /api/v1/recommend, always asking for the auto level over pinned HTTP/1.1, with Authorization: Bearer when a token URL is configured and with no credential when it is not; a zone name longer than the 64 characters of Loci's contract is refused before the request, and a rejected snapshot, a 401 or 403, or a Loci that does not answer is a 502 problem (SlottingExceptionMapper), never a silent fallback
LociTokenSource Obtains that bearer with client_credentials (client_secret_post) and caches it until 30 seconds before expiry. Unset token URL returns no credential
SlottingConfig Thresholds (a-threshold, b-threshold, history-days) Karyo sends in the contract and the Loci keys (loci.timeout, loci.token-url, loci.client-id, loci.client-secret, loci.token-scope), the timeout and the credential pairing checked at startup
SlotReader / VelocityReader / FixAssignmentReader Native-SQL reads of pickable stock with its on-hand quantity, picks in the demand window, and fixed-location assignments

The module holds no slotting analysis of its own and declares no SPI for one (ADR 0033).

Schema and migrations ship with the distribution

The engine schemas and the whole Flyway history are part of this repository's aggregator (services/karyo-app/src/main/resources/db/migration/) and apply to every installation. The distribution introduces no engine-specific .sql file and no migration; the schema and Flyway history are unchanged as part of this tree, and no data migration is needed.