# Writing this Kanoniq model This repository holds an architecture model written in Kanoniq: the `.kq` files under `model/` are one model, `kanoniq.repository.json` holds its settings, and `portal/` holds the pages of its portal. Read this file before you write or change a `.kq` file, and hold to it in every change. ## Rules for every change - **Model only what runs.** Every element stands for something tangible: software that is deployed, a store that holds data, a team that exists. Where you cannot name the tangible thing behind an element, ask the Author; never invent one. - **State everything; infer nothing.** Kanoniq has no defaults: what the files do not say, the model does not hold. Where a choice could go two ways, such as a Broker or a Channel, a monolith or a Platform, a Domain Object or a Data Entity, ask the Author; never pick one silently. - **Never write what Kanoniq writes.** Write nothing into a `.g.kq` file and never write an Id: `kq build` writes them. Rename or move an element with the editor's Rename and Move refactorings, so its Id is kept. - **Keep out what the language rules out.** Where the source describes something Kanoniq cannot say, say so rather than force it in, and report it to the Author as something the language cannot say. - **Validate before you propose.** Run the loop below on every change, until the model is clean or only questions for the Author remain. - **Cite.** An answer about the model names every element it relies on by its path, such as `shop/storefront/order-service`. An answer with no citation is a wrong answer. ## The loop 1. Change the `.kq` files under `model/`. 2. Run `kq validate --format sarif .` at the repository's root. It writes one SARIF log to standard output: each result has a rule code, a message and the file and line it is on, and each rule links its page in the documentation, which says how to fix what it reports. 3. Fix what it reports and run it again, until it reports nothing or only questions for the Author remain. Ask those; never guess an answer. 4. Run `kq build .`. It writes `model/.g.kq`, which holds what Kanoniq adds and every element's Id. Commit it with the `.kq` files. ## How a model is written A small model that builds: ```kanoniq /// What the shop does, and the systems that do it. ecosystem shop "Shop" { domain selling "Selling" { #pcf "10215" function place-order "Place an order" } platform storefront "Storefront" { /// The web shop customers order in. component web-shop "Web Shop" : user-facing-app technology "Next.js" { spa web-shop-ui "Web Shop" } component order-service "Order Service" : backend web-shop -> order-service/orders-api over http auth user-token web-shop realizes selling/place-order order-service realizes selling/place-order } } ``` - A declaration is a keyword, a Code and a name in quotes: `platform storefront "Storefront"`. The Code is how other statements refer to the element. - A block in braces holds what the element contains: the Ecosystem holds the domain and the platform, the platform holds the components. - A kind follows a colon: `: backend`. - A reference is a path of Codes, from where it is written: `order-service/orders-api`, `selling/place-order`. - `web-shop -> order-service/orders-api over http auth user-token` is a connection: who calls which Interface, over what protocol and with what credential. Naming `orders-api` is enough; Kanoniq adds it. - `realizes` says which Component carries out which Function. - A `#` line above an element sets an open property that `kanoniq.repository.json` declares. - A `///` line above an element is its description. Every statement of every language area, with examples, is in the language reference: https://kanoniq.extenza.dev/docs/language.md. ## Element types ### Motivation and strategy | Element type | What it is | | --- | --- | | Stakeholder | A Stakeholder is a party with an interest in the organization, inside it or outside it. A Stakeholder is not an actor in the landscape. | | Driver | A Driver is something that moves the organization to change. A Driver may hold Drivers of its own, and influences Goals. | | Assessment | An Assessment is a finding about the organization in one SWOT category: a strength, a weakness, an opportunity or a threat. An Assessment may hold Assessments of its own, and influences Drivers. | | Goal | A Goal is a commitment of the organization. A Goal may hold Goals of its own, and is realized by the function side. | | Impact | An Impact is a change in one Stakeholder's behavior that serves the organization's goals, such as riders returning bikes to a dock. An Impact influences Goals and is realized by the function side. | | Principle | A Principle is a rule the organization sets itself, its statement being its description. A Principle holding others is the category they belong to. | | Value | A Value is worth to someone: held by the organization, or delivered by a Value Stream. | | Purpose | A Purpose is what the element holding it is for, its text being its description; in an Ecosystem, what the organization is for. An element holds at most one Purpose. | | Value Stream | A Value Stream is a sequence of stages delivering value: a stream the organization exists for, or one that supports those. | | Value Stream Stage | A Value Stream Stage is one step of its Value Stream, ordered by its number. Only a Function Group realizes a Value Stream Stage. | ### Business functions | Element type | What it is | | --- | --- | | Ecosystem | An Ecosystem is the outermost grouping of a model and its privacy and security boundary: in practice a company, or a division of one that runs itself. An Ecosystem has no parent and is never realized. | | Domain | A Domain is an area of what the organization does with IT, on the function side: in DDD's terms a subdomain, the whole problem space being the Ecosystem's function side. A Domain holds either sub-domains, or Function Groups and Functions, never both. | | Function Group | A Function Group is a group of related Functions in a Domain, on the function side. Only a Function Group realizes a Value Stream Stage. | | Function | A Function is one thing the organization does with IT, the finest level of the function side. A Function is realized by what implements it. | ### Processes | Element type | What it is | | --- | --- | | Process | A Process is a business process: ordered work under a Value Stream Stage, written as BPMN. A Process sits in a Domain or an Ecosystem and holds its pools, its flow nodes and the flows between them; its lanes are Job Roles. | | Pool | A Pool is an external party taking part in a Process, written as a persona: a customer, a partner's representative or an auditor. A Pool belongs to its Process and holds the party's External Steps; the organization itself is never a Pool. | | Flow Node | A Flow Node is one step of a Process as BPMN draws it: a task, a start or end event, a gateway, or an External Step of a party's Pool. Every Flow Node but an External Step sits in one lane of its Process. | ### Applications | Element type | What it is | | --- | --- | | Platform | A Platform is a conceptual grouping of separately deployable Components, with the user-facing Interfaces, Brokers and Domain Objects that belong with them. | | Monolith | A Monolith is one system in which at least one tier is single, such as a big backend or a single database. A Monolith stands where a Platform does and holds Modules, Components, Interfaces, Storages, Brokers and Domain Objects. It is run and replaced as one, so it carries a life cycle. | | Module | A Module is a part of a Monolith that holds Components. Modules do not nest. | | Component | A Component is a piece of software that runs, such as a service, an application or a rented SaaS. A Component sits in a Platform, a Monolith or a Module, holds its Interfaces and Storages, and realizes Functions. | | Interface | A software-facing Interface is how other software reaches a Component, such as an HTTP API. A call to an Interface that is not declared creates it, of the kind the call's protocol implies. | | Interface | A user-facing Interface is how a person reaches the landscape: a web app, a mobile app or a desktop application, on a device the organization places too. A user-facing Interface sits in its backend Component where it has one, and otherwise in a Platform or a Monolith. | ### Integration | Element type | What it is | | --- | --- | | Channel | A Channel is what messaging parties attach to when neither knows the other, such as a topic or a queue: the messaging counterpart to an Interface. A Channel sits in its Broker, or for a file handoff on the file or blob Storage the files are in, and serves every party that names it. | | Broker | A Broker is the infrastructure messaging goes through, such as a Kafka cluster or a Service Bus namespace. A Broker contains Channels, and its kind names its technology; it runs on the provider or on what the organization runs. | | Event | An Event is a message saying what happened, declared by the Component that publishes it, such as Order placed. An Event is about one Domain Object and is carried on legs into and out of Channels. | | Command | A Command is a message asking one handler to do something, declared by the Component that handles it, such as Send invoice. A Command is about one Domain Object and is carried on any Connection reaching its handler. | | Query | A Query is a message asking one handler for something, declared by the Component that handles it, such as Invoice status. A Query is about one Domain Object and is carried on any Connection reaching its handler. | | Scenario | A Scenario is an ordered walk over existing connections for one piece of behavior, such as signing in: which system asks or tells which, in what order. It sits directly in an Ecosystem, and may be anchored on the task of a Process it carries out. | ### Data structure | Element type | What it is | | --- | --- | | Storage | A Storage is where data sits, such as a SQL database or a blob container, owned by the Component or Monolith it sits in. A Storage holds Data Entities. | | Domain Object | A Domain Object is a conceptual thing the organization keeps data about, such as Order. A Domain Object sits in a Platform or a Monolith, belongs to exactly one Domain, and is held in Storages as Data Entities. | | Data Entity | A Data Entity is a tangible holding of a Domain Object, such as the Order table in the Order System. A Data Entity sits in a Storage and represents exactly one Domain Object. | ### Data use | Element type | What it is | | --- | --- | | Data Use | A Data Use is a purpose for which the organization processes personal data, such as running payroll, with the lawful basis it rests on. A Data Use sits in an Ecosystem or a Domain, names the function-side work it covers and the Domain Objects it processes, and its systems, holdings and recipients are read from the model. | ### Identity and access | Element type | What it is | | --- | --- | | Identity | An Identity is a population of accounts of one persona in one Identity Provider, such as the staff in the corporate directory. An Identity's parent is its Identity Provider. | | Role | A Role is an app role: the capacity in which accounts use one user-facing application. A Role sits in that application, has one persona, and is held by every Identity of its persona in the Identity Provider it names. | | Workload Identity | A Workload Identity is a workload's identity at an Identity Provider, such as a managed identity, an app registration or a service account. A Workload Identity sits in the Component or Monolith whose identity it is, or in a Platform when several Components share it. | | Permission | A Permission is a role a server Workload Identity declares, which a client Workload Identity may be granted. A Permission's name is the value its token carries. | | Job Role | A Job Role is a position in the organization, such as Mechanic or Claims handler: who does the work, and why a person has the access they have. A Job Role sits in its Ecosystem, has one internal persona, and holds app Roles. | ### Technology | Element type | What it is | | --- | --- | | Environment | An Environment is one stage an Ecosystem's parts run in, such as PRD or DEV, declared once in the Ecosystem and shared by all its Platforms and Monoliths. Its name is the stage's fixed reading, such as Production. | | Data Center | A Data Center is a building the organization or a colocation supplier runs, in a country, holding every stage. A Network, a Host or a platform service in it names it as its location, and its zones are its own. | | Network | A Network is a private network the organization runs or rents, in one Environment, such as a VNet, a VPC or a data center's LAN. Hosts and platform services sit in it, and where it is regional, where it is is where they are. | | Host | A Host is something the organization runs, in one Environment: a virtual machine, a set of them run as copies of one, a physical server, or a device it places for people to use. Parts are deployed on it, and software is installed on it. | | Installation | An Installation is a version of a product installed on a Host: an operating system, a runtime, an SDK, a web server or middleware. It is in its Host's Environment, and a Component is deployed on the Host beside it. | | App Platform | An App Platform is where application code runs, in one Environment: application PaaS such as an App Service plan or a Functions app, or a self-run scheduler such as Kubernetes. Components are deployed on it. | | Db Server | A DbServer is a database engine, software on a Host or run by the provider, that hosts Storages in one Environment. Its pools are capacity inside it that databases name. | | Db Pool | A DbPool is capacity inside its DbServer that several databases share, such as an elastic pool. A Storage hosted on the server names the pool it is in. | | Gateway | A Gateway is something requests pass through on their way, in one Environment: an API gateway, a load balancer, an edge, an ingress, a firewall, a NAT or a bastion. It publishes Interfaces and forwards to what is behind it. | | Dns | A Dns record is a host name, its name, in a public or private zone, pointing at an endpoint, in one Environment. | | Certificate | A Certificate is a TLS certificate, its name its subject, that endpoints serve in one Environment. | | Storage Account | A Storage Account holds Storages of kind blob, file and table, hosted on it, and a queue Broker, in one Environment, stating its network placement once. A bucket is one holding exactly one Storage. | | Vault | A Vault keeps secrets, keys or certificates, as its kind says, in one Environment. A credential and a Certificate are stored in it, and a call to it lands on it. | | Registry | A Registry holds Repositories of packages and images, each of one format, in the Environment it lives in; a platform that pulls from it uses it, from any stage. | | Repository | A Repository is one repository of its Registry, holding packages or images of one format. | | Ai Platform | An AI Platform hosts the model deployments the organization configures and calls, in one Environment: a provider's AI platform or a self-run model server. Agents built on it are Components deployed on it. | | Model Deployment | A Model Deployment is one model deployed in its AI Platform, its name the model's. A call lands on it. | | Backup Vault | A Backup Vault keeps backups, in one Environment. A Storage, a Host or a DbServer backed up in it names it with how long each backup is kept. | | Security Service | A Security Service watches the stages it covers, in one Environment of its own: posture management, threat detection, vulnerability scanning or a SIEM. | ### Suppliers and contracts | Element type | What it is | | --- | --- | | Supplier | A Supplier is a company or person the organization obtains ICT services from, such as a cloud provider or a software vendor, named by its legal name. A Supplier sits in the Ecosystem that contracts with it and holds its Contracts. | | Contract | A Contract is an agreement under which a Supplier provides ICT services, such as a subscription or an outsourced service desk, with its dates and notice periods. A Contract covers run elements, or names the function-side work it supports, and the Functions it supports are read from what it covers. | | Legal Entity | A Legal Entity is a legal person whose work its Ecosystem does, such as a bank or its subsidiary, named by its legal name. A Legal Entity sits in one Ecosystem and holds its Branches; its parent undertaking draws its group. | | Branch | A Branch is a place of business of a Legal Entity in a country, with no legal personality of its own, such as a bank's branch abroad. Its head office is its Legal Entity, and a Platform or a monolith may do its work. | ### Change over time | Element type | What it is | | --- | --- | | Plateau | A Plateau is a point in time of the whole model. The model's Plateaus form one sequence, and what each holds is stated where it changes. | | Data Migration | A Data Migration is the work of moving data from one holding to another, delivering the later of two Plateaus. A Data Migration sits in an Ecosystem and is part of no Plateau's state. | ### Governance | Element type | What it is | | --- | --- | | Policy Set | A Policy Set groups Policies of one kind, which are judged together and reported under the set's Code. A Policy Set belongs to the model or to one Ecosystem. | | Policy | A Policy is an organization's architecture rule: a filter and an action, allow or deny. Where it is written is what it reaches; its findings are conformance, never validity. | | Constant | A Constant names a value, such as a rotation period, so the policies that use it say it once. Where it is written is what sees it. | ## Rules `kq validate` checks every rule below. An error fails it; a lint does not, unless it runs with `--strict`. | Rule | Severity | What a model must do | | --- | --- | --- | | [KQ001](https://kanoniq.extenza.dev/docs/rules/kq001) | error | Every relationship names elements that are in the model. | | [KQ002](https://kanoniq.extenza.dev/docs/rules/kq002) | error | No two elements share an Id, and no two elements under one parent share a Code. | | [KQ003](https://kanoniq.extenza.dev/docs/rules/kq003) | error | A model has an Ecosystem, and every Ecosystem sits at the top level. | | [KQ004](https://kanoniq.extenza.dev/docs/rules/kq004) | error | Every element but an Ecosystem has exactly one parent. | | [KQ005](https://kanoniq.extenza.dev/docs/rules/kq005) | error | Following parents upward from any element reaches an Ecosystem, never a circle. | | [KQ006](https://kanoniq.extenza.dev/docs/rules/kq006) | error | A Data Entity sits in a Storage, and a Storage sits in the Component or monolith that owns it. | | [KQ007](https://kanoniq.extenza.dev/docs/rules/kq007) | error | Only a Domain, a Function Group, a Function, a Goal, a value stream stage or an impact is realized. | | [KQ008](https://kanoniq.extenza.dev/docs/rules/kq008) | error | A realization stays inside one Ecosystem. | | [KQ009](https://kanoniq.extenza.dev/docs/rules/kq009) | error | A Domain holds either sub-domains or Function Groups and Functions, never both, and a Domain with sub-domains is not realized itself. | | [KQ010](https://kanoniq.extenza.dev/docs/rules/kq010) | error | Every Data Entity holds exactly one Domain Object. | | [KQ011](https://kanoniq.extenza.dev/docs/rules/kq011) | error | Every Domain Object has exactly one authoritative holding across the whole model. | | [KQ012](https://kanoniq.extenza.dev/docs/rules/kq012) | error | A replica syncs from the authoritative holding or from another replica, never from a transient one. | | [KQ013](https://kanoniq.extenza.dev/docs/rules/kq013) | error | A transient holding neither syncs in nor syncs out. | | [KQ014](https://kanoniq.extenza.dev/docs/rules/kq014) | error | part of and references stay inside one Component. | | [KQ015](https://kanoniq.extenza.dev/docs/rules/kq015) | error | Every Data Entity is a root or part of another. | | [KQ016](https://kanoniq.extenza.dev/docs/rules/kq016) | error | part of forms a tree: each Data Entity is part of at most one other, with no circle. | | [KQ021](https://kanoniq.extenza.dev/docs/rules/kq021) | error | Every Domain Object has a holding marked origin, where the data is first created. | | [KQ022](https://kanoniq.extenza.dev/docs/rules/kq022) | error | A connection lands on an Interface or a Channel, not on a Component or monolith, unless it is in-process. | | [KQ023](https://kanoniq.extenza.dev/docs/rules/kq023) | error | A connection's protocol matches the kind of Interface it lands on, and no call lands on a user interface. | | [KQ024](https://kanoniq.extenza.dev/docs/rules/kq024) | error | A Channel is reached through its broker with no protocol, an Interface always with one, and no connection joins two Channels. | | [KQ025](https://kanoniq.extenza.dev/docs/rules/kq025) | error | Only a Domain directly in an Ecosystem is marked enabler. | | [KQ026](https://kanoniq.extenza.dev/docs/rules/kq026) | error | A relationship is written once, in one file or across the files of a split model. | | [KQ027](https://kanoniq.extenza.dev/docs/rules/kq027) | error | A Module sits in a monolith, never in a Platform or another Module. | | [KQ028](https://kanoniq.extenza.dev/docs/rules/kq028) | error | An in-process call joins two Components of one monolith. | | [KQ029](https://kanoniq.extenza.dev/docs/rules/kq029) | error | An environment line names a stage its Ecosystem declares and sits on something that runs on its own. | | [KQ030](https://kanoniq.extenza.dev/docs/rules/kq030) | error | A user interface's environment line states no number of instances; the device it runs on is a host that states its count. | | [KQ031](https://kanoniq.extenza.dev/docs/rules/kq031) | error | A database server replica is of a database server in its own Environment. | | [KQ032](https://kanoniq.extenza.dev/docs/rules/kq032) | error | A Storage is hosted on a database server or a storage account, if on anything. | | [KQ033](https://kanoniq.extenza.dev/docs/rules/kq033) | error | Plateaus line up one after another, in a single sequence. | | [KQ034](https://kanoniq.extenza.dev/docs/rules/kq034) | error | Each dated plateau is later than the dated plateaus before it. | | [KQ035](https://kanoniq.extenza.dev/docs/rules/kq035) | error | The first plateau adds, removes, moves and restates nothing. | | [KQ036](https://kanoniq.extenza.dev/docs/rules/kq036) | error | A removal or a move names something the plateau before holds. | | [KQ037](https://kanoniq.extenza.dev/docs/rules/kq037) | error | A path that once was an element's is never another element's in a later plateau. | | [KQ038](https://kanoniq.extenza.dev/docs/rules/kq038) | error | A move puts an element where no other element has its Code. | | [KQ039](https://kanoniq.extenza.dev/docs/rules/kq039) | error | A plateau removes nothing a remaining relationship still uses. | | [KQ040](https://kanoniq.extenza.dev/docs/rules/kq040) | error | A Role sits in a Component or monolith that holds a user interface of its own. | | [KQ041](https://kanoniq.extenza.dev/docs/rules/kq041) | error | A Role names an Identity Provider: a Component or monolith marked idp. | | [KQ042](https://kanoniq.extenza.dev/docs/rules/kq042) | error | A Role's Identity Provider holds an Identity of the Role's persona, so someone can hold the Role. | | [KQ043](https://kanoniq.extenza.dev/docs/rules/kq043) | error | An Identity sits in a Component or monolith marked idp. | | [KQ045](https://kanoniq.extenza.dev/docs/rules/kq045) | error | Only a Component, or a monolith with nothing inside it, marks a realization primary, and on one realization at most. | | [KQ046](https://kanoniq.extenza.dev/docs/rules/kq046) | error | A Component that realizes into several Domains marks the realization into its own primary, and one that realizes into one Domain marks none. | | [KQ047](https://kanoniq.extenza.dev/docs/rules/kq047) | error | A data migration is declared in a plateau after the initial one. | | [KQ048](https://kanoniq.extenza.dev/docs/rules/kq048) | error | Each change of a Domain Object's authoritative holding is covered by exactly one data migration of its plateau. | | [KQ049](https://kanoniq.extenza.dev/docs/rules/kq049) | error | A data migration covers only Data Entities its plateau adds, removes or restates. | | [KQ050](https://kanoniq.extenza.dev/docs/rules/kq050) | error | A data migration starts and is due between the dates of the plateau before and the plateau it delivers, and starts before it is due. | | [KQ051](https://kanoniq.extenza.dev/docs/rules/kq051) | error | A data migration's link is an absolute http or https URL, or the path of a page file in the repository. | | [KQ052](https://kanoniq.extenza.dev/docs/rules/kq052) | error | Only a Domain, a Function Group or a Function realizes a Goal or an impact, and only a Function Group a value stream stage. | | [KQ053](https://kanoniq.extenza.dev/docs/rules/kq053) | error | An influence runs from an Assessment or a Value to a Driver, or from a Driver or an impact to a Goal, and a value stream delivers a Value. | | [KQ054](https://kanoniq.extenza.dev/docs/rules/kq054) | error | An influence and a value delivery stay inside one Ecosystem. | | [KQ055](https://kanoniq.extenza.dev/docs/rules/kq055) | error | A value stream's stages are numbered 1, 2, 3 and on, each number once. | | [KQ056](https://kanoniq.extenza.dev/docs/rules/kq056) | error | An element's motivation holds at most one purpose. | | [KQ057](https://kanoniq.extenza.dev/docs/rules/kq057) | error | A value stream stage is realized by a Function Group, never by a Domain or a Function. | | [KQ058](https://kanoniq.extenza.dev/docs/rules/kq058) | error | An open property is declared in the repository's settings, for the element type it is written on. | | [KQ059](https://kanoniq.extenza.dev/docs/rules/kq059) | error | An open property's value, and each value of a list, is of the type its declaration gives it. | | [KQ060](https://kanoniq.extenza.dev/docs/rules/kq060) | error | A connection's authentication scheme is one its protocol or broker accepts. | | [KQ061](https://kanoniq.extenza.dev/docs/rules/kq061) | error | via goes only with a scheme whose token someone issues. | | [KQ062](https://kanoniq.extenza.dev/docs/rules/kq062) | error | via names an Identity Provider: a Component or monolith marked idp. | | [KQ063](https://kanoniq.extenza.dev/docs/rules/kq063) | error | Two statements of one leg into or out of a Channel state the same scheme. | | [KQ064](https://kanoniq.extenza.dev/docs/rules/kq064) | error | A workload identity names an Identity Provider: a Component or monolith marked idp. | | [KQ065](https://kanoniq.extenza.dev/docs/rules/kq065) | error | App roles and scopes are declared in a server workload identity, never a client one. | | [KQ066](https://kanoniq.extenza.dev/docs/rules/kq066) | error | Only a client workload identity states a credential. | | [KQ067](https://kanoniq.extenza.dev/docs/rules/kq067) | error | A credential is stored in a vault element. | | [KQ068](https://kanoniq.extenza.dev/docs/rules/kq068) | error | A federated credential comes from an Identity Provider: a Component marked idp. | | [KQ069](https://kanoniq.extenza.dev/docs/rules/kq069) | error | A call's authentication scheme is one the caller's credential can produce. | | [KQ070](https://kanoniq.extenza.dev/docs/rules/kq070) | error | A call on behalf of a user rests on a delegated scope granted on the API it calls. | | [KQ071](https://kanoniq.extenza.dev/docs/rules/kq071) | error | A Component or monolith marked anonymous holds no Role. | | [KQ072](https://kanoniq.extenza.dev/docs/rules/kq072) | error | Only a Component or monolith that holds a user interface of its own is marked anonymous. | | [KQ073](https://kanoniq.extenza.dev/docs/rules/kq073) | error | An Identity Provider is never marked anonymous. | | [KQ074](https://kanoniq.extenza.dev/docs/rules/kq074) | error | Every clause of a policy names an aspect or a selector Kanoniq knows, or a property the repository declares, and lists only values that clause takes. | | [KQ075](https://kanoniq.extenza.dev/docs/rules/kq075) | error | A policy names each clause once, listing several values in one clause. | | [KQ076](https://kanoniq.extenza.dev/docs/rules/kq076) | error | Some subject, a call, a leg, a sync, a grant or a workload identity, can match every clause of a policy. | | [KQ077](https://kanoniq.extenza.dev/docs/rules/kq077) | error | An exemption lifts a policy from an element, a call, a leg, a sync or a grant. | | [KQ078](https://kanoniq.extenza.dev/docs/rules/kq078) | error | No policy set of an Ecosystem shares its Code with a policy set of the model, the two default sets aside. | | [KQ079](https://kanoniq.extenza.dev/docs/rules/kq079) | error | A job holds no Interface, declared or created by a connection. | | [KQ080](https://kanoniq.extenza.dev/docs/rules/kq080) | error | No delivery out of a Channel lands on a job. | | [KQ081](https://kanoniq.extenza.dev/docs/rules/kq081) | error | A schedule names a known time zone, a time of day, a day of the month from 1 to 31, each weekday once, and a cron expression of five standard fields. | | [KQ082](https://kanoniq.extenza.dev/docs/rules/kq082) | error | A robot holds no Interface, declared or created by a connection. | | [KQ083](https://kanoniq.extenza.dev/docs/rules/kq083) | error | A connection over ui comes only from a robot or a Role. | | [KQ084](https://kanoniq.extenza.dev/docs/rules/kq084) | error | A connection over ui lands only on a declared user-facing Interface. | | [KQ085](https://kanoniq.extenza.dev/docs/rules/kq085) | error | A Role's connection over ui lands only on a user-facing Interface of the Role's own application. | | [KQ086](https://kanoniq.extenza.dev/docs/rules/kq086) | error | The environment line of a part that runs, other than a client, a workload identity, a network, a DNS record or a certificate, states its number of instances. | | [KQ087](https://kanoniq.extenza.dev/docs/rules/kq087) | error | A Component or deployable module held by one that states environments states only stages its holder states. | | [KQ088](https://kanoniq.extenza.dev/docs/rules/kq088) | error | A user interface declared in its backend Component states only stages that Component runs in. | | [KQ089](https://kanoniq.extenza.dev/docs/rules/kq089) | error | A database server hosting a Storage runs only in stages the Storage's owner runs in. | | [KQ090](https://kanoniq.extenza.dev/docs/rules/kq090) | error | No policy set has a preset's Code while the repository sets a preset of its kind, and no two presets of one kind are both written out. | | [KQ091](https://kanoniq.extenza.dev/docs/rules/kq091) | error | A policy set coded as a default set, a preset or a package's set is of the kind its Code names: default-model, the baseline-model presets and threats-stated model sets, default-architecture, the baseline-architecture presets and threats-stride architecture sets. | | [KQ092](https://kanoniq.extenza.dev/docs/rules/kq092) | error | A policy in a model set is a deny whose tested clause lists only unstated, and no other clause lists it. | | [KQ093](https://kanoniq.extenza.dev/docs/rules/kq093) | error | A policy in an architecture set lists unstated in no clause. | | [KQ094](https://kanoniq.extenza.dev/docs/rules/kq094) | error | An impact's actor is a Stakeholder in the impact's own Ecosystem. | | [KQ095](https://kanoniq.extenza.dev/docs/rules/kq095) | error | A Component is in at most one bounded context, and no Domain marked bounded-context sits inside another. | | [KQ096](https://kanoniq.extenza.dev/docs/rules/kq096) | error | An Enabler Domain, and every Domain under one, is generic and states no subdomain type of its own. | | [KQ097](https://kanoniq.extenza.dev/docs/rules/kq097) | error | A delivery out of a Channel carries only events, and versions of them, that a leg into that Channel carries. | | [KQ098](https://kanoniq.extenza.dev/docs/rules/kq098) | error | A leg into a Channel carries only events its sending Component declares. | | [KQ099](https://kanoniq.extenza.dev/docs/rules/kq099) | error | A leg names a version an event declares, names a versioned event with its version, and an unversioned event with none. | | [KQ101](https://kanoniq.extenza.dev/docs/rules/kq101) | lint | A Domain Object sits in a Platform that realizes the Domain owning it. | | [KQ102](https://kanoniq.extenza.dev/docs/rules/kq102) | lint | A Channel has both a sender and a receiver. | | [KQ103](https://kanoniq.extenza.dev/docs/rules/kq103) | lint | A derived element is still named by something in the model. | | [KQ104](https://kanoniq.extenza.dev/docs/rules/kq104) | lint | A Component realizes a Domain, Function Group or Function, or sits in something that does, wherever its Ecosystem has Domains. | | [KQ106](https://kanoniq.extenza.dev/docs/rules/kq106) | lint | A Component holds a client or a server workload identity, not both. | | [KQ107](https://kanoniq.extenza.dev/docs/rules/kq107) | lint | A workload identity is the identity of one Component, in one Environment. | | [KQ108](https://kanoniq.extenza.dev/docs/rules/kq108) | lint | Components do not run as people's accounts, and people do not sign in as a service. | | [KQ109](https://kanoniq.extenza.dev/docs/rules/kq109) | lint | A client is granted a role only on an API it calls. | | [KQ110](https://kanoniq.extenza.dev/docs/rules/kq110) | lint | A credential is stored in a vault the service connects to. | | [KQ111](https://kanoniq.extenza.dev/docs/rules/kq111) | lint | Where a robot uses an application's screens, the Identity it runs as holds a Role in that application. | | [KQ112](https://kanoniq.extenza.dev/docs/rules/kq112) | lint | A core Domain is realized by at least some custom-built software, not by SaaS or off-the-shelf products alone. | | [KQ113](https://kanoniq.extenza.dev/docs/rules/kq113) | lint | A generic Domain, an Enabler Domain aside, is realized by SaaS or off-the-shelf products, not by custom-built software. | | [KQ114](https://kanoniq.extenza.dev/docs/rules/kq114) | lint | The Component publishing an event holds a Data Entity of the Domain Object the event is about. | | [KQ115](https://kanoniq.extenza.dev/docs/rules/kq115) | lint | Some delivery out of a Channel or some sync carries each event, and each version of one. | | [KQ116](https://kanoniq.extenza.dev/docs/rules/kq116) | lint | The Component handling a command or a query holds a Data Entity of the Domain Object it is about. | | [KQ117](https://kanoniq.extenza.dev/docs/rules/kq117) | lint | Some connection or some sync carries each command and query, and each version of one. | | [KQ118](https://kanoniq.extenza.dev/docs/rules/kq118) | lint | A message a sync carries is about the Domain Object its replica represents. | | [KQ119](https://kanoniq.extenza.dev/docs/rules/kq119) | lint | A flow node of a process is reached by then from one of its start events. | | [KQ120](https://kanoniq.extenza.dev/docs/rules/kq120) | lint | In an Ecosystem with job roles, every Role of an internal persona in its applications and its Identity Providers is held by a job role. | | [KQ121](https://kanoniq.extenza.dev/docs/rules/kq121) | lint | Some call names each version of a software-facing Interface. | | [KQ122](https://kanoniq.extenza.dev/docs/rules/kq122) | lint | A provider-run service reached in a network by a private endpoint has a private DNS record pointing at it, unless its provider resolves the name itself. | | [KQ123](https://kanoniq.extenza.dev/docs/rules/kq123) | lint | A run element that is not retired, phasing out or meant to be replaced, migrated or retired does not reach the end of its extended support or its contract within the repository's warning period, nor does a contract unless all it covers is so answered. | | [KQ124](https://kanoniq.extenza.dev/docs/rules/kq124) | lint | A Domain Object one of whose Data Entities marks a property personal states personal-data, personal or special-category. | | [KQ126](https://kanoniq.extenza.dev/docs/rules/kq126) | lint | A Domain Object a data use names states personal-data, personal or special-category. | | [KQ127](https://kanoniq.extenza.dev/docs/rules/kq127) | lint | In an Ecosystem with a data use, every Data Entity of personal or special-category data is a holding or a copy of a data use. | | [KQ128](https://kanoniq.extenza.dev/docs/rules/kq128) | lint | A data use states its basis, one of GDPR Art. 6(1)'s lawful bases. | | [KQ129](https://kanoniq.extenza.dev/docs/rules/kq129) | lint | In an Ecosystem with a contract, every saas or cots Component or monolith is covered by a contract, a Component in a covered monolith counting as covered. | | [KQ130](https://kanoniq.extenza.dev/docs/rules/kq130) | lint | A contract supporting a critical Function states its ends and its notice. | | [KQ131](https://kanoniq.extenza.dev/docs/rules/kq131) | lint | A contract supports a Function: something it covers realizes one, or it names one with via. | | [KQ132](https://kanoniq.extenza.dev/docs/rules/kq132) | lint | In a framework the repository's frameworks setting follows, every requirement the model can check is served by a policy in effect, a preset the settings name included. | | [KQ134](https://kanoniq.extenza.dev/docs/rules/kq134) | lint | In an Ecosystem with two or more legal entities, every Platform and monolith names with for the entities or branches whose work it does. | | [KQ135](https://kanoniq.extenza.dev/docs/rules/kq135) | lint | A supplier's is names an Ecosystem holding at most one legal entity; where it holds several, is names the legal entity by path. | | [KQ136](https://kanoniq.extenza.dev/docs/rules/kq136) | lint | A branch is in another country than its legal entity's headquarters. | | [KQ137](https://kanoniq.extenza.dev/docs/rules/kq137) | lint | Personal data a call, a leg, a sync or a holding's own hop moves out of a residency stating adequate, to a country outside that list, goes where a contract covering what receives it states a transfer ground. | | [KQ138](https://kanoniq.extenza.dev/docs/rules/kq138) | lint | Personal data moved from inside a residency stating adequate goes to a place whose country is stated. | | [KQ200](https://kanoniq.extenza.dev/docs/rules/kq200) | error | What an event is about is a Domain Object. | | [KQ201](https://kanoniq.extenza.dev/docs/rules/kq201) | error | A call or a delivery carries only commands and queries the Component it reaches declares, and a leg into a Channel only those some Component declares. | | [KQ202](https://kanoniq.extenza.dev/docs/rules/kq202) | error | A connection names a version a command or a query declares, names a versioned one with its version, and an unversioned one with none. | | [KQ203](https://kanoniq.extenza.dev/docs/rules/kq203) | error | What a command or a query is about is a Domain Object. | | [KQ204](https://kanoniq.extenza.dev/docs/rules/kq204) | error | A context states conforms-to or customer-of only toward a context the edges put upstream of it. | | [KQ205](https://kanoniq.extenza.dev/docs/rules/kq205) | error | A context does not state both conforms-to and customer-of toward one context. | | [KQ206](https://kanoniq.extenza.dev/docs/rules/kq206) | error | A context does not state conforms-to toward a context whose every crossing to it goes through an anticorruption layer. | | [KQ207](https://kanoniq.extenza.dev/docs/rules/kq207) | error | A relationship other than separate-ways joins two contexts something crosses between. | | [KQ208](https://kanoniq.extenza.dev/docs/rules/kq208) | error | Nothing crosses between two contexts stated separate-ways. | | [KQ209](https://kanoniq.extenza.dev/docs/rules/kq209) | error | A partnership, a shared kernel or separate ways is stated in one of its two contexts, not both. | | [KQ210](https://kanoniq.extenza.dev/docs/rules/kq210) | error | A context relationship is written in an element marked bounded-context and names another one. | | [KQ211](https://kanoniq.extenza.dev/docs/rules/kq211) | error | An Interface or a Channel marked published-language is marked open-host. | | [KQ212](https://kanoniq.extenza.dev/docs/rules/kq212) | error | A crossing whose downstream end is an integration Component states no acl. | | [KQ213](https://kanoniq.extenza.dev/docs/rules/kq213) | error | An element marked big-ball-of-mud is marked bounded-context. | | [KQ214](https://kanoniq.extenza.dev/docs/rules/kq214) | error | A sync carries only events its source Component declares. | | [KQ215](https://kanoniq.extenza.dev/docs/rules/kq215) | error | A sync carries only commands the Component holding the replica declares. | | [KQ216](https://kanoniq.extenza.dev/docs/rules/kq216) | error | A sync carries only queries its source Component declares. | | [KQ217](https://kanoniq.extenza.dev/docs/rules/kq217) | error | A sync carrying a query goes over a protocol, never through a Channel. | | [KQ218](https://kanoniq.extenza.dev/docs/rules/kq218) | error | A sync carries messages or one mechanism, never both, and never two mechanisms. | | [KQ219](https://kanoniq.extenza.dev/docs/rules/kq219) | error | Of the syncs into an entity, exactly one is not marked reconcile. | | [KQ220](https://kanoniq.extenza.dev/docs/rules/kq220) | error | No two syncs into one entity have the same source, the same route and the same carries. | | [KQ221](https://kanoniq.extenza.dev/docs/rules/kq221) | error | Every flow node but an external step sits in one of its process's lanes. | | [KQ222](https://kanoniq.extenza.dev/docs/rules/kq222) | error | A process's lane names a job role of the process's own Ecosystem. | | [KQ223](https://kanoniq.extenza.dev/docs/rules/kq223) | error | A then joins two flow nodes of one process, neither an external step, never into a start event or out of an end event. | | [KQ224](https://kanoniq.extenza.dev/docs/rules/kq224) | error | A message flow joins a node in a lane to a pool or one of its external steps, received by a start event or a task and sent by an end event or a task. | | [KQ225](https://kanoniq.extenza.dev/docs/rules/kq225) | error | A task's on names a user-facing Interface of an application that realizes the Function the task performs. | | [KQ226](https://kanoniq.extenza.dev/docs/rules/kq226) | error | A task done on a screen sits in the lane of a job role holding a Role in that screen's application that uses it. | | [KQ227](https://kanoniq.extenza.dev/docs/rules/kq227) | error | Every connection a message flow travels over is a connection of the model. | | [KQ228](https://kanoniq.extenza.dev/docs/rules/kq228) | error | Each connection a message travels over starts where the one before it landed. | | [KQ229](https://kanoniq.extenza.dev/docs/rules/kq229) | error | A message a task sends starts, and one it receives lands, at one of the task's systems. | | [KQ230](https://kanoniq.extenza.dev/docs/rules/kq230) | error | A message to a pool that says where its systems are lands there, and one from it starts there. | | [KQ231](https://kanoniq.extenza.dev/docs/rules/kq231) | error | Every Function a task performs lies under a Function Group realizing the stage its process details. | | [KQ232](https://kanoniq.extenza.dev/docs/rules/kq232) | error | A pool's persona is external, and its `site` names an Ecosystem, a Platform or a monolith. | | [KQ233](https://kanoniq.extenza.dev/docs/rules/kq233) | error | A job role's persona is an employee or a freelancer. | | [KQ234](https://kanoniq.extenza.dev/docs/rules/kq234) | error | A job role holds only Roles of its own persona. | | [KQ237](https://kanoniq.extenza.dev/docs/rules/kq237) | error | Every Domain Object a data mark names is in its node's Data: a task's, of the Domains holding its Function; a start event's, of the stage its process details. | | [KQ238](https://kanoniq.extenza.dev/docs/rules/kq238) | error | Every Domain Object a data mark names is held, not as a replica, in exactly one Storage of its node's systems. | | [KQ239](https://kanoniq.extenza.dev/docs/rules/kq239) | error | Only a task, or a start event receiving a message over a chain, is marked data. | | [KQ240](https://kanoniq.extenza.dev/docs/rules/kq240) | error | Every connection a scenario's step walks over, and both legs of a hop through a Channel, is a connection of the model. | | [KQ241](https://kanoniq.extenza.dev/docs/rules/kq241) | error | Each step of a scenario starts where the scenario starts or where an earlier step arrived. | | [KQ242](https://kanoniq.extenza.dev/docs/rules/kq242) | error | A step's message is carried by its connection, or by both legs of a hop, under a version the message declares. | | [KQ243](https://kanoniq.extenza.dev/docs/rules/kq243) | error | A scenario for a task starts at the task's screen or at one of its systems. | | [KQ244](https://kanoniq.extenza.dev/docs/rules/kq244) | error | A scenario sits directly in the Ecosystem of its first step's source. | | [KQ245](https://kanoniq.extenza.dev/docs/rules/kq245) | error | What a scenario is for is a task, a user task or a service task of a process. | | [KQ246](https://kanoniq.extenza.dev/docs/rules/kq246) | error | An access joins a Component of a monolith to a data entity in a Storage the same monolith holds itself. | | [KQ247](https://kanoniq.extenza.dev/docs/rules/kq247) | error | An access names the root of an aggregate, or a data entity in no aggregate, never a part. | | [KQ248](https://kanoniq.extenza.dev/docs/rules/kq248) | error | A user-facing Interface states no schema and no versions. | | [KQ249](https://kanoniq.extenza.dev/docs/rules/kq249) | error | A call names a version its Interface declares, calls a versioned Interface with its version, and an unversioned one with none. | | [KQ250](https://kanoniq.extenza.dev/docs/rules/kq250) | error | A provider-run service of a product that cannot be public states the network it is in. | | [KQ251](https://kanoniq.extenza.dev/docs/rules/kq251) | error | Every part a product word requires is named: its network with in, its storage account with uses, its origin with forwards-to, its certificate by served-by. | | [KQ252](https://kanoniq.extenza.dev/docs/rules/kq252) | error | The gateway a call goes via publishes the Interface the call lands on, unless it is a NAT the call leaves by. | | [KQ253](https://kanoniq.extenza.dev/docs/rules/kq253) | error | The pool a Storage names is inside the database server it is hosted on. | | [KQ254](https://kanoniq.extenza.dev/docs/rules/kq254) | error | A credential or a certificate is stored in a vault whose kind holds secrets or certificates. | | [KQ255](https://kanoniq.extenza.dev/docs/rules/kq255) | error | Via names a gateway, backup a backup vault, covers a stage of the service's own Ecosystem, and a certificate's stored-in a vault and served-by what can serve one. | | [KQ256](https://kanoniq.extenza.dev/docs/rules/kq256) | error | A storage account of a bucket product holds exactly one Storage. | | [KQ257](https://kanoniq.extenza.dev/docs/rules/kq257) | error | A Storage on a storage account is of a kind that account's product holds. | | [KQ258](https://kanoniq.extenza.dev/docs/rules/kq258) | error | Only a user-facing client is deployed on a storage account, a static site served from it. | | [KQ259](https://kanoniq.extenza.dev/docs/rules/kq259) | error | What a part runs on, and what an infrastructure element runs on, is in and uses, is in the same stage, a registry aside, and a link joins two networks of one stage. | | [KQ260](https://kanoniq.extenza.dev/docs/rules/kq260) | error | A DNS record in a private zone states the network its zone is linked to. | | [KQ261](https://kanoniq.extenza.dev/docs/rules/kq261) | error | A platform service of a generic kind states paas or on the host it runs on. | | [KQ262](https://kanoniq.extenza.dev/docs/rules/kq262) | error | A platform service of a provider's product word states no paas, states on only after a self-run word, and states it after one. | | [KQ263](https://kanoniq.extenza.dev/docs/rules/kq263) | error | Nothing that is not retired is deployed, hosted or installed on a retired element, uses it or calls it, and no Component that is not retired is held in a retired monolith. | | [KQ264](https://kanoniq.extenza.dev/docs/rules/kq264) | error | An element that is phasing out does not have a future of invest. | | [KQ265](https://kanoniq.extenza.dev/docs/rules/kq265) | error | A successor is named only with a future of replace or migrate, is of the same type as the element, or a Component for a monolith and a monolith for a Component, and is not the element itself. | | [KQ266](https://kanoniq.extenza.dev/docs/rules/kq266) | error | An installation names the Host it is installed on, and only a Host. | | [KQ267](https://kanoniq.extenza.dev/docs/rules/kq267) | error | An element's end of extended support is not before its end of mainstream support. | | [KQ268](https://kanoniq.extenza.dev/docs/rules/kq268) | error | A run element that is not retired, phasing out or meant to be replaced, migrated or retired does not reach the end of its extended support or its contract within the repository's error period, nor past it, nor does a contract unless all it covers is so answered. | | [KQ269](https://kanoniq.extenza.dev/docs/rules/kq269) | error | A software-facing Interface or a Broker stated in-transit plaintext does not serve a certificate, is not of a transport that takes no plaintext, and is not reached with auth certificate. | | [KQ270](https://kanoniq.extenza.dev/docs/rules/kq270) | error | in-transit is stated on a software-facing Interface other than an ipc-api, or on a Broker, and nowhere else. | | [KQ271](https://kanoniq.extenza.dev/docs/rules/kq271) | error | A name used in a value's place is a constant written on the model, or on the element the value is written on or in, or on one that holds it. | | [KQ272](https://kanoniq.extenza.dev/docs/rules/kq272) | error | A constant used in a bound is a period or a number in the unit its clause takes; as quoted text, a string; in a period's place, a period; as an open property's value, its declared type's. | | [KQ273](https://kanoniq.extenza.dev/docs/rules/kq273) | error | A constant's name is defined once in the whole model, never again at another level. | | [KQ274](https://kanoniq.extenza.dev/docs/rules/kq274) | error | A constant's name is capitals, digits and underscores, starting with a capital, and is neither a stage nor shaped as a period, so a value is never ambiguous. | | [KQ275](https://kanoniq.extenza.dev/docs/rules/kq275) | error | A Domain Object's confidentiality is one of the levels the repository's confidentiality-levels setting lists. | | [KQ276](https://kanoniq.extenza.dev/docs/rules/kq276) | error | No property is marked personal on a Data Entity of a Domain Object stated personal-data none. | | [KQ277](https://kanoniq.extenza.dev/docs/rules/kq277) | error | No Domain Object a data use names is stated personal-data none. | | [KQ278](https://kanoniq.extenza.dev/docs/rules/kq278) | error | Every Domain Object a data use names is represented by a Data Entity in a Storage of a system realizing what its via names. | | [KQ279](https://kanoniq.extenza.dev/docs/rules/kq279) | error | A data use naming special-category data states special, the condition it is processed under. | | [KQ280](https://kanoniq.extenza.dev/docs/rules/kq280) | error | A data use states special only where it names special-category data. | | [KQ281](https://kanoniq.extenza.dev/docs/rules/kq281) | error | What a data use's via names is in the data use's own Ecosystem. | | [KQ282](https://kanoniq.extenza.dev/docs/rules/kq282) | error | A data use's joint names other Ecosystems, never its own. | | [KQ284](https://kanoniq.extenza.dev/docs/rules/kq284) | error | What a contract covers is in its own Ecosystem, or in the Ecosystem its supplier is, directly or through a legal entity. | | [KQ285](https://kanoniq.extenza.dev/docs/rules/kq285) | error | What a contract's via names is in the contract's own Ecosystem. | | [KQ286](https://kanoniq.extenza.dev/docs/rules/kq286) | error | An element a contract covers states no contract-end; it reads its contracts' ends. | | [KQ287](https://kanoniq.extenza.dev/docs/rules/kq287) | error | A contract's ends is not before its starts. | | [KQ288](https://kanoniq.extenza.dev/docs/rules/kq288) | error | Each subcontractor names another supplier of the Ecosystem than the contract's own, once, under its supplier or one in its chain, and the chain reaches the contract's supplier. | | [KQ289](https://kanoniq.extenza.dev/docs/rules/kq289) | error | A supplier's parent is another supplier of its Ecosystem, and parents form no cycle. | | [KQ290](https://kanoniq.extenza.dev/docs/rules/kq290) | error | A supplier's is names another Ecosystem than the one it is declared in, or a legal entity of another. | | [KQ291](https://kanoniq.extenza.dev/docs/rules/kq291) | error | A supplier's or a legal entity's lei is 18 capitals or digits and two check digits valid under ISO 7064 MOD 97-10. | | [KQ292](https://kanoniq.extenza.dev/docs/rules/kq292) | error | An element in a network that states its location states none of its own: it is where its network is. | | [KQ293](https://kanoniq.extenza.dev/docs/rules/kq293) | error | Each zone an element names is one its location has: one its region's registry entry names, or one its data center declares. | | [KQ294](https://kanoniq.extenza.dev/docs/rules/kq294) | error | An element names the zones it spans or says its provider spreads it with zone-redundant, never both. | | [KQ295](https://kanoniq.extenza.dev/docs/rules/kq295) | error | A part that states one stage on several environment lines names what it runs on on each, a different host or platform on each. | | [KQ296](https://kanoniq.extenza.dev/docs/rules/kq296) | error | A policy or a policy set lists each requirement it serves once. | | [KQ297](https://kanoniq.extenza.dev/docs/rules/kq297) | error | A Domain Object's or a significant property's regulated scope is one the repository's regulated-scopes setting lists. | | [KQ298](https://kanoniq.extenza.dev/docs/rules/kq298) | error | A legal entity's parent is another legal entity, in any Ecosystem, and parents form no cycle. | | [KQ299](https://kanoniq.extenza.dev/docs/rules/kq299) | error | No two legal entities of the model state one lei. | | [KQ400](https://kanoniq.extenza.dev/docs/rules/kq400) | error | What a Platform's or a monolith's for names is a legal entity or a branch of its own Ecosystem. | | [KQ401](https://kanoniq.extenza.dev/docs/rules/kq401) | error | A contract's signed-by names a legal entity of the Ecosystem it is declared in. | | [KQ402](https://kanoniq.extenza.dev/docs/rules/kq402) | error | In an Ecosystem with two or more legal entities, every contract states signed-by. | | [KQ403](https://kanoniq.extenza.dev/docs/rules/kq403) | error | A supplier whose is names a legal entity states no lei and no headquarters: it reads both from the entity. | | [KQ404](https://kanoniq.extenza.dev/docs/rules/kq404) | error | A subject's memberships are runs that neither overlap nor touch, and only a relationship whose Id is its ends has more than one. | | [KQ405](https://kanoniq.extenza.dev/docs/rules/kq405) | error | A ground a contract's transfer clause lists is listed once. | | [KQ406](https://kanoniq.extenza.dev/docs/rules/kq406) | error | A constant a use names is alive in every plateau the policy, the element or the relationship holding the use is alive in. | ## Read more - https://kanoniq.extenza.dev/docs/llms.txt: an index of the documentation, every page as Markdown. - https://kanoniq.extenza.dev/docs/llms-full.txt: the language reference, the rules and this brief, in one file. --- Source: https://kanoniq.extenza.dev/docs/language.md # Language areas The language groups everything it can say into areas: why the organization does what it does, what it does, the systems that do it, the data they hold, who reaches them, where they run and how all of it changes. Each element type, each relationship and each group of rules belongs to exactly one area, so you can read one area's worth of the language at a time. Each area's page says what its elements mean and how to write them; what each rule asks is in [Validation](https://kanoniq.extenza.dev/docs/rules.md). ## Motivation and strategy Say why the organization does what it does, the impacts it counts on and the value it delivers. - **Elements:** Stakeholder, Driver, Assessment, Goal, Impact, Principle, Value, Purpose, Value Stream, Value Stream Stage - **Relationships:** Influence, Value Delivery - **Rules:** [Motivation and strategy](https://kanoniq.extenza.dev/docs/rules.md#motivation-and-strategy) ## Business functions Say what the organization does, in Domains and their functions. - **Elements:** Ecosystem, Domain, Function Group, Function - **Rules:** [Domains](https://kanoniq.extenza.dev/docs/rules.md#domains) ## Processes Write a business process as BPMN and see it drawn in lanes. - **Elements:** Process, Pool, Flow Node - **Relationships:** Lane, Sequence Flow, Message Flow - **Rules:** [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) ## Domain-driven design Mark subdomain types and bounded contexts, and see the context map they make. - **Relationships:** Context Relationship - **Rules:** [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) ## Applications Say which systems realize which functions, and what they offer. - **Elements:** Platform, Monolith, Module, Component, Interface - **Relationships:** Realization - **Rules:** [Realization](https://kanoniq.extenza.dev/docs/rules.md#realization), [Monoliths](https://kanoniq.extenza.dev/docs/rules.md#monoliths), [Jobs, robots and screens](https://kanoniq.extenza.dev/docs/rules.md#jobs-robots-and-screens) ## Integration Say how systems reach each other and what travels between them. - **Elements:** Channel, Broker, Event, Command, Query, Scenario - **Relationships:** Connection, Sync - **Rules:** [Connections](https://kanoniq.extenza.dev/docs/rules.md#connections), [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries), [Scenarios](https://kanoniq.extenza.dev/docs/rules.md#scenarios) ## Data Say what data the organization holds and how it moves. - **Rules:** [Data](https://kanoniq.extenza.dev/docs/rules.md#data) ### Data structure Say where each piece of data is held, who is its authority and how it is shaped. - **Elements:** Storage, Domain Object, Data Entity - **Relationships:** Representation, Domain Ownership, Part Of, Reference, Access, Replication ### Data use Say why personal data is processed and on what legal ground, and see where it goes. - **Elements:** Data Use ## Identity and access Say who signs in where, and with which role. - **Elements:** Identity, Role, Workload Identity, Permission, Job Role - **Relationships:** Grant, Runs As, Used By, Holds - **Rules:** [Authentication](https://kanoniq.extenza.dev/docs/rules.md#authentication), [People](https://kanoniq.extenza.dev/docs/rules.md#people), [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) ## Technology Say where each system runs and what hosts its data. - **Elements:** Environment, Database Server, Data Center, Network, Host, Installation, App Platform, Db Pool, Gateway, Dns, Certificate, Storage Account, Vault, Registry, Repository, Ai Platform, Model Deployment, Backup Vault, Security Service - **Relationships:** Deployment, Hosting, Link - **Rules:** [Environments and database servers](https://kanoniq.extenza.dev/docs/rules.md#environments-and-database-servers), [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure), [Life cycle](https://kanoniq.extenza.dev/docs/rules.md#life-cycle) ### Suppliers and contracts Say who supplies what runs, under which contract, and which functions are critical. - **Elements:** Supplier, Contract, Legal Entity, Branch - **Rules:** [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) ## Change over time Say how the landscape changes, plateau by plateau. - **Elements:** Plateau, Data Migration - **Relationships:** Succession, Existence, Addition, Removal, Move, Delivery, Coverage - **Rules:** [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) ## Governance State the organization's architecture rules and the exemptions it grants. - **Elements:** Policy Set, Policy, Constant - **Relationships:** Exemption - **Rules:** [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) ## Language basics Ids, codes, files and what every statement shares. - **Relationships:** Containment, Property Link - **Rules:** [Structure](https://kanoniq.extenza.dev/docs/rules.md#structure), [Splitting a model](https://kanoniq.extenza.dev/docs/rules.md#splitting-a-model), [Open properties](https://kanoniq.extenza.dev/docs/rules.md#open-properties) © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/motivation-and-strategy.md # Motivation and strategy Say why the organization does what it does, the impacts it counts on and the value it delivers. ## The motivation elements Why the organization does what it does, and what it delivers. Nothing here runs: each element is a fact about the one organization that holds it, so it sits in that organization's ecosystem and never spans two. Within the ecosystem it belongs to the element it concerns: the ecosystem itself, or a domain, a platform, a monolith, a module or a component, written in that element's motivation block (see [Writing motivation and strategy](#writing-motivation-and-strategy)). | Motivation element | Drawn as | Use it for | | --- | --- | --- | | **Stakeholder** | Listed on the landscape page, not drawn | A party with an interest, `internal` or `external`: *riders*, *a regulator* | | **Driver** | ![Driver](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/driver-light.svg#light)![Driver](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/driver-dark.svg#dark) | What pushes the organization to change, in a tree of drivers, with the organization's own code in brackets: *Climate (ENV-1)* | | **Assessment** | ![Assessment](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/assessment-light.svg#light)![Assessment](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/assessment-dark.svg#dark) | A finding, in a tree of findings, each a `strength`, `weakness`, `opportunity` or `threat`, optionally `rising`, `falling` or `mixed` | | **Goal** | ![Goal](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/goal-light.svg#light)![Goal](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/goal-dark.svg#dark) | A commitment, in a tree of goals: *a zero-emission fleet* | | **Impact** | ![Impact](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/impact-light.svg#light)![Impact](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/impact-dark.svg#dark) On its goal's [impact map](https://kanoniq.extenza.dev/docs/views/impact-map.md) | A change in one stakeholder's behavior that serves your goals, `on` that stakeholder: *travellers buy on the app, not at the window*. ArchiMate calls it an outcome | | **Principle** | Listed on the landscape page, not drawn | A rule the organization set itself, its statement written as its description; group principles under a parent principle | | **Value** | ![Value](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/value-light.svg#light)![Value](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/value-dark.svg#dark) | Worth to someone: a core value the organization holds, or what a value stream delivers | | **Purpose** | The [motivation view](https://kanoniq.extenza.dev/docs/views/motivation.md)'s header, for the ecosystem's own | What the organization, or the element holding it, is for, its text as its description. One per element at most ([KQ056](https://kanoniq.extenza.dev/docs/rules/kq056.md)) | | **Value stream** | ![Value stream](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/value-stream-light.svg#light)![Value stream](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/value-stream-dark.svg#dark) | How the organization delivers value, `main-stream` or `support-stream`, made of numbered **value stream stages** | | **Value stream stage** | ![Value stream stage](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/value-stream-stage-light.svg#light)![Value stream stage](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/value-stream-stage-dark.svg#dark) | One step of its value stream, numbered: *1. Plan a journey*, *2. Buy a ticket* | **Influences form a chain**: an assessment or a value influences a driver, and a driver influences a goal, optionally with a strength ([KQ053](https://kanoniq.extenza.dev/docs/rules/kq053.md)). An impact influences a goal too, for it or against it. **A value stream delivers values.** **The function side realizes goals, value stream stages and impacts**: a domain, function group or function contributes to a goal or causes an impact, and a function group carries a value stream stage, only a function group ([KQ057](https://kanoniq.extenza.dev/docs/rules/kq057.md)). Only the function side does any of these ([KQ052](https://kanoniq.extenza.dev/docs/rules/kq052.md)); a component reaches a goal, a stage or an impact through the functions it realizes. **An impact's actor is a stakeholder of its own ecosystem** ([KQ094](https://kanoniq.extenza.dev/docs/rules/kq094.md)), named with `on`: one actor per impact, so a change in two parties' behavior is two impacts. A role or an identity is never an actor: they say how a person signs in, and the party a goal depends on, a regulator or a partner, often has no account. A value stream stage's number is its order, 1, 2, 3 and on, each once ([KQ055](https://kanoniq.extenza.dev/docs/rules/kq055.md)). There is no requirement or constraint, and no Business Model Canvas: a canvas is a layout over these elements. The [motivation view](https://kanoniq.extenza.dev/docs/views/motivation.md) draws an ecosystem's assessments, values, drivers and goals, with what realizes the goals, the [value-stream view](https://kanoniq.extenza.dev/docs/views/value-stream.md) draws one value stream: what it delivers, its stages in order, and the function groups carrying each, and the [impact map](https://kanoniq.extenza.dev/docs/views/impact-map.md) draws one goal: the impacts on it by stakeholder, what causes each, and what builds that. ## Writing motivation and strategy ```kanoniq ecosystem bikes "City Bikes" { domain renting "Renting" { function-group unlocking "Unlocking" { function unlock-bike "Unlock a bike" } motivation { goal fast-unlock "Unlock in five seconds" impact app-unlocks "Riders unlock with the app" on riders app-unlocks influences fast-unlock [+] unlocking/unlock-bike realizes fast-unlock unlocking/unlock-bike realizes app-unlocks } } platform app "App" { component api "API" : backend api realizes renting/unlocking/unlock-bike } motivation { /// Every rider has a safe bike within five minutes, wherever they are. purpose rides "Rides for everyone" stakeholder riders "Riders" : external stakeholder workshop "Workshop staff" : internal driver sustainability "Sustainability" (ENV) { driver climate "Climate" (ENV-1) } assessment loyal-riders "Loyal riders" : strength rising goal clean-fleet "Zero-emission fleet" principle repair-first "Repair first" value safety "Safety" value safe-ride "A safe ride" value-stream rent-a-bike "Rent a bike" : main-stream { value-stream-stage 1 find "Find a bike" value-stream-stage 2 unlock "Unlock" } loyal-riders influences sustainability/climate [+] sustainability/climate influences clean-fleet [++] rent-a-bike delivers safe-ride renting/unlocking realizes rent-a-bike/unlock } } motivation for bikes/app/api { principle stateless "Stateless" } ``` Motivation is written in a `motivation { … }` block, in an ecosystem, a domain, a platform, a monolith, a module or a component: the organization's own in the ecosystem, and what concerns one element in that element. What the block holds belongs to that element, as if written in its own block, so a goal and a function of one name in one domain clash. **`motivation for { … }`** is the same block for the element at ``, written anywhere, the path from the model's root as after `extend`. A `driver`, an `assessment`, a `goal` and a `principle` nest more of their own kind. A stakeholder states `internal` or `external`. A driver's code in brackets keeps the organization's own form, dots included: `(ENV-1.1)`. An assessment states its SWOT category, and may add `rising`, `falling` or `mixed`. A principle's statement and a purpose's text are their `///` descriptions; an element has one purpose at most. A value stream stage states its number before its code. **`impact "" on `** is a change in one actor's behavior that serves your goals, and its name says the change. `on` names the actor, a stakeholder of the impact's own ecosystem ([KQ094](https://kanoniq.extenza.dev/docs/rules/kq094.md)), found from the impact's element outward as any name in the block is, so `on riders` in the domain above names the ecosystem's riders. An impact nests nothing; a second actor is a second impact. **`influences`** runs from an assessment or a value to a driver, or from a driver or an impact to a goal, with an optional strength after the target: `[+]`, `[++]`, `[-]` or `[--]`. **`delivers`** runs from a value stream to a value. Both are written in a motivation block, the innermost one holding both ends, and a nested element is named by its path from there, as `sustainability/climate`. ## Reference The element types, relationships and kinds of this area, each with what it means. **Element types** | Element type | What it is | | --- | --- | | Stakeholder | A Stakeholder is a party with an interest in the organization, inside it or outside it. A Stakeholder is not an actor in the landscape. | | Driver | A Driver is something that moves the organization to change. A Driver may hold Drivers of its own, and influences Goals. | | Assessment | An Assessment is a finding about the organization in one SWOT category: a strength, a weakness, an opportunity or a threat. An Assessment may hold Assessments of its own, and influences Drivers. | | Goal | A Goal is a commitment of the organization. A Goal may hold Goals of its own, and is realized by the function side. | | Impact | An Impact is a change in one Stakeholder's behavior that serves the organization's goals, such as riders returning bikes to a dock. An Impact influences Goals and is realized by the function side. | | Principle | A Principle is a rule the organization sets itself, its statement being its description. A Principle holding others is the category they belong to. | | Value | A Value is worth to someone: held by the organization, or delivered by a Value Stream. | | Purpose | A Purpose is what the element holding it is for, its text being its description; in an Ecosystem, what the organization is for. An element holds at most one Purpose. | | Value Stream | A Value Stream is a sequence of stages delivering value: a stream the organization exists for, or one that supports those. | | Value Stream Stage | A Value Stream Stage is one step of its Value Stream, ordered by its number. Only a Function Group realizes a Value Stream Stage. | **Relationships** | Relationship | What it says | | --- | --- | | Influence | An Influence says one motivation element affects another, within one Ecosystem: an Assessment or a Value influencing a Driver, or a Driver or an Impact influencing a Goal. | | Value Delivery | A Value Delivery says a Value Stream delivers a Value. A Value Stream may deliver several. | **Stakeholder kind**: Whether a Stakeholder is inside the organization or outside it. | Value | Means | | --- | --- | | `internal` | A Stakeholder inside the organization. | | `external` | A Stakeholder outside the organization. | **Assessment kind**: An Assessment's SWOT category: a strength, a weakness, an opportunity or a threat. | Value | Means | | --- | --- | | `strength` | A strength of the organization. | | `weakness` | A weakness of the organization. | | `opportunity` | An opportunity the organization could take. | | `threat` | A threat to the organization. | **Trend**: Where an Assessment is heading. | Value | Means | | --- | --- | | `rising` | The assessed matter is growing. | | `falling` | The assessed matter is shrinking. | | `mixed` | The assessed matter is heading both ways at once. | **Value stream kind**: A ValueStream's kind: a stream the organization exists for, or one that supports those. | Value | Means | | --- | --- | | `main-stream` | A value stream the organization exists for. | | `support-stream` | A value stream that supports the organization's main streams. | **Influence strength**: How strongly an Influence's source affects its target, written as ArchiMate writes it. | Value | Means | | --- | --- | | `+` | A positive influence. | | `++` | A strongly positive influence. | | `-` | A negative influence. | | `--` | A strongly negative influence. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/business-functions.md # Business functions Say what the organization does, in Domains and their functions. ## Ecosystem **A company, or a division of a large one that runs itself.** It is a privacy and security boundary: one data-protection assessment covers all of it, and its technical staff administer it without crossing organizational lines. The test for whether two things belong in the same ecosystem: does one set of people administer both, under one assessment, without asking anyone's permission to cross between them? A holding company with three operating businesses has three ecosystems. A single company with a marketing and a finance department has one. Everything sits inside exactly one ecosystem, so every model has at least one, and may have several. Connections may cross ecosystems, because companies call each other. Realization may not, because a company doesn't implement another company's functions. ## The function side What the organization does, independent of any system. | Element | Drawn as | Use it for | | --- | --- | --- | | **Domain** | ![Domain](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/domain-light.svg#light)![Domain](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/domain-dark.svg#dark) | A broad area of activity: *Selling*, *Fulfilment*, *Customer*. May hold sub-domains | | **Function group** | ![Function group](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/function-group-light.svg#light)![Function group](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/function-group-dark.svg#dark) | A cluster of related functions within a domain: *Take orders* | | **Function** | ![Function](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/function-light.svg#light)![Function](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/function-dark.svg#dark) | One thing the organization does: *Place an order* | Use as many levels as the landscape needs. A small one may have only domains, or no domains at all. A domain holds either sub-domains or function groups and functions, never both: when a domain gains a sub-domain, move its functions into one. Each of the three may carry the organization's own code, as an ecosystem and a driver do: the number APQC's Process Classification Framework gives it, or any numbering the organization keeps. Kanoniq shows it as written, before the name on every box, *4.2.1 Pick orders*, and checks neither its format nor that it is unique: the numbering is the organization's. ### Enabler Domains An **Enabler Domain** is a domain marked `enabler`. It holds shared software components and shared infrastructure, such as identity, messaging or monitoring, that other domains lean on. Business capabilities never go in one, however many domains use them: *Customer* stays a domain even when everything calls it. Nothing checks this, so it is yours to keep. On a domain's layered view, a component the domain's own components call is drawn in the context, below the view, unless it realizes into an Enabler Domain. Then it is drawn in a band of its own, **Enablers**, framed by its Enabler Domain and that domain's ecosystem, so what the domain leans on reads apart from its peers. An Enabler Domain's own view shows its callers in the context, as any domain's does. Its box reads *Enabler Domain*. The **enablers** switch is on by default. Off, a domain's view leaves out the Enablers band and its lines, and an Enabler Domain's view leaves out its callers. On the command line, `kq svg --hide-enablers` turns it off. ## Writing an ecosystem ```kanoniq ecosystem shop "Northwind Retail" (SHOP) ``` The token in parentheses is the organization's own abbreviation. Optional. It is capital letters and digits, in words joined by single hyphens or dots, with at least one letter: `SHOP`, `123-DDD`, `2B` and `ENV-1.1` are abbreviations; `Shop`, `-DDD` and `123` are not. A code with no capital, such as `3.2.1`, goes in quotes instead: `("3.2.1")`. Either form goes on an ecosystem, a domain, a function group, a function or a driver, and two elements may share one. ## Domain, function group, function ```kanoniq domain selling "Selling" { function-group take-orders "Take orders" { function place-order "Place an order" } } ``` Levels may be skipped (a `function` directly in a `domain`) but not reordered. A domain holds either sub-domains or function groups and functions, never a mix. **Your organization's own code** goes in parentheses right after the name, as an [ecosystem's abbreviation](#writing-an-ecosystem) does: APQC's hierarchy number, or any numbering of your own. On a domain it comes before everything else after the name. Every view labels the box with the code before the name, `4.2.1 Pick orders`. ```kanoniq domain fulfilment "Deliver physical products" ("4") core { function-group fulfil-orders "Fulfil orders" ("4.2") { function pick-orders "Pick orders" ("4.2.1") } } ``` **`enabler` after a domain's name** makes it an Enabler Domain: one that holds shared software components or shared infrastructure, such as identity, messaging or monitoring, that other domains lean on. Business capabilities never go in one. ```kanoniq domain identity-access "Identity" enabler { function-group authenticate "Authenticate" } ``` Only a domain directly in an ecosystem can be an Enabler Domain ([KQ025](https://kanoniq.extenza.dev/docs/rules/kq025.md)). Its sub-domains are part of it without a mark of their own. Everything else about a domain applies: components realize it, and it holds function groups and functions. What changes is how it is drawn: see [Enabler Domains](#enabler-domains). **`core`, `supporting` or `generic` after a domain's name** states its subdomain type, in domain-driven design's terms: `core` where the business competes, `supporting` for what is specific to it but not what it competes on, `generic` for a solved problem every business has. It is optional and goes at any level; a sub-domain stating none takes its nearest typed parent's. An Enabler Domain is `generic` already, so a type on it or inside it is an error ([KQ096](https://kanoniq.extenza.dev/docs/rules/kq096.md)). **`bounded-context`**, last, marks a domain a bounded context: the boundary of one model and the language naming it. Every component whose primary domain is in it belongs to that context, wherever the component sits. ```kanoniq domain ordering "Ordering" core bounded-context { domain notifications "Notifications" generic } domain payroll "Payroll" generic ``` **`big-ball-of-mud`**, after `bounded-context`, says the context's model has no consistent boundaries inside it: a legacy system, often a vendor's, kept behind its boundary so the mess stays inside. It goes only on a bounded context ([KQ213](https://kanoniq.extenza.dev/docs/rules/kq213.md)), on any of the five elements that can be one. See [Subdomain types and bounded contexts](https://kanoniq.extenza.dev/docs/language/domain-driven-design.md#subdomain-types-and-bounded-contexts) for what the two marks mean and what checks them. ## Reference The element types, relationships and kinds of this area, each with what it means. **Element types** | Element type | What it is | | --- | --- | | Ecosystem | An Ecosystem is the outermost grouping of a model and its privacy and security boundary: in practice a company, or a division of one that runs itself. An Ecosystem has no parent and is never realized. | | Domain | A Domain is an area of what the organization does with IT, on the function side: in DDD's terms a subdomain, the whole problem space being the Ecosystem's function side. A Domain holds either sub-domains, or Function Groups and Functions, never both. | | Function Group | A Function Group is a group of related Functions in a Domain, on the function side. Only a Function Group realizes a Value Stream Stage. | | Function | A Function is one thing the organization does with IT, the finest level of the function side. A Function is realized by what implements it. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/processes.md # Processes Write a business process as BPMN and see it drawn in lanes. ## Business processes Below a value stream stage, the work is ordered as a **process**: BPMN written in the model, in its Descriptive subset. A process sits in a domain or the ecosystem, and may say which stage it details. Its **lanes** are job roles of its ecosystem; its **pools** are parties outside the organization, by persona, each with its **external** steps. Its **flow nodes**, tasks, start and end events and `xor` and `and` gateways, are elements of their own, each in one lane; a task names the **function** it performs, which gives it its systems and its data, and may name the screen a person does it on. **Sequence flows** order the nodes, and **message flows** exchange messages with a pool, optionally over the connections they travel on. The data a process handles is read off its tasks' functions, never written; a task may mark the domain objects it enters with `data`, which picks from that data for the stage's data-flow view. No view of the landscape draws a process; it has a view of its own. See [Writing a business process](#writing-a-business-process). ## Writing a business process A business process is BPMN, written in the model: who does what, in which order, under a value stream stage. Kanoniq draws it; you never keep a `.bpmn` file beside the model. ```kanoniq ecosystem insure { job-role handler "Claims handler" : employee { holds claims-platform/claims-app/handler } /// From a claim filed online to the money in the claimant's account. process pay-out "Pay out a claim" stage claims-stream/settle { pool claimant "Claimant" : customer pool bank "Bank" : b2b-representative site fin-bank { external confirm "Confirm payment" } lane handler start received "Claim received" in handler message from claimant over (claims-platform/portal -> claims-platform/claims-app/api) task approve "Approve" in handler via claims/assess/approve on claims-platform/claims-app/web xor approved "Approved?" in handler task pay "Pay" in handler via payments/payouts/pay-out service message to bank/confirm over (payments-platform/payer -> hubs/hub/api, hubs/hub -> fin-bank/ledger/payments-api) end paid "Paid" in handler end refused "Refused" in handler message to claimant received then approve then approved approved then pay [yes] approved then refused [no] pay then paid } } ``` - **`process ""`** goes in an ecosystem or a domain. **`stage `**, optional, names the value stream stage whose work it orders; every function its tasks name then lies under a function group realizing that stage ([KQ231](https://kanoniq.extenza.dev/docs/rules/kq231.md)). A process calls no other process: write two, each detailing its stage. - **`lane `** makes a job role of the same ecosystem one of the process's lanes. Every task, event and gateway sits in one with **`in `** ([KQ221](https://kanoniq.extenza.dev/docs/rules/kq221.md)). - **`pool "" : `** is a party outside your organization, a `customer`, a `b2b-representative` or an `auditor` ([KQ232](https://kanoniq.extenza.dev/docs/rules/kq232.md)). **`site`**, optional, names where its systems are: an ecosystem, a platform or a monolith. Its block holds its **`external`** steps, a name and nothing else. - **`task`** is work. **`via `** names the function it performs, which tells Kanoniq its systems, data and people; a task naming none is valid, and the recommended model policies ask for one ([`task-names-function`](https://kanoniq.extenza.dev/docs/language/governance.md)). **`on `** names the user interface a person does it on, of an application realizing that function ([KQ225](https://kanoniq.extenza.dev/docs/rules/kq225.md)), and its lane's job role must hold a role there that uses it ([KQ226](https://kanoniq.extenza.dev/docs/rules/kq226.md)). **`service`** says a system does it with nobody. A task is never both. - **`start`** begins the process: on a message with **`message from`**, or on a schedule with **`timer`** and a job's schedule forms (`timer daily at 08:00 Europe/Amsterdam`). **`end`** ends a path: with **`message to`**, or **`terminate`** to stop the whole process. **`xor`** takes one of its ways out, **`and`** all of them. - **`message from `** and **`message to `** exchange a message with a pool, or one of its `external` steps (`message to bank/confirm`): a start event or a task receives, an end event or a task sends. **`over (…)`**, optional, lists the connections the message travels on, each as it is declared, in order from sender to receiver. Every one must exist ([KQ227](https://kanoniq.extenza.dev/docs/rules/kq227.md)), each starts where the one before landed ([KQ228](https://kanoniq.extenza.dev/docs/rules/kq228.md)), the chain starts or lands at the task's systems ([KQ229](https://kanoniq.extenza.dev/docs/rules/kq229.md)) and at the pool's `site` ([KQ230](https://kanoniq.extenza.dev/docs/rules/kq230.md)). - **`a then b`** is a sequence flow; a line may chain them, `a then b then c`. A name follows the target in brackets, `[yes]`. It is a name, never a condition. - **`data , …`**, after the rest of a task's line or after a start event's lane, marks it as work that enters or changes those domain objects: `task book "Book" in clerk via ticketing/sell on office-ui data booking, ticket`. A domain object is named by its code alone, from anywhere in the ecosystem, or by its path where two share a code. It must be one the task handles ([KQ237](https://kanoniq.extenza.dev/docs/rules/kq237.md)), held in exactly one storage of its systems ([KQ238](https://kanoniq.extenza.dev/docs/rules/kq238.md)), and a marked start event needs a message `over` a chain ([KQ239](https://kanoniq.extenza.dev/docs/rules/kq239.md)). Only marked work is drawn on a stage's data-flow view. - **What data a process handles is never written.** It comes from the functions its tasks perform. ## Reference The element types, relationships and kinds of this area, each with what it means. **Element types** | Element type | What it is | | --- | --- | | Process | A Process is a business process: ordered work under a Value Stream Stage, written as BPMN. A Process sits in a Domain or an Ecosystem and holds its pools, its flow nodes and the flows between them; its lanes are Job Roles. | | Pool | A Pool is an external party taking part in a Process, written as a persona: a customer, a partner's representative or an auditor. A Pool belongs to its Process and holds the party's External Steps; the organization itself is never a Pool. | | Flow Node | A Flow Node is one step of a Process as BPMN draws it: a task, a start or end event, a gateway, or an External Step of a party's Pool. Every Flow Node but an External Step sits in one lane of its Process. | **Relationships** | Relationship | What it says | | --- | --- | | Lane | A Lane makes a Job Role one of a Process's lanes, in the order the Process states them. | | Sequence Flow | A Sequence Flow orders the work of a Process: from one FlowNode to the next, in one Process. | | Message Flow | A Message Flow is a message exchanged between a Process's work and an external party, and optionally the chain of connections it travels on. | **Flow node kind**: A FlowNode's kind: the BPMN element it is, or a step of an external party. | Value | Means | | --- | --- | | `task` | A task no system is said to do, or not said yet. | | `user-task` | A task a person does on a user-facing Interface. | | `service-task` | A task a system does with no person. | | `start-event` | Where the process starts, with no trigger stated. | | `message-start-event` | Where the process starts, on a message from an external party. | | `timer-start-event` | Where the process starts, on a schedule. | | `end-event` | Where a path through the process ends. | | `message-end-event` | Where a path ends by sending a message to an external party. | | `terminate-end-event` | Where the whole process ends, whatever else is running. | | `exclusive-gateway` | A decision: one of its outgoing flows is taken. | | `parallel-gateway` | A fork or a join: all its outgoing flows are taken, or all its incoming ones awaited. | | `external-step` | A step of an external party, in its pool: a name and nothing else. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/domain-driven-design.md # Domain-driven design Mark subdomain types and bounded contexts, and see the context map they make. ## Subdomain types and bounded contexts Kanoniq speaks domain-driven design's strategic terms. A **domain** is what DDD calls a subdomain, a part of the problem space; the whole problem space is the ecosystem's function side. The application side is DDD's solution space. A domain may state its **subdomain type**: `core`, where the business competes; `supporting`, specific to the business but not what it competes on; or `generic`, a solved problem every business has. A sub-domain stating none takes its nearest typed parent's, and an Enabler Domain and everything in it are generic. Two lints check DDD's advice to build the core and buy the generic: a core domain realized only by `saas` or `cots` software ([KQ112](https://kanoniq.extenza.dev/docs/rules/kq112.md)), and a generic one, Enabler Domains aside, realized by custom-built software ([KQ113](https://kanoniq.extenza.dev/docs/rules/kq113.md)). A **bounded context** is the boundary inside which one model, and the language naming it, holds. You mark it with `bounded-context` on a domain, a platform, a monolith, a module or a component, at whatever level the boundary falls; Kanoniq never guesses one. A component is in the context marked on it or on the module, monolith or platform around it, or on a domain at or above its primary domain. It is in at most one: contexts don't nest ([KQ095](https://kanoniq.extenza.dev/docs/rules/kq095.md)). A component in no context is simply unmapped. A context marked `big-ball-of-mud` as well is one whose model has no consistent boundaries inside it: a legacy system, often a vendor's, around which the boundary is drawn so the mess stays inside. ## The context map Kanoniq reads which contexts depend on which from what the model already says, so the map never goes stale. **Two contexts are joined wherever something crosses between them**, and each crossing says which is upstream: | What crosses | Upstream | Downstream | | --- | --- | --- | | A call, `in-process` included | The context of the component the interface belongs to | The caller's | | A message through a channel: an event, or nothing said | The sender's | The receiver's | | A command or a query through a channel | The receiver's, which handles it | The sender's | | A copy of data whose authoritative entity is in another context | The context holding the authoritative entity | The copy's | Components in no context are gathered at one end, *Unmapped*. Crossings both ways make two lines, each remembering every call, message and copy it comes from. What the crossings cannot say is stated where it holds: - **An open host service (OHS) and a published language (PL)** are marks on the upstream's API or channel, `open-host` and `published-language`. A line reads them where every crossing of it goes through a marked one. - **An anticorruption layer (ACL)** is read from an `integration` component at the downstream end, which translates, or stated with `acl` on the connection where the downstream component translates itself. A line reads it where every crossing goes through one. - **Team relationships** are lines in a context's block: conformist (`conforms-to`) and customer and supplier (`customer-of`) in the downstream context, partnership, shared kernel and separate ways once in either. A relationship the crossings contradict is an error: see [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map). DDD's advice on the map is policy, not validity: a core context conforming to another's model, a core context or any context taking from bought software or a Big Ball of Mud with no anticorruption layer, a copy of another context's data with no call, message or sync between the two, a line with no pattern stated. Each is in a preset (see [The baselines](https://kanoniq.extenza.dev/docs/language/governance.md#the-baselines)). The layered view draws a Domain's subdomain type and each mark on its boxes, and with its **contexts** switch on, each context as a boundary and every line crossing one ([Layered view](https://kanoniq.extenza.dev/docs/views/layered.md)). The context map view draws an Ecosystem's contexts as boxes and the lines between them, upstream above downstream, with each pattern written at its end. The marks are read and checked, and the information pane shows them when you select an element ([Selecting and moving around](https://kanoniq.extenza.dev/docs/viewer/moving-around.md)). ## Relationships between contexts A bounded context states how it relates to another, in domain-driven design's terms, with a line in the block of the element marked `bounded-context`: ```kanoniq domain ordering "Ordering" core bounded-context { function place-order "Place order" conforms-to identity-access customer-of catalog partnership fulfillment } platform ordering-platform "Ordering platform" { component order-service "Order service" : backend order-service realizes ordering order-service -> services/identity-service/api over http order-service -> services/catalog-service/api over http order-service -> services/fulfillment-service/api over http } ``` | Line | Means | Written in | | --- | --- | --- | | `conforms-to ` | Conformist: this context adopts the other's model as it is | The downstream context | | `customer-of ` | Customer and supplier: the other context plans for this one's needs | The downstream context | | `partnership ` | Partnership: the two teams succeed or fail together | Either context, once | | `shared-kernel ` | Shared kernel: a part of the model both share and change only together | Either context, once | | `separate-ways ` | Separate ways: deliberately no integration | Either context, once | - **Name the other context by the element marked `bounded-context`**, its Code where it sits beside this one, its path otherwise: the domain, platform, monolith, module or component, not one of its members ([KQ210](https://kanoniq.extenza.dev/docs/rules/kq210.md)). - **Which way the integration runs is not written.** Kanoniq reads it from the calls, channels and copies of data between the two, and reports a line they contradict: `conforms-to` toward a context downstream of this one ([KQ204](https://kanoniq.extenza.dev/docs/rules/kq204.md)), a relationship with nothing crossing ([KQ207](https://kanoniq.extenza.dev/docs/rules/kq207.md)), `separate-ways` with something crossing ([KQ208](https://kanoniq.extenza.dev/docs/rules/kq208.md)). The rest of the checks are under [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map). - **A line takes no `as` and no `#assumed`.** Remove one in a later plateau with `-conforms-to identity`. ## Through an anticorruption layer `acl`, after `grant` and before `carries`, says a connection into another bounded context goes through an anticorruption layer: the component at your end translates what it takes, rather than adopting the other context's model. ```kanoniq order-service -> payments/api over http acl ``` Where the component at the receiving end is an `integration` component, it is the translator already, so write nothing: `acl` there is an error ([KQ212](https://kanoniq.extenza.dev/docs/rules/kq212.md)). In `a -> b over events/orders acl`, both connections are marked. A `-` line takes no `acl` ([KB073](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb073)); to add or drop it in a later plateau, remove the connection and write it again. ## Reference The element types, relationships and kinds of this area, each with what it means. **Relationships** | Relationship | What it says | | --- | --- | | Context Relationship | A Context Relationship states how two bounded contexts relate, in DDD's terms: conformist, customer and supplier, partnership, shared kernel or separate ways. The downstream states the first two; a symmetric one is stated once, in either context. | **Subdomain type**: A Domain's subdomain type, in DDD's terms: what the Domain is to the business, and so whether its software is built or bought. | Value | Means | | --- | --- | | `core` | Where the business competes, worth the best people and custom-built software. | | `supporting` | Specific to the business but not what it competes on; built, often more simply, or outsourced. | | `generic` | A solved problem every business has, bought or taken off the shelf. | **Context relationship kind**: How two bounded contexts relate, in DDD's terms: stated by the downstream context, or once for a symmetric relationship. | Value | Means | | --- | --- | | `conforms-to` | Conformist: the context holding it adopts the other's model as it is. | | `customer-of` | Customer and supplier: the other context, upstream, plans for the needs of the one holding it. | | `partnership` | Partnership: two teams that succeed or fail together. | | `shared-kernel` | Shared kernel: a part of the model both contexts share and change only together. | | `separate-ways` | Separate ways: deliberately no integration between the two contexts. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/applications.md # Applications Say which systems realize which functions, and what they offer. ## The application side | Element | Drawn as | Use it for | | --- | --- | --- | | **Platform** | ![Platform](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/platform-light.svg#light)![Platform](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/platform-dark.svg#dark) | A product or system as people talk about it, made of separately deployed components: *Commerce*, *Warehouse* | | **Monolith** | ![Monolith](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/monolith-custom-light.svg#light)![Monolith](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/monolith-custom-dark.svg#dark) | One system with at least one single tier, such as an ERP, a learning platform or a mainframe. It stands wherever a platform does | | **Module** | ![Module](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/module-grouping-light.svg#light)![Module](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/module-grouping-dark.svg#dark) | A part of a monolith: a named grouping, or a tier deployed on its own. Only in a monolith, and modules don't nest | | **Component** | ![Component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-backend-light.svg#light)![Component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-backend-dark.svg#dark) | Something that runs: a service, an app, a bought product | | **Interface** | ![Interface](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/interface-software-light.svg#light)![Interface](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/interface-software-dark.svg#dark) | How a component is reached: by software through an API, or by people through an app | | **Broker** | ![Broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-kafka-light.svg#light)![Broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-kafka-dark.svg#dark) | Messaging infrastructure: a Kafka cluster, a Service Bus namespace, a storage account's queues | | **Channel** | ![Channel](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/channel-light.svg#light)![Channel](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/channel-dark.svg#dark) | A topic, queue, stream or mailbox on a broker, or a file drop on a storage, where messaging parties meet | | **Storage** | ![Storage](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/storage-light.svg#light)![Storage](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/storage-dark.svg#dark) | Where a component, or a monolith, keeps data: a SQL database, a table store, a document database, a log store, a directory, a blob container | | **Domain object** | ![Domain object](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/object-light.svg#light)![Domain object](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/object-dark.svg#dark) | A kind of business data, conceptually: *Order*, *Customer* | | **Data entity** | ![Data entity](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/data-entity-light.svg#light)![Data entity](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/data-entity-dark.svg#dark) | One component's holding of a domain object: *the Order table in the Order Service* | | **Identity** | ![Identity](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/identity-light.svg#light)![Identity](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/identity-dark.svg#dark) | A population of accounts of one persona in an identity provider: *the staff in the corporate directory* | | **Role** | ![Role](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/role-light.svg#light)![Role](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/role-dark.svg#dark) | The capacity in which accounts use one application: *Account holder* in the internet bank | ### Component kinds | Kind | Drawn as | Use it for | | --- | --- | --- | | `backend` | ![backend component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-backend-light.svg#light)![backend component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-backend-dark.svg#dark) | A backend service you build | | `user-facing-app` | ![user-facing-app component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-user-facing-app-light.svg#light)![user-facing-app component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-user-facing-app-dark.svg#dark) | An app people use that you build | | `saas` | ![saas component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-saas-light.svg#light)![saas component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-saas-dark.svg#dark) | A product you subscribe to and someone else runs | | `cots` | ![cots component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-cots-light.svg#light)![cots component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-cots-dark.svg#dark) | A product you buy and run yourself | | `integration` | ![integration component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-integration-light.svg#light)![integration component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-integration-dark.svg#dark) | Integration logic that is its own deployable unit, translating between systems. Not a library inside another component | | `job` | ![job component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-job-light.svg#light)![job component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-job-dark.svg#dark) | Code you build that runs on a schedule and that nothing calls | | `robot` | ![robot component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-robot-light.svg#light)![robot component](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/component-robot-dark.svg#dark) | An automation on an RPA product that works other systems' screens and files as a person would | The kind says what a component *is*. What it runs, such as *.NET* or *Salesforce*, goes in `technology`. Every component sits in a platform or a monolith. **A job runs on a schedule and nothing calls it**, so it holds no interface and no channel delivers to it: a job woken by a message is a `backend`. Jobs that share one scheduler process sit together in one `deployable` module, which is all a scheduler is; a job deployed on its own, such as a timer function, sits in a platform. A job may say when it runs with `schedule` (see [Jobs and robots](#jobs-and-robots)). A job that also serves an API is two components. **A robot does a clerk's work through other systems' screens.** It sits in the RPA product that runs it, a `cots` monolith, holds no interface, and is started by its schedule, by a queue of the product (a broker of kind `rpa.queues`) or by hand. It uses a screen with `ui`, landing on a user interface, and may also call APIs as any component does. A robot acts for an employee and says so with `runs-as` an employee's or a freelancer's identity; there is no robot persona. The diagrams draw a job with a clock in its corner and a robot with a robot, with their kind on the type line and, under it, their schedule as you wrote it without the word `schedule`: `daily at 08:00 Europe/Amsterdam`. ### Monolith and module kinds | Monolith kind | Drawn as | Use it for | | --- | --- | --- | | `custom` | ![custom monolith](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/monolith-custom-light.svg#light)![custom monolith](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/monolith-custom-dark.svg#dark) | A system you build | | `saas` | ![saas monolith](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/monolith-saas-light.svg#light)![saas monolith](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/monolith-saas-dark.svg#dark) | A product you subscribe to and someone else runs | | `cots` | ![cots monolith](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/monolith-cots-light.svg#light)![cots monolith](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/monolith-cots-dark.svg#dark) | A product you buy and run yourself | | Module kind | Drawn as | Use it for | | --- | --- | --- | | `grouping` | ![grouping module](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/module-grouping-light.svg#light)![grouping module](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/module-grouping-dark.svg#dark) | A part of the monolith worth naming, deployed with the rest | | `deployable` | ![deployable module](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/module-deployable-light.svg#light)![deployable module](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/module-deployable-dark.svg#dark) | A part deployed on its own, such as one tier. It may carry `technology` | A monolith with nothing inside it worth modeling, such as a mainframe, holds its interfaces and storages itself, and then connects, is connected to and realizes as a component does. Model separately deployable units as separate components where the difference matters, even when they ship together. A backend-for-frontend is its own component. ### Interface kinds | Kind | Drawn as | Reached by | How it comes to exist | | --- | --- | --- | --- | | `http-api`, `grpc-api`, `graphql-api`, `web-socket-api`, `signal-r-hub`, `ipc-api`, `mail-api`, `snmp-api`, `ldap-api` | ![http-api interface](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/interface-software-light.svg#light)![http-api interface](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/interface-software-dark.svg#dark) | Software | A connection naming it creates it; declare it to give it a name, a schema or versions | | `spa`, `mobile-app`, `desktop-app` | ![spa interface](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/interface-people-light.svg#light)![spa interface](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/interface-people-dark.svg#dark) | People | Always declared | **A user interface gets no component of its own.** A single-page app is static files, not a running service. Declare it directly in the platform or monolith it belongs to, never in the ecosystem. When it has a server side, such as a Next.js backend-for-frontend, that server is a component and the interface goes inside it. A user interface may say what it is built with in `technology`. A webview and the extension that holds it talk by `postMessage`, which is not a connection: the webview is a user interface, such as a `desktop-app`, that its extension contains. **A device your organization places for people to use**, an ATM, a ticket machine, a check-in terminal, a self-service till, is a host of kind `device` (see [Infrastructure](https://kanoniq.extenza.dev/docs/language/technology.md#infrastructure)), and the client on it is an ordinary user interface, a `desktop-app` or an `spa`, deployed `on` it. The host says how many devices run in its stage; the client says none. ## Platform, monolith and module ```kanoniq platform commerce "Commerce" monolith internet-banking "Internet Banking System" : custom { module web-tier "Web tier" : deployable technology "Java and Spring MVC" module accounts "Accounts" : grouping } monolith mainframe "Mainframe Banking System" : custom { http-api api "Mainframe API" } ``` A **platform** groups components that are deployed separately. A **monolith** is one system with at least one single tier: one big frontend, one big backend, or one database. Use it for a large product such as an ERP or a learning platform, or for an in-house system deployed tier by tier. It stands wherever a platform does: it holds relationship statements, and `kq arrange` gives it a file and a folder. The kind after a monolith's name is required: `custom`, `saas` or `cots`. A monolith with no inner structure, such as a mainframe, holds its interfaces and storages itself, and is then connected to, connects and realizes as a component does. A **module** is a part of a monolith, and sits only in one; a platform holds its components directly. Modules hold components and don't nest. The kind is required: | Kind | Means | | --- | --- | | `grouping` | A part of the monolith worth naming, deployed with the rest | | `deployable` | A part deployed on its own, such as one tier. It may carry `technology` | ## Component ```kanoniq component order-service "Order Service" : backend technology ".NET" component warehouse-wms "Warehouse WMS" : cots ``` The kind after `:` is required: `backend`, `user-facing-app`, `saas`, `cots`, `integration`, `job` or `robot`. `technology` is optional free text naming what it runs. Leave out the block when it would be empty. ## Jobs and robots ```kanoniq module scheduler "Scheduler" : deployable technology ".NET" { component import-shipments "Import shipment statuses" : job schedule every PT15M component send-reminders "Send reminders" : job schedule daily at 08:00 Europe/Amsterdam component weekly-report "Weekly report" : job schedule weekly on mon, thu at 06:30 Europe/Amsterdam component export-vat "Export VAT returns" : job schedule monthly on last at 01:00 UTC component rebuild-index "Rebuild search index" : job schedule cron "0 */2 * * 1-5" Europe/Amsterdam } ``` A `job` or a `robot` may say when it runs with `schedule`, after the kind and before `technology`. No other kind takes one, and a job or a robot with none is started from outside the model or by hand. | Form | Runs | | --- | --- | | `every PT15M`, `every PT4H`, `every P1D` | At a fixed interval, a period with no month or year, from when it starts. A month or a year is `monthly` or `cron` | | `daily at 02:00 ` | Once a day | | `weekly on mon, thu at 06:30 ` | On the weekdays named, `mon` to `sun`, each once | | `monthly on 1 at 01:00 ` | On a day of the month, `1` to `31` or `last`; `monthly on 31` is not an error, and the model does not say what happens in a month without one | | `cron "0 */2 * * 1-5" ` | Anything the four don't say: five standard cron fields, as you'd copy them from the system | **A time of day always has its time zone**, an IANA name such as `Europe/Amsterdam`, or `UTC`. There is no default. An unknown zone, a time like `24:00`, a day like `32`, a weekday named twice or a cron expression that isn't five fields is [KQ081](https://kanoniq.extenza.dev/docs/rules/kq081.md). Kanoniq writes a schedule back in the form you wrote it. Nothing calls a job or a robot, so neither holds an interface: a connection naming a path under one is an error and creates nothing ([KQ079](https://kanoniq.extenza.dev/docs/rules/kq079.md), [KQ082](https://kanoniq.extenza.dev/docs/rules/kq082.md)). A channel may start a robot (`rpa-queues/new-bookings -> meeting-bot`), never a job ([KQ080](https://kanoniq.extenza.dev/docs/rules/kq080.md)). ## Interface ```kanoniq http-api orders-api "Orders API" grpc-api status-api "Status API" spa checkout-spa "Checkout" technology "TypeScript and React" desktop-app atm-screen "ATM" technology "Chrome kiosk mode, Angular" ``` The keyword is the kind: `http-api`, `grpc-api`, `graphql-api`, `web-socket-api`, `signal-r-hub`, `ipc-api`, `mail-api`, `snmp-api` and `ldap-api` for software, `spa`, `mobile-app` and `desktop-app` for people. A device your organization places for people to use, an ATM, a ticket machine, a check-in terminal, is a `host` of kind `device`, and the client on it an ordinary user interface deployed `on` it: `environment PRD on atms` (see [Writing infrastructure](https://kanoniq.extenza.dev/docs/language/technology.md#writing-infrastructure)). A webview and the extension that holds it talk by `postMessage`, which is not a connection: model the webview as a user interface, such as a `desktop-app`, inside the extension's component. - **An API usually needs no declaration.** A connection that names it creates it (see [Connections](https://kanoniq.extenza.dev/docs/language/integration.md#connections)). Declare it only to give it a name, a description, a schema or versions. - **A user interface is always declared.** Put it in the component that serves it, or directly in the platform or monolith it belongs to when no component does, such as a static single-page app with no backend of its own. It never goes directly in an ecosystem. - **A user interface may carry `technology`**, naming what it is built with. An API takes none. - **`schema`** after an API's name and marks links its contract: a URL, such as an OpenAPI or AsyncAPI document, or a path in a repository, as its owner names it. Kanoniq shows it and does not read it: `http-api orders-api "Orders API" schema "https://api.example.com/orders/openapi.yaml"`. A user interface has no contract to link ([KQ248](https://kanoniq.extenza.dev/docs/rules/kq248.md)). - **Versions** go in a block after the API, one per line, `v1` and `v2`. Only a breaking change adds one; a compatible change adds none. An API with no block is unversioned. A call names the version it calls ([Connections](https://kanoniq.extenza.dev/docs/language/integration.md#connections)), and a later plateau adds a version and retires an old one ([What a later plateau's block says](https://kanoniq.extenza.dev/docs/language/change-over-time.md#what-a-later-plateaus-block-says)). - **`open-host`** after an API's name says it is offered to every bounded context, not built for one client, and **`published-language`** after it that what travels on it is a documented language they share: `http-api orders-api "Orders API" open-host published-language`. `published-language` goes only beside `open-host` ([KQ211](https://kanoniq.extenza.dev/docs/rules/kq211.md)), and both need the name, so an API a connection created is declared to be marked. - **`in-transit encrypted`** or **`in-transit plaintext`** after an API's marks says what reaches it: only encrypted traffic, or plaintext, so an API that accepts both is `plaintext`. It needs the name: `http-api legacy-api "Legacy API" in-transit plaintext`. An `ipc-api` never leaves its machine and takes none ([KQ270](https://kanoniq.extenza.dev/docs/rules/kq270.md)). An API the model already proves encrypted, by a certificate it serves or a call to it with `auth certificate`, is never stated `plaintext` ([KQ269](https://kanoniq.extenza.dev/docs/rules/kq269.md)). ## Realization ```kanoniq order-service realizes selling/take-orders/place-order ``` The target is a domain, function group or function in the same ecosystem. A domain with sub-domains is realized through them, not directly. **A component that realizes into several domains marks one realization `primary`**, after the target and before any `as`. That realization's domain, or the nearest domain holding its target, is the component's primary domain: the one it belongs to. A component whose realizations all lead to one domain needs no mark. ```kanoniq channel-bff realizes cards/card-overview primary channel-bff realizes payments/make-transfer ``` A component realizing into several domains with no mark is an error ([KQ046](https://kanoniq.extenza.dev/docs/rules/kq046.md)), and so is a mark on a component whose realizations all lead to one domain, or a second mark ([KQ045](https://kanoniq.extenza.dev/docs/rules/kq045.md)). **A domain, function group or function realizes a goal or an impact, and a function group a value stream stage**, written in a motivation block holding both ends: ```kanoniq renting/unlocking realizes rent-a-bike/unlock renting realizes clean-fleet ``` Only the function side realizes a goal, an impact or a value stream stage ([KQ052](https://kanoniq.extenza.dev/docs/rules/kq052.md)), and of it only a function group, the second level, realizes a stage ([KQ057](https://kanoniq.extenza.dev/docs/rules/kq057.md)): a domain is too broad to say which part carries it, a function too narrow. ## Reference The element types, relationships and kinds of this area, each with what it means. **Element types** | Element type | What it is | | --- | --- | | Platform | A Platform is a conceptual grouping of separately deployable Components, with the user-facing Interfaces, Brokers and Domain Objects that belong with them. | | Monolith | A Monolith is one system in which at least one tier is single, such as a big backend or a single database. A Monolith stands where a Platform does and holds Modules, Components, Interfaces, Storages, Brokers and Domain Objects. It is run and replaced as one, so it carries a life cycle. | | Module | A Module is a part of a Monolith that holds Components. Modules do not nest. | | Component | A Component is a piece of software that runs, such as a service, an application or a rented SaaS. A Component sits in a Platform, a Monolith or a Module, holds its Interfaces and Storages, and realizes Functions. | | Interface | A software-facing Interface is how other software reaches a Component, such as an HTTP API. A call to an Interface that is not declared creates it, of the kind the call's protocol implies. | | Interface | A user-facing Interface is how a person reaches the landscape: a web app, a mobile app or a desktop application, on a device the organization places too. A user-facing Interface sits in its backend Component where it has one, and otherwise in a Platform or a Monolith. | **Relationships** | Relationship | What it says | | --- | --- | | Realization | A Realization says what implements what across the sides of the model: an application-side element realizing a Domain, a Function Group or a Function, or a function-side element realizing a Goal, a Value Stream Stage or an Impact. A Realization never targets an Ecosystem and stays within one. | **Component kind**: A Component's kind: what sort of software the Component is. The product it runs is its technology, never its kind. | Value | Means | | --- | --- | | `backend` | A backend service the organization builds itself. | | `user-facing-app` | An application the organization builds itself for people to use. | | `saas` | Software the organization rents as a service, such as Salesforce. | | `cots` | Commercial off-the-shelf software the organization buys and runs. | | `integration` | A Component whose job is to connect other systems: its own codebase and deployable unit, which may translate between contracts and hold long-running logic, never a library inside another Component. | | `job` | Custom code that runs on a schedule and is called by nothing: it holds no Interface, and no delivery out of a Channel lands on it. | | `robot` | An automation on an RPA product that works through other systems' user interfaces and files as a person would. It holds no Interface, and may be started by a delivery out of a Channel. | **Monolith kind**: A Monolith's kind: whether the system is built, rented or bought. | Value | Means | | --- | --- | | `custom` | A Monolith built for this landscape. | | `saas` | A Monolith rented as a service. | | `cots` | A Monolith bought and run by the organization. | **Module kind**: A Module's kind: whether the part is deployed with the rest of its Monolith or on its own. | Value | Means | | --- | --- | | `grouping` | A part of a Monolith worth naming, deployed with the rest of the Monolith. | | `deployable` | A part of a Monolith deployed on its own, such as one tier, which may name a technology of its own. | **Software-facing interface kind**: A software-facing Interface's kind: how other software reaches a Component. The kind follows from the protocol of the calls that land on the Interface. | Value | Means | | --- | --- | | `http-api` | An HTTP API, reached by calls over http. | | `grpc-api` | A gRPC API, reached by calls over grpc. | | `mail-api` | A mail system's interface, reached by calls over email, which the sender does not wait on. | | `snmp-api` | A monitoring system's SNMP interface, reached by calls over snmp: a trap is sent and not answered. | | `ldap-api` | A directory's LDAP interface, reached over ldap to authenticate against the directory or look it up. | | `graphql-api` | A GraphQL endpoint, reached by calls over graphql: a query a client sends and waits on. | | `web-socket-api` | A WebSocket endpoint, reached over web-socket: once the client opens the connection, both sides send without waiting for a reply. | | `signal-r-hub` | An ASP.NET SignalR hub that clients connect to over signal-r: once connected, both sides send without waiting for a reply. | | `ipc-api` | A process's local channel, reached over ipc by another process on the same machine: a pipe, standard input and output, a Unix domain socket, a named pipe or Node IPC. | **User-facing interface kind**: A user-facing Interface's kind: how a person reaches the landscape. | Value | Means | | --- | --- | | `spa` | A single-page web application: static assets that run in the user's browser. | | `mobile-app` | A mobile app that runs on the user's device. | | `desktop-app` | A desktop application that runs on the user's computer. | **Weekday**: A day of the week, as a weekly schedule names it. | Value | Means | | --- | --- | | `mon` | Monday. | | `tue` | Tuesday. | | `wed` | Wednesday. | | `thu` | Thursday. | | `fri` | Friday. | | `sat` | Saturday. | | `sun` | Sunday. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/integration.md # Integration Say how systems reach each other and what travels between them. ## Brokers and channels Use a broker whenever two components talk asynchronously, but over `email`, `snmp`, `web-socket` or `signal-r`, which reach the other side through its interface. Neither side knows the other: both know only the channel. One channel serves every party that names it, so publish-subscribe has one topic, not one per pair. A storage account's Azure Storage Queues are a broker of kind `azure.storage-queue`, declared inside its storage account, whose channels are *Queues*, as with `azure.service-bus.queues`. An RPA product's work queues, through which robots hand work to each other, are a broker of kind `rpa.queues`, whose channels are *Queues* too. A change feed is a channel too, kind *Stream*, on an `azure.event-hubs` broker or another that carries streams. An e-mail system can be either. Usually it is a system you reach over `email`, landing on its `mail-api`. Where its mailboxes matter, make it a broker of kind `email`, whose channels are *Mailboxes*. A file handed from one system to another is a channel on the `file` or `blob` storage the files are in, of kind `file-share`, `blob-storage` or `sftp`, never on a broker. File handoff is usually a poor integration choice, but it is real and Kanoniq models it. Data at rest in a directory is the `file` storage itself: whether a directory is a conduit, a store or both is your call, and the statements you write say which. **A broker's kind is a generic kind or a provider's product word**: `kafka`, `rabbitmq`, `mqtt`, or `aws.sqs`, `gcp.pub-sub`. Where a kind carries one kind of channel, its channels take it; where it carries several, as `rabbitmq` carries queues and topics, each channel states its own. A broker is a platform service, run by its provider or on a host of your own, like the rest of the [infrastructure](https://kanoniq.extenza.dev/docs/language/technology.md#infrastructure). ## Events, commands and queries A channel says where messages go, not what they are. Say what they are with three kinds of message, each about one domain object: | Message | Says | Declared in | Travels | | --- | --- | --- | --- | | **Event** | What happened: *Order placed* | The component that publishes it | Into and out of channels | | **Command** | Do something: *Send invoice* | The component that handles it | On any connection to its handler | | **Query** | Answer something: *Invoice status* | The component that handles it | The same | Whoever owns the contract declares it: a publisher its events, which any number of subscribers depend on, a handler its commands and queries, which every sender depends on. A message may state its format, `json`, `xml`, `avro` or `protobuf`, and link to its real schema. Only breaking versions are modeled, `v1`, `v2`, so you can see who still consumes `v1`. A connection names what it [carries](#what-a-connection-carries). **An event is an integration event where a delivery takes it to a component in another bounded context**, or in none. Kanoniq reads that from the contexts; nothing marks it. Events raised and handled inside one component's code are not modeled. Messages are not drawn in a view yet. ## Scenarios A **scenario** is an ordered walk over connections already in the model, for one piece of behavior such as signing in: which system asks or tells which, first to last. It sits directly in its ecosystem. Each **step** names one connection by its ends, or one hop through a channel from a publisher to a subscriber, and may name the message it sends and a sentence saying what it does. A step is no element of its own, so one connection may be stepped on twice. A scenario may name the process task it carries out. It holds no conditions, loops or timings, and no replies: a failure path is a scenario of its own. No view of the landscape draws a scenario. See [Writing a scenario](#writing-a-scenario). ## Broker and channel ```kanoniq broker events "Events" : kafka on aks-prd in spoke-prd { environment PRD x1 channel orders "Orders" } broker mq "RabbitMQ" : rabbitmq { channel prices "Prices" : topic channel refunds "Refunds" : queue } order-service -> events/orders events/orders -> billing order-service -> mq/prices mq/prices -> billing order-service -> mq/refunds mq/refunds -> billing ``` A broker is declared in an ecosystem, a platform or a monolith, or inside the `storage-account` or the `redis` `db-server` it is part of. **It is a platform service**: after its kind comes how it runs, `paas` or `on `, then `in ` and `public`, as for the rest of the [infrastructure](https://kanoniq.extenza.dev/docs/language/technology.md#writing-infrastructure), and its stages are its `environment` lines. **`in-transit encrypted`** or **`in-transit plaintext`** follows its placement, as on an API ([Interface](https://kanoniq.extenza.dev/docs/language/applications.md#interface)): `broker events "Events" : rabbitmq on mq-host in-transit plaintext`. Most providers' product words take no plaintext, so a broker of one reads as encrypted with nothing stated, and stating it `plaintext` is [KQ269](https://kanoniq.extenza.dev/docs/rules/kq269.md). Its kind is a generic kind or a provider's product word, one the build doesn't know being [KB079](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb079). Its kind decides the kind of its channels: | Broker kind | Drawn as | Channels are | | --- | --- | --- | | `kafka` | ![kafka broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-kafka-light.svg#light)![kafka broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-kafka-dark.svg#dark) | Topics | | `rabbitmq` | ![rabbitmq broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-rabbitmq-light.svg#light)![rabbitmq broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-rabbitmq-dark.svg#dark) | Queues or Topics, each stating its kind | | `activemq` | ![activemq broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-activemq-light.svg#light)![activemq broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-activemq-dark.svg#dark) | Queues or Topics, each stating its kind | | `mqtt` | ![mqtt broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-mqtt-light.svg#light)![mqtt broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-mqtt-dark.svg#dark) | Topics | | `redis-pub-sub` | ![redis-pub-sub broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-redis-pub-sub-light.svg#light)![redis-pub-sub broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-redis-pub-sub-dark.svg#dark) | Topics | | `redis-streams` | ![redis-streams broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-redis-streams-light.svg#light)![redis-streams broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-redis-streams-dark.svg#dark) | Streams | | `email` | ![email broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-email-light.svg#light)![email broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-email-dark.svg#dark) | Mailbox | | `sms` | ![sms broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-sms-light.svg#light)![sms broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-sms-dark.svg#dark) | Sms | | `push` | ![push broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-push-light.svg#light)![push broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-push-dark.svg#dark) | Push | | `rpa.queues` | ![rpa.queues broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-rpa-queues-light.svg#light)![rpa.queues broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-rpa-queues-dark.svg#dark) | Queues | | `azure.service-bus.queues` | ![azure.service-bus.queues broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-service-bus-queues-light.svg#light)![azure.service-bus.queues broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-service-bus-queues-dark.svg#dark) | Queues | | `azure.service-bus.topics` | ![azure.service-bus.topics broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-service-bus-topics-light.svg#light)![azure.service-bus.topics broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-service-bus-topics-dark.svg#dark) | Topics | | `azure.event-hubs` | ![azure.event-hubs broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-event-hubs-light.svg#light)![azure.event-hubs broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-event-hubs-dark.svg#dark) | Streams | | `azure.event-grid` | ![azure.event-grid broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-event-grid-light.svg#light)![azure.event-grid broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-event-grid-dark.svg#dark) | Topics | | `azure.event-grid.mqtt` | ![azure.event-grid.mqtt broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-event-grid-mqtt-light.svg#light)![azure.event-grid.mqtt broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-event-grid-mqtt-dark.svg#dark) | Topics | | `azure.storage-queue` | ![azure.storage-queue broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-storage-queue-light.svg#light)![azure.storage-queue broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-storage-queue-dark.svg#dark) | Queues | | `azure.signal-r` | ![azure.signal-r broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-signal-r-light.svg#light)![azure.signal-r broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-signal-r-dark.svg#dark) | Topics | | `azure.web-pub-sub` | ![azure.web-pub-sub broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-web-pub-sub-light.svg#light)![azure.web-pub-sub broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-web-pub-sub-dark.svg#dark) | Topics | | `azure.communication-services.email` | ![azure.communication-services.email broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-communication-services-email-light.svg#light)![azure.communication-services.email broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-communication-services-email-dark.svg#dark) | Mailbox | | `azure.communication-services.sms` | ![azure.communication-services.sms broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-communication-services-sms-light.svg#light)![azure.communication-services.sms broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-communication-services-sms-dark.svg#dark) | Sms | | `azure.notification-hubs` | ![azure.notification-hubs broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-notification-hubs-light.svg#light)![azure.notification-hubs broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-azure-notification-hubs-dark.svg#dark) | Push | | `aws.sqs` | ![aws.sqs broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-sqs-light.svg#light)![aws.sqs broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-sqs-dark.svg#dark) | Queues | | `aws.sns` | ![aws.sns broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-sns-light.svg#light)![aws.sns broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-sns-dark.svg#dark) | Topics | | `aws.event-bridge` | ![aws.event-bridge broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-event-bridge-light.svg#light)![aws.event-bridge broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-event-bridge-dark.svg#dark) | Topics | | `aws.kinesis` | ![aws.kinesis broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-kinesis-light.svg#light)![aws.kinesis broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-kinesis-dark.svg#dark) | Streams | | `aws.msk` | ![aws.msk broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-msk-light.svg#light)![aws.msk broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-msk-dark.svg#dark) | Topics | | `aws.mq.rabbitmq` | ![aws.mq.rabbitmq broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-mq-rabbitmq-light.svg#light)![aws.mq.rabbitmq broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-mq-rabbitmq-dark.svg#dark) | Queues or Topics, each stating its kind | | `aws.mq.activemq` | ![aws.mq.activemq broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-mq-activemq-light.svg#light)![aws.mq.activemq broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-mq-activemq-dark.svg#dark) | Queues or Topics, each stating its kind | | `aws.app-sync.events` | ![aws.app-sync.events broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-app-sync-events-light.svg#light)![aws.app-sync.events broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-app-sync-events-dark.svg#dark) | Topics | | `aws.iot-core` | ![aws.iot-core broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-iot-core-light.svg#light)![aws.iot-core broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-iot-core-dark.svg#dark) | Topics | | `aws.ses` | ![aws.ses broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-ses-light.svg#light)![aws.ses broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-ses-dark.svg#dark) | Mailbox | | `aws.end-user-messaging` | ![aws.end-user-messaging broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-end-user-messaging-light.svg#light)![aws.end-user-messaging broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-aws-end-user-messaging-dark.svg#dark) | Sms or Push, each stating its kind | | `gcp.pub-sub` | ![gcp.pub-sub broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-gcp-pub-sub-light.svg#light)![gcp.pub-sub broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-gcp-pub-sub-dark.svg#dark) | Topics | | `gcp.eventarc` | ![gcp.eventarc broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-gcp-eventarc-light.svg#light)![gcp.eventarc broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-gcp-eventarc-dark.svg#dark) | Topics | | `gcp.cloud-tasks` | ![gcp.cloud-tasks broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-gcp-cloud-tasks-light.svg#light)![gcp.cloud-tasks broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-gcp-cloud-tasks-dark.svg#dark) | Queues | | `gcp.managed-kafka` | ![gcp.managed-kafka broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-gcp-managed-kafka-light.svg#light)![gcp.managed-kafka broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-gcp-managed-kafka-dark.svg#dark) | Topics | | `gcp.firebase-cloud-messaging` | ![gcp.firebase-cloud-messaging broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-gcp-firebase-cloud-messaging-light.svg#light)![gcp.firebase-cloud-messaging broker](https://kanoniq.extenza.dev/docs/v/0.4.1/img/elements/broker-gcp-firebase-cloud-messaging-dark.svg#dark) | Push | **Where a kind carries several, each channel states its own** after its name, `: queue` or `: topic`; where it carries one, a channel states none, and either slip is [KB079](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb079). `redis-pub-sub` and `redis-streams` are declared inside a `redis` database server, and `azure.storage-queue` inside its storage account: ```kanoniq db-server cache-prd "Orders cache" : azure.managed-redis in spoke-prd environment PRD x1 { broker notify "Notifications" : redis-pub-sub } dns cache-dns "orders-cache.redis.azure.net" : azure.private-dns in spoke-prd -> cache-prd environment PRD ``` **A file handoff is a channel on a storage**, declared in the block of the `file` or `blob` storage the files are in, with its kind: `file-share` on a `file` one, `blob-storage` on a `blob` one, `sftp` on either. Nothing creates one, since its kind would be a guess: ```kanoniq component exporter "Exporter" : integration { file partner-files "Partner file exchange" { channel revenue-files "Revenue files" : sftp } } exporter -> clearing-house over exporter/partner-files/revenue-files ``` A channel in a broker whose kind carries one kind of channel usually needs no declaration either: `over events/orders` creates it. Declare it to give it a name or a description, or to mark it `open-host` and `published-language` as an API is: `channel orders "Orders" open-host published-language`. ## Writing events, commands and queries ```kanoniq component order-service "Order Service" : backend technology ".NET" { event order-placed "Order placed" about order format avro schema "orders.order-placed-value" { v1 v2 } event order-cancelled "Order cancelled" about order sql orders-db "Orders DB" { root order from records over http identifier "Order Id" } } component billing-engine "Billing Engine" : backend { command send-invoice "Send invoice" about invoice format json query invoice-status "Invoice status" about invoice sql billing-db "Billing DB" { root invoice from records over http identifier "Invoice Id" } } order-service -> events/orders carries order-placed v1, order-placed v2, order-cancelled events/orders -> shipping carries order-service/order-placed v1, order-service/order-placed v2, order-service/order-cancelled shipping -> billing-engine/api over http carries send-invoice, invoice-status ``` An **event** says what happened, and is declared in the component that publishes it. A **command** asks one component to do something, and a **query** asks it for something; both are declared in the component that handles them. A monolith with no components of its own declares its own. **`about`** is required and names the domain object the message is about, looked up as a data entity's is: bare where the object is declared in the component's own platform, by its path elsewhere. Anything but a domain object is an error ([KQ200](https://kanoniq.extenza.dev/docs/rules/kq200.md), [KQ203](https://kanoniq.extenza.dev/docs/rules/kq203.md)). **`format`** is optional: `json`, `xml`, `avro` or `protobuf`. Leave it out and nothing is said about the format. **`schema`** is optional too, after `format`: a link to the real schema, such as an AsyncAPI document, or a schema registry subject as the registry names it. Kanoniq shows it and doesn't read it. **A block lists the breaking versions**, `v1`, `v2`, one per line. A compatible change, such as an added optional field, needs no new version. A message with no block has no versions. A later plateau adds a version with its line and retires one with `-v1` (see [Change over time](https://kanoniq.extenza.dev/docs/language/change-over-time.md)). A message is drawn in no view yet. ## Connections ```kanoniq web-shop -> order-service/orders-api over http/json order-service -> processing/status-api over grpc order-service -> mail-system/smtp over email order-service -> processing over events/orders order-service -> events/audit ``` | Form | Means | | --- | --- | | `a -> b/api over http` | `a` calls the interface `api` of `b`. `http` lands on an `http-api`, `grpc` on a `grpc-api`, `graphql` on a `graphql-api`, `web-socket` on a `web-socket-api`, `signal-r` on a `signal-r-hub`, `ipc` on an `ipc-api`, `email` on a `mail-api`, `snmp` on an `snmp-api`, `ldap` on an `ldap-api`; the interface is created if it isn't declared | | `a -> b/api over http/json` | The same, saying what the payload is written in: `json` or `xml`, for `http` only. Leave it out and nothing is said about the format | | `a -> b over in-process` | A call inside one monolith: it lands on the component `b` itself, with no interface. Both ends are components of the same monolith, in any of its modules | | `r -> app/desktop over ui` | A robot or a role uses a user interface's screens. The user interface must be declared | | `a -> b over events/orders` | `a` publishes to the channel `orders` of the broker `events`, and `b` receives from it. The channel is created if it isn't declared | | `a -> events/orders` or `events/orders -> b` | One side only, for a party outside the model | **A connection always names its target.** `a -> b` with `b` a component is an error, unless it goes `over in-process`: say which interface, or which channel. **A call names the version of the API it calls** after its target, `web-shop -> order-service/orders-api v2 over http/json`, one version at most. Name a version the API declares, and none where it declares none ([KQ249](https://kanoniq.extenza.dev/docs/rules/kq249.md)). **`via `** after the transport names the gateway a call goes through, and comes before `auth`, whose own `via` names an identity provider: the first `via` after `over` is the gateway, the one after a scheme the identity provider. ```kanoniq orders -> payments/api over http via apim auth workload-identity via iam/platform-idp orders -> partner/api over http via nat auth key ``` The gateway publishes the API the call lands on ([KQ252](https://kanoniq.extenza.dev/docs/rules/kq252.md)), or is the `nat` gateway an outbound call leaves by. Only a call over a protocol takes one: a leg goes through its channel's broker, and `via` on a leg, a `ui` statement or a `-` line is [KB078](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb078). Leave it out and no gateway is said; never write a call through a gateway as two calls. **`email` reads by its position.** After `over` it is the protocol, after a broker's `:` the broker kind. Unlike `http` and `grpc` it is asynchronous, but the mail system stays a system you call; make it a broker only where its mailboxes matter. A protocol after `over` goes only with an interface, and a channel only without one. **`snmp` is asynchronous too**, for alerts sent to a monitoring system, which stays a system you call rather than a broker. **`ldap` is synchronous**: how a component authenticates against and looks up a directory such as Active Directory. Neither takes a payload format. **`graphql` is synchronous**: a query is sent and waited on. **`web-socket` and `signal-r` are asynchronous**: once the client opens the connection, both sides send without waiting for a reply, and the arrow goes from the client that opens it. Like `email` and `snmp`, each is a direct connection with no broker between. `signal-r` is ASP.NET's real-time library, whose clients connect to a hub. None of the three takes a payload format; `json` and `xml` are for `http` only. **`ipc` is a call to another process on the same machine** through a pipe, standard input and output, a Unix domain socket, a named pipe or Node IPC, such as an editor extension talking to the language server it starts. It is synchronous, and the arrow goes from the process that starts or opens the channel. What is spoken over it isn't told apart, so name it in a doc comment (`/// The Language Server Protocol.`). A socket on `localhost` is not `ipc`: use what is spoken over it, `http` or `grpc`. It takes no payload format and no `auth`. **`ui` is how a robot or a person uses a screen**, the one way to land on a user interface. Only a `robot` or a `role` writes it ([KQ083](https://kanoniq.extenza.dev/docs/rules/kq083.md)), and it names a declared `spa`, `mobile-app` or `desktop-app` ([KQ084](https://kanoniq.extenza.dev/docs/rules/kq084.md)). It takes no payload format, no `auth` and no `grant`: who signs in is the role's `in`, or the robot's `runs-as`. ```kanoniq monolith booking "Booking system" : cots idp { identity staff "Booking staff" : employee desktop-app desktop "Booking client" spa admin "Admin console" role clerk "Clerk" in booking : employee clerk -> desktop over ui } ``` A role with no `ui` uses every user interface of its application; once it has one, it uses only the ones it names, so `clerk` above uses the desktop client and not the admin console. A role's `ui` stays in its own application ([KQ085](https://kanoniq.extenza.dev/docs/rules/kq085.md)): to use another application's screens, people hold a role there. A robot's `ui` into an application where the identity it `runs-as` holds no role is [KQ111](https://kanoniq.extenza.dev/docs/rules/kq111.md). **Several senders and receivers on one channel all share it**, and each pair of ends is one connection. `a -> b over events/orders` and `a -> c over events/orders` are one send from `a` into the channel and two deliveries out of it. The model holds the sends and the deliveries, not who talks to whom: that is what a channel decouples. Your file keeps the statements as you wrote them. ## What a connection carries `carries`, after every other part of a connection, names the events, commands and queries it carries: ```kanoniq order-service -> events/orders carries order-placed v1, order-placed v2, order-cancelled events/orders -> billing/billing-engine carries ordering/order-service/order-placed v1 order-service -> billing/billing-engine/api over http/json carries send-invoice order-service -> shipping over events/orders carries order-placed v2 ``` **A Code alone names a message of the end that owns it.** On a connection into a channel, and in `a -> b over events/orders`, that is the sender's own event. On a delivery out of a channel, a call or an `in-process` call, it is a command or a query of the component reached. Name any other by its path: an event on a delivery by its publisher's path, a command on a connection into a channel by its handler's. **An event travels only into or out of a channel**, and an event on a call is an error ([KB070](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb070)). A connection into a channel carries only the sender's own events ([KQ098](https://kanoniq.extenza.dev/docs/rules/kq098.md)), and a delivery only what a connection into its channel carries ([KQ097](https://kanoniq.extenza.dev/docs/rules/kq097.md)). **A command or a query travels to its handler**, on a call, a channel or `in-process` ([KQ201](https://kanoniq.extenza.dev/docs/rules/kq201.md)). **Name a versioned message with its version**, `order-placed v1`, once for each version carried, and one without versions bare ([KQ099](https://kanoniq.extenza.dev/docs/rules/kq099.md), [KQ202](https://kanoniq.extenza.dev/docs/rules/kq202.md)). `a -> b over events/orders carries ...` says it for both connections. **`carries` is optional**: leave it out and nothing is said about what a connection carries. Don't start the next statement with a Code spelled like a version, such as a component coded `v2`; the list would read it as a version. ## What a sync carries `carries` also ends a sync, after its scheme, and names the events, commands and queries that keep the copy, or one mechanism when no message does: ```kanoniq sql billing-db "Billing DB" { root customer-account from crm over events/customers carries crm/customer-changed v2 root product from catalog over http/json carries catalog/products-since root ledger-line from erp over erp/exports/drops carries file } ``` **Name a message as `from` names its component**: by its path, `crm/customer-changed`, or by its Code alone when the component holding the replica declares it, as it does a command it handles. Name a versioned message with its version, as on a connection. **What it carries says who starts it.** An event is its source's, which publishes it ([KQ214](https://kanoniq.extenza.dev/docs/rules/kq214.md)); a command is the replica holder's, which the source calls ([KQ215](https://kanoniq.extenza.dev/docs/rules/kq215.md)); a query is the source's, which the holder calls to pull the copy ([KQ216](https://kanoniq.extenza.dev/docs/rules/kq216.md)). A query goes over a protocol, never through a channel ([KQ217](https://kanoniq.extenza.dev/docs/rules/kq217.md)), and a pulled sync's `auth` is the holder's. Over a channel, the list stands on both of the sync's connections. A message about another domain object than the entity's is a lint ([KQ118](https://kanoniq.extenza.dev/docs/rules/kq118.md)). **A mechanism** names how the copy is kept with no message: `cdc` (change data capture), `etl` (a scheduled extract, transform and load job), `file` (an export dropped and picked up) or `replication` (a database product's own copy between two components' databases). A sync carries messages or one mechanism, never both ([KQ218](https://kanoniq.extenza.dev/docs/rules/kq218.md)). The four are reserved words. **An entity may have several syncs.** Write the first on the entity's line and each other on its own line under it. All but one are marked `reconcile`, which ends the line: the unmarked one is the main feed, and each `reconcile` sync corrects drift in the copy it keeps ([KQ219](https://kanoniq.extenza.dev/docs/rules/kq219.md)). Two syncs with the same source, route and `carries` are an error ([KQ220](https://kanoniq.extenza.dev/docs/rules/kq220.md)). ```kanoniq root customer-account from crm over events/customers carries crm/customer-changed v2 from crm over crm/exports/drops carries file reconcile ``` Syncs from different components into one entity are allowed; the recommended policy `one-source-per-replica` reports them ([Governance](https://kanoniq.extenza.dev/docs/language/governance.md)). **`carries` is optional** on a sync too: leave it out and nothing is said about what moves or who starts it. ## Writing a scenario A scenario walks over connections you already declared, in order, for one piece of behavior: which system asks or tells which, first to last. ```kanoniq ecosystem big-bank { /// How the sign in feature works in the single-page application. scenario sign-in "Sign in" { step internet-banking/web-application/single-page-application -> internet-banking/api-application/sign-in-controller/api "Submits credentials, gets an authentication token back" step internet-banking/api-application/sign-in-controller -> internet-banking/api-application/security-component "Validates the credentials" } } ``` - **`scenario ""`** goes directly in an ecosystem, nowhere else: the one its first step starts in ([KQ244](https://kanoniq.extenza.dev/docs/rules/kq244.md)). **`for /`**, optional, names the task of a business process it carries out ([KQ245](https://kanoniq.extenza.dev/docs/rules/kq245.md)), and the first step then starts at the task's screen or one of its systems ([KQ243](https://kanoniq.extenza.dev/docs/rules/kq243.md)). Its block holds its steps, at least one, in order. - **`step -> `** names a connection by its two ends, as it is declared: `a -> b/api` for a call, `a -> b` for an `in-process` call. **`step -> -> `** is one hop through a channel, from the publisher to a subscriber. A step never creates an interface; it may name one a connection created. The connection must exist ([KQ240](https://kanoniq.extenza.dev/docs/rules/kq240.md)), and each step starts where the scenario starts or where an earlier step arrived ([KQ241](https://kanoniq.extenza.dev/docs/rules/kq241.md)). - **`carries `**, optional, names the event, command or query the step sends, with its version, `carries order-placed v2`; its connection, or both legs of a hop, must carry it ([KQ242](https://kanoniq.extenza.dev/docs/rules/kq242.md)). A code alone is a message of the component the call reaches, or of the publisher on a hop; any other is named by its path. - **A sentence**, optional and last, says what the step does. A reply is never written: a synchronous call's answer is the call's, and the sentence may say both ways. - **A scenario is written whole.** To change its steps at a later plateau, declare it again in that plateau's block; `-` removes it. A step whose connection is gone at a plateau is an error in that plateau. `kq arrange` puts an ecosystem's scenarios in `scenarios.kq`. ## Reference The element types, relationships and kinds of this area, each with what it means. **Element types** | Element type | What it is | | --- | --- | | Channel | A Channel is what messaging parties attach to when neither knows the other, such as a topic or a queue: the messaging counterpart to an Interface. A Channel sits in its Broker, or for a file handoff on the file or blob Storage the files are in, and serves every party that names it. | | Broker | A Broker is the infrastructure messaging goes through, such as a Kafka cluster or a Service Bus namespace. A Broker contains Channels, and its kind names its technology; it runs on the provider or on what the organization runs. | | Event | An Event is a message saying what happened, declared by the Component that publishes it, such as Order placed. An Event is about one Domain Object and is carried on legs into and out of Channels. | | Command | A Command is a message asking one handler to do something, declared by the Component that handles it, such as Send invoice. A Command is about one Domain Object and is carried on any Connection reaching its handler. | | Query | A Query is a message asking one handler for something, declared by the Component that handles it, such as Invoice status. A Query is about one Domain Object and is carried on any Connection reaching its handler. | | Scenario | A Scenario is an ordered walk over existing connections for one piece of behavior, such as signing in: which system asks or tells which, in what order. It sits directly in an Ecosystem, and may be anchored on the task of a Process it carries out. | **Relationships** | Relationship | What it says | | --- | --- | | Connection | A Connection records control flow, from the end in the active position: a call from a Component to an Interface, an in-process call between two Components of one Monolith, or a leg into or out of a Channel. | | Sync | A Sync replicates one holding of a Domain Object into another, across Components, over a protocol or through a Broker's Channel, and may say what keeps the copy. | **Channel kind**: A Channel's kind: how the Channel delivers what is sent through it, never the product. In a Broker whose kind carries one Channel kind it is that one; in a Broker whose kind carries several, and on a Storage, the Channel states it. | Value | Means | | --- | --- | | `topic` | A topic: every subscriber receives each message. | | `queue` | A queue: each message goes to one receiver. | | `stream` | A stream: an ordered sequence of events that readers consume at their own pace, such as a change feed. | | `mailbox` | A mailbox whose messages matter to the landscape: on an email Broker that sends, the sender address. | | `sms` | Text messages sent to people's phones, from one sender; the recipients are people, not modeled. | | `push` | Notifications pushed to a mobile app on people's devices; the recipients are people, not modeled. | | `file-share` | A file handoff through a file share: files passed between parties in a directory of a file Storage. | | `blob-storage` | A file handoff through blob storage: files passed between parties in a blob Storage's container. | | `sftp` | A file handoff over SFTP: files passed between parties on a file or blob Storage an SFTP endpoint serves. | **Auth scheme**: How the source of a call, a leg or a sync authenticates, named by mechanism, never by product. A token scheme is issued by an Identity Provider. | Value | Means | | --- | --- | | `none` | Nobody is checked: a public endpoint, an open relay or an anonymous bind. | | `key` | A static shared secret the caller stores: a password, an API or subscription key, a SAS token, a connection string, an HMAC-signed webhook or an SNMP community string. | | `certificate` | A key pair the caller holds: a client certificate (mTLS), an SSH key or SASL EXTERNAL. | | `client-credentials` | An application's own OAuth 2.0 or OpenID Connect token, or a signed client assertion. | | `workload-identity` | A token the platform the caller runs on obtains for it, with no secret in the caller's configuration. | | `user-token` | The signed-in user's identity, carried on unchanged: a bearer token, or a session cookie from a user-facing Interface to its backend. | | `on-behalf-of` | A token the caller obtains for itself, for the target, by exchanging the user's token and its own credential; the token carries the user's identity. | | `kerberos` | Windows integrated authentication: Kerberos, NTLM, Negotiate or SASL GSSAPI. | **Protocol**: The protocol a call or a sync travels over. Each protocol but in-process implies the kind of Interface the call lands on. | Value | Means | | --- | --- | | `http` | HTTP, synchronous. A call over http lands on an HttpApi Interface. | | `grpc` | gRPC, synchronous. A call over grpc lands on a GrpcApi Interface. | | `email` | Email, asynchronous. A call over email lands on the mail system's MailApi Interface. | | `snmp` | SNMP, asynchronous: a trap is sent and not answered. A call over snmp lands on an SnmpApi Interface. | | `ldap` | LDAP, the directory protocol, synchronous. A call over ldap lands on an LdapApi Interface. | | `graphql` | GraphQL, synchronous: a query a client sends over HTTP and waits on. A call over graphql lands on a GraphqlApi Interface. | | `web-socket` | WebSocket, asynchronous: once the client opens the connection, both sides send without waiting for a reply. A call over web-socket lands on a WebSocketApi Interface. | | `signal-r` | SignalR, ASP.NET's real-time library, asynchronous. A call over signal-r lands on a SignalRHub Interface. | | `ipc` | A call between two processes on one machine through a local channel, synchronous: a pipe, standard input and output, a Unix domain socket, a named pipe or Node IPC, whatever is spoken over it. A call over ipc lands on an IpcApi Interface. It carries no payload format and no authentication. | | `in-process` | A call between two Components of one Monolith, which lands on the Component itself, with no Interface and no authentication. | | `ui` | Use through a user interface, as a person works a screen: made only by a Robot or a Role, it lands on any declared user-facing Interface and creates none. It carries no payload format and no authentication. | **Payload format**: The format a payload is written in: on a call or a sync over a protocol that takes it, or on an event, a command or a query. | Value | Means | | --- | --- | | `json` | JSON. A call or a sync takes it over http only. | | `xml` | XML. A call or a sync takes it over http only. | | `avro` | Apache Avro, a binary format with a schema. Only an event, a command or a query states it. | | `protobuf` | Protocol Buffers, a binary format with a schema. Only an event, a command or a query states it. | **Broker kind**: A Broker's kind, as written: a generic kind or a provider's product word. The kind fixes the kinds of Channel the Broker contains. | Value | Means | | --- | --- | | `kafka` | Apache Kafka. Each Channel in a kafka Broker is a Topic. | | `rabbitmq` | RabbitMQ. Each Channel in a rabbitmq Broker states its kind, a Queue or a Topic. | | `activemq` | Apache ActiveMQ. Each Channel in an activemq Broker states its kind, a Queue or a Topic. | | `mqtt` | An MQTT broker, pushing in real time to the clients subscribed. Each Channel in an mqtt Broker is a Topic. | | `redis-pub-sub` | Redis Pub/Sub, inside a redis database server, fire and forget. Each Channel in a redis-pub-sub Broker is a Topic. | | `redis-streams` | Redis Streams, inside a redis database server, kept for consumer groups. Each Channel in a redis-streams Broker is a Stream. | | `email` | A mail server whose mailboxes matter. Each Channel in an email Broker is a Mailbox. | | `sms` | A service sending text messages to people. Each Channel in an sms Broker is an Sms sender. | | `push` | A service pushing notifications to mobile apps. Each Channel in a push Broker is a Push. | | `rpa.queues` | An RPA product's work queues, through which robots hand work to each other. Each Channel in an rpa.queues Broker is a Queue. A robot authenticates to its own product's queues on no arrow. | | `azure.service-bus.queues` | Azure Service Bus queues. Each Channel in an azure.service-bus.queues Broker is a Queue. | | `azure.service-bus.topics` | Azure Service Bus topics. Each Channel in an azure.service-bus.topics Broker is a Topic. | | `azure.event-hubs` | Azure Event Hubs. Each Channel in an azure.event-hubs Broker is a Stream. | | `azure.event-grid` | Azure Event Grid. Each Channel in an azure.event-grid Broker is a Topic. | | `azure.event-grid.mqtt` | The MQTT broker of an Azure Event Grid namespace. Each Channel in it is a Topic. | | `azure.storage-queue` | Azure Queue Storage, inside its storage account. Each Channel in an azure.storage-queue Broker is a Queue. | | `azure.signal-r` | Azure SignalR Service, pushing in real time to connected clients. Each Channel in it is a Topic. | | `azure.web-pub-sub` | Azure Web PubSub, pushing in real time to connected clients. Each Channel in it is a Topic. | | `azure.communication-services.email` | Azure Communication Services Email. Each Channel in it is a Mailbox, the sender address. | | `azure.communication-services.sms` | Azure Communication Services SMS. Each Channel in it is an Sms sender. | | `azure.notification-hubs` | Azure Notification Hubs. Each Channel in it is a Push. | | `aws.sqs` | Amazon SQS. Each Channel in an aws.sqs Broker is a Queue. | | `aws.sns` | Amazon SNS. Each Channel in an aws.sns Broker is a Topic. | | `aws.event-bridge` | An Amazon EventBridge event bus. Each Channel in it is a Topic. | | `aws.kinesis` | Amazon Kinesis Data Streams. Each Channel in it is a Stream. | | `aws.msk` | Amazon MSK. Each Channel in an aws.msk Broker is a Topic. | | `aws.mq.rabbitmq` | Amazon MQ for RabbitMQ. Each Channel in it states its kind, a Queue or a Topic. | | `aws.mq.activemq` | Amazon MQ for ActiveMQ. Each Channel in it states its kind, a Queue or a Topic. | | `aws.app-sync.events` | AWS AppSync Events, pushing in real time to connected clients. Each Channel in it is a Topic. | | `aws.iot-core` | AWS IoT Core's MQTT broker. Each Channel in it is a Topic. | | `aws.ses` | Amazon SES. Each Channel in an aws.ses Broker is a Mailbox, the sender address. | | `aws.end-user-messaging` | AWS End User Messaging, for SMS and mobile push. Each Channel in it states its kind, an Sms or a Push. | | `gcp.pub-sub` | Google Cloud Pub/Sub. Each Channel in a gcp.pub-sub Broker is a Topic. | | `gcp.eventarc` | Google Cloud Eventarc. Each Channel in it is a Topic. | | `gcp.cloud-tasks` | Google Cloud Tasks. Each Channel in it is a Queue. | | `gcp.managed-kafka` | Google Cloud Managed Service for Apache Kafka. Each Channel in it is a Topic. | | `gcp.firebase-cloud-messaging` | Firebase Cloud Messaging. Each Channel in it is a Push. | **Sync mechanism**: How a Sync kept by no named message keeps its copy. | Value | Means | | --- | --- | | `cdc` | Change data capture: the source database's change log read and applied. | | `etl` | A scheduled extract, transform and load job. | | `file` | An export dropped and picked up. | | `replication` | A database product's own copy feature, between two Components' databases. | **In transit**: What an endpoint states reaches it. Absent, nothing is stated, and it is read from the certificates and transports the model states. | Value | Means | | --- | --- | | `encrypted` | Only encrypted traffic reaches it, whether or not the model states its certificate. | | `plaintext` | Plaintext reaches it: it accepts unencrypted traffic, alone or beside encrypted. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/data.md # Data Say what data the organization holds and how it moves. ## Data, in two dimensions A **domain object** is the concept, *Order*. A **data entity** is a concrete holding of it, *the Order table in the Order Service*. Neither sits above the other; they answer different questions. | | Domain object | Data entity | | --- | --- | --- | | Declared in | A platform or a monolith | A storage, inside the component or monolith that owns it | | Belongs to | Exactly one domain | The component or monolith it sits in | | Carries | How confidential it is, whether it is personal data, and whether it is `canonical` | Its role, structure, properties and policies | One domain object is usually held in several places. Tell the holdings apart with markers: | Marker | Says | Rule | | --- | --- | --- | | `authoritative` | This is the system of record | Exactly one per domain object | | `origin` | Data of this kind is first created here | At least one per domain object | | `from … over …` | This is a replica, kept in step from another holding, by the messages or the mechanism it [carries](https://kanoniq.extenza.dev/docs/language/integration.md#what-a-sync-carries). An entity may have several, all but one marked `reconcile` | Its source can't be transient | | `transient` | Nothing outside this component depends on it | Never syncs in or out | A holding can be several at once: a service that creates and keeps its own orders is both `origin` and `authoritative`. **Authority covers the whole domain object.** One holding is the system of record for all of it, never for some of its properties: a property listed on a replica is a copy. When two systems each own part of one concept, such as a CRM owning the customer and billing owning the customer's payment terms, model each part as its own domain object, *Customer* and *Customer Payment Terms*, each with its own `authoritative` holding. **One owner, always.** Each data entity sits in one storage in one component, or in a monolith that holds its storages itself. A component that needs data it doesn't own goes through the owner, or keeps a replica; two components sharing one database can't be written. **Structure is local.** Within a component, every entity is a `root` or `part of` another, so each component's data is a set of complete trees. `references` links entities in the same component, in one storage or across two of its storages (`references risk-store/exposure`). Between systems, there is no foreign key: what links them is that both hold the same domain object. **Canonical data** is reference data end users don't manage: countries, currencies. **Classification belongs to the concept.** A domain object states two separate things: its confidentiality, how bad a leak would be, and whether it is personal data, whether it identifies a person. A pricing model is confidential and identifies nobody; an employee directory is personal data and may be only internal. Both sit on the domain object, so its copies can't disagree. A holding marks which of its properties are personal, which tells a privacy review where the name and address are kept and where only an id is. **Significant properties.** List the identifier and the few properties that matter, not the full column list. A system that stores only a customer's id holds one property, and that is exactly what a privacy review needs to see. ## Domain object ```kanoniq object order "Order" : sales/selling object @customer "Customer" : sales/selling confidentiality confidential personal-data personal object diagnosis "Diagnosis" : care confidentiality restricted personal-data special-category object @country "Country" : reference confidentiality public personal-data none canonical component records "Records" : backend { sql records-db "Records DB" { root order authoritative origin root @customer authoritative origin root diagnosis authoritative origin root @country authoritative origin } } ``` Declared in a platform or a monolith. After `:` comes the domain that owns it. Then, each optional and in this order: | Part | Means | | --- | --- | | `confidentiality ` | How sensitive it is: one of your repository's levels, least sensitive first in `confidentiality-levels` in `kanoniq.repository.json`. By default they are `public`, `internal`, `confidential` and `restricted`, and a level not listed is [KQ275](https://kanoniq.extenza.dev/docs/rules/kq275.md) | | `personal-data ` | Whether it identifies a person: `none`, `personal`, or `special-category` for health, biometric, genetic, ethnic, political, religious, union, sex life or orientation data and criminal records. `none` says you checked; leaving it out says nothing | | `canonical` | Reference data that end users don't manage, such as countries or currencies | ## Storage and data entity Data is written inside the component that owns it, or in a monolith that holds its storages itself, in a named storage: `sql` (a SQL database), `table` (entities by partition and row key, with no schema, such as Azure Table Storage; not a SQL table), `document` (JSON documents in containers or collections, such as Cosmos DB's NoSQL API or MongoDB), `log` (an append-only store of time-ordered events, such as Application Insights), `file` (a directory), `blob` (a blob container), `key-value` (opaque values by key, such as a Redis cache), `graph` (nodes and edges, such as Cosmos DB for Gremlin or Neptune) or `search-index` (a search index, such as an Azure AI Search index). A storage of any kind sits in the component that owns its data. The product that keeps it, such as Azure Table Storage, is not modeled as a component reached over `http`: at most it is a database server or a storage account the storage is hosted on (see [Writing environments and database servers](https://kanoniq.extenza.dev/docs/language/technology.md#writing-environments-and-database-servers)). ```kanoniq object order "Order" : sales/selling object order-line "Order line" : sales/selling component order-service "Order Service" : backend { sql orders-db "Orders DB" { root order authoritative origin identifier "Order Id" property "Total" references @customer [1] order-line part of order [1..*] authoritative origin identifier "Order Line Id" root platform-channels/@customer from platform-channels/customer-hub over http identifier "Customer Id" } } ``` **An entity is named by the domain object it holds.** `order` above is the `Order` domain object, held in `orders-db`. The domain object is looked up from the component's platform or monolith outward, so write a path when it is declared elsewhere: `root platform-core/payment` holds the `Payment` declared in `platform-core`. The path is from the ecosystem, and the entity is still referred to by its last segment, `payment`, in `references` and `part of`. An entity line reads, in order: | Part | Means | | --- | --- | | `root` | Leads the line when the entity is the top of a tree. Every entity is either `root` or `part of` another | | `part of [n]` | This entity belongs to another in the same storage. `[n]` is how many parts the whole has | | `authoritative` | This holding is the system of record. Exactly one per domain object, in the whole model | | `origin` | Data of this kind is first created here. At least one per domain object | | `transient` | Nothing outside this component depends on it, so it never syncs in or out | | `from over ` | This is a replica, kept in step from that component's copy. Name the component by its path from the ecosystem when it is in another platform: `from platform-channels/customer-hub over http`. A sync states its [scheme](https://kanoniq.extenza.dev/docs/language/identity-and-access.md#authentication) as a connection does: `auth` over a protocol, `sender-auth` and `receiver-auth` over a channel, and may end with what it [carries](https://kanoniq.extenza.dev/docs/language/integration.md#what-a-sync-carries) and `reconcile` | Then, on lines of their own below it: | Line | Means | | --- | --- | | `from over …` | Another [sync](https://kanoniq.extenza.dev/docs/language/integration.md#what-a-sync-carries) into the same entity, written like the first, before the other lines | | `identifier ""` | An identifying property. Several make a composite key | | `property ""` | Another significant property. List the few that matter, not every column | | `… personal` | Ends an `identifier` or `property` line whose data is personal in this holding, `property "Email" personal`. It never sets a level: the domain object's classification holds for every copy. On a domain object stating `personal-data none` it's [KQ276](https://kanoniq.extenza.dev/docs/rules/kq276.md); on one stating no `personal-data`, [KQ124](https://kanoniq.extenza.dev/docs/rules/kq124.md) | | `references [n]` | A reference to another entity in the same storage, with how many it points at. Write `references / [n]` for an entity in another storage of the same component | Multiplicities are `[1]`, `[0..1]`, `[1..*]` and `[0..*]`. **Structure stays inside a component.** `part of` and `references` name entities in the same component. Across systems, the link is that both hold the same domain object. So a component that needs to refer to something another component owns holds its own entity for it, usually a replica, and refers to that: ```kanoniq object account "Account" : sales/selling component ledger "Ledger" : backend { sql ledger-db "Ledger DB" { root account authoritative origin identifier "Account Number" references @customer [1] root platform-channels/@customer from platform-channels/customer-hub over http identifier "Customer Id" } } ``` `references customer` is valid only because `ledger-db` holds a `customer` entity. Without it, the reference has nothing to point at. ## Access Which component of a monolith reads or writes which of the monolith's own tables, written in the monolith's block: ```kanoniq storefront/web writes shop-db/order storefront/web reads shop-db/basket scheduler/import-shipments writes shop-db/shipment ``` `writes` is creating, changing or deleting, and `reads` is reading. Neither implies the other: a component that does both states both, and an import that only inserts states `writes` alone. The same line twice is a repeat ([KQ026](https://kanoniq.extenza.dev/docs/rules/kq026.md)). The source is a component of the monolith, directly or in a module, of any kind, a `job` or a `robot` included. The target is an entity in a storage the monolith holds itself, named by its storage and its object. Data a component holds is that component's, reached by calling it, and another monolith's or a platform's never shares this database ([KQ246](https://kanoniq.extenza.dev/docs/rules/kq246.md)). Name an aggregate by its root, which covers its parts; an entity that is neither a root nor `part of` anything is named itself ([KQ247](https://kanoniq.extenza.dev/docs/rules/kq247.md)). An access creates nothing: an entity that is not there is an unresolved name ([KB003](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb003)). Accesses are optional. A monolith that states none says nothing about who uses its data, and stating one does not ask for the rest. No view draws an access as a line. ## Data uses ```kanoniq data-use payroll "Run payroll" via people/pay basis contract, legal-obligation subjects employee, freelancer data employee-record, salary data-use sick-leave "Record sick leave" via people/absence basis legal-obligation special employment subjects employee data absence-record ``` A data use says why you process personal data, and on what legal ground. Its name is the purpose. Write it in a domain or an ecosystem, which holds it. Its parts, in this order: | Part | Means | | --- | --- | | `via , …` | The domains, function groups or functions of its own ecosystem whose work the purpose covers, each with what is under it. Required | | `basis , …` | The lawful bases of GDPR Art. 6(1): `consent`, `contract`, `legal-obligation`, `vital-interests`, `public-task` or `legitimate-interests` | | `special , …` | For special-category data, the conditions of GDPR Art. 9(2) it is processed under, such as `explicit-consent`, `employment` or `health-care`, or Art. 10's `authorized-by-law` | | `subjects , …` | Whose data it is, as personas: `employee`, `customer` and the others | | `data , …` | The domain objects it processes. A code alone names the domain object of that code in its ecosystem. Required | | `joint , …` | Other ecosystems that decide the purpose with it, its joint controllers | The legal words are not reserved but `contract`, which `basis` still reads, so a code such as `consent` stays legal; a word GDPR doesn't list is [KB084](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb084). The full lists are in the [reference](#reference). **Everything else is read from the model.** Select a data use and the information pane lists, under *Computed*, its systems, the ones realizing what `via` names; its holdings in their storages, with the properties marked `personal`; the copies syncs keep of them; where they run, each stage with the countries they're held in; its transfers, each place its personal data leaves a transfer regime for, with the element receiving it and its ground, or *no ground stated*, or *not stated* where that place isn't known; its controller, its own ecosystem, and its joint ones; its processors, the `saas` components and monoliths among its systems or holding its data; its recipients, the other ecosystems and pool sites its data reaches; and the security measures stated on what reaches them. **What is checked.** A named domain object that is `personal-data none` ([KQ277](https://kanoniq.extenza.dev/docs/rules/kq277.md)) or that its systems don't hold ([KQ278](https://kanoniq.extenza.dev/docs/rules/kq278.md)), `special-category` data with no `special` ([KQ279](https://kanoniq.extenza.dev/docs/rules/kq279.md)), a `special` with no special-category data ([KQ280](https://kanoniq.extenza.dev/docs/rules/kq280.md)), a `via` into another ecosystem ([KQ281](https://kanoniq.extenza.dev/docs/rules/kq281.md)), and `joint` naming its own ecosystem ([KQ282](https://kanoniq.extenza.dev/docs/rules/kq282.md)) are errors. A named domain object stating no `personal-data` ([KQ126](https://kanoniq.extenza.dev/docs/rules/kq126.md)) and a data use with no `basis` ([KQ128](https://kanoniq.extenza.dev/docs/rules/kq128.md)) are lints. Once an ecosystem states one data use, each data entity of personal data in it that no data use holds or copies is a lint too ([KQ127](https://kanoniq.extenza.dev/docs/rules/kq127.md)). ## Reference The element types, relationships and kinds of this area, each with what it means. **Element types** | Element type | What it is | | --- | --- | | Storage | A Storage is where data sits, such as a SQL database or a blob container, owned by the Component or Monolith it sits in. A Storage holds Data Entities. | | Domain Object | A Domain Object is a conceptual thing the organization keeps data about, such as Order. A Domain Object sits in a Platform or a Monolith, belongs to exactly one Domain, and is held in Storages as Data Entities. | | Data Entity | A Data Entity is a tangible holding of a Domain Object, such as the Order table in the Order System. A Data Entity sits in a Storage and represents exactly one Domain Object. | | Data Use | A Data Use is a purpose for which the organization processes personal data, such as running payroll, with the lawful basis it rests on. A Data Use sits in an Ecosystem or a Domain, names the function-side work it covers and the Domain Objects it processes, and its systems, holdings and recipients are read from the model. | **Relationships** | Relationship | What it says | | --- | --- | | Representation | A Representation says which Domain Object a Data Entity is a holding of. Each Data Entity represents exactly one Domain Object. | | Domain Ownership | A Domain Ownership binds a Domain Object to the one Domain it belongs to, apart from the Platform or Monolith that contains it. | | Part Of | A Part Of puts a Data Entity in the local tree of a whole, within one Storage of one Component. Every Data Entity is a root or part of another. | | Reference | A Reference is a foreign key from one Data Entity to another of the same Component, possibly in another of its Storages. A Reference never crosses Components. | | Access | An Access says a Component of a monolith reads or writes a Data Entity in a Storage the monolith holds itself. It names an aggregate by its root, or an entity in no aggregate, and is legal only inside one monolith. | | Replication | A Replication says a DbServer replicates another, in a role. Replication runs between database servers, never between Data Entities. | **Replica role**: The role a replica database server plays for its primary. | Value | Means | | --- | --- | | `failover` | A standby that takes over when the primary fails. | **Storage kind**: A Storage's kind: what sort of store the Storage is. | Value | Means | | --- | --- | | `sql` | A SQL database. | | `file` | A directory of files. | | `blob` | A blob container. | | `table` | Entities by partition and row key, with named properties a query filters on and no schema, such as Azure Table Storage, DynamoDB or Bigtable. A table Storage is not a SQL table. | | `document` | JSON documents in containers or collections, such as Cosmos DB's NoSQL API or MongoDB. | | `log` | An append-only store of time-ordered events, such as Application Insights. | | `key-value` | Opaque values by key, such as a Redis or Valkey cache. | | `graph` | A graph of nodes and edges, such as Cosmos DB for Gremlin, Neptune or Neo4j. | | `search-index` | A search index, such as an Azure AI Search, OpenSearch or Elasticsearch index. | **Cardinality**: How many Data Entities a part-of or reference relationship expects at its far end. | Value | Means | | --- | --- | | `1` | Exactly one. | | `0..1` | Zero or one. | | `1..*` | One or more. | | `0..*` | Zero or more. | **Access mode**: What an Access's Component does with the entity: reads it, or writes it. A Component that does both has one Access of each. | Value | Means | | --- | --- | | `read` | The Component reads the entity. | | `write` | The Component creates, changes or deletes the entity. | **Personal data**: Whether a Domain Object identifies a person. Absent, nothing is stated, which is not none. | Value | Means | | --- | --- | | `none` | Identifies no person. | | `personal` | Identifies a person, directly or with other data (GDPR Art. 4(1)). | | `special-category` | Health, biometric, genetic, ethnic, political, religious, union membership, sex life or orientation (GDPR Art. 9), or criminal records (GDPR Art. 10). | **Legal basis**: A lawful basis for processing personal data, one of GDPR Art. 6(1)'s six. | Value | Means | | --- | --- | | `consent` | The data subject has given consent (GDPR Art. 6(1)(a)). | | `contract` | Processing is necessary for a contract with the data subject, or for steps before entering one (GDPR Art. 6(1)(b)). | | `legal-obligation` | Processing is necessary to comply with a legal obligation (GDPR Art. 6(1)(c)). | | `vital-interests` | Processing is necessary to protect someone's vital interests (GDPR Art. 6(1)(d)). | | `public-task` | Processing is necessary for a task in the public interest or in official authority (GDPR Art. 6(1)(e)). | | `legitimate-interests` | Processing is necessary for legitimate interests not overridden by the data subject's (GDPR Art. 6(1)(f)). | **Special condition**: A condition for processing special-category data, one of GDPR Art. 9(2)'s ten or Art. 10's authorization by law, on top of an Art. 6(1) basis. | Value | Means | | --- | --- | | `explicit-consent` | The data subject has given explicit consent (GDPR Art. 9(2)(a)). | | `employment` | Processing is necessary under employment, social security or social protection law (GDPR Art. 9(2)(b)). | | `vital-interests` | Processing is necessary to protect the vital interests of a person unable to consent (GDPR Art. 9(2)(c)). | | `not-for-profit` | Processing by a not-for-profit body about its members (GDPR Art. 9(2)(d)). | | `made-public` | The data subject has manifestly made the data public (GDPR Art. 9(2)(e)). | | `legal-claims` | Processing is necessary for legal claims or courts acting judicially (GDPR Art. 9(2)(f)). | | `substantial-public-interest` | Processing is necessary for reasons of substantial public interest under law (GDPR Art. 9(2)(g)). | | `health-care` | Processing is necessary for medicine, health or social care (GDPR Art. 9(2)(h)). | | `public-health` | Processing is necessary for reasons of public interest in public health (GDPR Art. 9(2)(i)). | | `archiving-research` | Processing is necessary for archiving, research or statistics in the public interest (GDPR Art. 9(2)(j)). | | `authorized-by-law` | Processing of criminal convictions and offences is authorized by law (GDPR Art. 10). | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/identity-and-access.md # Identity and access Say who signs in where, and with which role. ## People People come into a model as **identities** and **roles**, never as individuals. A component or a monolith marked `idp` is an **identity provider**, such as Entra ID or Keycloak; it is a component in every other respect. An identity sits in its provider; a role sits in the application people use through it, a component or a monolith holding a user interface of its own, and names its provider. An application nobody signs into, such as a public site, a local tool or a kiosk, is marked `anonymous` instead and holds no role. Each identity and each role has one **persona**: | Persona | | | --- | --- | | `employee` | Internal | | `freelancer` | Internal | | `customer` | External | | `b2b-representative` | External | | `auditor` | External | **A role's holders are computed:** every identity of its persona in its provider. You never assign one, so a role can't be held by the wrong people, and a role whose provider has no identity of its persona is an error ([KQ042](https://kanoniq.extenza.dev/docs/rules/kq042.md)). A role uses its application's user interfaces, also without a statement; where it uses only some of them, it says which with `ui` (`clerk -> desktop over ui`), and then uses those only. A role's `ui` stays in its own application ([KQ085](https://kanoniq.extenza.dev/docs/rules/kq085.md)). An identity no role uses is fine: a directory exists before any application signs in through it. The [IAM view](https://kanoniq.extenza.dev/docs/views/iam.md) draws identities and roles; the other views leave them out. A **job role** is a position in the organization, a mechanic or a claims handler, and **holds** the roles a person in it gets in each application. It sits in its ecosystem, never in a domain, has an internal persona, and is the lane of a business process. Nothing assigns a person to it. See [Job roles](#job-roles). ## Workloads A service has an identity of its own, as people do. A **workload identity** is a workload's identity at an identity provider: a managed identity, an app registration or a service account. A **client** workload identity is what the workload signs in as; it holds its **credential** (a `secret` or a `certificate` kept in a [vault](https://kanoniq.extenza.dev/docs/language/technology.md#infrastructure), a `federated` token from an outside issuer, or `managed` by the platform) and is **granted** roles. A **server** workload identity is what an API is known as, and declares the roles a client may be granted: an **app role**, for one service calling another as itself, or a **scope**, for a service calling on behalf of a user. A workload identity sits in the component or monolith whose identity it is, or in a platform when several components share it. A grant is written on the client, and a role it names that the server doesn't declare is created. See [Workload identities and grants](#workload-identities-and-grants). ## Identity providers, identities and roles People are modeled where your landscape knows them: as accounts in an identity provider, and as the roles those accounts have in the applications they use. A model never names a person. ```kanoniq platform iam "Identity" { component staff-idp "Staff directory" : saas idp technology "Entra ID" { identity staff "Staff" : employee identity contractors "Contractors" : freelancer } component customer-idp "Customer identity" : saas idp technology "Azure AD B2C" { identity customers "Customers" : customer } } platform internet-banking "Internet Banking" { component web-app "Web Application" : user-facing-app technology "Java and Spring MVC" { spa web-ui "Internet Banking" role account-holder "Account holder" in iam/customer-idp : customer } } monolith mainframe "Mainframe Banking System" : custom idp { identity operators "Operators" : employee desktop-app terminal "Terminal" role back-office "Back office" in mainframe : employee } ``` - **`idp`** after a component's or a monolith's kind, before `technology`, marks it an identity provider: Entra ID, Keycloak, a mainframe's own user store. - **`anonymous`** in the same place says nobody signs into the application: a public site, a local tool such as VS Code or a command line, a kiosk. It holds no role and is never an identity provider. Leave it off where the roles just aren't written yet. - **`bounded-context`**, last on the line, after `technology` and before `big-ball-of-mud`, marks a component a bounded context of its own. A platform takes it after its name, a monolith after its kind and its marks, and a module after its kind and `technology`: `module billing "Billing" : grouping bounded-context`. Contexts don't nest, so no component may be in two ([KQ095](https://kanoniq.extenza.dev/docs/rules/kq095.md)). - **`identity "" : `** is a population of accounts of one persona, written inside its identity provider. - **`role "" in : `** is an app role, written inside the application people use, a component or a monolith with a user interface of its own. `in` names the identity provider, looked up from the platform or monolith the role is in, and may reach another platform or ecosystem. A monolith that keeps its own accounts names itself. - **A persona** is one of `employee`, `freelancer` (internal), `customer`, `b2b-representative` or `auditor` (external). An internal auditor is an `employee`. Every persona is a reserved word, so a Code that is one is written with an `@`, such as `@customer`. - **Who holds a role is not written.** It is every identity of the role's persona in the provider it names. What a role uses is not written either: the user interfaces of the application it is in. ## Job roles A job role is a position in your organization: a mechanic, a claims handler, a controller. It says why people have the access they have, and it is the lane of a [business process](https://kanoniq.extenza.dev/docs/language/processes.md#writing-a-business-process). It never names a person. ```kanoniq ecosystem bikes { /// Repairs bikes in the workshop and takes the parts from stock. job-role mechanic "Mechanic" : employee { holds workshop/app/mechanic holds stock/app/picker } } ``` - **`job-role "" : `** is written in an ecosystem, never in a domain: a position works across domains. Its persona is `employee` or `freelancer`; a customer or a partner is not a position ([KQ233](https://kanoniq.extenza.dev/docs/rules/kq233.md)). - **`holds `** names a role a person in that position gets in one application. The path may reach another ecosystem, and names a `role` only. The role's persona is the job role's ([KQ234](https://kanoniq.extenza.dev/docs/rules/kq234.md)). - **A job role that holds nothing is fine**: a position is real before its access is written. Once an ecosystem has a job role, a role of an internal persona that no job role holds is reported, as access no position explains ([KQ120](https://kanoniq.extenza.dev/docs/rules/kq120.md)). ## Workload identities and grants A service signs in as itself, with an identity of its own at an identity provider: a **workload identity**. Write it in the component or monolith whose identity it is. ```kanoniq platform iam "Identity" { component platform-idp "Platform identity" : saas idp technology "Entra ID" vault secrets "Secrets" : azure.key-vault environment PRD x1 } platform payments "Payments" { component payments "Payments" : backend { workload payments-api "Payments API" : server in iam/platform-idp { app-role write "Payments.Write" scope read "Payments.Read" } } } platform orders "Orders" { component orders "Orders" : backend { workload orders-app "Orders" : client in iam/platform-idp { environment PRD credential secret stored-in iam/secrets rotate P90D } } orders -> payments/payments/api over http auth client-credentials via iam/platform-idp grant write orders -> iam/secrets over http } ``` | Line | Means | | --- | --- | | `workload "" : client in ` | What the service signs in as. `in` names the identity provider, as a role's does | | `workload "" : server in ` | What an API is known as, declaring the roles a client may be granted | | `app-role ""` | A role for a service calling as itself; the value is what its token carries | | `scope ""` | A role for a service calling on behalf of a user | | `credential secret stored-in rotate P90D` | A secret the service keeps, in a vault, replaced every 90 days. `certificate` works the same way | | `credential federated from subject ""` | No secret: the service trades a token from an outside issuer, such as a CI pipeline's, marked `idp` | | `credential managed` | No secret: the platform the service runs on holds it | | `environment ` | The stage it's registered in | | `used-by because ""` | People sign in as it. Always a warning, so say why | **`stored-in`** names a `vault`, an element of its own (see [Writing infrastructure](https://kanoniq.extenza.dev/docs/language/technology.md#writing-infrastructure)), never a component. **A credential is part of its workload identity's declaration.** To change it in a later plateau, or keep it in another vault, declare the workload identity again there with its `credential` line; declared again without one, it has none from there on. **A grant gives a client one role.** Write it on the call, after the scheme: `grant write` names a role of the server workload identity of the component the call lands on, and `grant "Storage Blob Data Reader"` a role the cloud defines on it. For a grant with no call, write it in the client's block: `grant payments/payments/payments-api/write`, or `grant "Contributor" on payments/payments` for a deployment right. A role the server doesn't declare is created for you, like an interface a call names, and kept in `.g.kq`. **A shared workload identity** goes in a platform, and a component that runs as it says so with `runs-as iam/shared`. ## Authentication Say how the caller proves who it is with `auth` after the transport, and which identity provider issues its token with `via`. Both are optional; leave `auth` out and nothing is said, which is not the same as `auth none`, saying on purpose that nobody is checked. ```kanoniq portal-bff -> orders/api over http/json auth user-token via iam/customer-idp orders -> payments/api over http auth on-behalf-of via iam/customer-idp orders -> stripe/api over http auth key orders -> events/orders auth workload-identity orders -> billing over events/orders sender-auth workload-identity receiver-auth key ``` | Scheme | Use it for | | --- | --- | | `none` | Nobody is checked: a public endpoint, an open relay, an anonymous bind | | `key` | A secret the caller stores: a password, an API or subscription key, a SAS token, a connection string, a signed webhook, an SNMP community string | | `certificate` | A key pair the caller holds: a client certificate (mTLS), an SSH key | | `client-credentials` | The application's own OAuth 2.0 or OIDC token | | `workload-identity` | A token the platform obtains for the caller, with no secret in its configuration: a managed identity, an IAM role, a cloud service account | | `user-token` | The signed-in user's token, passed on unchanged: a bearer token, a session cookie from a user interface to its BFF | | `on-behalf-of` | A token the caller gets for itself by exchanging the user's token and its own credential, still carrying the user: the on-behalf-of flow, a token exchange | | `kerberos` | Windows integrated authentication: Kerberos, NTLM, Negotiate | Schemes are named by how the credential works, never by product: a managed identity in Azure and an IAM role in AWS are both `workload-identity`, and a password and an API key are both `key`. **Each transport takes the schemes it can carry.** A scheme the transport doesn't accept is an error ([KQ060](https://kanoniq.extenza.dev/docs/rules/kq060.md)): | Transport | Accepts | | --- | --- | | `http`, `graphql` | every scheme | | `grpc`, `web-socket`, `signal-r` | every scheme but `kerberos` | | `ldap` | `none`, `key`, `certificate`, `kerberos` | | `email`, as a protocol or a broker | `none`, `key`, `client-credentials`, `workload-identity` | | `snmp` | `key` | | `kafka` | `none`, `key`, `certificate`, `client-credentials`, `workload-identity`, `kerberos` | | `rabbitmq`, `activemq`, `mqtt` | `none`, `key`, `certificate`, `client-credentials` | | `redis-pub-sub`, `redis-streams` | `none`, `key`, `certificate`, `client-credentials`, `workload-identity` | | `azure.service-bus.queues`, `azure.service-bus.topics`, `azure.event-hubs`, `azure.event-grid`, `azure.storage-queue`, `sms`, `push`, a `blob-storage` channel | `key`, `client-credentials`, `workload-identity` | | a `file-share` channel | `key`, `workload-identity`, `kerberos` | | an `sftp` channel | `key`, `certificate` | | `in-process` | nothing: there is nobody to authenticate to | | `ipc` | nothing: who may open a local channel is the operating system's business | | `rpa.queues` | nothing: the queues are the RPA product's own | Every other provider's broker word, such as `aws.sqs`, accepts the schemes listed for it in Kanoniq's registry. **`via` goes only with a token**: `client-credentials`, `workload-identity`, `user-token`, `on-behalf-of` or `kerberos`. It names a component or monolith marked `idp`, by its path as a role's `in` does, and may reach into another platform or ecosystem. Leave it out when the provider is a partner's or a cloud's and not in your model. **A path into a broker is two arrows**, so it states two schemes: `sender-auth` for the sender's credential at the broker, then `receiver-auth` for the receiver's, each with its own `via`. A plain `auth` there is an error, and so are `sender-auth` and `receiver-auth` on a single arrow. On a one-sided leg such as `orders -> events/orders`, `auth` is that component's credential at the broker. Where two statements mean the same leg, it takes the scheme either states; two different ones are an error ([KQ063](https://kanoniq.extenza.dev/docs/rules/kq063.md)). **`user-token` or `on-behalf-of`?** If the service passes the user's token along as it is, that's `user-token`. If it trades the user's token for one of its own, issued to it for the downstream API, that's `on-behalf-of`: the downstream API still sees the user, and the service needs its own credential to make the exchange. ## Reference The element types, relationships and kinds of this area, each with what it means. **Element types** | Element type | What it is | | --- | --- | | Identity | An Identity is a population of accounts of one persona in one Identity Provider, such as the staff in the corporate directory. An Identity's parent is its Identity Provider. | | Role | A Role is an app role: the capacity in which accounts use one user-facing application. A Role sits in that application, has one persona, and is held by every Identity of its persona in the Identity Provider it names. | | Workload Identity | A Workload Identity is a workload's identity at an Identity Provider, such as a managed identity, an app registration or a service account. A Workload Identity sits in the Component or Monolith whose identity it is, or in a Platform when several Components share it. | | Permission | A Permission is a role a server Workload Identity declares, which a client Workload Identity may be granted. A Permission's name is the value its token carries. | | Job Role | A Job Role is a position in the organization, such as Mechanic or Claims handler: who does the work, and why a person has the access they have. A Job Role sits in its Ecosystem, has one internal persona, and holds app Roles. | **Relationships** | Relationship | What it says | | --- | --- | | Grant | A Grant assigns one role to one client Workload Identity: a Permission of a server Workload Identity, or a role the cloud defines on a resource. | | Runs As | A Runs As says a Component or Monolith runs as a Workload Identity it does not own, or as a person's Identity, which validation reports. | | Used By | A Used By says people sign in as a Workload Identity, with the reason. Validation always reports it. | | Holds | A Holds says a Job Role is granted an app Role: what a person in that position can do in one application. | **Persona**: A persona: a kind of person, never an individual. A persona is the kind of an Identity and of a Role, and is internal or external by what it is. | Value | Means | | --- | --- | | `employee` | A person employed by the organization, an internal persona. An internal auditor is an Employee. | | `freelancer` | A freelancer working for the organization, an internal persona. | | `customer` | A customer of the organization, an external persona. | | `b2b-representative` | A person representing a business partner, an external persona. | | `auditor` | An external auditor, an external persona. | **Workload identity kind**: A Workload Identity's kind: whether a workload signs in as the Workload Identity, or an API is known by it. | Value | Means | | --- | --- | | `client` | A client Workload Identity: what a workload signs in as. A client Workload Identity holds its credential and is granted roles. | | `server` | A server Workload Identity: what an API is known as. A server Workload Identity declares the Permissions a client may be granted. | **Permission kind**: A Permission's kind: an application permission or a delegated one. | Value | Means | | --- | --- | | `app-role` | An application permission, for calls from one workload to another with no user involved. | | `scope` | A delegated permission, for calls made on behalf of a signed-in user. | **Credential kind**: How a client Workload Identity's credential is held. The kind decides which authentication schemes the credential carries. | Value | Means | | --- | --- | | `secret` | A client secret. A Secret credential carries the client-credentials, key and on-behalf-of schemes. | | `certificate` | A certificate. A Certificate credential carries the client-credentials, certificate and on-behalf-of schemes. | | `federated` | A trust in a token another Identity Provider issues. A Federated credential carries the workload-identity, client-credentials and on-behalf-of schemes. | | `managed` | A managed identity, whose credential the platform the workload runs on holds. A Managed credential carries the workload-identity scheme only. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/technology.md # Technology Say where each system runs and what hosts its data. ## Environments and database servers An **environment** is one of six fixed stages, `DEV`, `TST`, `ACC`, `UAT`, `EPH` and `PRD`, read as Development, Test, Acceptance, User acceptance, Ephemeral and Production. The ecosystem declares the ones it uses, once, shared by all its platforms and monoliths. A component, a deployable module, a monolith or a broker says which stages it runs in, and how many instances; a user interface says only which, since it runs on each user's device; devices your organization places, such as ATMs, are a host that says how many. A part runs only where what holds it runs. A part may run in one stage on several hosts or platforms, each with its own count, which is how a stage spans regions. A part that says nothing about environments is not placed anywhere by default. A **database server** is a database engine, technology drawn in green like a broker. Its kind is the engine, such as `postgresql`, or a provider's product word, such as `azure.sql-database`, and it runs as the rest of the [infrastructure](#infrastructure) does. It runs in one stage and may hold pools, capacity its databases share. A storage names the servers it is hosted on, and the pool it is in, and runs where they do, and a replica names its primary, as a `failover`. Replication between two servers is not a sync: a sync copies entities between components. ## Infrastructure **The infrastructure is what parts run on and requests pass through**, each element in one stage. It is written out, element by element; nothing is assumed from a product you didn't name. | Infrastructure element | Use it for | | --- | --- | | **Data center** | A building your organization or a colocation supplier runs, in a country, holding every stage, with its own zones | | **Network** | A private network, `vnet`, `vpc`, `lan`, or a `hub` the others attach to | | **Host** | A machine your organization runs: a `vm`, a `physical` server, or a `device` such as an ATM. A scale set is one host whose count is a range | | **Installation** | Software installed on a host: an `os`, a `runtime`, an `sdk`, a `web-server` or `middleware`, in its host's stage. A host's operating system is one | | **App platform** | Where application code runs: `kubernetes`, `app-hosting`, `functions`, `containers`, `workflows`, `data-pipelines`, `static-sites`, `ci-runners` | | **Database server** | A database engine, with its pools | | **Gateway** | Something requests pass through: an `api-gateway`, a load balancer, an `edge`, an `ingress`, a `firewall`, a `nat`, a `bastion`. It names the APIs it publishes and what it forwards to | | **DNS record** | A host name pointing at an endpoint, in a `public` or a `private` zone | | **Certificate** | A TLS certificate, by its subject: who issued it, how often it is rotated and the vault it is stored in, or `managed` by what serves it | | **Storage account** | What a provider bundles under one account: its `blob`, `file` and `table` storages and its queues. A bucket, such as `aws.s3`, is a storage account holding one storage | | **Vault** | Where secrets, keys and certificates are kept, the ones its kind holds | | **Registry** | Repositories of packages and images, each with its format, such as `oci` or `npm` | | **AI platform** | Where the model deployments your systems call run | | **Backup vault** | Where backups are kept. A storage, a host or a database server says it is backed up there, and for how long | | **Security service** | What watches the stages it covers: `posture`, `threat-detection`, `vulnerability-scanning`, `siem` | - **A kind is a generic kind or a provider's product word.** A product word, such as `azure.postgresql` or `aws.rds.postgresql`, names the product in its provider's namespace and fixes its generic kind and how it runs, so a policy on `postgresql` reaches it. A product with no word of its own is the generic kind, with the product in `technology`. - **A platform service states how it runs**: `paas`, run by its provider, or `on` a host or app platform of your own. App platforms, database servers, gateways, brokers, storage accounts, vaults, registries, AI platforms, backup vaults and security services are platform services. Neither way is a default: one that states neither says nothing about how it runs, which is an error for a generic kind ([KQ261](https://kanoniq.extenza.dev/docs/rules/kq261.md)). - **A link joins two networks of one stage**, a relationship of kind `peering`, `vpn`, `private-link` or `dedicated`: linked networks reach each other, and nothing more is said about routing. - **`in` places a host or a platform service in a network**, and `public` makes it reachable from the internet as well. A `paas` element with no `in` is public. - **A part says what it runs on** in each stage, a host or an app platform, with `on` on its `environment` line. A user interface may run on a storage account, as a static site, and an agent on an AI platform. - **Exposure is worked out, never written; encryption in transit is worked out unless you state it.** Whether an endpoint is reachable from the internet, Kanoniq reads from where it and the gateways publishing it are placed. Whether what reaches it is encrypted, it reads from what an API or a broker states with `in-transit` ([Interface](https://kanoniq.extenza.dev/docs/language/applications.md#interface)), else from the certificates served, the transports that take no plaintext and the calls made with `auth certificate`, for your [policies](https://kanoniq.extenza.dev/docs/language/governance.md#what-a-clause-can-name). - **Where something runs is a location and its zones.** A network, a host or a platform service states its region, a location word such as `azure.westeurope`, or the data center it is in; what is in a network is where the network is. A part is where what it runs on is, worked out, and a saas component states its own region or country. An environment states none, since one stage may span regions. Zones are the provider's names for the zones an element spans, or `zone-redundant` where the provider spreads it. Nothing is assumed: where nothing says it, the location is unstated. Subnets, security groups and route tables are not modeled. See [Writing infrastructure](#writing-infrastructure) for how to write each, and [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) for the rules. ## Writing environments and database servers ```kanoniq ecosystem big-bank "Big Bank plc" { environments DEV, PRD db-server db-live "Oracle - Primary" technology "Oracle 12c" environment PRD x1 db-server db-standby "Oracle - Secondary" technology "Oracle 12c" environment PRD x1 replica of db-live failover monolith internet-banking "Internet Banking System" : custom { module api-tier "API tier" : deployable technology "Java and Spring MVC" { environment PRD x8 environment DEV x1 component api "API Application" : backend { sql database "Database" on db-live, db-standby } } spa web-ui "Single-Page Application" technology "JavaScript and Angular" { environment PRD } } } ``` - **`environments`** names the stages the ecosystem uses, once, shared by every platform and monolith in it. A stage is one of six, in capitals: `DEV`, `TST`, `ACC`, `UAT`, `EPH` and `PRD`, read as Development, Test, Acceptance, User acceptance, Ephemeral and Production. You can't name one of your own. - **`environment x`** says a part runs there, with that many instances: `environment PRD x8`. Write it in a component, a `deployable` module, a monolith or a broker, a line per stage, first in the block and on the declaration, not in a reopening ([KB007](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb007)); a `grouping` module takes none ([KB010](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb010)). A stage may take several lines, each `on` a different host or platform, `environment PRD x2 on aks-weu` and `environment PRD x2 on aks-neu` ([KQ295](https://kanoniq.extenza.dev/docs/rules/kq295.md)). A user interface takes `environment ` with no count, in a block of its own, since it runs on each user's device. - **`on `** after the count, or after the stage where there is none, says what the part runs on there: `environment PRD x3 on aks-prd`, or a client's `environment PRD on atms` on a device. It may also name a storage account, for a client served from it as a static site, or an AI platform, for an agent built on it. Without `on`, the line says nothing about what the part runs on. - **A part runs where what holds it runs.** A component in a deployable module or a monolith states only the holder's stages, or none to run wherever its holder does. A user interface in its backend component runs only where that component runs. - **No `environment` says nothing.** It is not a default, and a model that never mentions environments is complete. - **A database server** is declared in an ecosystem, a platform or a monolith, like a broker, with its one stage and count after `environment`. Written with its kind, `db-server "" : …`, it says how it runs and where, as the rest of the [infrastructure](#infrastructure) does, and takes `technology` after the count; written with no kind, its product goes after `technology`, before `environment`, and it says nothing of how it runs. `replica of failover` names the primary it replicates, in the same stage. Its block holds its **pools**, `pool ""`, capacity its databases share, such as an elastic pool. - **A storage names its servers** after its name, with `on`: database servers, or a storage account. Its component runs in each of those servers' stages. **`pool `** after them names the pool it is in, and **`backup retain `** where it is backed up and for how long: `sql orders "Orders" on sql-prd pool shared backup bv-prd retain P35D`. A stage states no location: where something runs is written on the network or the element that is there, as [Writing infrastructure](#writing-infrastructure) says. ## Writing infrastructure The hosts, platforms, gateways and services your parts run on and your requests pass through, each in one stage: ```kanoniq ecosystem shop "Shop" { environments PRD data-center dc-ams "Amsterdam DC1" country NL technology "Equinix AM3" { zone hall-a } network spoke-prd "Shop production VNet" : vnet location azure.westeurope environment PRD network hub-prd "Hub" : azure.virtual-wan location azure.westeurope environment PRD network dc-lan "DC LAN" : lan location dc-ams environment PRD host web "Web servers" : azure.vm-scale-set in spoke-prd zones 1, 2, 3 environment PRD x2..10 installation ubuntu "Ubuntu" : os on web version "22.04" host vm-db "DB VM" : vm in dc-lan zones hall-a environment PRD x1 host atms "ATMs" : device kiosk environment PRD x2400 app-platform aks-prd "AKS production" : azure.aks in spoke-prd environment PRD x1 technology "AKS 1.30" db-server orders "Orders DB" : postgresql on vm-db environment PRD x1 db-server sql-prd "Orders SQL" : azure.sql-database in spoke-prd zone-redundant environment PRD x1 { pool shared "Shared pool" } gateway apim "API Management" : azure.api-management in hub-prd environment PRD x1 publishes payments/api/rest forwards-to aks-prd waf gateway front "Front Door" : azure.front-door environment PRD x1 forwards-to apim dns api "api.shop.com" : azure.dns -> front environment PRD certificate api-cert "api.shop.com" issuer "DigiCert" rotate P1Y served-by front environment PRD storage-account st-prd "Payments storage" : azure.storage-account in spoke-prd environment PRD x1 { broker queues "Queues" : azure.storage-queue } vault kv-prd "Payments vault" : azure.key-vault in spoke-prd environment PRD x1 registry acr "Container registry" : azure.container-registry in hub-prd environment PRD x1 { repository images oci } ai-platform foundry-prd "Foundry" : azure.foundry in spoke-prd environment PRD x1 { model gpt "GPT-4.1" } backup-vault bv-prd "Backups" : azure.backup-vault location azure.northeurope environment PRD x1 security-service defender "Threat detection" : threat-detection paas environment PRD x1 covers PRD dns sql-dns "orders-sql.database.windows.net" : azure.private-dns in spoke-prd -> sql-prd environment PRD dns storage-dns "paymentsstorage.blob.core.windows.net" : azure.private-dns in spoke-prd -> st-prd environment PRD dns foundry-dns "foundry.openai.azure.com" : azure.private-dns in spoke-prd -> foundry-prd environment PRD dns acr-dns "shopacr.azurecr.io" : azure.private-dns in hub-prd -> acr environment PRD dns vault-dns "paymentsvault.vault.azure.net" : azure.private-dns in spoke-prd -> kv-prd environment PRD dns apim-dns "shop.azure-api.net" : azure.private-dns in hub-prd -> apim environment PRD platform payments "Payments" { component genesys "Genesys Cloud" : saas location aws.eu-central-1 component api "Payments API" : backend { environment PRD x3 on aks-prd http-api rest "Payments API" sql payments "Payments" on sql-prd pool shared backup bv-prd retain P35D blob receipts "Receipts" on st-prd } api -> foundry-prd/gpt over http auth workload-identity } link hub-prd <-> spoke-prd : peering } ``` The infrastructure is declared in an ecosystem, and so is a `data-center`. An `app-platform`, a `db-server`, a `gateway`, a `storage-account`, a `vault`, a `registry`, an `ai-platform`, a `backup-vault` and a `security-service` may also be declared in a platform or a monolith, as a broker is. Each states its one stage on its own line, `environment ` with its count where it has one, never in a block. Each is declared once and never reopened. Its clauses come in this order: | Declaration | After the name | After the stage | | --- | --- | --- | | `data-center ""` | `country `, `technology ""`, its block of zones | it states no stage | | `network ""` | `: `, `location` | `ddos` | | `host ""` | `: `, a device's word, `on `, `in `, `public`, `location`, `zones` or `zone-redundant` | its count, `technology ""`, `backup` | | `installation ""` | `: `, `on ` | it states no stage | | `app-platform ""` | `: `, how it runs, `in `, `public`, `location`, `zones` or `zone-redundant` | its count, `technology`, `uses` | | `db-server ""` | `: `, how it runs, `in `, `public`, `location`, `zones` or `zone-redundant` | its count, `technology`, `replica of`, `uses`, `backup`, its block of pools and brokers | | `gateway ""` | `: `, how it runs, `in `, `public`, `location`, `zones` or `zone-redundant` | its count, `technology`, `uses`, `publishes`, `forwards-to`, `waf`, `ddos` | | `dns ""` | `: `, `in `, `-> ` | nothing | | `certificate ""` | `issuer ""`, then `managed`, or `rotate ` and `stored-in `, then `served-by , …` | nothing | | `storage-account ""` | `: `, how it runs, `in `, `public`, `location`, `zones` or `zone-redundant` | its count, `technology`, `uses`, its block of brokers | | `vault ""`, `backup-vault ""` | `: `, how it runs, `in `, `public`, `location`, `zones` or `zone-redundant` | its count, `technology`, `uses` | | `registry ""` | `: `, how it runs, `in `, `public`, `location`, `zones` or `zone-redundant` | its count, `technology`, `uses`, its block of repositories | | `ai-platform ""` | `: `, how it runs, `in `, `public`, `location`, `zones` or `zone-redundant` | its count, `technology`, `uses`, its block of model deployments | | `security-service ""` | `: `, how it runs, `on` a database server too, `in `, `public`, `location`, `zones` or `zone-redundant` | its count, `technology`, `uses`, `covers , …` | - **The kind follows `:`**: a generic kind, such as `vm` or `postgresql`, or a provider's product word, kebab-case words joined by dots, such as `azure.postgresql` or `aws.rds.postgresql`, which fixes what the element is and how it runs. Neither is a reserved word, so `vm` or `edge` stays a Code you can use. A word that is neither, for the element it follows, is [KB079](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb079). A `host` of kind `device` says what it is with a second word, `: device kiosk`. - **How a platform service runs** follows its kind: `paas`, run by the provider, or `on `, run on your own. Neither is a default; a generic kind that states neither is [KQ261](https://kanoniq.extenza.dev/docs/rules/kq261.md). A product word already says how it runs, so `paas` after one is [KQ262](https://kanoniq.extenza.dev/docs/rules/kq262.md). A `host` may run `on` another host, a VM on a physical server. - **`in `** places a host or a platform service in a network, reached there by a private endpoint where the provider runs it; **`public`** after it says it is reachable from the internet too. - **`location `** says where an element is: a region, as its provider spells it in its namespace, `azure.westeurope`, `aws.us-east-1`, `gcp.europe-west4`, or a `data-center` by its Code. A region the registry doesn't hold is [KB089](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb089). A network states it where it is regional, and an element in it states none of its own ([KQ292](https://kanoniq.extenza.dev/docs/rules/kq292.md)); a host or a platform service in no network, or in one that states none, states its own. A `saas` component or monolith states its own after its kind, `component genesys "Genesys Cloud" : saas location aws.eu-central-1`, or `country ` where its vendor gives only a country. Any other component states none: it is where what it runs on is. - **`zones , …`** names the zones a host or a platform service spans, in its provider's names, `zones 1, 2, 3` in Azure, `euw1-az1` in AWS, `europe-west4-a` in GCP, or its data center's own; each is one its location has ([KQ293](https://kanoniq.extenza.dev/docs/rules/kq293.md)). **`zone-redundant`** says the provider spreads it without you naming them, and takes no `zones` ([KQ294](https://kanoniq.extenza.dev/docs/rules/kq294.md)). - **A `data-center`** is a building, `data-center dc-ams "Amsterdam DC1" country NL technology "Equinix AM3"`, its country two capitals ([KB085](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb085)) and `technology` the facility. It holds every stage, so it states no `environment`; its block declares its zones, `zone hall-a`, one a line. - **An `installation`** is software installed on a host: `installation jre "Java" : runtime on vm-db version "17"`. Its kind is `os`, `runtime`, `sdk`, `web-server` or `middleware`, and `on ` is mandatory: one with none, or on anything but a host, is [KQ266](https://kanoniq.extenza.dev/docs/rules/kq266.md). It is declared where its host is, and states no `environment` and no count: it is in its host's stage, with its host's count. Nothing is deployed `on` an installation; a component runs on the host beside it. A host has no `os`: its operating system is an installation of kind `os`. - **A host's count may be a range**, `x2..10`, for a scale set or an autoscaling group. Only a host takes one. A network, a DNS record and a certificate state their stage with no count. - **`uses , …`** names a part a platform service needs itself, such as the storage account a Functions app needs, not one its components call. What an element names stays in its stage, a registry aside ([KQ259](https://kanoniq.extenza.dev/docs/rules/kq259.md)). - **A gateway** `publishes` the APIs it exposes and `forwards-to` gateways, hosts and app platforms. **`waf`** says it filters requests with a web application firewall, and **`ddos`**, on a gateway or a network, that it has DDoS protection beyond the provider's base. A call names the gateway it goes through with `via` (see [Connections](https://kanoniq.extenza.dev/docs/language/integration.md#connections)). - **A `dns` record's name is its host name.** Its zone, `public`, `private` or a product word, follows `:`, and `->` names what it points at: a gateway, a host, a platform service or an API. A private zone states `in ` ([KQ260](https://kanoniq.extenza.dev/docs/rules/kq260.md)). - **A `certificate`'s name is its subject.** `managed` says what serves it also issues, stores and renews it, so it takes no `rotate` and no `stored-in`. `served-by` names what serves it. - **A `storage-account`** holds what its provider bundles: a `blob`, `file` or `table` storage names it after `on`, as it names a database server, and its block holds its queue broker. A bucket, `aws.s3` or `gcp.cloud-storage`, is a storage account holding one storage. A client served from it as a static site names it on its `environment` line: `environment PRD on web-bucket`. - **A `vault`** is what a credential and a certificate are `stored-in`. A call to it lands on it, `orders -> kv-prd over http auth workload-identity`. - **A `registry`**'s block holds its repositories, **`repository [""] `**, the format one of `oci`, `npm`, `nuget`, `maven`, `pypi`, `go`, `cargo`, `rubygems`, `swift`, `helm`, `terraform`, `apt`, `yum` and `generic`. - **An `ai-platform`**'s block holds its model deployments, **`model ""`**, named after the model. A call lands on a deployment by its path, `api -> foundry-prd/gpt over http`, and an agent built on the platform is a component whose `environment` line names it after `on`. - **`backup retain `**, on a host, a database server or a storage, says where it is backed up and for how long. - **A `security-service`** of kind `posture`, `threat-detection`, `vulnerability-scanning` or `siem` names the stages it watches with **`covers , …`**; a `siem` runs `on` the database server that is the log store it reads. - **`link <-> : `** joins two networks of one stage, in an ecosystem's block, after its declarations. It has no Code; a `-` before it removes it in a later plateau. A product the registry has no word for is the generic kind, with the product in `technology`. See [Infrastructure](#infrastructure) for what each element means. ## Writing the life cycle **A component, a monolith, a host, an installation and every platform service** may say where it is in its life, what you intend for it, its version and its vendor's dates. A network, a link, a DNS record and a certificate state none. Moving an ERP to a new stack: ```kanoniq host erp-old "ERP VM, old stack" : vm in dc-lan environment PRD x1 status phasing-out future replace successor erp-new installation win2016 "Windows Server" : os on erp-old version "2016" status phasing-out end-of-extended-support 2027-01-12 db-server erp-db "ERP DB" : sql-server on erp-old environment PRD x1 version "2016" status phasing-out end-of-extended-support 2026-07-14 installation jre11 "Java" : runtime on erp-old version "11" host erp-new "ERP VM, new stack" : vm in dc-lan environment PRD x1 status building installation win2022 "Windows Server" : os on erp-new version "2022" db-server erp-db-new "ERP DB" : sql-server on erp-new environment PRD x1 version "2022" platform finance "Finance" { component erp "ERP" : cots version "7.2" status phasing-out contract-end 2027-06-30 { environment PRD x1 on erp-old } } ``` A monolith states them after its kind and marks. A bought system with no inner structure, to be replaced: ```kanoniq monolith tix "TIX" : cots idp version "4.2" status active future replace { environment PRD x1 } ``` Each clause is optional and written once, at the end of the declaration's header and before its block, in this order: | Clause | Takes | | --- | --- | | `version ""` | The product's version as its vendor writes it: `version "2016"`, `version "11.0.22"` | | `status ` | Where it is now, one of the statuses below | | `future ` | What you intend for it, one of the futures below | | `successor ` | The element that takes its place | | `end-of-mainstream-support ` | The day the vendor stops adding fixes and features | | `end-of-extended-support ` | The day the vendor stops all support, security fixes included | | `contract-end ` | The day a license, subscription or support contract ends | | Status | Means | | --- | --- | | `proposed` | Requested or considered, not approved | | `planned` | Approved and scheduled, work not started | | `building` | Being built, implemented, configured, onboarded or installed | | `pilot` | Limited use to validate fit | | `active` | In production and supported by your organization | | `phasing-out` | Still running, closed to new use, being replaced or removed | | `retired` | Switched off; its data archived or migrated | | Future | Means | | --- | --- | | `invest` | Grow, modernize, add capability | | `maintain` | Keep as is, fix and patch only | | `migrate` | Keep the capability, change what runs it: a newer version, platform or host | | `replace` | Put another product or service in its place | | `retire` | Remove it with no successor | Nothing has a default: an element that states no status says nothing, and an absent future is undecided. - **A version is the vendor's text**, which Kanoniq doesn't parse or order, not a call's `v1`. A component has one version: a new major version that runs beside the old one is a second component, linked by `successor`. - **Legacy is not a status**: it is an `active` element whose future is `migrate`, `replace` or `retire`. - **A component in a monolith states its own** clauses and inherits none of its monolith's: one that states no status says nothing. It lives within its monolith, though: one that isn't `retired` and is held in a `retired` monolith is an error ([KQ263](https://kanoniq.extenza.dev/docs/rules/kq263.md)), and its end-of-support notice is answered by its monolith's answer as well as its own. - **A successor goes with `replace` or `migrate`**, is of the element's own type, except that a monolith's may be a component and a component's a monolith, and is not the element itself ([KQ265](https://kanoniq.extenza.dev/docs/rules/kq265.md)). Nothing that isn't `retired` runs, is deployed, installed or hosted on, uses or calls a `retired` element ([KQ263](https://kanoniq.extenza.dev/docs/rules/kq263.md)), a `phasing-out` element's future is not `invest` ([KQ264](https://kanoniq.extenza.dev/docs/rules/kq264.md)), and extended support doesn't end before mainstream support ([KQ267](https://kanoniq.extenza.dev/docs/rules/kq267.md)). - **The end-of-support notice** reports an element that isn't `retired` whose `end-of-extended-support` or `contract-end` is past or close, unless the model already answers it: its status is `phasing-out`, or its future `replace`, `migrate` or `retire`. Two settings in `kanoniq.repository.json` say how close: within `end-of-support-warning`, 12 months unless you set it, it is a lint ([KQ123](https://kanoniq.extenza.dev/docs/rules/kq123.md)); within `end-of-support-error` it is an error ([KQ268](https://kanoniq.extenza.dev/docs/rules/kq268.md)). The error is off unless you set it; `kq init` writes it as `6m`. Each is `"m"` or `false`. - The notice counts from the day it runs, so once a date comes within the error period, a model that passed fails with no edit. See [Life cycle](https://kanoniq.extenza.dev/docs/rules.md#life-cycle) for the rules. ## Suppliers and contracts ```kanoniq domain operations "Operations" { function-group run-timetable "Run the timetable" critical function-group roster-crew "Roster crew" } supplier genesys "Genesys Cloud Services, Inc." headquarters US { contract genesys-cx "Genesys Cloud subscription" number "MR-2024-118" starts 2024-04-01 ends 2027-03-31 notice P90D supplier-notice P180D law IE covers @customer/contact-centre { subcontractor aws subcontractor equinix under aws } } supplier aws "Amazon Web Services EMEA SARL" headquarters LU supplier equinix "Equinix (Germany) GmbH" headquarters DE supplier crew-agency "Rail Crew Services Ltd" headquarters GB { contract crew-cover "Crew cover" ends 2028-12-31 notice P90D via operations/roster-crew } ``` A supplier is a company or person you obtain ICT services from, named by its legal name. Write it in the ecosystem that contracts with it, which holds it, and its contracts in its block. Its parts, each optional, in this order: | Part | Means | | --- | --- | | `lei ""` | Its Legal Entity Identifier, 20 characters | | `headquarters ` | The country of its head office | | `parent ` | The supplier that is its ultimate parent, declared in the same ecosystem | | `is ` | The ecosystem of your model that this supplier is, for a company of your own group; its contracts are then intra-group, and may cover that ecosystem's elements | | `is /` | The [legal entity](#legal-entities-and-branches) of another ecosystem that this supplier is, written as a path; the supplier reads its LEI and headquarters from it and states neither, and its contracts are intra-group as above | A contract is an agreement under which its supplier provides ICT services. Its parts, in this order: | Part | Means | | --- | --- | | `number ""` | Your reference for it | | `signed-by ` | The [legal entity](#legal-entities-and-branches) of the ecosystem that signed it | | `starts `, `ends ` | Its first and last day; an open-ended contract states no `ends` | | `notice ` | The period you must give to end it, such as `P90D` | | `supplier-notice ` | The period the supplier must give | | `law ` | The country whose law governs it | | `transfer , …` | The grounds on which personal data goes to the supplier outside a transfer regime: `adequacy`, `scc`, `bcr`, `code-of-conduct`, `certification`, `ad-hoc-clauses` or `public-instrument`, GDPR Chapter V's, each once | | `covers , …` | The components and monoliths of any kind, hosts, installations and platform services it provides | | `via , …` | The domains, function groups or functions it supports where nothing that runs stands for its work, such as an outsourced service | A contract states `covers`, `via` or both. A transfer regime is a residency your repository declares with its `adequate` countries in its [settings](https://kanoniq.extenza.dev/docs/settings.md). A ground outside the list is [KB092](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb092), one listed twice is [KQ405](https://kanoniq.extenza.dev/docs/rules/kq405.md), and none of the grounds is reserved, so `scc` stays a legal code. A country is its two-letter ISO 3166-1 code in capitals, such as `IE`; any other is [KB085](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb085), and no country code is reserved, so `de` stays a legal code. **A contract's block holds its subcontractors**, one line each, naming a supplier of the ecosystem, with `under` the supplier it works for where that isn't the contract's own: the chain may run as deep as it goes. A contract is always written whole, so a later plateau restates it by declaring it again. `kq arrange` writes an ecosystem's suppliers, with their contracts, in `suppliers.kq`. **`critical` marks a domain, a function group or a function whose disruption would materially impair your organization.** It follows the name and the organization's code, before a domain's subdomain type, and everything under a critical domain or function group is critical too. No word says that something isn't. **The contract end moves to the contract.** An element a contract covers states no `contract-end` of its own ([KQ286](https://kanoniq.extenza.dev/docs/rules/kq286.md)): it reads the earliest `ends` of the contracts covering it, which a policy's `contract-end` reads too. The end-of-support notice reads a contract's `ends` the same way it reads an element's dates, and reports the contract, unless everything it covers is already answered; a contract with only `via` never is ([KQ123](https://kanoniq.extenza.dev/docs/rules/kq123.md), [KQ268](https://kanoniq.extenza.dev/docs/rules/kq268.md)). **Everything else is read from the model.** Select a contract and the information pane lists, under *Computed*, the functions it supports, those its covered elements realize, or the platform, monolith or module holding one, and for a host, an installation or a platform service those of what runs on it, plus what `via` names; whether it is critical, each critical function it supports; its chain, each supplier with its rank, its own supplier first; whether it is intra-group; and the data its services hold, with its highest confidentiality and personal data and the stages it runs in. Select a supplier and it lists whether it is critical, by its own contracts or by being in a critical contract's chain, its contracts, the contracts it is a subcontractor in, what they cover and the critical functions they support, and the countries those store data in and process it in. A covered element lists its contracts and its contract end, and a data use's processors name their suppliers, with the subcontractors as sub-processors. **What is checked.** A contract covering another ecosystem's element, unless its supplier `is` that ecosystem ([KQ284](https://kanoniq.extenza.dev/docs/rules/kq284.md)), a `via` into another ecosystem ([KQ285](https://kanoniq.extenza.dev/docs/rules/kq285.md)), `ends` before `starts` ([KQ287](https://kanoniq.extenza.dev/docs/rules/kq287.md)), a subcontractor chain that doesn't hang from the contract's supplier ([KQ288](https://kanoniq.extenza.dev/docs/rules/kq288.md)), a `parent` that isn't another supplier of the ecosystem, or loops ([KQ289](https://kanoniq.extenza.dev/docs/rules/kq289.md)), `is` naming the supplier's own ecosystem ([KQ290](https://kanoniq.extenza.dev/docs/rules/kq290.md)), a malformed `lei` ([KQ291](https://kanoniq.extenza.dev/docs/rules/kq291.md)) and `lei` or `headquarters` on a supplier that is a legal entity ([KQ403](https://kanoniq.extenza.dev/docs/rules/kq403.md)) are errors. Once an ecosystem holds a contract, a `saas` or `cots` component or monolith no contract covers ([KQ129](https://kanoniq.extenza.dev/docs/rules/kq129.md)), a contract supporting a critical function with no `ends` or `notice` ([KQ130](https://kanoniq.extenza.dev/docs/rules/kq130.md)) and a contract supporting no function ([KQ131](https://kanoniq.extenza.dev/docs/rules/kq131.md)) are lints, as is `is` naming an ecosystem that holds two or more legal entities, which doesn't say which company supplies ([KQ135](https://kanoniq.extenza.dev/docs/rules/kq135.md)). ## Legal entities and branches ```kanoniq legal-entity aurora-uk "Aurora Payments Ltd" lei "984500AURORAPAY0GB58" headquarters GB legal-entity aurora-eu "Aurora Payments Europe UAB" headquarters LT parent aurora-uk { branch berlin "Aurora Payments Europe UAB, Berlin branch" in DE } platform platform-cards "Card Services" for aurora-eu, aurora-eu/berlin { component card-management "Card management" : backend card-management realizes cards/manage-cards } supplier marqeta "Marqeta Inc" headquarters US { contract card-processing "Card issuing platform" signed-by aurora-eu starts 2024-06-01 covers platform-cards/card-management } ``` A legal entity is a legal person whose work an ecosystem does, named by its legal name. An ecosystem is a landscape, not a company: one ecosystem may do the work of several entities, so write each entity in the ecosystem whose landscape serves it, and its branches in its block. Its parts, each optional, in this order: | Part | Means | | --- | --- | | `lei ""` | Its Legal Entity Identifier, as on a supplier | | `headquarters ` | The country of its registered office | | `parent ` | Its direct parent undertaking, which may be in another ecosystem: the group is the tree these draw | A branch is a place of business of its legal entity in a country, with no legal personality of its own: its name, an optional `branch-code ""` for the entity's code for it, then `in `, another than its entity's `headquarters`. `kq arrange` writes an ecosystem's legal entities, with their branches, in `legal-entities.kq`. **`for` says whose work a platform or a monolith does.** It follows the name and the context marks and names legal entities or branches of the same ecosystem; a branch stands for its entity too. An ecosystem with one legal entity needs no `for`: everything in it does that entity's work. It is said on the platform, not the function, so one function realized by two platforms for two entities is performed for both. A contract's signer is the ecosystem's only legal entity, or the one `signed-by` names, and the entities and branches using it are read from what it covers. **Everything else is read from the model.** Select a legal entity and the information pane lists, under *Computed*, its ultimate parent and the rest of its group, its branches, the platforms and monoliths doing its work, the functions they realize, and the contracts it signs and uses. A platform lists whose work it does, a function whom it's performed for, and a contract its signer and its users. **What is checked.** A `parent` that isn't another legal entity, or loops ([KQ298](https://kanoniq.extenza.dev/docs/rules/kq298.md)), two entities with one `lei` ([KQ299](https://kanoniq.extenza.dev/docs/rules/kq299.md)), `for` naming another ecosystem's entity ([KQ400](https://kanoniq.extenza.dev/docs/rules/kq400.md)), `signed-by` naming another ecosystem's entity ([KQ401](https://kanoniq.extenza.dev/docs/rules/kq401.md)) and, in an ecosystem with two or more legal entities, a contract with no `signed-by` ([KQ402](https://kanoniq.extenza.dev/docs/rules/kq402.md)) are errors; there, a platform or monolith with no `for` is a lint ([KQ134](https://kanoniq.extenza.dev/docs/rules/kq134.md)), and so is a branch in its own entity's headquarters country ([KQ136](https://kanoniq.extenza.dev/docs/rules/kq136.md)). A malformed `lei` is [KQ291](https://kanoniq.extenza.dev/docs/rules/kq291.md), as on a supplier. ## Reference The element types, relationships and kinds of this area, each with what it means. **Element types** | Element type | What it is | | --- | --- | | Environment | An Environment is one stage an Ecosystem's parts run in, such as PRD or DEV, declared once in the Ecosystem and shared by all its Platforms and Monoliths. Its name is the stage's fixed reading, such as Production. | | Data Center | A Data Center is a building the organization or a colocation supplier runs, in a country, holding every stage. A Network, a Host or a platform service in it names it as its location, and its zones are its own. | | Network | A Network is a private network the organization runs or rents, in one Environment, such as a VNet, a VPC or a data center's LAN. Hosts and platform services sit in it, and where it is regional, where it is is where they are. | | Host | A Host is something the organization runs, in one Environment: a virtual machine, a set of them run as copies of one, a physical server, or a device it places for people to use. Parts are deployed on it, and software is installed on it. | | Installation | An Installation is a version of a product installed on a Host: an operating system, a runtime, an SDK, a web server or middleware. It is in its Host's Environment, and a Component is deployed on the Host beside it. | | App Platform | An App Platform is where application code runs, in one Environment: application PaaS such as an App Service plan or a Functions app, or a self-run scheduler such as Kubernetes. Components are deployed on it. | | Db Server | A DbServer is a database engine, software on a Host or run by the provider, that hosts Storages in one Environment. Its pools are capacity inside it that databases name. | | Db Pool | A DbPool is capacity inside its DbServer that several databases share, such as an elastic pool. A Storage hosted on the server names the pool it is in. | | Gateway | A Gateway is something requests pass through on their way, in one Environment: an API gateway, a load balancer, an edge, an ingress, a firewall, a NAT or a bastion. It publishes Interfaces and forwards to what is behind it. | | Dns | A Dns record is a host name, its name, in a public or private zone, pointing at an endpoint, in one Environment. | | Certificate | A Certificate is a TLS certificate, its name its subject, that endpoints serve in one Environment. | | Storage Account | A Storage Account holds Storages of kind blob, file and table, hosted on it, and a queue Broker, in one Environment, stating its network placement once. A bucket is one holding exactly one Storage. | | Vault | A Vault keeps secrets, keys or certificates, as its kind says, in one Environment. A credential and a Certificate are stored in it, and a call to it lands on it. | | Registry | A Registry holds Repositories of packages and images, each of one format, in the Environment it lives in; a platform that pulls from it uses it, from any stage. | | Repository | A Repository is one repository of its Registry, holding packages or images of one format. | | Ai Platform | An AI Platform hosts the model deployments the organization configures and calls, in one Environment: a provider's AI platform or a self-run model server. Agents built on it are Components deployed on it. | | Model Deployment | A Model Deployment is one model deployed in its AI Platform, its name the model's. A call lands on it. | | Backup Vault | A Backup Vault keeps backups, in one Environment. A Storage, a Host or a DbServer backed up in it names it with how long each backup is kept. | | Security Service | A Security Service watches the stages it covers, in one Environment of its own: posture management, threat detection, vulnerability scanning or a SIEM. | | Supplier | A Supplier is a company or person the organization obtains ICT services from, such as a cloud provider or a software vendor, named by its legal name. A Supplier sits in the Ecosystem that contracts with it and holds its Contracts. | | Contract | A Contract is an agreement under which a Supplier provides ICT services, such as a subscription or an outsourced service desk, with its dates and notice periods. A Contract covers run elements, or names the function-side work it supports, and the Functions it supports are read from what it covers. | | Legal Entity | A Legal Entity is a legal person whose work its Ecosystem does, such as a bank or its subsidiary, named by its legal name. A Legal Entity sits in one Ecosystem and holds its Branches; its parent undertaking draws its group. | | Branch | A Branch is a place of business of a Legal Entity in a country, with no legal personality of its own, such as a bank's branch abroad. Its head office is its Legal Entity, and a Platform or a monolith may do its work. | **Relationships** | Relationship | What it says | | --- | --- | | Deployment | A Deployment says a part runs in an Environment, and optionally on what: a Component, a Deployable Module, a Monolith, a Broker, a user-facing Interface, a DbServer, a Workload Identity, or an infrastructure element, which states its stage on its own line. | | Hosting | A Hosting says a Storage is hosted on a DbServer. A Storage may be hosted on several. | | Link | A Link joins two Networks of one Environment, so each reaches the other. It is symmetric, and says nothing more about routing. | **Stage**: One of the six fixed stages an Environment is. No Author's Code can take one. | Value | Means | | --- | --- | | `DEV` | Development. | | `TST` | Test. | | `ACC` | Acceptance. | | `UAT` | User acceptance. | | `EPH` | Ephemeral. | | `PRD` | Production. | **Network kind**: A Network's kind, as written: a generic kind or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `vnet` | An Azure virtual network, or another cloud's network called so. | | `vpc` | A virtual private cloud network, as AWS and GCP call one. | | `lan` | A local area network the organization runs, such as a data center's. | | `hub` | A hub that networks attach to, each by a peering link, such as a Virtual WAN hub or a Transit Gateway; spokes reach each other only where linked. | | `azure.virtual-wan` | An Azure Virtual WAN hub. | | `aws.transit-gateway` | An AWS Transit Gateway. | | `gcp.network-connectivity-center` | A Network Connectivity Center hub. | **Link kind**: How a Link joins its two networks, as written: a generic kind or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `peering` | A peering between two networks, regional or global. | | `vpn` | A site-to-site VPN between two networks. | | `private-link` | A private link publishing a service of one network into another. | | `dedicated` | A dedicated line, such as ExpressRoute, Direct Connect or Interconnect. | | `azure.express-route` | Azure ExpressRoute. | | `aws.direct-connect` | AWS Direct Connect. | | `gcp.interconnect` | Cloud Interconnect, dedicated or partner. | | `gcp.cloud-vpn` | Google Cloud HA VPN. | | `azure.vpn-gateway` | An Azure VPN Gateway, site to site. | | `aws.site-to-site-vpn` | AWS Site-to-Site VPN. | **Host kind**: A Host's kind, as written: a generic kind or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `vm` | A virtual machine, or a set of them run as copies of one, such as a scale set with a count range. | | `physical` | A physical server, such as a dedicated host; a VM on it is a host on a host. | | `device` | A device the organization places for people to use, which states what it is by a second word; the client on it is deployed on it. | | `azure.vm` | Azure Virtual Machines. | | `azure.vm-scale-set` | Azure Virtual Machine Scale Sets, with a count range. | | `aws.ec2` | Amazon EC2 instances. | | `aws.auto-scaling-group` | An EC2 Auto Scaling group, with a count range. | | `gcp.compute-engine` | Compute Engine instances. | | `gcp.managed-instance-group` | A Compute Engine managed instance group, with a count range. | | `azure.dedicated-host` | An Azure Dedicated Host. | | `aws.dedicated-host` | An EC2 Dedicated Host. | | `gcp.sole-tenant-node` | A Compute Engine sole-tenant node. | **Device kind**: What a device Host is, the word after device. | Value | Means | | --- | --- | | `kiosk` | A kiosk: a device for people to use in a public place, such as an ATM, a ticket machine or a check-in terminal. | **Installation kind**: What an Installation is: an operating system, a runtime, an SDK, a web server or middleware. | Value | Means | | --- | --- | | `os` | An operating system, such as Windows Server or Ubuntu. | | `runtime` | A runtime code runs in, such as Java or .NET. | | `sdk` | A software development kit installed for building or running code, such as the .NET SDK. | | `web-server` | A web server, such as IIS, nginx or Apache httpd. | | `middleware` | Middleware, such as an application server or a message queue manager installed on the host. | **Lifecycle status**: Where a run element is now in its life. Absent, nothing is said. | Value | Means | | --- | --- | | `proposed` | Requested or considered, not approved. | | `planned` | Approved and scheduled, work not started. | | `building` | Being built, implemented, configured, onboarded or installed. | | `pilot` | Limited use to validate fit. | | `active` | In production and supported by the organization. | | `phasing-out` | Still running, closed to new use, being replaced or removed. | | `retired` | Switched off; its data archived or migrated. | **Transfer ground**: A ground for transferring personal data to an importer outside a transfer regime, one of GDPR Chapter V's. | Value | Means | | --- | --- | | `adequacy` | An adequacy decision covering this importer rather than its whole country, such as the EU-US Data Privacy Framework for a certified company (GDPR Art. 45). | | `scc` | Standard contractual clauses, the UK's IDTA or Addendum and the Swiss-adapted clauses included (GDPR Art. 46(2)(c) and (d)). | | `bcr` | Binding corporate rules (GDPR Art. 47). | | `code-of-conduct` | An approved code of conduct with binding commitments of the importer (GDPR Art. 46(2)(e)). | | `certification` | An approved certification mechanism with binding commitments of the importer (GDPR Art. 46(2)(f)). | | `ad-hoc-clauses` | Contractual clauses the supervisory authority authorized (GDPR Art. 46(3)(a)). | | `public-instrument` | A legally binding instrument or arrangement between public authorities (GDPR Art. 46(2)(a) and 46(3)(b)). | **Future**: What the organization intends for a run element. Absent, it is undecided. | Value | Means | | --- | --- | | `invest` | Grow, modernize, add capability. | | `maintain` | Keep as is, fix and patch only. | | `migrate` | Keep the capability, change what runs it: a newer version, platform or host. | | `replace` | Put another product or service in its place. | | `retire` | Remove it with no successor. | **App platform kind**: An App Platform's kind, as written: a generic kind or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `kubernetes` | A Kubernetes cluster. | | `app-hosting` | Application hosting: a plan or an environment applications are deployed to, such as an App Service plan. | | `functions` | A functions platform, where code runs per event. | | `containers` | A container platform that runs container images it is given, such as Container Apps or Cloud Run. | | `workflows` | A workflow engine, whose workflows are Components deployed on it. | | `data-pipelines` | A data pipeline platform, whose pipelines and notebooks are Components deployed on it. | | `static-sites` | A platform made for static sites, a client deployed on it. | | `ci-runners` | Build and deployment runners, a pipeline being a job Component deployed on them. | | `azure.aks` | Azure Kubernetes Service. | | `azure.app-service` | An Azure App Service plan. | | `azure.functions` | An Azure Functions app. | | `aws.lambda` | AWS Lambda functions sharing one network placement. | | `aws.eks` | Amazon EKS. | | `gcp.gke` | Google Kubernetes Engine. | | `gcp.cloud-run` | Cloud Run services sharing one network placement. | | `azure.container-apps` | An Azure Container Apps environment. | | `azure.container-instances` | Azure Container Instances. | | `azure.service-fabric` | An Azure Service Fabric cluster. | | `azure.logic-apps` | Azure Logic Apps Standard. | | `azure.data-factory` | Azure Data Factory. | | `azure.fabric` | A Microsoft Fabric capacity. | | `azure.databricks` | An Azure Databricks workspace. | | `azure.static-web-apps` | Azure Static Web Apps. | | `azure.managed-dev-ops-pools` | Managed DevOps Pools, agents for Azure DevOps. | | `aws.ecs` | An Amazon ECS cluster. | | `aws.elastic-beanstalk` | An AWS Elastic Beanstalk environment. | | `aws.step-functions` | AWS Step Functions. | | `aws.mwaa` | Amazon Managed Workflows for Apache Airflow. | | `aws.glue` | AWS Glue. | | `aws.emr` | Amazon EMR. | | `aws.amplify-hosting` | AWS Amplify Hosting. | | `aws.code-build` | AWS CodeBuild, the runners a CodePipeline pipeline uses. | | `gcp.app-engine` | Google App Engine. | | `gcp.cloud-functions` | Cloud Run functions, formerly Cloud Functions. | | `gcp.workflows` | Google Cloud Workflows. | | `gcp.composer` | Cloud Composer. | | `gcp.dataflow` | Dataflow. | | `gcp.dataproc` | Dataproc. | | `gcp.firebase-hosting` | Firebase Hosting. | | `gcp.cloud-build` | Cloud Build, with its private pools. | **Db server kind**: A DbServer's kind, as written: its engine, what the store is, or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `sql-server` | Microsoft SQL Server, or a product compatible with it. | | `postgresql` | PostgreSQL, or a product compatible with it. | | `mysql` | MySQL, or a product compatible with it. | | `mariadb` | MariaDB. | | `oracle` | Oracle Database. | | `mongodb` | MongoDB, or a product compatible with it. | | `redis` | Redis, or a product compatible with it such as Valkey. | | `cassandra` | Apache Cassandra, or a product compatible with it. | | `neo4j` | Neo4j. | | `elasticsearch` | Elasticsearch. | | `opensearch` | OpenSearch. | | `loki` | Grafana Loki. | | `document-store` | A document store no engine names, holding document Storages. | | `table-store` | A table store no engine names, holding table Storages. | | `warehouse` | A SQL warehouse, holding sql Storages. | | `azure.sql-database` | An Azure SQL Database logical server. | | `azure.postgresql` | Azure Database for PostgreSQL flexible server. | | `azure.cosmos-db.no-sql` | Azure Cosmos DB for NoSQL. | | `aws.rds.postgresql` | Amazon RDS for PostgreSQL. | | `aws.dynamo-db` | Amazon DynamoDB. | | `aws.elasti-cache` | Amazon ElastiCache for Valkey or Redis OSS. | | `azure.managed-redis` | Azure Managed Redis. | | `azure.ai-search` | Azure AI Search, holding search-index Storages. | | `azure.log-analytics` | An Azure Monitor Log Analytics workspace, holding log Storages. | | `gcp.cloud-sql.postgresql` | Cloud SQL for PostgreSQL. | | `gcp.spanner` | Spanner. | | `azure.sql-managed-instance` | Azure SQL Managed Instance. | | `azure.mysql` | Azure Database for MySQL flexible server. | | `azure.document-db` | Azure DocumentDB, MongoDB-compatible. | | `azure.cosmos-db.mongodb` | Azure Cosmos DB for MongoDB (RU). | | `azure.cosmos-db.cassandra` | Azure Cosmos DB for Apache Cassandra. | | `azure.cassandra-managed-instance` | Azure Managed Instance for Apache Cassandra. | | `azure.cosmos-db.gremlin` | Azure Cosmos DB for Apache Gremlin. | | `azure.cosmos-db.table` | Azure Cosmos DB for Table. | | `azure.fabric.warehouse` | A Microsoft Fabric warehouse, on its capacity. | | `azure.synapse` | An Azure Synapse Analytics workspace. | | `azure.databricks.sql-warehouse` | An Azure Databricks SQL warehouse, on its workspace. | | `azure.data-explorer` | An Azure Data Explorer cluster. | | `aws.rds.sql-server` | Amazon RDS for SQL Server. | | `aws.rds.mysql` | Amazon RDS for MySQL. | | `aws.rds.mariadb` | Amazon RDS for MariaDB. | | `aws.rds.oracle` | Amazon RDS for Oracle. | | `aws.aurora.postgresql` | Amazon Aurora PostgreSQL-compatible. | | `aws.aurora.mysql` | Amazon Aurora MySQL-compatible. | | `aws.document-db` | Amazon DocumentDB, MongoDB-compatible. | | `aws.keyspaces` | Amazon Keyspaces for Apache Cassandra. | | `aws.neptune` | Amazon Neptune. | | `aws.open-search` | Amazon OpenSearch Service, managed domains and Serverless. | | `aws.memory-db` | Amazon MemoryDB. | | `aws.cloud-watch-logs` | Amazon CloudWatch Logs, holding log Storages. | | `aws.redshift` | Amazon Redshift, provisioned or Serverless. | | `aws.athena` | Amazon Athena. | | `gcp.cloud-sql.sql-server` | Cloud SQL for SQL Server. | | `gcp.cloud-sql.mysql` | Cloud SQL for MySQL. | | `gcp.alloy-db` | AlloyDB for PostgreSQL. | | `gcp.firestore` | Firestore. | | `gcp.bigtable` | Bigtable. | | `gcp.vertex-ai-search` | Vertex AI Search. | | `gcp.memorystore` | Memorystore for Valkey or Redis. | | `gcp.cloud-logging` | Cloud Logging, holding log Storages. | | `gcp.big-query` | BigQuery. | **Gateway kind**: A Gateway's kind, as written: a generic kind or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `api-gateway` | An API gateway, publishing APIs. | | `app-load-balancer` | A load balancer for HTTP that terminates TLS, serving a certificate. | | `network-load-balancer` | A load balancer for TCP and UDP that passes TLS through. | | `edge` | An edge in front of origins, where a CDN is its own product. | | `ingress` | An ingress controller run on a cluster that proxies requests itself. | | `firewall` | A firewall on the path of requests. | | `nat` | A NAT gateway, the address outbound calls leave from. | | `bastion` | A bastion, the path people take to administer hosts. | | `azure.api-management` | Azure API Management. | | `azure.api-management.self-hosted-gateway` | API Management's self-hosted gateway, on the organization's cluster. | | `azure.front-door` | Azure Front Door. | | `azure.firewall` | Azure Firewall. | | `aws.alb` | An AWS Application Load Balancer. | | `aws.api-gateway` | Amazon API Gateway. | | `aws.nat-gateway` | An AWS NAT gateway. | | `gcp.apigee` | Apigee. | | `gcp.apigee.hybrid` | Apigee hybrid's runtime, on the organization's cluster. | | `azure.application-gateway` | Azure Application Gateway. | | `azure.app-gateway-for-containers` | Azure Application Gateway for Containers. | | `azure.load-balancer` | An Azure Load Balancer, public or internal. | | `azure.nat-gateway` | An Azure NAT Gateway. | | `azure.bastion` | Azure Bastion. | | `aws.nlb` | An AWS Network Load Balancer. | | `aws.gateway-load-balancer` | An AWS Gateway Load Balancer, in front of appliances. | | `aws.cloud-front` | An Amazon CloudFront distribution. | | `aws.global-accelerator` | AWS Global Accelerator. | | `aws.network-firewall` | AWS Network Firewall. | | `aws.app-sync` | AWS AppSync GraphQL APIs. | | `aws.instance-connect-endpoint` | An EC2 Instance Connect Endpoint. | | `gcp.api-gateway` | Google Cloud API Gateway. | | `gcp.application-load-balancer` | A Google Cloud Application Load Balancer, external or internal. | | `gcp.network-load-balancer` | A Google Cloud Network Load Balancer, proxy or passthrough. | | `gcp.cloud-nat` | Cloud NAT. | **Dns zone**: The zone a Dns record is in, as written: public, private, or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `public` | A record in a public zone, resolvable from the internet. | | `private` | A record in a private zone, resolvable in the networks the zone is linked to. | | `azure.dns` | An Azure DNS public zone. | | `azure.private-dns` | An Azure Private DNS zone. | | `aws.route53.public` | A Route 53 public hosted zone. | | `aws.route53.private` | A Route 53 private hosted zone. | | `gcp.cloud-dns.public` | A Cloud DNS public zone. | | `gcp.cloud-dns.private` | A Cloud DNS private zone. | **Storage account kind**: A Storage Account's kind, as written: a product word, there being no generic kind. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `azure.storage-account` | An Azure storage account, holding blob, file and table Storages and its queues. | | `aws.s3` | An Amazon S3 bucket, holding one blob Storage. | | `aws.efs` | An Amazon EFS file system, holding one file Storage. | | `aws.fsx.windows` | An Amazon FSx for Windows File Server file system, holding one file Storage. | | `gcp.cloud-storage` | A Cloud Storage bucket, holding one blob Storage. | | `gcp.filestore` | A Filestore instance, holding one file Storage. | **Vault kind**: A Vault's kind, as written: a generic kind or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `hashicorp-vault` | HashiCorp Vault, holding secrets, keys and certificates. | | `azure.key-vault` | Azure Key Vault. | | `azure.managed-hsm` | Azure Key Vault Managed HSM. | | `aws.secrets-manager` | AWS Secrets Manager. | | `aws.parameter-store` | AWS Systems Manager Parameter Store, whose SecureString parameters are secrets. | | `aws.kms` | AWS KMS. | | `aws.acm` | AWS Certificate Manager. | | `gcp.secret-manager` | Google Cloud Secret Manager. | | `gcp.cloud-kms` | Google Cloud KMS. | | `gcp.certificate-manager` | Google Cloud Certificate Manager. | **Registry kind**: A Registry's kind, as written: a generic kind or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `artifactory` | JFrog Artifactory. | | `nexus` | Sonatype Nexus Repository. | | `harbor` | Harbor, a registry of OCI artifacts. | | `azure.container-registry` | Azure Container Registry. | | `azure.artifacts` | An Azure Artifacts feed. | | `aws.ecr` | Amazon ECR. | | `aws.code-artifact` | AWS CodeArtifact. | | `gcp.artifact-registry` | Google Artifact Registry. | **Repository format**: What a Repository holds, as written: oci, npm, nuget, maven, pypi, go, cargo, rubygems, swift, helm, terraform, apt, yum or generic. | Value | Means | | --- | --- | | `oci` | OCI artifacts: container images, Helm charts and Bicep modules alike. | | `npm` | npm packages. | | `nuget` | NuGet packages. | | `maven` | Maven artifacts, which Gradle uses too. | | `pypi` | Python packages. | | `go` | Go modules. | | `cargo` | Rust crates. | | `rubygems` | Ruby gems. | | `swift` | Swift packages. | | `helm` | A Helm chart repository outside OCI. | | `terraform` | Terraform modules and providers. | | `apt` | Debian packages. | | `yum` | RPM packages. | | `generic` | Files of any format. | **Ai platform kind**: An AI Platform's kind, as written: a generic kind or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `vllm` | vLLM, a self-run model server. | | `ollama` | Ollama, a self-run model server. | | `azure.foundry` | Microsoft Foundry. | | `aws.bedrock` | Amazon Bedrock. | | `aws.sage-maker` | Amazon SageMaker AI. | | `gcp.agent-platform` | Gemini Enterprise Agent Platform. | **Backup vault kind**: A Backup Vault's kind, as written: a generic kind or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `veeam` | Veeam Backup & Replication. | | `bacula` | Bacula. | | `azure.backup-vault` | An Azure Backup vault. | | `aws.backup` | An AWS Backup vault. | | `gcp.backup-dr` | Google Cloud Backup and DR Service. | **Security service kind**: A Security Service's kind, as written: what it does, or a product word. A provider's product word, such as azure.postgresql, names the product and fixes its generic kind. | Value | Means | | --- | --- | | `posture` | Posture management: misconfigurations and compliance across what the stage runs. | | `threat-detection` | Threat detection: suspicious activity in what the stage runs. | | `vulnerability-scanning` | Vulnerability scanning: known vulnerabilities in the hosts, images and code the stage runs. | | `siem` | A SIEM: security events gathered and correlated, run on the log store it reads. | | `azure.defender-for-cloud` | Microsoft Defender for Cloud. | | `azure.sentinel` | Microsoft Sentinel, on the Log Analytics workspace it reads. | | `aws.security-hub` | AWS Security Hub. | | `aws.guard-duty` | Amazon GuardDuty. | | `aws.inspector` | Amazon Inspector. | | `gcp.security-command-center` | Security Command Center. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/change-over-time.md # Change over time A model can describe the landscape at several points in time: as it is, and as it will be after a change. Each point in time is a **plateau**. The first plateau is the model as you write it; each later one says only what differs from the one before. An element that lives through several plateaus is one element with one Id in all of them, so you never copy anything to describe its future. Every model has at least one plateau. One you never declared is `initial`, which `kq build` writes into `.g.kq`. ## Declaring plateaus ```kanoniq plateau as-is "As is" dated 2026-10-01 ecosystem acme "Acme" { platform finance "Finance" { component order-service "Order Service" : backend component legacy-export "Export" : cots technology "Export v1" order-service -> legacy-export/api over http } } plateau to-be "To be" after as-is dated 2027-06-30 { ecosystem acme { platform finance { component finance-app "Finance" : cots technology "Finance v2" component order-service "Order Service" : backend technology ".NET" order-service -> finance-app/api over http -legacy-export -order-service -> legacy-export/api over http } } } ``` - **Exactly one plateau has no block**, and the file's top level is its content: usually the first, as `as-is` above. - **Every other plateau has a block**, and names the plateau before it with `after`. The plateaus form one line, one after another. - **`dated` is optional**, a full day. Dates rise from one plateau to the next. - **A plateau's block can be split across files**: declare it once with its name, and reopen it elsewhere with its Code alone, `plateau to-be { … }`. - **To give the derived `initial` plateau a name**, declare it in one of your files, `plateau initial "As is"`. You must, as soon as you declare any other plateau; it keeps its Id. ## What a later plateau's block says A block is read like the top level, at that point in time. Nesting in it means what it always means; the `plateau` around it only says *when*. | You write | From that plateau on | | --- | --- | | A declaration at a new path | The element is added | | A declaration at a path that exists | The element's header is replaced: its name, kind, `technology`, markers, every attribute, and its `///` description. Anything you leave out is gone, the description included. A header restated carries its own [`#assumed` mark](https://kanoniq.extenza.dev/docs/language/assumptions.md#plateaus), or none | | The keyword and Code with a block, `platform finance { … }` | Nothing changes about the element; the block reaches what is inside it | | A connection, a realization, an [access](https://kanoniq.extenza.dev/docs/language/data.md#access), a [relationship between contexts](https://kanoniq.extenza.dev/docs/language/domain-driven-design.md#relationships-between-contexts), an `environment` line, a `references` line | It is added | | `-legacy-export` | The element is removed, with everything inside it | | `-` and a statement, `-order-service -> gateway/api over http` | That statement is removed. Also `-conforms-to identity`, `-environment PRD`, `-x part of y [1]`, `-x references y [1]`, and `-pay` for one named `as pay` | | `-` and a line named by its ends alone: `-holds tix/ticket-clerk` in a job role, `-lane fitter` or `-review then pay` in a process, `-runs-as id` in a component, `-used-by staff` or `-grant pay-api/write` in a workload identity | That line's relationship is removed. A `then` takes no name and a `used-by` no reason here | | A `const`, `policy`, `policy-set` or `exempt` line, in the block it belongs to | It is added. A [constant](https://kanoniq.extenza.dev/docs/language/governance.md#constants) or a policy the plateau before already holds, by name or by set and Code, is restated: the new line restates it, its value or all of the policy, and it keeps its Id | | `-const MAX_ROTATION`, `-policy no-key`, `-policy-set security`, `-exempt security/no-key for orders`, in the block it was written in | That constant, policy, set or exemption is removed | | `v3` in an event's, a command's, a query's or an API's block | That version is added | | `-v1` in an event's, a command's, a query's or an API's block | That version is removed | | `move legacy/payments to central/payments` | The element keeps its Id, its contents and its relationships, at a new path | **Paths in a block are the paths at that plateau**, after its moves. A `-` line names what the plateau before holds. **A plateau's state is judged as if you had written it directly**, however its moves, `-` lines and restated headers reach it, and refused with the same code: an element moved under one that cannot hold its kind, such as a module anywhere but into a monolith or a Component into a Domain, [KB009](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb009); an `environment` line that stands where its module is restated as not deployable, [KB010](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb010); a move onto a path the same plateau adds, or a second move of the same element, [KB042](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb042); and a `-` line taking what the same plateau moves, [KB043](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb043). A `move` names its element by its path in the plateau before, never by a path an earlier move of the same plateau made, [KB003](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb003). **Some relationships are part of a declaration's line**: a storage's `on`, an object's domain, a database server's `environment` and `replica of`, an entity's `part of` and `from`, a flow node's `message` lines. Restate the line without one, and it is gone; restate it with a new one, and that is added. To change the number of instances on an `environment` line, remove it and write the new one: `-environment PRD` and `environment PRD x4`. **An entity's line** replaces its root mark, markers, `part of`, `from` and description together, whenever it states any of them. Its `identifier` and `property` lines replace all its properties together. The object's name alone, `order`, changes nothing. **A version is a line of its block**, a message's or an API's, so retiring `v1` shows in the plan like any other change. Reopen it by its keyword and Code to add or remove one: ```kanoniq component order-service { event order-placed { v3 -v1 } http-api orders-api { v3 -v1 } } order-service -> events/orders carries order-placed v3 events/orders -> billing carries order-service/order-placed v3 web-shop -> order-service/orders-api v3 over http ``` A connection's `carries`, `acl` and version, and the gateway a call goes `via`, are part of the statement, so to change any of them, remove the connection with a `-` line and write it again; a `-` line takes none of them. To move a caller to another version of an API, `-billing -> orders-api over http`, then `billing -> orders-api v2 over http`. A relationship between contexts changes kind the same way: `-conforms-to identity`, then `customer-of identity`. **A grant goes with the last statement of it**. Remove a call and the grant folded into it goes too, unless another call or a standalone `grant` line still gives the same permission; `-grant` removes a standalone line only. **A relationship named by its ends can come back.** A `holds`, a lane, a `then`, a message flow, a `runs-as`, a `used-by`, a grant or a `ref` property's link written again in a later plateau, after it ended, is the same relationship, alive again from there and gone in the plateaus between. It keeps the name, chain or reason it had: write it as it was first written. **A removed element never comes back**, and nothing new may take its path, or the path of an element moved away: nobody could tell which one it is. ## Writing backwards You may write the later state first and say what was different before it, with `before`: ```kanoniq plateau to-be "To be" ecosystem big-bank "Big Bank plc" { platform b "System B" } plateau as-is "As is" before to-be { ecosystem big-bank { -b platform a "System A" } } ``` In a `before` block, a declaration means *this existed then, and is gone after*, and `-b` means *this did not exist yet*. So does a message's version line: `v1` was a version then, and `-v3` was not one yet. A `before` block holds no `move`, and changes no policy of an entity the later plateau holds. [`kq arrange`](https://kanoniq.extenza.dev/docs/cli/kq-arrange.md) rewrites it the usual way round: `as-is` becomes the first plateau, and `to-be` a block after it, where moves and policies can be written. ## What Kanoniq does with them - **Each plateau is checked as a whole model.** A finding names the plateaus it holds in, once, however many there are. A few rules check the plateaus and their data migrations themselves: see [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus). - **What goes with a removed element goes too**: its contents, the APIs and channels connections name in it included, and the relationships it starts or holds. A remaining element that still uses it is an error, [KQ039](https://kanoniq.extenza.dev/docs/rules/kq039.md). - **An API or a Channel a statement names** lives in the plateaus where a statement naming it does. - **Every view is drawn at a plateau**, the first by default. See [Plateaus](https://kanoniq.extenza.dev/docs/viewer/plateaus.md). - **`kq arrange` gives each plateau a file**, `model/plateaus/000-as-is.kq`, `001-to-be.kq` and on, in order (see [`kq arrange`](https://kanoniq.extenza.dev/docs/cli/kq-arrange.md)). ## Data migrations When a plateau changes where a Domain Object's data is held, someone has to move the data. A **data migration** is that work: it happens between two plateaus and delivers the later one. It belongs to neither state, so no `-` line or `move` names it, and it has no view of its own: a transition shows it as the change of authority it delivers ([Data migrations on a view](https://kanoniq.extenza.dev/docs/views/over-time.md#data-migrations-on-a-view)). ```kanoniq plateau to-be "To be" after as-is dated 2027-06-30 { ecosystem acme { /// Customers move to the new CRM; the old database keeps a replica until it is switched off. data-migration migrate-central-account "Move customers to the new CRM" starts 2027-03-01 by 2027-05-31 { covers central/crm/crm-db/account covers central/legacy/old-db/account link "https://example.atlassian.net/browse/FIN-42" link "portal/Home/Migrations.page.yml" } } } ``` - **It is declared in an Ecosystem's block, in the block of the plateau it delivers**, never in the first plateau's content: there is nothing before it to move data from ([KQ047](https://kanoniq.extenza.dev/docs/rules/kq047.md)). - **`starts` and `by`** are optional full days, in that order. Both fall after the plateau before and on or before the plateau delivered, where those are dated, and `starts` is not after `by` ([KQ050](https://kanoniq.extenza.dev/docs/rules/kq050.md)). - **`covers`** names a Data Entity the plateau adds, removes or restates, one line each. Its path is read in the plateau delivered, or, for an entity that plateau removes, in the plateau before ([KQ049](https://kanoniq.extenza.dev/docs/rules/kq049.md)). - **`link`** points at where the work is tracked: an absolute `http://` or `https://` URL, or the path of a [page file](https://kanoniq.extenza.dev/docs/site.md) from the repository's root ([KQ051](https://kanoniq.extenza.dev/docs/rules/kq051.md)). - **Its Code is unique within its plateau**, not across the model, so two plateaus can each have a `migrate-central-account`. ### Derived or declared **A change of authority is a Domain Object alive in a plateau and in the one before, whose `authoritative` Data Entity is another one.** `kq build` derives a data migration for each, `migrate--`, covering the old and the new authoritative entity, and writes it into `.g.kq`, in the plateau's block. An object that is new or removed in the plateau changes no authority, and neither does an entity that moves, since it keeps its Id. **To give it a name, dates or links, declare it** at the same path, in the same plateau: your declaration adopts the derived one and keeps its Id, and `.g.kq` stops writing it. In VS Code, **Adopt data migration** on a derived migration's line in `.g.kq` writes that declaration for you, with its `covers` lines, and puts the cursor in its empty name ([Working in VS Code](https://kanoniq.extenza.dev/docs/vscode.md)). Your declaration states its own `covers` lines, so write the new authoritative entity's: every change of authority is covered by exactly one data migration of its plateau, and no entity by two ([KQ048](https://kanoniq.extenza.dev/docs/rules/kq048.md)). A build only adds: where the authority changes again, it adds a `covers` line to a derived migration; where the change is gone, the derived migration is marked `derived orphan`, and `kq prune` removes it. ## Removing a plateau Plateaus stay, as the model's history. To remove one, dissolve it into its neighbor with [`kq dissolve`](https://kanoniq.extenza.dev/docs/cli/kq-dissolve.md), or **Dissolve plateau…** on its `plateau` line in VS Code. Into next, the next plateau takes its changes; into previous, the plateau before takes its state. Whatever existed only in the state that is lost leaves the model. A view tile in your [navigation pages](https://kanoniq.extenza.dev/docs/site.md) that names the dissolved plateau as its `at` or `to` is repointed to the plateau that survives, the value alone, so the page keeps its layout and comments; where that would make `to` equal `at`, `to` is removed. The plan lists every page file it rewrites. Data migrations move to the plateau that survives; where it becomes the first plateau, nothing is left to migrate from, and the data migrations of both plateaus are deleted, which the plan lists too. ## Reference The element types, relationships and kinds of this area, each with what it means. **Element types** | Element type | What it is | | --- | --- | | Plateau | A Plateau is a point in time of the whole model. The model's Plateaus form one sequence, and what each holds is stated where it changes. | | Data Migration | A Data Migration is the work of moving data from one holding to another, delivering the later of two Plateaus. A Data Migration sits in an Ecosystem and is part of no Plateau's state. | **Relationships** | Relationship | What it says | | --- | --- | | Succession | A Succession says one Plateau follows another. The Successions form the model's one sequence of Plateaus. | | Existence | An Existence says an element or a relationship is already there at the model's initial Plateau. Kanoniq always derives it. | | Addition | An Addition says an element or a relationship enters the model at a later Plateau, or returns there after a gap. Kanoniq always derives it, from where the subject is declared or stated. | | Removal | A Removal says an element or a relationship is gone from a Plateau on, whether an Author removed it or it went with something removed. | | Move | A Move gives an element a new parent, a new Code, or both, from a Plateau on, keeping its Id and everything it holds. | | Delivery | A Delivery says which Plateau a Data Migration delivers: the one whose state the migration brings about. | | Coverage | A Coverage says a Data Migration covers a Data Entity, and with it the syncs into that entity. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/governance.md # Governance Your model says what the landscape *is*. A **policy** says what your organization *permits*: "no static secrets", "nobody anonymous across an ecosystem", "user tokens stop at the BFF". Rules like these usually live in a wiki or a review checklist. Written in the model, they sit next to what they are about, and they change with it. A policy never makes a model invalid. Whether the landscape follows your policies is a separate question from whether the model is well formed: [validation](https://kanoniq.extenza.dev/docs/rules.md) checks that each policy makes sense, its clauses' names and values included ([KQ074](https://kanoniq.extenza.dev/docs/rules/kq074.md) to [KQ078](https://kanoniq.extenza.dev/docs/rules/kq078.md)), and that it fits its set's kind ([KQ091](https://kanoniq.extenza.dev/docs/rules/kq091.md) to [KQ093](https://kanoniq.extenza.dev/docs/rules/kq093.md)), and [checking your landscape](#checking-your-landscape) is a pass of its own, after it. ## A policy ```kanoniq policy no-key in architecture "No static secrets" -> deny auth: key ``` A policy is a **filter**, an **action** and the clause the action is about, on one line: `policy`, a Code, `in` and the [set](#policy-sets) it goes in, an optional name, `when` and the filter, `->`, then `deny` or `allow only` and one clause. Without `when`, the policy is about everything where it is written, and the arrow follows its name. A **clause** is a name, a colon and one or more values joined by `or`: `auth: key`, `from: backend or integration`. A clause matches when any of its values matches. A policy matches a connection, a workload identity or a grant when **all** its clauses match. A `confidence` policy also judges any other element you can mark `#assumed` (`element`), and a realization, an influence, a value delivery or a `references` line, an `intent` policy a channel, a `sources` policy a data entity, a `kind` policy a component, a monolith, a permission or a piece of infrastructure, and an `env` policy any element or workload identity by the stages it runs in. An `exposure` or `in-transit` policy judges an API, a broker or a platform service as well as a connection, a `run` policy a platform service, a `waf` policy a gateway, and a `ddos` policy a gateway or a network. **The clause after the action is the one the action is about.** The clauses after `when`, joined by `and`, narrow down what the policy applies to: ```kanoniq policy no-outside-keys in architecture "No static secrets from outside" when across: ecosystems -> deny auth: key policy token-at-edge in architecture "User tokens stop at the BFF" when auth: user-token -> allow only from: user-facing-app ``` - `deny` reports everything that matches every clause. `no-outside-keys` reports a connection that authenticates with a key and crosses from one ecosystem into another. - `allow only` lets through only the values it lists. `token-at-edge` looks at every connection that carries a user's token (`auth: user-token`), and reports any that does not come from a user-facing app. A policy states what it allows or denies, never what it doesn't: write `-> deny auth: key`, not "anything but key". Where you need "has no value", every aspect takes `unstated`, and the policy is a model policy, about what your model must say: ```kanoniq policy vaulted in model "Secrets state their vault" when credential: secret or certificate -> deny stored-in: unstated ``` ## What a clause can name Some clauses read **what a subject states**: | Clause | Applies to | Values | | --- | --- | --- | | `auth` | A connection, a leg through a broker, a sync | `none`, `key`, `certificate`, `client-credentials`, `workload-identity`, `user-token`, `on-behalf-of`, `kerberos` | | `protocol` | A connection, a sync | The protocols, such as `http`, `grpc`, `ldap`. `http` also matches `http/json` and `http/xml` | | `broker` | A leg through a broker | The broker kinds, such as `kafka`, `azure.service-bus.queues`; for a file handoff's leg, its channel's kind, `file-share`, `blob-storage` or `sftp` | | `credential` | A client workload identity | `secret`, `certificate`, `federated`, `managed` | | `stored-in` | A client workload identity | `unstated` | | `rotate` | A client workload identity | How often its credential is rotated, a period: a bound, `over P90D` or `under P2D`, and `unstated` | | `grant` | A grant | `app-role`, `scope`, `role` for any cloud role, or a cloud role in quotes, `"Owner"` | | `confidence` | Any subject but a sync and a grant | `assumed`, a subject marked with an [`#assumed` line](https://kanoniq.extenza.dev/docs/language/assumptions.md), or carrying one from its sources; `unstated` for one that is not | | `intent` | A channel | What its connections [carry](https://kanoniq.extenza.dev/docs/language/integration.md#what-a-connection-carries): `event`, `command` or `query` where all of it is of that one kind, `mixed` where it is more than one; `unstated` where they carry nothing stated | | `publishers` | A channel | How many components or monoliths publish to it: `one`, or `many` where more than one does. A component publishes to a channel when a leg of its into it carries an event, or carries nothing on a topic or a stream; a leg carrying only commands or queries never counts. `unstated` where none is counted | | `sources` | A data entity | How many components its [syncs](https://kanoniq.extenza.dev/docs/language/integration.md#what-a-sync-carries) come from: `one`, or `many` where they come from more than one; `unstated` where it has no sync | | `relationship` | A bounded context | The [relationships](https://kanoniq.extenza.dev/docs/language/domain-driven-design.md#relationships-between-contexts) it states, and the partnerships, shared kernels and separate ways stated toward it: `conforms-to`, `customer-of`, `partnership`, `shared-kernel`, `separate-ways` | | `pattern` | A line of the [context map](https://kanoniq.extenza.dev/docs/language/domain-driven-design.md#the-context-map) | `open-host`, `published-language` and `acl` where every crossing of it has them, and each relationship stated between its two contexts | | `no-acl-from` | A line of the context map | For each crossing of it through no anticorruption layer, the kind of the component at its upstream end, `custom` for a monolith, and `big-ball-of-mud` where the upstream context is one | | `path` | A line of the context map | How data travels between its two contexts, either way: `call`, `leg` through a channel, `sync` | | `function` | A task of a business process | Only `unstated`: a task that names no function | | `via` | A call | Only `unstated`: a call that names no gateway it goes through | | `exposure` | A call, a leg, an API, a broker, a platform service | `internet` or `internal`, per stage: an API's, a broker's or a platform service's own, a call's its target's, a leg's its channel's | | `in-transit` | A call, a leg, an API, a broker, a platform service | `encrypted` or `plaintext` as an API or a broker states it; else `encrypted` where the endpoint, or the gateway a call goes `via`, serves a certificate, its transport takes no plaintext, or it is reached with `auth certificate` | | `run` | A platform service | `paas` or `on`: how it runs, as stated or as its product word fixes it | | `waf` | A gateway | Only `unstated`: a gateway that states no `waf` | | `ddos` | A gateway, a network | Only `unstated`: a gateway or a network that states no `ddos`; the provider's always-on base protection is never stated | | `stage` | A connection, a leg through a broker, a sync | Read per stage pair, below: `same` where the pair stays in one stage, `crossed` where it joins two; `unstated` where either side is | | `way-in` | A data entity, as a `holding` | How its data gets there: `origin`, `replica` where a sync writes it, `action` where a task marked `data` enters it, `command` where its component handles a command about it, `event` where another component sends it one; `unstated` where none of these is stated | Every one of these also takes `unstated`, which matches a subject that states nothing for it. A connection with no `auth`, for example, matches `auth: unstated` and nothing else about `auth`. `rotate` also takes a **bound**: `over P90D` matches a rotation strictly longer than 90 days, and `under P2D` one strictly shorter than two days. Periods are compared by length, not in whole days, so `PT47H` is under `P2D` and `PT48H` is not. Bounds and words join with `or`, as in `rotate: under P1D or over P90D`. A credential that states no rotation matches no bound, only `rotate: unstated`. Others read **where a subject sits**: | Clause | Values | Matches | | --- | --- | --- | | `type` | `call`, `leg`, `sync`, `grant`, `workload`, `element`, `realization`, `influence`, `value-delivery`, `reference`, `context`, `context-edge`, `task`, `holding`, `root`; and a piece of infrastructure by its keyword, `network`, `host`, `app-platform`, `db-server`, `gateway`, `broker`, `dns`, `certificate`, `storage-account`, `vault`, `registry`, `ai-platform`, `backup-vault`, `security-service`, `data-center` | What the subject is: `context` a bounded context, `context-edge` a line of the context map, `task` a task of a business process, `holding` a data entity judged by how its data gets there, `root` a root data entity; an infrastructure keyword one of its `element`s | | `kind` | A component kind, `custom` for a monolith, `client`, `server`, `app-role`, `scope`, an infrastructure kind | A component's or monolith's own kind, a permission's, or a workload identity's; a piece of infrastructure's kind as written and the generic kind its product word maps to, so `kind: postgresql` reaches `azure.postgresql` | | `from`, `to` | A component kind, `custom` for a monolith, `idp`, `vault` | The component or monolith at that end, by its kind or its `idp` mark; `vault` a vault a call lands on | | `across` | `ecosystems`, `platforms`; `networks`, `internet`, `devices`, `trust-boundaries` for any of them, `unstated` | A connection whose two ends are in different ecosystems, or different platforms; a call, a leg or a sync by the [trust boundaries](#trust-boundaries) it crosses, and `unstated` where its placement can't be read | | `within` | `ecosystem`, `platform` | A connection whose two ends are in one ecosystem, or one platform | | `direction` | `in`, `out` | For a policy written below the model: a connection coming into where it is written, or going out | | `env` | `DEV`, `TST`, `ACC`, `UAT`, `EPH`, `PRD`, `unstated` | An element or a workload identity by the stages it runs in: its own `environment` lines, or else those of the nearest part holding it that states any; `unstated` where none does | | `from-env`, `to-env` | `DEV`, `TST`, `ACC`, `UAT`, `EPH`, `PRD`, `unstated` | A connection, a leg or a sync by each stage pair, below: the stage at its source, and the one it reaches at its target | | `data` | `canonical`, `managed` | A root data entity by its domain object: `canonical` where it is marked so, `managed` where its users manage it | | `confidentiality` | Your repository's levels, by default `public`, `internal`, `confidential`, `restricted`; a bound, `over` or `under` a level; `unstated` | A domain object by the level it states, a data entity, as an `element`, a `holding` or a `root`, by its domain object's; a connection and a leg by the most sensitive domain object their messages are about, a sync by its entity's; `unstated` on every other element | | `personal-data` | `none`, `personal`, `special-category`, `unstated` | The same subjects, read the same way, `none` below `personal` below `special-category` | | `scope` | Your repository's regulated scopes | A subject in a [regulated scope](#controls-and-regulated-scopes): a data entity holding or copying its data, a connection, leg or sync carrying it, a channel or broker it passes through, and the storages, components, monoliths and what they run on; no `unstated`, and a subject in none matches nothing | | `connected-to` | Your repository's regulated scopes | An element outside a scope with a connection, sync or leg to or from one in it, or a gateway a call into it goes through: one hop, no further | | `subdomain` | `core`, `supporting`, `generic` | A bounded context by its subdomain type: its domain's, or that of the one domain its components are filed in | | `upstream`, `downstream` | `core`, `supporting`, `generic`, `big-ball-of-mud`, `unmapped` | A line of the context map by the context at that end | | `crossing` | `call`, `leg`, `copy` | A line of the context map by what it comes from: a call, `in-process` included, a message through a channel, a copy of the other's data | | `status` | `proposed`, `planned`, `building`, `pilot`, `active`, `phasing-out`, `retired`, `unstated` | An element by the status it states; `unstated` where it states none, every element that carries none included | | `future` | `invest`, `maintain`, `migrate`, `replace`, `retire`, `unstated` | An element by the future it states; `unstated` where it is undecided, and on every element that carries none | | `end-of-mainstream-support`, `end-of-extended-support`, `contract-end` | A bound, `over` or `under` a period, and `unstated` | A run element by the vendor date it states, below | | `location` | A region, such as `azure.westeurope`, `data-center`, `unstated` | An element by where it runs, worked out: a piece of infrastructure's own location, else its network's, else that of what it runs on; a part's, those of what it runs on; a storage's, its servers'; `data-center` one in a data center | | `country` | A country, two capitals such as `NL`, a residency your repository declares, such as `eea`, `unstated` | An element by the country it runs in: its region's, its data center's, or a saas component's own; a holding by the countries it is held in; a residency matches any of its countries | | `from-country`, `to-country` | A country, a residency your repository declares, `unstated` | A connection, a leg, a sync or a holding by each country pair, below: the countries data leaves from, and those it reaches | | `leaves` | A country, a residency your repository declares, `unstated` | The same, by each residency or country a pair leaves: one of its countries is on the source side and a country outside it on the target side | | `transfer` | `adequacy`, `scc`, `bcr`, `code-of-conduct`, `certification`, `ad-hoc-clauses`, `public-instrument`, `unstated` | The same, by a pair's grounds: those the contracts covering the receiving element and what it runs on state, and `adequacy` where every country it reaches outside each regime it leaves is on that regime's `adequate` list | | `cloud` | `azure`, `aws`, `gcp`, `unstated` | An element by its product word's or its region's provider; a part's, that of what it runs on | | `zones` | `zonal`, `zone-redundant`, `unstated` | A host or a platform service by its zones: `zonal` in one, `zone-redundant` in several or spread by its provider | `type` also takes `installation`, and `kind` an installation's kind, `os`, `runtime`, `sdk`, `web-server` or `middleware`. A component, a host, an installation and a platform service state their [life cycle](https://kanoniq.extenza.dev/docs/language/technology.md#writing-the-life-cycle); a domain, an API or a network never does, so it matches `status: unstated`. Filter with `status` or `type` to judge only the run elements. A vendor date takes a bound **counted forward from the day the model is judged on**, by the calendar: judged on 2026-10-20, `end-of-extended-support: under P6M` matches a date before 2027-04-20, and `contract-end: over P2Y` one after 2028-10-20. A date already past is under any period, so the policy keeps reporting once support has ended. A bound takes whole days or more, never hours. An element that states no date matches no bound, only `unstated`. The day is the run's, the one `--as-of` gives, or a later plateau's own date, so a policy hears of an end of support months ahead, and a build that passed can fail the next day with no edit to the model: ```kanoniq policy stated-future in model "An active element states its future" when status: active -> deny future: unstated policy supported-os in architecture "No operating system within six months of its end of support" when type: installation and kind: os and env: PRD -> deny end-of-extended-support: under P6M ``` `confidentiality` takes a level as a **bound**, strictly beyond it in your repository's order, least sensitive first: with the default levels, `over internal` matches `confidential` and `restricted`. A subject that states no level matches no bound, only `unstated`. Stating a classification never makes a `no-policy` finding: ```kanoniq policy no-sensitive-to-saas in architecture "Nothing confidential or above reaches a SaaS" when confidentiality: confidential or over confidential -> deny to: saas policy special-category-authenticated in architecture "Special-category data never moves anonymously" when personal-data: special-category -> deny auth: none ``` **`exposure` and `in-transit` are computed** from each plateau's model when a policy asks. `exposure` is never written; `in-transit` is stated on an API or a broker where you know it ([Interface](https://kanoniq.extenza.dev/docs/language/applications.md#interface)), and what is stated is read first. An endpoint is `internet` where it, or a gateway that publishes it, is marked `public`, is `paas` with no `in`, or is in no network while its ecosystem declares networks; `internal` where it and every gateway publishing it are in a network. Plaintext is never read from absence: an endpoint that states nothing and that nothing proves encrypted is `unstated`, and so is either aspect where the model says too little, such as an ecosystem with no network. A call through a gateway to an API stated `plaintext` is `plaintext`: the gateway ends the encryption, and the hop behind it is plain. ```kanoniq policy gateway-at-edge in model "Internet-facing APIs sit behind a gateway" when exposure: internet and type: call -> deny via: unstated policy encrypted-from-internet in architecture "Nothing internet-facing takes plaintext" when exposure: internet -> deny in-transit: plaintext ``` **A connection runs in no stage of its own**, so `from-env`, `to-env` and `stage` read it one **stage pair** at a time, one for each stage its source runs in: that stage at both ends where the target runs there too; else the target's stage, where it runs in only one; else `unstated`, never a guess. A source that states no stage gives one pair, from `unstated`. An API reads its component's stages, a component its own or else its module's or monolith's, a channel its broker's, and a user interface only its own. A connection from a component in `DEV` and `PRD` to one in `PRD` alone has two pairs, `DEV to PRD`, crossed, and `PRD to PRD`, the same. It breaches a policy once, its finding naming every pair that did, and one exemption lifts them all: ```kanoniq policy prd-no-secrets in architecture "No client secret in production" when env: PRD -> deny credential: secret policy no-nonprod-into-prd in architecture "Nothing outside production calls into it" when from-env: DEV or TST or ACC or UAT or EPH -> deny to-env: PRD ``` **Where personal data moves is read one country pair at a time**, `from-country`, `to-country`, `leaves` and `transfer` together. A **country pair** is one hop of a connection in one stage pair, from the countries of its source to those of its target: a call through a gateway has two hops, and so does a sync through a channel. An event or a command moves data forward; a query, or a call carrying no message, is read both ways, since its reply comes back. A holding has its own pair in each stage, from its component to where it's held, so a database in another country moves data with no connection drawn. A side whose place can't be read is `unstated`, never a pass, and a breach names every country pair that breached: ```kanoniq policy eu-only in architecture "Personal data stays in the EEA" when personal-data: personal or special-category -> deny leaves: eea policy grounded in model "A transfer states its ground" when personal-data: personal or special-category and leaves: eea -> deny transfer: unstated ``` A bounded context and a line of the context map are read from each plateau's model, never written. A finding about either is shown on the element marked `bounded-context`, a line's on its downstream context, and an exemption names that element. A clause can also name **a property your repository declares**, as `#` and its name, the way its `#` line writes it: `#owner`, `#sla-tier`. Its values are those of the property's type: an `enum`'s values, `yes` or `no` for a `boolean`, a text in quotes for a `text`, matched exactly as written, and a bound for a `number`, a `duration` or a `date`. A number bound has no unit, `over 500`, since the declaration's unit is the one compared; a `duration` compares by length, as `rotate` does, and a `date` counts forward from the day the model is judged on, as a vendor date does. Every type also takes `unstated`, the only value a `url`, a `page` or a `ref` takes, so those are tested by whether they are written. A list property matches when any of its values does. A property clause judges every subject a policy reaches. A subject whose type cannot carry the property, because the declaration's `on` leaves its type out or because it is a leg, a sync, a grant or a workload identity, states none and matches only `unstated`. So name the types a policy is about in its filter: ```kanoniq policy owned in model "Every backend has an owner" when type: element and kind: backend -> deny #owner: unstated policy large-saas-gold in architecture "A SaaS with over 500 seats is on the gold tier" when kind: saas and #seats: over 500 -> allow only #sla-tier: gold ``` Kanoniq compares what a subject states with the values a clause lists and nothing more: a policy is the only place it reads a property, and the property still means what your repository says it means. Clause names and values are not reserved words, so none of them takes a Code away from you. ## Trust boundaries A trust boundary is where data passes between parts that don't trust each other to the same degree. Kanoniq reads it from where your model places things, never written: there is no boundary to declare. A network is the finest segment it reads. A call, a leg through a broker or a sync crosses one of four edges, each named by its word for `across`: | Edge | `across` | Crossed where | | --- | --- | --- | | An ecosystem's | `ecosystems` | The two ends are in different ecosystems | | The internet's | `internet` | One end is in a network and the other on the internet, or the target is reached from outside its network because it is exposed to the internet | | The user's device | `devices` | The source is a user interface, a client on a `device` host included | | A network's | `networks` | Both ends are in networks, and not the same one, linked or not | `trust-boundaries` matches any of the four. A platform is not a trust boundary: it is containment, and `platforms` keeps its own meaning. - **An end is placed** by its `environment` line in the stage: the host or platform service it runs `on`, in a network or run `paas`. A broker and a platform service are placed by their own `in`. An end placed in no network while its ecosystem declares networks is on the internet: a `paas` service or a host with no `in`, a SaaS in another ecosystem, a user interface. - **Where an end's placement isn't stated, nothing is read from what your model leaves out**: no internet or network crossing, and the connection matches `across: unstated` instead. The ecosystem and device edges never depend on placement. - **A crossing is read per stage pair**, as `stage` is, since a part may run in different networks in each stage. A breach names its pairs where some pairs breach and others don't. - **A call `via` a gateway is read hop by hop**, the caller to the gateway, then the gateway to the target. A leg's ends are its component and its channel's broker; a sync through a broker is read through its two legs, and one over a protocol as a call. ```kanoniq policy encrypted-crossing in architecture "Nothing crosses a trust boundary in plaintext" when across: trust-boundaries -> deny in-transit: plaintext policy placed in model "A flow's crossings can be read" -> deny across: unstated ``` Select a line in the viewer and its information pane lists what it crosses under *Crosses*, per stage pair where they differ. The **boundaries** switch marks each line that crosses one; see [Whole model](https://kanoniq.extenza.dev/docs/views/whole-model.md). ## Where a policy is written Where you write a policy is what it covers: - **At the top of a file**, it is the model's and covers everything. - **In an ecosystem, a platform, a monolith or a component**, it covers what is inside, and every connection with either end inside. A policy on a component covers its own workload identities and every connection into or out of it; add `direction: in` to cover only its callers. ```kanoniq ecosystem shop "Shop" { platform payments "Payments" { component ledger "Ledger" : backend { policy certificates-only in architecture "Callers present a certificate" when direction: in -> allow only auth: certificate } } } ``` An `extend` block or a scoped file counts as the element it reopens. A connection between two ecosystems answers to the policies of both sides. A policy written lower down can only add to what a higher one already says. To loosen a rule for one place, write an [exemption](#exemptions) instead. ## Constants A constant names a value, so a figure your policies and your model use is said once: `const`, a name, `=` and the value, one per line, wherever you may write a policy. ```kanoniq ecosystem shop "Shop" { const MAX_SECRET_ROTATION = P90D policy secret-rotation in architecture "Secrets rotate at least every 90 days" when credential: secret -> deny rotate: over MAX_SECRET_ROTATION } ``` A policy may always write the value instead: `rotate: over P90D` and `rotate: over MAX_SECRET_ROTATION` say the same. **A name** is capitals, digits and underscores, starting with a capital: `MAX_SECRET_ROTATION`, `LIMIT`. It is never a stage, such as `PRD`, and never shaped as a period, such as `P90D` ([KQ274](https://kanoniq.extenza.dev/docs/rules/kq274.md)). **Its value is one of four types**, read from how you write it: | Type | Written as | Example | | --- | --- | --- | | Period | A period, unquoted | `P18M`, `PT4H` | | Number | A whole number | `3` | | Text | Text in quotes | `"Storage Blob Data Reader"` | | Boolean | `true` or `false` | `true` | `"P18M"`, in quotes, is text, not a period. Any other word is a build error ([KB083](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb083)). **Where you write it is what sees it**, as for a [policy](#where-a-policy-is-written). At the top of a file, a constant is the model's and seen everywhere. In an ecosystem, a platform, a monolith or a component, or an `extend` block or a scoped file of one, it is seen there and in everything inside it, and a use anywhere else is [KQ271](https://kanoniq.extenza.dev/docs/rules/kq271.md). A use is resolved where it is written, never where the subject a policy judges sits, so `MAX_SECRET_ROTATION` above serves the policies of `shop` and nothing outside it. **A name is defined once in the whole model** ([KQ273](https://kanoniq.extenza.dev/docs/rules/kq273.md)): never again at another level, so an ecosystem that wants another figure gives it another name. The same name twice in one place is [KB005](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb005), and a name no constant has is [KB082](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb082). **A name is taken wherever a value of its type is**: - **A period** in a policy's bound, a credential's or a certificate's `rotate`, and a schedule's `every`. - **A number** in a bound on a `number` property. - **A text** as a quoted clause value, such as a cloud role on `grant`. - **Any type** as the value of an [open property](https://kanoniq.extenza.dev/docs/language/basics.md#open-properties) of that type. In a workload identity: ```kanoniq credential secret stored-in secrets rotate MAX_SECRET_ROTATION ``` A constant of a type its place doesn't take is [KQ272](https://kanoniq.extenza.dev/docs/rules/kq272.md): a number in a `rotate`, a period in a `text` property. An `every` constant in years or months is [KB011](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb011), as it is when written directly. Your model holds the value at each use, beside the constant it came from, and Kanoniq writes the name back where you wrote it. A constant keeps its Id when you rename it, as any element does, and [`kq arrange`](https://kanoniq.extenza.dev/docs/cli/kq-arrange.md) writes it in the `policies.kq` beside its placement's policies. A constant can change from one [plateau](https://kanoniq.extenza.dev/docs/language/change-over-time.md#what-a-later-plateaus-block-says) to the next: restate it in that plateau's block, `const MAX_SECRET_ROTATION = P30D` inside `ecosystem shop { … }`, and it keeps its Id; `-const MAX_SECRET_ROTATION` there removes it. Each plateau gives every use the constant's value there, so a policy or a `rotate` you wrote once follows it with no change of its own. A use in a plateau its constant isn't in is [KQ406](https://kanoniq.extenza.dev/docs/rules/kq406.md). ## A worked example Say your organization wants every secret in production rotated at least once a month. One constant and one policy say it: ```kanoniq const MAX_PRD_ROTATION = P30D policy prd-rotation in architecture "Production secrets rotate at least monthly" when env: PRD and credential: secret -> deny rotate: over MAX_PRD_ROTATION ``` From the left: 1. **`policy prd-rotation in architecture`** names the policy and puts it in the default [set](#policy-sets) of architecture policies. Its full name is `default-architecture/prd-rotation`. 2. **`"Production secrets rotate at least monthly"`** is its name. 3. **`when env: PRD and credential: secret`** is the filter. A subject must match both clauses: a client workload identity that runs in production, by its own `environment` lines, and keeps a secret. 4. **`-> deny rotate: over MAX_PRD_ROTATION`** is the action and the clause it tests. `MAX_PRD_ROTATION` stands for `P30D`, so the policy reports every subject passing the filter whose credential rotates strictly longer than 30 days. Judged against this model: ```kanoniq ecosystem shop "Shop" { environments DEV, PRD vault secrets "Secrets" : azure.key-vault environment PRD x1 platform iam "Identity" { component platform-idp "Identity" : saas idp technology "Entra ID" } platform apps "Apps" { component orders "Orders" : backend { workload orders-app "Orders" : client in iam/platform-idp { environment PRD credential secret stored-in secrets rotate P90D } } component billing "Billing" : backend { workload billing-app "Billing" : client in iam/platform-idp { environment PRD credential secret stored-in secrets rotate MAX_PRD_ROTATION } } component reports "Reports" : backend { workload reports-app "Reports" : client in iam/platform-idp { environment DEV credential secret stored-in secrets rotate P90D } } orders -> secrets over http billing -> secrets over http reports -> secrets over http } } ``` - **`orders-app`** breaches the policy: it runs in production, keeps a secret, and rotates it every 90 days, over the bound. - **`billing-app`** passes. Its `rotate MAX_PRD_ROTATION` is the same constant the policy bounds, `P30D`, and a bound is strict, so exactly 30 days is not over it. - **`reports-app`** is never judged: it runs in `DEV`, so the filter leaves it out. A secret that states no rotation matches no bound, only `rotate: unstated`, so this policy passes it. The strict model [baseline](#the-baselines) asks every secret to state its rotation; take it beside this policy. Run [`kq validate`](#checking-your-landscape) to see the finding. ## Policy sets ```kanoniq policy-set architecture security "Security" { policy no-key -> deny auth: key policy no-anonymous when across: ecosystems -> deny auth: none } ``` A policy set groups policies under one Code. A set is the model's when it is written at the top of a file, and otherwise its ecosystem's: two `policy-set architecture security { … }` blocks in two platforms of one ecosystem are the same set. Give a set its name in one place only ([KB049](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb049)). Every set is one of two kinds, written right after `policy-set`, and every occurrence of a set states the same one ([KB046](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb046)): - **`model`**: what your model must state. Each policy denies something left `unstated`, such as `-> deny auth: unstated`. A finding means the model is silent where your organization wants it to speak; the system itself may be fine. - **`architecture`**: what your systems may do. No policy mentions `unstated`. A finding means the model states something your organization does not permit. A policy outside every set says where it goes with `in`: `in model` or `in architecture` puts it in that kind's default set, `default-model` or `default-architecture`, and `in security` puts it in the set coded `security`, of the model or of its own ecosystem ([KB048](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb048)). A policy inside a set takes the set's kind and writes no `in` ([KB047](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb047)). `default-model`, `default-architecture`, `baseline-recommended` and `baseline-strict` are reserved set Codes. Every policy has a full name: `/`, such as `security/no-key` or `default-architecture/no-key`, and from another ecosystem `//`. ## Exemptions An exemption lifts one policy from one subject, with your reason, and optionally until a date: ```kanoniq ecosystem shop { platform legacy { exempt security/no-key because "AD bind until the 2027 migration" until 2027-06-30 } exempt security/no-key for commerce/orders -> commerce/stripe/api because "Stripe offers only API keys" } ``` - **Without `for`**, it lifts the policy from the element whose block holds it, and from everything that policy would cover there. - **`for` names the subject**: an element by its path, a root data entity included, a connection as ` -> `, a sync as ` from `, its copy and the component it syncs from as the sync writes it, or a grant as ` grant `. - **Past `until`**, the exemption no longer applies. `until` is the last day it lifts its breach, judged against the run's date and against each plateau's own: a plateau dated past it reports the breach, and so does every plateau once the run's date is past it, the finding naming the plateau and the date that passed `until`. - **In a [plateau](https://kanoniq.extenza.dev/docs/language/change-over-time.md)** that removes the element an exemption is written in, or the subject it names, the exemption goes with it. - Only the side that owns a policy can lift it: in an ecosystem, you can exempt the model's policies and that ecosystem's own. - **A baseline's policy** is named `/`, such as `baseline-architecture-recommended/no-key-crossing`, while `preset` names that baseline in the [settings](#settings). The exemption stays the same after [`kq materialize`](#changing-a-baseline). - **`threats-stated` and `threats-stride`** are reserved for the threat-modeling package, which is planned. An exemption of one of their policies is kept as written: it lifts nothing and nothing reports it, so your model builds the same with the package or without it. A policy is lifted at most once per subject. ## The baselines Kanoniq ships four ready-made policy sets, a recommended one and a strict one of each kind. They hold only what the rest of validation does not already check, and each strict one holds its recommended one's policies. `baseline-model-recommended` asks your model to say how secrets are kept and how its edges authenticate: ```kanoniq policy-set model baseline-model-recommended { policy vaulted when credential: secret or certificate -> deny stored-in: unstated policy stated-saas-auth when to: saas -> deny auth: unstated policy stated-webhook-auth when from: saas -> deny auth: unstated policy stated-vault-auth when to: vault -> deny auth: unstated policy stated-edge-auth when from: user-facing-app -> deny auth: unstated policy replica-has-a-path when crossing: copy -> deny path: unstated policy task-names-function -> deny function: unstated policy holding-has-a-way-in -> deny way-in: unstated } ``` `replica-has-a-path` asks that a copy of another bounded context's data come with a call, a message or a sync between the two contexts, so the model says how it travels. `task-names-function` asks every task of a [business process](https://kanoniq.extenza.dev/docs/language/processes.md#writing-a-business-process) to name the function it performs with `via`, so its systems, data and people can be read; the language itself accepts a task sketched before its functions are cut. `holding-has-a-way-in` asks that the model say how every data entity's data gets there: it is an `origin`, a copy a sync writes, entered by a task marked `data`, or reached by a command its component handles or an event another component sends it. Being `authoritative` is not a way in. `baseline-model-strict` adds that every connection across a platform, every sync and every leg through a broker states its scheme, and so does every call to an identity provider, a backend, an integration, bought software or a monolith; that a client workload identity states its credential; and that a secret or certificate states its rotation. It adds `stated-relationship`, `-> deny pattern: unstated`: every line of the context map reads a pattern at one of its ends or a relationship between its contexts. And it adds `stated-target-stage`, `-> deny stage: unstated`: every connection reaches a stage the model states, in each of its stage pairs. With `stated-future`, `when status: active -> deny future: unstated`, an active component, host, installation or platform service states what is intended for it. With `stated-crossing-transit`, `when across: ecosystems -> deny in-transit: unstated`, every connection across an ecosystem reaches an endpoint whose encryption in transit the model states or proves. `baseline-architecture-recommended` says what your systems may do: nobody anonymous across an ecosystem or a network, and no static secret across an ecosystem; nothing crosses a trust boundary in plaintext (`encrypted-crossing`), and nothing internet-facing takes plaintext (`encrypted-from-internet`); a user's token stops at its BFF and never goes on a broker; nobody calls a SaaS, a backend or an integration anonymously, nor in from a SaaS; a vault is reached with an identity; nobody syncs or uses a broker anonymously; a channel carries one kind of message, events or commands or queries, not a mix (`one-intent-per-channel`); a topic has one publisher, though the language allows several (`one-publisher-per-topic`); and a replica is fed by one component, any data another adds kept in an entity of its own (`one-source-per-replica`). From domain-driven design's advice on the context map: a core context does not conform to another's model (`core-not-conformist`), and a core context takes nothing from bought software (`acl-to-vendor`), nor any context from a Big Ball of Mud (`acl-to-mud`), except through an anticorruption layer. A connection stays in one stage (`one-stage`, `-> deny stage: crossed`): a test system calling into production is reported, and where your organization allows a crossing, an exemption says why. `baseline-architecture-strict` holds those, the two crossing rules widened from ecosystems to platforms, and adds that no client uses a secret; that SNMP, a directory bind, a file share and a cloud role stay inside their ecosystem; per protocol and broker kind, which schemes it accepts, never `none` and never `key` where a token scheme is available; and that a secret rotates at least every 90 days (`secret-rotation`, `-> deny rotate: over P90D`) and a certificate at least yearly (`certificate-rotation`, `-> deny rotate: over P365D`). Where an architecture policy only looks at a stated scheme, a call that states none passes it. Its model counterpart catches that call: `authenticated-saas` and `stated-saas-auth` go together, so take a model preset beside an architecture one. To check one, name it under its kind in `preset` in your [settings](#settings). To change one, write it out with [`kq materialize`](#changing-a-baseline). ## Controls and regulated scopes **A policy says which framework requirements it serves**, with `serves` after its name and before `when`. A policy set may say it too, after its name, and every policy in the set then serves those as well as its own: ```kanoniq policy-set architecture transport "Transport security" serves iso-27001-2022/A.8.24, soc2-2017/CC6.7 { policy encrypted-in-pci "Encrypted in the PCI scope" serves pci-dss-4/4.2.1 when scope: pci -> deny in-transit: plaintext policy encrypted-crossing "Encrypted across an ecosystem" serves nis2/21.2.h when across: ecosystems -> deny in-transit: plaintext } ``` A policy that serves a requirement is what a framework calls a control. A requirement is `/`, the id as the framework numbers it. Kanoniq ships five frameworks, each word naming one version, so a new version is a new word: | Framework | Its word | Ids | | --- | --- | --- | | ISO/IEC 27001:2022, Annex A | `iso-27001-2022` | `A.5.1` to `A.8.34` | | PCI DSS v4.0.1 | `pci-dss-4` | `1.1.1` to `12.10.7` | | SOC 2 Trust Services Criteria (2017) | `soc2-2017` | `CC1.1` to `CC9.2`, then the availability, confidentiality, processing integrity and privacy criteria, such as `C1.2` | | NIS2, Art. 21(2) | `nis2` | `21.2.a` to `21.2.j` | | DORA, Art. 5 to 14 | `dora` | Article, paragraph and point, joined by dots: `9.4.d` | Kanoniq holds the ids only, never a requirement's text. For a standard of your own, declare its word and its ids under `frameworks` in `kanoniq.repository.json`, `"acme-sec": ["NET-01", "NET-02"]`. A framework or id neither has is [KB087](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb087), and a set's requirements are stated on one of its occurrences, [KB088](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb088). A requirement listed twice is [KQ296](https://kanoniq.extenza.dev/docs/rules/kq296.md); one a policy repeats from its set is [KP009](#kp009). An exemption states none, since the policy it names does. **`serves` changes nothing about how a policy is checked**: a breach is reported in its set, at its set's severity, as any breach is. In SARIF, each breach and its policy's rule carry the requirements under `properties`, so a tool importing the log reads which requirement a finding is evidence for. Kanoniq never says a requirement is met: a requirement whose policies all pass passes what the model checks, and what the model can't check, and whether a requirement applies, stay in your GRC tool. Every baseline policy serves its requirements: `encrypted-from-internet` serves `pci-dss-4/4.2.1` among others, and [`kq materialize`](#changing-a-baseline) writes them out. **To follow a framework**, set it to `true` under `frameworks`: `"frameworks": { "iso-27001-2022": true }`. [KQ132](https://kanoniq.extenza.dev/docs/rules/kq132.md) then lists each of its requirements the model can check that no policy you check serves, the baselines included. A framework you don't follow is never reported. **A domain object may be regulated**, `regulated` and the scopes after `personal-data`, each a word of the repository's `regulated-scopes` setting, which lists none by default: ```kanoniq object card "Card" : cards confidentiality restricted personal-data personal regulated pci object order "Order" : sales personal-data personal component checkout "Checkout" : backend { sql orders-db "Orders" { root card authoritative origin root order authoritative origin property "PAN" personal regulated pci } } ``` A significant property ends in `regulated` too, for a holding in a scope through what it keeps: the checkout's orders keep the card number. A scope your settings don't list is [KQ297](https://kanoniq.extenza.dev/docs/rules/kq297.md). What is in a scope is read from the model, never stated: its holdings, every data entity of a regulated object and every one with a regulated property; their copies, sync after sync; what carries the data, each connection, leg and sync with a regulated object and each channel and broker on the way; and the storages, the components and monoliths holding or carrying it, and what they run on. Everything one connection, sync or leg away from those, and a gateway a call into them goes through, is connected to it, one hop and no further. Network placement segments it: whatever shares a network with the scope is in it, whatever sits in a network linked to that one is connected, and a spoke reached only through a hub holding a firewall is out of it. Where nothing states its network, the reading is the worst case. Select a regulated domain object in the viewer and its information pane lists each scope's holdings, copies, carriers, what is in it and what is connected, then its networks, the networks linked to them, the spokes filtered off and what is unsegmented, placed nowhere. **A policy selects a scope with `scope`, and what is connected with `connected-to`**, as `encrypted-in-pci` above does. Both take your scopes and neither takes `unstated`: a subject in no scope matches neither. ## Checking your landscape `kq validate` and `kq build` check the model against its policies once it has no error, and list each finding after the model's own, under `policy findings:`. A model with an error is not checked: fix it first. A finding at `error` makes the command exit with 1, `kq build` after writing its files. `--strict` is about the model's own lints and never makes a policy finding fail. Policies are judged as of today; `--as-of 2027-07-01` judges them as of another day, so you can see what an exemption's `until` will bring back. See [`kq validate`](https://kanoniq.extenza.dev/docs/cli/kq-validate.md), with its output for CI. The other places you see findings: - **In VS Code**, the *Problems* panel lists them as you type, apart from the model's own, under the source `kanoniq policy`. A breach links to the policy it breaks; `no-policy` and the checks below link to this page. - **`kq portal:build`** prints them after the model's findings. None of them stops the site, whatever its severity. ### Settings How strictly your policies are checked is the `policies` setting in `kanoniq.repository.json`. Leave it out, and every policy set you write is checked, with no baseline: ```json { "policies": { "preset": { "model": "baseline-model-recommended", "architecture": "baseline-architecture-recommended" }, "policy-sets": { "security": "error", "shop/legacy": "warn" }, "no-policy": "info", "exemptions": "info", "hygiene": "warn" } } ``` | Setting | What it sets | Left out | | --- | --- | --- | | `enabled` | `false` checks no policy at all. Validation still checks that each one makes sense, and `kq audit` still runs | `true` | | `preset` | The [baselines](#the-baselines) checked as if they were written in the model, at most one of each kind: `model` names `baseline-model-recommended` or `baseline-model-strict`, `architecture` names `baseline-architecture-recommended` or `baseline-architecture-strict` | None | | `policy-sets` | The severity of each set's breaches, by its Code, or `/` for an ecosystem's. A baseline's Code and the default sets' count | `error` | | `no-policy` | The severity of [no-policy](#no-policy) | `info` | | `exemptions` | The severity of a breach an exemption lifts, still listed with its reason | `info` | | `hygiene` | The severity of the checks on your policies, [KP001](#kp001) to [KP009](#kp009) | `warn` | | `hygiene-checks` | A severity of its own for a check on your policies, by its code, over `hygiene`: `{ "KP001": "info" }` reports KP001 at `info`, and `none` not at all. A check it doesn't name takes `hygiene` | None | A severity is `none`, `info`, `warn` or `error`. A set at `none` is not checked at all. ### Before you turn them on [`kq audit`](https://kanoniq.extenza.dev/docs/cli/kq-audit.md) checks every set and lists every finding as `info`, whatever the settings say, those at `none` and `"enabled": false` included. It writes nothing. Run it to see what your policies would report, and `kq audit --enforce` to fail on anything that breaks them. ### Changing a baseline [`kq materialize`](https://kanoniq.extenza.dev/docs/cli/kq-materialize.md) writes every baseline `preset` names into `model/policies.kq` as a policy set of your own, of the baseline's kind, and removes `preset` from the settings. Each policy keeps its Id, so its findings and exemptions stay the same. From then on it is yours to change. ## Findings Kanoniq names each finding about your policies: a breach by its policy, `/`, and the rest by the ids below. The checks on your policies themselves, `KP001` upward, never run across two sets, since two sets have two owners. ### no-policy — nothing speaks to it A call, a leg, a sync, a grant or a workload identity states a value, such as an `auth` scheme or a `credential`, and no architecture policy you check reaches it: no `deny` matches it and no `allow` governs it. A model policy never counts, since it only asks for what is left unstated. It is a gap in your rules rather than a breach. A connection that states nothing is never reported. A property it states never counts: only the values above do. Nor does a `function`, `via`, `stored-in`, `waf` or `ddos` it states, which no policy can name except by its absence. Write a policy that covers it, or leave it: it is reported at `info` unless your settings say otherwise. ### KP001 — unused A policy that, in no plateau, reaches anything its selecting clauses match, of a type its tested clause applies to. A tested property clause that lists no `unstated` applies only to a type that can carry the property. Its placement or its selectors are narrower than you meant, or the landscape has nothing it is about yet. ### KP002 — shadowed An `allow` lists a value that can never pass: a `deny` of the same aspect, covering it, denies that value, or an `allow` at an enclosing level, covering it, does not list it. On `rotate`, a bound is such a value when every period it takes is denied, or when it shares no period with the enclosing `allow`: `allow only rotate: over P90D` below an enclosing `allow only rotate: under P30D`. Remove the value, or change the policy that hides it. ### KP003 — redundant A policy another one already does: a `deny` covered by another `deny`, an `allow` covered by an `allow` at its level about the same aspect, or the second of two policies that repeat each other. On `rotate`, a `deny` of `over P90D` is covered by one of `over P30D`, since every period over `P90D` is over `P30D`. Remove it. ### KP004 — contradicting Two policies of one set that cannot both hold: an `allow` and a `deny` about the same aspect, at nested placements, that can judge the same kind of subject, sharing a value; or two `allow` lists at two nested levels sharing no value, so nothing they govern can pass. On `rotate`, two bounds share a value when the periods they take overlap: `allow only rotate: under P30D` and `deny rotate: over P10D` share every period between. Decide which one stands. ### KP005 — too broad A clause lists every value its aspect or selector can take, `unstated` aside: a `deny` of everything, or an `allow` that lets everything through. On `rotate`, bounds that together take every period are too broad, as `under P1D or over PT1H` are. Narrow it, or drop the clause. ### KP006 — exemption unused An exemption that lifts no breach in any plateau: what it exempts already complies. Remove it. ### KP007 — exemption expired An exemption past its `until`, judged against the day of the run. The breach it lifted is reported again. Fix the breach, or extend the date with a reason. ### KP008 — exemption out of reach An exemption whose policy, in no plateau, can reach the subject it names, so it can never lift anything. Name the right policy or the right subject. ### KP009 — serves redundant A policy states a requirement in its `serves` that its policy set already states, so it serves the requirement twice over: through its set and on its own line. Remove it from the policy. ## Formatting A policy stays on one line however long it gets. In a block, policies come first: each set under its `policy-set ` line, then each policy written outside a set on its own line, with its `in`, then the exemptions. [`kq arrange`](https://kanoniq.extenza.dev/docs/cli/kq-arrange.md) gathers them in one place: the model's policies in `model/policies.kq`, and each ecosystem's in `/policies.kq`, with the policies written on a platform or a component in an `extend { … }` block by path, and that ecosystem's exemptions last. ## Reference The element types, relationships and kinds of this area, each with what it means. **Element types** | Element type | What it is | | --- | --- | | Policy Set | A Policy Set groups Policies of one kind, which are judged together and reported under the set's Code. A Policy Set belongs to the model or to one Ecosystem. | | Policy | A Policy is an organization's architecture rule: a filter and an action, allow or deny. Where it is written is what it reaches; its findings are conformance, never validity. | | Constant | A Constant names a value, such as a rotation period, so the policies that use it say it once. Where it is written is what sees it. | **Relationships** | Relationship | What it says | | --- | --- | | Exemption | An Exemption lifts one Policy from one subject, with the reason. A breach it lifts is still reported, as exempted; past its last day it lifts nothing. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/basics.md # Language basics Ids, codes, files and what every statement shares. ## Basics **Files** are UTF-8 text with LF line endings. A model is every `.kq` file under its repository's `model/` folder, read as one (see [The model is the files](https://kanoniq.extenza.dev/docs/concepts/the-model-is-the-files.md)). **Layout is free.** Newlines and indentation only separate words. The formatter writes one statement per line, two-space indents and aligned columns, so let it handle layout (format on save in VS Code, or `kq fmt`). **Codes** are lowercase letters and digits in hyphen-separated groups: `order-service`, `api2`. **Paths** join Codes with `/`: `platform-orders/order-service/order-api`. See [Names, Codes and paths](https://kanoniq.extenza.dev/docs/concepts/names-codes-and-paths.md) for how a path is resolved. A Code has no length limit. **`-`** before a path or a statement, in a later plateau's block, removes it (see [Change over time](https://kanoniq.extenza.dev/docs/language/change-over-time.md)). A Code never starts with `-`. **Version tags** are `v` and digits, `v1`, and number a policy's versions, the versions of an event, a command, a query or an API, and the version a call names. Spelled like a Code, `v1` is still a valid Code anywhere else. **Names** are double-quoted and never empty. `\"` and `\\` are the only escapes. **Comments** start with `//` and run to the end of the line. The formatter keeps them where they are: above a statement, at the end of its first line, or above a closing brace. A comment anywhere else stops the formatter with an error naming it, rather than being lost. **Descriptions** are `///` lines directly above a declaration or a statement. They become the element's description, which the viewer's Information pane and the editor's hover show. Text between backticks on one line, such as `` `orders-api` ``, is shown as code in the viewer; an export keeps the backticks as written. ```kanoniq /// The single front door for the storefront apps. Fans out to the /// catalogue, search and basket services; owns no data of its own. component storefront-bff "Storefront BFF" : backend technology ".NET" ``` ## What may be written where Writing a declaration inside a block puts the element inside that block's element. These are the only nestings allowed: | Inside | You may declare | | --- | --- | | a file | `plateau`, `ecosystem` | | `plateau` | `ecosystem`, `extend`: the model at that point in time, so the block contains nothing (see [Change over time](https://kanoniq.extenza.dev/docs/language/change-over-time.md)) | | `ecosystem` | `domain`, `platform`, `monolith`, `broker`, `environments`, `db-server`, the rest of the [infrastructure](https://kanoniq.extenza.dev/docs/language/technology.md#writing-infrastructure) and its `link`s, `job-role`, `process`, and, in a later plateau's block, `data-migration` (see [Data migrations](https://kanoniq.extenza.dev/docs/language/change-over-time.md#data-migrations)) | | `ecosystem`, `domain`, `platform`, `monolith`, `module`, `component` | also a `motivation` block, or `motivation for` another element | | `domain`, `platform`, `monolith`, `module`, `component` marked `bounded-context` | also its relationships with other bounded contexts: `conforms-to`, `customer-of`, `partnership`, `shared-kernel`, `separate-ways` (see [Relationships between contexts](https://kanoniq.extenza.dev/docs/language/domain-driven-design.md#relationships-between-contexts)) | | `motivation` | `stakeholder`, `driver`, `assessment`, `goal`, `impact`, `principle`, `value`, `purpose`, `value-stream`, and `influences`, `delivers` and the realizations of goals, value stream stages and impacts | | `driver`, `assessment`, `goal`, `principle` | more of its own kind | | `value-stream` | `value-stream-stage` | | `domain` | either `domain`s, or `function-group`s and `function`s — never both; and `process` | | `job-role` | `holds` | | `process` | `pool`, `lane`, `task`, `start`, `end`, `xor`, `and`, and `then` lines | | `pool` | `external` | | `function-group` | `function` | | `platform` | `component`, a user interface (`spa`, `mobile-app`, `desktop-app`) that no component serves, `broker`, `db-server` and the other platform services, `object`, and relationship statements | | `monolith` | `module`, `component`, interfaces, storages of any kind, `broker`, `db-server` and the other platform services, `object`, `identity`, `role`, `event`, `command`, `query`, and relationship statements | | `module` | `component` | | `component` | interfaces, storages of any kind, `identity` and `role`, `event`, `command` and `query` | | `event`, `command`, `query` | its versions, `v1`, `v2`, one per line | | `broker` | `channel` | | `db-server` | `pool`, and a `broker` in a `redis` one | | `storage-account` | its queue `broker` | | `registry` | `repository` | | `ai-platform` | `model` | | a storage | data entities, and in a `file` or `blob` one, `channel` | An `identity` in a component or monolith not marked `idp` is reported by validation ([KQ043](https://kanoniq.extenza.dev/docs/rules/kq043.md)), and so is a `role` in one with no user interface of its own ([KQ040](https://kanoniq.extenza.dev/docs/rules/kq040.md)). Two misplacements are reported with where the declaration belongs: a `module` written in a `platform` belongs in a monolith, and a storage belongs in the component or monolith that owns it. ## Relationships | Relationship | Means | | --- | --- | | **Containment** | One element is inside another. Written by nesting, never as a statement | | **Connection** | Who calls whom: a component calls an interface, or sends to or receives from a channel. The arrow points the way control flows, from the caller | | **Realization** | An application element implements a domain, function group or function in its own ecosystem; or the function side contributes to a goal, carries a value stream stage or causes an impact | | **Influence** | An assessment or a value bears on a driver, or a driver or an impact on a goal, with an optional strength | | **Value delivery** | A value stream delivers a value | | **Access** | A component of a monolith reads or writes a data entity its monolith holds itself, naming an aggregate by its root. Optional, and legal only inside one monolith. No view draws it as a line | | **Context relationship** | How one bounded context relates to another: conformist, customer and supplier, partnership, shared kernel or separate ways (see [The context map](https://kanoniq.extenza.dev/docs/language/domain-driven-design.md#the-context-map)). The context map view draws it | | **Property link** | An element's `ref` property names another element, one link per value of a `ref` list (see [Open properties](#open-properties)). Kanoniq derives it from the `#` line; no view draws it | A connection, a realization, an access, an influence, a value delivery or a `references` line may be marked [assumed](https://kanoniq.extenza.dev/docs/language/assumptions.md) when you have not checked it. **A connection starts at a component**, or at a monolith that holds its interfaces itself, or at a user interface, or, delivering a message, at a channel. It lands on an interface or a channel, never on a component but for a delivery out of a channel and an `in-process` call; a monolith that holds its interfaces itself is reached through them in the same way. **Only `ui` lands on a user interface**, and only a robot or a role states it. **Realization runs at any altitude.** A platform, a monolith, a module or a component may realize a domain, a function group or a function. A realization written on a platform, a monolith or a module covers every component in it. The target is never an ecosystem, and never a domain that holds sub-domains: realize the sub-domain that applies. Once an ecosystem has domains, every component should realize something, directly or through its platform, monolith or module, so shared infrastructure such as a gateway belongs in an Enabler Domain (see [Enabler Domains](https://kanoniq.extenza.dev/docs/language/business-functions.md#enabler-domains); [KQ104](https://kanoniq.extenza.dev/docs/rules/kq104.md)). **A component has a primary domain**: the one it belongs to, where it is documented and filed. It is the domain its realizations lead to; a component realizing into several domains, such as a front end serving several, marks one realization `primary` to say which (see [Realization](https://kanoniq.extenza.dev/docs/language/applications.md#realization)). The primary domain says nothing about what the component realizes, and views still draw it under each domain it realizes into. **A connection may say how its caller authenticates**: one scheme per arrow, such as `key`, `client-credentials` or `on-behalf-of`, named by how the credential works rather than by product, and for a token the identity provider that issues it. On a leg into or out of a channel, it is that component's credential at the broker. See [Authentication](https://kanoniq.extenza.dev/docs/language/identity-and-access.md#authentication). **A call may name the gateway it goes through**, `via`: one that publishes the API the call lands on, or the `nat` gateway it leaves by. Leave it out and no gateway is said; a call through a gateway is never written as two calls. See [Connections](https://kanoniq.extenza.dev/docs/language/integration.md#connections). **A connection may go through an anticorruption layer**, `acl`, where the component at its end translates what it takes from another bounded context. See [Through an anticorruption layer](https://kanoniq.extenza.dev/docs/language/domain-driven-design.md#through-an-anticorruption-layer). **A connection may say what it carries**: the events, commands and queries on it, each with its version where it has versions. An event travels into and out of channels, a command or a query to the component that handles it. Say nothing and nothing is said. See [What a connection carries](https://kanoniq.extenza.dev/docs/language/integration.md#what-a-connection-carries). A webhook is just an HTTP call. What the receiver does next is process, not landscape. **There are no application services.** A function says what a component does and an interface says how it is reached, which is the separation an application service would otherwise provide. ## Relationship statements Connections, realizations and accesses are written in a platform or monolith block: the one holding the component they start from, or the monolith around the module that holds it. A monolith that connects or realizes as a component does writes the statement in its own block. A connection from a user interface goes in the block of the platform or monolith it belongs to. A delivery from a channel, which starts from no component, is written where the component receiving it is. ### Naming a relationship A connection or realization may carry its own Code and name, after `as`: ```kanoniq web-shop -> order-service/orders-api over http as place "Place order" ``` ## Open properties A `#` line above a declaration or a relationship statement gives it a property your repository has declared: a cost center, a go-live date, a runbook link. Write the `///` description first, then one `#` line per property, the name and its value, or a list's values separated by commas: ```kanoniq /// The single front door for the storefront apps. #cost-center "CC-42" #rto PT4H #owned-by storefront component storefront-bff "Storefront BFF" : backend technology ".NET" #sla-tier gold #tactics retry, circuit-breaker storefront-bff -> catalogue-service/api over http ``` Declare each property once, in `kanoniq.repository.json`, under `properties`, with its type: ```json { "properties": { "cost-center": { "type": "text", "label": "Cost center" }, "rto": { "type": "duration", "label": "RTO" }, "sla-tier": { "type": "enum", "values": ["gold", "silver", "bronze"], "on": ["Connection"] }, "tactics": { "type": "enum", "list": true, "values": ["retry", "circuit-breaker", "outbox"], "on": ["Connection", "Component"] }, "owned-by": { "type": "ref", "targets": ["Platform"], "on": ["Component"] } } } ``` | Type | Write | For example | | --- | --- | --- | | `text` | A text in quotes | `#vendor "Oracle"` | | `number` | A number; `unit` in the declaration is shown after it | `#seats 250` | | `boolean` | `yes` or `no` | `#pci-scope yes` | | `date` | A date | `#go-live 2025-03-01` | | `duration` | `PT30M`, `PT4H`, `P90D`, `P18M` (months) or `P7Y` | `#rto PT4H` | | `url` | An `http` or `https` address in quotes | `#runbook "https://wiki.example.com/bff"` | | `page` | A page file's path from the repository's root, in quotes | `#overview "portal/Home/Selling.page.yml"` | | `enum` | One of the declaration's `values` | `#sla-tier gold` | | `ref` | The path of an element, as a reference in the declaration is written | `#owned-by storefront` | `on` lists the types a property may be written on; without it, any element type may carry it, and any connection, realization, influence or value delivery too, except a `ref`, which only an element carries. A data entity, a policy, a plateau and a data migration carry none. `label` is how the viewer names it. **`"list": true` lets a property take several values**, written on one line with a comma between each: `#tactics retry, circuit-breaker`. Only `enum`, `ref`, `text`, `url` and `page` can be lists; a `boolean`, `number`, `date` or `duration` never is, since two of those on one element mean two different things, each a property of its own. The values keep the order you write them in, and the order means nothing. Give each value once; a `ref` list names each element once, and each value is a relationship of its own. A property without `list` takes one value. An unquoted value holds no comma, so `#x a,b` is two values. **`brand` is Kanoniq's own property**: which brand or brands an application, a website, a kiosk or a customer population belongs to. List your brands in its entry, which takes only `values`, `label` and `description`; its type and where it goes are Kanoniq's. Write it on a platform, a monolith, a component, a user interface or an identity, several brands separated by commas; a backend no customer sees carries none. It is not inherited: an interface in a platform marked `#brand acme` has no brand unless it says so. ```jsonc "brand": { "values": ["acme", "budget-co"], "label": "Brand" } ``` ```kanoniq #brand acme, budget-co spa shop "Shop" ``` A repository made by [`kq init`](https://kanoniq.extenza.dev/docs/cli/kq-init.md) starts with three properties declared, each under a comment: `brand`, with an empty `values` list for you to fill, and two linking their sources. `pcf` holds an element's ID in APQC's [Process Classification Framework](https://www.apqc.org/process-frameworks), the five-digit number that stays the same when APQC renumbers its hierarchy. `bian` holds the name [BIAN's Service Landscape](https://bian.org/deliverables/service-landscape/) gives what the element matches: a service domain on a Function, a business domain or business area above it. Both are text and go on a Domain, a Function Group or a Function. The PCF's hierarchy number is not a property: it goes in the parentheses after the name, as [your organization's code](https://kanoniq.extenza.dev/docs/language/business-functions.md#domain-function-group-function). Kanoniq gives neither a meaning of its own, so delete them, rename them, make one an `enum` or a list as you like: ```kanoniq #pcf "10215" #bian "Customer Offer" function make-offer "Make offer" ("3.2.1") ``` `assumed` and `confidence` are reserved names: declaring either is an error, since an [`#assumed` line](https://kanoniq.extenza.dev/docs/language/assumptions.md) says what both would; `brand` is Kanoniq's own, declared only as above. A property goes on an element's declaration, as its description does, never on a reopening. In a later plateau, the declaration restating the element states its properties, all of them, a list whole. A property declared nowhere, or a value not of its type, is reported ([KQ058](https://kanoniq.extenza.dev/docs/rules/kq058.md), [KQ059](https://kanoniq.extenza.dev/docs/rules/kq059.md), each value of a list on its own); one property given twice, several values on a property that is not a list, a value given twice in a list and a comma with no value after it are errors ([KB013](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb013), [KB074](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb074), [KB012](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb012)). The viewer lists an element's properties in its Information pane, a list on one row; no diagram draws them. **In VS Code**, typing `#` on a new line above a declaration or a statement offers the properties your repository declares for it, each with its label, type and description, and `assumed`; a name already written above it is not offered again. After a name and a space, and after each comma of a list, it offers an `enum`'s values not yet given, `yes` and `no`, or for a `ref` the elements it may name. Hover over `#` and the name to see its declaration, or that it is declared nowhere. ## Extend `extend` adds children to an element declared anywhere in the model, from any file: ```kanoniq extend shop/commerce/processing { grpc-api status-api "Status API" } ``` The path is the full path from the root, without a leading `/`. Inside, everything reads exactly as if it were written in the target's own block: references resolve from the target, and it holds only what the target's block may hold. A path that names nothing is an error, starting `extend :`. An `extend` may add to an element another `extend` declares. `kq build` writes what it adds the same way. ## Splitting a model A model can be split across as many files and folders as you like. No keyword marks it. ### Reopening an element Declare an element once, with its name and attributes, and **reopen** it in any other file with its keyword, its Code and a block. The declaration and every reopening are one element, with one Id: ```kanoniq // shop.kq ecosystem shop "Shop" { platform orders "Orders" { component order-service "Order Service" : backend { sql orders-db "Orders DB" { order } } } } // orders-data.kq ecosystem shop { platform orders { component order-service { sql orders-db { root order authoritative origin identifier "Order number" } } } } ``` - The name, the attributes (a component's, monolith's or module's kind, `idp`, `technology`, the abbreviation of an ecosystem, a domain, a function group, a function or a driver, `enabler`, a domain's subdomain type, `bounded-context`, `big-ball-of-mud`, an API's or a channel's `open-host` and `published-language`, `canonical`, an assessment's or a value stream's kind) and the `///` description go on the declaration, and only there. Writing them on two occurrences is an error, even where they agree. - Reopening something declared nowhere is an error, so a mistyped Code never creates an element. - Only an element that holds others can be reopened: ecosystem, domain, function group, platform, monolith, module, component, broker and storage. A function, an interface, a channel, a domain object, an identity or a role is declared once. - A data entity can be written in several places in its storage, each fact once: `root`, a marker, `from`, a key or property, a policy, `part of`, `references`. - Relationships from every file add up. The same one written twice is an error ([KQ026](https://kanoniq.extenza.dev/docs/rules/kq026.md)). - Files are read in the order of their paths, so an element reopened in several files lists its children in that order. ### Scoped files A file whose first line is `scoped` is read inside the element its folder names, so it needs no wrapping: ```kanoniq // shop/orders/selling.d.kq scoped component order-service { sql orders-db { root order authoritative origin identifier "Order number" } } ``` - `scoped` is the first line, alone. Nothing comes before it, not even a comment. - The folder, from `model/` (in the folder holding `kanoniq.repository.json`), names the element: an ecosystem's Code, then a platform's or a monolith's in it, then anything under that. `shop/orders/` is the platform `orders` in the ecosystem `shop`. - A scoped file holds what that element's block may hold, and no `ecosystem` or `ids`. It holds an `extend` only for [policies](https://kanoniq.extenza.dev/docs/language/governance.md#formatting), as `kq arrange` writes an Ecosystem's. - A file without `scoped` reads as any other file does, in any folder. - The scope must be declared in another file, and a scoped file directly in `model/` is an error, since that folder names no element. Every folder holding a scoped file, and each folder above it, must name an element; one that doesn't is an error for the scoped files under it. Other folders are free, until the model is arranged. Renaming or moving an element in the editor renames or moves the folder that names it, and the file beside it named after it. In a git repository, VS Code stages each tracked file it moves as a rename, as `git mv` would. The `plateaus` folder, where [`kq arrange`](https://kanoniq.extenza.dev/docs/cli/kq-arrange.md) puts the plateau files, names no element. ### The conventional layout `kq arrange` sorts a model into one layout: a file per ecosystem at the root, a folder per ecosystem holding `domains.kq`, `motivation.kq` for the motivation of the ecosystem and its domains, and a file per platform or monolith, and a folder per platform or monolith holding its own and its components' motivation in `motivation.kq`, each domain's software in `.s.kq` and its data in `.d.kq` and its identities and roles in `.i.kq`. An ecosystem's job roles go in `.i.kq` in its folder, its processes, its domains' included, in `processes.kq`, and its scenarios in `scenarios.kq`. What belongs to no single domain goes in files named after the platform or monolith. Once a model is arranged, anything out of place is reported until you run `kq arrange` again. See [`kq arrange`](https://kanoniq.extenza.dev/docs/cli/kq-arrange.md). ## Formatting The formatter writes one layout, the same on every machine, so a change to a model is a small diff. Format on save in VS Code, or `kq fmt`, applies it: - Two-space indents, one statement per line, no trailing spaces, and a final newline. - Within a block: `move` lines first, then declarations, connections, realizations and relationships between contexts, each group in the order you wrote it, then the `-` lines. - Plateaus: the one with no block first, then the top level, then every other plateau with its block, in order. A block holds only what changes there. - A data migration comes after every other declaration of its Ecosystem's block, its `covers` lines before its `link` lines. - **A run of statements of the same shape is aligned in columns**: the names, the `->` targets, the `over` and the `realizes` line up. A blank line ends a run, so group statements with blank lines to choose what aligns. A declaration that opens a block stands alone, and a statement with a `technology` clause doesn't align with one without. A realization's `primary` mark is its own column, left blank on the unmarked realizations of a run that has one, so a marked realization still lines up with its neighbors. - Blank lines between statements are kept, at most one in a row. - An [`#assumed` line](https://kanoniq.extenza.dev/docs/language/assumptions.md) goes after the `///` description and before the `#` property lines. - Every reference is rewritten to the shortest path that still resolves from where it is written. - A code in parentheses loses its quotes where it needs none, so `("ENV-1.1")` becomes `(ENV-1.1)`, and keeps them where it does, `("3.2.1")`. - Policies, policy sets and exemptions open the block they are in; see [Formatting](https://kanoniq.extenza.dev/docs/language/governance.md#formatting). - A policy with one version is written on one line, without `v1` when it applies from the start; several versions are a block of tagged lines. - Comments stay where they are: above a declaration, a statement, a policy version, or a `grant`, `runs-as`, `used-by`, `environment`, `credential` or further `from` line, at the end of its first line, or above a closing brace. A comment anywhere else has nowhere to go, so formatting stops and names it rather than dropping it. A long name realigns its whole run. That is the price of a file that reads as a table, and a run is as short as your blank lines make it. ## Written by Kanoniq You will see these in `.g.kq`. Don't type them. | Marker | Means | | --- | --- | | `derived` | Created by Kanoniq from something you wrote | | `derived orphan` | Created by Kanoniq, and nothing names it any more. `kq prune` removes it | | `derived plateau initial` | The plateau of a model that declares none | | `derived data-migration` | The data migration of a change of authority you declared none for, in its plateau's block | | `ids { … }` | Every element's Id | ## Reserved words Every keyword, and every kind and protocol, is reserved, but for the kinds the build checks: those of the [infrastructure](https://kanoniq.extenza.dev/docs/language/technology.md#writing-infrastructure), a broker's, a channel's and a repository's format, so `vm`, `postgresql` or `edge` stays a Code you can use. A Code that spells a reserved word is written with an `@`, such as `@customer`; the Model holds `customer`. The reserved words: ```text about ACC acl active after ai-platform allow and anonymous app-platform app-role architecture as assessment at auditor auth authoritative avro azure b2b-representative backend backup backup-vault basis because before big-ball-of-mud blob bounded-context branch branch-code broker building by canonical carries cdc certificate channel client client-credentials command component confidentiality conforms-to const contract contract-end core cots country covers credential critical cron custom customer customer-of daily data data-center data-migration data-use dated db-server ddos delivers deny deployable derived desktop-app DEV dns document domain driver ecosystem email employee enabler encrypted end end-of-extended-support end-of-mainstream-support ends environment environments EPH etl event every exempt extend external failover falling federated file for format forwards-to freelancer fri from function function-group future gateway generic goal grant graph graphql graphql-api grouping grpc grpc-api headquarters holds host http http-api identifier identity idp ids impact in in-process in-transit influences initial installation integration internal invest ipc ipc-api is issuer job job-role joint json kerberos key key-value lane last law ldap ldap-api legal-entity lei link location log mail-api main-stream maintain managed message migrate mixed mobile-app model module mon monolith monthly motivation move network none notice number object of on on-behalf-of only open-host opportunity or origin orphan over paas parent part partnership personal personal-data phasing-out pilot plaintext planned plateau platform policy policy-set pool PRD primary principle process property proposed protobuf public published-language publishes purpose query reads realizes receiver-auth reconcile references registry regulated replace replica replication repository retain retire retired rising robot role root rotate runs-as saas sat scenario schedule schema scope scoped search-index secret security-service sender-auth separate-ways served-by server serves service shared-kernel signal-r signal-r-hub signed-by site snmp snmp-api spa special special-category sql stage stakeholder start starts status step storage-account stored-in strength subcontractor subject subjects successor sun supplier supplier-notice support-stream supporting table task technology terminate then threat thu timer to transfer transient TST tue UAT ui under until used-by user-facing-app user-token uses value value-stream value-stream-stage vault version via waf weakness web-socket web-socket-api wed weekly when workload workload-identity writes xml xor zone zone-redundant zones ``` A Code may contain one: `platform-orders` is fine. Nor can a Code be `domains` or `plateaus`, or a name Windows keeps for a device: `con`, `prn`, `aux`, `nul`, `com1` to `com9`, `lpt1` to `lpt9`. A Code can name a folder, and Windows won't create a folder with one of those names. ## Reference The element types, relationships and kinds of this area, each with what it means. **Relationships** | Relationship | What it says | | --- | --- | | Containment | A Containment joins an element to its parent. Every element but an Ecosystem has exactly one parent, and the model's hierarchy is these relationships. | | Property Link | A Property Link records what a reference-typed open property names: from the element carrying the property to the element its value names. Kanoniq derives it from the property. | **Provenance**: Where a piece of model content came from: authored by an Author, or derived by Kanoniq. Both are equally part of the model. | Value | Means | | --- | --- | | `authored` | Created explicitly by an Author. | | `derived` | Created by Kanoniq as a consequence of authored content. | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/assumptions.md # Assumptions A model is written from what its author knows, and nobody knows everything. In a workshop the gaps are said out loud: "we think the CRM is the master for customers", "nobody has checked whether billing syncs nightly or by event". Once written down, every statement reads with the same certainty. An **assumption** marks the statements that have not been checked, so a reviewer can see where the model is guesswork. An assumed element is a standard element, and an assumed relationship a standard relationship. It builds, validates and derives exactly as it would unmarked; the mark is metadata on it. The views draw it, the tool counts it, and a [policy](https://kanoniq.extenza.dev/docs/language/governance.md) can deny it. It is never a finding, and it has no due date: it stays until you delete the line. ## Writing one An `#assumed` line goes directly above the declaration or statement it marks, after its `///` description and before its [`#` property lines](https://kanoniq.extenza.dev/docs/language/basics.md#open-properties). A reason in quotes is optional: ```kanoniq object customer-record "Customer record" : selling /// Holds customer records; the vendor has not confirmed it is the master. #assumed "Vendor not asked yet" component crm "CRM" : backend technology "Dynamics" { sql crm-db "CRM DB" { root customer-record origin } } crm realizes selling #assumed "Could be gRPC; the team has not answered" storefront-bff -> catalogue-service/api over http sql customers-db "Customers DB" { #assumed "Not sure this copy is the authoritative one, nor how it is fed" root customer-record authoritative from crm over events/customers } ``` **The mark covers everything its line says.** An element's kind, technology, markers and where it is declared; a connection's protocol and `auth`; a data entity's `from` and `part of`. There is no way to mark one part of a line, so the reason says which part is in doubt. A reason is one line of text, not empty; without one, none is stated. **One mark per line.** Two `#assumed` lines above one line are an error. In VS Code, typing `#` on a new line offers `assumed` beside your [properties](https://kanoniq.extenza.dev/docs/language/basics.md#open-properties), and hovering over `#assumed` says what it marks. ### What can carry one - Every element type you declare. A data entity carries it on the line that states its header: its `root` mark, a marker, `part of`, `from` or its description. - A connection, a realization, an access, an influence, a value delivery, and a `references` line. A sync and a containment are marked through the element whose line defines them: a sync through its data entity's line, where an element sits through its own declaration. A broker idiom, `a -> b over broker/channel`, is two connections, so the mark goes on both. A leg that two statements share is assumed only when every statement naming it is. ### What cannot A policy, a policy set and an exemption, which an organization decides rather than observes. A plateau and a data migration, which are plans, and a plan is neither known nor unknown. A `-` line, a reopening, and an entity line stating nothing of its header, which define nothing. A `derived` declaration in `.g.kq`, which takes its mark from its sources. Each is refused when the model is built. ## What it carries to **What a statement creates is assumed when every statement it comes from is.** An interface that a connection creates, as [`kq build` adds it](https://kanoniq.extenza.dev/docs/language/derivation.md), carries the mark of that connection. The same goes for a channel. A single unmarked statement naming it makes it as certain as that statement: an interface that two connections reach, one assumed and one not, is not assumed, since it exists whichever of the two is a guess. This is computed on every build and never written. `.g.kq` holds no `#assumed` line, so confirming the connection, by deleting its mark, confirms what it created with no second edit. An element you declare yourself is assumed or not by its own line, whatever else names it. A carried mark has no reason of its own; the Information pane lists the marked statements it comes from. ## How the tool reports it `kq validate` ends its summary line with a count, where the model has any, and `kq build` prints the count on standard error: ```text 4 assumptions, 2 carried ``` The first number is the elements and relationships you marked; the second is what was created or derived from them. A marked broker idiom counts as its two legs. The count never changes the exit code, and `--strict` ignores it. In a SARIF log the two numbers are in the KQ run's `properties`. `kq audit` lists them after its findings, under their own heading: each path and its reason, sorted by path. The list is not findings and changes no exit code, `--enforce` included. ## How the views show it Every view that draws an assumed subject marks it: | | Box | Line | | --- | --- | --- | | **Assumed** | A `?` badge in its top left corner | The same badge before its caption, or alone at its middle | - **A mark follows its element into a collapsed container.** The container wears one `?`, and its tooltip counts what it holds. A merged line wears one `?` where any relationship it stands for is assumed. - **The Information pane** wears the same badge beside the subject's name, and says *Assumed*, with the reason. A carried mark says *Assumed, from* and lists the marked statements, each with its reason, linked as the pane's other links are. - **The toolbar** shows a button, `5 assumed`, that steps through the assumed subjects the view draws, in the order `kq audit` lists them. Its toggle turns the `?` marks off. The toggle is view state, kept in the address as `assumptions=off`, and never in the model. - **Exports** (`kq svg`, `kq png`) draw the marks as the editor does with the toggle on. - **The site** draws them too, and builds an *Assumptions* page whenever the model has any. It lists what `kq audit` lists, a section per ecosystem, each line linking to its subject in the editor. A [navigation page](https://kanoniq.extenza.dev/docs/site/generated-landscape.md#the-assumptions-page) may link to it, and a view tile can turn the marks off. A model whose author does not want its assumptions public removes the lines. ## Denying them in a policy `confidence` is a [policy](https://kanoniq.extenza.dev/docs/language/governance.md) clause. Its values are `assumed`, matching a marked subject, and `unstated`, matching one that is not: ```kanoniq policy no-guesswork in architecture "Nothing assumed at go-live" -> deny confidence: assumed policy no-assumed-crossings in architecture "Ecosystem edges are confirmed" when across: ecosystems -> deny confidence: assumed ``` Both are architecture policies: they judge a mark the model states, so they go `in architecture` or in an architecture set ([Policy sets](https://kanoniq.extenza.dev/docs/language/governance.md#policy-sets)). Written in a plateau, a policy applies there, which is how an organization says "no guesswork by go-live". A mark that no policy speaks to is a `no-policy` finding, like any other value no policy covers; it is `info` by default and fails nothing unless your repository raises it. ## Open questions A question that names nothing that runs, "which IdP will partners use?", is not model content. Either declare the identity provider your design assumes and mark it, with the question as the reason: ```kanoniq #assumed "Which IdP partners use is open: Entra or Okta" component partner-idp "Partner IdP" : saas idp ``` or leave it out of the model and keep the question in a decision record or your issue tracker. ## Moving from a `confidence` property Declaring `assumed` or `confidence` under `properties` in `kanoniq.repository.json` is an error whose message names the `#assumed` line. Replace each `#confidence assumed` or `#confidence unverified` with `#assumed`, and delete each `#confidence confirmed`. A property under another name that means the same thing cannot be recognized, so migrate it by hand. ## Plateaus The mark is part of the header or statement it is written above, as a property is. A later plateau that restates the header restates its mark, and left out it is gone from there on; see [Change over time](https://kanoniq.extenza.dev/docs/language/change-over-time.md). © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/language/derivation.md # What `kq build` adds Kanoniq creates a few elements on your behalf. This page lists all of them, where they go, and what happens when they're no longer needed. ## The rule **Kanoniq only adds what a statement names, and only where nothing is declared at that path.** It never removes, renames, moves or rewrites anything you wrote, and it never guesses what a statement left out. A statement missing something is an error, not a gap to fill. Everything it adds goes into `.g.kq`, marked `derived`. Your own files stay byte-for-byte as you wrote them. A derived element is as real as one you wrote: it has an Id, it is committed, and you can refer to it. ## What it adds ### An API a connection names ```kanoniq web-shop -> order-service/orders-api over http ``` If `order-service` has no `orders-api`, Kanoniq creates one: an `http-api` for `http`, a `grpc-api` for `grpc`, a `graphql-api` for `graphql`, a `web-socket-api` for `web-socket`, a `signal-r-hub` for `signal-r`, an `ipc-api` for `ipc`, a `mail-api` for `email`, an `snmp-api` for `snmp`, an `ldap-api` for `ldap`. A payload format (`over http/json`) changes nothing about what is created, and `in-process` creates nothing, since it lands on the component itself. `order-service` itself must exist; only the last segment of a path is ever created. That last segment becomes the new API's code, so it can't be a reserved word: `order-service/ldap` is an error, not an API called `ldap`. Name it something else, such as `order-service/auth`, or write the word with an `@`, `order-service/@ldap`. The same goes for a channel. The same goes for a monolith that holds its interfaces itself: `a -> mainframe/api over http` creates `api` in the monolith `mainframe`. ```kanoniq extend shop/storefront/order-service { derived http-api orders-api } ``` A created API has a Code and no name, so diagrams show its Code. To give it a name or a description, declare it yourself: ```kanoniq component order-service "Order Service" : backend { /// Place, amend and cancel orders. http-api orders-api "Orders API" } ``` A user interface (`spa`, `mobile-app`, `desktop-app`) is never created this way. A sync over a protocol (`from order-service over http`) creates nothing either. Who starts it, the source or the holder, is read from what it [carries](https://kanoniq.extenza.dev/docs/language/integration.md#what-a-sync-carries). ### A channel a statement names ```kanoniq order-service -> processing over events/orders ``` If the broker `events` has no channel `orders`, Kanoniq creates one, of the broker's channel kind. The same happens for a one-sided connection (`order-service -> events/orders`) and a sync (`root order from order-service over events/orders`). Every statement naming the same channel shares it. Declare the channel in its broker to give it a name. ### A role a grant names ```kanoniq orders -> payments/payments/api over http auth client-credentials via iam/platform-idp grant write ``` If the server workload identity of `payments` declares no role `write`, Kanoniq creates one there: an `app-role`, or a `scope` for a grant on an `on-behalf-of` call. Every grant naming the same role shares it. Declare the role in the server's `workload` block to give it its value. ### The initial plateau A model that declares no [plateau](https://kanoniq.extenza.dev/docs/language/change-over-time.md) gets one, `derived plateau initial`, with no name. Declare it yourself, `plateau initial "As is"`, to give it a name; you must once you declare another plateau. It keeps its Id. Where in time each element lives, from the plateau it enters to the one that removes it, is worked out on every build and never written down, but for a derived element entering a later plateau, which `.g.kq` writes in that plateau's block. An API or a channel lives where a statement naming it does. ## What it does not add Each of these must be written. Leaving one out is an error, not something Kanoniq completes: - **A platform.** Every component is written in a platform or a monolith. There is no default platform. - **A storage.** Data sits in a named `sql`, `table`, `document`, `log`, `file` or `blob` block in its component. - **An origin.** Mark at least one holding of each domain object `origin`. - **A connection's target.** `a -> b` to a component is an error; name the interface or channel. - **Domain structure.** A domain that gains a sub-domain while still holding functions is an error until you move them. ## Orphans When you delete the statement that named a derived element, the element is **not** deleted. The next build marks it as an orphan and says so: ```text orphan: derived Interface shop/storefront/order-service/orders-api is named by nothing; name it or run kq prune ``` In `.g.kq` it becomes `derived orphan http-api orders-api`. It still exists, references to it still resolve, and validation reports it as a warning ([KQ103](https://kanoniq.extenza.dev/docs/rules/kq103.md)). In VS Code, a lens above it in `.g.kq` says so; see [What the model makes of a statement](https://kanoniq.extenza.dev/docs/vscode.md#what-the-model-makes-of-a-statement). | Derived element | Orphaned when | | --- | --- | | API | No connection names it | | Channel | It isn't declared in its broker, and nothing sends to it or receives from it | | Permission | No grant names it | A derived element whose every source is [assumed](https://kanoniq.extenza.dev/docs/language/assumptions.md#what-it-carries-to) is assumed too. That is computed on every build and never written in `.g.kq`. To keep it, name it again or declare it yourself. To remove it, run `kq prune`, which deletes every orphan and every unused Id, and prints each one. Removing is always your decision: `kq build` never does it. **Don't delete derived elements from `.g.kq` by hand.** If a statement still names one, the next build creates it again under a new Id, and anything bound to the old Id loses it. ## Building twice changes nothing A build over a built model adds nothing, because everything named already exists. That makes `kq build --check` a reliable test in CI: it fails when someone changed the model without building it, or when the model has an error. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules.md # Validation Kanoniq checks a model against the rules of the metamodel and reports what it finds. This page lists every rule, each linking to a page of its own with what it means and how to fix it. ## Where it runs **In VS Code**, as you type. Every finding shows in the *Problems* panel and under the text, across every file of the model. **On the command line**, with `kq validate`, and on every `kq build` (see [`kq validate`](https://kanoniq.extenza.dev/docs/cli/kq-validate.md)). An error makes either exit with 1, so a CI job running one of them stops an invalid model. A lint fails only `kq validate --strict`. Six rules read your repository's settings: [KQ058](https://kanoniq.extenza.dev/docs/rules/kq058.md) and [KQ059](https://kanoniq.extenza.dev/docs/rules/kq059.md), the open properties, from `properties`, [KQ090](https://kanoniq.extenza.dev/docs/rules/kq090.md), the policy preset, from `policies`, and [KQ123](https://kanoniq.extenza.dev/docs/rules/kq123.md) and [KQ268](https://kanoniq.extenza.dev/docs/rules/kq268.md), the end-of-support periods, from `end-of-support-warning` and `end-of-support-error`, and [KQ275](https://kanoniq.extenza.dev/docs/rules/kq275.md), the confidentiality levels, from `confidentiality-levels`. Those two also read today's date, so a model that passed can fail on a later day. The rest depend on the model alone. Build errors come before validation: a file that doesn't parse, or a reference that names nothing, has no model to check, so those are reported instead, each under a `KB` code of its own rather than a `KQ` one. See [Build errors](https://kanoniq.extenza.dev/docs/rules/build-errors.md). ## Quick fixes **In VS Code, some findings come with a fix.** Put the cursor on the underlined text and press Ctrl+. (Cmd+. on a Mac), or click the light bulb. A fix is offered only where the right edit is certain: | Finding | Fix | | --- | --- | | A path segment that names nothing, such as `ordres` | *Change to* the closest Code that can be named there, up to three, closest first | | A misspelt keyword, such as `bakend`, or `over htpp` | *Change to* the closest keyword that fits there | | [KQ022](https://kanoniq.extenza.dev/docs/rules/kq022.md), a connection over a protocol landing on a component | *Change target to* its one interface of that protocol's kind | | [KQ024](https://kanoniq.extenza.dev/docs/rules/kq024.md), a protocol to a channel, or none to an interface | *Remove* the protocol, or *Add* the one the interface's kind implies | | [KQ026](https://kanoniq.extenza.dev/docs/rules/kq026.md), a relationship written twice | *Remove the repeated statement* | | [KQ030](https://kanoniq.extenza.dev/docs/rules/kq030.md), a count on a user interface's `environment` | *Remove the count* | Every other rule has no fix, because putting it right is a modeling choice: which element is wrong, or a Code, a name or a number only you can give. A fix never edits `.g.kq`, and it is offered only if the model, checked with it applied, has no new error. Accepting a lint is not possible yet. ## Errors and lints | Severity | Codes | Means | You | | --- | --- | --- | --- | | **Error** | `KQ001`–`KQ099`, `KQ200`–`KQ299` | The model is invalid: a rule is broken and nothing reading it can trust it | Must fix it | | **Lint** | `KQ100`–`KQ199` | The model is valid but suspect | May leave it | Neither is configurable. A lint describes something a real, in-progress landscape can legitimately be; an error describes a model that can't be acted on. An [assumption](https://kanoniq.extenza.dev/docs/language/assumptions.md) is never a finding, neither an error nor a lint, and `--strict` does not read it. A code is permanent: it always means the same rule, and a retired rule's code is never reused. Every rule runs and reports everything it finds, so you see all the problems at once rather than one per run. Some rules stay quiet while another rule's problem would make their answer meaningless; fix the first one and they will speak up if there is anything left. A finding names each element by its name and its path, `Channel "Orders" (shop/events/orders)`, or by its path alone where nothing gave it a name. **A model with plateaus is checked at every plateau.** Each plateau's landscape is checked as a whole model, and a finding names the plateaus it holds in, once however many there are. A model with one plateau names none. The rules under [Plateaus](#plateaus) check the timeline itself and its data migrations. Findings are sorted by rule code, so two runs over the same model print the same lines in the same order, and a diff of them shows only what changed. ## Every rule Each rule has a page of its own, with what it reports and how to put it right. Narrow the lists below by severity, area or quick fix:
## Motivation and strategy | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ052](https://kanoniq.extenza.dev/docs/rules/kq052.md) | **a Goal or a value stream stage is realized from the function side**
Only a Domain, a Function Group or a Function realizes a Goal or an impact, and only a Function Group a value stream stage. | Error | No | | [KQ053](https://kanoniq.extenza.dev/docs/rules/kq053.md) | **an influence and a value delivery join a legal pair**
An influence runs from an Assessment or a Value to a Driver, or from a Driver or an impact to a Goal, and a value stream delivers a Value. | Error | No | | [KQ054](https://kanoniq.extenza.dev/docs/rules/kq054.md) | **an influence and a value delivery stay in one Ecosystem**
An influence and a value delivery stay inside one Ecosystem. | Error | No | | [KQ055](https://kanoniq.extenza.dev/docs/rules/kq055.md) | **a value stream's stages are numbered from 1**
A value stream's stages are numbered 1, 2, 3 and on, each number once. | Error | No | | [KQ056](https://kanoniq.extenza.dev/docs/rules/kq056.md) | **an element holds at most one purpose**
An element's motivation holds at most one purpose. | Error | No | | [KQ057](https://kanoniq.extenza.dev/docs/rules/kq057.md) | **a value stream stage is realized by a Function Group**
A value stream stage is realized by a Function Group, never by a Domain or a Function. | Error | No | | [KQ094](https://kanoniq.extenza.dev/docs/rules/kq094.md) | **an impact's actor is a Stakeholder of its own Ecosystem**
An impact's actor is a Stakeholder in the impact's own Ecosystem. | Error | No | ## Domains | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ025](https://kanoniq.extenza.dev/docs/rules/kq025.md) | **only a top-level Domain is an enabler**
Only a Domain directly in an Ecosystem is marked enabler. | Error | No | | [KQ095](https://kanoniq.extenza.dev/docs/rules/kq095.md) | **contexts do not nest**
A Component is in at most one bounded context, and no Domain marked bounded-context sits inside another. | Error | No | | [KQ096](https://kanoniq.extenza.dev/docs/rules/kq096.md) | **an Enabler Domain states no subdomain type**
An Enabler Domain, and every Domain under one, is generic and states no subdomain type of its own. | Error | No | | [KQ112](https://kanoniq.extenza.dev/docs/rules/kq112.md) | **a core Domain is not only bought**
A core Domain is realized by at least some custom-built software, not by SaaS or off-the-shelf products alone. | Lint | No | | [KQ113](https://kanoniq.extenza.dev/docs/rules/kq113.md) | **a generic Domain is not custom-built**
A generic Domain, an Enabler Domain aside, is realized by SaaS or off-the-shelf products, not by custom-built software. | Lint | No | ## Processes A business process orders the work under a value stream stage, in lanes that are job roles. These rules keep its flows inside it, its lanes in reach of the screens its tasks use, and its messages on the connections they name. | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ119](https://kanoniq.extenza.dev/docs/rules/kq119.md) | **a flow node is reached from a start event**
A flow node of a process is reached by then from one of its start events. | Lint | No | | [KQ221](https://kanoniq.extenza.dev/docs/rules/kq221.md) | **a flow node is in a lane of its process**
Every flow node but an external step sits in one of its process's lanes. | Error | No | | [KQ222](https://kanoniq.extenza.dev/docs/rules/kq222.md) | **a lane is a job role of the process's Ecosystem**
A process's lane names a job role of the process's own Ecosystem. | Error | No | | [KQ223](https://kanoniq.extenza.dev/docs/rules/kq223.md) | **a sequence flow joins two flow nodes of one process**
A then joins two flow nodes of one process, neither an external step, never into a start event or out of an end event. | Error | No | | [KQ224](https://kanoniq.extenza.dev/docs/rules/kq224.md) | **a message flow joins a lane to an external party**
A message flow joins a node in a lane to a pool or one of its external steps, received by a start event or a task and sent by an end event or a task. | Error | No | | [KQ225](https://kanoniq.extenza.dev/docs/rules/kq225.md) | **a task's screen is of an application realizing its Function**
A task's on names a user-facing Interface of an application that realizes the Function the task performs. | Error | No | | [KQ226](https://kanoniq.extenza.dev/docs/rules/kq226.md) | **a task's lane holds a Role using its screen**
A task done on a screen sits in the lane of a job role holding a Role in that screen's application that uses it. | Error | No | | [KQ227](https://kanoniq.extenza.dev/docs/rules/kq227.md) | **a message's connections are in the model**
Every connection a message flow travels over is a connection of the model. | Error | No | | [KQ228](https://kanoniq.extenza.dev/docs/rules/kq228.md) | **a message's chain is unbroken**
Each connection a message travels over starts where the one before it landed. | Error | No | | [KQ229](https://kanoniq.extenza.dev/docs/rules/kq229.md) | **a message's chain starts or lands at its task's systems**
A message a task sends starts, and one it receives lands, at one of the task's systems. | Error | No | | [KQ230](https://kanoniq.extenza.dev/docs/rules/kq230.md) | **a message's chain reaches its pool's systems**
A message to a pool that says where its systems are lands there, and one from it starts there. | Error | No | | [KQ231](https://kanoniq.extenza.dev/docs/rules/kq231.md) | **a process stays within the stage it details**
Every Function a task performs lies under a Function Group realizing the stage its process details. | Error | No | | [KQ232](https://kanoniq.extenza.dev/docs/rules/kq232.md) | **a pool is an external party**
A pool's persona is external, and its `site` names an Ecosystem, a Platform or a monolith. | Error | No | | [KQ237](https://kanoniq.extenza.dev/docs/rules/kq237.md) | **a data action names its own data**
Every Domain Object a data mark names is in its node's Data: a task's, of the Domains holding its Function; a start event's, of the stage its process details. | Error | No | | [KQ238](https://kanoniq.extenza.dev/docs/rules/kq238.md) | **a data action's Domain Object has one holding**
Every Domain Object a data mark names is held, not as a replica, in exactly one Storage of its node's systems. | Error | No | | [KQ239](https://kanoniq.extenza.dev/docs/rules/kq239.md) | **a data mark sits on a task or a receiving start event**
Only a task, or a start event receiving a message over a chain, is marked data. | Error | No | ## Context map The context map's lines are derived from what crosses between two bounded contexts: a call, a message through a channel, a copy of the other's data. Its patterns are stated. These rules catch a stated pattern the model contradicts. | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ204](https://kanoniq.extenza.dev/docs/rules/kq204.md) | **conforms-to and customer-of name an upstream**
A context states conforms-to or customer-of only toward a context the edges put upstream of it. | Error | No | | [KQ205](https://kanoniq.extenza.dev/docs/rules/kq205.md) | **a downstream conforms or is a customer**
A context does not state both conforms-to and customer-of toward one context. | Error | No | | [KQ206](https://kanoniq.extenza.dev/docs/rules/kq206.md) | **a conformist does not translate**
A context does not state conforms-to toward a context whose every crossing to it goes through an anticorruption layer. | Error | No | | [KQ207](https://kanoniq.extenza.dev/docs/rules/kq207.md) | **a relationship has an integration**
A relationship other than separate-ways joins two contexts something crosses between. | Error | No | | [KQ208](https://kanoniq.extenza.dev/docs/rules/kq208.md) | **separate ways cross nothing**
Nothing crosses between two contexts stated separate-ways. | Error | No | | [KQ209](https://kanoniq.extenza.dev/docs/rules/kq209.md) | **a symmetric relationship is stated once**
A partnership, a shared kernel or separate ways is stated in one of its two contexts, not both. | Error | No | | [KQ210](https://kanoniq.extenza.dev/docs/rules/kq210.md) | **a relationship joins two contexts**
A context relationship is written in an element marked bounded-context and names another one. | Error | No | | [KQ211](https://kanoniq.extenza.dev/docs/rules/kq211.md) | **published language beside an open host**
An Interface or a Channel marked published-language is marked open-host. | Error | No | | [KQ212](https://kanoniq.extenza.dev/docs/rules/kq212.md) | **acl is not stated through an integration Component**
A crossing whose downstream end is an integration Component states no acl. | Error | No | | [KQ213](https://kanoniq.extenza.dev/docs/rules/kq213.md) | **a Big Ball of Mud is a context**
An element marked big-ball-of-mud is marked bounded-context. | Error | No | ## Realization | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ007](https://kanoniq.extenza.dev/docs/rules/kq007.md) | **realization target**
Only a Domain, a Function Group, a Function, a Goal, a value stream stage or an impact is realized. | Error | No | | [KQ008](https://kanoniq.extenza.dev/docs/rules/kq008.md) | **realization stays in one Ecosystem**
A realization stays inside one Ecosystem. | Error | No | | [KQ009](https://kanoniq.extenza.dev/docs/rules/kq009.md) | **a Domain holds one altitude**
A Domain holds either sub-domains or Function Groups and Functions, never both, and a Domain with sub-domains is not realized itself. | Error | No | | [KQ045](https://kanoniq.extenza.dev/docs/rules/kq045.md) | **a primary mark is on one realization of a Component**
Only a Component, or a monolith with nothing inside it, marks a realization primary, and on one realization at most. | Error | No | | [KQ046](https://kanoniq.extenza.dev/docs/rules/kq046.md) | **a Component marks its primary Domain where it realizes into several**
A Component that realizes into several Domains marks the realization into its own primary, and one that realizes into one Domain marks none. | Error | No | | [KQ101](https://kanoniq.extenza.dev/docs/rules/kq101.md) | **a Platform realizes its Domain**
A Domain Object sits in a Platform that realizes the Domain owning it. | Lint | No | | [KQ104](https://kanoniq.extenza.dev/docs/rules/kq104.md) | **a Component realizes something**
A Component realizes a Domain, Function Group or Function, or sits in something that does, wherever its Ecosystem has Domains. | Lint | No | ## Monoliths | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ027](https://kanoniq.extenza.dev/docs/rules/kq027.md) | **a module sits in a monolith**
A Module sits in a monolith, never in a Platform or another Module. | Error | No | | [KQ028](https://kanoniq.extenza.dev/docs/rules/kq028.md) | **an in-process call stays in its monolith**
An in-process call joins two Components of one monolith. | Error | No | ## Jobs, robots and screens | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ079](https://kanoniq.extenza.dev/docs/rules/kq079.md) | **a job holds no Interface**
A job holds no Interface, declared or created by a connection. | Error | No | | [KQ080](https://kanoniq.extenza.dev/docs/rules/kq080.md) | **no delivery out of a Channel lands on a job**
No delivery out of a Channel lands on a job. | Error | No | | [KQ081](https://kanoniq.extenza.dev/docs/rules/kq081.md) | **a schedule is well formed**
A schedule names a known time zone, a time of day, a day of the month from 1 to 31, each weekday once, and a cron expression of five standard fields. | Error | No | | [KQ082](https://kanoniq.extenza.dev/docs/rules/kq082.md) | **a robot holds no Interface**
A robot holds no Interface, declared or created by a connection. | Error | No | | [KQ083](https://kanoniq.extenza.dev/docs/rules/kq083.md) | **ui comes only from a robot or a Role**
A connection over ui comes only from a robot or a Role. | Error | No | | [KQ084](https://kanoniq.extenza.dev/docs/rules/kq084.md) | **ui lands only on a declared user-facing Interface**
A connection over ui lands only on a declared user-facing Interface. | Error | No | | [KQ085](https://kanoniq.extenza.dev/docs/rules/kq085.md) | **a Role's ui stays in its own application**
A Role's connection over ui lands only on a user-facing Interface of the Role's own application. | Error | No | | [KQ111](https://kanoniq.extenza.dev/docs/rules/kq111.md) | **a robot's Identity holds a Role where its ui goes**
Where a robot uses an application's screens, the Identity it runs as holds a Role in that application. | Lint | No | ## Connections | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ022](https://kanoniq.extenza.dev/docs/rules/kq022.md) | **a connection names its target**
A connection lands on an Interface or a Channel, not on a Component or monolith, unless it is in-process. | Error | Yes | | [KQ023](https://kanoniq.extenza.dev/docs/rules/kq023.md) | **protocol matches the Interface**
A connection's protocol matches the kind of Interface it lands on, and no call lands on a user interface. | Error | No | | [KQ024](https://kanoniq.extenza.dev/docs/rules/kq024.md) | **a Channel is reached through its broker**
A Channel is reached through its broker with no protocol, an Interface always with one, and no connection joins two Channels. | Error | Yes | | [KQ102](https://kanoniq.extenza.dev/docs/rules/kq102.md) | **a Channel has both sides**
A Channel has both a sender and a receiver. | Lint | No | | [KQ121](https://kanoniq.extenza.dev/docs/rules/kq121.md) | **an Interface's version is called**
Some call names each version of a software-facing Interface. | Lint | No | | [KQ248](https://kanoniq.extenza.dev/docs/rules/kq248.md) | **only a software-facing Interface has a contract**
A user-facing Interface states no schema and no versions. | Error | No | | [KQ249](https://kanoniq.extenza.dev/docs/rules/kq249.md) | **a call names a declared version**
A call names a version its Interface declares, calls a versioned Interface with its version, and an unversioned one with none. | Error | No | ## Events, commands and queries | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ097](https://kanoniq.extenza.dev/docs/rules/kq097.md) | **a delivery carries what is published**
A delivery out of a Channel carries only events, and versions of them, that a leg into that Channel carries. | Error | No | | [KQ098](https://kanoniq.extenza.dev/docs/rules/kq098.md) | **a publishing leg carries its publisher's events**
A leg into a Channel carries only events its sending Component declares. | Error | No | | [KQ099](https://kanoniq.extenza.dev/docs/rules/kq099.md) | **a carried event names a declared version**
A leg names a version an event declares, names a versioned event with its version, and an unversioned event with none. | Error | No | | [KQ114](https://kanoniq.extenza.dev/docs/rules/kq114.md) | **a publisher holds what its event is about**
The Component publishing an event holds a Data Entity of the Domain Object the event is about. | Lint | No | | [KQ115](https://kanoniq.extenza.dev/docs/rules/kq115.md) | **an event is delivered**
Some delivery out of a Channel or some sync carries each event, and each version of one. | Lint | No | | [KQ116](https://kanoniq.extenza.dev/docs/rules/kq116.md) | **a handler holds what its command or query is about**
The Component handling a command or a query holds a Data Entity of the Domain Object it is about. | Lint | No | | [KQ117](https://kanoniq.extenza.dev/docs/rules/kq117.md) | **a command or a query is carried**
Some connection or some sync carries each command and query, and each version of one. | Lint | No | | [KQ200](https://kanoniq.extenza.dev/docs/rules/kq200.md) | **an event is about a Domain Object**
What an event is about is a Domain Object. | Error | No | | [KQ201](https://kanoniq.extenza.dev/docs/rules/kq201.md) | **a command or a query reaches its handler**
A call or a delivery carries only commands and queries the Component it reaches declares, and a leg into a Channel only those some Component declares. | Error | No | | [KQ202](https://kanoniq.extenza.dev/docs/rules/kq202.md) | **a carried command or query names a declared version**
A connection names a version a command or a query declares, names a versioned one with its version, and an unversioned one with none. | Error | No | | [KQ203](https://kanoniq.extenza.dev/docs/rules/kq203.md) | **a command or a query is about a Domain Object**
What a command or a query is about is a Domain Object. | Error | No | ## Scenarios A scenario walks over connections already declared, in order. These rules keep each step on a connection the model has, the walk in one piece, its messages ones the connections carry, and the scenario where it starts. Each holds at every plateau: a step whose connection is gone at a plateau is an error there. | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ240](https://kanoniq.extenza.dev/docs/rules/kq240.md) | **a scenario's connections are in the model**
Every connection a scenario's step walks over, and both legs of a hop through a Channel, is a connection of the model. | Error | No | | [KQ241](https://kanoniq.extenza.dev/docs/rules/kq241.md) | **a scenario's walk is unbroken**
Each step of a scenario starts where the scenario starts or where an earlier step arrived. | Error | No | | [KQ242](https://kanoniq.extenza.dev/docs/rules/kq242.md) | **a scenario's step names a message its connection carries**
A step's message is carried by its connection, or by both legs of a hop, under a version the message declares. | Error | No | | [KQ243](https://kanoniq.extenza.dev/docs/rules/kq243.md) | **a scenario starts at its task's screen or systems**
A scenario for a task starts at the task's screen or at one of its systems. | Error | No | | [KQ244](https://kanoniq.extenza.dev/docs/rules/kq244.md) | **a scenario sits in the Ecosystem where it starts**
A scenario sits directly in the Ecosystem of its first step's source. | Error | No | | [KQ245](https://kanoniq.extenza.dev/docs/rules/kq245.md) | **a scenario is for a task of a process**
What a scenario is for is a task, a user task or a service task of a process. | Error | No | ## Data | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ010](https://kanoniq.extenza.dev/docs/rules/kq010.md) | **representation cardinality**
Every Data Entity holds exactly one Domain Object. | Error | No | | [KQ011](https://kanoniq.extenza.dev/docs/rules/kq011.md) | **authoritative cardinality**
Every Domain Object has exactly one authoritative holding across the whole model. | Error | No | | [KQ012](https://kanoniq.extenza.dev/docs/rules/kq012.md) | **a replica has a source**
A replica syncs from the authoritative holding or from another replica, never from a transient one. | Error | No | | [KQ013](https://kanoniq.extenza.dev/docs/rules/kq013.md) | **transient is local**
A transient holding neither syncs in nor syncs out. | Error | No | | [KQ014](https://kanoniq.extenza.dev/docs/rules/kq014.md) | **structure stays local**
part of and references stay inside one Component. | Error | No | | [KQ015](https://kanoniq.extenza.dev/docs/rules/kq015.md) | **no orphan entity**
Every Data Entity is a root or part of another. | Error | No | | [KQ016](https://kanoniq.extenza.dev/docs/rules/kq016.md) | **part of is a tree**
part of forms a tree: each Data Entity is part of at most one other, with no circle. | Error | No | | [KQ021](https://kanoniq.extenza.dev/docs/rules/kq021.md) | **a Domain Object has an origin**
Every Domain Object has a holding marked origin, where the data is first created. | Error | No | | [KQ118](https://kanoniq.extenza.dev/docs/rules/kq118.md) | **a sync carries messages about its entity**
A message a sync carries is about the Domain Object its replica represents. | Lint | No | | [KQ124](https://kanoniq.extenza.dev/docs/rules/kq124.md) | **a Domain Object with a property marked personal states its personal data**
A Domain Object one of whose Data Entities marks a property personal states personal-data, personal or special-category. | Lint | No | | [KQ126](https://kanoniq.extenza.dev/docs/rules/kq126.md) | **a Domain Object a data use names states its personal data**
A Domain Object a data use names states personal-data, personal or special-category. | Lint | No | | [KQ127](https://kanoniq.extenza.dev/docs/rules/kq127.md) | **personal data is held for a stated purpose**
In an Ecosystem with a data use, every Data Entity of personal or special-category data is a holding or a copy of a data use. | Lint | No | | [KQ128](https://kanoniq.extenza.dev/docs/rules/kq128.md) | **a data use states its legal basis**
A data use states its basis, one of GDPR Art. 6(1)'s lawful bases. | Lint | No | | [KQ137](https://kanoniq.extenza.dev/docs/rules/kq137.md) | **personal data leaves a transfer regime on a ground**
Personal data a call, a leg, a sync or a holding's own hop moves out of a residency stating adequate, to a country outside that list, goes where a contract covering what receives it states a transfer ground. | Lint | No | | [KQ138](https://kanoniq.extenza.dev/docs/rules/kq138.md) | **personal data does not leave a transfer regime for a place not stated**
Personal data moved from inside a residency stating adequate goes to a place whose country is stated. | Lint | No | | [KQ214](https://kanoniq.extenza.dev/docs/rules/kq214.md) | **a synced event is its source's**
A sync carries only events its source Component declares. | Error | No | | [KQ215](https://kanoniq.extenza.dev/docs/rules/kq215.md) | **a synced command is its holder's**
A sync carries only commands the Component holding the replica declares. | Error | No | | [KQ216](https://kanoniq.extenza.dev/docs/rules/kq216.md) | **a synced query is its source's**
A sync carries only queries its source Component declares. | Error | No | | [KQ217](https://kanoniq.extenza.dev/docs/rules/kq217.md) | **a pulled sync goes over a protocol**
A sync carrying a query goes over a protocol, never through a Channel. | Error | No | | [KQ218](https://kanoniq.extenza.dev/docs/rules/kq218.md) | **a sync carries messages or one mechanism**
A sync carries messages or one mechanism, never both, and never two mechanisms. | Error | No | | [KQ219](https://kanoniq.extenza.dev/docs/rules/kq219.md) | **an entity's syncs have one main feed**
Of the syncs into an entity, exactly one is not marked reconcile. | Error | No | | [KQ220](https://kanoniq.extenza.dev/docs/rules/kq220.md) | **two syncs into one entity differ**
No two syncs into one entity have the same source, the same route and the same carries. | Error | No | | [KQ246](https://kanoniq.extenza.dev/docs/rules/kq246.md) | **an access stays in its monolith**
An access joins a Component of a monolith to a data entity in a Storage the same monolith holds itself. | Error | No | | [KQ247](https://kanoniq.extenza.dev/docs/rules/kq247.md) | **an access names an aggregate**
An access names the root of an aggregate, or a data entity in no aggregate, never a part. | Error | No | | [KQ275](https://kanoniq.extenza.dev/docs/rules/kq275.md) | **a confidentiality is one of the repository's levels**
A Domain Object's confidentiality is one of the levels the repository's confidentiality-levels setting lists. | Error | No | | [KQ276](https://kanoniq.extenza.dev/docs/rules/kq276.md) | **no property is personal on data that is not personal**
No property is marked personal on a Data Entity of a Domain Object stated personal-data none. | Error | No | | [KQ277](https://kanoniq.extenza.dev/docs/rules/kq277.md) | **a data use names personal data**
No Domain Object a data use names is stated personal-data none. | Error | No | | [KQ278](https://kanoniq.extenza.dev/docs/rules/kq278.md) | **a data use's data is held in its systems**
Every Domain Object a data use names is represented by a Data Entity in a Storage of a system realizing what its via names. | Error | No | | [KQ279](https://kanoniq.extenza.dev/docs/rules/kq279.md) | **special-category data has a condition**
A data use naming special-category data states special, the condition it is processed under. | Error | No | | [KQ280](https://kanoniq.extenza.dev/docs/rules/kq280.md) | **a condition goes with special-category data**
A data use states special only where it names special-category data. | Error | No | | [KQ281](https://kanoniq.extenza.dev/docs/rules/kq281.md) | **a data use covers its own Ecosystem's work**
What a data use's via names is in the data use's own Ecosystem. | Error | No | | [KQ282](https://kanoniq.extenza.dev/docs/rules/kq282.md) | **a joint controller is another Ecosystem**
A data use's joint names other Ecosystems, never its own. | Error | No | | [KQ297](https://kanoniq.extenza.dev/docs/rules/kq297.md) | **a regulated scope is one the repository lists**
A Domain Object's or a significant property's regulated scope is one the repository's regulated-scopes setting lists. | Error | No | ## Authentication | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ060](https://kanoniq.extenza.dev/docs/rules/kq060.md) | **a scheme its transport accepts**
A connection's authentication scheme is one its protocol or broker accepts. | Error | No | | [KQ061](https://kanoniq.extenza.dev/docs/rules/kq061.md) | **via only on a token scheme**
via goes only with a scheme whose token someone issues. | Error | No | | [KQ062](https://kanoniq.extenza.dev/docs/rules/kq062.md) | **via names an Identity Provider**
via names an Identity Provider: a Component or monolith marked idp. | Error | No | | [KQ063](https://kanoniq.extenza.dev/docs/rules/kq063.md) | **a leg states one scheme**
Two statements of one leg into or out of a Channel state the same scheme. | Error | No | ## People | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ040](https://kanoniq.extenza.dev/docs/rules/kq040.md) | **a Role is in a user-facing application**
A Role sits in a Component or monolith that holds a user interface of its own. | Error | No | | [KQ041](https://kanoniq.extenza.dev/docs/rules/kq041.md) | **a Role names an Identity Provider**
A Role names an Identity Provider: a Component or monolith marked idp. | Error | No | | [KQ042](https://kanoniq.extenza.dev/docs/rules/kq042.md) | **a Role has holders**
A Role's Identity Provider holds an Identity of the Role's persona, so someone can hold the Role. | Error | No | | [KQ043](https://kanoniq.extenza.dev/docs/rules/kq043.md) | **an Identity is in an Identity Provider**
An Identity sits in a Component or monolith marked idp. | Error | No | | [KQ071](https://kanoniq.extenza.dev/docs/rules/kq071.md) | **a Role is never in an anonymous application**
A Component or monolith marked anonymous holds no Role. | Error | No | | [KQ072](https://kanoniq.extenza.dev/docs/rules/kq072.md) | **anonymous marks a user-facing application**
Only a Component or monolith that holds a user interface of its own is marked anonymous. | Error | No | | [KQ073](https://kanoniq.extenza.dev/docs/rules/kq073.md) | **an Identity Provider is never anonymous**
An Identity Provider is never marked anonymous. | Error | No | | [KQ120](https://kanoniq.extenza.dev/docs/rules/kq120.md) | **an internal Role is held by a job role**
In an Ecosystem with job roles, every Role of an internal persona in its applications and its Identity Providers is held by a job role. | Lint | No | | [KQ233](https://kanoniq.extenza.dev/docs/rules/kq233.md) | **a job role's persona is internal**
A job role's persona is an employee or a freelancer. | Error | No | | [KQ234](https://kanoniq.extenza.dev/docs/rules/kq234.md) | **a held Role is of the job role's persona**
A job role holds only Roles of its own persona. | Error | No | ## Workload identity | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ064](https://kanoniq.extenza.dev/docs/rules/kq064.md) | **a workload identity names an Identity Provider**
A workload identity names an Identity Provider: a Component or monolith marked idp. | Error | No | | [KQ065](https://kanoniq.extenza.dev/docs/rules/kq065.md) | **a role sits in a server workload identity**
App roles and scopes are declared in a server workload identity, never a client one. | Error | No | | [KQ066](https://kanoniq.extenza.dev/docs/rules/kq066.md) | **a credential sits on a client workload identity**
Only a client workload identity states a credential. | Error | No | | [KQ067](https://kanoniq.extenza.dev/docs/rules/kq067.md) | **stored-in names a vault**
A credential is stored in a vault element. | Error | No | | [KQ068](https://kanoniq.extenza.dev/docs/rules/kq068.md) | **a federated credential names its issuer**
A federated credential comes from an Identity Provider: a Component marked idp. | Error | No | | [KQ069](https://kanoniq.extenza.dev/docs/rules/kq069.md) | **a scheme the caller's credential carries**
A call's authentication scheme is one the caller's credential can produce. | Error | No | | [KQ070](https://kanoniq.extenza.dev/docs/rules/kq070.md) | **on-behalf-of rests on a scope**
A call on behalf of a user rests on a delegated scope granted on the API it calls. | Error | No | | [KQ106](https://kanoniq.extenza.dev/docs/rules/kq106.md) | **a Component holds one kind of workload identity**
A Component holds a client or a server workload identity, not both. | Lint | No | | [KQ107](https://kanoniq.extenza.dev/docs/rules/kq107.md) | **a workload identity is one workload's, in one environment**
A workload identity is the identity of one Component, in one Environment. | Lint | No | | [KQ108](https://kanoniq.extenza.dev/docs/rules/kq108.md) | **people and workloads do not share an identity**
Components do not run as people's accounts, and people do not sign in as a service. | Lint | No | | [KQ109](https://kanoniq.extenza.dev/docs/rules/kq109.md) | **a grant has a call behind it**
A client is granted a role only on an API it calls. | Lint | No | | [KQ110](https://kanoniq.extenza.dev/docs/rules/kq110.md) | **a credential is read from its vault**
A credential is stored in a vault the service connects to. | Lint | No | ## Environments and database servers | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ029](https://kanoniq.extenza.dev/docs/rules/kq029.md) | **an environment line names a stage**
An environment line names a stage its Ecosystem declares and sits on something that runs on its own. | Error | No | | [KQ030](https://kanoniq.extenza.dev/docs/rules/kq030.md) | **a client's environment line has no count**
A user interface's environment line states no number of instances; the device it runs on is a host that states its count. | Error | Yes | | [KQ031](https://kanoniq.extenza.dev/docs/rules/kq031.md) | **a replica is in its primary's environment**
A database server replica is of a database server in its own Environment. | Error | No | | [KQ032](https://kanoniq.extenza.dev/docs/rules/kq032.md) | **a Storage is on a database server**
A Storage is hosted on a database server or a storage account, if on anything. | Error | No | | [KQ086](https://kanoniq.extenza.dev/docs/rules/kq086.md) | **an environment line states its count**
The environment line of a part that runs, other than a client, a workload identity, a network, a DNS record or a certificate, states its number of instances. | Error | No | | [KQ087](https://kanoniq.extenza.dev/docs/rules/kq087.md) | **a held Component runs where its holder runs**
A Component or deployable module held by one that states environments states only stages its holder states. | Error | No | | [KQ088](https://kanoniq.extenza.dev/docs/rules/kq088.md) | **a client runs where its backend runs**
A user interface declared in its backend Component states only stages that Component runs in. | Error | No | | [KQ089](https://kanoniq.extenza.dev/docs/rules/kq089.md) | **a Storage is hosted where its owner runs**
A database server hosting a Storage runs only in stages the Storage's owner runs in. | Error | No | ## Infrastructure | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ122](https://kanoniq.extenza.dev/docs/rules/kq122.md) | **a private endpoint has a private DNS record**
A provider-run service reached in a network by a private endpoint has a private DNS record pointing at it, unless its provider resolves the name itself. | Lint | No | | [KQ250](https://kanoniq.extenza.dev/docs/rules/kq250.md) | **a network-only product is in a network**
A provider-run service of a product that cannot be public states the network it is in. | Error | No | | [KQ251](https://kanoniq.extenza.dev/docs/rules/kq251.md) | **a product's required parts are named**
Every part a product word requires is named: its network with in, its storage account with uses, its origin with forwards-to, its certificate by served-by. | Error | No | | [KQ252](https://kanoniq.extenza.dev/docs/rules/kq252.md) | **a call's gateway publishes its target**
The gateway a call goes via publishes the Interface the call lands on, unless it is a NAT the call leaves by. | Error | No | | [KQ253](https://kanoniq.extenza.dev/docs/rules/kq253.md) | **a Storage's pool is in its server**
The pool a Storage names is inside the database server it is hosted on. | Error | No | | [KQ254](https://kanoniq.extenza.dev/docs/rules/kq254.md) | **a vault holds what is stored in it**
A credential or a certificate is stored in a vault whose kind holds secrets or certificates. | Error | No | | [KQ255](https://kanoniq.extenza.dev/docs/rules/kq255.md) | **an infrastructure clause names what it takes**
Via names a gateway, backup a backup vault, covers a stage of the service's own Ecosystem, and a certificate's stored-in a vault and served-by what can serve one. | Error | No | | [KQ256](https://kanoniq.extenza.dev/docs/rules/kq256.md) | **a bucket holds one Storage**
A storage account of a bucket product holds exactly one Storage. | Error | No | | [KQ257](https://kanoniq.extenza.dev/docs/rules/kq257.md) | **a Storage is of a kind its account holds**
A Storage on a storage account is of a kind that account's product holds. | Error | No | | [KQ258](https://kanoniq.extenza.dev/docs/rules/kq258.md) | **only a client runs on a storage account**
Only a user-facing client is deployed on a storage account, a static site served from it. | Error | No | | [KQ259](https://kanoniq.extenza.dev/docs/rules/kq259.md) | **infrastructure stays in its stage**
What a part runs on, and what an infrastructure element runs on, is in and uses, is in the same stage, a registry aside, and a link joins two networks of one stage. | Error | No | | [KQ260](https://kanoniq.extenza.dev/docs/rules/kq260.md) | **a private DNS zone is in a network**
A DNS record in a private zone states the network its zone is linked to. | Error | No | | [KQ261](https://kanoniq.extenza.dev/docs/rules/kq261.md) | **a platform service states how it runs**
A platform service of a generic kind states paas or on the host it runs on. | Error | No | | [KQ262](https://kanoniq.extenza.dev/docs/rules/kq262.md) | **a product word fixes how it runs**
A platform service of a provider's product word states no paas, states on only after a self-run word, and states it after one. | Error | No | | [KQ269](https://kanoniq.extenza.dev/docs/rules/kq269.md) | **an endpoint stated plaintext is not proven encrypted**
A software-facing Interface or a Broker stated in-transit plaintext does not serve a certificate, is not of a transport that takes no plaintext, and is not reached with auth certificate. | Error | No | | [KQ270](https://kanoniq.extenza.dev/docs/rules/kq270.md) | **only a network endpoint states in-transit**
in-transit is stated on a software-facing Interface other than an ipc-api, or on a Broker, and nowhere else. | Error | No | | [KQ292](https://kanoniq.extenza.dev/docs/rules/kq292.md) | **a location is stated once**
An element in a network that states its location states none of its own: it is where its network is. | Error | No | | [KQ293](https://kanoniq.extenza.dev/docs/rules/kq293.md) | **a zone its location has**
Each zone an element names is one its location has: one its region's registry entry names, or one its data center declares. | Error | No | | [KQ294](https://kanoniq.extenza.dev/docs/rules/kq294.md) | **zones or zone-redundant**
An element names the zones it spans or says its provider spreads it with zone-redundant, never both. | Error | No | | [KQ295](https://kanoniq.extenza.dev/docs/rules/kq295.md) | **a stage on several lines is on different hosts**
A part that states one stage on several environment lines names what it runs on on each, a different host or platform on each. | Error | No | ## Life cycle | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ123](https://kanoniq.extenza.dev/docs/rules/kq123.md) | **support does not end within the warning period**
A run element that is not retired, phasing out or meant to be replaced, migrated or retired does not reach the end of its extended support or its contract within the repository's warning period, nor does a contract unless all it covers is so answered. | Lint | No | | [KQ263](https://kanoniq.extenza.dev/docs/rules/kq263.md) | **nothing live depends on a retired element**
Nothing that is not retired is deployed, hosted or installed on a retired element, uses it or calls it, and no Component that is not retired is held in a retired monolith. | Error | No | | [KQ264](https://kanoniq.extenza.dev/docs/rules/kq264.md) | **a phasing-out element is not invested in**
An element that is phasing out does not have a future of invest. | Error | No | | [KQ265](https://kanoniq.extenza.dev/docs/rules/kq265.md) | **a successor is of the element's type and its future**
A successor is named only with a future of replace or migrate, is of the same type as the element, or a Component for a monolith and a monolith for a Component, and is not the element itself. | Error | No | | [KQ266](https://kanoniq.extenza.dev/docs/rules/kq266.md) | **an installation is on a Host**
An installation names the Host it is installed on, and only a Host. | Error | No | | [KQ267](https://kanoniq.extenza.dev/docs/rules/kq267.md) | **extended support ends after mainstream support**
An element's end of extended support is not before its end of mainstream support. | Error | No | | [KQ268](https://kanoniq.extenza.dev/docs/rules/kq268.md) | **support does not end within the error period**
A run element that is not retired, phasing out or meant to be replaced, migrated or retired does not reach the end of its extended support or its contract within the repository's error period, nor past it, nor does a contract unless all it covers is so answered. | Error | No | ## Suppliers and contracts | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ129](https://kanoniq.extenza.dev/docs/rules/kq129.md) | **bought software has a supplier**
In an Ecosystem with a contract, every saas or cots Component or monolith is covered by a contract, a Component in a covered monolith counting as covered. | Lint | No | | [KQ130](https://kanoniq.extenza.dev/docs/rules/kq130.md) | **a critical contract has a way out**
A contract supporting a critical Function states its ends and its notice. | Lint | No | | [KQ131](https://kanoniq.extenza.dev/docs/rules/kq131.md) | **a contract supports a Function**
A contract supports a Function: something it covers realizes one, or it names one with via. | Lint | No | | [KQ134](https://kanoniq.extenza.dev/docs/rules/kq134.md) | **a Platform says whose work it does**
In an Ecosystem with two or more legal entities, every Platform and monolith names with for the entities or branches whose work it does. | Lint | No | | [KQ135](https://kanoniq.extenza.dev/docs/rules/kq135.md) | **a supplier is one company**
A supplier's is names an Ecosystem holding at most one legal entity; where it holds several, is names the legal entity by path. | Lint | No | | [KQ136](https://kanoniq.extenza.dev/docs/rules/kq136.md) | **a branch is abroad**
A branch is in another country than its legal entity's headquarters. | Lint | No | | [KQ284](https://kanoniq.extenza.dev/docs/rules/kq284.md) | **a contract covers its own Ecosystem's elements**
What a contract covers is in its own Ecosystem, or in the Ecosystem its supplier is, directly or through a legal entity. | Error | No | | [KQ285](https://kanoniq.extenza.dev/docs/rules/kq285.md) | **a contract supports its own Ecosystem's work**
What a contract's via names is in the contract's own Ecosystem. | Error | No | | [KQ286](https://kanoniq.extenza.dev/docs/rules/kq286.md) | **a covered element states no contract end**
An element a contract covers states no contract-end; it reads its contracts' ends. | Error | No | | [KQ287](https://kanoniq.extenza.dev/docs/rules/kq287.md) | **a contract ends after it starts**
A contract's ends is not before its starts. | Error | No | | [KQ288](https://kanoniq.extenza.dev/docs/rules/kq288.md) | **a contract's subcontractors form one chain**
Each subcontractor names another supplier of the Ecosystem than the contract's own, once, under its supplier or one in its chain, and the chain reaches the contract's supplier. | Error | No | | [KQ289](https://kanoniq.extenza.dev/docs/rules/kq289.md) | **a supplier's parent is another supplier**
A supplier's parent is another supplier of its Ecosystem, and parents form no cycle. | Error | No | | [KQ290](https://kanoniq.extenza.dev/docs/rules/kq290.md) | **a supplier is another Ecosystem**
A supplier's is names another Ecosystem than the one it is declared in, or a legal entity of another. | Error | No | | [KQ291](https://kanoniq.extenza.dev/docs/rules/kq291.md) | **an LEI is well formed**
A supplier's or a legal entity's lei is 18 capitals or digits and two check digits valid under ISO 7064 MOD 97-10. | Error | No | | [KQ298](https://kanoniq.extenza.dev/docs/rules/kq298.md) | **a legal entity's parent is another legal entity**
A legal entity's parent is another legal entity, in any Ecosystem, and parents form no cycle. | Error | No | | [KQ299](https://kanoniq.extenza.dev/docs/rules/kq299.md) | **an LEI names one legal entity**
No two legal entities of the model state one lei. | Error | No | | [KQ400](https://kanoniq.extenza.dev/docs/rules/kq400.md) | **for names an entity of its Ecosystem**
What a Platform's or a monolith's for names is a legal entity or a branch of its own Ecosystem. | Error | No | | [KQ401](https://kanoniq.extenza.dev/docs/rules/kq401.md) | **a contract is signed in its Ecosystem**
A contract's signed-by names a legal entity of the Ecosystem it is declared in. | Error | No | | [KQ402](https://kanoniq.extenza.dev/docs/rules/kq402.md) | **a contract names its signer**
In an Ecosystem with two or more legal entities, every contract states signed-by. | Error | No | | [KQ403](https://kanoniq.extenza.dev/docs/rules/kq403.md) | **a supplier that is a legal entity states no LEI**
A supplier whose is names a legal entity states no lei and no headquarters: it reads both from the entity. | Error | No | | [KQ405](https://kanoniq.extenza.dev/docs/rules/kq405.md) | **a contract states each transfer ground once**
A ground a contract's transfer clause lists is listed once. | Error | No | ## Plateaus | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ033](https://kanoniq.extenza.dev/docs/rules/kq033.md) | **plateaus form one sequence**
Plateaus line up one after another, in a single sequence. | Error | No | | [KQ034](https://kanoniq.extenza.dev/docs/rules/kq034.md) | **plateau dates rise**
Each dated plateau is later than the dated plateaus before it. | Error | No | | [KQ035](https://kanoniq.extenza.dev/docs/rules/kq035.md) | **the initial plateau changes nothing**
The first plateau adds, removes, moves and restates nothing. | Error | No | | [KQ036](https://kanoniq.extenza.dev/docs/rules/kq036.md) | **a change names what the plateau before holds**
A removal or a move names something the plateau before holds. | Error | No | | [KQ037](https://kanoniq.extenza.dev/docs/rules/kq037.md) | **a path is one element's**
A path that once was an element's is never another element's in a later plateau. | Error | No | | [KQ038](https://kanoniq.extenza.dev/docs/rules/kq038.md) | **a move lands on a free path**
A move puts an element where no other element has its Code. | Error | No | | [KQ039](https://kanoniq.extenza.dev/docs/rules/kq039.md) | **a relationship's end is alive**
A plateau removes nothing a remaining relationship still uses. | Error | No | | [KQ047](https://kanoniq.extenza.dev/docs/rules/kq047.md) | **a data migration follows a plateau**
A data migration is declared in a plateau after the initial one. | Error | No | | [KQ048](https://kanoniq.extenza.dev/docs/rules/kq048.md) | **a change of authority is covered once**
Each change of a Domain Object's authoritative holding is covered by exactly one data migration of its plateau. | Error | No | | [KQ049](https://kanoniq.extenza.dev/docs/rules/kq049.md) | **covers names a change**
A data migration covers only Data Entities its plateau adds, removes or restates. | Error | No | | [KQ050](https://kanoniq.extenza.dev/docs/rules/kq050.md) | **a data migration falls within its window**
A data migration starts and is due between the dates of the plateau before and the plateau it delivers, and starts before it is due. | Error | No | | [KQ051](https://kanoniq.extenza.dev/docs/rules/kq051.md) | **a link names a page**
A data migration's link is an absolute http or https URL, or the path of a page file in the repository. | Error | No | | [KQ404](https://kanoniq.extenza.dev/docs/rules/kq404.md) | **memberships form runs**
A subject's memberships are runs that neither overlap nor touch, and only a relationship whose Id is its ends has more than one. | Error | No | | [KQ406](https://kanoniq.extenza.dev/docs/rules/kq406.md) | **a constant is alive where it is used**
A constant a use names is alive in every plateau the policy, the element or the relationship holding the use is alive in. | Error | No | ## Policies These check that a [policy](https://kanoniq.extenza.dev/docs/language/governance.md) makes sense, never whether your landscape follows it: a model that breaks its own policies is still valid. | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ074](https://kanoniq.extenza.dev/docs/rules/kq074.md) | **a policy's clause is an aspect or a selector, with its values**
Every clause of a policy names an aspect or a selector Kanoniq knows, or a property the repository declares, and lists only values that clause takes. | Error | No | | [KQ075](https://kanoniq.extenza.dev/docs/rules/kq075.md) | **a clause appears once in a policy**
A policy names each clause once, listing several values in one clause. | Error | No | | [KQ076](https://kanoniq.extenza.dev/docs/rules/kq076.md) | **a policy's clauses apply to one subject type**
Some subject, a call, a leg, a sync, a grant or a workload identity, can match every clause of a policy. | Error | No | | [KQ077](https://kanoniq.extenza.dev/docs/rules/kq077.md) | **an exemption lifts a policy from a subject**
An exemption lifts a policy from an element, a call, a leg, a sync or a grant. | Error | No | | [KQ078](https://kanoniq.extenza.dev/docs/rules/kq078.md) | **an Ecosystem's policy set shares no Code with the model's**
No policy set of an Ecosystem shares its Code with a policy set of the model, the two default sets aside. | Error | No | | [KQ090](https://kanoniq.extenza.dev/docs/rules/kq090.md) | **a preset's set is written out only where no other preset is judged**
No policy set has a preset's Code while the repository sets a preset of its kind, and no two presets of one kind are both written out. | Error | No | | [KQ091](https://kanoniq.extenza.dev/docs/rules/kq091.md) | **a reserved policy set is of its own kind**
A policy set coded as a default set, a preset or a package's set is of the kind its Code names: default-model, the baseline-model presets and threats-stated model sets, default-architecture, the baseline-architecture presets and threats-stride architecture sets. | Error | No | | [KQ092](https://kanoniq.extenza.dev/docs/rules/kq092.md) | **a model policy denies what is unstated**
A policy in a model set is a deny whose tested clause lists only unstated, and no other clause lists it. | Error | No | | [KQ093](https://kanoniq.extenza.dev/docs/rules/kq093.md) | **an architecture policy judges what is stated**
A policy in an architecture set lists unstated in no clause. | Error | No | | [KQ132](https://kanoniq.extenza.dev/docs/rules/kq132.md) | **a requirement the model can check is served**
In a framework the repository's frameworks setting follows, every requirement the model can check is served by a policy in effect, a preset the settings name included. | Lint | No | | [KQ271](https://kanoniq.extenza.dev/docs/rules/kq271.md) | **a constant is used where it is seen**
A name used in a value's place is a constant written on the model, or on the element the value is written on or in, or on one that holds it. | Error | No | | [KQ272](https://kanoniq.extenza.dev/docs/rules/kq272.md) | **a constant's type fits where it is used**
A constant used in a bound is a period or a number in the unit its clause takes; as quoted text, a string; in a period's place, a period; as an open property's value, its declared type's. | Error | No | | [KQ273](https://kanoniq.extenza.dev/docs/rules/kq273.md) | **a constant's name is defined once**
A constant's name is defined once in the whole model, never again at another level. | Error | No | | [KQ274](https://kanoniq.extenza.dev/docs/rules/kq274.md) | **a constant's name is neither a stage nor a period**
A constant's name is capitals, digits and underscores, starting with a capital, and is neither a stage nor shaped as a period, so a value is never ambiguous. | Error | No | | [KQ296](https://kanoniq.extenza.dev/docs/rules/kq296.md) | **a requirement is listed once**
A policy or a policy set lists each requirement it serves once. | Error | No | ## Structure | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ001](https://kanoniq.extenza.dev/docs/rules/kq001.md) | **unresolved endpoint**
Every relationship names elements that are in the model. | Error | No | | [KQ002](https://kanoniq.extenza.dev/docs/rules/kq002.md) | **duplicate identity**
No two elements share an Id, and no two elements under one parent share a Code. | Error | No | | [KQ003](https://kanoniq.extenza.dev/docs/rules/kq003.md) | **Ecosystem presence**
A model has an Ecosystem, and every Ecosystem sits at the top level. | Error | No | | [KQ004](https://kanoniq.extenza.dev/docs/rules/kq004.md) | **parent cardinality**
Every element but an Ecosystem has exactly one parent. | Error | No | | [KQ005](https://kanoniq.extenza.dev/docs/rules/kq005.md) | **containment reaches an Ecosystem**
Following parents upward from any element reaches an Ecosystem, never a circle. | Error | No | | [KQ006](https://kanoniq.extenza.dev/docs/rules/kq006.md) | **owner cardinality**
A Data Entity sits in a Storage, and a Storage sits in the Component or monolith that owns it. | Error | No | | [KQ103](https://kanoniq.extenza.dev/docs/rules/kq103.md) | **an orphaned derived element**
A derived element is still named by something in the model. | Lint | No | ## Splitting a model | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ026](https://kanoniq.extenza.dev/docs/rules/kq026.md) | **a relationship is stated once**
A relationship is written once, in one file or across the files of a split model. | Error | Yes | ## Open properties | Code | Rule | Severity | Quick fix | | --- | --- | --- | --- | | [KQ058](https://kanoniq.extenza.dev/docs/rules/kq058.md) | **a property is declared**
An open property is declared in the repository's settings, for the element type it is written on. | Error | No | | [KQ059](https://kanoniq.extenza.dev/docs/rules/kq059.md) | **a property's value is of its declared type**
An open property's value, and each value of a list, is of the type its declaration gives it. | Error | No | ## Page rules Page rules are checked by `kq portal:build` on the portal's pages, not on the model, and are reported under a `KQP` code. See [What `kq portal:build` reports](https://kanoniq.extenza.dev/docs/site/kq-portal-build.md#what-kq-portalbuild-reports). ### Page files | Code | Rule | Severity | | --- | --- | --- | | [KQP001](https://kanoniq.extenza.dev/docs/rules/kqp001.md) | **well-formed YAML**
A page file, a Markdown page's or a decision record's frontmatter, and a view block are well-formed YAML: one document, no key repeated. | Error | | [KQP002](https://kanoniq.extenza.dev/docs/rules/kqp002.md) | **page shape**
A page file, a Markdown page's or a decision record's frontmatter, and a view block have every field they need and only those they take, each with a value it can take. | Error | | [KQP003](https://kanoniq.extenza.dev/docs/rules/kqp003.md) | **page name**
A page file's name is the canonical encoding of the page's name. | Error | | [KQP004](https://kanoniq.extenza.dev/docs/rules/kqp004.md) | **one file per page**
A page has one file: no two sibling files for names that differ only in case or composition, or for one name under two extensions. | Error | | [KQP009](https://kanoniq.extenza.dev/docs/rules/kqp009.md) | **a known icon**
An icon is named as Lucide names one of its icons. | Error | ### Navigation | Code | Rule | Severity | | --- | --- | --- | | [KQP005](https://kanoniq.extenza.dev/docs/rules/kqp005.md) | **one home page**
portal/ holds exactly one page file directly: the home page. | Error | | [KQP006](https://kanoniq.extenza.dev/docs/rules/kqp006.md) | **every page is reachable**
Every page file and decision record sits in a directory that mirrors a page. | Error | | [KQP101](https://kanoniq.extenza.dev/docs/rules/kqp101.md) | **published under unpublished**
A published page sits under a published parent, since it is not rendered otherwise. | Lint | ### Tiles | Code | Rule | Severity | | --- | --- | --- | | [KQP007](https://kanoniq.extenza.dev/docs/rules/kqp007.md) | **a tile names a child**
A page tile names a child page or decision record in the page's mirror directory. | Error | | [KQP008](https://kanoniq.extenza.dev/docs/rules/kqp008.md) | **a child is listed once**
A page's tiles list each child once. | Error | | [KQP102](https://kanoniq.extenza.dev/docs/rules/kqp102.md) | **an unlisted child**
A page's tiles list every child page, so their order is chosen rather than by name. | Lint | ### Views | Code | Rule | Severity | | --- | --- | --- | | [KQP010](https://kanoniq.extenza.dev/docs/rules/kqp010.md) | **a known plateau**
A view tile's or view block's at and to name plateaus of the model, its to later than its at. | Error | | [KQP019](https://kanoniq.extenza.dev/docs/rules/kqp019.md) | **a known view path**
A path that decides which view opens, a view's domain, focus or anchor, names an element of the model of a type the parameter takes. | Error | | [KQP106](https://kanoniq.extenza.dev/docs/rules/kqp106.md) | **a view's selected and collapsed paths**
A view's selected path and collapsed entries name elements of the model. | Lint | ### Decision records | Code | Rule | Severity | | --- | --- | --- | | [KQP011](https://kanoniq.extenza.dev/docs/rules/kqp011.md) | **a known element**
A decision record's element Id names an element of the model. | Error | | [KQP012](https://kanoniq.extenza.dev/docs/rules/kqp012.md) | **a known successor**
A superseded decision record's superseded-by names another decision record's file, by its path from portal/. | Error | | [KQP013](https://kanoniq.extenza.dev/docs/rules/kqp013.md) | **a chain of successors that ends**
Following superseded-by from record to record never comes back to a record already passed. | Error | | [KQP103](https://kanoniq.extenza.dev/docs/rules/kqp103.md) | **the element's path**
A decision record's element path is the path its element Id is at in the model. | Lint | | [KQP104](https://kanoniq.extenza.dev/docs/rules/kqp104.md) | **a successor in force**
A superseded decision record's successor is not proposed or rejected, since then nothing has replaced the decision yet. | Lint | ### Page text | Code | Rule | Severity | | --- | --- | --- | | [KQP014](https://kanoniq.extenza.dev/docs/rules/kqp014.md) | **an image path**
An image in a page's text is named by a relative path to a file inside portal/. | Error | | [KQP015](https://kanoniq.extenza.dev/docs/rules/kqp015.md) | **an image that exists**
An image in a page's text names a file that exists. | Error | | [KQP016](https://kanoniq.extenza.dev/docs/rules/kqp016.md) | **an image type**
An image in a page's text is a PNG, JPEG, GIF, WebP or SVG file, as its extension says and its first bytes agree. | Error | | [KQP017](https://kanoniq.extenza.dev/docs/rules/kqp017.md) | **an image's size**
An image in a page's text is at most 5 MiB. | Error | | [KQP018](https://kanoniq.extenza.dev/docs/rules/kqp018.md) | **a link's target**
A link in a page's text names a page file or decision record by a relative path, or is a fragment or an http, https or mailto address. | Error | | [KQP105](https://kanoniq.extenza.dev/docs/rules/kqp105.md) | **a link to an unrendered page**
A rendered page links only to rendered pages, since a link to any other is written as its text. | Lint | © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/build-errors.md # Build errors Before Kanoniq can [validate](https://kanoniq.extenza.dev/docs/rules.md) a model, it has to build one: read the files, resolve every reference, and assemble what they say. When that fails, Kanoniq reports a build error. This page lists every one, what it means and how to fix it. ## Codes Every build error has a permanent code, `KB` and three digits, and it never changes meaning. A release may reword the message; the code stays, so you can search for it, cite it in a ticket, or match it in CI. - **`KB001`–`KB499` are errors.** The model does not build, so nothing is validated or written, and the command exits 1. The one exception is [KB024](#kb024), which fails the command but still lets the model build. - **`KB500` and up are warnings.** They are about the repository's settings, and fail nothing. A build error is different from a validation finding. A `KQ` finding is about a model that built and breaks a rule; a `KB` error means there is no model yet, or that something around it, such as `kanoniq.repository.json`, needs fixing. **No build error can be suppressed**: fix the file instead. ## Where you see them - **`kq`** prints each one as a line, `orders.kq:12:5 error KB003 'payments' names nothing`, with its file and position. `--format github` makes it an annotation titled with its code, and `--format sarif` makes it a result, so a SARIF viewer lists it beside the findings. - **VS Code** shows it in the Problems panel with its code, which links to its section on this page. - **The visual editor and the portal** list the errors of a model that does not build, each with its code. ## Every code | Code | Check | Severity | | --- | --- | --- | | [KB001](#kb001) | syntax | Error | | [KB002](#kb002) | characters the language reads | Error | | [KB003](#kb003) | a reference resolves | Error | | [KB004](#kb004) | a reserved Code | Error | | [KB005](#kb005) | declared once | Error | | [KB006](#kb006) | a reopening has a declaration | Error | | [KB007](#kb007) | a reopening restates nothing | Error | | [KB008](#kb008) | a name is stated | Error | | [KB009](#kb009) | declared where its kind can be | Error | | [KB010](#kb010) | a clause of its kind | Error | | [KB011](#kb011) | a schedule's interval | Error | | [KB012](#kb012) | a property has a value | Error | | [KB013](#kb013) | a property is given once | Error | | [KB014](#kb014) | a property's place | Error | | [KB015](#kb015) | an assumption is marked once | Error | | [KB016](#kb016) | an assumption's reason | Error | | [KB017](#kb017) | an assumption's place | Error | | [KB018](#kb018) | what carries an assumption | Error | | [KB019](#kb019) | the scoped line | Error | | [KB020](#kb020) | a scoped file's folder | Error | | [KB021](#kb021) | an extend in a scoped file | Error | | [KB022](#kb022) | one .g.kq file | Error | | [KB023](#kb023) | an Ecosystem's file | Error | | [KB024](#kb024) | the arranged layout | Error | | [KB025](#kb025) | authentication through a broker | Error | | [KB026](#kb026) | the broker idiom is unnamed | Error | | [KB027](#kb027) | a ui statement's authentication | Error | | [KB028](#kb028) | a grant is its source's | Error | | [KB029](#kb029) | one credential | Error | | [KB030](#kb030) | a cloud role's resource | Error | | [KB031](#kb031) | an entity's header is stated once | Error | | [KB032](#kb032) | an entity of its storage | Error | | [KB033](#kb033) | references stay with one owner | Error | | [KB034](#kb034) | a data migration covers an entity once | Error | | [KB035](#kb035) | one plateau without a block | Error | | [KB036](#kb036) | a derived plateau stands alone | Error | | [KB037](#kb037) | a plateau link is stated once | Error | | [KB038](#kb038) | plateaus form one sequence | Error | | [KB039](#kb039) | a plateau's occurrence restates nothing | Error | | [KB040](#kb040) | a before block changes nothing | Error | | [KB041](#kb041) | where a move is written | Error | | [KB042](#kb042) | a move's destination | Error | | [KB043](#kb043) | a removal removes something | Error | | [KB044](#kb044) | declared under what is removed | Error | | [KB046](#kb046) | a policy set has one kind | Error | | [KB047](#kb047) | a policy's set is stated once | Error | | [KB048](#kb048) | a policy's set is in scope | Error | | [KB049](#kb049) | a policy set's name is stated once | Error | | [KB050](#kb050) | an exemption is its owner's | Error | | [KB051](#kb051) | an exemption's subject | Error | | [KB052](#kb052) | an exemption is stated once | Error | | [KB053](#kb053) | an exemption's policy path | Error | | [KB054](#kb054) | a comment is kept | Error | | [KB055](#kb055) | inside the model | Error | | [KB056](#kb056) | no model inside a model | Error | | [KB057](#kb057) | the repository file is a JSON object | Error | | [KB058](#kb058) | a known setting | Error | | [KB059](#kb059) | a setting's value | Error | | [KB060](#kb060) | a command needs a repository | Error | | [KB061](#kb061) | a command needs one sequence | Error | | [KB062](#kb062) | a command writes the whole model | Error | | [KB063](#kb063) | dissolve names a plateau | Error | | [KB064](#kb064) | dissolve needs no before block | Error | | [KB065](#kb065) | a dissolve's direction | Error | | [KB066](#kb066) | data migrations that would meet | Error | | [KB067](#kb067) | the portal's output directory | Error | | [KB068](#kb068) | the repository's id | Error | | [KB069](#kb069) | a message's version is stated once | Error | | [KB070](#kb070) | an event travels on a leg | Error | | [KB071](#kb071) | a message is carried once | Error | | [KB072](#kb072) | a removal carries nothing | Error | | [KB073](#kb073) | a removal states no acl | Error | | [KB074](#kb074) | a value is given once in a list | Error | | [KB075](#kb075) | a process's statement is written once | Error | | [KB076](#kb076) | a name is not empty | Error | | [KB077](#kb077) | a version is named on a call | Error | | [KB078](#kb078) | via names a call's gateway | Error | | [KB079](#kb079) | a kind its element takes | Error | | [KB080](#kb080) | a period's form | Error | | [KB082](#kb082) | a name used is a constant | Error | | [KB083](#kb083) | a constant's value | Error | | [KB084](#kb084) | a legal basis is one of GDPR's | Error | | [KB085](#kb085) | a country is an ISO 3166-1 code | Error | | [KB086](#kb086) | a reserved policy set is written at the model or an Ecosystem | Error | | [KB087](#kb087) | a requirement is one its framework lists | Error | | [KB088](#kb088) | a policy set's requirements are stated once | Error | | [KB089](#kb089) | a location word the registry holds | Error | | [KB090](#kb090) | a removal names its ends | Error | | [KB091](#kb091) | a relationship keeps its attributes | Error | | [KB092](#kb092) | a transfer ground is one of GDPR Chapter V's | Error | | [KB501](#kb501) | a policy-sets key names a set | Warning | ## Syntax ### KB001 — syntax **Error** · `syntax` The text is not valid Kanoniq: a keyword in the wrong place, a missing `{` or `}`, or a declaration cut short. The message says what the parser expected at that position. Look at the line and the one before it; a missing closing brace is often reported where the next declaration starts. The [language guide](https://kanoniq.extenza.dev/docs/language.md) has every form. ### KB002 — characters the language reads **Error** · `lexer` The file holds a character or a token Kanoniq cannot read, such as an unclosed quote or a stray symbol. Close the string or remove the character. ### KB080 — a period's form **Error** · `period-form` A period is misspelled. Kanoniq writes a period as an ISO 8601 duration: `P`, then years `Y`, months `M` and days `D`, then `T` and hours `H`, minutes `M` and seconds `S`, each a whole number with an uppercase letter, written once and in that order, such as `P90D`, `P18M` or `PT15M`; or weeks alone, `P2W`. The message names the rule the period breaks: `P90d` has a lowercase letter, `PT0.5S` a fraction, `P1W3D` a week beside days, `P1D2Y` its parts out of order. Write the period in that form. ### KB083 — a constant's value **Error** · `constant-value` A constant's value is a word other than `true` or `false`, such as `const ENABLED = yes`. A constant holds a period, a whole number, quoted text, `true` or `false`; write one of those after the `=`. ## Names and references ### KB003 — a reference resolves **Error** · `reference-resolves` A Code or path names nothing, names more than one element, or names an element of the wrong kind for its place. The message says which: where a bare Code was looked for, which segment of a path was not found, or what it named instead. Correct the spelling, write the full path from the root with a leading `/` if an inner Code hides the one you mean, or declare the element. ### KB004 — a reserved Code **Error** · `reserved-code` The Code is a reserved word or a name Windows gives a device, such as `con` or `nul`. Every Code must be able to name a folder. Choose another Code, or write a Code that is a reserved word with an `@`, as `@customer`. ### KB005 — declared once **Error** · `declared-once` An element, plateau, policy or data migration is declared twice. Remove one declaration, or, if the element has children, turn the second into a reopening: its keyword and Code alone, followed by a block. ### KB006 — a reopening has a declaration **Error** · `reopening-has-declaration` A reopening names an element that is declared nowhere, in the model or in the plateau before. Declare the element once, with its name, or correct the Code of the reopening. ### KB007 — a reopening restates nothing **Error** · `reopening-restates-nothing` A reopening is only a Code and a block. Its name, description, properties, assumption, `environment` and a workload identity's `credential` go on the declaration. Move them there, and give the reopening a block. ### KB008 — a name is stated **Error** · `name-stated` An element you declare states its name in quotes after its Code. Add the name. Only Kanoniq leaves a name out, on what it writes into `.g.kq`. ### KB076 — a name is not empty **Error** · `name-not-empty` A name is written `""`, or a code in parentheses is written `("")`. Write the name or the code between the quotes, or, for a code, leave the parentheses out. ### KB082 — a name used is a constant **Error** · `constant-resolves` A name is written where a value is taken, such as `rotate MAX_ROTATION` or `#owner OWNER`, and no constant in the model has that name. Check the spelling, or define it with `const MAX_ROTATION = P90D`. ### KB085 — a country is an ISO 3166-1 code **Error** · `country-known` A supplier's or a legal entity's `headquarters`, a contract's `law`, a branch's country after `in`, or the `country` of a data center or a saas component names a country that isn't an ISO 3166-1 alpha-2 code, such as `headquarters UK` or `country UK`. Write the country's two-letter code in capitals, such as `headquarters GB`, `law IE` or `country GB`. No country code is reserved, so a Code such as `de` stays legal. ### KB089 — a location word the registry holds **Error** · `location-known` A `location` names a region the registry of location words doesn't hold, such as `location azure.west-europe`. Write the region as its provider spells it, `location azure.westeurope`; the message lists the words the registry holds. ## Structure ### KB009 — declared where its kind can be **Error** · `declared-where-allowed` The element sits inside an element that cannot hold its kind: for example a module outside a monolith, a storage outside the Component or monolith that owns it, a policy in a block that holds none, or a data migration outside an Ecosystem. A later plateau's `move` that puts an element under one that cannot hold its kind, such as a module anywhere but in a monolith or a Component in a Domain or another Component, is refused the same way. Move it to where its kind belongs; the [language guide](https://kanoniq.extenza.dev/docs/language.md) says what holds what. ### KB010 — a clause of its kind **Error** · `clause-of-its-kind` The clause does not apply to this kind of element: `environment` and `technology` go on a deployable module only, `schedule` on a job or a robot only, and `location` and `country` on a saas component or monolith only. Any other component or monolith is where what it runs `on` is, so it states no location of its own. A module's kind in a plateau is the one its header has there: an `environment` line that stands where a later plateau restates its module as not deployable is refused, and so is a restated header with `technology` on a module that is not deployable. Remove the clause, or change the element's kind. ### KB011 — a schedule's interval **Error** · `schedule-interval` `every` takes a period with no month or year, such as `PT15M`, `PT4H` or `P1D`, since a month or a year has no fixed length. Write the interval in weeks, days, hours or minutes, or use `monthly` or `cron`. ### KB075 — a process's statement is written once **Error** · `process-statement-once` A job role's `holds`, a process's `lane`, a `then` between the same two nodes, or a node's `message` to or from the same party, is written twice in one plateau. Each is fixed by its two ends, so the second line says the same thing again. Delete one of them. ### KB079 — a kind its element takes **Error** · `kind-known` The kind after the colon of a network, a link, a host, an app platform, a database server, a gateway, a DNS record, a storage account, a vault, a registry, an AI platform, a backup vault, a security service or a broker is not one that element takes: no generic kind of it, and no product word the registry maps to it. A device host states what it is by a second word, such as `kiosk`, and no other host states one. A channel states its kind exactly where what holds it carries several: none in a broker whose kind carries one, one of them in a broker such as `rabbitmq` that carries several, and on a storage `file-share` or `sftp` on a `file` one, `blob-storage` or `sftp` on a `blob` one. A repository's format is one of `oci`, `npm`, `nuget`, `maven`, `pypi`, `go`, `cargo`, `rubygems`, `swift`, `helm`, `terraform`, `apt`, `yum` and `generic`, and an installation's kind one of `os`, `runtime`, `sdk`, `web-server` and `middleware`. Write one of the kinds the message names, or a product word for that element. ## Properties and assumptions ### KB012 — a property has a value **Error** · `property-has-value` A property line names a property but no value, or a comma with no value after it: write `@name `, or a list's values `@name , `. ### KB013 — a property is given once **Error** · `property-once` A property has one value unless it is declared a list. Remove the second line giving it, or, on a connection, the second statement naming it; for a list, write its values on one line, separated by commas, or declare the property `"list": true` to give it several. ### KB014 — a property's place **Error** · `property-placed` A property line goes directly above a declaration or a statement that carries properties. Move it there, or remove it. ### KB015 — an assumption is marked once **Error** · `assumption-once` A line carries one `#assumed`. Remove the second. ### KB016 — an assumption's reason **Error** · `assumption-reason` An assumption's reason is quoted text that says why: `#assumed "not confirmed by the team"`. Quote it, or leave the reason out entirely. ### KB017 — an assumption's place **Error** · `assumption-placed` An `#assumed` line goes directly above a declaration or a statement that carries one. Move it there, or remove it. ### KB018 — what carries an assumption **Error** · `assumption-carried` Only something known or unknown can be assumed. A plan is neither; a derived element carries the assumption of what it came from; an entity line that states nothing of its header has nothing to assume. Mark the line that states it instead, or remove the mark. See [Assumptions](https://kanoniq.extenza.dev/docs/language/assumptions.md). ### KB074 — a value is given once in a list **Error** · `property-value-once` A list property names each value once: `#brand acme, acme` gives one brand twice. Remove the second. Two paths naming the same element are one value given twice. ## Splitting a model ### KB019 — the scoped line **Error** · `scoped-first-line` A scoped file starts with `scoped` alone on its first line, with nothing before it, not even a comment. Move it to the top. ### KB020 — a scoped file's folder **Error** · `scoped-folder` A scoped file is read inside the element its folder mirrors, so the folder has to name one: the file must be under the model's root, not at the root itself, in a folder path that matches an element's path. Move the file to the right folder, or remove `scoped`. ### KB021 — an extend in a scoped file **Error** · `scoped-extend-policies` An `extend` block in a scoped file holds policies alone. Move anything else to the file of the element it belongs to. ### KB022 — one .g.kq file **Error** · `one-id-map` A model has one `.g.kq` file. Delete the extra one, keeping the file named after the repository. ### KB023 — an Ecosystem's file **Error** · `ecosystem-file-traced` A file the arranged layout gives an Ecosystem no longer holds that Ecosystem. Run `kq arrange` to put the declarations where they belong. ### KB024 — the arranged layout **Error** · `arranged-layout` In an arranged model, a file is not where the layout puts it, or holds what belongs in another file. Run `kq arrange`. This is the one error that does not stop the build: the model is still built and `.g.kq` written, but the command fails. ## Connections and workload identity ### KB025 — authentication through a broker **Error** · `broker-auth` A path into a broker is two arrows, so it states each one's scheme with `sender-auth` and `receiver-auth`. A single arrow states `auth`. Use the pair on a broker path and `auth` everywhere else. ### KB026 — the broker idiom is unnamed **Error** · `broker-idiom-unnamed` The broker idiom stands for two connections, so it takes no `as` name. Remove `as`, or write the two connections out if you need to name them. ### KB027 — a ui statement's authentication **Error** · `ui-no-auth` A `ui` statement carries no `auth` and no `grant`: who signs in is the Role's `in`, or the robot's `runs-as`. Remove the clause and state it there. ### KB028 — a grant is its source's **Error** · `grant-is-sources` A grant on a connection is a role of the connection's source. Write the grant on the connection from the element that holds the role. ### KB029 — one credential **Error** · `one-credential` A workload identity states one credential. Remove the extra ones. ### KB030 — a cloud role's resource **Error** · `cloud-role-on` A cloud role names the resource it is granted on with `on`, or is written as part of a connection to that resource. Add `on `, or move the role onto the connection. ### KB070 — an event travels on a leg **Error** · `event-on-a-leg` An event is named in `carries` on a call. An event travels into and out of channels, so name it on the publisher's connection into the channel and on each delivery out of it, or carry a command or a query on the call instead. ### KB071 — a message is carried once **Error** · `carried-once` A `carries` list, on a connection or a sync, names the same message, or the same version of it, twice. Remove the repeat. ### KB072 — a removal carries nothing **Error** · `removal-carries-nothing` A `-` line for a connection has `carries`. A removal names a connection by its ends and transport only, so drop `carries` from it; to change what a connection carries, remove it and write it again with its new list. ### KB073 — a removal states no acl **Error** · `removal-states-no-acl` A `-` line for a connection has `acl`. A removal names a connection by its ends and transport only, so drop `acl` from it; to add or drop the anticorruption layer, remove the connection and write it again with or without `acl`. ### KB077 — a version is named on a call **Error** · `version-on-a-call` A version follows the target of a statement that lands on no interface: a connection into or out of a channel, the broker idiom or an `in-process` call; or a `-` line for a connection names one. Only a call to an interface names the version it calls, so drop it there. A removal names a connection by its ends and transport only; to move a caller to another version, remove the call and write it again with the new version. ### KB078 — via names a call's gateway **Error** · `via-on-a-call` A `via ` sits on something other than a call over a protocol: a leg into or out of a channel, the broker idiom, a `ui` statement, or a `-` line. Only a call goes through a gateway, so drop `via` there; to change a call's gateway, remove the call and write it again with its new `via`. ## Data ### KB031 — an entity's header is stated once **Error** · `entity-header-once` Each part of an entity's header (its root, its markers, `part of`, `from` and its description) is stated once. Remove the repeat. ### KB032 — an entity of its storage **Error** · `entity-of-storage` The name is not one of this storage's entities. Correct it, or declare the entity in the storage. ### KB033 — references stay with one owner **Error** · `references-within-owner` `references` names an entity in a storage of the same Component. Point it at one of those, or remove it. ### KB034 — a data migration covers an entity once **Error** · `migration-covers-once` Remove the second `covers` line for the entity. ### KB084 — a legal basis is one of GDPR's **Error** · `legal-basis-known` A data use states a word GDPR doesn't list, such as `basis contractual`. A `basis` is one of the six lawful bases of Art. 6(1), and a `special` one of the conditions of Art. 9(2) or Art. 10's `authorized-by-law`. Write the word as the list spells it, such as `basis contract`. None of these words is reserved but `contract`, which `basis` still reads, so a Code such as `consent` stays legal. ### KB092 — a transfer ground is one of GDPR Chapter V's **Error** · `transfer-ground-known` A contract's `transfer` states a word GDPR Chapter V doesn't list, such as `transfer consent`. A ground is one of `adequacy`, `scc`, `bcr`, `code-of-conduct`, `certification`, `ad-hoc-clauses` and `public-instrument`; an Art. 49 derogation isn't one, since it is for occasional transfers rather than a standing flow. Write the word as the list spells it, such as `transfer scc`. None of these words is reserved, so a Code such as `scc` stays legal. ## Plateaus ### KB035 — one plateau without a block **Error** · `one-base-plateau` Exactly one plateau is declared without a block; the model's top level is its content. Every other plateau has a block. Give each extra one a block, or, if none is declared without one, take the block off the plateau the model starts from. ### KB036 — a derived plateau stands alone **Error** · `derived-plateau-alone` Kanoniq derives a plateau only for a model that declares none. Once you declare plateaus, declare this one in a model file too: `plateau ""`. ### KB037 — a plateau link is stated once **Error** · `plateau-link-once` The link between two plateaus is stated once: `after` on the later, or `before` on the earlier, not both. Remove one. ### KB038 — plateaus form one sequence **Error** · `plateaus-one-sequence` Plateaus form one line: every plateau but the first follows exactly one other, and no two follow the same one. Fix the `after` and `before` links so there is no fork, merge, loop or plateau left on its own. ### KB039 — a plateau's occurrence restates nothing **Error** · `plateau-occurrence-restates-nothing` Inside a plateau, a description, property or assumption goes on a declaration, which restates the element's header. Write the element's full declaration in that plateau, or move them out. ### KB040 — a before block changes nothing **Error** · `before-block-changes-nothing` A move or a policy change belongs in the later plateau, not in a `before` block. Move it there. `kq arrange` writes every plateau forward. ### KB041 — where a move is written **Error** · `move-written-where-new` A move is written where its element lands, not inside a block of an element the plateau before holds. Write it in the destination's block. ### KB042 — a move's destination **Error** · `move-destination` A move lands on a free path. Choose a destination that no element already holds, and that is not under the element being moved. The path is judged once the whole plateau is read, so the plateau can't add an element where the move puts another. Only an ecosystem moves to the model's top, and an ecosystem moves nowhere else. An element moves once in a plateau; a second move gives it two destinations. A move names its element by its path in the plateau before, so a move naming the path an earlier move of the same plateau made names nothing, [KB003](#kb003). ### KB043 — a removal removes something **Error** · `removal-removes` A removal names something the plateau before holds. Check the name and the plateau; if the element was added in this plateau, delete its declaration instead. A `-v1` in a message's block names a version the plateau before has, and is never written in the model's first state. A plateau does not both move and remove an element: a `-` line that takes away what a `move` of the same plateau moves, itself or with an element above it, is refused; write the move or the removal, not both. ### KB044 — declared under what is removed **Error** · `declared-under-removed` The element is declared under one its plateau removes. Move it to a parent that stays, or keep the parent. ### KB069 — a message's version is stated once **Error** · `version-stated-once` A version is written twice in an event's, a command's or a query's block, or a later plateau adds a version the plateau before already has. Write each version once; a plateau writes only the versions it adds, `v3`, and the ones it removes, `-v1`. ### KB090 — a removal names its ends **Error** · `removal-names-ends` A `-` line removing a `then` states its name, or one removing a `used-by` states its reason. Such a line names the relationship by its two ends alone: write `-review then pay`, not `-review then pay [yes]`, and leave the name or the reason out. ### KB091 — a relationship keeps its attributes **Error** · `return-keeps-attributes` A `then`, a message flow or a `used-by` written again in a later plateau, after a `-` line ended it, states another name, `over` chain or reason than it was first stated with. Written again, it is the same relationship, with one name, chain or reason in every plateau it lives in: write it as it was first written. ## Policies ### KB046 — a policy set has one kind **Error** · `policy-set-one-kind` Every occurrence of a policy set states the same kind, `model` or `architecture`. Make them match. See [Governance](https://kanoniq.extenza.dev/docs/language/governance.md). ### KB047 — a policy's set is stated once **Error** · `policy-in-once` A policy outside every set names where it goes, with `in model`, `in architecture` or `in ` after its Code. A policy inside a set takes the set's kind, and writes no `in`. Add or remove `in` to match. ### KB048 — a policy's set is in scope **Error** · `policy-set-in-scope` `in ` names a set of the model, or of the policy's own Ecosystem. Correct the Code, declare the set, or move the policy to where the set is. ### KB049 — a policy set's name is stated once **Error** · `policy-set-name-once` A policy set's name is written once, at one of its occurrences. Remove it from the others. ### KB050 — an exemption is its owner's **Error** · `exemption-by-owner` Only the side that owns a policy can lift it. Write the exemption in the Ecosystem the message names. ### KB051 — an exemption's subject **Error** · `exemption-subject` An exemption at the model's top level names what it exempts with `for `. Add it. ### KB052 — an exemption is stated once **Error** · `exemption-once` A policy is exempted once for one subject. Remove the duplicate exemption. ### KB053 — an exemption's policy path **Error** · `exemption-policy-path` An exemption names its policy as `/`, or `//` from outside the policy's Ecosystem. Write the path in that form. ### KB086 — a reserved policy set is written at the model or an Ecosystem **Error** · `reserved-set-in-ecosystem` A policy set with a reserved Code, `default-model`, `default-architecture` or one of the four `baseline-…` presets, is written at the model's top or in an Ecosystem's block, never in a Platform or below. Move the set out of the Platform or Component block, and write the policies of that block as `policy in model`, `in architecture` or `in `. ### KB087 — a requirement is one its framework lists **Error** · `requirement-known` A requirement after `serves` names a framework that neither Kanoniq ships nor your repository declares, or an id that framework doesn't list, such as `serves pci-dss-4/13.1.1`. Write the framework's word as Kanoniq ships it, such as `iso-27001-2022`, or declare your own framework and its ids in the repository's `frameworks` setting, and write the id as the framework numbers it. ### KB088 — a policy set's requirements are stated once **Error** · `policy-set-serves-once` Two occurrences of one policy set each state `serves`. State the requirements the set serves on one of its occurrences, as its name is. ## Canonical form ### KB054 — a comment is kept **Error** · `comment-kept` Kanoniq rewrites files in canonical form and keeps every `//` comment above the declaration or statement it precedes. This comment has nothing to go above, or would be written twice. Move it directly above a declaration. ## The repository's files ### KB055 — inside the model **Error** · `inside-model` In a repository, every `.kq` file belongs under `model/`. Move the file there, or delete it. ### KB056 — no model inside a model **Error** · `no-nested-model` A model holds no other model: this `kanoniq.repository.json` sits inside one. Delete it, or move the folder out of the model. ### KB057 — the repository file is a JSON object **Error** · `repository-file-object` `kanoniq.repository.json` is JSON holding one object, with `//` and `/* … */` comments allowed and no trailing comma. Fix the syntax; the message says where it broke. ### KB058 — a known setting **Error** · `repository-setting-known` The key is not a setting. Check its spelling against the settings `kq init` writes, and remove it if it is not one. ### KB059 — a setting's value **Error** · `repository-setting-value` The setting's value is not of its form. The message says what form it takes. An `end-of-support-error` longer than the `end-of-support-warning` is this error too, since the error comes before the warning: shorten the error, or lengthen the warning. So is a `confidentiality-levels` that is empty, lists a level twice, or lists a reserved word other than `public`, `internal` and `secret`: list each level once, spelled as a code is. So is a `residencies` entry whose name isn't spelled as a code is or is a reserved word, that holds a key other than `countries` and `adequate`, whose `countries` is empty, or that lists a code outside ISO 3166-1, a country twice or an `adequate` country among its own: list each country once, as its two capitals. ### KB501 — a policy-sets key names a set **Warning** · `policy-sets-key-names-set` A key under `policy-sets` names a policy set the model does not have. Remove the key, or correct it. This is a warning, so a set can be removed before its setting. ## Commands ### KB060 — a command needs a repository **Error** · `command-needs-repository` A command that writes needs a repository: `kq build`, `kq prune`, `kq arrange`, `kq dissolve` and `kq portal:build` read a model whose root is marked by `kanoniq.repository.json`. Run `kq init` to make one. ### KB061 — a command needs one sequence **Error** · `command-needs-one-sequence` `kq arrange` and `kq dissolve` need the model's plateaus to form one sequence. Fix [KB038](#kb038) first. ### KB062 — a command writes the whole model **Error** · `command-writes-whole-model` `kq arrange` and `kq dissolve` write the whole model or nothing. This one could not place everything, so it wrote nothing. Fix what the other messages report and run it again. ### KB063 — dissolve names a plateau **Error** · `dissolve-names-plateau` `kq dissolve` names a plateau of the model by its Code. Check the spelling. ### KB064 — dissolve needs no before block **Error** · `dissolve-needs-arranged` `kq dissolve` reads a model with no `before` block. Run `kq arrange` first, which writes every plateau forward. ### KB065 — a dissolve's direction **Error** · `dissolve-direction` A plateau dissolves into a neighbor it has: the model's only plateau has none, the first plateau dissolves only into next, and the last only into previous. Choose the other direction. ### KB066 — data migrations that would meet **Error** · `dissolve-migrations-meet` Dissolving the plateau would put two data migrations at one path. Rename or remove one of them first. ### KB067 — the portal's output directory **Error** · `portal-out-directory` `kq portal:build` writes into a directory that is not the repository nor above it, and that is empty or holds only what it wrote before. Choose another `--out` directory, or empty it. ### KB068 — the repository's id **Error** · `portal-repository-id` `kq portal:build` needs the repository's permanent `id` in `kanoniq.repository.json`. Add the `"id"` the message gives; it stays the repository's for good. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq052.md # KQ052 — a Goal or a value stream stage is realized from the function side **Error** · `strategy-realized-from-function-side` · [Motivation and strategy](https://kanoniq.extenza.dev/docs/rules.md#motivation-and-strategy) Only a Domain, a Function Group or a Function realizes a Goal or an impact, and only a Function Group a value stream stage. A component, a platform or a monolith `realizes` a `goal`, a `value-stream-stage` or an `impact`. Only a domain, a function group or a function realizes one, and only a function group a stage ([KQ057](https://kanoniq.extenza.dev/docs/rules/kq057.md)): a component reaches a goal, a stage or an impact through the functions it realizes. Write the realization from the domain, function group or function the component already realizes, in a motivation block. ## Examples In an ecosystem where the rider app realizes the function `renting/unlocking/unlock-bike`, the app realizing the goal itself raises KQ052: ```kanoniq motivation { rental/rider-app realizes clean-fleet } ``` Realized from the domain the app works for, the goal raises nothing: ```kanoniq motivation { renting realizes clean-fleet } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq053.md # KQ053 — an influence and a value delivery join a legal pair **Error** · `motivation-pair` · [Motivation and strategy](https://kanoniq.extenza.dev/docs/rules.md#motivation-and-strategy) An influence runs from an Assessment or a Value to a Driver, or from a Driver or an impact to a Goal, and a value stream delivers a Value. An `influences` goes from an assessment or a value to a driver, or from a driver or an impact to a goal, and `delivers` from a value stream to a value. Point the statement at the element the chain allows: an assessment influences the driver it bears on, which influences the goal. ## Examples A goal influencing a driver runs the chain backward, so it raises KQ053: ```kanoniq motivation { clean-fleet influences climate } ``` The driver influencing the goal raises nothing: ```kanoniq motivation { climate influences clean-fleet } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq054.md # KQ054 — an influence and a value delivery stay in one Ecosystem **Error** · `motivation-within-ecosystem` · [Motivation and strategy](https://kanoniq.extenza.dev/docs/rules.md#motivation-and-strategy) An influence and a value delivery stay inside one Ecosystem. An `influences` or a `delivers` names an element in another ecosystem. Each organization's motivation is its own. State the driver, value or goal again in the ecosystem it belongs to, and point the statement there. ## Examples A driver in City Bikes influencing a goal in Rail crosses Ecosystems, so it raises KQ054: ```kanoniq motivation { climate influences rail/punctual } ``` The goal stated again in City Bikes, with the influence pointing there, raises nothing: ```kanoniq motivation { goal on-time-rides "Rides on time" climate influences on-time-rides } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq055.md # KQ055 — a value stream's stages are numbered from 1 **Error** · `stages-numbered` · [Motivation and strategy](https://kanoniq.extenza.dev/docs/rules.md#motivation-and-strategy) A value stream's stages are numbered 1, 2, 3 and on, each number once. A value stream's stages are not numbered 1, 2, 3 and on, each number once. The number is the order of the stages, so renumber them without gaps or repeats. ## Examples A value stream whose stages are numbered 1 and 3 leaves a gap, so it raises KQ055: ```kanoniq motivation { value-stream return-bike "Return a bike" : main-stream { value-stream-stage 1 dock "Dock the bike" value-stream-stage 3 pay "Pay for the ride" } } ``` Numbered 1 and 2, its stages raise nothing: ```kanoniq motivation { value-stream return-bike "Return a bike" : main-stream { value-stream-stage 1 dock "Dock the bike" value-stream-stage 2 pay "Pay for the ride" } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq056.md # KQ056 — an element holds at most one purpose **Error** · `one-purpose` · [Motivation and strategy](https://kanoniq.extenza.dev/docs/rules.md#motivation-and-strategy) An element's motivation holds at most one purpose. An element's motivation holds more than one `purpose`. Keep one, and move the text of the others into its `///` description. ## Examples Two purposes in the ecosystem's motivation raise KQ056: ```kanoniq motivation { /// Every rider has a safe bike within five minutes. purpose rides "Rides for everyone" /// Fewer cars in the city. purpose streets "Quieter streets" } ``` One purpose, its text in its description, raises nothing: ```kanoniq motivation { /// Every rider has a safe bike within five minutes, and the city has fewer cars. purpose rides "Rides for everyone" } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq057.md # KQ057 — a value stream stage is realized by a Function Group **Error** · `stage-realized-by-function-group` · [Motivation and strategy](https://kanoniq.extenza.dev/docs/rules.md#motivation-and-strategy) A value stream stage is realized by a Function Group, never by a Domain or a Function. A `domain` or a `function` `realizes` a `value-stream-stage`. Only a function group, the second level of the business decomposition, carries a stage, so what carries each stage is answered at one level. Write the realization from the function group that holds the function, or from the one inside the domain that carries the stage. ## Examples In an ecosystem where the domain `renting` holds the function group `unlocking`, the domain realizing the stage `unlock` raises KQ057: ```kanoniq motivation { renting realizes rent-a-bike/unlock } ``` The function group realizing it raises nothing: ```kanoniq motivation { renting/unlocking realizes rent-a-bike/unlock } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq094.md # KQ094 — an impact's actor is a Stakeholder of its own Ecosystem **Error** · `impact-actor` · [Motivation and strategy](https://kanoniq.extenza.dev/docs/rules.md#motivation-and-strategy) An impact's actor is a Stakeholder in the impact's own Ecosystem. An `impact`'s `on` names a stakeholder of another ecosystem, or something that isn't a stakeholder. An impact is a change in the behavior of a party with an interest in your own organization. Declare the stakeholder in the ecosystem the impact belongs to, and name it after `on`. ## Examples An impact whose actor is a stakeholder of another ecosystem, Rail's travellers, raises KQ094: ```kanoniq motivation { impact rail-riders "Travellers ride to the station" on rail/travellers } ``` On a stakeholder of its own ecosystem, the riders, it raises nothing: ```kanoniq motivation { impact app-unlocks "Riders unlock with the app" on riders } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq025.md # KQ025 — only a top-level Domain is an enabler **Error** · `enabler-is-top-level` · [Domains](https://kanoniq.extenza.dev/docs/rules.md#domains) Only a Domain directly in an Ecosystem is marked enabler. A domain marked `enabler` sits inside another domain. Only a domain directly in an ecosystem can be an Enabler Domain. Its sub-domains are part of it without a mark of their own, so drop the `enabler` from the sub-domain, or move it up to the ecosystem. ## Examples A sub-domain marked `enabler` raises KQ025: ```kanoniq domain operations "Operations" { domain monitoring "Monitoring" enabler } ``` With the mark on the top-level domain, it raises nothing: ```kanoniq domain operations "Operations" enabler { domain monitoring "Monitoring" } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq095.md # KQ095 — contexts do not nest **Error** · `contexts-do-not-nest` · [Domains](https://kanoniq.extenza.dev/docs/rules.md#domains) A Component is in at most one bounded context, and no Domain marked bounded-context sits inside another. A component is in two bounded contexts: it is marked `bounded-context` itself or sits in a marked module, monolith or platform, and a marked domain also holds the domain it is filed under, or two of those marks hold it. A domain marked inside another marked domain is reported even before anything is filed in it. Keep the mark on the one boundary whose model holds, and remove the other. ## Examples A domain marked `bounded-context` inside another marked domain raises KQ095: ```kanoniq domain selling "Selling" bounded-context { domain pricing "Pricing" bounded-context } ``` With the mark on one of them, nothing is raised: ```kanoniq domain selling "Selling" bounded-context { domain pricing "Pricing" } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq096.md # KQ096 — an Enabler Domain states no subdomain type **Error** · `no-subdomain-type-under-enabler` · [Domains](https://kanoniq.extenza.dev/docs/rules.md#domains) An Enabler Domain, and every Domain under one, is generic and states no subdomain type of its own. A domain marked `enabler`, or a domain inside one, states `core`, `supporting` or `generic`. An Enabler Domain is generic already, and so is everything in it. Remove the type. ## Examples An Enabler Domain stating `generic` raises KQ096: ```kanoniq domain monitoring "Monitoring" generic enabler ``` Without the type, it raises nothing: ```kanoniq domain monitoring "Monitoring" enabler ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq112.md # KQ112 — a core Domain is not only bought **Lint** · `core-is-built` · [Domains](https://kanoniq.extenza.dev/docs/rules.md#domains) A core Domain is realized by at least some custom-built software, not by SaaS or off-the-shelf products alone. A domain typed `core`, or inside one, is realized only by `saas` or `cots` components or monoliths, or parts of a bought monolith. The business competes on its core, and here it competes on software it does not control. Fine for a while, during a replacement. Otherwise, check the type: the domain may be `supporting` or `generic`. ## Examples A `core` domain realized only by a `saas` component raises KQ112: ```kanoniq domain pricing "Pricing" core platform back-office "Back office" { component price-engine "Price engine" : saas price-engine realizes pricing } ``` Realized by a component built in-house, it raises nothing: ```kanoniq domain pricing "Pricing" core platform back-office "Back office" { component price-engine "Price engine" : backend price-engine realizes pricing } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq113.md # KQ113 — a generic Domain is not custom-built **Lint** · `generic-is-bought` · [Domains](https://kanoniq.extenza.dev/docs/rules.md#domains) A generic Domain, an Enabler Domain aside, is realized by SaaS or off-the-shelf products, not by custom-built software. A domain typed `generic`, or inside one, is realized by custom-built software. A generic subdomain is a solved problem, usually bought rather than built. Building it can be a deliberate choice; otherwise, check the type, or consider a product. An Enabler Domain is never reported, since shared software is often run or built in-house by design. ## Examples A `generic` domain realized by a component built in-house raises KQ113: ```kanoniq domain payroll "Payroll" generic platform back-office "Back office" { component payroll-service "Payroll service" : backend payroll-service realizes payroll } ``` Realized by a `saas` component, it raises nothing: ```kanoniq domain payroll "Payroll" generic platform back-office "Back office" { component payroll-service "Payroll service" : saas payroll-service realizes payroll } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq119.md # KQ119 — a flow node is reached from a start event **Lint** · `flow-node-is-reached` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) A flow node of a process is reached by then from one of its start events. A task, an event or a gateway that no start event of its process reaches by following `then`. The order never arrives at it. Add the `then` that leads to it, or a `start` if the process has none yet. An `external` step is never reported: only messages reach it. ## Examples In a process whose start event leads to `approve`, a task no `then` leads to raises KQ119: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service } ``` A `then` from `approve` puts it on the way and raises nothing: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service approve then pay } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq221.md # KQ221 — a flow node is in a lane of its process **Error** · `flow-node-in-a-lane` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) Every flow node but an external step sits in one of its process's lanes. A task, an event or a gateway states no `in `, or names a job role that is not one of its process's `lane` lines. Write `in` with one of the process's lanes, or add `lane ` to the process. ## Examples A task with no `in` sits in no lane, so it raises KQ221: ```kanoniq process pay-claim { task pay "Pay" via claims/pay/pay-out service approve then pay } ``` In the `handler` lane, it raises nothing: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service approve then pay } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq222.md # KQ222 — a lane is a job role of the process's Ecosystem **Error** · `lane-is-a-job-role` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) A process's lane names a job role of the process's own Ecosystem. A `lane` names a job role of another ecosystem than its process's. A process's lanes are the positions of its own organization. Declare the job role in the process's ecosystem; a party from outside it is a `pool`. ## Examples `teller` is a job role of the bank's ecosystem, not the insurer's, so a lane of it raises KQ222: ```kanoniq process pay-claim { lane fin-bank/teller } ``` A lane of `clerk`, a job role of the insurer's own ecosystem, raises nothing: ```kanoniq process pay-claim { lane clerk } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq223.md # KQ223 — a sequence flow joins two flow nodes of one process **Error** · `sequence-flow-within-a-process` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) A then joins two flow nodes of one process, neither an external step, never into a start event or out of an end event. A `then` joins nodes of two processes, has an `external` step at either end, flows into a `start` or flows out of an `end`. An external step is reached only by `message` lines, a start event begins a path and an end event ends one. Join two nodes of the same process, in that order. ## Examples `bank/confirm` is an external step of the bank's pool, so a `then` to it raises KQ223: ```kanoniq process pay-claim { approve then bank/confirm } ``` An end event that sends the bank a message raises nothing: ```kanoniq process pay-claim { end sent "Payment sent" in handler message to bank/confirm approve then sent } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq224.md # KQ224 — a message flow joins a lane to an external party **Error** · `message-flow-reaches-a-party` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) A message flow joins a node in a lane to a pool or one of its external steps, received by a start event or a task and sent by an end event or a task. A message reaches a pool, or a pool's `external` step, of another process than the node it is written on. Only a process's own pools exchange messages with it. Name a pool of the same process, or declare one there. ## Examples A new process that receives its message from `pay-claim/claimant`, a pool of another process, raises KQ224: ```kanoniq process recover "Recover a payment" { lane handler start asked "Recovery asked" in handler message from pay-claim/claimant } ``` With a pool of its own for the claimant, it raises nothing: ```kanoniq process recover "Recover a payment" { pool claimant "Claimant" : customer lane handler start asked "Recovery asked" in handler message from claimant } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq225.md # KQ225 — a task's screen is of an application realizing its Function **Error** · `screen-of-the-tasks-function` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) A task's on names a user-facing Interface of an application that realizes the Function the task performs. A task's `on` names a screen of an application that does not realize the function the task names with `via`. The screen is where that function's work is done. Name a screen of an application realizing the function, or check the function. ## Examples The claims app does not realize `pay-out`, so a task performing it on the claims app's screen raises KQ225: ```kanoniq process pay-claim { task review "Review the claim" in handler via claims/pay/pay-out on claims-platform/claims-app/web filed then review } ``` Performing `approve`, which the claims app realizes, it raises nothing: ```kanoniq process pay-claim { task review "Review the claim" in handler via claims/assess/approve on claims-platform/claims-app/web filed then review } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq226.md # KQ226 — a task's lane holds a Role using its screen **Error** · `lane-holds-the-screen` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) A task done on a screen sits in the lane of a job role holding a Role in that screen's application that uses it. A task is done `on` a screen in the lane of a job role that holds no role in that screen's application using it: *the claims handler approves in the claims app but has no access to it.* Add a `holds` of that application's role to the job role, or move the task to the lane of a position that has the access. ## Examples The claims clerk holds no role in the claims app, so a task on its screen in the clerk's lane raises KQ226: ```kanoniq process pay-claim { lane clerk task check "Check the claim" in clerk via claims/assess/approve on claims-platform/claims-app/web filed then check } ``` Once the clerk holds the claims app's `handler` role, nothing is raised: ```kanoniq job-role clerk { holds claims-platform/claims-app/handler } process pay-claim { lane clerk task check "Check the claim" in clerk via claims/assess/approve on claims-platform/claims-app/web filed then check } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq227.md # KQ227 — a message's connections are in the model **Error** · `chain-connection-exists` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) Every connection a message flow travels over is a connection of the model. A `message` line's `over (…)` names a connection, by its two ends, that the model does not have. Write each connection as it is declared, `a -> b`, or declare the missing one. ## Examples The payer reaches the bank's ledger only through the payment hub, so a message over a direct connection from the payer to the ledger raises KQ227: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service message to bank/confirm over (claims-platform/payer -> fin-bank/ledger/payments) approve then pay } ``` Over the two connections the model has, it raises nothing: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service message to bank/confirm over (claims-platform/payer -> claims-platform/hub/api, claims-platform/hub -> fin-bank/ledger/payments) approve then pay } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq228.md # KQ228 — a message's chain is unbroken **Error** · `chain-is-unbroken` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) Each connection a message travels over starts where the one before it landed. In an `over (…)` list, a connection does not start where the one before it landed: at that element, or at the component or monolith holding the interface it landed on. List the connections in order from the sender to the receiver, with none missing between them. ## Examples The first connection lands at the payment hub and the second starts at the claims app, so the chain breaks and raises KQ228: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service message to bank/confirm over (claims-platform/payer -> claims-platform/hub/api, claims-platform/claims-app -> fin-bank/ledger/statements) approve then pay } ``` With the second connection starting at the hub, the chain is unbroken and raises nothing: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service message to bank/confirm over (claims-platform/payer -> claims-platform/hub/api, claims-platform/hub -> fin-bank/ledger/payments) approve then pay } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq229.md # KQ229 — a message's chain starts or lands at its task's systems **Error** · `chain-starts-at-its-task` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) A message a task sends starts, and one it receives lands, at one of the task's systems. A task sends a message whose chain does not start at one of its systems, or receives one whose chain does not land at one: the components and monoliths realizing its `via` function, and the application of its `on` screen. Start or end the chain there, or check the task's function. An event, and a task naming neither, is not checked. ## Examples The task's systems are the payer and the hub, which realize `pay-out`, so a message it sends over a chain starting at the claims app raises KQ229: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service message to bank/confirm over (claims-platform/claims-app -> fin-bank/ledger/statements) approve then pay } ``` A chain starting at the payer raises nothing: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service message to bank/confirm over (claims-platform/payer -> claims-platform/hub/api, claims-platform/hub -> fin-bank/ledger/payments) approve then pay } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq230.md # KQ230 — a message's chain reaches its pool's systems **Error** · `chain-reaches-the-pool` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) A message to a pool that says where its systems are lands there, and one from it starts there. A pool states where its party's systems are with `site`, and a message to it lands elsewhere, or one from it starts elsewhere. End the chain in what `site` names, or correct the pool's `site`. A pool with no `site` is not checked. ## Examples The bank's pool says its systems are in the `fin-bank` ecosystem, so a message to it whose chain stops at the payment hub raises KQ230: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service message to bank/confirm over (claims-platform/payer -> claims-platform/hub/api) approve then pay } ``` With the hub's connection to the bank's ledger added, the chain lands in the bank and raises nothing: ```kanoniq process pay-claim { task pay "Pay" in handler via claims/pay/pay-out service message to bank/confirm over (claims-platform/payer -> claims-platform/hub/api, claims-platform/hub -> fin-bank/ledger/payments) approve then pay } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq231.md # KQ231 — a process stays within the stage it details **Error** · `process-within-its-stage` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) Every Function a task performs lies under a Function Group realizing the stage its process details. A process `details` a value stream stage, and a task performs a function under none of the function groups realizing that stage. The process does work its stage does not have. Realize the stage from that function's group too, or check which stage the process details. ## Examples The process details the `settle` stage, which only the claims function groups realize, so a task performing a marketing function raises KQ231: ```kanoniq process pay-claim { task mail "Send a mailing" in handler via marketing/campaigns/send-mailing service approve then mail } ``` Once the campaigns function group realizes the stage too, nothing is raised: ```kanoniq motivation { marketing/campaigns realizes claims-stream/settle } process pay-claim { task mail "Send a mailing" in handler via marketing/campaigns/send-mailing service approve then mail } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq232.md # KQ232 — a pool is an external party **Error** · `pool-is-an-external-party` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) A pool's persona is external, and its `site` names an Ecosystem, a Platform or a monolith. A `pool` has an internal persona, `employee` or `freelancer`. A pool is a party outside the organization; the organization's own people are the process's lanes. Use a lane for them, or give the pool the persona of the outside party. ## Examples A pool with the internal persona `employee` raises KQ232: ```kanoniq process pay-claim { pool adjuster "Loss adjuster" : employee } ``` As a `b2b-representative`, an outside party, it raises nothing: ```kanoniq process pay-claim { pool adjuster "Loss adjuster" : b2b-representative } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq237.md # KQ237 — a data action names its own data **Error** · `data-in-the-nodes-data` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) Every Domain Object a data mark names is in its node's Data: a task's, of the Domains holding its Function; a start event's, of the stage its process details. A task's or a start event's `data` names a domain object the model does not say it handles. A task handles the domain objects of the domains holding the function it performs; a start event, those of the stage its process details. Name a domain object it handles, or check the task's `via` and which domain the domain object belongs to. A task naming no function, and the start of a process detailing no stage, are not checked. ## Examples `consent` belongs to the marketing domain, outside what `approve` handles, so marking it on a task performing `approve` raises KQ237: ```kanoniq process pay-claim { task check "Check the claim" in handler via claims/assess/approve on claims-platform/claims-app/web data consent filed then check } ``` Marking the claim, which the claims domain holds, raises nothing: ```kanoniq process pay-claim { task check "Check the claim" in handler via claims/assess/approve on claims-platform/claims-app/web data claim filed then check } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq238.md # KQ238 — a data action's Domain Object has one holding **Error** · `data-resolves-to-one-holding` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) Every Domain Object a data mark names is held, not as a replica, in exactly one Storage of its node's systems. A domain object a `data` mark names is held in no storage of the node's systems, or only as a copy, or in several. A task's systems are the ones realizing its function and the application of its screen; a start event's, where its message's chain lands. Hold the domain object where the work is done, or say which system does it, so exactly one holding remains. ## Examples The payment is held by the payer, not by the claims app this task is done in, so marking it raises KQ238: ```kanoniq process pay-claim { task record "Record the payment" in handler via claims/assess/approve on claims-platform/claims-app/web data payment approve then record } ``` Done by the payer, which holds the payment, it raises nothing: ```kanoniq process pay-claim { task record "Record the payment" in handler via claims/pay/pay-out service data payment approve then record } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq239.md # KQ239 — a data mark sits on a task or a receiving start event **Error** · `data-marks-a-task-or-a-receiving-start` · [Processes](https://kanoniq.extenza.dev/docs/rules.md#processes) Only a task, or a start event receiving a message over a chain, is marked data. A start event is marked `data` and receives no message `over` a chain, so no system of its own can hold what it names. Write the connections its message travels on, or mark the first task after it instead. ## Examples A start event marked `data` whose message names no chain has no system to hold the claim, so it raises KQ239: ```kanoniq process pay-claim { start reopened "Claim reopened" in handler data claim message from claimant reopened then approve } ``` With the connection the message travels on, from the portal to the claims app, it raises nothing: ```kanoniq process pay-claim { start reopened "Claim reopened" in handler data claim message from claimant over (claims-platform/portal -> claims-platform/claims-app/api) reopened then approve } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq204.md # KQ204 — conforms-to and customer-of name an upstream **Error** · `relationship-follows-the-edges` · [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) A context states conforms-to or customer-of only toward a context the edges put upstream of it. A context states `conforms-to` or `customer-of` toward a context that is downstream of it: every call, message and copy between the two runs from the context stating it. The statement belongs in the other context's block, naming this one; or, if the model is wrong, fix the integration. ## Examples Shipping calls ordering, so ordering is upstream of it, and `conforms-to` toward shipping, written in ordering, raises KQ204: ```kanoniq conforms-to services/shipping ``` Toward the catalog, which ordering calls, it raises nothing: ```kanoniq conforms-to services/catalog ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq205.md # KQ205 — a downstream conforms or is a customer **Error** · `conformist-or-customer` · [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) A context does not state both conforms-to and customer-of toward one context. A context states both `conforms-to` and `customer-of` toward one context. A downstream team either adopts its upstream's model as it is or has an upstream that plans for its needs. Keep the one that holds. ## Examples Ordering stating both `conforms-to` and `customer-of` toward the catalog raises KQ205: ```kanoniq conforms-to services/catalog customer-of services/catalog ``` Keeping the one that holds raises nothing: ```kanoniq customer-of services/catalog ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq206.md # KQ206 — a conformist does not translate **Error** · `conformist-translates-nothing` · [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) A context does not state conforms-to toward a context whose every crossing to it goes through an anticorruption layer. A context states `conforms-to` toward a context whose every crossing into it goes through an anticorruption layer: an `integration` component at its end, or `acl` on the connection. Conforming and translating are opposites. Drop `conforms-to`, or the layer if the context really takes the other's model as it is. ## Examples Ordering calls payments only through an anticorruption layer, so `conforms-to` toward payments raises KQ206: ```kanoniq conforms-to services/payments ``` Stated as `customer-of`, which a translating layer fits, it raises nothing: ```kanoniq customer-of services/payments ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq207.md # KQ207 — a relationship has an integration **Error** · `relationship-has-a-crossing` · [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) A relationship other than separate-ways joins two contexts something crosses between. A context states `conforms-to`, `customer-of`, `partnership` or `shared-kernel` toward a context it has nothing crossing with: no call, no message through a channel, no copy of the other's data. Add the integration the relationship describes, or state `separate-ways` if there is none on purpose. ## Examples Nothing crosses between ordering and loyalty, so a `partnership` between them raises KQ207: ```kanoniq partnership services/loyalty ``` Stated as `separate-ways`, it raises nothing: ```kanoniq separate-ways services/loyalty ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq208.md # KQ208 — separate ways cross nothing **Error** · `separate-ways-cross-nothing` · [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) Nothing crosses between two contexts stated separate-ways. Two contexts are stated `separate-ways`, but something crosses between them. Remove the integration, or state the relationship it really is. ## Examples Ordering calls the catalog, so `separate-ways` toward it raises KQ208: ```kanoniq separate-ways services/catalog ``` The relationship it really is raises nothing: ```kanoniq customer-of services/catalog ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq209.md # KQ209 — a symmetric relationship is stated once **Error** · `symmetric-stated-once` · [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) A partnership, a shared kernel or separate ways is stated in one of its two contexts, not both. A `partnership`, a `shared-kernel` or `separate-ways` is written in both contexts. It holds both ways, so write it once, in either, and remove the other line. ## Examples Shipping already states `partnership ordering`, so the same partnership written in ordering raises KQ209: ```kanoniq partnership services/shipping ``` A partnership with the catalog, which states none, raises nothing: ```kanoniq partnership services/catalog ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq210.md # KQ210 — a relationship joins two contexts **Error** · `relationship-between-contexts` · [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) A context relationship is written in an element marked bounded-context and names another one. A relationship is written in the block of an element not marked `bounded-context`, names one that is not, or names the context it is written in. Mark the element, write the line in the context's own block, or name the other context's marked element: the domain, platform, monolith, module or component that carries `bounded-context`, not one of its members. ## Examples `services` is the platform holding the catalog context but is not marked `bounded-context` itself, so naming it raises KQ210: ```kanoniq customer-of services ``` Naming the marked component raises nothing: ```kanoniq customer-of services/catalog ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq211.md # KQ211 — published language beside an open host **Error** · `published-language-beside-open-host` · [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) An Interface or a Channel marked published-language is marked open-host. An interface or a channel is marked `published-language` without `open-host`. A published language is offered on an open host service, so mark both, or neither. ## Examples An interface marked `published-language` without `open-host` raises KQ211: ```kanoniq component tracking "Tracking" : backend { http-api tracking-api "Tracking API" published-language } ``` Marked `open-host` as well, it raises nothing: ```kanoniq component tracking "Tracking" : backend { http-api tracking-api "Tracking API" open-host published-language } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq212.md # KQ212 — acl is not stated through an integration Component **Error** · `acl-not-on-integration` · [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) A crossing whose downstream end is an integration Component states no acl. A connection crossing into another context is marked `acl`, but the component at its downstream end is an `integration` component, which is the anticorruption layer already. Remove `acl`. ## Examples A call from an `integration` component into the catalog context marked `acl` raises KQ212: ```kanoniq component catalog-adapter "Catalog adapter" : integration catalog-adapter -> services/catalog/products-api over http acl ``` Without `acl`, the integration component is the layer, and nothing is raised: ```kanoniq component catalog-adapter "Catalog adapter" : integration catalog-adapter -> services/catalog/products-api over http ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq213.md # KQ213 — a Big Ball of Mud is a context **Error** · `big-ball-of-mud-on-a-context` · [Context map](https://kanoniq.extenza.dev/docs/rules.md#context-map) An element marked big-ball-of-mud is marked bounded-context. An element is marked `big-ball-of-mud` without `bounded-context`. Only a context can be a Big Ball of Mud: add `bounded-context` before it, or remove the mark. ## Examples Inside the ordering context, a component marked `big-ball-of-mud` without `bounded-context` raises KQ213: ```kanoniq component pricing "Pricing" : cots big-ball-of-mud ``` Without the mark, it raises nothing: ```kanoniq component pricing "Pricing" : cots ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq007.md # KQ007 — realization target **Error** · `realization-target` · [Realization](https://kanoniq.extenza.dev/docs/rules.md#realization) Only a Domain, a Function Group, a Function, a Goal, a value stream stage or an impact is realized. Something realizes an element that isn't a domain, function group, function, goal, value stream stage or impact. Point the `realizes` at the function side. ## Examples A component realizing another component, the rider app, raises KQ007: ```kanoniq platform workshop "Workshop" { component repair-log "Repair log" : backend repair-log realizes rental/rider-app } ``` Realizing the function it serves raises nothing: ```kanoniq platform workshop "Workshop" { component repair-log "Repair log" : backend repair-log realizes fleet/repair-bike } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq008.md # KQ008 — realization stays in one Ecosystem **Error** · `realization-within-ecosystem` · [Realization](https://kanoniq.extenza.dev/docs/rules.md#realization) A realization stays inside one Ecosystem. A component realizes a function in another ecosystem. An ecosystem is a privacy and security boundary, so this is never valid. If the two organizations work together, model a connection between them instead. ## Examples A component of City Bikes realizing a domain of Rail, another ecosystem, raises KQ008: ```kanoniq platform workshop "Workshop" { component repair-log "Repair log" : backend repair-log realizes rail/ticketing } ``` Realizing a function of its own ecosystem raises nothing: ```kanoniq platform workshop "Workshop" { component repair-log "Repair log" : backend repair-log realizes fleet/repair-bike } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq009.md # KQ009 — a Domain holds one altitude **Error** · `domain-holds-one-altitude` · [Realization](https://kanoniq.extenza.dev/docs/rules.md#realization) A Domain holds either sub-domains or Function Groups and Functions, never both, and a Domain with sub-domains is not realized itself. A domain holds both sub-domains and functions, or something realizes a domain that has sub-domains. Move the functions into a sub-domain, and point the realization at the sub-domain that applies. ## Examples A domain holding a sub-domain and a function side by side raises KQ009: ```kanoniq domain servicing "Servicing" { domain repairs "Repairs" function clean-bike "Clean a bike" } ``` With the function moved into a sub-domain of its own, it raises nothing: ```kanoniq domain servicing "Servicing" { domain repairs "Repairs" domain cleaning "Cleaning" { function clean-bike "Clean a bike" } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq045.md # KQ045 — a primary mark is on one realization of a Component **Error** · `primary-mark-on-a-component` · [Realization](https://kanoniq.extenza.dev/docs/rules.md#realization) Only a Component, or a monolith with nothing inside it, marks a realization primary, and on one realization at most. A component marks more than one realization `primary`, or a platform, a module or a monolith that holds components marks one. Keep the mark on the one realization into the domain the component belongs to, and remove it from anything that isn't a component or a monolith with nothing inside it. ## Examples A component marking two of its realizations `primary` raises KQ045: ```kanoniq platform workshop "Workshop" { component repair-log "Repair log" : backend repair-log realizes fleet/repair-bike primary repair-log realizes renting/unlocking primary } ``` With the mark on the one into the domain it belongs to, it raises nothing: ```kanoniq platform workshop "Workshop" { component repair-log "Repair log" : backend repair-log realizes fleet/repair-bike primary repair-log realizes renting/unlocking } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq046.md # KQ046 — a Component marks its primary Domain where it realizes into several **Error** · `primary-mark-where-several-domains` · [Realization](https://kanoniq.extenza.dev/docs/rules.md#realization) A Component that realizes into several Domains marks the realization into its own primary, and one that realizes into one Domain marks none. A component realizes into several domains and marks none of its realizations `primary`, or it marks one although all its realizations lead to one domain. In the first case, add `primary` to the realization into the domain it belongs to; in the second, remove the mark, since that one domain is its primary domain already. See [Realization](https://kanoniq.extenza.dev/docs/language/applications.md#realization). ## Examples A component realizing into two domains, `fleet` and `renting`, with no realization marked `primary` raises KQ046: ```kanoniq platform workshop "Workshop" { component repair-log "Repair log" : backend repair-log realizes fleet/repair-bike repair-log realizes renting/unlocking } ``` Marking the realization into the domain it belongs to raises nothing: ```kanoniq platform workshop "Workshop" { component repair-log "Repair log" : backend repair-log realizes fleet/repair-bike primary repair-log realizes renting/unlocking } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq101.md # KQ101 — a Platform realizes its Domain **Lint** · `platform-realizes-its-domain` · [Realization](https://kanoniq.extenza.dev/docs/rules.md#realization) A Domain Object sits in a Platform that realizes the Domain owning it. A domain object sits in a platform that doesn't realize the domain owning it. This happens legitimately during a migration. Otherwise, add the realization or move the object. ## Examples A platform holding the `fleet` domain's bike while realizing only `renting` raises KQ101: ```kanoniq platform workshop "Workshop" { object bike "Bike" : fleet component repair-log "Repair log" : backend { sql repairs-db "Repairs DB" { root bike authoritative origin } } repair-log realizes renting/unlocking } ``` Realizing the `fleet` domain that owns the bike raises nothing: ```kanoniq platform workshop "Workshop" { object bike "Bike" : fleet component repair-log "Repair log" : backend { sql repairs-db "Repairs DB" { root bike authoritative origin } } repair-log realizes fleet/repair-bike } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq104.md # KQ104 — a Component realizes something **Lint** · `component-realizes-something` · [Realization](https://kanoniq.extenza.dev/docs/rules.md#realization) A Component realizes a Domain, Function Group or Function, or sits in something that does, wherever its Ecosystem has Domains. A component realizes no domain, function group or function, and neither does the platform, monolith or module it sits in, while its ecosystem has domains. Add the realization, or place infrastructure such as a gateway in an enabling domain. An ecosystem with no domains at all is never reported: a small system doesn't need them. ## Examples In an ecosystem with domains, a component that realizes nothing raises KQ104: ```kanoniq platform workshop "Workshop" { component repair-log "Repair log" : backend } ``` Realizing the function it serves, it raises nothing: ```kanoniq platform workshop "Workshop" { component repair-log "Repair log" : backend repair-log realizes fleet/repair-bike } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq027.md # KQ027 — a module sits in a monolith **Error** · `module-sits-in-a-monolith` · [Monoliths](https://kanoniq.extenza.dev/docs/rules.md#monoliths) A Module sits in a monolith, never in a Platform or another Module. A module sits in a platform or in another module. A module is a part of a monolith: move it into one, or, in a platform, declare its components directly in the platform. `kq build` already refuses a `module` written in a `platform` block, so this is met only in a model that comes from somewhere else. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq028.md # KQ028 — an in-process call stays in its monolith **Error** · `in-process-stays-in-its-monolith` · [Monoliths](https://kanoniq.extenza.dev/docs/rules.md#monoliths) An in-process call joins two Components of one monolith. A connection over `in-process` joins something other than two components of one monolith: components of two monoliths or of a platform, or an interface, a channel or a monolith at one end. An in-process call happens inside one running system. Between systems, name the protocol (`over http`) or the broker instead. ## Examples An `in-process` call from the ERP's invoicing to the mailer, a component of the CRM platform, leaves the monolith, so it raises KQ028: ```kanoniq monolith erp { finance/invoicing -> crm-platform/mailer over in-process } ``` Named as a call over `http`, it raises nothing: ```kanoniq monolith erp { finance/invoicing -> crm-platform/mailer/messages over http } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq079.md # KQ079 — a job holds no Interface **Error** · `job-holds-no-interface` · [Jobs, robots and screens](https://kanoniq.extenza.dev/docs/rules.md#jobs-robots-and-screens) A job holds no Interface, declared or created by a connection. A `job` holds an interface, or a connection names a path under a job (`x -> my-job/api over http`), which creates nothing and is an error at the reference. Nothing calls a job. If it also serves an API, that is a second component: a `backend` beside the job, in the same `deployable` module if they ship together. ## Examples A job that holds an `http-api` raises KQ079: ```kanoniq platform crm-platform { component exports "Export contacts" : job schedule daily at 02:00 Europe/Amsterdam { http-api progress "Export progress" } } ``` With the API on a `backend` of its own beside the job, nothing is raised: ```kanoniq platform crm-platform { component exports "Export contacts" : job schedule daily at 02:00 Europe/Amsterdam component export-info "Export progress" : backend { http-api progress "Export progress" } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq080.md # KQ080 — no delivery out of a Channel lands on a job **Error** · `no-leg-lands-on-a-job` · [Jobs, robots and screens](https://kanoniq.extenza.dev/docs/rules.md#jobs-robots-and-screens) No delivery out of a Channel lands on a job. A channel delivers to a `job`. A job runs on its schedule; one woken by a message is a consumer, so make it a `backend`. ## Examples `reminders` is a job, so a delivery to it out of the `orders` channel raises KQ080: ```kanoniq platform crm-platform { events/orders -> reminders } ``` Delivered to the mailer, a `backend`, it raises nothing: ```kanoniq platform crm-platform { events/orders -> mailer } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq081.md # KQ081 — a schedule is well formed **Error** · `schedule-well-formed` · [Jobs, robots and screens](https://kanoniq.extenza.dev/docs/rules.md#jobs-robots-and-screens) A schedule names a known time zone, a time of day, a day of the month from 1 to 31, each weekday once, and a cron expression of five standard fields. A `schedule` names a time zone the IANA database does not have (write `Europe/Amsterdam` or `UTC`, not an abbreviation like `CEST`), a time outside `00:00` to `23:59`, a day of the month outside `1` to `31`, the same weekday twice, or a `cron` expression that is not five standard fields (no seconds field, no `@daily`). Fix the value the message names. `monthly on 31` is fine: the months with no 31st are the job's business. ## Examples `CEST` is an abbreviation, not a time zone of the IANA database, so this schedule raises KQ081: ```kanoniq platform crm-platform { component exports "Export contacts" : job schedule daily at 02:00 CEST } ``` With `Europe/Amsterdam`, it raises nothing: ```kanoniq platform crm-platform { component exports "Export contacts" : job schedule daily at 02:00 Europe/Amsterdam } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq082.md # KQ082 — a robot holds no Interface **Error** · `robot-holds-no-interface` · [Jobs, robots and screens](https://kanoniq.extenza.dev/docs/rules.md#jobs-robots-and-screens) A robot holds no Interface, declared or created by a connection. A `robot` holds an interface, or a connection names a path under one, which creates nothing. Nothing calls a robot: it is started by its schedule, by a queue (`rpa-queues/work -> my-robot`) or by hand. ## Examples A robot that holds an `http-api` raises KQ082: ```kanoniq monolith rpa { component filer "Filer" : robot { runs-as iam/staff-idp/staff http-api jobs "Filing jobs" } } ``` Started by a queue of the RPA product instead, it raises nothing: ```kanoniq monolith rpa { component filer "Filer" : robot { runs-as iam/staff-idp/staff } rpa-queues/requests -> filer } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq083.md # KQ083 — ui comes only from a robot or a Role **Error** · `ui-from-robot-or-role` · [Jobs, robots and screens](https://kanoniq.extenza.dev/docs/rules.md#jobs-robots-and-screens) A connection over ui comes only from a robot or a Role. A connection `over ui` comes from something other than a `robot` or a `role`. Only a robot and people use an application's screens. A service calling another one names its API and protocol instead. ## Examples The mailer is a `backend`, so its connection over `ui` to the CRM's screen raises KQ083: ```kanoniq platform crm-platform { mailer -> crm/crm-ui over ui } ``` A call to the CRM's API over `http` raises nothing: ```kanoniq platform crm-platform { mailer -> crm/crm-api over http } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq084.md # KQ084 — ui lands only on a declared user-facing Interface **Error** · `ui-lands-on-user-facing-interface` · [Jobs, robots and screens](https://kanoniq.extenza.dev/docs/rules.md#jobs-robots-and-screens) A connection over ui lands only on a declared user-facing Interface. A connection `over ui` lands on something other than a user interface (`spa`, `mobile-app`, `desktop-app`), or names one that is not declared, which `ui` never creates. Point it at the client, and declare the client where the application has none yet. ## Examples `crm-api` is an `http-api`, not a user interface, so a robot's connection to it over `ui` raises KQ084: ```kanoniq monolith rpa { reader -> crm-platform/crm/crm-api over ui } ``` Landing on `crm-ui`, the CRM's `spa`, it raises nothing: ```kanoniq monolith rpa { reader -> crm-platform/crm/crm-ui over ui } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq085.md # KQ085 — a Role's ui stays in its own application **Error** · `role-ui-in-its-application` · [Jobs, robots and screens](https://kanoniq.extenza.dev/docs/rules.md#jobs-robots-and-screens) A Role's connection over ui lands only on a user-facing Interface of the Role's own application. A `role` uses a client of another application `over ui`. A role is one application's: point the statement at a client of the role's own application, and give the people a role in the other application to use its screens. ## Examples `clerk` is a role of the ERP, so its connection over `ui` to the CRM's screen raises KQ085: ```kanoniq monolith erp { clerk -> crm-platform/crm/crm-ui over ui } ``` Using the ERP's own client, it raises nothing: ```kanoniq monolith erp { clerk -> erp-client over ui } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq111.md # KQ111 — a robot's Identity holds a Role where its ui goes **Lint** · `robot-holds-a-role-where-it-goes` · [Jobs, robots and screens](https://kanoniq.extenza.dev/docs/rules.md#jobs-robots-and-screens) Where a robot uses an application's screens, the Identity it runs as holds a Role in that application. A `robot` uses an application's screens `over ui`, but the identity it `runs-as` holds no role in that application, so nothing says it can sign in. Give the application a role of that identity's persona, or run the robot as an identity that holds one. A robot with no `runs-as` is not checked. ## Examples The CRM's only role is for staff of the staff directory, so a robot that runs as the ERP's own users and uses the CRM's screen raises KQ111: ```kanoniq monolith rpa { component filer "Filer" : robot { runs-as erp/erp-users } filer -> crm-platform/crm/crm-ui over ui } ``` Running as `staff`, which the CRM's `agent` role is for, it raises nothing: ```kanoniq monolith rpa { component filer "Filer" : robot { runs-as iam/staff-idp/staff } filer -> crm-platform/crm/crm-ui over ui } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq022.md # KQ022 — a connection names its target **Error** · `connection-names-its-target` · [Connections](https://kanoniq.extenza.dev/docs/rules.md#connections) · Quick fix in VS Code A connection lands on an Interface or a Channel, not on a Component or monolith, unless it is in-process. A connection lands on a component or a monolith, and isn't a delivery out of a channel, a call over `in-process` or a `ui` statement. Name the interface (`b/api over http`) or go through a channel (`over events/orders`). In VS Code, where the component holds exactly one interface of the protocol's kind, the quick fix names it for you. ## Examples In a platform where `order-service` holds an `http-api` named `orders-api`, this connection lands on the component itself, so it raises KQ022: ```kanoniq web-shop -> order-service over http ``` Naming the interface it uses raises nothing: ```kanoniq web-shop -> order-service/orders-api over http ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq023.md # KQ023 — protocol matches the Interface **Error** · `protocol-matches-interface` · [Connections](https://kanoniq.extenza.dev/docs/rules.md#connections) A connection's protocol matches the kind of Interface it lands on, and no call lands on a user interface. The protocol doesn't match the interface it lands on: `http` must land on an `http-api`, `grpc` on a `grpc-api`, `graphql` on a `graphql-api`, `web-socket` on a `web-socket-api`, `signal-r` on a `signal-r-hub`, `ipc` on an `ipc-api`, `email` on a `mail-api`, `snmp` on an `snmp-api`, `ldap` on an `ldap-api`. A user interface receives no calls: only a robot or a role reaches one, `over ui`. Fix the protocol or the declared interface's kind. ## Examples `orders-api` is an `http-api`, so a call to it over `grpc` raises KQ023: ```kanoniq web-shop -> order-service/orders-api over grpc ``` A call over `http` matches its kind and raises nothing: ```kanoniq web-shop -> order-service/orders-api over http ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq024.md # KQ024 — a Channel is reached through its broker **Error** · `channel-through-broker` · [Connections](https://kanoniq.extenza.dev/docs/rules.md#connections) · Quick fix in VS Code A Channel is reached through its broker with no protocol, an Interface always with one, and no connection joins two Channels. A connection to or from a channel carries a protocol, a connection to an interface carries none, or a connection joins two channels. Write `over http` only to an interface, and a broker path only for a channel. In VS Code, the quick fix removes a protocol written to a channel, and adds the one an interface's kind implies, `http` for an `http-api`. ## Examples `events/orders` is a channel, whose transport is its broker's, so a protocol on a connection to it raises KQ024: ```kanoniq order-service -> events/orders over http ``` The same connection with no protocol raises nothing: ```kanoniq order-service -> events/orders ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq102.md # KQ102 — a Channel has both sides **Lint** · `channel-has-both-sides` · [Connections](https://kanoniq.extenza.dev/docs/rules.md#connections) A Channel has both a sender and a receiver. A channel has a sender and no receiver, or the reverse. Fine when the other party is outside the model. Otherwise, check the spelling: `over events/ordres` quietly creates a new channel. ## Examples This connection sends to a channel, `events/audit`, that nothing receives from, so it raises KQ102: ```kanoniq order-service -> events/audit ``` With a receiver as well, the channel has both sides and raises nothing: ```kanoniq order-service -> events/audit events/audit -> billing ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq121.md # KQ121 — an Interface's version is called **Lint** · `interface-version-is-called` · [Connections](https://kanoniq.extenza.dev/docs/rules.md#connections) Some call names each version of a software-facing Interface. No call names a version of a software-facing interface. Nothing in the model calls it, so it can be retired, or a caller is missing. A version no call names any more is one a later plateau can remove with `-v1`. ## Examples This interface declares two versions and its one call names `v2`, so `v1` raises KQ121: ```kanoniq component pricing "Pricing" : backend { http-api prices-api "Prices API" { v1 v2 } } web-shop -> pricing/prices-api v2 over http ``` A second caller of `v1` leaves no version uncalled and raises nothing: ```kanoniq component pricing "Pricing" : backend { http-api prices-api "Prices API" { v1 v2 } } web-shop -> pricing/prices-api v2 over http order-service -> pricing/prices-api v1 over http ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq248.md # KQ248 — only a software-facing Interface has a contract **Error** · `contract-on-a-software-interface` · [Connections](https://kanoniq.extenza.dev/docs/rules.md#connections) A user-facing Interface states no schema and no versions. A `spa`, a `mobile-app` or a `desktop-app` states a `schema` or version lines. A person reaches a user interface through its screens, so it has no contract to link and no version a caller names. Remove them, and put them on the software-facing interface of the component behind it, its BFF. ## Examples An `spa` is a user interface, so a `schema` on it raises KQ248: ```kanoniq spa admin "Admin console" schema "https://example.com/admin/openapi.yaml" ``` Without the schema it raises nothing: ```kanoniq spa admin "Admin console" ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq249.md # KQ249 — a call names a declared version **Error** · `call-version-is-declared` · [Connections](https://kanoniq.extenza.dev/docs/rules.md#connections) A call names a version its Interface declares, calls a versioned Interface with its version, and an unversioned one with none. A call names a version its interface doesn't declare, calls an interface that has versions without one, or calls an interface without versions with one. Write the version the caller calls after the target, `checkout -> orders/api v2 over http/json`, one the interface declares, and call an interface without versions with none. An interface a call created has no versions until you declare it. A call's version is independent of the versions of what it `carries`. ## Examples In a platform where `catalog/products-api` declares `v1` and `v2`, a call to `v3` raises KQ249: ```kanoniq web-shop -> catalog/products-api v3 over http ``` A call to a version it declares raises nothing: ```kanoniq web-shop -> catalog/products-api v2 over http ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq097.md # KQ097 — a delivery carries what is published **Error** · `delivered-is-published` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) A delivery out of a Channel carries only events, and versions of them, that a leg into that Channel carries. A connection out of a channel `carries` an event, or a version of one, that no connection into that channel carries. A subscriber reads what is published, so name the event on its publisher's leg into the channel too, with the same version, or drop it from the delivery. ## Examples In a shop where only `billing` publishes `invoice-sent`, and only on `events/invoices`, a delivery out of `events/orders` that carries it raises KQ097: ```kanoniq events/orders -> shipping carries billing/invoice-sent ``` Carrying an event that the order service publishes on `events/orders` raises nothing: ```kanoniq events/orders -> shipping carries order-service/order-placed v2 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq098.md # KQ098 — a publishing leg carries its publisher's events **Error** · `publisher-carries-its-own` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) A leg into a Channel carries only events its sending Component declares. A connection into a channel `carries` an event another component declares. An event belongs to the component that publishes it, so a leg into a channel carries only the sender's own. Declare the event in the sender, or name it on the publisher's own leg. ## Examples `order-cancelled` is declared by the order service, so billing publishing it on `events/orders` raises KQ098: ```kanoniq billing -> events/orders carries order-service/order-cancelled ``` Publishing its own event, `invoice-sent`, raises nothing: ```kanoniq billing -> events/orders carries invoice-sent ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq099.md # KQ099 — a carried event names a declared version **Error** · `event-version-is-declared` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) A leg names a version an event declares, names a versioned event with its version, and an unversioned event with none. A `carries` list, on a connection or a sync, names a version the event doesn't declare, names an event that has versions without one, or names an event without versions with one. Write `order-placed v2` for a versioned event, once per version a leg carries, and `order-cancelled` for one with no versions. ## Examples In a shop where `order-placed` declares `v1` and `v2`, a delivery that carries `v3` raises KQ099: ```kanoniq events/orders -> shipping carries order-service/order-placed v3 ``` Naming a version it declares raises nothing: ```kanoniq events/orders -> shipping carries order-service/order-placed v2 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq114.md # KQ114 — a publisher holds what its event is about **Lint** · `publisher-holds-its-object` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) The Component publishing an event holds a Data Entity of the Domain Object the event is about. The component that publishes an event holds no data entity of the domain object the event is about. A publisher usually says what happened to data it keeps. Add the entity to one of its storages, or check that the event is declared in the right component. ## Examples The shipping service holds no data, so an event it publishes about the order raises KQ114: ```kanoniq component shipping { event order-shipped "Order shipped" about order } shipping -> billing over events/shipments carries order-shipped ``` Once it keeps a copy of the order, it holds what its event is about and raises nothing: ```kanoniq component shipping { event order-shipped "Order shipped" about order sql shipping-db "Shipping DB" { root order from order-service over events/orders carries order-service/order-placed v2 identifier "Order Id" } } shipping -> billing over events/shipments carries order-shipped ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq115.md # KQ115 — an event is delivered **Lint** · `event-is-delivered` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) Some delivery out of a Channel or some sync carries each event, and each version of one. No connection out of a channel and no sync `carries` an event, or one of its versions. Nothing in the model consumes it, so it can be retired, or a subscriber is missing. A version no delivery carries any more is one a later plateau can remove with `-v1`. ## Examples An event that no delivery carries raises KQ115: ```kanoniq component order-service { event order-shipped "Order shipped" about order } ``` With a subscriber that receives it, nothing is raised: ```kanoniq component order-service { event order-shipped "Order shipped" about order } order-service -> shipping over events/orders carries order-shipped ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq116.md # KQ116 — a handler holds what its command or query is about **Lint** · `handler-holds-its-object` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) The Component handling a command or a query holds a Data Entity of the Domain Object it is about. As [KQ114](https://kanoniq.extenza.dev/docs/rules/kq114.md), for a command or a query and the component that handles it. ## Examples The billing service holds no orders, so a command about the order that it handles raises KQ116: ```kanoniq component billing { command cancel-order "Cancel order" about order } shipping -> billing/invoices-api over http carries cancel-order ``` Declared in the order service, which holds the orders, it raises nothing: ```kanoniq component order-service { command cancel-order "Cancel order" about order } shipping -> order-service/orders-api over http carries cancel-order ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq117.md # KQ117 — a command or a query is carried **Lint** · `command-is-carried` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) Some connection or some sync carries each command and query, and each version of one. No connection or sync `carries` a command or a query, or one of its versions. Nothing in the model asks for it, so it can be retired, or a sender is missing. ## Examples A query that no connection carries raises KQ117: ```kanoniq component billing { query invoice-total "Invoice total" about invoice } ``` With a call that carries it, nothing is raised: ```kanoniq component billing { query invoice-total "Invoice total" about invoice } shipping -> billing/invoices-api over http carries invoice-total ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq200.md # KQ200 — an event is about a Domain Object **Error** · `event-is-about-a-domain-object` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) What an event is about is a Domain Object. An event's `about` names something other than a domain object, such as a function or a component. An event says what happened to some data, so name the domain object it is about: bare where it is declared in the publisher's own platform, by its path elsewhere. ## Examples An event about `shipping`, a component, raises KQ200: ```kanoniq component order-service { event order-shipped "Order shipped" about shipping } order-service -> shipping over events/orders carries order-shipped ``` About the order, a domain object, it raises nothing: ```kanoniq component order-service { event order-shipped "Order shipped" about order } order-service -> shipping over events/orders carries order-shipped ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq201.md # KQ201 — a command or a query reaches its handler **Error** · `handler-declares-it` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) A call or a delivery carries only commands and queries the Component it reaches declares, and a leg into a Channel only those some Component declares. A call, a delivery out of a channel or an `in-process` call `carries` a command or a query that the component it reaches doesn't declare. A command or a query belongs to the one component that handles it. Send it to that component, or declare it there. ## Examples In a shop where `send-invoice` is declared by the billing service, a call to the order service that carries it raises KQ201: ```kanoniq shipping -> order-service/orders-api over http carries billing/send-invoice ``` Sent to the billing service, its handler, it raises nothing: ```kanoniq shipping -> billing/invoices-api over http carries send-invoice ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq202.md # KQ202 — a carried command or query names a declared version **Error** · `command-version-is-declared` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) A connection names a version a command or a query declares, names a versioned one with its version, and an unversioned one with none. As [KQ099](https://kanoniq.extenza.dev/docs/rules/kq099.md), for a command or a query on any connection or sync: name a versioned one with a version it declares, and an unversioned one without. ## Examples In a shop where `send-invoice` declares no versions, a call that carries it as `v2` raises KQ202: ```kanoniq shipping -> billing/invoices-api over http carries send-invoice v2 ``` Named bare, it raises nothing: ```kanoniq shipping -> billing/invoices-api over http carries send-invoice ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq203.md # KQ203 — a command or a query is about a Domain Object **Error** · `command-is-about-a-domain-object` · [Events, commands and queries](https://kanoniq.extenza.dev/docs/rules.md#events-commands-and-queries) What a command or a query is about is a Domain Object. As [KQ200](https://kanoniq.extenza.dev/docs/rules/kq200.md), for a command or a query: name the domain object it is about. ## Examples A query about `order-service`, a component, raises KQ203: ```kanoniq component billing { query amount-due "Amount due" about order-service } shipping -> billing/invoices-api over http carries amount-due ``` About the invoice, a domain object, it raises nothing: ```kanoniq component billing { query amount-due "Amount due" about invoice } shipping -> billing/invoices-api over http carries amount-due ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq240.md # KQ240 — a scenario's connections are in the model **Error** · `scenario-connection-exists` · [Scenarios](https://kanoniq.extenza.dev/docs/rules.md#scenarios) Every connection a scenario's step walks over, and both legs of a hop through a Channel, is a connection of the model. A `step` names a connection, by its two ends, that the model does not have; on a hop through a channel, either leg. Write each step as its connection is declared, `a -> b/api` or `a -> b`, or declare the missing connection. When the connection goes at a later plateau, restate the scenario in that plateau's block without the step, or remove it with `-`. ## Examples The payer reaches the bank's ledger only through the payment hub, so a step from the payer straight to the ledger raises KQ240: ```kanoniq scenario pay "Pay a claim" { step claims-platform/payer -> fin-bank/ledger/payments } ``` Walking over the two connections the model has raises nothing: ```kanoniq scenario pay "Pay a claim" { step claims-platform/payer -> claims-platform/hub/api step claims-platform/hub -> fin-bank/ledger/payments } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq241.md # KQ241 — a scenario's walk is unbroken **Error** · `scenario-walk-is-unbroken` · [Scenarios](https://kanoniq.extenza.dev/docs/rules.md#scenarios) Each step of a scenario starts where the scenario starts or where an earlier step arrived. A step starts somewhere the walk has not been: neither where the first step starts nor where an earlier step arrived. A call arrives at the component or monolith holding the interface it lands on; an `in-process` call or a hop, at the component it reaches. Start the step there, or add the step that gets the walk to it first. ## Examples The walk reaches the payment hub, and its second step starts at the claims app, so it raises KQ241: ```kanoniq scenario pay "Pay a claim" { step claims-platform/payer -> claims-platform/hub/api step claims-platform/claims-app -> fin-bank/ledger/statements } ``` A second step starting at the hub raises nothing: ```kanoniq scenario pay "Pay a claim" { step claims-platform/payer -> claims-platform/hub/api step claims-platform/hub -> fin-bank/ledger/payments } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq242.md # KQ242 — a scenario's step names a message its connection carries **Error** · `scenario-message-is-carried` · [Scenarios](https://kanoniq.extenza.dev/docs/rules.md#scenarios) A step's message is carried by its connection, or by both legs of a hop, under a version the message declares. A step's `carries` names a message its connection does not carry, or on a hop one that either leg does not; or names its version wrongly. Add the message to the connection's `carries`, with the same version, or name one the connection carries. A versioned message is named with its version, `carries order-placed v2`, and an unversioned one without. ## Examples The payer's call to the hub carries `send-payment`, so a step naming `cancel-payment` raises KQ242: ```kanoniq scenario pay "Pay a claim" { step claims-platform/payer -> claims-platform/hub/api carries cancel-payment } ``` Naming the message the connection carries raises nothing: ```kanoniq scenario pay "Pay a claim" { step claims-platform/payer -> claims-platform/hub/api carries send-payment } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq243.md # KQ243 — a scenario starts at its task's screen or systems **Error** · `scenario-starts-at-its-task` · [Scenarios](https://kanoniq.extenza.dev/docs/rules.md#scenarios) A scenario for a task starts at the task's screen or at one of its systems. A scenario written `for` a task starts somewhere other than the task's `on` screen or one of its systems: the components and monoliths realizing its `via` function, and the application of its screen. Start the scenario there, or check which task it is for. A task naming neither a function nor a screen is not checked. ## Examples The `approve` task is done on the claims app's screen, so a scenario for it that starts at the payer raises KQ243: ```kanoniq scenario pay "Pay a claim" for pay-claim/approve { step claims-platform/payer -> claims-platform/hub/api } ``` Starting at the claims app raises nothing: ```kanoniq scenario pay "Pay a claim" for pay-claim/approve { step claims-platform/claims-app -> claims-platform/payer/payouts step claims-platform/payer -> claims-platform/hub/api } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq244.md # KQ244 — a scenario sits in the Ecosystem where it starts **Error** · `scenario-in-its-ecosystem` · [Scenarios](https://kanoniq.extenza.dev/docs/rules.md#scenarios) A scenario sits directly in the Ecosystem of its first step's source. A scenario sits in another ecosystem than the one its first step starts in. Move it into that ecosystem's block, or `scenarios.kq` beside it. ## Examples This scenario sits in the insurer's ecosystem and its first step starts at the bank's ledger, so it raises KQ244: ```kanoniq scenario confirm "Confirm a payment" { step fin-bank/ledger -> claims-platform/hub/api } ``` A walk that starts at the payment hub, in the insurer's ecosystem, raises nothing: ```kanoniq scenario confirm "Confirm a payment" { step claims-platform/hub -> fin-bank/ledger/payments step fin-bank/ledger -> claims-platform/hub/api } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq245.md # KQ245 — a scenario is for a task of a process **Error** · `scenario-for-names-a-task` · [Scenarios](https://kanoniq.extenza.dev/docs/rules.md#scenarios) What a scenario is for is a task, a user task or a service task of a process. A scenario's `for` names something other than a `task` of a process, such as a `start`, an `end` or a gateway. Name the task the scenario carries out, or drop `for`. ## Examples `filed` is the process's start event, not a task, so a scenario for it raises KQ245: ```kanoniq scenario approve "Approve a claim" for pay-claim/filed { step claims-platform/claims-app -> claims-platform/payer/payouts } ``` For the `approve` task, it raises nothing: ```kanoniq scenario approve "Approve a claim" for pay-claim/approve { step claims-platform/claims-app -> claims-platform/payer/payouts } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq010.md # KQ010 — representation cardinality **Error** · `representation-cardinality` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) Every Data Entity holds exactly one Domain Object. A data entity doesn't hold exactly one domain object. Each entity line names one domain object. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq011.md # KQ011 — authoritative cardinality **Error** · `authoritative-cardinality` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) Every Domain Object has exactly one authoritative holding across the whole model. A domain object has no `authoritative` holding, or more than one, across the whole model. Mark the system of record `authoritative`, and only that one. ## Examples The order service already holds the authoritative orders, so a second `authoritative` holding in the billing service raises KQ011: ```kanoniq component billing { sql billing-db "Billing DB" { root order authoritative } } ``` A copy synced from the order service raises nothing: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over events/orders carries order-service/order-placed } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq012.md # KQ012 — a replica has a source **Error** · `replica-has-a-source` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A replica syncs from the authoritative holding or from another replica, never from a transient one. A `from` names a holding that can't be a source, such as a `transient` one. Sync from the authoritative holding or from another replica. ## Examples The billing service keeps a `transient` basket of orders, so a returns service that copies the orders from it raises KQ012: ```kanoniq component billing { sql basket "Basket" { root order transient } } component returns "Returns" : backend { sql returns-db "Returns DB" { root order from billing over http } } returns realizes selling ``` Copying them from the order service, which holds the authoritative orders, raises nothing: ```kanoniq component returns "Returns" : backend { sql returns-db "Returns DB" { root order from order-service over http } } returns realizes selling ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq013.md # KQ013 — transient is local **Error** · `transient-is-local` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A transient holding neither syncs in nor syncs out. A `transient` holding syncs from another holding. Either drop `transient`, or drop the sync. A sync out of a transient holding is [KQ012](https://kanoniq.extenza.dev/docs/rules/kq012.md)'s, reported on the sync. ## Examples A `transient` holding that syncs from the order service raises KQ013: ```kanoniq component billing { sql billing-db "Billing DB" { root order transient from order-service over events/orders carries order-service/order-placed } } ``` The same holding without `transient` is a replica and raises nothing: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over events/orders carries order-service/order-placed } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq014.md # KQ014 — structure stays local **Error** · `structure-stays-local` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) part of and references stay inside one Component. A `part of` or `references` crosses into another component. Across systems there is no foreign key; the link is that both components hold the same domain object. Keep `part of` and `references` inside one component; a `references` between two storages of the same component is fine. ## Examples In a model where `order-line` is `part of order` in the order service's storage, a plateau that moves the order line entity alone into billing's storage makes the `part of` cross into another component, and raises KQ014: ```kanoniq plateau to-be "To be" after as-is { move shop/commerce/order-service/orders-db/order-line to shop/commerce/billing/billing-db/order-line } ``` Moving the whole orders storage into billing keeps the order and its lines together, and raises nothing: ```kanoniq plateau to-be "To be" after as-is { move shop/commerce/order-service/orders-db to shop/commerce/billing/orders-db } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq015.md # KQ015 — no orphan entity **Error** · `no-orphan-entity` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) Every Data Entity is a root or part of another. A data entity is neither `root` nor `part of` another. Mark it `root`, or say what it is part of. ## Examples An `invoice` entity that is neither `root` nor `part of` another raises KQ015: ```kanoniq object invoice "Invoice" : selling component billing { sql billing-db "Billing DB" { invoice authoritative origin } } ``` Marked `root`, it raises nothing: ```kanoniq object invoice "Invoice" : selling component billing { sql billing-db "Billing DB" { root invoice authoritative origin } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq016.md # KQ016 — part of is a tree **Error** · `part-of-is-a-tree` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) part of forms a tree: each Data Entity is part of at most one other, with no circle. `part of` goes round in a circle, or gives an entity two wholes. Each entity is part of at most one other. ## Examples An invoice and an invoice line that are each `part of` the other go round in a circle, so they raise KQ016: ```kanoniq object invoice "Invoice" : selling object invoice-line "Invoice line" : selling component billing { sql billing-db "Billing DB" { invoice part of invoice-line [1] authoritative origin invoice-line part of invoice [1..*] authoritative origin } } ``` With the invoice as the root, the tree has one whole and raises nothing: ```kanoniq object invoice "Invoice" : selling object invoice-line "Invoice line" : selling component billing { sql billing-db "Billing DB" { root invoice authoritative origin invoice-line part of invoice [1..*] authoritative origin } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq021.md # KQ021 — a Domain Object has an origin **Error** · `domain-object-has-an-origin` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) Every Domain Object has a holding marked origin, where the data is first created. No holding of a domain object is marked `origin`, including the case where nothing holds it at all. Mark where the data is first created `origin`. ## Examples No holding of the `invoice` object is marked `origin`, so it raises KQ021: ```kanoniq object invoice "Invoice" : selling component billing { sql billing-db "Billing DB" { root invoice authoritative } } ``` Marking where invoices are created `origin` raises nothing: ```kanoniq object invoice "Invoice" : selling component billing { sql billing-db "Billing DB" { root invoice authoritative origin } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq118.md # KQ118 — a sync carries messages about its entity **Lint** · `sync-carries-its-object` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A message a sync carries is about the Domain Object its replica represents. A sync `carries` an event, a command or a query `about` another domain object than the one its replica holds. Sometimes that is right, an order event carrying the customer's details; more often the wrong message is named, or the copy belongs in another entity. Name the message about the entity's own domain object, or move the sync to the entity it keeps. ## Examples A copy of the shopper kept by `order-placed`, an event about the order, raises KQ118: ```kanoniq component billing { sql billing-db "Billing DB" { root shopper from order-service over events/orders carries order-service/order-placed } } ``` Kept by `shopper-moved`, an event about the shopper, it raises nothing: ```kanoniq component billing { sql billing-db "Billing DB" { root shopper from order-service over events/orders carries order-service/shopper-moved } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq124.md # KQ124 — a Domain Object with a property marked personal states its personal data **Lint** · `personal-object-states-personal-data` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A Domain Object one of whose Data Entities marks a property personal states personal-data, personal or special-category. A data entity marks a property `personal`, and its domain object states no `personal-data`. The mark says the holding keeps personal data, and a record of processing reads the concept, not the mark. State `personal-data personal`, or `special-category`, on the domain object. ## Examples The rota's holding marks the staff member's email `personal`, and the staff member states no `personal-data`, so it raises KQ124: ```kanoniq object staff "Staff member" : care component rota "Rota" : backend { sql rota-db "Rota DB" { root staff authoritative origin identifier "Staff Id" property "Email" personal } } ``` The staff member stating `personal-data personal` raises nothing: ```kanoniq object staff "Staff member" : care personal-data personal component rota "Rota" : backend { sql rota-db "Rota DB" { root staff authoritative origin identifier "Staff Id" property "Email" personal } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq126.md # KQ126 — a Domain Object a data use names states its personal data **Lint** · `data-use-object-states-personal-data` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A Domain Object a data use names states personal-data, personal or special-category. A data use names a domain object that states no `personal-data`. A record of processing reads the category of data from the domain object, and this one says nothing. State `personal-data personal`, or `special-category`, on the domain object. ## Examples Running payroll names the payslip, which states no `personal-data`, so it raises KQ126: ```kanoniq platform finance "Finance" { object payslip "Payslip" : people component payroll-system "Payroll system" : backend { sql payroll-db "Payroll DB" { root payslip authoritative origin identifier "Payslip Id" } } payroll-system realizes people/pay } data-use payroll "Run payroll" via people/pay basis contract subjects employee data payslip ``` The payslip stating `personal-data personal` raises nothing: ```kanoniq platform finance "Finance" { object payslip "Payslip" : people personal-data personal component payroll-system "Payroll system" : backend { sql payroll-db "Payroll DB" { root payslip authoritative origin identifier "Payslip Id" } } payroll-system realizes people/pay } data-use payroll "Run payroll" via people/pay basis contract subjects employee data payslip ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq127.md # KQ127 — personal data is held for a stated purpose **Lint** · `personal-data-has-a-use` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) In an Ecosystem with a data use, every Data Entity of personal or special-category data is a holding or a copy of a data use. In an ecosystem that states at least one data use, a data entity of `personal` or `special-category` data is neither a holding nor a copy of any data use: personal data held for no stated purpose. A copy counts as covered wherever it is. An ecosystem with no data use is not checked. Name the domain object in the data use it is processed for, through a `via` whose systems hold the entity, or remove the data the ecosystem holds for no purpose. ## Examples Running payroll is the company's only data use, so the absence records its HR system holds are special-category data held for no stated purpose, and it raises KQ127: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract, legal-obligation subjects employee, freelancer data employee-record, salary ``` A second data use, recording sick leave, naming the absence records raises nothing: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract, legal-obligation subjects employee, freelancer data employee-record, salary data-use sick-leave "Record sick leave" via people/absence basis legal-obligation special employment subjects employee data absence-record ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq128.md # KQ128 — a data use states its legal basis **Lint** · `data-use-has-a-basis` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A data use states its basis, one of GDPR Art. 6(1)'s lawful bases. A data use states no `basis`. Every processing of personal data rests on one of GDPR Art. 6(1)'s lawful bases, and a record of processing has a column for it. Add `basis` and the lawful basis, such as `basis contract`. ## Examples Running payroll states no `basis`, so it raises KQ128: ```kanoniq data-use payroll "Run payroll" via people/pay subjects employee data employee-record ``` Stating `basis contract` raises nothing: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract subjects employee data employee-record ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq137.md # KQ137 — personal data leaves a transfer regime on a ground **Lint** · `transfer-has-a-ground` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) Personal data a call, a leg, a sync or a holding's own hop moves out of a residency stating adequate, to a country outside that list, goes where a contract covering what receives it states a transfer ground. Personal data leaves a residency your repository makes a transfer regime, by stating its `adequate` list, for a country outside that list, and no contract covering where it goes states a `transfer` ground. A call from a component in the Netherlands to a SaaS in the United States is reported until the SaaS's contract states one, such as `transfer scc`. State the ground on the contract that covers the receiving element or what it runs on. A transfer that relies on an Art. 49 derogation, which is occasional, is this finding suppressed with its justification. The lint runs only for a residency that states `adequate`. ## Examples The analytics component runs on a host in New York and keeps a copy of the customer, so personal data leaves the EEA for the United States, which isn't on its `adequate` list, and with no contract stating a ground it raises KQ137: ```kanoniq component analytics "Analytics" : backend { environment PRD x1 on us-vm sql facts "Facts" { root buyer from customers over http auth client-credentials } } ``` On a host in London instead, the copy goes to the United Kingdom, which is on the list, and raises nothing: ```kanoniq component analytics "Analytics" : backend { environment PRD x1 on uk-vm sql facts "Facts" { root buyer from customers over http auth client-credentials } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq138.md # KQ138 — personal data does not leave a transfer regime for a place not stated **Lint** · `transfer-is-placed` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) Personal data moved from inside a residency stating adequate goes to a place whose country is stated. Personal data moves from a place inside a transfer regime to a place whose country isn't stated, so nothing says whether it leaves the regime. An unstated place is never a pass. State where the receiving element runs: a `location` or a `country` on a SaaS, or on the host or platform it's deployed on. A pair unstated on both sides isn't reported, so a model that states no location stays quiet. The lint runs only for a residency that states `adequate`. ## Examples The analytics component keeps a copy of the customer but states no environment, so nothing says where the copy is held, and personal data leaving the Netherlands for a place not stated raises KQ138: ```kanoniq component analytics "Analytics" : backend { sql facts "Facts" { root buyer from customers over http auth client-credentials } } ``` Deployed on a host in London, the copy's place is stated, and it raises nothing: ```kanoniq component analytics "Analytics" : backend { environment PRD x1 on uk-vm sql facts "Facts" { root buyer from customers over http auth client-credentials } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq214.md # KQ214 — a synced event is its source's **Error** · `sync-event-is-the-sources` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A sync carries only events its source Component declares. A sync `carries` an event its source component doesn't declare. A copy kept by events is kept by its source publishing them, so name an event the source publishes, by its path: `from crm over events/customers carries crm/customer-changed v2`. ## Examples A copy of the orders kept by `invoiced`, an event of the billing service rather than of the order service it syncs from, raises KQ214: ```kanoniq component billing { event invoiced "Invoiced" about order sql billing-db "Billing DB" { root order from order-service over http carries billing/invoiced } } ``` Kept by `order-placed`, the order service's own event, it raises nothing: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over events/orders carries order-service/order-placed } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq215.md # KQ215 — a synced command is its holder's **Error** · `sync-command-is-the-holders` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A sync carries only commands the Component holding the replica declares. A sync `carries` a command the component holding the replica doesn't declare. A copy kept by commands is written by the source calling the holder, so the command is the holder's own: declare it there, or name the one it declares. ## Examples A copy kept by `cancel-order`, a command of the order service rather than of the billing service that holds the copy, raises KQ215: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over http carries order-service/cancel-order } } ``` Kept by a command the billing service declares, it raises nothing: ```kanoniq component billing { command record-order "Record order" about order sql billing-db "Billing DB" { root order from order-service over http carries billing/record-order } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq216.md # KQ216 — a synced query is its source's **Error** · `sync-query-is-the-sources` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A sync carries only queries its source Component declares. A sync `carries` a query its source component doesn't declare. A copy kept by queries is pulled by the holder from the source, so the query is one the source handles: name it by the source's path, or declare it there. ## Examples A copy kept by `invoices-since`, a query of the billing service rather than of the order service it pulls from, raises KQ216: ```kanoniq component billing { query invoices-since "Invoices since" about order sql billing-db "Billing DB" { root order from order-service over http carries billing/invoices-since } } ``` Kept by `orders-since`, the order service's own query, it raises nothing: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over http carries order-service/orders-since } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq217.md # KQ217 — a pulled sync goes over a protocol **Error** · `pulled-sync-over-a-protocol` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A sync carrying a query goes over a protocol, never through a Channel. A sync through a channel `carries` a query. A pulled copy is asked for by the holder and answered by the source, which a channel's one-way connections don't say. Write the sync over a protocol, `from catalog over http carries catalog/products-since`, or carry the source's events instead. ## Examples A copy of the orders pulled by `orders-since`, a query, through the `events/orders` channel raises KQ217: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over events/orders carries order-service/orders-since } } ``` Pulled over `http`, it raises nothing: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over http carries order-service/orders-since } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq218.md # KQ218 — a sync carries messages or one mechanism **Error** · `messages-or-one-mechanism` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A sync carries messages or one mechanism, never both, and never two mechanisms. A sync's `carries` names both messages and a mechanism, or two mechanisms. A copy kept two ways is two syncs: keep one, and write the other on its own line under the entity, marked `reconcile`. ## Examples A sync that carries an event and the `file` mechanism at once raises KQ218: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over events/orders carries order-service/order-placed, file } } ``` Carrying the event alone, it raises nothing: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over events/orders carries order-service/order-placed } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq219.md # KQ219 — an entity's syncs have one main feed **Error** · `one-main-feed` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) Of the syncs into an entity, exactly one is not marked reconcile. Of the syncs into an entity, none or more than one is left unmarked. Exactly one is the main feed; mark every other `reconcile`. A single sync marked `reconcile` reconciles nothing: remove the mark. ## Examples Two syncs into one entity, neither marked `reconcile`, raise KQ219: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over events/orders carries order-service/order-placed from order-service over http carries order-service/orders-since } } ``` With the second marked `reconcile`, there is one main feed and nothing is raised: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over events/orders carries order-service/order-placed from order-service over http carries order-service/orders-since reconcile } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq220.md # KQ220 — two syncs into one entity differ **Error** · `syncs-differ` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) No two syncs into one entity have the same source, the same route and the same carries. Two syncs into one entity come from the same component over the same route and carry the same thing, so they say it twice, usually a copy left behind. Remove one, or say what tells them apart. ## Examples Two syncs into one entity from the same source, over the same route and carrying the same event, raise KQ220: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over events/orders carries order-service/order-placed from order-service over events/orders carries order-service/order-placed reconcile } } ``` With the second pulling by a query over `http`, they differ and raise nothing: ```kanoniq component billing { sql billing-db "Billing DB" { root order from order-service over events/orders carries order-service/order-placed from order-service over http carries order-service/orders-since reconcile } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq246.md # KQ246 — an access stays in its monolith **Error** · `access-stays-in-its-monolith` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) An access joins a Component of a monolith to a data entity in a Storage the same monolith holds itself. A `reads` or `writes` line joins something other than a component of a monolith and a data entity in a storage that same monolith holds itself: its source is in a platform, or its target sits in a storage a component holds, in another monolith, or nowhere. A monolith's components share its own database; anything else is reached through its owner. Call the component that holds the data (`over in-process` inside the monolith, a protocol outside it), or move the storage up into the monolith's block. In a plateau that moves the entity into a component's storage, remove the access there and call the new owner instead. ## Examples In a model where the ERP monolith holds the orders in its own database, `erp-db`, the billing service, which is not one of the ERP's components, reading them raises KQ246: ```kanoniq billing reads erp/erp-db/order ``` The ERP's own `invoicing` component reading them raises nothing: ```kanoniq erp/invoicing reads erp/erp-db/order ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq247.md # KQ247 — an access names an aggregate **Error** · `access-names-an-aggregate` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) An access names the root of an aggregate, or a data entity in no aggregate, never a part. A `reads` or `writes` line names a data entity that is `part of` another. An access names the aggregate by its root and covers every part of it. Name the root instead. ## Examples In `erp-db`, the order line is `part of` the order, so an access to the line raises KQ247: ```kanoniq erp/invoicing reads erp/erp-db/order-line ``` An access to the order, the root, covers its lines and raises nothing: ```kanoniq erp/invoicing reads erp/erp-db/order ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq275.md # KQ275 — a confidentiality is one of the repository's levels **Error** · `confidentiality-is-a-level` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A Domain Object's confidentiality is one of the levels the repository's confidentiality-levels setting lists. A domain object's `confidentiality` is a level the repository doesn't list in `confidentiality-levels`, by default `public`, `internal`, `confidential` and `restricted`. A level nobody listed can't be ordered or recognized. Use one of the repository's levels, or add yours to `kanoniq.repository.json` in its place in the order, least sensitive first. ## Examples The price list states `confidentiality secret`, a level the default repository doesn't list, so it raises KQ275: ```kanoniq object price-list "Price list" : sales/selling confidentiality secret component pricing "Pricing" : backend { sql prices-db "Prices DB" { root price-list authoritative origin identifier "Price list Id" } } ``` The price list stating `restricted`, one of the default levels, raises nothing: ```kanoniq object price-list "Price list" : sales/selling confidentiality restricted component pricing "Pricing" : backend { sql prices-db "Prices DB" { root price-list authoritative origin identifier "Price list Id" } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq276.md # KQ276 — no property is personal on data that is not personal **Error** · `personal-on-a-none-object` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) No property is marked personal on a Data Entity of a Domain Object stated personal-data none. A data entity marks a property `personal` while its domain object states `personal-data none`. The concept says it identifies nobody and the holding says it does, so one is wrong. State `personal` or `special-category` on the domain object, or remove the mark. ## Examples The rota's holding marks the staff member's email `personal`, while the staff member states `personal-data none`, so it raises KQ276: ```kanoniq object staff "Staff member" : care personal-data none component rota "Rota" : backend { sql rota-db "Rota DB" { root staff authoritative origin identifier "Staff Id" property "Email" personal } } ``` The staff member stating `personal-data personal` instead raises nothing: ```kanoniq object staff "Staff member" : care personal-data personal component rota "Rota" : backend { sql rota-db "Rota DB" { root staff authoritative origin identifier "Staff Id" property "Email" personal } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq277.md # KQ277 — a data use names personal data **Error** · `data-use-names-personal-data` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) No Domain Object a data use names is stated personal-data none. A data use names a domain object stated `personal-data none`. A data use is a purpose for processing personal data, and the domain object says it identifies nobody, so one of the two is wrong. Remove the domain object from the data use's `data`, or state `personal` or `special-category` on it. ## Examples Running payroll names the grade, which states `personal-data none`, so it raises KQ277: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract subjects employee data employee-record, grade ``` Naming only the employee record, which is personal data, raises nothing: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract subjects employee data employee-record ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq278.md # KQ278 — a data use's data is held in its systems **Error** · `data-use-data-is-held` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) Every Domain Object a data use names is represented by a Data Entity in a Storage of a system realizing what its via names. A data use names a domain object that no data entity in a storage of its systems represents. Its systems are the systems realizing what its `via` names, and none of them holds the data. Point `via` at the work whose systems hold the data, add the holding to one of those systems, or remove the domain object from `data`. ## Examples Setting pay rises names the appraisal, but its `via` names only the pay work, whose HR system doesn't hold appraisals, so it raises KQ278: ```kanoniq data-use pay-rise "Set pay rises" via people/pay basis contract subjects employee data employee-record, appraisal ``` Adding the review work, whose review system holds the appraisals, to `via` raises nothing: ```kanoniq data-use pay-rise "Set pay rises" via people/pay, people/review basis contract subjects employee data employee-record, appraisal ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq279.md # KQ279 — special-category data has a condition **Error** · `special-data-has-a-condition` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A data use naming special-category data states special, the condition it is processed under. A data use names a domain object stated `special-category` and states no `special`. Special-category data may be processed only under one of GDPR Art. 9(2)'s conditions, or Art. 10's authorization by law, on top of a lawful basis. Add `special` and the condition, such as `special employment`. ## Examples Recording sick leave names the absence record, which is special-category data, and states no `special`, so it raises KQ279: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract, legal-obligation subjects employee, freelancer data employee-record, salary data-use sick-leave "Record sick leave" via people/absence basis legal-obligation subjects employee data absence-record ``` Stating `special employment`, the condition sick leave is recorded under, raises nothing: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract, legal-obligation subjects employee, freelancer data employee-record, salary data-use sick-leave "Record sick leave" via people/absence basis legal-obligation special employment subjects employee data absence-record ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq280.md # KQ280 — a condition goes with special-category data **Error** · `condition-has-special-data` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A data use states special only where it names special-category data. A data use states `special` and names no domain object stated `special-category`. A condition of Art. 9(2) is for special-category data only, so either it isn't needed or the data is classified too low. Remove `special`, or state `special-category` on the domain object it covers. ## Examples Running payroll states `special employment`, and the employee record it names is personal but not special-category data, so it raises KQ280: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract special employment subjects employee data employee-record ``` Without `special` it raises nothing: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract subjects employee data employee-record ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq281.md # KQ281 — a data use covers its own Ecosystem's work **Error** · `data-use-via-stays-home` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) What a data use's via names is in the data use's own Ecosystem. A data use's `via` names a domain, a function group or a function of another ecosystem. A system realizes only its own ecosystem's functions, and the ecosystem is the data use's controller, so the work is never its. Name the work in the data use's own ecosystem, or write the data use in the other ecosystem. ## Examples Running payroll names the payroll bureau's domain in its `via`, work of another ecosystem, so it raises KQ281: ```kanoniq data-use payroll "Run payroll" via people/pay, bureau/payroll basis contract subjects employee data employee-record ``` Naming only the company's own pay work, with the bureau as a joint controller, raises nothing: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract subjects employee data employee-record joint bureau ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq282.md # KQ282 — a joint controller is another Ecosystem **Error** · `joint-is-another-ecosystem` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A data use's joint names other Ecosystems, never its own. A data use's `joint` names its own ecosystem. The ecosystem is already the data use's controller; `joint` names the other ecosystems that decide the purpose with it. Remove the data use's own ecosystem from `joint`. ## Examples Running payroll names the company, its own ecosystem, in `joint`, so it raises KQ282: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract subjects employee data employee-record joint company ``` Naming the payroll bureau, which decides the purpose with it, raises nothing: ```kanoniq data-use payroll "Run payroll" via people/pay basis contract subjects employee data employee-record joint bureau ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq297.md # KQ297 — a regulated scope is one the repository lists **Error** · `regulated-scope-is-listed` · [Data](https://kanoniq.extenza.dev/docs/rules.md#data) A Domain Object's or a significant property's regulated scope is one the repository's regulated-scopes setting lists. A domain object's `regulated`, or a significant property's, names a scope your repository's `regulated-scopes` setting doesn't list, so no policy can select it. Add the scope to `regulated-scopes` in `kanoniq.repository.json`, or correct the word. A `scope` or `connected-to` clause in a policy naming such a scope is [KQ074](https://kanoniq.extenza.dev/docs/rules/kq074.md)'s. ## Examples In a repository whose `regulated-scopes` lists only `pci`, a card regulated in `pci-dss` raises KQ297: ```kanoniq object card "Card" : cards confidentiality restricted personal-data personal regulated pci-dss component checkout "Checkout" : backend { sql cards-db "Cards DB" { root card authoritative origin identifier "Card Id" } } ``` The card regulated in `pci`, the scope the repository lists, raises nothing: ```kanoniq object card "Card" : cards confidentiality restricted personal-data personal regulated pci component checkout "Checkout" : backend { sql cards-db "Cards DB" { root card authoritative origin identifier "Card Id" } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq060.md # KQ060 — a scheme its transport accepts **Error** · `scheme-fits-transport` · [Authentication](https://kanoniq.extenza.dev/docs/rules.md#authentication) A connection's authentication scheme is one its protocol or broker accepts. The `auth` scheme isn't one the transport accepts: `snmp` takes only `key`, `ldap` no token issued by an identity provider other than `kerberos`, and no broker carries a user's token, so `user-token` and `on-behalf-of` never go on a leg. On a call or a sync the protocol decides, on a leg the broker's kind, or for a file handoff its channel's kind. An `in-process` call takes no scheme at all, since there is nobody to authenticate to, and nor does a call over `ipc`. Pick a scheme from the transport's list on the [Authentication](https://kanoniq.extenza.dev/docs/language/identity-and-access.md#authentication) page, or drop `auth`. ## Examples A broker carries no user's token, so `user-token` on the leg into `events/transfers` raises KQ060: ```kanoniq platform banking { accounts -> payments over events/transfers sender-auth user-token } ``` `workload-identity`, which `kafka` accepts, raises nothing: ```kanoniq platform banking { accounts -> payments over events/transfers sender-auth workload-identity } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq061.md # KQ061 — via only on a token scheme **Error** · `via-on-token-scheme` · [Authentication](https://kanoniq.extenza.dev/docs/rules.md#authentication) via goes only with a scheme whose token someone issues. `via` names who issues a token, and `none`, `key` and `certificate` are no token anyone issues. Remove `via`, or state the token scheme the caller really uses, such as `client-credentials`. ## Examples A `key` is no token anyone issues, so `via` after it raises KQ061: ```kanoniq platform banking { payments -> accounts/accounts-api over http auth key via iam/entra } ``` Without `via`, it raises nothing: ```kanoniq platform banking { payments -> accounts/accounts-api over http auth key } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq062.md # KQ062 — via names an Identity Provider **Error** · `via-names-identity-provider` · [Authentication](https://kanoniq.extenza.dev/docs/rules.md#authentication) via names an Identity Provider: a Component or monolith marked idp. What `via` names is not marked `idp`. Name the component or monolith that issues the token, or mark the one you named with `idp` after its kind if it is an identity provider. ## Examples A `via` that names `accounts`, which is not marked `idp`, raises KQ062: ```kanoniq platform banking { payments -> accounts/accounts-api over http auth client-credentials via accounts } ``` Naming the staff directory, which issues the token, it raises nothing: ```kanoniq platform banking { payments -> accounts/accounts-api over http auth client-credentials via iam/entra } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq063.md # KQ063 — a leg states one scheme **Error** · `leg-states-one-scheme` · [Authentication](https://kanoniq.extenza.dev/docs/rules.md#authentication) Two statements of one leg into or out of a Channel state the same scheme. Two statements mean the same leg into or out of a channel, and they state different schemes for it: the broker idiom's `sender-auth` and a half-leg's `auth`, say. A leg is one component's credential at the broker, so it has one scheme. Make the two agree, or state the scheme on one of them only. ## Examples Two statements of the payments service's leg out of `events/transfers` that state `key` and `client-credentials` raise KQ063: ```kanoniq platform banking { accounts -> payments over events/transfers receiver-auth key events/transfers -> payments auth client-credentials } ``` Stating the same scheme on both raises nothing: ```kanoniq platform banking { accounts -> payments over events/transfers receiver-auth key events/transfers -> payments auth key } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq040.md # KQ040 — a Role is in a user-facing application **Error** · `role-in-user-facing-application` · [People](https://kanoniq.extenza.dev/docs/rules.md#people) A Role sits in a Component or monolith that holds a user interface of its own. A `role` sits in a component or a monolith that holds no user interface (`spa`, `mobile-app`, `desktop-app`) of its own. A role is the capacity in which people use an application through its screens. Move the role into the component or monolith that holds the user interface, its BFF where it has one. ## Examples `accounts` is a backend with no user interface of its own, so a role in it raises KQ040: ```kanoniq platform banking { component accounts { role payer "Payer" in iam/customer-idp : customer } } ``` In the online banking app, whose screens its customers use, the role raises nothing: ```kanoniq platform banking { component web-app { role payer "Payer" in iam/customer-idp : customer } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq041.md # KQ041 — a Role names an Identity Provider **Error** · `role-names-identity-provider` · [People](https://kanoniq.extenza.dev/docs/rules.md#people) A Role names an Identity Provider: a Component or monolith marked idp. What a role names after `in` is not marked `idp`. Name the component or monolith that holds the accounts, or mark the one you named with `idp` after its kind if it is an identity provider. ## Examples A role whose `in` names `accounts`, which is not marked `idp`, raises KQ041: ```kanoniq platform banking { component web-app { role payer "Payer" in accounts : customer } } ``` Naming the customer identity provider, it raises nothing: ```kanoniq platform banking { component web-app { role payer "Payer" in iam/customer-idp : customer } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq042.md # KQ042 — a Role has holders **Error** · `role-has-holders` · [People](https://kanoniq.extenza.dev/docs/rules.md#people) A Role's Identity Provider holds an Identity of the Role's persona, so someone can hold the Role. A role's identity provider holds no `identity` of the role's persona, so nobody could hold the role. Add an identity of that persona to the provider, or give the role the persona of the accounts that do use it. ## Examples The customer identity provider holds only customers, so a role in it for business representatives raises KQ042: ```kanoniq platform banking { component web-app { role payer "Payer" in iam/customer-idp : b2b-representative } } ``` A role of the persona its provider's accounts have raises nothing: ```kanoniq platform banking { component web-app { role payer "Payer" in iam/customer-idp : customer } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq043.md # KQ043 — an Identity is in an Identity Provider **Error** · `identity-in-identity-provider` · [People](https://kanoniq.extenza.dev/docs/rules.md#people) An Identity sits in a Component or monolith marked idp. An `identity` sits in a component or a monolith not marked `idp`. Mark it `idp` after its kind if it keeps accounts, or move the identity into the one that does. ## Examples An identity in a component not marked `idp` raises KQ043: ```kanoniq platform banking { component ledger "Ledger" : cots { identity operators "Operators" : employee } } ``` Marked `idp`, the component keeps accounts and raises nothing: ```kanoniq platform banking { component ledger "Ledger" : cots idp { identity operators "Operators" : employee } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq071.md # KQ071 — a Role is never in an anonymous application **Error** · `no-role-in-anonymous-application` · [People](https://kanoniq.extenza.dev/docs/rules.md#people) A Component or monolith marked anonymous holds no Role. A `role` sits in a component or monolith marked `anonymous`, which says nobody signs into it. If people do sign in, remove `anonymous`; if nobody does, remove the role. ## Examples A role in an application marked `anonymous` raises KQ071: ```kanoniq platform banking { component loans "Loans" : user-facing-app anonymous { spa loans-ui "Loans" role applicant "Applicant" in iam/customer-idp : customer } } ``` Without the mark, since people do sign in, it raises nothing: ```kanoniq platform banking { component loans "Loans" : user-facing-app { spa loans-ui "Loans" role applicant "Applicant" in iam/customer-idp : customer } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq072.md # KQ072 — anonymous marks a user-facing application **Error** · `anonymous-is-user-facing` · [People](https://kanoniq.extenza.dev/docs/rules.md#people) Only a Component or monolith that holds a user interface of its own is marked anonymous. A component or monolith marked `anonymous` holds no user interface (`spa`, `mobile-app`, `desktop-app`) of its own. Only an application people use directly is used with or without an account: move the mark to the one that holds the user interface, or remove it. ## Examples A backend with no user interface marked `anonymous` raises KQ072: ```kanoniq platform banking { component rates "Rates" : backend anonymous { http-api rates-api "Rates API" } } ``` Without the mark it raises nothing: ```kanoniq platform banking { component rates "Rates" : backend { http-api rates-api "Rates API" } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq073.md # KQ073 — an Identity Provider is never anonymous **Error** · `anonymous-is-no-provider` · [People](https://kanoniq.extenza.dev/docs/rules.md#people) An Identity Provider is never marked anonymous. A component or monolith is marked both `idp` and `anonymous`. An identity provider keeps accounts, so remove one of the two. ## Examples An application marked both `idp` and `anonymous` raises KQ073: ```kanoniq platform banking { component kiosk "Kiosk" : user-facing-app idp anonymous { spa kiosk-ui "Kiosk" } } ``` Marked `anonymous` only, it raises nothing: ```kanoniq platform banking { component kiosk "Kiosk" : user-facing-app anonymous { spa kiosk-ui "Kiosk" } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq120.md # KQ120 — an internal Role is held by a job role **Lint** · `internal-role-held-by-a-position` · [People](https://kanoniq.extenza.dev/docs/rules.md#people) In an Ecosystem with job roles, every Role of an internal persona in its applications and its Identity Providers is held by a job role. In an ecosystem that declares at least one `job-role`, a role of an internal persona (`employee` or `freelancer`), in one of the ecosystem's applications and naming one of its identity providers, that no job role `holds`. It is access no position explains, which is what an access review asks about. Add a `holds` to the job role whose people use it, or remove the role if nobody should. An ecosystem with no job role is never reported, nor a role naming another ecosystem's provider. ## Examples In a bank whose only job role, `teller`, holds the cashier role, a new staff role in the branch app raises KQ120: ```kanoniq platform banking { component branch-app { role manager "Branch manager" in iam/entra : employee } } ``` A job role that holds it raises nothing: ```kanoniq job-role manager "Branch manager" : employee { holds banking/branch-app/manager } platform banking { component branch-app { role manager "Branch manager" in iam/entra : employee } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq233.md # KQ233 — a job role's persona is internal **Error** · `job-role-is-internal` · [People](https://kanoniq.extenza.dev/docs/rules.md#people) A job role's persona is an employee or a freelancer. A `job-role` has an external persona: `customer`, `b2b-representative` or `auditor`. A position in the organization is filled by an `employee` or a `freelancer`. Give it one of those; a customer or a partner taking part in a process is a `pool` of that process instead. ## Examples A job role of an external persona raises KQ233: ```kanoniq job-role advisor "Mortgage advisor" : b2b-representative ``` Filled by freelancers, it raises nothing: ```kanoniq job-role advisor "Mortgage advisor" : freelancer ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq234.md # KQ234 — a held Role is of the job role's persona **Error** · `held-role-of-its-persona` · [People](https://kanoniq.extenza.dev/docs/rules.md#people) A job role holds only Roles of its own persona. A job role `holds` a role of another persona than its own, such as an `employee` position holding a `customer` role. A role's holders are the accounts of its persona, so nobody in that position could hold it. Hold the role of the right persona, or check the job role's persona. ## Examples An `employee` job role that holds `account-holder`, a `customer` role, raises KQ234: ```kanoniq job-role advisor "Advisor" : employee { holds banking/web-app/account-holder } ``` Holding the cashier role, an `employee` one, it raises nothing: ```kanoniq job-role advisor "Advisor" : employee { holds banking/branch-app/cashier } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq064.md # KQ064 — a workload identity names an Identity Provider **Error** · `workload-identity-names-identity-provider` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) A workload identity names an Identity Provider: a Component or monolith marked idp. What a workload identity names after `in` is not marked `idp`. Name the component or monolith that issues its tokens, or mark the one you named with `idp` after its kind. ## Examples A workload identity whose `in` names `accounts`, which is not marked `idp`, raises KQ064: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : client in accounts { credential managed } } } ``` In the staff directory, it raises nothing: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : client in iam/entra { credential managed } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq065.md # KQ065 — a role sits in a server workload identity **Error** · `permission-in-server` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) App roles and scopes are declared in a server workload identity, never a client one. An `app-role` or a `scope` is written in a client workload identity. Roles belong to the API that declares them: move it into the server workload identity, and grant it to the client with `grant`. ## Examples An `app-role` in a client workload identity raises KQ065: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : client in iam/entra { app-role read "Cards.Read" } } } ``` In a server workload identity, it raises nothing: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : server in iam/entra { app-role read "Cards.Read" } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq066.md # KQ066 — a credential sits on a client workload identity **Error** · `credential-on-client` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) Only a client workload identity states a credential. A server workload identity states a `credential`. Only a client signs in; if the service also calls others, give it a client workload identity of its own for that. ## Examples A `credential` on a server workload identity raises KQ066: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : server in iam/entra { credential managed } } } ``` Without it, the server workload identity raises nothing: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : server in iam/entra } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq067.md # KQ067 — stored-in names a vault **Error** · `stored-in-vault` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) A credential is stored in a vault element. What a credential is `stored-in` is not a vault. Name the `vault` that keeps it, an element of its own (see [Writing infrastructure](https://kanoniq.extenza.dev/docs/language/technology.md#writing-infrastructure)), not a component. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq068.md # KQ068 — a federated credential names its issuer **Error** · `federated-from-identity-provider` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) A federated credential comes from an Identity Provider: a Component marked idp. What a `federated` credential is `from` is not marked `idp`. Name the component that issues the outside token, such as your CI system's token issuer, and mark it `idp`. ## Examples A `federated` credential from a CI system not marked `idp` raises KQ068: ```kanoniq platform banking { component ci "CI" : saas technology "GitHub Actions" component cards "Cards" : backend { workload cards-id "Cards" : client in iam/entra { credential federated from ci subject "repo:bank/cards:environment:PRD" } } } ``` With the CI system marked `idp`, as the issuer of the token it trusts, nothing is raised: ```kanoniq platform banking { component ci "CI" : saas idp technology "GitHub Actions" component cards "Cards" : backend { workload cards-id "Cards" : client in iam/entra { credential federated from ci subject "repo:bank/cards:environment:PRD" } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq069.md # KQ069 — a scheme the caller's credential carries **Error** · `scheme-fits-credential` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) A call's authentication scheme is one the caller's credential can produce. The call states a scheme the caller's credential can't produce: a `managed` identity only gives `workload-identity`, a `secret` gives `client-credentials`, `key` or `on-behalf-of`, a `certificate` gives `client-credentials`, `certificate` or `on-behalf-of`, a `federated` credential gives `workload-identity`, `client-credentials` or `on-behalf-of`. Fix the call's `auth` or the workload identity's `credential`. A service never signs in with a user flow of its own. ## Examples The payments service signs in with a secret, which gives no `workload-identity`, so its call with that scheme raises KQ069: ```kanoniq platform banking { payments -> accounts/accounts-api over http auth workload-identity via iam/entra } ``` `client-credentials`, which a secret gives, raises nothing: ```kanoniq platform banking { payments -> accounts/accounts-api over http auth client-credentials via iam/entra } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq070.md # KQ070 — on-behalf-of rests on a scope **Error** · `on-behalf-of-rests-on-scope` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) A call on behalf of a user rests on a delegated scope granted on the API it calls. A call `auth on-behalf-of` holds only app roles on the API it calls. On behalf of a user, the API checks a delegated `scope`: declare one in its server workload identity and grant it, `grant read` on the call. ## Examples In a bank where the accounts API declares the app role `read` and the scope `act`, an `on-behalf-of` call granted only `read` raises KQ070: ```kanoniq platform banking { payments -> accounts/accounts-api over http auth on-behalf-of via iam/entra grant read } ``` Granted the scope `act`, it raises nothing: ```kanoniq platform banking { payments -> accounts/accounts-api over http auth on-behalf-of via iam/entra grant act } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq106.md # KQ106 — a Component holds one kind of workload identity **Lint** · `client-and-server-in-one` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) A Component holds a client or a server workload identity, not both. A component holds both a client and a server workload identity. That is right for an API that also calls others; check it isn't one identity written twice. ## Examples A component holding both a client and a server workload identity raises KQ106: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-api "Cards API" : server in iam/entra workload cards-app "Cards" : client in iam/entra { credential managed } } } ``` With the one it signs in as, it raises nothing: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-app "Cards" : client in iam/entra { credential managed } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq107.md # KQ107 — a workload identity is one workload's, in one environment **Lint** · `workload-identity-shared` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) A workload identity is the identity of one Component, in one Environment. A workload identity is the identity of several components, or registered in several environments. Every grant then reaches all of them; give each its own, one per environment, unless sharing is deliberate. ## Examples A cards service that `runs-as` the payments service's workload identity shares it with payments, so it raises KQ107: ```kanoniq platform banking { component cards "Cards" : backend { runs-as payments/payments-id } } ``` With a workload identity of its own, it raises nothing: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : client in iam/entra { credential managed } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq108.md # KQ108 — people and workloads do not share an identity **Lint** · `person-and-workload-share` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) Components do not run as people's accounts, and people do not sign in as a service. A component `runs-as` people's accounts, or people sign in as a service with `used-by`. Both happen; both are worth a second look, which is why `used-by` takes a reason. A `robot` running as an employee's or a freelancer's identity is not reported: acting for an employee is what a robot does. One running as a customer's, a partner's or an external auditor's is. ## Examples A service that `runs-as` the staff's identity raises KQ108: ```kanoniq platform banking { component cards "Cards" : backend { runs-as iam/entra/staff } } ``` With a workload identity of its own, it raises nothing: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : client in iam/entra { credential managed } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq109.md # KQ109 — a grant has a call behind it **Lint** · `over-grant` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) A client is granted a role only on an API it calls. A client is granted a role on an API that nothing it is the identity of calls. Remove the grant, or model the call it is for. A role the cloud defines on a resource, such as a deployment right, is never reported. ## Examples A client granted `read` on the accounts API, which it never calls, raises KQ109: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : client in iam/entra { credential managed grant accounts/accounts-id/read } } } ``` With the call the grant is for, it raises nothing: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : client in iam/entra { credential managed } } cards -> accounts/accounts-api over http auth workload-identity via iam/entra grant read } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq110.md # KQ110 — a credential is read from its vault **Lint** · `secret-read-from-vault` · [Workload identity](https://kanoniq.extenza.dev/docs/rules.md#workload-identity) A credential is stored in a vault the service connects to. A credential is stored in a vault the service never connects to, so nothing shows how it reads it. Add the call to the vault, or say where the secret really is. ## Examples A secret stored in the `secrets` vault, which the cards service never connects to, raises KQ110: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : client in iam/entra { credential secret stored-in iam/secrets rotate P90D } } } ``` With the call that reads it, nothing is raised: ```kanoniq platform banking { component cards "Cards" : backend { workload cards-id "Cards" : client in iam/entra { credential secret stored-in iam/secrets rotate P90D } } cards -> iam/secrets over http } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq029.md # KQ029 — an environment line names a stage **Error** · `environment-line-names-a-stage` · [Environments and database servers](https://kanoniq.extenza.dev/docs/rules.md#environments-and-database-servers) An environment line names a stage its Ecosystem declares and sits on something that runs on its own. An `environment` names something that is not a stage the ecosystem declares, or sits on something that doesn't run on its own: a platform, a `grouping` module, an API. Name a stage from the ecosystem's `environments` line, and put the `environment` on the component, deployable module, monolith, broker, user interface, database server or other piece of infrastructure that runs, such as a host, a network or a gateway, or on a workload identity, which is registered in one environment. `kq build` already refuses most of these in a `.kq` file. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq030.md # KQ030 — a client's environment line has no count **Error** · `client-environment-has-no-count` · [Environments and database servers](https://kanoniq.extenza.dev/docs/rules.md#environments-and-database-servers) · Quick fix in VS Code A user interface's environment line states no number of instances; the device it runs on is a host that states its count. A user interface states a number of instances. It runs on each user's device, so write `environment PRD` with no count. In VS Code, the quick fix removes the count. Devices your organization places and counts, such as ATMs, are a `host` of kind `device`, which states the count, `environment PRD x2400`; the client deployed `on` it states none. ## Examples A user interface states a count of instances on its `environment` line, so it raises KQ030: ```kanoniq platform storefront { component order-service { spa admin "Admin console" { environment PRD x2 } } } ``` With the stage alone, since it runs on each user's device, it raises nothing: ```kanoniq platform storefront { component order-service { spa admin "Admin console" { environment PRD } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq031.md # KQ031 — a replica is in its primary's environment **Error** · `replica-in-its-primarys-environment` · [Environments and database servers](https://kanoniq.extenza.dev/docs/rules.md#environments-and-database-servers) A database server replica is of a database server in its own Environment. A database server is a replica of a server in another environment, or of something that is not a database server. A failover pair runs in one environment: point the replica at the primary in its own. ## Examples In a shop whose `sql-prd` server runs in `PRD`, a replica of it in `DEV` raises KQ031: ```kanoniq db-server sql-standby "Orders SQL standby" : azure.sql-database environment DEV x1 replica of sql-prd failover ``` A replica in the primary's own stage raises nothing: ```kanoniq db-server sql-standby "Orders SQL standby" : azure.sql-database environment PRD x1 replica of sql-prd failover ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq032.md # KQ032 — a Storage is on a database server **Error** · `storage-on-a-database-server` · [Environments and database servers](https://kanoniq.extenza.dev/docs/rules.md#environments-and-database-servers) A Storage is hosted on a database server or a storage account, if on anything. A storage is said to be hosted on something that is neither a database server nor a storage account. Met only in a model that comes from somewhere else. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq086.md # KQ086 — an environment line states its count **Error** · `environment-line-states-its-count` · [Environments and database servers](https://kanoniq.extenza.dev/docs/rules.md#environments-and-database-servers) The environment line of a part that runs, other than a client, a workload identity, a network, a DNS record or a certificate, states its number of instances. The `environment` of a component, deployable module, monolith, broker, database server, host, app platform or gateway says where it runs but not how many instances. Add the count after the stage, written with an `x`: `environment PRD x2`. Only a user interface, a workload identity, a network, a DNS record and a certificate state none. ## Examples This component's `environment` line names the stage and no count of instances, so it raises KQ086: ```kanoniq platform storefront { component billing "Billing" : backend { environment PRD } } ``` With the count after the stage, it raises nothing: ```kanoniq platform storefront { component billing "Billing" : backend { environment PRD x2 } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq087.md # KQ087 — a held Component runs where its holder runs **Error** · `held-component-in-its-holders-stages` · [Environments and database servers](https://kanoniq.extenza.dev/docs/rules.md#environments-and-database-servers) A Component or deployable module held by one that states environments states only stages its holder states. A component inside a deployable module or a monolith names a stage its holder doesn't run in. It can't run where what holds it doesn't. Remove that `environment`, add the stage to the holder, or leave the component's `environment` out so it runs wherever its holder does. ## Examples The ERP runs in `PRD` only, so a component in it that states `DEV` raises KQ087: ```kanoniq monolith erp "ERP" : cots { environment PRD x1 component invoicing "Invoicing" : backend { environment DEV x1 } } ``` Left without an `environment` of its own, the component runs wherever the ERP does and raises nothing: ```kanoniq monolith erp "ERP" : cots { environment PRD x1 component invoicing "Invoicing" : backend } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq088.md # KQ088 — a client runs where its backend runs **Error** · `client-in-its-backends-stages` · [Environments and database servers](https://kanoniq.extenza.dev/docs/rules.md#environments-and-database-servers) A user interface declared in its backend Component states only stages that Component runs in. A user interface declared in its backend component names a stage the backend doesn't run in. Add that stage to the backend, or remove it from the client. ## Examples In a platform where `order-service` runs in `PRD` only, a user interface in it that states `DEV` raises KQ088: ```kanoniq platform storefront { component order-service { spa admin "Admin console" { environment DEV } } } ``` Stating the stage its backend runs in raises nothing: ```kanoniq platform storefront { component order-service { spa admin "Admin console" { environment PRD } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq089.md # KQ089 — a Storage is hosted where its owner runs **Error** · `storage-hosted-where-its-owner-runs` · [Environments and database servers](https://kanoniq.extenza.dev/docs/rules.md#environments-and-database-servers) A database server hosting a Storage runs only in stages the Storage's owner runs in. A storage is `on` a database server in a stage its owning component doesn't run in. A server holds the data of what runs beside it: give the component an `environment` in that stage, or host the storage on the server of a stage it runs in. ## Examples The `sql-prd` server runs in `PRD`, so a storage on it whose component runs only in `DEV` raises KQ089: ```kanoniq platform storefront { component billing "Billing" : backend { environment DEV x1 sql billing-db "Billing DB" on sql-prd } } ``` With the component running in `PRD` as well, it raises nothing: ```kanoniq platform storefront { component billing "Billing" : backend { environment DEV x1 environment PRD x2 sql billing-db "Billing DB" on sql-prd } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq122.md # KQ122 — a private endpoint has a private DNS record **Lint** · `private-endpoint-has-private-dns` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) A provider-run service reached in a network by a private endpoint has a private DNS record pointing at it, unless its provider resolves the name itself. A provider-run service of a product word is `in `, reached there by a private endpoint, and no `dns` record in a private zone points at it, so its name doesn't resolve to the endpoint. Add the record, such as `dns kv "kv-prd.vault.azure.net" : azure.private-dns in spoke-prd -> kv-prd environment PRD`. A product whose provider resolves the name itself, or that is placed in the network rather than reached by an endpoint, is not reported. ## Examples A key vault reached in `spoke-prd` by a private endpoint, with no private DNS record pointing at it, raises KQ122: ```kanoniq vault kv-orders "Orders vault" : azure.key-vault in spoke-prd environment PRD x1 ``` With a record in a private zone in that network pointing at it, it raises nothing: ```kanoniq vault kv-orders "Orders vault" : azure.key-vault in spoke-prd environment PRD x1 dns kv-dns "kv-orders.vault.azure.net" : azure.private-dns in spoke-prd -> kv-orders environment PRD ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq250.md # KQ250 — a network-only product is in a network **Error** · `network-only-in-a-network` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) A provider-run service of a product that cannot be public states the network it is in. A product that can't be public at all, such as `aws.elasti-cache` or `aws.efs`, states no `in `. Add the network it is reachable in. ## Examples An `aws.elasti-cache` server cannot be public, so one that states no network raises KQ250: ```kanoniq db-server cache "Cache" : aws.elasti-cache environment PRD x1 ``` Placed `in` a network, it raises nothing: ```kanoniq db-server cache "Cache" : aws.elasti-cache in spoke-prd environment PRD x1 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq251.md # KQ251 — a product's required parts are named **Error** · `required-part-named` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) Every part a product word requires is named: its network with in, its storage account with uses, its origin with forwards-to, its certificate by served-by. A product word needs a part the model doesn't name, and the message says which: a network, named with `in`; a storage account, named with `uses`, as an `azure.functions` platform needs; an origin, named with `forwards-to`; or a certificate whose `served-by` names it. Add it. ## Examples An `azure.functions` app needs a storage account, so one that `uses` none raises KQ251: ```kanoniq app-platform functions "Functions" : azure.functions environment PRD x1 ``` Naming the storage account it uses raises nothing: ```kanoniq storage-account st-functions "Functions storage" : azure.storage-account environment PRD x1 app-platform functions "Functions" : azure.functions environment PRD x1 uses st-functions ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq252.md # KQ252 — a call's gateway publishes its target **Error** · `via-gateway-publishes` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) The gateway a call goes via publishes the Interface the call lands on, unless it is a NAT the call leaves by. A call goes `via` a gateway that doesn't publish the interface the call lands on. Add the interface to the gateway's `publishes`, or name the gateway that does. A call that leaves through a `nat` gateway is not reported. ## Examples In a shop where `apim` publishes the orders API and `admin-gw` the admin API, a call to the admin API via `apim` raises KQ252: ```kanoniq platform storefront { web-shop -> order-service/admin-api over http via apim } ``` Through the gateway that publishes it, the call raises nothing: ```kanoniq platform storefront { web-shop -> order-service/admin-api over http via admin-gw } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq253.md # KQ253 — a Storage's pool is in its server **Error** · `pool-in-its-server` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) The pool a Storage names is inside the database server it is hosted on. A storage names a pool of another database server than the one it is `on`. Name a pool of its own server, or put the storage on the server that holds the pool. ## Examples A storage `on` the `sql-prd` server that names the pool of another server raises KQ253: ```kanoniq db-server sql-reports "Reports SQL" : azure.sql-database environment PRD x1 { pool reports "Reports pool" } platform storefront { component order-service { sql order-history "Order history" on sql-prd pool sql-reports/reports } } ``` Put on the server that holds the pool, it raises nothing: ```kanoniq db-server sql-reports "Reports SQL" : azure.sql-database environment PRD x1 { pool reports "Reports pool" } platform storefront { component order-service { sql order-history "Order history" on sql-reports pool reports } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq254.md # KQ254 — a vault holds what is stored in it **Error** · `vault-holds-what-is-stored` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) A credential or a certificate is stored in a vault whose kind holds secrets or certificates. A secret or a certificate is `stored-in` a vault that can't hold it, such as a secret in `aws.acm` or a certificate in `aws.kms`. Store it in a vault that holds it. ## Examples An `aws.kms` vault holds keys, so a certificate stored in it raises KQ254: ```kanoniq vault kms "Keys" : aws.kms environment PRD x1 certificate shop-cert "shop.example.com" issuer "DigiCert" rotate P1Y stored-in kms served-by apim environment PRD ``` Stored in the shop's key vault, `kv-prd`, which holds certificates, it raises nothing: ```kanoniq certificate shop-cert "shop.example.com" issuer "DigiCert" rotate P1Y stored-in kv-prd served-by apim environment PRD ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq255.md # KQ255 — an infrastructure clause names what it takes **Error** · `clause-names-its-type` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) Via names a gateway, backup a backup vault, covers a stage of the service's own Ecosystem, and a certificate's stored-in a vault and served-by what can serve one. A clause names the wrong kind of element: `via` something that is no gateway, `backup` something that is no backup vault, `covers` a stage of another ecosystem, a certificate `stored-in` something that is no vault, or a certificate `served-by` a `network-load-balancer`, which passes TLS through and serves none. Name the element the clause takes; for a certificate, the endpoint behind the load balancer. ## Examples A `network-load-balancer` passes TLS through, so a certificate `served-by` one raises KQ255: ```kanoniq gateway nlb "Load balancer" : network-load-balancer paas environment PRD x1 forwards-to aks-prd certificate shop-cert "shop.example.com" issuer "DigiCert" rotate P1Y stored-in kv-prd served-by nlb environment PRD ``` Served by the cluster behind the load balancer, it raises nothing: ```kanoniq gateway nlb "Load balancer" : network-load-balancer paas environment PRD x1 forwards-to aks-prd certificate shop-cert "shop.example.com" issuer "DigiCert" rotate P1Y stored-in kv-prd served-by aks-prd environment PRD ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq256.md # KQ256 — a bucket holds one Storage **Error** · `bucket-holds-one-storage` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) A storage account of a bucket product holds exactly one Storage. A bucket, such as an `aws.s3` or `gcp.cloud-storage` storage account, holds no storage or several. A bucket holds exactly one: declare one bucket per storage. ## Examples An `aws.s3` bucket that holds no storage raises KQ256: ```kanoniq storage-account bucket "Exports" : aws.s3 environment PRD x1 ``` With the one storage it holds, it raises nothing: ```kanoniq storage-account bucket "Exports" : aws.s3 environment PRD x1 platform storefront { component order-service { blob exports "Exports" on bucket } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq257.md # KQ257 — a Storage is of a kind its account holds **Error** · `storage-of-its-accounts-kind` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) A Storage on a storage account is of a kind that account's product holds. A storage is `on` a storage account that can't hold its kind, such as a `sql` storage on `azure.storage-account`, or a `file` storage on `aws.s3`. Put it on a database server, or on an account that holds its kind. ## Examples An `aws.s3` bucket holds blobs, so a `file` storage on it raises KQ257: ```kanoniq storage-account bucket "Exports" : aws.s3 environment PRD x1 platform storefront { component order-service { file exports "Exports" on bucket } } ``` A `blob` storage on it raises nothing: ```kanoniq storage-account bucket "Exports" : aws.s3 environment PRD x1 platform storefront { component order-service { blob exports "Exports" on bucket } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq258.md # KQ258 — only a client runs on a storage account **Error** · `storage-account-serves-a-client` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) Only a user-facing client is deployed on a storage account, a static site served from it. Something other than a user interface is deployed `on` a storage account. Only a static site, a user interface served from a blob container or a bucket, runs there; deploy the rest on a host or an app platform. ## Examples A backend component deployed `on` a storage account raises KQ258: ```kanoniq storage-account st-prd "Shop storage" : azure.storage-account environment PRD x1 platform storefront { component billing "Billing" : backend { environment PRD x1 on st-prd } } ``` Deployed on the cluster, `aks-prd`, it raises nothing: ```kanoniq storage-account st-prd "Shop storage" : azure.storage-account environment PRD x1 platform storefront { component billing "Billing" : backend { environment PRD x1 on aks-prd } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq259.md # KQ259 — infrastructure stays in its stage **Error** · `infrastructure-in-its-stage` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) What a part runs on, and what an infrastructure element runs on, is in and uses, is in the same stage, a registry aside, and a link joins two networks of one stage. Something names infrastructure of another stage: a component runs `on` a host or platform that isn't in its `environment` line's stage, an element is `on`, `in` or `uses` one of another stage, or a `link` joins networks of two stages. Name the one of its own stage. A registry is the exception: `uses` names it from any stage. ## Examples The `aks-prd` cluster is in `PRD`, so a component that runs on it in `DEV` raises KQ259: ```kanoniq platform storefront { component billing "Billing" : backend { environment DEV x1 on aks-prd } } ``` Running in `DEV` on the development VM, `vm-dev`, it raises nothing: ```kanoniq platform storefront { component billing "Billing" : backend { environment DEV x1 on vm-dev } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq260.md # KQ260 — a private DNS zone is in a network **Error** · `private-zone-in-a-network` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) A DNS record in a private zone states the network its zone is linked to. A `dns` record in a private zone states no `in `. Add the network its zone is linked to. ## Examples A DNS record in a `private` zone that names no network raises KQ260: ```kanoniq dns orders-dns "orders.internal" : private -> apim environment PRD ``` Stating the network its zone is linked to, it raises nothing: ```kanoniq dns orders-dns "orders.internal" : private in spoke-prd -> apim environment PRD ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq261.md # KQ261 — a platform service states how it runs **Error** · `run-rule-stated` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) A platform service of a generic kind states paas or on the host it runs on. A platform service with a generic kind, such as `db-server orders "Orders" : postgresql`, states neither `paas` nor `on `. Write how it runs after the kind: `: postgresql paas` if the provider runs it, `: postgresql on vm-db` if it runs on your host. A product word such as `azure.postgresql` says it for you. A database server with no kind, a broker inside a storage account or a database server, and a broker that states no `environment` line, are not reported. ## Examples A database server of the generic kind `postgresql` that states neither `paas` nor `on` raises KQ261: ```kanoniq db-server pg "Reports DB" : postgresql environment PRD x1 ``` Stating that the provider runs it raises nothing: ```kanoniq db-server pg "Reports DB" : postgresql paas environment PRD x1 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq262.md # KQ262 — a product word fixes how it runs **Error** · `product-word-fixes-run` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) A platform service of a provider's product word states no paas, states on only after a self-run word, and states it after one. A platform service of a product word also states how it runs, and gets it wrong: `paas` after the word, which already says so; `on ` after a word the provider runs; or no `on ` after a self-run word such as `azure.api-management.self-hosted-gateway`. Remove `paas`, remove `on` or pick the self-run word, or add the host it runs on. ## Examples The product word `azure.key-vault` already says the provider runs it, so `paas` after it raises KQ262: ```kanoniq vault kv-orders "Orders vault" : azure.key-vault paas environment PRD x1 ``` Without `paas`, it raises nothing: ```kanoniq vault kv-orders "Orders vault" : azure.key-vault environment PRD x1 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq269.md # KQ269 — an endpoint stated plaintext is not proven encrypted **Error** · `plaintext-not-proven-encrypted` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) A software-facing Interface or a Broker stated in-transit plaintext does not serve a certificate, is not of a transport that takes no plaintext, and is not reached with auth certificate. An API or a broker states `in-transit plaintext`, and the model also proves it encrypted: it serves a certificate, it is a broker of a kind that takes no plaintext, such as `azure.service-bus.queues`, or a call or a leg reaching it states `auth certificate`, which is mutual TLS or an SSH key. A gateway in front of it serving a certificate is not reported: the gateway ends the encryption, and the hop behind it may be plain. State `in-transit encrypted`, or correct what proves it encrypted. ## Examples An API stated `in-transit plaintext` that a call reaches with `auth certificate` raises KQ269: ```kanoniq platform storefront { component billing "Billing" : backend { environment PRD x1 on aks-prd http-api invoices-api "Invoices API" in-transit plaintext } order-service -> billing/invoices-api over http auth certificate } ``` Stated `in-transit encrypted`, it raises nothing: ```kanoniq platform storefront { component billing "Billing" : backend { environment PRD x1 on aks-prd http-api invoices-api "Invoices API" in-transit encrypted } order-service -> billing/invoices-api over http auth certificate } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq270.md # KQ270 — only a network endpoint states in-transit **Error** · `in-transit-on-a-network-endpoint` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) in-transit is stated on a software-facing Interface other than an ipc-api, or on a Broker, and nowhere else. An `ipc-api` states `in-transit`, but its channel never leaves its machine, so nothing reaches it in transit. Remove the clause. ## Examples An `ipc-api` never leaves its machine, so `in-transit` on one raises KQ270: ```kanoniq platform storefront { component billing "Billing" : backend { ipc-api invoices-api "Invoices API" in-transit encrypted } } ``` Without the clause, it raises nothing: ```kanoniq platform storefront { component billing "Billing" : backend { ipc-api invoices-api "Invoices API" } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq292.md # KQ292 — a location is stated once **Error** · `location-stated-once` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) An element in a network that states its location states none of its own: it is where its network is. A host or a platform service states `location`, and the network it is `in` states one too. It is where its network is, so its own says the same thing twice, or contradicts it. Remove the element's `location` and keep the network's: `app-platform aks "AKS" : azure.aks in spoke-weu environment PRD x1`. ## Examples An AKS cluster in a network that states `location azure.westeurope`, stating that location again, raises KQ292: ```kanoniq app-platform aks-weu "AKS West Europe" : azure.aks in spoke-weu location azure.westeurope environment PRD x1 ``` The cluster with its own `location` removed, where its network is, raises nothing: ```kanoniq app-platform aks-weu "AKS West Europe" : azure.aks in spoke-weu environment PRD x1 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq293.md # KQ293 — a zone its location has **Error** · `zone-of-its-location` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) Each zone an element names is one its location has: one its region's registry entry names, or one its data center declares. A host or a platform service names a zone in `zones` that its location doesn't have: a number past an Azure region's zones, an AWS zone ID of another region, or a zone its data center doesn't declare. Its location is its own, else its network's, else that of what it runs on. Name one of the zones the message lists, or declare the zone in the data center's block: `zone hall-c`. ## Examples A scale set in the West Europe network naming zone 4, which `azure.westeurope` doesn't have, raises KQ293: ```kanoniq host web "Web servers" : azure.vm-scale-set in spoke-weu zones 1, 2, 4 environment PRD x3 ``` The scale set in the region's zones 1, 2 and 3 raises nothing: ```kanoniq host web "Web servers" : azure.vm-scale-set in spoke-weu zones 1, 2, 3 environment PRD x3 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq294.md # KQ294 — zones or zone-redundant **Error** · `zones-or-zone-redundant` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) An element names the zones it spans or says its provider spreads it with zone-redundant, never both. An element states both `zones` and `zone-redundant`. `zones` names the zones you place it in, and `zone-redundant` says its provider spreads it without you naming them, so keep the one that is true: `db-server orders "Orders SQL" : azure.sql-database zone-redundant environment PRD x1`. ## Examples A SQL database stating both `zones 1` and `zone-redundant` raises KQ294: ```kanoniq db-server orders "Orders SQL" : azure.sql-database zones 1 zone-redundant environment PRD x1 ``` The same database, `zone-redundant` alone, raises nothing: ```kanoniq db-server orders "Orders SQL" : azure.sql-database zone-redundant environment PRD x1 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq295.md # KQ295 — a stage on several lines is on different hosts **Error** · `stage-on-different-hosts` · [Infrastructure](https://kanoniq.extenza.dev/docs/rules.md#infrastructure) A part that states one stage on several environment lines names what it runs on on each, a different host or platform on each. A part states one stage on several `environment` lines, and one of them names no `on`, or two name the same host or platform. Several lines of one stage say how its instances are spread, so each says where its own run. Name a different host or platform on each line, or write the instances on one host on one line: `environment PRD x2 on aks-weu` and `environment PRD x2 on aks-neu`. ## Examples The order service stating PRD on two lines, the second naming no `on`, raises KQ295: ```kanoniq environment PRD x2 on aks-weu environment PRD x2 ``` Each line on its own cluster, one in each region, raises nothing: ```kanoniq environment PRD x2 on aks-weu environment PRD x2 on aks-neu ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq123.md # KQ123 — support does not end within the warning period **Lint** · `support-end-warning-period` · [Life cycle](https://kanoniq.extenza.dev/docs/rules.md#life-cycle) A run element that is not retired, phasing out or meant to be replaced, migrated or retired does not reach the end of its extended support or its contract within the repository's warning period, nor does a contract unless all it covers is so answered. An element that isn't `retired` states an `end-of-extended-support` or a `contract-end` that is past, or falls within the repository's `end-of-support-warning`, 12 months unless `kanoniq.repository.json` says otherwise. Plan for it: state `status phasing-out`, or a `future` of `replace`, `migrate` or `retire`; for a component in a monolith, its monolith's answer counts too. A contract's `ends` is noticed the same way, on the contract: it's answered once everything it covers is, and a contract covering nothing is answered only by moving its `ends`. A date within the error period is [KQ268](https://kanoniq.extenza.dev/docs/rules/kq268.md) instead, never both, and `end-of-mainstream-support` is never reported. Set the warning to `false` to turn this off. ## Examples An operating system whose extended support has ended, with no plan stated for it, raises KQ123: ```kanoniq installation win2012 "Windows Server" : os on vm-dev version "2012" end-of-extended-support 2023-10-10 ``` With a future of `replace` stated, it raises nothing: ```kanoniq installation win2012 "Windows Server" : os on vm-dev version "2012" future replace end-of-extended-support 2023-10-10 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq263.md # KQ263 — nothing live depends on a retired element **Error** · `retired-has-no-live-dependents` · [Life cycle](https://kanoniq.extenza.dev/docs/rules.md#life-cycle) Nothing that is not retired is deployed, hosted or installed on a retired element, uses it or calls it, and no Component that is not retired is held in a retired monolith. A `retired` element is switched off, and something that isn't is still deployed on it, hosted or installed on it, runs on it, uses it or calls it: a component on a retired host, a storage on a retired database server, an installation left on a retired host, a component left in a retired monolith. Retire the dependent too, or move it to what replaces the element. ## Examples A component deployed on a `retired` host raises KQ263: ```kanoniq host vm-old "Old VM" : vm environment PRD x1 status retired platform storefront { component billing "Billing" : backend { environment PRD x1 on vm-old } } ``` Moved to the cluster, `aks-prd`, it raises nothing: ```kanoniq host vm-old "Old VM" : vm environment PRD x1 status retired platform storefront { component billing "Billing" : backend { environment PRD x1 on aks-prd } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq264.md # KQ264 — a phasing-out element is not invested in **Error** · `phasing-out-is-not-invested` · [Life cycle](https://kanoniq.extenza.dev/docs/rules.md#life-cycle) An element that is phasing out does not have a future of invest. An element is `phasing-out`, closed to new use, and its `future` is `invest`, so it is both closed and grown. Change the future to `maintain`, `migrate`, `replace` or `retire`, or the status to `active`. ## Examples A host that is `phasing-out` and whose future is `invest` raises KQ264: ```kanoniq host vm-old "Old VM" : vm environment PRD x1 status phasing-out future invest ``` With a future of `retire`, it raises nothing: ```kanoniq host vm-old "Old VM" : vm environment PRD x1 status phasing-out future retire ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq265.md # KQ265 — a successor is of the element's type and its future **Error** · `successor-fits` · [Life cycle](https://kanoniq.extenza.dev/docs/rules.md#life-cycle) A successor is named only with a future of replace or migrate, is of the same type as the element, or a Component for a monolith and a monolith for a Component, and is not the element itself. A `successor` is named beside a future other than `replace` or `migrate`, or none; or it is an element of another type, such as a network as a host's successor; or it names the element itself. Write `future replace` or `future migrate` before it, and name an element of the same type; a component or a monolith may name either. ## Examples A host that names a `successor` beside a future of `maintain` raises KQ265: ```kanoniq host vm-old "Old VM" : vm environment PRD x1 future maintain successor vm-new host vm-new "New VM" : vm environment PRD x1 ``` Beside a future of `replace`, the successor raises nothing: ```kanoniq host vm-old "Old VM" : vm environment PRD x1 future replace successor vm-new host vm-new "New VM" : vm environment PRD x1 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq266.md # KQ266 — an installation is on a Host **Error** · `installation-on-a-host` · [Life cycle](https://kanoniq.extenza.dev/docs/rules.md#life-cycle) An installation names the Host it is installed on, and only a Host. An `installation` states no `on`, or names something that isn't a host after it, such as an app platform or a component. Name the host it is installed on: `installation jre "Java" : runtime on vm-db`. ## Examples The `aks-prd` cluster is an app platform, not a host, so an installation on it raises KQ266: ```kanoniq installation jre "Java" : runtime on aks-prd version "17" ``` Installed on a host, `vm-dev`, it raises nothing: ```kanoniq installation jre "Java" : runtime on vm-dev version "17" ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq267.md # KQ267 — extended support ends after mainstream support **Error** · `extended-after-mainstream` · [Life cycle](https://kanoniq.extenza.dev/docs/rules.md#life-cycle) An element's end of extended support is not before its end of mainstream support. An element's `end-of-extended-support` is before its `end-of-mainstream-support`, and a vendor never stops all support before it stops adding fixes. Check the two dates against the vendor's page; one is likely swapped. The same day for both is fine. ## Examples A host whose extended support ends before its mainstream support raises KQ267: ```kanoniq host vm-old "Old VM" : vm environment PRD x1 end-of-mainstream-support 2099-01-08 end-of-extended-support 2098-01-08 ``` With the two dates the right way round, it raises nothing: ```kanoniq host vm-old "Old VM" : vm environment PRD x1 end-of-mainstream-support 2098-01-08 end-of-extended-support 2099-01-08 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq268.md # KQ268 — support does not end within the error period **Error** · `support-end-error-period` · [Life cycle](https://kanoniq.extenza.dev/docs/rules.md#life-cycle) A run element that is not retired, phasing out or meant to be replaced, migrated or retired does not reach the end of its extended support or its contract within the repository's error period, nor past it, nor does a contract unless all it covers is so answered. As [KQ123](https://kanoniq.extenza.dev/docs/rules/kq123.md), over the repository's `end-of-support-error` period: an element that isn't `retired` reaches its `end-of-extended-support` or `contract-end` within it, or is already past it. State `status phasing-out`, or a `future` of `replace`, `migrate` or `retire`; for a component in a monolith, its monolith's answer counts too. A contract's `ends` is noticed the same way, on the contract. The error is off unless the setting is set; `kq init` writes `6m`. It counts from the day it runs, so a model that passed can fail on a later day with no edit. ## Examples In a repository whose `end-of-support-error` is `6m`, an operating system whose extended support has ended, with no plan stated for it, raises KQ268: ```kanoniq installation win2012 "Windows Server" : os on vm-dev version "2012" end-of-extended-support 2023-10-10 ``` With a future of `replace` stated, it raises nothing: ```kanoniq installation win2012 "Windows Server" : os on vm-dev version "2012" future replace end-of-extended-support 2023-10-10 ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq129.md # KQ129 — bought software has a supplier **Lint** · `bought-software-has-a-supplier` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) In an Ecosystem with a contract, every saas or cots Component or monolith is covered by a contract, a Component in a covered monolith counting as covered. A `saas` or `cots` component or monolith is bought software, and no contract covers it, so the model doesn't say who supplies it. A component in a covered monolith counts as covered. An ecosystem with no contract is not checked, so a model that never names a supplier isn't flooded. Add it to the `covers` of the contract it's bought under, declaring the supplier and the contract where none exists. ## Examples A contract that names the support work with `via` and covers nothing leaves the contact centre, a `saas` component, with no supplier, so it raises KQ129: ```kanoniq supplier genesys "Genesys Cloud Services, Inc." headquarters US { contract genesys-cx "Genesys Cloud subscription" via support } ``` The same contract covering the contact centre raises nothing: ```kanoniq supplier genesys "Genesys Cloud Services, Inc." headquarters US { contract genesys-cx "Genesys Cloud subscription" covers @customer/contact-centre } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq130.md # KQ130 — a critical contract has a way out **Lint** · `critical-contract-has-an-exit` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A contract supporting a critical Function states its ends and its notice. A contract supports a critical function and states no `ends` or no `notice`, so a critical dependency has no stated way out. The function is marked `critical` itself, under a critical domain or function group, or under a domain the contract supports. State the contract's last day with `ends` and the period you must give to leave it with `notice`, such as `notice P90D`. ## Examples A contract covering the planner, which realizes the critical timetable work, and stating no `ends` and no `notice` raises KQ130: ```kanoniq supplier signal-works "Signal Works Ltd" headquarters GB { contract planner-support "Planner support" covers planning/planner } ``` The same contract stating its last day and its notice period raises nothing: ```kanoniq supplier signal-works "Signal Works Ltd" headquarters GB { contract planner-support "Planner support" ends 2035-12-31 notice P90D covers planning/planner } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq131.md # KQ131 — a contract supports a Function **Lint** · `contract-supports-a-function` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A contract supports a Function: something it covers realizes one, or it names one with via. A contract supports no function: nothing it covers realizes one, directly or through what runs on it, and it names none with `via`. Add the realization the landscape is missing, or name the work it supports with `via`. ## Examples A contract covering only a VM host that nothing runs on supports no function, so it raises KQ131: ```kanoniq host roster-vm "Rostering VM" : vm environment PRD x1 supplier hosting-co "Rail Hosting Ltd" headquarters GB { contract vm-hosting "VM hosting" covers roster-vm } ``` The same contract naming the crew rostering work it supports with `via` raises nothing: ```kanoniq host roster-vm "Rostering VM" : vm environment PRD x1 supplier hosting-co "Rail Hosting Ltd" headquarters GB { contract vm-hosting "VM hosting" covers roster-vm via operations/roster-crew } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq134.md # KQ134 — a Platform says whose work it does **Lint** · `platform-says-whose-work` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) In an Ecosystem with two or more legal entities, every Platform and monolith names with for the entities or branches whose work it does. An ecosystem holds two or more legal entities, and a platform or a monolith in it states no `for`, so nothing says whose work it does: the functions it realizes are performed for no one, and the contracts covering it are used by no entity. Add `for` after its name, naming the legal entities or branches it serves. ## Examples Meridian Bank holds two legal entities, so a platform that states no `for` raises KQ134: ```kanoniq platform intranet "Intranet" ``` The same platform naming the legal entity whose work it does raises nothing: ```kanoniq platform intranet "Intranet" for meridian-plc ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq135.md # KQ135 — a supplier is one company **Lint** · `is-names-one-company` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A supplier's is names an Ecosystem holding at most one legal entity; where it holds several, is names the legal entity by path. A supplier's `is` names an ecosystem that holds two or more legal entities, so which company of your group supplies isn't said, nor whose LEI a register reports. Name the legal entity instead, by path: `is /`. The supplier then reads that entity's LEI and headquarters. ## Examples Shared Services holds two legal entities, so a supplier that `is` the whole ecosystem raises KQ135: ```kanoniq supplier group-hr "Meridian Shared Services Ltd" is services { contract payroll-service "Payroll service" signed-by meridian-plc via operations/pay-staff } ``` The same supplier naming its legal entity by path raises nothing: ```kanoniq supplier group-hr "Meridian Shared Services Ltd" is services/meridian-shared { contract payroll-service "Payroll service" signed-by meridian-plc via operations/pay-staff } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq136.md # KQ136 — a branch is abroad **Lint** · `branch-is-abroad` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A branch is in another country than its legal entity's headquarters. A branch's `in` is the country of its own legal entity's `headquarters`. A branch is a place of business of its entity in another country, so this is most likely the wrong country, or an office that isn't a branch. Correct the country after `in`, or remove the branch if the office is part of the entity's home business. A branch whose entity states no `headquarters` isn't reported. ## Examples Meridian Bank Ireland DAC has its headquarters in Ireland, so a branch of it in `IE` raises KQ136: ```kanoniq legal-entity meridian-ie { branch frankfurt "Meridian Bank Ireland DAC, Frankfurt branch" in IE } ``` The same branch in Germany, where it is, raises nothing: ```kanoniq legal-entity meridian-ie { branch frankfurt "Meridian Bank Ireland DAC, Frankfurt branch" in DE } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq284.md # KQ284 — a contract covers its own Ecosystem's elements **Error** · `covers-stays-home` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) What a contract covers is in its own Ecosystem, or in the Ecosystem its supplier is, directly or through a legal entity. A contract covers an element of another ecosystem, and its supplier isn't that ecosystem, nor a legal entity of it. The ecosystem holding the supplier is the one contracting for what it covers. Declare the supplier and the contract in the element's ecosystem, or, where the supplier is a company of the group whose landscape that ecosystem holds, say so with `is`. ## Examples A supplier declared in Meridian Bank whose contract covers the payroll engine of Shared Services, while the supplier is not that ecosystem, raises KQ284: ```kanoniq supplier group-hr "Meridian Shared Services Ltd" headquarters GB { contract payroll-service "Payroll service" signed-by meridian-plc covers services/payroll/payroll-engine } ``` The same supplier saying with `is` that it is the Shared Services legal entity raises nothing: ```kanoniq supplier group-hr "Meridian Shared Services Ltd" is services/meridian-shared { contract payroll-service "Payroll service" signed-by meridian-plc covers services/payroll/payroll-engine } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq285.md # KQ285 — a contract supports its own Ecosystem's work **Error** · `contract-via-stays-home` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) What a contract's via names is in the contract's own Ecosystem. A contract's `via` names a domain, a function group or a function of another ecosystem. A contract supports the work of the ecosystem it's declared in. Name the work in the contract's own ecosystem, or declare the supplier in the other one. ## Examples A contract in Meridian Bank whose `via` names the payroll function of Shared Services raises KQ285: ```kanoniq supplier group-hr "Meridian Shared Services Ltd" is services/meridian-shared { contract payroll-service "Payroll service" signed-by meridian-plc via services/hr/run-payroll } ``` The same contract naming the bank's own function raises nothing: ```kanoniq supplier group-hr "Meridian Shared Services Ltd" is services/meridian-shared { contract payroll-service "Payroll service" signed-by meridian-plc via operations/pay-staff } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq286.md # KQ286 — a covered element states no contract end **Error** · `covered-states-no-contract-end` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) An element a contract covers states no contract-end; it reads its contracts' ends. An element a contract covers states `contract-end`. Its contract end is the earliest `ends` of the contracts covering it, so the date is stated once, on the contract. Remove the `contract-end` from the element and state the date as the contract's `ends`. ## Examples A bought rostering component that states its own `contract-end`, covered by a contract, raises KQ286: ```kanoniq platform planning { component rostering "Rostering" : cots contract-end 2035-06-30 rostering realizes operations/roster-crew } supplier crew-soft "Crew Software Ltd" headquarters GB { contract rostering-license "Rostering license" covers planning/rostering } ``` The same date stated once, as the contract's `ends`, raises nothing: ```kanoniq platform planning { component rostering "Rostering" : cots rostering realizes operations/roster-crew } supplier crew-soft "Crew Software Ltd" headquarters GB { contract rostering-license "Rostering license" ends 2035-06-30 covers planning/rostering } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq287.md # KQ287 — a contract ends after it starts **Error** · `ends-after-starts` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A contract's ends is not before its starts. A contract's `ends` is before its `starts`. Both on the same day is fine. Correct whichever date is wrong. ## Examples A contract whose `ends` is the day before its `starts` raises KQ287: ```kanoniq supplier crew-agency "Rail Crew Services Ltd" headquarters GB { contract crew-cover "Crew cover" starts 2036-01-01 ends 2035-12-31 via operations/roster-crew } ``` The same contract with the start date corrected raises nothing: ```kanoniq supplier crew-agency "Rail Crew Services Ltd" headquarters GB { contract crew-cover "Crew cover" starts 2026-01-01 ends 2035-12-31 via operations/roster-crew } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq288.md # KQ288 — a contract's subcontractors form one chain **Error** · `subcontractor-chain` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) Each subcontractor names another supplier of the Ecosystem than the contract's own, once, under its supplier or one in its chain, and the chain reaches the contract's supplier. A contract's `subcontractor` lines don't form one chain under its supplier: a line names something that isn't a supplier, a supplier of another ecosystem, the contract's own supplier or one already named, an `under` names a supplier that is neither the contract's nor in its chain, or the lines run in a circle. Write one line per subcontractor, each naming a supplier declared in the contract's ecosystem, with `under` the supplier it works for when that isn't the contract's own. ## Examples A contract that has Equinix `under` AWS, while AWS is neither its supplier nor in its chain, raises KQ288: ```kanoniq supplier crew-soft "Crew Software Ltd" headquarters GB { contract crew-cover "Crew cover" via operations/roster-crew { subcontractor equinix under aws } } supplier aws "Amazon Web Services EMEA SARL" headquarters LU supplier equinix "Equinix (Germany) GmbH" headquarters DE ``` The same contract naming AWS as a subcontractor too, so the chain reaches its supplier, raises nothing: ```kanoniq supplier crew-soft "Crew Software Ltd" headquarters GB { contract crew-cover "Crew cover" via operations/roster-crew { subcontractor aws subcontractor equinix under aws } } supplier aws "Amazon Web Services EMEA SARL" headquarters LU supplier equinix "Equinix (Germany) GmbH" headquarters DE ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq289.md # KQ289 — a supplier's parent is another supplier **Error** · `parent-is-another-supplier` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A supplier's parent is another supplier of its Ecosystem, and parents form no cycle. A supplier's `parent` names the supplier itself, something that isn't a supplier, a supplier of another ecosystem, or a supplier whose own parents lead back to it. Name the company that ultimately owns it, declared as a supplier in the same ecosystem. ## Examples A supplier naming itself as its `parent` raises KQ289: ```kanoniq supplier equinix "Equinix (Germany) GmbH" headquarters DE parent equinix ``` Its ultimate parent declared as a supplier beside it, and named as its `parent`, raises nothing: ```kanoniq supplier equinix "Equinix (Germany) GmbH" headquarters DE parent equinix-inc supplier equinix-inc "Equinix, Inc." headquarters US ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq290.md # KQ290 — a supplier is another Ecosystem **Error** · `is-another-ecosystem` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A supplier's is names another Ecosystem than the one it is declared in, or a legal entity of another. A supplier's `is` names the ecosystem it is declared in, or a legal entity of that ecosystem. `is` says the supplier is another company of the group, whose landscape the model holds; an ecosystem does its own entities' work without a contract. Name the other company's ecosystem or legal entity, or remove `is` where the supplier is outside the group. ## Examples A supplier in the Cards ecosystem whose `is` names Cards itself raises KQ290: ```kanoniq supplier aurora-payments "Aurora Payments UAB" is cards ``` The same supplier naming the legal entity of the Payments ecosystem, the company of the group it is, raises nothing: ```kanoniq supplier aurora-payments "Aurora Payments UAB" is payments/payments-uab ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq291.md # KQ291 — an LEI is well formed **Error** · `lei-well-formed` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A supplier's or a legal entity's lei is 18 capitals or digits and two check digits valid under ISO 7064 MOD 97-10. A supplier's or a legal entity's `lei` isn't a Legal Entity Identifier: 18 capitals or digits, then two check digits, the whole valid under ISO 7064 MOD 97-10. Whether it is registered isn't checked. Copy the identifier from the LEI register, or leave `lei` out. ## Examples A legal entity whose `lei` ends in the wrong check digits raises KQ291: ```kanoniq legal-entity cards-ie "Aurora Cards Ireland DAC" lei "984500AURORACARDSI89" headquarters IE ``` The same identifier with the check digits ISO 7064 MOD 97-10 gives raises nothing: ```kanoniq legal-entity cards-ie "Aurora Cards Ireland DAC" lei "984500AURORACARDSI88" headquarters IE ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq298.md # KQ298 — a legal entity's parent is another legal entity **Error** · `parent-is-another-entity` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A legal entity's parent is another legal entity, in any Ecosystem, and parents form no cycle. A legal entity's `parent` names the entity itself, something that isn't a legal entity, or an entity whose own parents lead back to it. Name its direct parent undertaking, a legal entity declared in this ecosystem or another one. ## Examples A legal entity naming itself as its `parent` raises KQ298: ```kanoniq legal-entity cards-ie "Aurora Cards Ireland DAC" headquarters IE parent cards-ie ``` Its parent undertaking, the legal entity Aurora Cards Ltd, named instead raises nothing: ```kanoniq legal-entity cards-ie "Aurora Cards Ireland DAC" headquarters IE parent cards-ltd ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq299.md # KQ299 — an LEI names one legal entity **Error** · `lei-names-one-entity` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) No two legal entities of the model state one lei. Two or more legal entities state the same `lei`. An LEI identifies one legal person, so either one entity is declared twice or one identifier is wrong. Keep one declaration of the entity, or correct the identifier from the LEI register. ## Examples A legal entity in Cards stating the `lei` of Aurora Payments UAB, a legal entity of the Payments ecosystem, raises KQ299: ```kanoniq legal-entity cards-ie "Aurora Cards Ireland DAC" lei "984500AURORAPAY0GB58" headquarters IE ``` The entity stating its own identifier raises nothing: ```kanoniq legal-entity cards-ie "Aurora Cards Ireland DAC" lei "984500AURORACARDSI88" headquarters IE ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq400.md # KQ400 — for names an entity of its Ecosystem **Error** · `for-stays-home` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) What a Platform's or a monolith's for names is a legal entity or a branch of its own Ecosystem. A platform's or a monolith's `for` names a legal entity or a branch of another ecosystem. An ecosystem does the work of its own legal entities; another ecosystem's entity is served from outside, under a contract. Name an entity of this ecosystem, or say the service with a supplier that `is` the other ecosystem. ## Examples A platform in the Cards ecosystem whose `for` names the legal entity of the Payments ecosystem raises KQ400: ```kanoniq platform card-issuing "Card issuing" for payments/payments-uab { component card-management "Card management" : backend card-management realizes issuing/issue-cards } ``` The platform doing the work of Aurora Cards Ltd, the legal entity of its own ecosystem, raises nothing: ```kanoniq platform card-issuing "Card issuing" for cards-ltd { component card-management "Card management" : backend card-management realizes issuing/issue-cards } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq401.md # KQ401 — a contract is signed in its Ecosystem **Error** · `signer-stays-home` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A contract's signed-by names a legal entity of the Ecosystem it is declared in. A contract's `signed-by` names a legal entity of another ecosystem than the one the contract is declared in. Name the entity of this ecosystem that signed it. ## Examples A contract in Meridian Bank signed by a legal entity of Shared Services raises KQ401: ```kanoniq supplier payroll-co "Payroll Co Ltd" headquarters GB { contract payroll-service "Payroll service" signed-by services/meridian-shared via operations/pay-staff } ``` The same contract signed by the bank's own legal entity raises nothing: ```kanoniq supplier payroll-co "Payroll Co Ltd" headquarters GB { contract payroll-service "Payroll service" signed-by meridian-plc via operations/pay-staff } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq402.md # KQ402 — a contract names its signer **Error** · `contract-names-its-signer` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) In an Ecosystem with two or more legal entities, every contract states signed-by. A contract sits in an ecosystem holding two or more legal entities and states no `signed-by`, so which of them signed it isn't said. In an ecosystem with one legal entity, that entity signs it and nothing needs writing. Add `signed-by` after the contract's name and number, naming the entity that signed it. ## Examples Meridian Bank holds two legal entities, so a contract that states no `signed-by` raises KQ402: ```kanoniq supplier payroll-co "Payroll Co Ltd" headquarters GB { contract payroll-service "Payroll service" via operations/pay-staff } ``` The same contract naming the legal entity that signed it raises nothing: ```kanoniq supplier payroll-co "Payroll Co Ltd" headquarters GB { contract payroll-service "Payroll service" signed-by meridian-plc via operations/pay-staff } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq403.md # KQ403 — a supplier that is a legal entity states no LEI **Error** · `entity-supplier-states-no-identity` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A supplier whose is names a legal entity states no lei and no headquarters: it reads both from the entity. A supplier's `is` names a legal entity, and the supplier states `lei` or `headquarters` too. A supplier that is a legal entity reads both from it, so each fact is stated once. Remove `lei` and `headquarters` from the supplier, and state them on the legal entity instead. ## Examples A supplier that is the legal entity Aurora Payments UAB and states `headquarters` too raises KQ403: ```kanoniq supplier aurora-payments "Aurora Payments UAB" headquarters LT is payments/payments-uab ``` The supplier without `headquarters`, reading it from the legal entity, raises nothing: ```kanoniq supplier aurora-payments "Aurora Payments UAB" is payments/payments-uab ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq405.md # KQ405 — a contract states each transfer ground once **Error** · `transfer-ground-once` · [Suppliers and contracts](https://kanoniq.extenza.dev/docs/rules.md#suppliers-and-contracts) A ground a contract's transfer clause lists is listed once. A contract's `transfer` lists one ground twice, such as `transfer scc, bcr, scc`. A ground is stated once, or a register reading the grounds would list it twice. Remove the repeat. ## Examples A contract that lists `scc` twice in its `transfer` raises KQ405: ```kanoniq supplier crew-soft "Crew Software Ltd" headquarters GB { contract crew-cover "Crew cover" transfer scc, bcr, scc via operations/roster-crew } ``` The same contract listing each ground once raises nothing: ```kanoniq supplier crew-soft "Crew Software Ltd" headquarters GB { contract crew-cover "Crew cover" transfer scc, bcr via operations/roster-crew } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq033.md # KQ033 — plateaus form one sequence **Error** · `plateaus-form-one-sequence` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) Plateaus line up one after another, in a single sequence. The plateaus do not line up one after another: two have no plateau before them, one follows two, or they go round in a circle. Give every plateau but the first an `after`, naming the one before it. `kq build` already refuses this in a `.kq` file. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq034.md # KQ034 — plateau dates rise **Error** · `plateau-dates-rise` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) Each dated plateau is later than the dated plateaus before it. A plateau is dated on or before a plateau that comes earlier. Fix the date, or the order: each dated plateau is later than the dated ones before it. ## Examples The plateau `to-be` is dated 2027-06-30, so a plateau after it dated 2027-03-01 raises KQ034: ```kanoniq plateau later "Later" after to-be dated 2027-03-01 { ecosystem shop { platform commerce { -export } } } ``` Dated after `to-be`, it raises nothing: ```kanoniq plateau later "Later" after to-be dated 2027-09-30 { ecosystem shop { platform commerce { -export } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq035.md # KQ035 — the initial plateau changes nothing **Error** · `initial-plateau-changes-nothing` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) The first plateau adds, removes, moves and restates nothing. The first plateau adds, removes, moves or restates something, but there is nothing before it to change. Met only in a model that comes from somewhere else. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq036.md # KQ036 — a change names what the plateau before holds **Error** · `change-names-what-is-there` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) A removal or a move names something the plateau before holds. A removal or a move names something the plateau before does not hold. Met only in a model that comes from somewhere else: in a `.kq` file, `kq build` reports a `-` or `move` line naming nothing, and refuses a `-` line taking what a `move` of the same plateau moves as [KB043](https://kanoniq.extenza.dev/docs/rules/build-errors.md#kb043). © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq037.md # KQ037 — a path is one element's **Error** · `path-is-used-once` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) A path that once was an element's is never another element's in a later plateau. An element is declared at a path another element had in an earlier plateau, one that was removed or moved away. A removed element never comes back, and a new one cannot take its place: nobody could tell which it is. Give the new element another Code, or keep the old one instead of removing it. ## Examples This plateau moves `export` away and declares a new element at the path it had, so it raises KQ037: ```kanoniq plateau to-be { ecosystem shop { platform commerce { move export to old-export component export "Export" : integration export realizes selling } } } ``` Given a Code of its own, the new element raises nothing: ```kanoniq plateau to-be { ecosystem shop { platform commerce { move export to old-export component exporter "Exporter" : integration exporter realizes selling } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq038.md # KQ038 — a move lands on a free path **Error** · `move-lands-on-a-free-path` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) A move puts an element where no other element has its Code. A `move` puts an element where another already has its Code. Move it somewhere free, or remove the other first. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq039.md # KQ039 — a relationship's end is alive **Error** · `relationship-end-is-alive` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) A plateau removes nothing a remaining relationship still uses. A plateau removes something that a remaining element still uses: a component calls an API that is gone, on its own or with the component it is in, a replica syncs from an entity that is gone. Remove the connection too, with `-` and the statement, or point it at what replaces the thing removed. A line of its own, such as a job role's `holds` on a role whose application retires, ends with a `-` line naming its ends, which the finding names: `-holds tix/ticket-clerk`. ## Examples In a model where `billing` calls `order-service/orders-api`, a plateau that removes the API and leaves the call raises KQ039: ```kanoniq plateau to-be { ecosystem shop { platform commerce { component order-service { http-api orders-v2 "Orders API v2" -orders-api } } } } ``` Pointing the call at the API that replaces it raises nothing: ```kanoniq plateau to-be { ecosystem shop { platform commerce { component order-service { http-api orders-v2 "Orders API v2" -orders-api } billing -> order-service/orders-v2 over http -billing -> order-service/orders-api over http } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq047.md # KQ047 — a data migration follows a plateau **Error** · `data-migration-follows-a-plateau` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) A data migration is declared in a plateau after the initial one. A data migration is declared in the initial plateau's content. It moves data from the plateau before into the one it delivers, and the initial plateau has none before it. Declare it in the block of the plateau where the data has moved. ## Examples Declared at the top level, which is the plateau `as-is`, a data migration has no plateau before it to move data from, so it raises KQ047: ```kanoniq ecosystem shop { data-migration migrate-orders "Move orders to the new store" } ``` Declared in `to-be`, the plateau that moves the orders into their new store, it raises nothing: ```kanoniq plateau to-be { ecosystem shop { data-migration migrate-commerce-order "Move orders to the new store" { covers commerce/order-service/orders-db/order covers commerce/order-service/orders-store/order } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq048.md # KQ048 — a change of authority is covered once **Error** · `change-covered-once` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) Each change of a Domain Object's authoritative holding is covered by exactly one data migration of its plateau. A Domain Object's authoritative Data Entity is another than in the plateau before, and no data migration of that plateau covers the new one; or two data migrations of one plateau cover the same entity. `kq build` derives a data migration for every change of authority, so this comes from a declaration that adopts the derived one and leaves out the new entity's `covers` line: add it. Where two cover one entity, keep one of the lines. ## Examples In `to-be`, the orders' authoritative entity moves from `orders-db` to `orders-store`, so a migration that covers only the old one leaves the change uncovered and raises KQ048: ```kanoniq plateau to-be { ecosystem shop { data-migration migrate-commerce-order "Move orders to the new store" { covers commerce/order-service/orders-db/order } } } ``` Covering the new entity as well raises nothing: ```kanoniq plateau to-be { ecosystem shop { data-migration migrate-commerce-order "Move orders to the new store" { covers commerce/order-service/orders-db/order covers commerce/order-service/orders-store/order } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq049.md # KQ049 — covers names a change **Error** · `covers-a-change` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) A data migration covers only Data Entities its plateau adds, removes or restates. A `covers` line names a Data Entity its plateau neither adds, removes nor restates: nothing happens to that data there. Remove the line, or move the data migration to the plateau that changes the entity. ## Examples `to-be` leaves the invoices in `billing-db` as they are, so a migration that covers them raises KQ049: ```kanoniq plateau to-be { ecosystem shop { data-migration migrate-commerce-order "Move orders to the new store" { covers commerce/order-service/orders-db/order covers commerce/order-service/orders-store/order covers commerce/billing/billing-db/invoice } } } ``` Covering only the orders, which the plateau moves, raises nothing: ```kanoniq plateau to-be { ecosystem shop { data-migration migrate-commerce-order "Move orders to the new store" { covers commerce/order-service/orders-db/order covers commerce/order-service/orders-store/order } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq050.md # KQ050 — a data migration falls within its window **Error** · `migration-within-its-window` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) A data migration starts and is due between the dates of the plateau before and the plateau it delivers, and starts before it is due. A data migration's `starts` or `by` is on or before the date of the plateau before, or after the date of the plateau it delivers, or it starts after it is due. Fix the dates; a plateau with no date sets no bound. ## Examples The plateau before `to-be` is dated 2026-10-01, so a migration that starts on 2026-09-01 raises KQ050: ```kanoniq plateau to-be { ecosystem shop { data-migration migrate-commerce-order "Move orders to the new store" starts 2026-09-01 by 2027-05-31 { covers commerce/order-service/orders-db/order covers commerce/order-service/orders-store/order } } } ``` Starting after the plateau before, and due before `to-be` on 2027-06-30, it raises nothing: ```kanoniq plateau to-be { ecosystem shop { data-migration migrate-commerce-order "Move orders to the new store" starts 2027-03-01 by 2027-05-31 { covers commerce/order-service/orders-db/order covers commerce/order-service/orders-store/order } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq051.md # KQ051 — a link names a page **Error** · `link-names-a-page` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) A data migration's link is an absolute http or https URL, or the path of a page file in the repository. A `link` is neither an absolute `http://` or `https://` URL nor the path of a page file in the repository, from its root: `portal/Home/Migrations.page.yml`. Fix the path, or create the page. A model outside a repository has no pages, so only a URL works there. VS Code checks a path's form as you type; `kq build` checks that the page exists. ## Examples A `link` that is a ticket number, neither a URL nor a page file's path, raises KQ051: ```kanoniq plateau to-be { ecosystem shop { data-migration migrate-commerce-order "Move orders to the new store" { covers commerce/order-service/orders-db/order covers commerce/order-service/orders-store/order link "FIN-42" } } } ``` The ticket's absolute URL raises nothing: ```kanoniq plateau to-be { ecosystem shop { data-migration migrate-commerce-order "Move orders to the new store" { covers commerce/order-service/orders-db/order covers commerce/order-service/orders-store/order link "https://example.atlassian.net/browse/FIN-42" } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq404.md # KQ404 — memberships form runs **Error** · `memberships-form-runs` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) A subject's memberships are runs that neither overlap nor touch, and only a relationship whose Id is its ends has more than one. An element or a relationship is alive in runs of plateaus: it enters once in each run and leaves at most once, and runs neither overlap nor touch. An element has one run, and so does a connection or a realization. Only a relationship whose Id is computed from its ends, such as a `holds`, a `then` or a grant, may have more: written again in a later plateau after it ended, it is the same relationship, alive again from there. A model written in `.kq` never breaks this, since `kq build` states where each thing enters and leaves; the finding is reached by a model that comes from elsewhere. Write the change in the model's plateaus instead, and let `kq build` state the rest. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq406.md # KQ406 — a constant is alive where it is used **Error** · `constant-alive-where-used` · [Plateaus](https://kanoniq.extenza.dev/docs/rules.md#plateaus) A constant a use names is alive in every plateau the policy, the element or the relationship holding the use is alive in. A policy, an element or a relationship uses a constant in a plateau the constant is not alive in: one a later plateau removed with `-const`, or one it has not added yet. Each plateau gives a use its constant's value there, and a constant that is not alive in a plateau has none. Keep the constant in that plateau, or remove or restate the use there. ## Examples A later plateau removes `MAX_SECRET_ROTATION`, which the policy `secret-rotation` still uses there, so it raises KQ406: ```kanoniq -const MAX_SECRET_ROTATION ``` With the policy removed in that plateau too, it raises nothing: ```kanoniq -const MAX_SECRET_ROTATION -policy secret-rotation ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq074.md # KQ074 — a policy's clause is an aspect or a selector, with its values **Error** · `policy-clause-is-known` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) Every clause of a policy names an aspect or a selector Kanoniq knows, or a property the repository declares, and lists only values that clause takes. A clause names something that is no aspect or selector, or lists a value its clause doesn't take, such as `auth: password`. Check the spelling against the tables in [What a clause can name](https://kanoniq.extenza.dev/docs/language/governance.md#what-a-clause-can-name). Quoted text is a cloud role on `grant`, or the value of a `text` property. A bound, `over` or `under`, is a rotation period, a span ahead of a date or a limit on a number, and only `rotate`, the vendor dates and a `number`, `duration` or `date` property take one, a date in whole days or more: `auth: over P1D` and `contract-end: under PT12H` are reported. A `#` clause names a property `kanoniq.repository.json` declares and lists values of its type: `#ownr: unstated` is reported with the nearest name the file declares, and so is `#seats: gold` on a number. ## Examples `anon` is no `auth` scheme, so this policy raises KQ074: ```kanoniq policy no-anonymous in architecture "Nobody anonymous" -> deny auth: anon ``` Written with the scheme `none`, it raises nothing: ```kanoniq policy no-anonymous in architecture "Nobody anonymous" -> deny auth: none ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq075.md # KQ075 — a clause appears once in a policy **Error** · `policy-clause-once` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) A policy names each clause once, listing several values in one clause. A policy names the same clause twice, as in `when auth: key and auth: none -> deny protocol: http`. List the values in one clause, joined by `or`: `when auth: key or none -> deny protocol: http`. ## Examples This policy names the `auth` clause twice, so it raises KQ075: ```kanoniq policy no-plain-http in architecture "No plain HTTP for keys or anonymous calls" when auth: key and auth: none -> deny protocol: http ``` With both values in one clause, joined by `or`, it raises nothing: ```kanoniq policy no-plain-http in architecture "No plain HTTP for keys or anonymous calls" when auth: key or none -> deny protocol: http ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq076.md # KQ076 — a policy's clauses apply to one subject type **Error** · `policy-clauses-share-a-subject` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) Some subject, a call, a leg, a sync, a grant or a workload identity, can match every clause of a policy. No connection, workload identity or grant can match all of the policy's clauses, so it selects nothing: `credential` reads a workload identity and `protocol` a connection, so a policy naming both never applies. Split it into two policies, or drop the clause that doesn't belong. ## Examples `credential` reads a workload identity and `protocol` a connection, so a policy naming both selects nothing and raises KQ076: ```kanoniq policy no-secret in architecture "No client secret over HTTP" when protocol: http -> deny credential: secret ``` Without the clause that does not belong, it raises nothing: ```kanoniq policy no-secret in architecture "No client secret" -> deny credential: secret ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq077.md # KQ077 — an exemption lifts a policy from a subject **Error** · `exemption-lifts-a-policy` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) An exemption lifts a policy from an element, a call, a leg, a sync or a grant. An exemption points at something that is no policy, or lifts one from something no policy judges. `kq build` already refuses this in a `.kq` file, so it is met only in a model that comes from somewhere else. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq078.md # KQ078 — an Ecosystem's policy set shares no Code with the model's **Error** · `policy-set-code-is-unique` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) No policy set of an Ecosystem shares its Code with a policy set of the model, the two default sets aside. An ecosystem has a policy set with the same Code as one of the model's, so `security/no-key` could mean either. Rename one of the two sets. Every scope has its own `default-model` and `default-architecture` sets, which is fine. ## Examples In a model with its own `security` set, a set coded `security` in the shop's platform is the ecosystem's, so it raises KQ078: ```kanoniq policy-set architecture security "Shop security" { policy no-anonymous -> deny auth: none } ``` Renamed, it raises nothing: ```kanoniq policy-set architecture shop-security "Shop security" { policy no-anonymous -> deny auth: none } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq090.md # KQ090 — a preset's set is written out only where no other preset is judged **Error** · `preset-written-out-alone` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) No policy set has a preset's Code while the repository sets a preset of its kind, and no two presets of one kind are both written out. A policy set is coded as a preset while `kanoniq.repository.json` sets a `preset` of its kind, or both presets of one kind are written out. Only one preset of each kind is judged at a time, and a written-out preset would be judged twice beside the setting. Keep one: remove that kind from `preset` in `kanoniq.repository.json` to keep the written-out set, or remove the set to keep the setting. ## Examples Both model presets written out, each a set of its own, raise KQ090: ```kanoniq policy-set model baseline-model-recommended { policy vaulted when credential: secret or certificate -> deny stored-in: unstated } policy-set model baseline-model-strict { policy vaulted when credential: secret or certificate -> deny stored-in: unstated } ``` Keeping only the strict one raises nothing: ```kanoniq policy-set model baseline-model-strict { policy vaulted when credential: secret or certificate -> deny stored-in: unstated } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq091.md # KQ091 — a reserved policy set is of its own kind **Error** · `reserved-set-of-its-kind` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) A policy set coded as a default set, a preset or a package's set is of the kind its Code names: default-model, the baseline-model presets and threats-stated model sets, default-architecture, the baseline-architecture presets and threats-stride architecture sets. A set coded `default-model` or `baseline-model-…` is written as an `architecture` set, or `default-architecture` or `baseline-architecture-…` as a `model` set. Each of these Codes names its kind, so write the set with that kind: `policy-set model default-model`, `policy-set architecture baseline-architecture-strict`. ## Examples `default-model` names a model set, so writing it as an `architecture` set raises KQ091: ```kanoniq policy-set architecture default-model { policy no-anonymous -> deny auth: none } ``` Coded `default-architecture`, the reserved set of its own kind, it raises nothing: ```kanoniq policy-set architecture default-architecture { policy no-anonymous -> deny auth: none } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq092.md # KQ092 — a model policy denies what is unstated **Error** · `model-policy-tests-unstated` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) A policy in a model set is a deny whose tested clause lists only unstated, and no other clause lists it. A policy in a `model` set says what your model must state, so it denies a subject that leaves something `unstated`: `-> deny auth: unstated`. This one allows, tests a value that is stated, or selects by `unstated` in another clause. If it judges what your systems do, such as `-> deny auth: key`, move it to an `architecture` set; otherwise make it a `deny` whose clause after the action lists only `unstated`. ## Examples A policy `in model` that denies a stated scheme judges the systems, not the model, so it raises KQ092: ```kanoniq policy no-anonymous in model "Nobody anonymous" -> deny auth: none ``` In an architecture set, it raises nothing: ```kanoniq policy no-anonymous in architecture "Nobody anonymous" -> deny auth: none ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq093.md # KQ093 — an architecture policy judges what is stated **Error** · `architecture-policy-states` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) A policy in an architecture set lists unstated in no clause. A policy in an `architecture` set lists `unstated`. An architecture policy judges what your model says about your systems; asking that something be written down is a model policy's job. Move the policy to a `model` set, or write it `in model`. ## Examples A policy `in architecture` that denies an unstated scheme asks the model to say something, so it raises KQ093: ```kanoniq policy stated-auth in architecture "Calls state their scheme" -> deny auth: unstated ``` In a model set, it raises nothing: ```kanoniq policy stated-auth in model "Calls state their scheme" -> deny auth: unstated ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq132.md # KQ132 — a requirement the model can check is served **Lint** · `checkable-requirement-is-served` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) In a framework the repository's frameworks setting follows, every requirement the model can check is served by a policy in effect, a preset the settings name included. A framework your repository follows, in its `frameworks` setting, has a requirement the model can check that no policy you check serves: none of your policies states it, directly or through its set, and no baseline the settings name does. A policy in a set you turn off with `none` in `policy-sets`, or any policy while `policies` is off, serves nothing here. For a framework Kanoniq ships, the requirements the model can check are the ones its registry marks; for a framework you declare, every id of its list counts, or, where you declare it as `{ "ids": [...], "checkable": [...] }`, only the ids `checkable` lists. A framework you don't follow is never reported. Write a policy that checks it and add the requirement to its `serves`, or leave it: what the model doesn't check isn't wrong. ## Examples In a repository that follows DORA, a later plateau removes `encrypted-crossing`, the one policy that serves `dora/9.3.a`, so it raises KQ132: ```kanoniq -policy encrypted-crossing ``` With another policy written in its place that serves `dora/9.3.a`, it raises nothing: ```kanoniq -policy encrypted-crossing policy encrypted-in-transit in architecture "Nothing travels in plaintext" serves dora/9.3.a -> deny in-transit: plaintext ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq271.md # KQ271 — a constant is used where it is seen **Error** · `constant-visible` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) A name used in a value's place is a constant written on the model, or on the element the value is written on or in, or on one that holds it. A policy, a period or an open property uses a constant written on another part of the model, which can't be seen from there: a constant is seen where it is written and in everything that element holds, and one written at a file's top level is seen everywhere. A name is looked up where it is written: in a policy, where the policy is written, never where the subject it judges sits; in a period or a property, on the element that holds it. Move the constant up to an element that holds the use, or to the top level, or write the value where it is used. ## Examples The constant is written on the payments platform, and the policy that uses it on the shop, where it can't be seen, so it raises KQ271: ```kanoniq ecosystem shop "Shop" { platform payments "Payments" { const MAX_SECRET_ROTATION = P90D } policy secret-rotation in architecture "Secrets rotate at least every 90 days" when credential: secret -> deny rotate: over MAX_SECRET_ROTATION } ``` With the constant moved up to the shop, it raises nothing: ```kanoniq ecosystem shop "Shop" { const MAX_SECRET_ROTATION = P90D policy secret-rotation in architecture "Secrets rotate at least every 90 days" when credential: secret -> deny rotate: over MAX_SECRET_ROTATION } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq272.md # KQ272 — a constant's type fits where it is used **Error** · `constant-type-fits` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) A constant used in a bound is a period or a number in the unit its clause takes; as quoted text, a string; in a period's place, a period; as an open property's value, its declared type's. A constant is used where its type doesn't fit: `const OWNER = "Owner"` in `rotate: over OWNER`, `const ROTATION = 90` in `rotate ROTATION`, or `const OWNER = P90D` as a text property's value. A bound takes a period or a number, in the unit its clause compares; a quoted clause value takes text; a period's place takes a period; an open property takes its declared type's, and a date, an enum or a ref none. A constant's type is read from how its value is written, so `"P18M"` in quotes is text. Use a constant of the right type, or write the value where it is used. ## Examples `MAX_SECRET_ROTATION` is a number, and a bound on `rotate` takes a period, so it raises KQ272: ```kanoniq ecosystem shop "Shop" { const MAX_SECRET_ROTATION = 90 policy secret-rotation in architecture "Secrets rotate at least every 90 days" when credential: secret -> deny rotate: over MAX_SECRET_ROTATION } ``` Written as the period `P90D`, it raises nothing: ```kanoniq ecosystem shop "Shop" { const MAX_SECRET_ROTATION = P90D policy secret-rotation in architecture "Secrets rotate at least every 90 days" when credential: secret -> deny rotate: over MAX_SECRET_ROTATION } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq273.md # KQ273 — a constant's name is defined once **Error** · `constant-defined-once` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) A constant's name is defined once in the whole model, never again at another level. Two constants have the same name, in two places of the model. A name is defined once in the whole model and never redefined lower down, so it always means one value. Rename one of them; two Ecosystems that want different figures give them two names. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq274.md # KQ274 — a constant's name is neither a stage nor a period **Error** · `constant-name-shape` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) A constant's name is capitals, digits and underscores, starting with a capital, and is neither a stage nor shaped as a period, so a value is never ambiguous. A constant's name is a stage, such as `PRD`, looks like a period, such as `P90D`, or isn't capitals, digits and underscores starting with a capital. Either would make a value read two ways. Pick another name: `const PROD_ROTATION = P1D`, not `const PRD = P1D`. ## Examples `PRD` is a stage, so a constant of that name raises KQ274: ```kanoniq ecosystem shop "Shop" { const PRD = P1D } ``` Named `PROD_ROTATION`, it raises nothing: ```kanoniq ecosystem shop "Shop" { const PROD_ROTATION = P1D } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq296.md # KQ296 — a requirement is listed once **Error** · `requirement-listed-once` · [Policies](https://kanoniq.extenza.dev/docs/rules.md#policies) A policy or a policy set lists each requirement it serves once. A policy or a policy set lists one requirement twice after `serves`, as in `serves nis2/21.2.h, nis2/21.2.h`. List it once. A policy that states a requirement its set already serves is not this rule's: that is the hygiene check [KP009](https://kanoniq.extenza.dev/docs/language/governance.md#kp009), `serves-redundant`. ## Examples This policy lists `nis2/21.2.h` twice after `serves`, so it raises KQ296: ```kanoniq policy-set architecture transport "Transport security" { policy encrypted-crossing "Encrypted across an ecosystem" serves nis2/21.2.h, nis2/21.2.h when across: ecosystems -> deny in-transit: plaintext } ``` Listing it once, it raises nothing: ```kanoniq policy-set architecture transport "Transport security" { policy encrypted-crossing "Encrypted across an ecosystem" serves nis2/21.2.h when across: ecosystems -> deny in-transit: plaintext } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq001.md # KQ001 — unresolved endpoint **Error** · `unresolved-endpoint` · [Structure](https://kanoniq.extenza.dev/docs/rules.md#structure) Every relationship names elements that are in the model. A relationship points at an element that isn't in the model. `kq build` already reports a reference that names nothing in a `.kq` file, so this is met only in a model that comes from somewhere else: find the element the relationship should name. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq002.md # KQ002 — duplicate identity **Error** · `duplicate-identity` · [Structure](https://kanoniq.extenza.dev/docs/rules.md#structure) No two elements share an Id, and no two elements under one parent share a Code. Two elements have the same Code under one parent, or the same Id anywhere. Rename one of them. A duplicate Id comes from copying lines in `.g.kq`; delete the copy and rebuild. ## Examples In a model whose `invoice-files` storage holds a channel named `invoice`, a plateau that adds the `invoice` entity, which takes its domain object's Code, to that storage gives two of its elements one Code, and raises KQ002: ```kanoniq plateau to-be "To be" after as-is { ecosystem shop { platform finance { object invoice "Invoice" : selling component exporter { blob invoice-files { root invoice authoritative origin identifier "Invoice Id" } } } } } ``` Moving the channel to a Code of its own in the same plateau raises nothing: ```kanoniq plateau to-be "To be" after as-is { move shop/finance/exporter/invoice-files/invoice to shop/finance/exporter/invoice-files/invoice-drop ecosystem shop { platform finance { object invoice "Invoice" : selling component exporter { blob invoice-files { root invoice authoritative origin identifier "Invoice Id" } } } } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq003.md # KQ003 — Ecosystem presence **Error** · `ecosystem-presence` · [Structure](https://kanoniq.extenza.dev/docs/rules.md#structure) A model has an Ecosystem, and every Ecosystem sits at the top level. There is no ecosystem, or an ecosystem sits inside something. Wrap the model in an `ecosystem` block at the top level of a file. ## Examples A plateau that removes `shop`, the model's only ecosystem, leaves that plateau with none, and raises KQ003: ```kanoniq plateau closed "Closed" after as-is { -shop } ``` Removing what goes from inside the ecosystem, here the ERP, raises nothing: ```kanoniq plateau closed "Closed" after as-is { ecosystem shop { -erp } } ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq004.md # KQ004 — parent cardinality **Error** · `parent-cardinality` · [Structure](https://kanoniq.extenza.dev/docs/rules.md#structure) Every element but an Ecosystem has exactly one parent. An element has no parent, or more than one. Nesting makes this impossible in a `.kq` file, so this is met only in a model that comes from somewhere else. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq005.md # KQ005 — containment reaches an Ecosystem **Error** · `containment-reaches-ecosystem` · [Structure](https://kanoniq.extenza.dev/docs/rules.md#structure) Following parents upward from any element reaches an Ecosystem, never a circle. Following parents upward goes round in a circle instead of reaching an ecosystem. Like KQ004, this is met only in a model that comes from somewhere else. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq006.md # KQ006 — owner cardinality **Error** · `owner-cardinality` · [Structure](https://kanoniq.extenza.dev/docs/rules.md#structure) A Data Entity sits in a Storage, and a Storage sits in the Component or monolith that owns it. A data entity isn't in a storage, or a storage isn't in a component or a monolith. Move the data into a `sql`, `table`, `document`, `log`, `file` or `blob` block inside the component, or the monolith, that owns it. `kq build` already refuses data or a storage written or moved anywhere else, so this is met only in a model that comes from somewhere else. © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq103.md # KQ103 — an orphaned derived element **Lint** · `orphaned-derived-element` · [Structure](https://kanoniq.extenza.dev/docs/rules.md#structure) A derived element is still named by something in the model. A derived element nothing names any more. Name it again, or remove it with `kq prune`. See [Orphans](https://kanoniq.extenza.dev/docs/language/derivation.md#orphans). ## Examples The `Shipping API` was derived from a call that is no longer written, so `kq build` marks it `derived orphan`, and it raises KQ103: ```kanoniq component shipping "Shipping" : backend { derived orphan http-api api "Shipping API" } ``` Named again by a call from the order service, it raises nothing: ```kanoniq component shipping "Shipping" : backend { derived http-api api "Shipping API" } order-service -> shipping/api over http ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq026.md # KQ026 — a relationship is stated once **Error** · `duplicate-relationship` · [Splitting a model](https://kanoniq.extenza.dev/docs/rules.md#splitting-a-model) · Quick fix in VS Code A relationship is written once, in one file or across the files of a split model. The same relationship is written twice: the same kind, the same two ends, the same protocol and the same `as` Code. The two may be in one file or in two files of a split model. Delete one of them. In VS Code, the quick fix removes the repeat and keeps the first, unless the repeat has a name, a payload format, an authentication scheme or a description the first lacks. Two statements that differ only in their `auth` are still a repeat: one call has one scheme, so keep the one that's right. Two syncs into one entity are [KQ220](https://kanoniq.extenza.dev/docs/rules/kq220.md)'s. ## Examples In a platform where `billing` already calls `order-service/orders-api` over `http`, writing that call a second time raises KQ026: ```kanoniq billing -> order-service/orders-api over http auth client-credentials export -> order-service/orders-api over http auth client-credentials ``` Stating only the new call raises nothing: ```kanoniq export -> order-service/orders-api over http auth client-credentials ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq058.md # KQ058 — a property is declared **Error** · `property-declared` · [Open properties](https://kanoniq.extenza.dev/docs/rules.md#open-properties) An open property is declared in the repository's settings, for the element type it is written on. A `#` line names a property that `kanoniq.repository.json` does not declare under `properties`, or one whose declaration's `on` does not list the type it is written on. Declare it, with its type, or add the type to its `on`; if it is a typo, correct the name. A model with no `kanoniq.repository.json` declares nothing: run `kq init` to make one. ## Examples The repository declares `cost-center`, not `cost-centre`, so this component raises KQ058: ```kanoniq #cost-centre "CC-42" component storefront-bff "Storefront BFF" : backend ``` With the name corrected to `cost-center`, it raises nothing: ```kanoniq #cost-center "CC-42" component storefront-bff "Storefront BFF" : backend ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kq059.md # KQ059 — a property's value is of its declared type **Error** · `property-value-of-its-type` · [Open properties](https://kanoniq.extenza.dev/docs/rules.md#open-properties) An open property's value, and each value of a list, is of the type its declaration gives it. A `#` line's value is not one of its property's type: a text not in quotes, a number that is not one, a boolean other than `yes` or `no`, a date that is not a calendar day, a duration not written `PT30M`, `PT4H`, `P90D`, `P18M` or `P7Y`, a URL that is not an absolute `http` or `https` one, an `enum` value its declaration does not list, a `page` naming no page file, or a `ref` naming an element of a type its `targets` do not list. Each value of a list is judged on its own, and each one not of its type is reported once. Write the value as its type takes it, or change the declaration. ## Examples `rto` is a duration, and `4h` is not one, so this component raises KQ059: ```kanoniq #rto 4h component storefront-bff "Storefront BFF" : backend ``` Written as the period `PT4H`, it raises nothing: ```kanoniq #rto PT4H component storefront-bff "Storefront BFF" : backend ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp001.md # KQP001 — well-formed YAML **Error** · `page-yaml` · [Page files](https://kanoniq.extenza.dev/docs/rules.md#page-files) A page file, a Markdown page's or a decision record's frontmatter, and a view block are well-formed YAML: one document, no key repeated. A page file is not well-formed YAML: it holds more than one document or repeats a key. The same goes for the frontmatter of a Markdown page or a decision record, which is also reported when it is missing, and for the content of a `kanoniq-view` block. Fix the YAML at the line the finding gives. ## Examples A page file that gives `description` twice repeats a key, so it raises KQP001: ```yaml description: Taking orders on the web shop. icon: store description: Everything the shop does to take an order. ``` With each key once, it raises nothing: ```yaml description: Taking orders on the web shop. icon: store ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp002.md # KQP002 — page shape **Error** · `page-shape` · [Page files](https://kanoniq.extenza.dev/docs/rules.md#page-files) A page file, a Markdown page's or a decision record's frontmatter, and a view block have every field they need and only those they take, each with a value it can take. A page file, the frontmatter of a Markdown page or a decision record, or a `kanoniq-view` block breaks its shape: a field is missing, unknown or has a value outside the set it takes. Among the faults are a `text` field in a Markdown page, `superseded-by` missing under `superseded` or given under another status, a tile with both `page` and `view`, a view without `at`, and `focus` with `domain`. Each fault is a finding of its own, so fix the field each one names. ## Examples A page file with no `description` lacks a field every page needs, so it raises KQP002: ```yaml title: Selling icon: store ``` With a `description`, it raises nothing: ```yaml title: Selling description: Taking orders on the web shop. icon: store ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp003.md # KQP003 — page name **Error** · `page-name` · [Page files](https://kanoniq.extenza.dev/docs/rules.md#page-files) A page file's name is the canonical encoding of the page's name. A page file's name is not the canonical encoding of a page name: it does not decode, or it decodes to a name whose encoding is different, such as `%2d` in lower case or an encoded letter. Rename the file to the encoding of the page's name. A space is written `-`, a `-` is written `%2D`, and any other character outside `A–Z a–z 0–9 . _ ~` is written as its UTF-8 bytes in `%XX`, in upper-case hex, so `Order Management` is `Order-Management`. ## Examples A page file for Order Management that writes its space as `%20` is not the canonical encoding of the name, so it raises KQP003: ```yaml description: Every order, from placed to delivered. icon: clipboard-list ``` Named `Order-Management.page.yml`, its space written `-`, it raises nothing: ```yaml description: Every order, from placed to delivered. icon: clipboard-list ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp004.md # KQP004 — one file per page **Error** · `one-file-per-page` · [Page files](https://kanoniq.extenza.dev/docs/rules.md#page-files) A page has one file: no two sibling files for names that differ only in case or composition, or for one name under two extensions. A page has two files. Two sibling files have names that differ only in case or in how a character is composed, or one name is written under two of `.page.yml`, `.page.yaml`, `.page.md` and `.adr.md`. The finding is on the later file in path order, which the site leaves out of the page tree. Rename that file if the two are different pages, or delete it if they are one page. ## Examples Beside the Checkout page's `Checkout.page.yml`, a `Checkout.page.md` is a second file for one page, so it raises KQP004: ```markdown --- description: Taking back what a shopper returns. icon: undo-2 --- A shopper may send an item back within 30 days of delivery. ``` Named for the page it is, `Returns.page.md`, it raises nothing: ```markdown --- description: Taking back what a shopper returns. icon: undo-2 --- A shopper may send an item back within 30 days of delivery. ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp009.md # KQP009 — a known icon **Error** · `known-icon` · [Page files](https://kanoniq.extenza.dev/docs/rules.md#page-files) An icon is named as Lucide names one of its icons. An icon is named that Lucide does not have. Name it as Lucide does, such as `shopping-cart`, `layers` or `server`; the names are listed at [lucide.dev/icons](https://lucide.dev/icons). A tile with no icon shows a default, so you can also leave `icon` out. ## Examples `cart-shopping` is another icon set's name for a shopping cart, and Lucide has no icon of that name, so it raises KQP009: ```yaml description: Taking orders on the web shop. icon: cart-shopping ``` Named as Lucide names it, `shopping-cart` raises nothing: ```yaml description: Taking orders on the web shop. icon: shopping-cart ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp005.md # KQP005 — one home page **Error** · `home-page` · [Navigation](https://kanoniq.extenza.dev/docs/rules.md#navigation) portal/ holds exactly one page file directly: the home page. `portal/` must hold exactly one page file directly, the home page, and it holds none or more than one. Keep one home page, such as `Home.page.yml`, directly in `portal/`. Move every other page file into the mirror directory of a page, since its mirror directory holds the top-level sections. ## Examples Beside the home page, `Home.page.yml`, a second page file directly in `portal/` raises KQP005: ```yaml description: Where to begin reading about the shop. icon: book-open ``` Moved into `Home/`, the home page's mirror directory, it is a section and raises nothing: ```yaml description: Where to begin reading about the shop. icon: book-open ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp006.md # KQP006 — every page is reachable **Error** · `unreachable-page` · [Navigation](https://kanoniq.extenza.dev/docs/rules.md#navigation) Every page file and decision record sits in a directory that mirrors a page. A page file or decision record sits in a directory that no page mirrors, so no page can reach it. A decision record directly in `portal/` is one, and so is any file in a mirror directory with no page file beside it; that is reported once, on the topmost page file in it, not again for each page below. Add the parent page beside the directory, or move the file into the mirror directory of a page that exists. ## Examples A decision record directly in `portal/` sits in no page's mirror directory, so it raises KQP006: ```markdown --- description: Each service is built and deployed by a pipeline of its own. status: accepted date: 2026-10-15 --- The web shop and the order service each ship on their own schedule. ``` Moved into `Home/`, the home page's mirror directory, it is a child of the home page and raises nothing: ```markdown --- description: Each service is built and deployed by a pipeline of its own. status: accepted date: 2026-10-15 --- The web shop and the order service each ship on their own schedule. ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp101.md # KQP101 — published under unpublished **Lint** · `published-under-unpublished` · [Navigation](https://kanoniq.extenza.dev/docs/rules.md#navigation) A published page sits under a published parent, since it is not rendered otherwise. A page whose status is `published`, by its own status or by default, sits under a parent that is `draft` or `upcoming`, so it is not rendered until the parent is. This is expected while a section is a draft, and the site is still written. Publish the parent when the section is ready. ## Examples Selling's child page Checkout is published, so a Selling page that is a `draft` raises KQP101: ```yaml status: draft description: Taking orders on the web shop. icon: store tiles: - page: Checkout ``` Published, Selling raises nothing: ```yaml status: published description: Taking orders on the web shop. icon: store tiles: - page: Checkout ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp007.md # KQP007 — a tile names a child **Error** · `tile-names-a-child` · [Tiles](https://kanoniq.extenza.dev/docs/rules.md#tiles) A page tile names a child page or decision record in the page's mirror directory. A page tile names a child that is not in the page's mirror directory: no page file or decision record has that name. Write the name in `page:` as the child's name reads, decoded, or add the page file or decision record to the mirror directory. ## Examples Selling's mirror directory holds the decision record `0002-Orders-are-kept-by-the-order-service.adr.md`, and a tile that names it by its file name rather than its name raises KQP007: ```yaml description: Taking orders on the web shop. icon: store tiles: - page: Checkout - page: 0002-Orders-are-kept-by-the-order-service ``` Named as it reads, decoded, it raises nothing: ```yaml description: Taking orders on the web shop. icon: store tiles: - page: Checkout - page: 0002 Orders are kept by the order service ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp008.md # KQP008 — a child is listed once **Error** · `child-listed-once` · [Tiles](https://kanoniq.extenza.dev/docs/rules.md#tiles) A page's tiles list each child once. A page's `tiles` list a child that an earlier tile already names. Each child is listed once, so remove one of the two tiles. ## Examples A Selling page whose tiles list its child Checkout twice raises KQP008: ```yaml description: Taking orders on the web shop. icon: store tiles: - page: Checkout - title: Selling, layered description: The Selling Domain in its layered view. view: at: initial domain: shop/selling - page: Checkout ``` Listed once, it raises nothing: ```yaml description: Taking orders on the web shop. icon: store tiles: - page: Checkout - title: Selling, layered description: The Selling Domain in its layered view. view: at: initial domain: shop/selling ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp102.md # KQP102 — an unlisted child **Lint** · `unlisted-child` · [Tiles](https://kanoniq.extenza.dev/docs/rules.md#tiles) A page's tiles list every child page, so their order is chosen rather than by name. A page has a child page that its `tiles` do not list. The site still shows the child, after the listed tiles and in order of name, but you have not chosen where it goes. List the child with `page: ` where you want it. The finding is on the parent and is never raised for a decision record. ## Examples Selling's mirror directory holds the Checkout page, so a Selling page whose tiles do not list it raises KQP102: ```yaml description: Taking orders on the web shop. icon: store tiles: - title: Selling, layered description: The Selling Domain in its layered view. view: at: initial domain: shop/selling ``` Listing Checkout where it goes raises nothing: ```yaml description: Taking orders on the web shop. icon: store tiles: - page: Checkout - title: Selling, layered description: The Selling Domain in its layered view. view: at: initial domain: shop/selling ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp010.md # KQP010 — a known plateau **Error** · `known-plateau` · [Views](https://kanoniq.extenza.dev/docs/rules.md#views) A view tile's or view block's at and to name plateaus of the model, its to later than its at. A view tile's or `kanoniq-view` block's `at` or `to` names no plateau of the model, or its `to` is not later than its `at`. Only `kq portal:build` finds it, since it needs the model. Write the Code of a plateau the model has, and a `to` that is later than the `at`. ## Examples In a model that declares no plateau, and so has only `initial`, a view tile drawn `at: as-is` raises KQP010: ```yaml description: Taking orders on the web shop. icon: store tiles: - title: Selling, layered description: The Selling Domain in its layered view. view: at: as-is domain: shop/selling ``` Drawn `at: initial`, it raises nothing: ```yaml description: Taking orders on the web shop. icon: store tiles: - title: Selling, layered description: The Selling Domain in its layered view. view: at: initial domain: shop/selling ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp019.md # KQP019 — a known view path **Error** · `known-view-path` · [Views](https://kanoniq.extenza.dev/docs/rules.md#views) A path that decides which view opens, a view's domain, focus or anchor, names an element of the model of a type the parameter takes. A path that decides which view a tile or `kanoniq-view` block opens, such as `domain`, `focus` or `iam`, names no element of the model at the view's plateaus, or an element of a type its parameter does not take. `domain` takes a Domain, for example, and `scenario` a scenario. Write the element's path; where exactly one element has the path's last Code, the message names its path. Only `kq portal:build` finds it, since it needs the model. ## Examples In a shop whose Domain is `shop/selling` and whose platform is `shop/storefront`, a layered view whose `domain` names the platform raises KQP019: ```yaml description: Taking orders on the web shop. icon: store tiles: - title: Selling, layered description: The Selling Domain in its layered view. view: at: initial domain: shop/storefront ``` Naming the Domain, it raises nothing: ```yaml description: Taking orders on the web shop. icon: store tiles: - title: Selling, layered description: The Selling Domain in its layered view. view: at: initial domain: shop/selling ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp106.md # KQP106 — a view's selected and collapsed paths **Lint** · `view-path` · [Views](https://kanoniq.extenza.dev/docs/rules.md#views) A view's selected path and collapsed entries name elements of the model. A view tile's or `kanoniq-view` block's `selected` path, or one of its `collapsed` entries, names no element of the model at the view's plateaus. The view still opens as named, without that selection or collapse. Write the element's path, or drop the entry. Only `kq portal:build` finds it, since it needs the model. ## Examples `order-service` is in the platform `shop/storefront`, not in the Domain, so a view that selects `shop/selling/order-service` raises KQP106: ```yaml description: Taking orders on the web shop. icon: store tiles: - title: Selling, layered description: The Selling Domain in its layered view. view: at: initial domain: shop/selling selected: shop/selling/order-service ``` Selected by its own path, it raises nothing: ```yaml description: Taking orders on the web shop. icon: store tiles: - title: Selling, layered description: The Selling Domain in its layered view. view: at: initial domain: shop/selling selected: shop/storefront/order-service ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp011.md # KQP011 — a known element **Error** · `known-element` · [Decision records](https://kanoniq.extenza.dev/docs/rules.md#decision-records) A decision record's element Id names an element of the model. A decision record's `element` names an Id that no element of the model has. Only `kq portal:build` finds it, since it needs the model. Pick the element in VS Code, which offers the model's elements after `id: ` and writes its Id and path together. ## Examples This record is about the model's architecture policies, `default-architecture`, but a digit of its `id` was mistyped, so no element of the model has it, and it raises KQP011: ```markdown --- description: No call in the shop signs in with a key; the model's architecture policies deny it. status: accepted date: 2026-09-27 element: id: aca6a5a9-f6a7-563c-801b-7f1d71dc3a0e path: default-architecture --- Every call signs in with a token from the identity provider, so no key is ever handed out. ``` With the Id the model gives `default-architecture`, it raises nothing: ```markdown --- description: No call in the shop signs in with a key; the model's architecture policies deny it. status: accepted date: 2026-09-27 element: id: aca6a5a9-f6a7-563c-801b-7f1d71dc3a0f path: default-architecture --- Every call signs in with a token from the identity provider, so no key is ever handed out. ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp012.md # KQP012 — a known successor **Error** · `known-successor` · [Decision records](https://kanoniq.extenza.dev/docs/rules.md#decision-records) A superseded decision record's superseded-by names another decision record's file, by its path from portal/. A superseded decision record's `superseded-by` names no decision record under `portal/`, or names the record itself. Write the successor's file by its path from `portal/`, such as `Home/Selling/0005-Search-keeps-its-own-index.adr.md`. A successor file with a fault of its own is reported for that fault and not again here. ## Examples The record that replaced this one sits beside it in `Home/Selling/`, and `superseded-by` is read from `portal/`, so naming the successor by its file name alone raises KQP012: ```markdown --- description: The web shop stores each order it takes in a database of its own. status: superseded superseded-by: 0002-Orders-are-kept-by-the-order-service.adr.md date: 2026-09-01 --- The web shop writes each order to its own database, and nothing else reads it. ``` Written from `portal/`, it names the record beside it and raises nothing: ```markdown --- description: The web shop stores each order it takes in a database of its own. status: superseded superseded-by: Home/Selling/0002-Orders-are-kept-by-the-order-service.adr.md date: 2026-09-01 --- The web shop writes each order to its own database, and nothing else reads it. ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp013.md # KQP013 — a chain of successors that ends **Error** · `successor-chain` · [Decision records](https://kanoniq.extenza.dev/docs/rules.md#decision-records) Following superseded-by from record to record never comes back to a record already passed. Following `superseded-by` from one decision record to the next comes back to a record already passed. The finding is reported once, on the first record of the loop in path order, and names the loop. Break the loop by changing the `status` of one record, or its `superseded-by`, so that the chain ends in a record nothing replaces. ## Examples Record 0001 is superseded by this one, so marking this one superseded by 0001 makes a loop and raises KQP013: ```markdown --- description: The web shop hands each order to the order service, which keeps it. status: superseded superseded-by: Home/Selling/0001-The-web-shop-keeps-its-own-orders.adr.md date: 2026-10-01 --- The web shop places each order through the Orders API, and the order service is the one place an order is kept. ``` Accepted, it ends the chain and raises nothing: ```markdown --- description: The web shop hands each order to the order service, which keeps it. status: accepted date: 2026-10-01 --- The web shop places each order through the Orders API, and the order service is the one place an order is kept. ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp103.md # KQP103 — the element's path **Lint** · `element-path` · [Decision records](https://kanoniq.extenza.dev/docs/rules.md#decision-records) A decision record's element path is the path its element Id is at in the model. A decision record's `element.path` is not the path its `element.id` is at in the model now, as when the element was renamed or moved. The site follows the Id, so the record still finds its element, and the path is there for whoever reads the file. Write the path the finding gives. Only `kq portal:build` finds it, since it needs the model. ## Examples This record names the model's architecture policies by their Id, but its `path` is the path of the policy `no-key` inside them, so it raises KQP103: ```markdown --- description: No call in the shop signs in with a key; the model's architecture policies deny it. status: accepted date: 2026-09-27 element: id: aca6a5a9-f6a7-563c-801b-7f1d71dc3a0f path: default-architecture/no-key --- Every call signs in with a token from the identity provider, so no key is ever handed out. ``` With the path the Id is at, `default-architecture`, it raises nothing: ```markdown --- description: No call in the shop signs in with a key; the model's architecture policies deny it. status: accepted date: 2026-09-27 element: id: aca6a5a9-f6a7-563c-801b-7f1d71dc3a0f path: default-architecture --- Every call signs in with a token from the identity provider, so no key is ever handed out. ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp104.md # KQP104 — a successor in force **Lint** · `successor-in-force` · [Decision records](https://kanoniq.extenza.dev/docs/rules.md#decision-records) A superseded decision record's successor is not proposed or rejected, since then nothing has replaced the decision yet. A superseded decision record's successor is `proposed` or `rejected`, so nothing has replaced the decision yet. A successor that is `deprecated` or `superseded` in turn is not reported. Accept the successor, or set the record's `status` back and remove its `superseded-by`. ## Examples Record 0001 is superseded by this one, so while this one is only `proposed`, nothing has replaced 0001 yet and it raises KQP104: ```markdown --- description: The web shop hands each order to the order service, which keeps it. status: proposed date: 2026-10-01 --- The web shop places each order through the Orders API, and the order service is the one place an order is kept. ``` Accepted, it is in force and raises nothing: ```markdown --- description: The web shop hands each order to the order service, which keeps it. status: accepted date: 2026-10-01 --- The web shop places each order through the Orders API, and the order service is the one place an order is kept. ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp014.md # KQP014 — an image path **Error** · `image-path` · [Page text](https://kanoniq.extenza.dev/docs/rules.md#page-text) An image in a page's text is named by a relative path to a file inside portal/. An image in a page's text is not named by a relative path to a file inside `portal/`: it is a URL, an absolute path, a path with a query or a fragment, or a path that leaves `portal/` or goes through a directory the build skips. Put the image under `portal/`, in the page's mirror directory as a rule, and name it by a path relative to the file whose text shows it. ## Examples An image taken from another host by its URL raises KQP014: ```markdown --- description: Taking orders on the web shop. --- ![Checkout flow](https://example.com/checkout-flow.svg) ``` The same image saved in the page's mirror directory, `Home/Selling/`, and named by a path from the page, raises nothing: ```markdown --- description: Taking orders on the web shop. --- ![Checkout flow](Selling/checkout-flow.svg) ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp015.md # KQP015 — an image that exists **Error** · `image-found` · [Page text](https://kanoniq.extenza.dev/docs/rules.md#page-text) An image in a page's text names a file that exists. An image in a page's text names a file that does not exist. The path is relative to the file whose text shows the image, and one written with `%XX` names the file it decodes to where the file as written is not there. Fix the path, or add the file. Only `kq portal:build` finds it, since it needs the files. ## Examples The diagram is in `Home/Selling/`, and a path is read from the page's own directory, `Home/`, so `checkout-flow.svg` names no file and raises KQP015: ```markdown --- description: Taking orders on the web shop. --- ![Checkout flow](checkout-flow.svg) ``` `Selling/checkout-flow.svg` names the file and raises nothing: ```markdown --- description: Taking orders on the web shop. --- ![Checkout flow](Selling/checkout-flow.svg) ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp016.md # KQP016 — an image type **Error** · `image-type` · [Page text](https://kanoniq.extenza.dev/docs/rules.md#page-text) An image in a page's text is a PNG, JPEG, GIF, WebP or SVG file, as its extension says and its first bytes agree. An image in a page's text is not a PNG, JPEG, GIF, WebP or SVG file, by its extension or by its first bytes. The extension is `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp` or `.svg`, in any case, and the file's first bytes must be that type's. Save the image as one of those types. ## Examples A checkout flow exported as a PDF is not a type of image a page shows, so it raises KQP016: ```markdown --- description: Taking orders on the web shop. --- ![Checkout flow](Selling/checkout-flow.pdf) ``` The flow saved as an SVG raises nothing: ```markdown --- description: Taking orders on the web shop. --- ![Checkout flow](Selling/checkout-flow.svg) ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp017.md # KQP017 — an image's size **Error** · `image-size` · [Page text](https://kanoniq.extenza.dev/docs/rules.md#page-text) An image in a page's text is at most 5 MiB. An image in a page's text is larger than 5 MiB, 5,242,880 bytes. Make the file smaller than that. ## Examples A photo of the shop that is 6 MiB is larger than the limit, so it raises KQP017: ```markdown --- description: Taking orders on the web shop. --- ![The shop](Selling/shop-photo.png) ``` The checkout flow, an SVG of a few hundred bytes, is under the limit and raises nothing: ```markdown --- description: Taking orders on the web shop. --- ![Checkout flow](Selling/checkout-flow.svg) ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp018.md # KQP018 — a link's target **Error** · `link-target` · [Page text](https://kanoniq.extenza.dev/docs/rules.md#page-text) A link in a page's text names a page file or decision record by a relative path, or is a fragment or an http, https or mailto address. A link in a page's text is relative and names no page file or decision record, or it leaves `portal/`, starts at `/` or `//`, or has a scheme other than `http`, `https` and `mailto`, such as `javascript:` or `file:`. Link to the page's file by a relative path from the linking file, such as `Selling/Checkout.page.yml`, with a `#fragment` after it if you need one. A link that is only a `#fragment`, and an `http`, `https` or `mailto` address, are kept as written. ## Examples A link that starts at `/` raises KQP018: ```markdown --- description: Taking orders on the web shop. --- Back to [the shop](/Home.page.yml). ``` A path from the page's own directory, `Home/`, up to the home page's file raises nothing: ```markdown --- description: Taking orders on the web shop. --- Back to [the shop](../Home.page.yml). ``` © 2026 Extenza Works. All rights reserved. --- Source: https://kanoniq.extenza.dev/docs/rules/kqp105.md # KQP105 — a link to an unrendered page **Lint** · `link-to-unrendered` · [Page text](https://kanoniq.extenza.dev/docs/rules.md#page-text) A rendered page links only to rendered pages, since a link to any other is written as its text. A rendered page links to a page that is not rendered, such as a draft. The site writes the link as its text, since nothing in the site links to a page it does not render. Publish the page, or remove the link. ## Examples The home page's text links to Logistics, so a Logistics page that is a `draft` raises KQP105: ```yaml status: draft description: Getting each order to the shopper's door. icon: truck ``` Published, it raises nothing: ```yaml status: published description: Getting each order to the shopper's door. icon: truck ``` © 2026 Extenza Works. All rights reserved.