Karyo
Documentation/ Configuration

The runtime configuration store

Karyo 2.1.1rendered at build time
On this page

Karyo has a runtime-editable configuration store, reached at /api/v1/system-properties and presented as Admin -> System properties. It is the only part of the configuration surface a person can change on a running instance without a restart. Its catalog is written to grow "as existing @ConfigProperty knobs migrate onto the runtime store" (services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/config/SystemPropertyCatalog.kt, PropertyDefinition.capabilityControlled).

The code-owned catalog lists runtime-editable values and restart-bound identity, agent, ship-from and judgment engine connection settings. The latter are visible as metadata but environment-only. Other karyo.* knobs also remain environment-only - see the configuration boundary.

Two halves: a code-owned catalog and stored values

The design splits metadata from values, deliberately and clearly. The set of known keys, their types, groups, descriptions and defaults live in code, in SystemPropertyCatalog (SystemPropertyCatalog). Only the value is stored, in system_properties (SystemProperty, table created by services/karyo-app/src/main/resources/db/migration/auth/V1202__create_system_properties.sql).

The entity KDoc states the reason: catalog metadata "is code-owned in [SystemPropertyCatalog], never stored - a row only carries the value plus optional free-text description/group so that non-catalog (extension/custom) keys remain self-describing" (SystemProperty). That is a sound split. A key's type is a property of the code that reads it, so letting an administrator edit the type would let them break a consumer.

In a configuration layer, Business Unit 0 means the Company layer; it is not a Business Unit row. system_properties, home_layouts and document_templates keep that key after SYS retirement.

A row is keyed by (business_unit_id, facility_id, property_key), unique with NULLS NOT DISTINCT (V1614). A null Facility denotes a parent setting, not a physical site.

The Facility inheritance ladder

A read that names a Facility resolves through these values in order:

  1. The stored setting for that Facility.
  2. The stored setting for its Business Unit.
  3. The Company setting, stored under the existing business_unit_id = 0 parent key.
  4. The MicroProfile config value (application.yaml or an environment variable).
  5. The catalogue default of the key, which is its only default: a caller cannot pass its own.

A parent-level consumer, such as billing, starts without a Facility rung. The environment rung makes the store an override rather than a replacement: a stored row wins, and the environment value is the fallback, not the authority. The ladder reads the environment value itself, so a module does not inject it as a default of its own. application.yaml gives a catalogue key an empty fallback (${KARYO_X:}), so an unset variable reaches the catalogue default. A BOOLEAN key read from that rung is converted as a MicroProfile boolean, so an unrecognised value such as N reads as false; a stored row accepts only true and false, and anything else reads as the catalogue default. The keys Quarkus reads keep a literal there because they need a value to start: karyo.agent.resource-uri, karyo.identity.provider-type, the karyo.shipping.ship-from keys and quarkus.oidc.token.audience in the %dev and %prod sections. quarkus.oidc.token.issuer has no catalogue default; its %dev and %prod fallback is derived from OIDC_URL.

The catalogue default is the key's only default. RuntimePropertyLookup takes no default from a caller, so a call site cannot restate one, and a typed read (getBoolean, getInt) of a key whose catalogue default is not of that type fails instead of guessing. The flow model's default rates and the floor plan's sizes are read from the catalogue default through the same lookup, not from a constant. The only literal left beside the catalogue is the application.yaml fallback of those keys, in the default section or a profile section. CatalogueDefaultsTest pins each of them to the catalogue and fails when one disagrees. The ship-from startup warning reads the catalogue default of its key, so it follows a change of that default.

A stored row whose value is null never satisfies a rung; DELETE is the way to unset (SystemPropertyService.delete). There is no caching, and the class says why: the consumers are per-request admin and config paths, hot paths are not expected consumers yet, and the stated lever if one appears is a short-TTL layer rather than widening the class (SystemPropertyService). That is a rationale worth keeping - it names the next move instead of leaving it to be rediscovered.

Catalog keys and their consumers

SystemPropertyCatalog.kt owns the complete set. These are selected operational keys.

