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 <name>.g.kq.
Declaring plateaus
- Exactly one plateau has no block, and the file's top level is its content: usually the first, as
as-isabove. - Every other plateau has a block, and names the plateau before it with
after. The plateaus form one line, one after another. datedis 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
initialplateau 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, 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, a relationship 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 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; an environment line that stands where its module is restated as not deployable, KB010; a move onto a path the same plateau adds, or a second move of the same element, KB042; and a - line taking what the same plateau moves, 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.
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:
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:
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 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.
- 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.
- 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.
kq arrangegives each plateau a file,model/plateaus/000-as-is.kq,001-to-be.kqand on, in order (seekq arrange).
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).
- 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).
startsandbyare optional full days, in that order. Both fall after the plateau before and on or before the plateau delivered, where those are dated, andstartsis not afterby(KQ050).coversnames 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).linkpoints at where the work is tracked: an absolutehttp://orhttps://URL, or the path of a page file from the repository's root (KQ051).- 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-<platform>-<object>, covering the old and the new authoritative entity, and writes it into <name>.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 <name>.g.kq stops writing it. In VS Code, Adopt data migration on a derived migration's line in <name>.g.kq writes that declaration for you, with its covers lines, and puts the cursor in its empty name (Working in VS Code). 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).
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, 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 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.