Documentation/ Reference
Requirements
What Karyo is required to do, one requirement per line, each with where this repository meets it. Every row was checked against the source tree. How each warehouse operation behaves in detail is described in the functional documents listed in the documentation map; this register is the short list of requirements that carry an identifier.
Identifiers are stable once assigned and are never reused, so the numbering has gaps. Performance, availability and security targets are requirements to verify, not measured guarantees conferred by this register.
Platform
| Id | Requirement | Where it is met |
|---|---|---|
| INFRA-01 | Mutable aggregate entities carry an identity key, optimistic-lock version and assignable created/modified timestamps, normally through the shared base classes; the fixed-id Company maps the same fields directly, and owner-scoped entities add business_unit_id |
libs/karyo-common/src/main/kotlin/com/karyo/common/domain/BaseEntity.kt; services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/domain/model/Company.kt; data model |
| INFRA-02 | Domain changes that other systems consume are appended to a transactional outbox with a shared event envelope | libs/karyo-events/src/main/kotlin/com/karyo/events/DomainEvent.kt, libs/karyo-events/src/main/kotlin/com/karyo/events/outbox/OutboxService.kt; events and the outbox |
| INFRA-03 | API errors are returned as a problem-details body with seven fields: type, title, status, detail, instance, traceId, timestamp. Each https://karyowms.com/errors/<slug> has one meaning and one HTTP status; missing path resources are 404, missing body references are 422 invalid-reference |
libs/karyo-common/src/main/kotlin/com/karyo/common/exception/ProblemDetail.kt, ProblemDetail; API error contract |
| INFRA-04 | Every module builds through two tiers of convention plugins, karyo.kotlin-conventions and karyo.quarkus-service, with allOpen applied to six annotations and dependencies declared explicitly per module |
buildSrc/src/main/kotlin/karyo.kotlin-conventions.gradle.kts, allOpen, buildSrc/src/main/kotlin/karyo.quarkus-service.gradle.kts |
| INFRA-05 | The managed-provider profile defines one Keycloak realm with karyo-web, karyo-backend, karyo-admin, the explicit API audience and predefined realm roles, which grant nothing in Karyo |
infrastructure/keycloak/karyo-realm.json, infrastructure/keycloak/karyo-realm-prod.json |
Authentication and access
| Id | Requirement | Where it is met |
|---|---|---|
| AUTH-01 | A person authenticates with a standards-based OIDC provider through authorization code plus PKCE; the API accepts only a signed, time-valid access token with exact issuer, subject, RS256 and the configured API audience | Identity and tenancy; ADR 0037 |
| AUTH-02 | Every REST method (identity self-service and public methods excepted), scheduled job and agent tool declares one catalogue action, and a principal performs it only where a stored grant's permission profile holds it; provider roles, groups and scopes grant nothing | libs/karyo-security/src/main/kotlin/com/karyo/security/Actions.kt; services/karyo-app/src/main/kotlin/com/karyo/app/auth/TenantFilter.kt; users, roles and permissions; ADR 0048 |
| AUTH-03 | Business Unit and Facility data isolation: application code applies the Business Units and Facilities where the request's declared action is granted | Identity and tenancy; ADR 0014, ADR 0015 |
| AUTH-04 | Local access and provider administration obey the Users administration rules | Users administration; services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/api/v1/PrincipalResource.kt |
| AUTH-05 | In the managed Keycloak profile, an account is locked for 30 minutes after 5 failed sign-ins | infrastructure/keycloak/karyo-realm.json, bruteForceProtected, failureFactor, maxFailureWaitSeconds, infrastructure/keycloak/karyo-realm-prod.json, bruteForceProtected, failureFactor, maxFailureWaitSeconds |
| AUTH-06 | In the managed Keycloak profile, sign-in, sign-out and failed sign-in events are recorded in the audit trail from Keycloak's events API; an event with no Business Unit (an unknown user or the platform administrator) is skipped, because a journal row needs a Facility | services/karyo-app/src/main/kotlin/com/karyo/app/auth/KeycloakEventPoller.kt |
| AUTH-07 | One installation has one independently stored Company with fixed id 1; configuration key 0 is not a Business Unit row | services/karyo-app/src/main/resources/db/migration/auth/V1205__create_company.sql; Company and Business Units |
| AUTH-08 | Business Units have positive ids under Company 1, with Business Unit names in storage, claims and the public API | services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/service/BusinessUnitService.kt; services/auth-service/karyo-auth-api/src/main/kotlin/com/karyo/auth/spi/OrganizationLookup.kt; ADR 0051 |
| AUTH-09 | Karyo owns stable principal UUIDs; credentials bind by exact canonical issuer and opaque subject, with no username/email/JIT linking | services/karyo-app/src/main/resources/db/migration/auth/V1208__create_principals_and_external_identities.sql; ADR 0037 |
| AUTH-10 | Suspension, retirement, unlinking, unknown binding and identity-resolution failure deny the next request; authority and operational scope come from principal UUID grants read on every request, so a revoked grant stops the next request | services/karyo-app/src/main/kotlin/com/karyo/app/auth/PrincipalSecurityIdentityAugmentor.kt; services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/service/PrincipalService.kt |
| AUTH-11 | A reviewed forward-only manifest preserves identity-linked grants, personal state and live ownership, and stops on changed counts or ambiguity before writing a cutover marker | scripts/identity_migration.py; identity upgrade |
| AUTH-12 | Access activation maps only exact issuer/subject bindings to stable principal UUID grants; current /me/access and per-user allowedActions resolve those grants within kind, branch and provider-capability limits without narrowing the Users read list |
scripts/identity_migration.py; services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/service/CurrentAccessService.kt; users, roles and permissions |
| AUTH-13 | Selected Business Unit has separate context fields and never replaces affiliation; forged selection is refused before writes, a body businessUnitId is ignored in favour of the Facility, while missing grants yield no operational rows |
ADR 0038; services/karyo-app/src/test/kotlin/com/karyo/app/auth/CurrentAccessKeycloakIT.kt |
| AUTH-14 | Floor queue entries capture principal UUID from online /me, Business Unit, operation id and payload version; replay never changes actor or context, another account leaves an entry pending and cannot send or discard it, sign-out warns about unsent work, and old unbound entries require reconciliation | frontend/mobile/src/lib/offline/op-queue.test.ts; frontend/mobile/src/lib/offline/sync.test.ts; frontend/mobile/src/screens/sync-issues.test.tsx; frontend/mobile/src/components/hmi/sign-out-button.test.tsx; floor app |
Warehouse layout
| Id | Requirement | Where it is met |
|---|---|---|
| LYOT-01 | Storage locations are grouped by zone, Location Class and location cluster | services/warehouse-layout-service/karyo-layout-core/src/main/kotlin/com/karyo/layout/domain/model/StorageLocation.kt; warehouse layout configuration |
| LYOT-02 | Location Classes carry usages: goods in, goods out, picking, storage, transfer, replenish, buffer, cross-dock staging, pack staging and ship staging | services/warehouse-layout-service/karyo-layout-api/src/main/kotlin/com/karyo/layout/vo/LocationClassUsage.kt |
| LYOT-03 | Location types carry physical dimensions and weight or lifting capacity | services/warehouse-layout-service/karyo-layout-core/src/main/kotlin/com/karyo/layout/domain/model/LocationType.kt |
| LYOT-04 | A location can be locked and unlocked, with a lock type of general, quarantine, stocktaking or damage | services/warehouse-layout-service/karyo-layout-api/src/main/kotlin/com/karyo/layout/vo/LockType.kt |
| LYOT-05 | A location can be resolved by its scan code | services/warehouse-layout-service/karyo-layout-core/src/main/kotlin/com/karyo/layout/api/v1/LocationResource.kt, LocationResource.findByScanCode |
| LYOT-06 | Storage strategies are configurable, including the item mixing rule and zone preferences | services/warehouse-layout-service/karyo-layout-core/src/main/kotlin/com/karyo/layout/domain/model/StorageStrategy.kt; strategies and policies |
| LYOT-07 | Each location's allocation is maintained as unit loads arrive, leave and are revived, from in-process inventory events | services/warehouse-layout-service/karyo-layout-core/src/main/kotlin/com/karyo/layout/service/LocationAllocationService.kt, services/warehouse-layout-service/karyo-layout-core/src/main/kotlin/com/karyo/layout/messaging/UnitLoadTransferredObserver.kt |
| LYOT-08 | A product can be fix-assigned to a location with minimum and maximum amounts | services/warehouse-layout-service/karyo-layout-core/src/main/kotlin/com/karyo/layout/domain/model/FixAssignment.kt; replenishment |
| LYOT-09 | A location finder chooses putaway destinations, in process | Putaway and location finding |
| LYOT-10 | The server reads typed label ranges and pasted lists into addressed locations, and never creates a name that was not pasted | services/warehouse-layout-service/karyo-layout-core/src/main/kotlin/com/karyo/layout/service/WarehouseLabelReader.kt; set up a warehouse |
| LYOT-11 | Bulk warehouse setup is explicitly targeted at one Facility, creates all its locations in one transaction or none, and is idempotent under a client-generated key | services/warehouse-layout-service/karyo-layout-core/src/main/kotlin/com/karyo/layout/service/WarehouseSetupService.kt, WarehouseSetupService.create; ADR 0036 |
| LYOT-12 | One installation-wide floor arrangement, a flow of goods and dock-door counts, is stored and applied to the shared warehouse scene | services/warehouse-layout-service/karyo-layout-core/src/main/kotlin/com/karyo/layout/service/WarehouseArrangementService.kt, frontend/web/src/pages/home/warehouse/scene.ts; ADR 0036 |
Product master data
| Id | Requirement | Where it is met |
|---|---|---|
| PROD-01 | Products are created and maintained with a number (SKU), name, description, dimensions and weight | services/product-service/karyo-product-core/src/main/kotlin/com/karyo/product/domain/model/ItemData.kt |
| PROD-02 | A product carries multiple barcodes (EAN, UPC, supplier codes) and can be looked up by any of them | services/product-service/karyo-product-core/src/main/kotlin/com/karyo/product/domain/model/ItemDataNumber.kt, services/product-service/karyo-product-core/src/main/kotlin/com/karyo/product/api/v1/ProductResource.kt, ProductResource.getByBarcode |
| PROD-03 | Products are measured in item units typed as piece, weight, volume, length or other, with base units seeded | services/product-service/karyo-product-api/src/main/kotlin/com/karyo/product/vo/ItemUnitType.kt, services/karyo-app/src/main/resources/db/migration/product/V201__create_item_units.sql |
| PROD-04 | Packaging units carry a conversion amount | services/product-service/karyo-product-core/src/main/kotlin/com/karyo/product/domain/model/PackagingUnit.kt |
| PROD-05 | Lot and shelf-life tracking are set per product | services/product-service/karyo-product-core/src/main/kotlin/com/karyo/product/domain/model/ItemData.kt, ItemData |
| PROD-06 | A product is either active or inactive | services/product-service/karyo-product-api/src/main/kotlin/com/karyo/product/vo/ItemDataState.kt |
| PROD-07 | Serial numbers are recorded per product in one of three modes: not recorded, recorded at goods receipt, or always recorded | services/product-service/karyo-product-api/src/main/kotlin/com/karyo/product/vo/SerialNoRecordType.kt |
Desktop console
| Id | Requirement | Where it is met |
|---|---|---|
| DASH-02 | Sidebar navigation shows each section only to users who hold the catalogue action it names | frontend/web/src/components/layout/app-sidebar.tsx; frontend |
| DASH-03 | A locations screen lists, creates and edits locations | frontend/web/src/pages/locations/; administer Karyo |
| DASH-04 | A products screen lists, creates and edits products and manages their barcodes | frontend/web/src/pages/products/use-products.ts |
| DASH-05 | An inventory overview shows stock by location and product, and is filterable | frontend/web/src/pages/inventory/; find stock |
| DASH-06 | A users screen manages users and their permission-profile grants | frontend/web/src/pages/users/use-users.ts; administer Karyo |
| DASH-08 | Error responses are shown as readable notifications built from the problem-details body | frontend/web/src/lib/api-client.ts |
| DASH-09 | The console has a dark mode toggle | frontend/web/src/components/theme/mode-toggle.tsx |
| DASH-11 | A warehouse drawing, derived from zone, location-type and pick-sequence data, shows per-location occupancy, holds and Slotting advice, with an openable 3D view of the same scene; it is explicitly not a measured floor plan | frontend/web/src/pages/home/warehouse/; data model |
| DASH-12 | KPI widgets on Home cover inventory accuracy, order cycle time, picked-versus-received throughput and volume by category; the warehouse widget itself covers occupancy and slot utilisation | frontend/web/src/pages/home/home-widgets.tsx; data model |
| DASH-13 | Home's optional widget layout is customer-default plus a per-user override, stored server-side and keyed by Karyo principal UUID; the old subject remains only as migration provenance | services/auth-service/karyo-auth-core/src/main/kotlin/com/karyo/auth/service/HomeLayoutService.kt; data model |
| DASH-14 | The console offers typed and pasted warehouse setup, from Home, Locations, the sidebar and the command palette, to a user who holds layout.write |
frontend/web/src/pages/warehouse-setup/, frontend/web/src/pages/home/warehouse/warehouse-widget.tsx; set up a warehouse |
Deployment
| Id | Requirement | Where it is met |
|---|---|---|
| DEPLOY-01 | The production profile reads the database and identity settings from environment variables | services/karyo-app/src/main/resources/application.yaml, %prod.quarkus.datasource, %prod.quarkus.oidc, %prod.quarkus.keycloak.admin-client |
| DEPLOY-02 | Both front ends load standards-based OIDC authority/client configuration at container start, so a provider endpoint change needs no rebuild | infrastructure/docker/nginx/docker-entrypoint.sh; frontend/web/src/lib/keycloak.ts; frontend/mobile/src/lib/keycloak.ts |
| DEPLOY-03 | One Dockerfile, parameterised by a build argument, builds the application image | infrastructure/docker/Dockerfile.service |
| DEPLOY-04 | nginx routes /api/ to the application, /m/ to the floor PWA and / to the desktop console; managed-provider mode also proxies /auth/ to optional Keycloak |
infrastructure/docker/nginx/nginx.conf |
| DEPLOY-05 | A single idempotent deploy script brings up the supported Compose deployment | scripts/deploy-server.sh; deploying Karyo |
| CLOUD-01 | The deploy script detects Docker or Podman | scripts/deploy-server.sh |
| CLOUD-02 | The application container's memory limit comes from the environment file (APP_MEM_LIMIT), with a default |
infrastructure/docker/docker-compose.prod.yml, scripts/.env.prod.example |
| CLOUD-03 | JVM heap sizes are set per environment through JAVA_OPTS, with no image rebuild |
infrastructure/docker/Dockerfile.service, scripts/.env.prod.example |
| CLOUD-04 | A second environment template sizes the stack for a 24 GB ARM64 host | scripts/.env.prod.cloud-example |
| IDEMPOTENT-01 | The deploy script offers --quick, --reset-db and --help |
scripts/deploy-server.sh |
| IDEMPOTENT-02 | The deploy script validates the required environment variables before starting, and fails early on an empty or CHANGE_ME value |
scripts/deploy-server.sh |
| IDEMPOTENT-03 | The deploy script checks the nginx HTTP port (NGINX_HTTP_PORT), the only port the production stack publishes, and reports the process holding it |
scripts/deploy-server.sh |
| IDEMPOTENT-04 | On a health-check timeout the deploy script prints the last 20 lines of the failing container's log | scripts/deploy-server.sh |
Testing
| Id | Requirement | Where it is met |
|---|---|---|
| TEST-03 | Playwright end-to-end suites cover sign-in against a real Keycloak, create-read-update-delete screens, navigation and connected warehouse scenarios | tests/e2e/tests/auth.spec.ts, tests/e2e/tests/navigation.spec.ts, tests/e2e/tests/core-proof.spec.ts; testing |
| TEST-05 | Pact provider verification exists for four modules' REST APIs (auth, inventory, layout, product) and loads contracts from the Pact Broker named by pact.broker.url. It runs only when a broker is named, and is then strict: an unreachable broker or a missing pact fails it. With none named it is reported as skipped. The nightly test job runs it against an ephemeral broker holding the console's consumer pacts, and its pact-verify job fails unless every published interaction is verified |
services/karyo-app/src/test/kotlin/com/karyo/app/pact/RequiresPactBroker.kt, services/karyo-app/src/test/kotlin/com/karyo/inventory/pact/InventoryPactProviderTest.kt, InventoryPactProviderTest, .github/workflows/nightly.yml, jobs.pact-verify |
| TEST-06 | Consumer contracts cover the desktop console's calls to four APIs; the token claims the services depend on are checked against the realm and the tenant filter instead | frontend/web/src/test/pact/, services/karyo-app/src/test/kotlin/com/karyo/app/auth/RealmPrincipalKindClaimTest.kt, services/karyo-app/src/test/kotlin/com/karyo/security/TenantFilterTest.kt |
| TEST-07 | The development Compose file runs a Pact Broker | infrastructure/docker/docker-compose.dev.yml, services.pact-broker |
Related
- Glossary - the words these requirements use
- Data model - the tables behind them
- Implementer guide - verifying them on a real installation