Key Type Group Default Owner-writable Extended capability
karyo.identity.provider-type STRING Identity KEYCLOAK environment only -
quarkus.oidc.token.issuer STRING Identity none environment only -
quarkus.oidc.token.audience STRING Identity karyo-api environment only -
karyo.setup.reopen STRING Identity none environment only -
karyo.facility.time-zone STRING Facility UTC yes -
karyo.print.url STRING Printing none no -
karyo.layout.aisle-spacing-metres DECIMAL Floor plan 4.5 yes -
karyo.layout.bay-width-metres DECIMAL Floor plan 2.7 yes -
karyo.layout.level-height-metres DECIMAL Floor plan 1.5 yes -
karyo.layout.rack-depth-metres DECIMAL Floor plan 1.1 yes -
karyo.layout.cross-aisle-width-metres DECIMAL Floor plan 3.0 yes -
karyo.proximity.enabled BOOLEAN Proximity false yes -
karyo.work.dispatch-strategy STRING Work dispatch STRICT_PRIORITY yes -
karyo.work.proximity.max-wait-minutes INTEGER Proximity 30 yes -
karyo.receiving.allow-over-receipt BOOLEAN Receiving true no -
karyo.alerts.email.recipients STRING Alerts none yes monitors
karyo.alerts.slack.webhook-url STRING Alerts none no (secret) monitors
karyo.replenishment.from-picking BOOLEAN Replenishment false yes -
karyo.packing.cartonization.max-lines-per-box INTEGER Packing 1 yes cartonization
karyo.packing.cartonization.max-amount-per-box INTEGER Packing 0 yes cartonization
karyo.flow.history-days INTEGER Flow model 28 yes simulation
karyo.flow.default-rates STRING Flow model RECEIVING=30;...;COUNTING=8 yes simulation
karyo.flow.crews STRING Flow model none yes simulation
karyo.flow.walk-metres-per-minute INTEGER Flow model 60 yes simulation
karyo.flow.pick-seconds-per-line INTEGER Flow model 20 yes simulation
karyo.flow.cart-lines INTEGER Flow model 12 yes simulation
karyo.shipping.rename-unit-load BOOLEAN Shipping false yes -
karyo.inventory.purge.retention-days INTEGER Inventory 30 no -
karyo.crossdock.pre-distributed BOOLEAN Cross-docking false yes cross-dock
karyo.crossdock.opportunistic BOOLEAN Cross-docking false yes cross-dock
karyo.crossdock.staging-window INTEGER Cross-docking 4 no cross-dock
karyo.crossdock.expiry-action STRING Cross-docking AUTO_PUTAWAY no cross-dock
karyo.wave.auto-release BOOLEAN Waves false yes waves
karyo.streaming.enabled BOOLEAN Streaming false yes streaming
karyo.threepl.rate.storage-per-ul-day DECIMAL 3PL Billing none no three-pl-billing
karyo.threepl.currency STRING 3PL Billing USD no three-pl-billing
karyo.slotting.loci.base-url STRING Slotting none no slotting
karyo.profile STRING Profile CORE Capabilities panel only -
karyo.capability.<name>.enabled (12 keys) BOOLEAN Profile follows the profile Capabilities panel only -

A DECIMAL key takes a non-negative amount in plain notation (12, 0.25): no sign, exponent or separator. A write of anything else is refused with 422 system-property-invalid-value, and the 3PL currency is refused unless it is an ISO-4217 code in capitals (USD). The check runs on write only: a value stored before it existed is not rewritten, and billing still refuses an invalid stored rate. Correct it with PUT, or DELETE it to unset it.

The first three Floor plan keys are the Facility's sizes for travel distances, in metres: aisle spacing centre to centre, bay width along an aisle and level height. The fourth, rack depth, and the fifth, the width of every zone's front and back cross-aisle, do not move a location: the floor view draws the racks and the cross-aisles with them. An Area, a zone or an aisle may set its own aisle spacing, bay width, level height and rack depth on the Areas page or through the Area, zone and aisle API (the cross-aisle width is one value for the Facility), and that value wins below it. Layout's FloorPlanService reads them, and a value of 0 or above 100 reads as the default (ADR 0060, ADR 0065).

