aontu

Playground

Run aontu@0.72.0 in your browser. The documents you enter are evaluated in this tab and are not sent to a server.

main.aon

Result

Type on the left. This fills in a second after you stop.

Loading the engine… the playground needs JavaScript, because the engine runs here rather than on a server.

Unify the document and print the JSON it means.

schema.aon included when main.aon asks for it
Examples

What is actually running

The whole engine, in a web worker beside this page. Both documents are mounted in an in-browser filesystem, so @"./schema.aon" resolves exactly as it would on disk, which is why splitting a model across files is one of the examples rather than a paragraph.

Most of the operations here are command-line verbs (9 of them) and each takes the arguments it takes there: vet reads the schema first and the data second, breaking reads the earlier version first. Evaluate is what aontu main.aon does with no verb at all. Everything the reference states about flags and exit codes is about the same code path.

Package commands and a vendored dependency closure need a local filesystem, which this playground does not provide. Evaluation uses the budgets in the trust contract, but there is no wall-clock deadline. Use Stop to interrupt a large model. You can inspect the engine bundle and its build configuration.

What each example shows

A schema, a default and data

Three kinds of statement about one value, combined in a single operation. The default yields to the data; the type holds either way.

port:    *8080 | integer
host:    string
host:    "localhost"

A contradiction, located

Two statements that cannot both hold are not a warning and not a silent last-writer-wins. They are an error naming both sites.

port: integer
port: "high"

Layers, without a precedence table

The prod block states one fact of its own and inherits the rest. Nothing is overridden, so the order the two blocks are written in cannot change the answer.

defaults: {
  replicas: *2 | integer
  logLevel: *"info" | string
}

prod: $.defaults & {
  replicas: 6
}

Hold data to a schema

The gate verb. The schema is an ordinary document, so validation is unification with a verdict attached, and a finding that names the line in each file.

service: {
  name: "checkout"
  port: "8080"
}

with schema.aon:

service: {
  name: string
  port: integer
}

Ask why a value holds

Every conjunct that contributed to the value at a path, with the row and column that wrote it. This is what a merge tool cannot tell you.

defaults: {
  replicas: *2 | integer
}

prod: $.defaults & {
  replicas: 6
}

Split across two files

The include on the first line pulls the second pane in. Both documents are real files in an in-browser filesystem, so it resolves exactly as it would on disk.

@"./schema.aon"

host: "localhost"
port: 443

with schema.aon:

host: string
port: *8080 | integer

Pin what it means, not how it is written

The canon-hash is taken over the document's meaning. Reformat this, reorder the keys, change the comments: the pin does not move. Change a value and it does.

# an entirely cosmetic comment
service: {
  port:    8080,
  name:    "checkout",
}

What changed between two versions

The earlier version on the right, the current one on the left. The answer is a list of paths, not a text diff: a key that moved has not changed.

service: {
  name: "checkout"
  port: 8080
  region: "eu-west-1"
}

with schema.aon:

service: {
  port: 8080
  name: "checkout"
}

Find the entries that say nothing

The spread template states what every sibling has, and auth restates one of those facts, so the document means the same thing without it. The verb finds that by deleting and re-evaluating, not by matching text.

services: {
  &: { tier: "standard", replicas: *1 | integer }

  auth:    { tier: "standard", replicas: 3 }
  billing: { replicas: 1 }
}

Write the stanza for an agent

What an agent needs in order to read this definition rather than restate it: the pin, the shape, and the four commands that answer questions about it.

service: {
  name: string
  port: *8080 | integer
}

Continue on your machine

npm i aontu gets you the same engine with a filesystem under it, a REPL, and every verb in the reference. The tutorial is the guided version of what this page lets you poke at, and the how-to guides answer the narrower questions.