Open Utility Stack

Docs / The stack

Contracts

Every role contract the platforms exchange: what it says, who emits and consumes it, the standard it profiles, and how to check a document against it.

A contract is data, not a crate: a JSON Schema with examples and cases it must refuse. Any system that emits or consumes one takes a role in the stack, whether it is one of the platforms, a vendor system behind an adapter, or something you write yourself.

1 · Route by the URN

Set the contract's URN as the CloudEvent's dataschema, under your own type. Consumers route on it, never on your type name.

2 · Check your documents

Run the checker against your output in CI. It validates the schema and the profile's own rules.

3 · Read the rules

Each profile's states, codes and mappings are in the contracts README; the envelope rules on Conventions.

Vendor the files you use, all at once from contracts.tar.gz, and let CI compare your copy with the served one.

Orders, products and visits

order@1

TMF622 Product Ordering v5 confidential · GDPR

An order handed to a contract system changed state.

emitted bythe contract system (mako vertragd)
consumed bythe sales system (esales)the account system (konto)

urn:open-utility-stack:order:1

Schema Example Refused cases also #/$defs/Request

uv run contracts/check.py order@1 your.json

product-lifecycle@1

TMF637 Product Inventory v5 confidential · GDPR

A product (a supply contract, a line, a charging contract) changed state.

emitted bythe contract system (mako vertragd, telco contractd, emob)
consumed bythe sales system (esales)the account system (konto)

urn:open-utility-stack:product-lifecycle:1

Schema Example Refused cases

uv run contracts/check.py product-lifecycle@1 your.json

product-notice@1

the stack's own confidential · GDPR

A product's terms change or its term ends or renews while its state stays the same: a price change, the end of a fixed term, an automatic renewal, a move.

emitted bythe contract system (mako vertragd, telco contractd, emob)
consumed bythe sales system (esales)

urn:open-utility-stack:product-notice:1

Schema Example Refused cases

uv run contracts/check.py product-notice@1 your.json

appointment@1

TMF646 Appointment v4 confidential · GDPR

A field visit was agreed, done, failed or called off.

emitted bythe field-service system (fieldlink, or any vendor system)
consumed bythe sales system (esales)the telco contract system (telco contractd)

urn:open-utility-stack:appointment:1

Schema Example Refused cases

uv run contracts/check.py appointment@1 your.json

Charges, bills and collection

rated-charge@1

TMF635 Usage v5 confidential · GDPR

One rated line for one settlement period, before invoice rounding.

emitted byenergy rating (mako billingd)
consumed byinvoice settlement (mako billingd)the account system (konto)

urn:open-utility-stack:rated-charge:1

Schema Example reverse-chargenot-subjectcorrection Refused cases

uv run contracts/check.py rated-charge@1 your.json

bill-section@1

the stack's own confidential · GDPR

What a contract engine contributes to a convergent bill: its section's heading and the texts and facts its sector's law requires on every bill (§ 40 EnWG for electricity and gas, § 62 TKG and the TK-Transparenzverordnung for telecoms, AVBWasserV, AVBFernwärmeV and FFVAV for water and heat).

emitted byevery contract system (mako, telco, emob)
consumed bythe account system (konto)

urn:open-utility-stack:bill-section:1

Schema Example Refused cases

uv run contracts/check.py bill-section@1 your.json

bill@1

TMF678 Customer Bill v5, with the EN 16931 invoice attached confidential · GDPR

An issued bill for one contract account: every sector's sections, each line rounded once, the VAT groups, the totals and what was prepaid.

emitted bythe account system (konto)
consumed bythe customer portalanyone who wants to verify a bill

urn:open-utility-stack:bill:1

Schema Example Refused cases

uv run contracts/check.py bill@1 your.json

collection-terms@1

the stack's own confidential · GDPR

The rules under which an overdue claim from one contract may lead to a suspension of supply, as the contract's engine states them under its own law (§ 19 StromGVV and §§ 41f, 41g EnWG for electricity and gas, § 61 TKG, AVBFernwärmeV § 33, AVBWasserV § 33). The engine publishes it per contract or product; the account system (konto) evaluates it and proposes, never decides (D2). A suspension it proposes reaches the engine as an order@1 Request with a suspend item.