karyo.packing.cartonization.max-lines-per-box has a minimum of 1 and defaults to 1. Karyo refuses a lower value with 422 when it is written, and refuses startup if configuration sets a lower value. Auth V1607 raised any stored value below 1, at any scope, to 1; 0 already packed one line per box, so the packing did not change. karyo.packing.cartonization.max-amount-per-box = 0 still means unlimited.

ALERT keeps the cross-dock reservation, extends the staging deadline and flags the match for the Cross-dock expiry rule on Insights > Monitors. With Monitors and the rule enabled, the next monitor check raises the alert at its configured threshold (zero hours by default). The flag survives deadline extensions until the match completes, is cancelled, or expires through AUTO_PUTAWAY. See Cross-docking.

karyo.crossdock.expiry-action accepts only AUTO_PUTAWAY or ALERT (case is ignored), and a PUT of any other value is refused with 422. Before that check, a misspelling such as ALRET was stored and then read as AUTO_PUTAWAY, the opposite action.

The last column names the Extended capability a key tunes, where it has one (ADR 0052). Each of those keys takes effect when it is set, and is listed while the installation's profile shows its capability. The six keys that switch an engine's own work (streaming, wave auto-release, four cross-dock keys) stay listed while it is hidden - see the configuration boundary. The slotting key connects Loci, which slotting advice requires: empty, there is no advice and the slotting route says so; set to Loci's base URL (http://loci:8000 in scripts/.env.prod.example), Karyo sends its warehouse facts to Loci and shows Loci's advice. It is not owner-writable, because the application POSTs to that URL server-side, so URL authority stays with the operating company.

The catalog's default is display metadata. A consumer also passes its fallback to getBoolean, getInt or getString. Keep those defaults equal when adding a consumer.

Facility clocks and printers

The console exposes these settings on Warehouse > Facilities. A caller needs settings.manage on the named Facility. The parent grant can cover its descendant Facilities; a sibling grant cannot. The routes /api/v1/facilities/{id}/settings and /api/v1/facilities/{id}/settings/{key} name the site explicitly. Deleting a Facility override reveals the inherited value. An archived Facility or inactive parent refuses changes.

karyo.facility.time-zone accepts named IANA zones, such as Europe/Paris, Asia/Tokyo and UTC. It rejects fixed offsets and Java SystemV zones. The console publishes the effective zone through /api/v1/me. Daily reporting, forecasting, simulation, wave selection and rule preview use this same setting. Receiving checks best-before dates against the Facility day. Expiry monitoring shares one Facility day for its cutoff and findings. Shipment documents use their shipment's Facility day. Changing the setting refreshes the selected Facility's clock immediately. The Company sign-in log and shared counters use UTC; neither belongs to one Facility.

karyo.print.url names the Facility's ZPL printer as host:port; an omitted port means 9100. Its inherited/default value is visible beside the override. none refuses printing as unconfigured. Commissioning must configure a real target and prove a label through the named Facility's endpoint before floor work. The console's Facility selection never retargets a request already captured by the floor app.

Two kinds of privilege, expressed two different ways

The catalog carries three flags, and all are about privilege or exposure rather than warehouse behaviour.

ownerWritable = false means only an ops principal may write the key. The rationale is recorded where it is enforced: a goods-owner administrator "must not be able to loosen an operator-set hard stop by writing its own client row above the client-0/env fallback" (PropertyDefinition.ownerWritable; enforced at services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/api/v1/SystemPropertyResource.kt, SystemPropertyResource.requireOwnerWritable). Reads are unaffected. The refusal is 403 rather than 404 or 422, and the resource says why: the key's existence is public catalog metadata, so only the privilege is secret (SystemPropertyResource.requireOwnerWritable).

The ops-controlled keys are the over-receipt hard stop, the Slack webhook, the purge retention window, the cross-dock staging window and expiry action, the 3PL storage rate and billing currency, and the slotting Loci base URL (the application POSTs to it server-side, so URL authority stays with the operator; SystemPropertyCatalog). BillingKeyProtectionTest keeps the billing keys on that list: it runs RateCardProvider against a recording lookup and fails when any karyo.threepl.* key it reads is missing from the catalog or is owner-writable, because a key absent from the catalog is owner-writable by accident. The catalog states the distinction it is drawing each time: box sizing and rung toggles are "a warehouse-ops preference with no security surface", while an audit horizon and "how long staged stock is allowed to sit and what happens when it doesn't move" are operational-safety policy, and the billing keys "ARE the numbers a goods owner is invoiced against" (SystemPropertyCatalog); the Loci URL is "ops-controlled" because Karyo fetches it server-side. That line is drawn consistently across the runtime-editable keys.

