Karyo
Documentation/ Decision records

ADR 0052: An installation runs the Core or the Extended profile, and the profile decides which capabilities the console shows

Karyo 2.1.1rendered at build time
On this page

Status: Accepted. Supersedes in part ADR 0031: its rule that navigation takes "the caller's permissions and nothing else", and its rule that the Exceptions page, the Items page and the order-strategy form show the engines on every installation. ADR 0031's other decisions - no locked state, no licence awareness in the console, Loci as the slotting engine - stay current.

Context

Karyo is one Apache-2.0 product (ADR 0029), and since ADR 0031 every capability appears on every installation for anyone who holds its action. That is honest, but it is not what most installations need. An implementer bringing up one warehouse operation meets twelve engines it will not use on day one - Waves, Streaming, Monitors, Forecasting, the Slotting view, Simulation, Document templates, Integrations, the SPI catalogue, cartonization, cross-dock and 3PL billing - in the sidebar, the admin navigation, the command palette, the Home widgets, the floor menu and the settings lists. Each is a page to explain, a setting to leave alone and a support question.

Four constraints bind the answer:

  • No licence comes back. ADR 0030 retired every licence gate and ADR 0031 removed the console's licence awareness. A switch that hides a capability must not be a licence by another name: it is the installation's own choice, and it never decides who may do what.
  • No greyed or locked entries. A hidden capability is absent, the way a page is absent for a caller without its action. A disabled entry is a locked state.
  • Hiding is not deleting. Data a capability recorded must survive while it is hidden and show again, intact, when it is switched back on. Work in flight must be able to finish.
  • Authority is unchanged. ADR 0048 decides every call from grants. A profile must not become a second authorization path.

Decision

  • Two profiles, and twelve Extended capabilities. karyo.profile is CORE or EXTENDED; CORE is the default. The Extended capabilities are Waves, Streaming, Monitors, Forecasting, the Slotting view, Simulation, Document templates, Integrations, the SPI catalogue, cartonization, cross-dock and 3PL billing; everything else is Core. Core enables none of them, Extended enables all of them, and karyo.capability.<name>.enabled records an exception to the profile for one capability. Exceptions stay in Core without the monitor-alert check.
  • The profile reuses the configuration ladder, read at Company key 0 only. The keys are ordinary SystemPropertyCatalog entries, resolved as stored Company row, then configuration (KARYO_PROFILE, KARYO_CAPABILITY_<NAME>_ENABLED), then the default. A Business Unit or Facility row is never read: the profile is Company-wide. The licence bridge is not consulted.
  • KARYO_PROFILE sets the install default. scripts/.env.prod.example carries KARYO_PROFILE=core, and deploy-server.sh refuses any value other than core or extended (any case) or a second assignment.
  • A Company administrator changes it on the Capabilities panel, with a preview and a confirmation. GET /api/v1/capabilities, POST /api/v1/capabilities/preview and PUT /api/v1/capabilities declare settings.manage and answer only a caller who holds it at the Company. A change is refused unless it says confirmed: true. Choosing a new profile resets every exception, and an exception equal to what the profile and configuration give without it is removed, so the stored state is always "a profile plus its exceptions". A KARYO_CAPABILITY_* value that disagrees with a confirmed change is outvoted by a stored row, never ignored. The raw key editor refuses these keys (403 system-property-capability-controlled), so nothing bypasses the panel.
  • A capability shows when it is enabled and set up. An engine that is not set up is hidden: the Slotting view shows only once a Loci address (karyo.slotting.loci.base-url) is set. Two more surfaces are conditional on facts, not switches: Facility rollups show only when the Company has more than one active Facility, and the Connected agents controls and the Approvals page show only while the installation's agent access (karyo.agent.enabled) is on. /mcp agent access is part of Core and stays off by default.
  • /api/v1/me carries what shows, and every entry point filters by it. capabilities holds the profile, the surfaces that show and the capabilities still draining. The sidebar, the admin navigation, the command palette, the Home widget dialog, the Home warehouse layers, the floor menu, the Items analytics, the Exceptions checks, the order-strategy release modes and both settings lists drop a hidden capability's entries, except an engine's work switches (below). A route of a hidden capability renders the ordinary not-found page. A navigation entry carries a capability, never a licence, and no entitlement or lock metadata.
  • A profile thins the surface, never authority or data. No authorization check reads the profile; a hidden capability's REST routes stay callable for integrations and scripts, and its rows stay where they are.
  • The drain rule: switching a capability off finishes its open work. A switched-off capability with open work stays reachable for that work and offers nothing that starts new work. For Waves, open waves keep the Waves page and the floor app's Sort and Pack-out until they finish; New wave and the selection-rule writes are gone. Streaming has no task routes of its own to drain. A capability's open work is reported by its core through the CapabilityWork SPI. Cross-docking reports its matched and staged orders, which keeps the Cross-dock expiry rule in play.
  • A hidden Monitors capability pauses its evaluator. The scheduled sweep returns without evaluating while Monitors is not enabled, so no alert fires on an installation that shows none.
  • A monitor rule names the capability it belongs to, and a hidden capability hides the rule unless its engine still works. Each built-in rule declares one Extended capability or none; today only Cross-dock expiry names one (cross-dock). While that capability is not enabled, none of its engine-work switches is on anywhere, it reports no open work (the drain rule) and the Facility has no open alert for the rule, the rule is not seeded for that Facility, not evaluated and not listed by GET /api/v1/monitors. While an engine-work switch is on, work is open or an alert is open, the rule is seeded, evaluated, listed and alerts as before, so an open alert resolves through the normal evaluation when its condition clears, and the rule is hidden from the following check. PATCH still writes the stored row, because a hidden capability's routes stay callable. Capability switching never changes the stored configuration, so the rule returns with its earlier settings. A rule that names no capability behaves as before. A pause of the whole Monitors capability leaves open alerts as they are.

