Docs / The stack
Conventions
The rules for every seam between platforms: contracts, the CloudEvents profile, the client reference and idempotency, and how much an AI may do on its own.
Platforms in the stack meet only at runtime, through contracts. This page is the one place those contracts’ shared rules are written down. A platform, an adapter for a vendor system or a third party that follows them can take any role in the stack without anyone else changing code.
How to read it. MUST, SHOULD and MAY are used as in
BCP 14 (RFC 2119 and RFC 8174). Every rule
has an id, such as CE-3, and says how it is checked. The conformance probes report
passed, failed or unsupported per id. A rule nobody can check is a wish and isn’t on
this page.
Version: conventions 1, 2026-11-29. A change that tightens a rule gets a new version, like any contract (and a deprecation window once anyone runs the stack in production).
Seam rules (G1–G9)
| Id | Rule | Checked by |
|---|---|---|
| G1 | Every contract has exactly one owner and is published as data, never as a shared crate. A port (a command a platform needs filled) belongs to that platform; an event to its emitter; a role contract (what every filler of a role emits, such as order@1 or appointment@1) is a profile of the standard it follows, kept in the umbrella’s contracts catalogue. All three are JSON Schema plus a probe. Consumers generate or write their own types. A platform’s published events catalogue (type names, schema URIs and payload types, with no I/O) is not a contract; the schema is. | the catalogue lists one owner per contract; no member depends on another platform’s crate (just check) |
| G2 | Events are routed by contract, not by sender. A consumer MUST select events by dataschema, never by a type prefix. The emitter keeps its own type namespace (de.<platform>.*). | consumer probe: the same payload under a foreign type is still handled |
| G3 | Use a standard payload where one exists. TM Forum Open APIs for cross-sector shapes (order, usage, bill, account, party, appointment); BO4E, pinned, for energy details; the EDI@Energy API-Webdienste exactly as published; OCPI concepts for charging; EN 16931 for invoices. Extensions are namespaced attributes, never a fork. | schema review; extensions live under a namespace |
| G4 | Events carry the business state they promise, not just a key. A receiver needs no read access to the sender to act. Personal data is limited by G7. | the schema has the state fields; probe without callback credentials |
| G5 | Commands are idempotent, and their outcome arrives as events. See the client reference. | REF-1 to REF-6 |
| G6 | Name roles, not platforms. Configuration and documentation say “the contract system”, “the market-communication gateway”, never a product name. | configuration keys and docs name roles |
| G7 | Broadcast business state, not personal data. Every event declares its classification (CE-6). Personal data not every consumer needs (bank, contact, birth date) stays behind a reference: the dataref claim check or a call with the receiver’s own credentials. Every role that holds personal data emits erasure@1, and every consumer acts on it. Crypto-shredding is defence in depth, not proof of erasure. | schema scan for personal fields in broadcast events; erasure probe |
| G8 | Platforms do not invent authentication between themselves; the operator brings it. Webhooks are signed with Standard Webhooks. No unauthenticated endpoint that changes state on a network port. No shared static secret (an API key or bearer token baked into both sides) as the way one platform authenticates another: the operator puts its own standard in front (a gateway, OIDC, a service mesh). A webhook signing key (whsec_) per sender and receiver, rotated with two keys accepted during the overlap, is the first rule, not a shared static secret. Where a platform must know its caller, it chooses how. | probe: unsigned webhooks are refused; a state-changing endpoint on a network port refuses an unauthenticated call |
| G9 | Dependencies point down, never sideways. A platform depends on standalone and standards crates, never on another platform’s internal crate. A crate is judged by what it depends on, not by the workspace it lives in: a crate that depends on no platform crate and knows no stack is standalone, even when it is developed in a platform’s repository. A cross-domain platform (esales, konto, fieldlink) depends on no sector crate. | just check, from cargo metadata and stack.toml |
The CloudEvents profile
Events between platforms are CloudEvents 1.0.2. CloudEvents’ documented extensions “have no official standing and might be changed, or removed, at any time”, so this profile pins exactly the ones it uses and how.
| Id | Attribute | Rule |
|---|---|---|
| CE-1 | id, source | source + id is unique (the spec’s own rule), so a consumer MUST deduplicate on that pair, per authenticated sender: source is only what the sender claims, so the same pair from another sender is not a duplicate but a conflict (409), as REF-1 already holds for references. An id is at most 256 characters. The tenant is part of source, for example https://estate.example/tenants/swm/esales; there is no tenancy extension. The emitting component may follow the platform (…/tenants/swm/emob/billd); consumers never parse past the tenant. |
| CE-2 | type | de.<platform>.<aggregate>.<event> in the past tense: de.esales.order.accepted. The aggregate may be dotted where a platform groups them: de.mako.gpke.lieferbeginn.completed, de.fms.flex.request.sent. Meaning comes from dataschema (G2). |
| CE-3 | dataschema | Required. The contract’s URI, carrying its major version only: urn:open-utility-stack:product-lifecycle:1 for a role contract (the schema’s $id in the umbrella’s contracts/), the owner’s own URI for a port or event, which MUST carry the major in the path (…/events/v1/<type>.json); an older unversioned path stays served for the deprecation window (CE-11). A JSON Pointer fragment is allowed when it names the payload’s schema: into an envelope schema (…/v1/<type>.json#/properties/data) or into a data schema’s $defs (urn:open-utility-stack:erasure:1#/$defs/Confirmation); it is part of the URI. Consumers match it exactly, fragment included. An additive change keeps the URI, because producer schemas are closed and CI proves the change compatible; a breaking change gets a new major and a new URI, as the spec asks (incompatible changes SHOULD get a different URI). |
| CE-4 | subject | The business reference the event is about, for filtering by middleware that cannot read data. For a command’s outcome it MUST equal data.client_reference (REF-2). An event about another object the command changed (a product an order created) has that object’s id as subject. Optional otherwise. |
| CE-5 | partitionkey | Required: the aggregate the event is about, such as a contract or job. Events with the same key are ordered. On Kafka the record key MUST equal it; the Kafka binding does not guarantee that on its own. Over signed webhooks a sender’s key SHOULD bound the partitions it may write (a site’s key, that site’s events), and a receiver MAY refuse an event outside them. |
| CE-6 | dataclassification, dataregulation, datacategory | dataclassification required: public, internal, confidential or restricted. It is set per event: a catalogue entry gives the default for its type, and an emitter MAY raise it for one event (an alarm about one household’s battery is personal data) but never lower it. Events with personal data set dataregulation to GDPR. datacategory (standard, sensitive or special-category) is required whenever dataregulation is set; a receiver never assumes a default. A consumer MUST reject an event that lacks dataclassification or carries a value it does not recognise, as the extension requires. |
| CE-7 | correlationid, causationid | Required on every event caused by a command or another event: correlationid is the whole chain, causationid the direct cause’s id. These are technical; the business reference stays in data (REF-1). |
| CE-8 | traceparent, tracestate | Hop-by-hop trace context travels in the transport’s headers (W3C Trace Context). The attributes, when set, carry the trace that started the chain and MUST NOT be rewritten per hop, as the distributed-tracing extension says. Spans follow the OpenTelemetry semantic conventions for messaging and CloudEvents spans (status: Development): the span that processes an event SHOULD link to the event’s creation context, read from its traceparent; it MAY take that context as parent only for a single event processed outside any other span (mako’s outbox and inbound requests do this), and is NOT RECOMMENDED to when it runs inside another span. An event produced from several inputs (an order on a market round) therefore continues its own process’s trace, links each input, and names its direct cause by causationid (CE-7). The link lives on the exported span; no CloudEvents attribute carries it, and a platform without a span exporter has nothing to add. Spans carry cloudevents.event_id and cloudevents.event_source (required) and cloudevents.event_type, cloudevents.event_subject (recommended). Trace ids are random, or derived (so replayed inputs give identical events) with the W3C Level 2 random flag cleared; both are fine, as long as an id is unique per trace. |
| CE-9 | sequence | Optional: a per-partitionkey counter, lexicographically ordered (zero-padded), for consumers that see webhooks out of order. |
| CE-10 | authtype, authid | Required on events an agent or a person caused (AUT-6): who acted, for the audit trail. Informational only; the extension “is not intended to secure CloudEvents”. Security is G8. |
| CE-11 | deprecated, deprecationfrom, deprecationsunset, deprecationmigration | Set by the emitter on every event of a contract version in its deprecation window (at least 12 months). Only once a window applies: before production there is none (Contract versions). |
| CE-12 | time | RFC 3339 with a UTC offset of Z. Business dates (a delivery day, a billing period) are in data and name their zone. |
Binding modes. Over webhooks, events travel in structured mode
(application/cloudevents+json): the Standard Webhooks signature covers only the body,
so attributes sent as HTTP headers in binary mode would be unsigned. Over Kafka, binary
mode, with the record key set by CE-5. Batches are JSON arrays of structured events
(application/cloudevents-batch+json), each deduplicated on its own (CE-1).
The client reference and idempotency
A hand-over between platforms is a command. The party that sends it names it, and that name follows it to the end.
| Id | Rule |
|---|---|
| REF-1 | A command carries client_reference in its body: an opaque string of 1 to 128 printable ASCII characters, chosen by the sender, compared byte for byte. The receiver never parses, trims or normalises it. Its identity is the pair (authenticated sender, client_reference), so two senders cannot collide. |
| REF-2 | Every event about the command’s outcome carries data.client_reference unchanged, and subject with the same value (CE-4). data is normative: a consumer MUST correlate on data.client_reference. subject lets a broker filter, and the two MUST NOT differ. The outcome is the profile that answers the command (order@1 for an order). An event about an object the command changed (product-lifecycle@1) is a separate event: its own id, subject the object’s id, data.client_reference still the command’s, the same correlationid. |
| REF-3 | Over REST, the command also carries the HTTP Idempotency-Key header with the same value, as in the IETF Idempotency-Key draft (-09, a working-group draft, not yet an RFC). |
| REF-4 | A repeated command with the same content returns the original acknowledgement. The same reference with different content is refused with 422, a missing reference with 400, an Idempotency-Key that differs from the body’s client_reference with 400, a repeat while the first is still being processed with 409, each as RFC 9457 problem details (the draft’s status codes). A refusal is permanent: a reference is never reused. |
| REF-5 | The receiver publishes how long it remembers references, and it is at least 30 days. A reference seen again after that window is refused, not executed twice. |
| REF-6 | The outcome arrives as lifecycle events, for an order the states of order@1 (acknowledged, rejected, inProgress, completed, failed, …) and for the product product-lifecycle@1; the synchronous answer is only an acknowledgement. |
| REF-7 | Market messages correlate by their full reference tuple, never by a MaLo, a MeLo or a document number alone: the original’s BGM document number and transaction number (CNI; ORDERS and ORDRSP have none, so their document number stands alone), the market partner ids of both sides with their roles, and the direction. A location can carry several processes at once, and numbers repeat across partners. The rules are in the contracts’ common/market-correlation.md. |
The client reference is a business name, chosen by a person’s system and quoted in
letters and phone calls. correlationid is a technical chain id the runtime sets (CE-7).
Keep them apart: a retry gets a new id and the same client_reference.
Autonomy levels
An AI agent never decides how much it may do. Every operation an agent can call declares its level; the runtime enforces it, never a prompt.
| Level | Meaning | Mechanism | MCP tool annotations |
|---|---|---|---|
read | answers questions | a plain tool call | readOnlyHint: true |
propose | creates a draft, a reply or an approval request; the system keeps the decision | the core records the proposal | readOnlyHint: false, destructiveHint: false |
act-with-approval | dispatches after a person approved this exact call | an oversight task in agentplane | as the operation is; the approval is bound to the call’s arguments |
act | dispatches on its own | policy-gated and journaled | as the operation is, with idempotentHint true only if REF-4 holds |
| Id | Rule |
|---|---|
| AUT-1 | The level is declared per operation in the OpenAPI x-mcp extension, next to the tool name. A tool with no REST twin declares it in its MCP _meta under the same key ("x-mcp": {"level": "read"}). An operation without a declared level is not exposed to an agent at all: the MCP surface that would carry it refuses to start and names the tool. Silently leaving the tool out is not allowed; it hides the bug behind a working server. |
| AUT-2 | The ceiling comes from the decision class of what the operation affects: D0 operational (no effect on a person): up to act. D1 reversible business step: act only inside an envelope a person approved, with a recorded way back. D2 significant for a person (credit, refusing or ending a contract, dunning towards a supply stop): propose; the person’s decision is then carried out by act-with-approval. D3 a device, a limit, the grid: read, and propose an explanation; no AI on the control path. |
| AUT-3 | Never act by default for an operation that moves money, concludes or changes a contract, switches a physical device or limits a customer’s supply (§ 14a EnWG, a Sperrung). Raising it needs D1 and an envelope (AUT-2). |
| AUT-4 | Enforcement is in the runtime (agentplane’s policy gate, Cedar), not in the model: the model never sees a tool above its level. MCP annotations are set to match the level so clients can warn a person, but the MCP spec treats them as untrusted hints, and so does the stack. |
| AUT-5 | Calculations of record stay deterministic: prices, quantities, limits, invoices, deadlines, EDIFACT. An agent may propose or explain them; before anything takes effect, the core recomputes and checks it. |
| AUT-6 | Every event an agent causes carries authtype and authid (CE-10), and its decision is in the journal with the inputs it saw. |
The MCP defaults assume the worst: a tool without annotations is “non-read-only, potentially destructive, non-idempotent, and open-world”. AUT-1 goes one step further: undeclared means unavailable.
Operations
One rule, so an operator’s probes and dashboards work the same on every platform.
| Id | Rule |
|---|---|
| OPS-1 | A daemon SHOULD serve /livez, /readyz (the Kubernetes names) and OpenMetrics at /metrics on a separate operations listener, never on the public port. Metric names start with the platform’s name (fms_, ems_). No label carries personal data: no premises, meter, reading, account or certificate subject. |
Contract versions
- JSON Schema is the contract. AsyncAPI 3 documents may be generated from it for discovery, never the other way round.
- Producer schemas are closed (
additionalProperties: false), so an additive change can be proven compatible; consumers are tolerant readers anyway. - An additive change keeps the
dataschema; a breaking change is a new major and a new URI.oasdiff breakingchecks every OpenAPI change, schema compatibility checks every event change, in CI. - Before production, a breaking change is a hard cut. While no deployment of the emitter or of a consumer runs in production, the new major replaces the old one in the next release: the old schema and code path are removed, the CHANGELOG says what broke, no CE-11 attributes, no dual emission. Emitter and consumers release together. The new URI still makes a consumer that has not switched refuse the event instead of misreading it. No platform runs in production yet.
- From the first production deployment, which the platform announces in its CHANGELOG, the previous major stays supported for at least 12 months, announced with CE-11 and in the catalogue.
- Conformance is spec-driven. Every contract ships a probe any implementer runs against their own system; a vendor the stack has never met can prove its adapter.
Which platform follows which rule today is on the roadmap and the version matrix, not here.