environmentOnly = true marks restart-bound settings that the effective view may show but neither a BUSINESS_UNIT_USER nor an OPS principal may PUT or DELETE. The resource returns the system-property-environment-only 403 problem before touching a row, and the effective view resolves such a key from configuration alone, so a stray stored row never shows. These settings belong in the deployment environment because changing provider type, issuer or audience underneath a running security identity is unsafe. The five karyo.shipping.ship-from.* keys use the flag because the shipper block on every bill of lading is one installation-wide address read from ShipFromConfig at startup (see Deploying Karyo).

secret = true makes a key write-only in the effective view: any present value is replaced by a mask literal for every principal, ops included, while the source label stays truthful (PropertyDefinition.secret, SystemPropertyService.effectiveView, mask at SystemPropertyService.masked). Only the view is masked - the typed getters hand in-process consumers the real value, which is what makes the Slack channel work. Exactly one key is secret.

The masking is not defeated by the admin screen: the property editor seeds an empty draft for a secret key rather than the mask, so a save cannot round-trip the mask back into storage (frontend/web/src/pages/admin/admin-properties-page.tsx, AdminPropertiesPage, PropertyRow).

Scoping: who may target which Business Unit

A Business Unit user reads and writes only its own unit's rows. An ops principal defaults to Company configuration key 0 and may name a Business Unit through ?businessUnitId= or the body. The grant must reach that target: key 0 needs settings.manage at the Company node. A Business Unit needs it at that unit or above (SystemPropertyResource.targetClient, ADR 0048). A Business Unit user naming another unit, or an ops principal whose grant does not reach the target, gets 422 system-property-target-forbidden rather than 404: an upsert names no existing row, so there is nothing whose existence a 404 would have to hide. The console sends no businessUnitId for a Company-node holder and the selected Business Unit's id for any other caller.

Every route declares the settings.manage action (SystemPropertyResource), and the console's System properties entry and route guard check the same action (frontend/web/src/config/admin-navigation.ts). settings.manage is an administration action: it can be granted at the Company or a Business Unit, not at one Facility, and of the standard profiles only administrator holds it (services/karyo-app/src/main/resources/db/migration/auth/V1214__action_catalogue.sql, V1214__action_catalogue). See users, roles and permissions.

There is no property context

Earlier releases stored an optional property_context on every row, described as a finer scope such as a workstation. The REST layer took it in the body and as a query parameter, and the effective view listed the rows that carried one. No consumer ever read one: the resolution ladder queried the row without a context on every rung. A value scoped to a context was stored, echoed back, listed and inert.

The context is gone. Neither PUT nor DELETE on /api/v1/system-properties/{key} takes one, a view carries no context field, and the console types and screen no longer mention one. A write or delete that still names a context is refused, not ignored: a context query parameter on PUT or DELETE, or a context field in a PUT body, on /api/v1/system-properties/{key} or /api/v1/facilities/{id}/settings/{key}, answers 422 property-context-removed, and nothing is written or deleted. Ignoring it would turn a call that once touched only an inert row into a write or delete of the Business Unit's own row. Migration V1614__drop_system_property_context.sql deleted the rows that carried a context, because nothing could read or remove them, and dropped the column. Per-workstation configuration does not exist. The ladder's real per-owner mechanism is a row written against a businessUnitId (and, for a site, a Facility).

The ext. namespace

A system-property write must name a catalog key or start with the case-sensitive prefix ext.. Karyo refuses any other key with 422 system-property-unknown-key. An ext.partner.option key is stored without type validation; the extension that consumes it owns its value and behaviour. Catalogued environment-only keys still refuse runtime writes with 403 system-property-environment-only. Putting ext. before a Karyo setting does not configure Karyo.