emitted byevery contract system (mako vertragd, telco contractd, a heat or water engine)
consumed bythe account system (konto, konto-collect)

urn:open-utility-stack:collection-terms:1

Schema Example Refused cases

uv run contracts/check.py collection-terms@1 your.json

Grid flexibility

flex-request@1

UFTP 3.1 FlexRequest (§ 4.2.24) internal

A grid operator asks aggregators for flexibility on a congestion point: per ISP, the power range it can accept, and where it needs a deviation.

emitted bythe DSO role (fms)
consumed byaggregators (flexpool)

urn:open-utility-stack:flex-request:1

Schema Example Refused cases

uv run contracts/check.py flex-request@1 your.json

flex-offer@1

UFTP 3.1 FlexOffer (§ 4.2.26) confidential

An aggregator offers flexibility, answering a flex-request@1 or unsolicited: one or more priced options, of which the grid operator may order at most one.

emitted byaggregators (flexpool)
consumed bythe DSO role (fms)

urn:open-utility-stack:flex-offer:1

Schema Example Refused cases

uv run contracts/check.py flex-offer@1 your.json

flex-prognosis@1

UFTP 3.1 D-Prognosis confidential

An aggregator's D-Prognosis: the power it expects at one congestion point for one day, per ISP, before any order.

emitted byaggregators (flexpool)
consumed bythe DSO role (fms), for `dprognosis@1` settlements

urn:open-utility-stack:flex-prognosis:1

Schema Example Refused cases

uv run contracts/check.py flex-prognosis@1 your.json

flex-order@1

UFTP 3.1 FlexOrder (§ 4.2.27) confidential

A grid operator orders flexibility, usually one option of a flex-offer@1, at a share of it. A profile of UFTP 3.1 FlexOrder (§ 4.2.27). The activation it carries reaches devices as a limit or schedule.

emitted bythe DSO role (fms)
consumed byaggregators (flexpool), then the device path

urn:open-utility-stack:flex-order:1

Schema Example Refused cases

uv run contracts/check.py flex-order@1 your.json

flex-settlement@1

UFTP 3.1 FlexOrderSettlement (§ 4.2.28), computed as § 2.6 confidential

The settlement of one flex-order@1 for one day: per ISP, baseline, ordered, actual and delivered power and the deficiency, and the price less the penalty.

emitted bythe DSO role (fms)
consumed byaggregators (flexpool), the account system (konto)

urn:open-utility-stack:flex-settlement:1

Schema Example Refused cases

uv run contracts/check.py flex-settlement@1 your.json

flex-register@1

the stack's own confidential · GDPR

A grid operator's registers of flexibility service providers and controllable units, as one data file it serves read-only (fms).

emitted bythe DSO role (fms), served read-only
consumed byservice providers (flexpool)the DSO's own flex-request@1 and flex-order@1

urn:open-utility-stack:flex-register:1

Schema Example Refused cases

uv run contracts/check.py flex-register@1 your.json

Privacy

erasure@1

the stack's own confidential · GDPR

A person's data was erased by the emitter, and every consumer that received data about them must erase or anonymise its copies (G7; Art. 17(2) and Art. 19 GDPR). The event names the person only by references consumers already hold.

emitted byevery role that holds personal data (esales, konto, mako, telco, emob, fieldlink)
consumed byevery consumer of that role's events

urn:open-utility-stack:erasure:1

Schema Example Refused cases also #/$defs/Confirmation

uv run contracts/check.py erasure@1 your.json

Shared definitions

What the profiles share. A profile refers to them by URN; you rarely validate against them alone.

common/money

An exact amount of money.

urn:open-utility-stack:common:money:1

Schema

common/time

Instants are UTC; business dates are civil dates in a named zone.

urn:open-utility-stack:common:time:1

Schema

common/reference

The client reference of a command (conventions REF-1 to REF-6) and the reference tuple of a market message (REF-7).

urn:open-utility-stack:common:reference:1

Schema

common/flex

What the four flexibility profiles share: the market context of a UFTP exchange, ISP spans and powers.

urn:open-utility-stack:common:flex:1

Schema