Karyo
Documentation/ Decision records

ADR 0030: No licence withholds anything; the licence interfaces remain as a compatibility bridge

Karyo 2.1.1rendered at build time
On this page

Status: Accepted; superseded in part by ADR 0031 (the console's locked states, and the entitlement-gate.test.tsx test that pinned them, are no longer in the code).

Context

ADR 0029 made Karyo one Apache-2.0 product and left the 1.x entitlement machinery in place, marked transitional. That machinery still decided what an installation could do. On a fresh 2.0.0 install with no licence setting, GET /api/v1/license reported the commercial edition with an empty entitlement set, and every engine route refused an authorised user with 403 and the problem type https://karyo.com/errors/license-required (the problem type namespace of that time), ahead of its own role checks. The background engines skipped their work. A licence that lapsed stranded work already in flight: released waves stopped advancing, cross-dock rows past their deadline were never disposed of, and the routes that could have unwound them were refused too.

Three constraints bind the retirement:

  • Existing clients read GET /api/v1/license. The route, its 200, its two body shapes and their field names are a published contract (ADR 0017), and the console places its add-on pages from entitlements.
  • Existing deployments carry the 1.x settings. An environment file may set KARYO_LICENSE, KARYO_LICENSE_KEY or KARYO_LICENSE_PUBLIC_KEY, with any value: a valid, expired or forged token, an unsigned list, a placeholder, or nothing. An upgrade must not fail on one, must not echo one into a log, and must not keep reporting commercial state.
  • Authentication and authorization are a separate concern. Roles, owner scope and principal kind (ADR 0014, ADR 0015) must come out of the change exactly as they went in.

Decision

  • Every capability is available on every installation. No code path withholds a capability, refuses a request or skips work for a licence reason. The engines' require and isEntitled call sites, the per-engine LicensedModuleInstallation markers, LicenseEdition, LicenseRequiredException and its mapper are deleted, and no engine module depends on libs/karyo-license any more.
  • LicenseService stays as the compatibility bridge. entitlements() is the frozen set of the eight 1.x capability keys, and the startup warning names each retired setting still carried.
  • The licence settings are accepted whatever they hold and decide nothing. Nothing parses, verifies or compares them, so no value can fail the boot, lock a capability or change a response. The tolerance is deliberate: rejecting a value an existing environment file carries would turn an upgrade into an outage while deciding nothing. At startup the application logs one warning per retired setting that is present, naming the setting and never its value.
  • GET /api/v1/license keeps its contract and tells the truth. Same route, same 200, still @PermitAll, same two shapes. edition is community for every caller. An authenticated caller also reads entitlements: the eight keys, always. An anonymous caller still reads edition alone, so the anonymous disclosure is no wider than it was. The endpoint discloses; nothing in Karyo authorizes from it.
  • Authorization is untouched. Every @RolesAllowed, the operating-company guards on statement preview and document templates, and owner isolation are as they were. The licence refusal that used to stand in front of them is gone, so a caller now meets exactly the real check.
  • The token tooling stays in the library. LicenseVerifier, VendorKey and the minting and key-generation tests remain in libs/karyo-license, unused at runtime.
  • The retired surface is deprecated, with no removal date. The settings and the endpoint stay until a later decision removes them.
The licence surface kept as a compatibility bridge: the three retired settings are accepted whatever their value, LicenseService never reads them for a decision, the startup log names the setting and never its value, and GET /api/v1/license reports community with every capability key.

The licence settings are accepted, never read for a decision: the startup log names a present setting and never its value, and the endpoint reports community and every capability key. Derived from the decision above and libs/karyo-license/src/main/kotlin; source docs/diagrams/08-licence-compatibility-bridge.mmd.

Consequences

  • A fresh install serves every capability, and a signed-in caller reads the full key set. There is no licence-lapse failure mode any more: the stranded-wave and stranded-cross-dock defects, the unsigned-list bypass and the refusal that masked the real authorization answer are gone with the gate.
  • Engines whose capability the 1.x licence did not name now act when their own switches allow. The event monitors are enabled per goods owner by default and sweep every karyo.monitors.interval (5 minutes), raising in-app alerts. Every new alert also publishes alert.fired to the outbox, and the webhook relay delivers it to each active subscription of the goods owner whose event types match * or an alert* prefix - so an installation whose licence did not cover the monitors, holding such a subscription, starts receiving alert.fired after upgrade with no email or Slack channel configured. Email and Slack delivery stay off until a channel is enabled. An order strategy saved with a CARTONIZATION packout knob starts cartonizing at the default of one line per box, where before it packed one unit per container. Wave auto-release, order streaming and both cross-docking rungs each still wait for their own runtime switch, all off by default. Document-template overrides with an active row render again. An operator upgrading from 1.x sees these for the first time on every capability the licence did not name.
  • Cartonization answers its CARTONIZATION knob in any spelling. pack() proceeds when the knob, trimmed, equals CARTONIZATION ignoring case - the spellings the console accepts and saves - and returns null for anything else, so an order strategy whose knob names a strategy no bean claims - the names are unvalidated free text (ADR 0018) - falls through to the built-in ONE_TO_ONE and packs one unit per container. For an installation upgrading from 1.x with a cartonization licence this keeps cartonization on any spelling of CARTONIZATION; the one packing change is a name that is neither CARTONIZATION in any case nor ONE_TO_ONE, which 1.x cartonized through the priority scan and which now packs one unit per container. The default ONE_TO_ONE is claimed by name and unchanged.
  • edition is no longer a discriminator. A client that branched on commercial now reads community, which is the only edition there is.
  • The console's locked states are still in the code, and show only before the licence request answers or when it fails. The add-on placement and the locked panels ask useLicense().isEntitled(key), which reads the licence body: while the request is pending the sidebar and palette hold the add-on entries unlocked in the Add-ons group and the locked pages show a loading state, but three in-page locks - the Exceptions page's Monitor alerts section, the Warehouse > Items class filter and the order-strategy form's add-on hints - can already show; once it answers, every capability key is reported and nothing is locked; if the request fails - the console retries once - the console settles on its 1.x locked states until later UI work removes them.
  • No schema change and no migration.

Alternatives considered

  • Delete LicenseService, the endpoint and the settings now. Rejected: existing clients read the endpoint, and the console reads its body.
  • Keep verifying signed tokens, and report what they name while granting everything. Rejected: a verifier that decides nothing is misleading, and an expired or foreign token would produce warnings about a check that no longer exists.
  • Refuse to boot, or refuse a request, on a malformed or unknown value. Rejected: an upgrade would fail on a setting that no longer does anything.
  • Report commercial, or drop edition. Rejected: the first is false commercial state; the second breaks the body shape clients parse.
  • Report the configured list, or an empty one. Rejected: either would lock console screens for a capability that is available.
  • Answer anonymous callers with the key set too. Rejected: the anonymous body stays exactly as narrow as it was.
  • Let cartonization answer the priority scan, so an unrelated packout name is cartonized too. Not taken: cartonization answers CARTONIZATION in any spelling and anything else keeps the built-in ONE_TO_ONE (recorded above), which is what an unlicensed 1.x installation did.

Evidence

  • libs/karyo-license/src/main/kotlin/com/karyo/license/LicenseService.kt, LicenseService.reportRetiredSettings, LicenseService.retiredSettingsInUse, LicenseService.entitlements - the bridge: the settings as optional values, the startup warning, the frozen key set
  • libs/karyo-license/src/main/kotlin/com/karyo/license/LicenseResource.kt, LicenseResource - the two bodies, split by anonymous and authenticated caller
  • services/karyo-app/src/main/resources/application.yaml, karyo.license.entitlements - KARYO_LICENSE mapped only so the startup warning can see it
  • scripts/.env.prod.example - the licence settings commented out, and why
  • services/fulfillment-service/karyo-cartonization-core/src/main/kotlin/com/karyo/cartonization/CartonizationPackout.kt, CartonizationPackout
    • answers the CARTONIZATION knob in any spelling; an unrelated name keeps the built-in
  • services/karyo-app/src/test/kotlin/com/karyo/license/ - the bodies with no, empty and legacy settings, and the startup warning that never repeats a value
  • services/karyo-app/src/test/kotlin/com/karyo/security/EngineRouteAuthorizationTest.kt - every engine route's role boundary, unchanged
  • libs/karyo-license/src/test/kotlin/com/karyo/license/LicenseServiceTest.kt - valid, expired, forged and malformed tokens, and unsigned lists, all change nothing
  • frontend/web/src/features/license/entitlement-gate.test.tsx - on the served eight-key licence body, every add-on page stays in its home group and opens its live view
  • tests/e2e/tests/profiles.spec.ts - waves, streaming, monitors and document templates open live, no locked panel, on a stack without a licence