ADR 0033: Slotting advice requires Loci; Karyo keeps its facts and constraints but no analysis of its own
Status: Accepted. Supersedes in part
ADR 0031 (the built-in reference
advisor that answered without Loci, and the SlottingStrategy SPI behind it).
Context
ADR 0031 made Loci the slotting
engine behind Karyo's facts and constraints, and kept a second source of slotting analysis inside
Karyo: when no karyo.slotting.loci.base-url resolved for a goods owner, the built-in
abc-proximity reference advisor (AbcProximitySlottingStrategy, behind the SlottingStrategy
SPI) ranked ABC velocity against location order index and answered through the same advice
envelope, labelled engine.kind = reference. The Items page's class chips and the Slotting page
showed that advice on every installation without Loci.
The product decision is that slotting requires Loci: SlottingService stays, as the Karyo
service that collects the warehouse facts and enforces Karyo's own constraints, and the built-in
analysis goes. No further reason is recorded.
Two constraints from ADR 0031 still bind:
- Nothing may become an always-enabled fiction. An installation without Loci must not be shown invented advice, an empty list that reads as nothing to move, or advice left over from an earlier answer.
- The boundary with Loci stays exact. Karyo keeps the facts, the constraints, authorization, review, applying changes and the UI; Loci keeps analysis and advice and stays independently deployable.
Decision
- Loci is the only source of slotting analysis.
AbcProximitySlottingStrategyand theSlottingStrategySPI are deleted, with the SPI's row in the admin's live registry and static catalogue and thekaryo.slotting.mismatch-thresholdsetting only the advisor read.SkuSlot, a fact the reader produces and the contract builder reads, moves from the SPI package intokaryo-slotting-core'sreaderpackage besideFixedLocation. SlottingServicestays and needs a Loci base URL first. It resolveskaryo.slotting.loci.base-urlfor the goods owner (client row, SYS row, configuration) before it reads any fact. Unset, it refuses the request asSlottingException.EngineNotConfigured; set, it reads the facts, sends the neutral contract, and applies the fixed-location hold exactly as before, includinglevel = nonewhen there is nothing to rank.- No Loci is a
503problem that names the setting.SlottingExceptionMappermapsEngineNotConfiguredto503slotting-engine-not-configured, whose detail says that slotting advice requires Loci and namesKARYO_LOCI_BASE_URLandkaryo.slotting.loci.base-url, as a label printer that is not configured is a503(no-printer-configured). A configured Loci that fails keeps its502problems (slotting-engine-unavailable,slotting-snapshot-rejected). - The console states it rather than failing on it. The Slotting page shows a Slotting advice requires Loci state that names the setting, with no engine strip, table or error panel, and neither toasts nor retries that answer; it hides any earlier advice still in the cache. The Items page shows no velocity classes and says they need Loci, never that a call failed.
- The advice envelope keeps its shape.
SlottingAdviceDtois served only by a configured Loci, soengine.kindislociandlevelis neverreference; the fields stay for the console and any integration that reads them.
Consequences
- An installation without Loci has no slotting advice and says so on the Slotting page, on the
Items page and in the
503body, instead of showing a Karyo ranking. Every other capability is unaffected; Loci stays a separate deployment, now required for this one answer. - The demo warehouse shows slotting advice only with a Loci connected; without one its Slotting page shows the not-configured state.
- Karyo's own responsibilities are unchanged: tenant-scoped facts, the fixed-location hold,
VIEWERauthorization, the review vocabulary and applying accepted moves through ordinary Karyo workflows. - The admin's SPI registry lists one seam fewer, and
EngineRouteAuthorizationTestchecks the slotting route's503problem as its handler's answer on a test stack without Loci. - An integration that read the reference envelope now receives a
503problem where it receivedengine.kind = reference. The route is in no consumer contract.
Alternatives considered
- Answer
200with an empty envelope marked as not configured. Rejected: a client that reads onlysuggestionswould take an empty list for "nothing to move", and the Items page would show every SKU as having no class yet, which is the empty success the change must not produce. - Keep the
SlottingStrategySPI with no built-in implementation. Rejected: a seam with no path behind it would list in the registry as an extension point that nothing calls, and a custom bean behind it would be the in-Karyo analysis this decision removes. - Keep the reference advisor as a fallback. Rejected by the product decision above; ADR 0031 records why it had been kept.
Evidence
services/slotting-service/karyo-slotting-core/src/main/kotlin/com/karyo/slotting/service/SlottingService.kt,SlottingService.advice- the base URL checked before any fact is read;
SlottingService.holdFixed;SlottingService.NOT_CONFIGURED, the refusal's detail
- the base URL checked before any fact is read;
services/slotting-service/karyo-slotting-core/src/main/kotlin/com/karyo/slotting/exception/SlottingException.kt,SlottingException,SlottingExceptionMapper- the503problemservices/slotting-service/karyo-slotting-core/src/main/kotlin/com/karyo/slotting/reader/SlotReader.ktSkuSlotbeside the reader that produces it
services/karyo-app/src/test/kotlin/com/karyo/slotting/SlottingServiceTest.kt,SlottingApiTest.kt- no Loci is refused as not configured, over HTTP and with no fact readservices/karyo-app/src/test/kotlin/com/karyo/security/EngineRouteAuthorizationTest.kt,EngineRouteAuthorizationTest.NOT_CONFIGURED_HERE- the slotting route's not-configured answer in the role tablefrontend/web/src/pages/insights/slotting-api.ts,isLociNotConfigured, retrySlotting-isLociNotConfigured,retrySlottingfrontend/web/src/pages/insights/slotting-page.tsx,SlottingPage- the Slotting advice requires Loci statefrontend/web/src/pages/items/use-item-analytics.ts,useItemAnalytics-slottingNotConfigured
Related
- ADR 0031 - Loci as the slotting engine behind Karyo's facts and constraints
- The engine boundaries
- the boundary in full
- Engine capabilities and Unconfigured states
- The error contract