Sander Sax
Back to paid client work

Aontu's vet passes JSON that was cut off halfway

Alexandr Khrustalev, November 2026

cut.json stops in the middle of a number and has no closing braces.

{
  "services": {
    "api": { "owner": "platform", "tier": 1, "replicas": 6 },
    "auth": { "owner": "identity", "tier": 3, "replicas": 1

The complete file gives auth 12 replicas and has a third service called billing. Aontu called the shortened version valid, with the two strictest vet flags I could find switched on.

Aontu is a JSON superset built on unification. Its npm description calls it a validation gate for AI-agent ground truth, and the site says a change proposed by a coding agent is either admitted or refused. I tried version 0.76.1 from npm this week. The language is well designed and its error reports are very good, but I would not put bare aontu vet in front of agent output, because it reads untrusted data as source code.

What it gets right

Schema, defaults and data share one notation, and two statements about one path must agree. A later value cannot quietly replace an earlier one. This is the model I used throughout, a service type with defaults, applied to every key of services.

spec: type({ service: { owner: string, tier: *1 | integer, replicas: *3 | integer } })
services: { &: $.spec.service }

A wrong value gets a report that names both sides of the conflict, with line and column.

$ aontu vet model.aontu bad.json
verdict: invalid

$.services.api.tier: empty [conflict]
  [aontu/empty]: Cannot unify values at path $.services.api.tier
  data: bad.json:1:55 ("high")
  schema: model.aontu:1:46 (*1|integer)
exit 1

Exit codes separate valid, invalid, incomplete and a broken schema, so a repair loop can branch on them. model why traced a default back to its source column. breaking reported a newly required key between two versions of a model. hash gave the same result for two differently formatted files with the same meaning.

Aontu is also stricter than JSON.parse about values. JSON.parse turned 12345678901234567890 into 12345678901234567000 without complaint, and vet refused it with lossy_integer_literal.

Speed was fine for this job. On 50,000 generated services, a 2.6 MB file on my Windows machine, the median vet took 5.2 seconds against 6.7 for cue vet. CUE was faster at 10,000 services, 0.3 seconds against 1.2.

Data is read as source

The opening result has a simple cause. vet.ts passes the data text to aontu.parse, the same call it uses for the schema, and nothing treats a .json file differently. That parser comes from @tabnas/jsonic, where the rule.finish option closes open structures at the end of input and defaults to true. The project's published ABNF requires the closing brace and states that the parser may accept more.

That leniency suits files people write by hand. It is a poor fit for agent output, because a response that hits a token limit ends exactly like this. I cut this file myself, but the failure is ordinary. CUE 0.17.1 refuses the same bytes.

$ cue vet model.cue json: - < cut.json
invalid JSON for file "-": unexpected end of JSON input:
    -:4:59
exit 1

With ajv 8.20.0 the schema never runs, because JSON.parse throws first. Aontu does catch some cuts. A cut inside a string gives unterminated_string, and a cut that loses a required key gives incomplete. A cut through a number, or right after a complete entry, passes. The coverage line is no help, since it reports 6 of 6 leaves for a file that originally had 9.

I tried the obvious fix by setting finish to false in a local copy. vet then failed with end_of_source on the schema itself, because brace-free top-level syntax depends on the same behaviour. So the fix has to be a separate strict path for data, and main does not have one as I write this.

Data can compute and read files

Since data is source, this file passes vet, and replicas evaluates to 4.

{ "services": { "api": { "owner": "platform", "replicas": 2 + 2 } } }

Includes are more serious. A file under test can pull in another file, and a failed check prints the value it read.

{ "services": { "api": { "owner": "platform", "tier": @"./secret.txt" } } }
$ aontu vet model.aontu peek.json
verdict: invalid

$.services.api.tier: empty [conflict]
  [aontu/empty]: Cannot unify values at path $.services.api.tier
  data: peek.json:1:55 ("db-password-from-the-repo\n")
  schema: model.aontu:1:46 (*1|integer)
exit 1

So an agent that can propose a data file could print a file from the checkout into a CI log. An include from outside the folder worked the same way. The bare aontu command warned about that one, and vet printed no warning, although trust.md describes a warning for every such resolution.

The project knows about this risk. The README warns that evaluating a document you did not write runs it, --trust none refused the include in my test, and trust.md says a later major version will deny out-of-root includes by default. That plan would not cover a file in the same folder, and the project's own GitHub Action passes no --trust flag unless you add one. A verb whose whole job is reading untrusted input should start with includes off.

The closed flag stops at the top level

Maps are open by default, so a misspelled key is accepted and the default stays in place. Here typo.json sets teir to 3, and typo.aontu is the same mistake inside a model.

$ aontu vet --closed model.aontu typo.json
verdict: valid
exit 0

$ aontu model get '$.services.auth' typo.aontu
{
  "owner": "identity",
  "teir": 3,
  "tier": 1
}
exit 0

The author wanted tier 3 and got tier 1. JSON Schema has the same default, and ajv returned true for this file until I set additionalProperties to false, so open maps are a defensible choice. CUE definitions are closed, and cue vet answered field not allowed.

The flag is the real problem. The agent skill shipped in the npm package says --closed refuses keys the model does not declare, and teir is such a key. The source closes only the anchor, which is the document root unless you move it. The --help text does say anchor, but nobody reading it would guess that a nested typo gets through. Writing close() in the model works, and the how-to guide recommends that.

What I would run today

This wrapper handles every case above, given a model that uses close().

const { readFileSync } = require('node:fs')
const { vet } = require('aontu')

const [schemaFile, dataFile] = process.argv.slice(2)
const schema = readFileSync(schemaFile, 'utf8')
const data = readFileSync(dataFile, 'utf8')

try {
  JSON.parse(data) // only a syntax check, vet still reads the original text
} catch (err) {
  console.log(`refused: ${err.message}`)
  process.exit(1)
}

const report = vet(schema, data, { trust: { include: 'none' } })
console.log(report.verdict)
process.exit(report.verdict === 'valid' ? 0 : 1)
$ node gate.js model-closed.aontu cut.json
refused: Expected ',' or '}' after property value in JSON at position 139 (line 4 column 60)
exit 1

$ node gate.js model-closed.aontu sum.json
refused: Expected ',' or '}' after property value in JSON at position 60 (line 1 column 61)
exit 1

$ node gate.js model-closed.aontu peek.json
refused: Unexpected token '@', ...", "tier": @"./secret"... is not valid JSON
exit 1

$ node gate.js model-closed.aontu typo.json
invalid
exit 1

None of this should need a wrapper. vet should read .json data with a strict parser, keep includes off for data documents, and apply --closed at every depth.

Priorities are my wider concern. The CLI help lists 28 verbs, including a package manager, a language server and an MCP server. The site's install line pins 0.73.0, npm serves 0.76.1 and the GitHub Action defaults to 0.58.0. A project that describes itself as a gate should settle how it reads input before adding more around it.

Who should use it

Use Aontu for models your own team writes and reviews, where unification, model why and breaking justify learning a new language. Pin the version, since it is still 0.x.

Do not point bare aontu vet at agent output or at any file you did not write. For a gate today, use CUE, or JSON Schema with ajv and additionalProperties set to false, or wrap Aontu as shown above. I tested the npm build on Windows only, so none of this speaks for the Go port.

Back to paid client work