Existing rows are not deleted or rewritten. The API still lists unknown rows with type: null; that marks a key outside the catalog without changing the response shape. The console labels a non-ext. row with that type Not recognised, makes its value read-only and offers Remove. Reading and deleting such a row still work; writing it again requires a recognised key or the extension namespace. Restart-bound settings still belong in the deployment environment, not in this store.

The effective view lists those keys along the same rungs the ladder reads. effectiveView takes the non-catalog rows of the Facility, the Business Unit and the Company, nearest first, and a nearer row hides a farther row of the same key (SystemPropertyService.effectiveView). A non-catalog key stored at the Company therefore shows on a goods owner's screen with source SYSTEM, as rung 2 of the ladder resolves it for them. Earlier releases listed only the caller's own rows, so a Company key was invisible to an owner who inherited it.

Order strategy extension properties

Order strategies keep the same extensionProperties JSON object. On create, and on an update that sends extensionProperties, Karyo validates the map before changing the row. These fourteen product-owned keys need no prefix; every other key must start with ext.. Values use JSON numbers and booleans, not strings that happen to look numeric or boolean.

Key Accepted value on write Default when absent
releaseMode MANUAL, WAVE, STREAM; case and padding ignored by ReleaseMode.parseOrNull MANUAL
streamBatchSize Integer 1..1000 50
streamMaxWaitSeconds Non-negative 32-bit integer 30
streamAbandonSeconds Non-negative 32-bit integer; the runtime raises it to the max wait when lower 1800
streamTimingStrategy Registered ReleaseTimingStrategy.key; padding ignored time-size
waveAutoRelease Boolean false
waveMaxOrders Non-negative 32-bit integer; zero selects no orders 200
wavePickMode HYBRID, COMPLETE_ONLY, PICK_ONLY, BULK; exact enum name HYBRID
waveShortageAction SKIP, SHORT_ALLOCATE, HOLD_ORDER, HOLD_WAVE; exact enum name SKIP
waveSelectionStrategy Registered WaveSelectionStrategy.key; exact match due-date-priority
waveDueWithinDays Signed 32-bit integer or null; negative means an earlier cutoff none
waveMinPrio Signed 32-bit integer or null none
waveIncludeUndated Boolean true
waveSelectionRuleId Positive 64-bit integer or null none

The enum parsers and registered strategy beans define the names, so a compiled extension's strategy key is accepted too. Rule lookup remains an operation-time Facility check; a positive id here does not prove that a rule exists in every Facility. rule-based still needs a resolvable rule when used.

Invalid input returns 422 order-strategy-invalid-extension. Its detail starts with extensionProperties.<key>:, followed by the correction. The console shows that message in a toast. Existing stored maps retain today's runtime parsing, defaults and clamping. Reading or using one never rewrites it. An update that omits extensionProperties leaves the stored map as it is and does not validate it, so legacy content never blocks a change to another field. An update that sends the map must send a valid one.

The cross-module read contract

Other modules do not depend on auth-core. They inject RuntimePropertyLookup, an interface in auth-api with a single implementation that delegates to the typed getters (services/auth-service/karyo-auth-api/src/main/kotlin/com/karyo/auth/spi/RuntimePropertyLookup.kt, services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/service/DefaultRuntimePropertyLookup.kt).

Its KDoc is unusually explicit about what it is not: "This is a cross-module read contract, not a strategy seam: there is no plausible second implementation, and none should be added" (the RuntimePropertyLookup KDoc). It is also deliberately unscoped by tenant - callers name the domain row's own Facility, and production call sites are already tenant-guarded (the same KDoc). Both statements are the kind of rationale that would otherwise survive only in someone's head, and both hold: ten modules in this repository consume it and only auth implements it.

RuntimePropertyLookup is nevertheless listed in the live SPI registry the admin Extensions page reads (services/karyo-app/src/main/kotlin/com/karyo/app/admin/AdminExtensionsResource.kt, AdminExtensionsResource.resolve), because that list includes every interface declared in an spi package, and the registry does not distinguish an in-process read contract like this one from a genuine extension point (AdminExtensionsResource.resolve). See the configuration boundary.