The workshop has instruments, measurements, and people. A technician records a measurement for an instrument. An inspector reviews it. The organization wants to prevent the person who submitted a measurement from approving that same record. It also wants the approved content to remain identifiable afterward.
Before choosing fields, write down the events. A reading is taken, a record is created, a revision is submitted, and an approval or rejection is recorded. These are different moments. An instrument can exist without a calibration record, and a calibration can exist without being certified. A good model preserves these distinctions instead of compressing them into one boolean named done.
A small set of explicit promises
Our teaching application makes four promises within its declared operations. A saved reading names an instrument and a revision. Submission records the authenticated submitter. Approval requires an inspector with a trusted training claim and a different identity from the submitter. The measurement fields of the saved candidate do not change when it is approved.
The last promise shapes the model. We choose to make instrument, revision, and measured offset immutable from creation. A correction creates another candidate record. That is a deliberately simple revision strategy. It does not prevent two candidates from using the same instrument and revision number; a production design needing that guarantee must add and verify an appropriate uniqueness rule.
These promises do not state that two different accounts belong to different humans. They do not say that an inspector understood the measurement. They do not prevent an administrator with direct database access from rewriting storage. Those are separate obligations, and a model becomes clearer when they are named where they matter.
What ADL contributes
ADL brings fields, constraints, relationships, permissions, state machines, and other behavior into an application document. Kalos loads that document and constructs the corresponding runtime behavior. The document is therefore both something an author can review and an input to machinery that serves requests.
This arrangement reduces duplication. The field used by validation is also available to generated schema and interface consumers. The transition known to the server can also be named by a Journey. A policy beside a resource has an obvious subject. Yet a shared declaration still depends on each consumer interpreting and enforcing the relevant part correctly.
An exported API description is useful documentation. A running route is a concrete interface. A compiler verdict is evidence about a model. Keeping those artifacts separate lets you locate a disagreement: did the declaration say the wrong thing, did a consumer interpret it differently, or did the request arrive outside the expected boundary?
Turn a requirement into an observation
Suppose Alice submits record R. Her approval request should fail. Bob’s otherwise equivalent request should succeed when Bob is an inspector and has the training claim. The successful response should identify Bob as approver, and a later read should still show the submitted offset.
This comparison gives a stronger test than sending one forbidden request. If both users fail because the server cannot load the domain, no independent-review rule has been exercised. Hold the unrelated conditions constant and vary the fact that should decide the result.
The same method applies to data. Attempt to include a fabricated submitter in a request. Then read the stored record. The relevant question is what the service accepted and retained, not merely whether the client received a status code that looked reassuring.
Define the boundary before claiming success
The handbook’s runtime check uses a temporary SQLite deployment, generated resource actions, seeded test identities, and the compliance plugin. It does not exercise a production identity provider, PostgreSQL concurrency, every export route, or a browser task console. That boundary makes the result reproducible and tells us what work remains for a real deployment.
The language reference gives the wider contract. ADL 1 introduces declarations and runtime interpretation; ADL 3 owns the platform boundary. Consult them when extending the example beyond the operations checked here.
Workshop
Write a fifth promise: a rejected calibration cannot later become certified. List the transitions and other writes that could affect it. Then distinguish three kinds of evidence: a graph with no rejection-to-certification edge, an HTTP refusal of one attempted transition, and an argument covering every authorized write path. Explain what each establishes.