Consequences

  • A Core installation reads as a warehouse system for one operation. The Insights group is absent from the sidebar, Admin lists no Extensions, Integrations or Document templates, and the floor menu has six entries.
  • Switching a capability on is a confirmation, not a migration. Its pages, widgets, settings and data reappear as they were; nothing was copied or deleted.
  • The console makes the same requests as before plus none: the profile travels in /api/v1/me, which every session already loads.
  • A Business Unit administrator cannot change the profile and sees a permission state on the panel; the profile belongs to the whole Company.
  • A hidden capability is still reachable through REST. An integration that drives waves keeps working on a Core installation. This is intended: the profile is a presentation choice. An operator who wants an engine to stop doing work must switch the work off, as the Monitors evaluator does. Hiding a capability does not stop an engine whose work switch is on, so the work switches (engineWork in the property catalogue: karyo.streaming.enabled, karyo.wave.auto-release and the four cross-dock keys) stay listed in System properties and Facility settings while their capability is hidden, and the Capabilities preview warns when a change hides a capability whose switch is on.
  • Test installations run Extended. The backend test profile sets karyo.profile: EXTENDED, so every engine test sees its capability; tests of the profile itself store Company rows and remove them again.

Alternatives considered

  • Keep showing everything (ADR 0031 as written). Rejected: the surface an implementer must learn and explain grows with every engine, and the product's own vision is a narrow Core that works for one operation before it grows.
  • Gate capabilities with the licence bridge. Rejected: it would bring back a licence in all but name, and ADR 0030 keeps that bridge for integrations only.
  • Grey out hidden entries with an explanation. Rejected: a disabled entry is the locked state ADR 0031 removed, and issue #169 found the Home widget dialog doing exactly that.
  • Refuse a hidden capability's REST routes. Rejected: it would make the profile an authorization rule beside the grants of ADR 0048, and switching a capability off would break integrations and strand open work.
  • Store the profile per Business Unit or per Facility. Rejected: navigation, the command palette and the floor menu would differ by context inside one Company, and a capability's data would show in one unit and not another. The ladder supports it; the decision does not use it.
  • Let the raw property editor change the keys. Rejected: a raw edit has no preview of what hides and no confirmation, which is the failure the panel exists to prevent.

Evidence

  • services/auth-service/karyo-auth-api/src/main/kotlin/com/karyo/auth/capability/Capabilities.kt, Profile, Capability, CapabilityLookup, CapabilityWork - Profile, the twelve Capability entries, CapabilityLookup and CapabilityWork.
  • services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/service/CapabilityService.kt, CapabilityService.console - console, what shows and drains; preview, the preview; change, the confirmed change; plan, the reset to the new profile; setUp, the Slotting view's Loci requirement.
  • services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/config/SystemPropertyCatalog.kt, SystemPropertyCatalog - karyo.profile and the capability keys; SystemPropertyResource.requireOwnerWritable the raw editor's refusal.
  • services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/api/v1/CapabilityResource.kt, CapabilityResource - the panel's routes, Company-only.
  • services/karyo-app/src/main/kotlin/com/karyo/app/auth/AuthSessionResource.kt, AuthSessionResource.currentPrincipal - capabilities in /api/v1/me.
  • services/monitoring-service/karyo-monitors-core/src/main/kotlin/com/karyo/monitors/service/MonitorEvaluator.kt, MonitorEvaluator.runOnce - the paused evaluator.
  • services/monitoring-service/karyo-monitors-core/src/main/kotlin/com/karyo/monitors/catalog/MonitorCatalog.kt, MonitorCatalog, and services/monitoring-service/karyo-monitors-core/src/main/kotlin/com/karyo/monitors/service/MonitorConfigService.kt, MonitorConfigService.effectiveConfig, resolve, isSwitchedOff - the rule's capability and where the gate applies.
  • services/wave-service/karyo-wave-core/src/main/kotlin/com/karyo/wave/service/WaveCapabilityWork.kt, WaveCapabilityWork - open waves for the drain rule.
  • services/crossdock-service/karyo-crossdock-core/src/main/kotlin/com/karyo/crossdock/service/CrossDockCapabilityWork.kt, CrossDockCapabilityWork - matched and staged cross-dock orders for the drain rule.
  • frontend/web/src/hooks/use-capabilities.ts, useCapabilities, frontend/web/src/config/navigation.ts, navigationItems, getVisibleNavItems, frontend/web/src/config/admin-navigation.ts, adminNavItems, visibleAdminNavItems, frontend/web/src/pages/home/widget-catalog.tsx, WidgetCatalog, frontend/web/src/pages/waves/waves-page.tsx, WavesPage, WavesBoard, frontend/mobile/src/menu/use-menu.ts, useMenu - the entry points that filter.
  • frontend/web/src/pages/admin/admin-capabilities-page.tsx - the panel.
  • scripts/deploy-server.sh, validate_env (KARYO_PROFILE check) - the KARYO_PROFILE preflight.
  • services/karyo-app/src/test/kotlin/com/karyo/auth/api/v1/CapabilityResourceTest.kt, frontend/web/src/config/__tests__/navigation.test.ts, frontend/web/src/pages/__tests__/engine-pages.test.tsx - the pinned behaviour.