Tests, serving, and SDKs
Tests are in the language
A model’s behavior is asserted in the language, not in an external harness. A test "name" { … } block runs against a fresh store seeded with the package’s declared facts, and ox test discovers and runs every block, printing a verdict per test and exiting non-zero on any failure, so it doubles as a CI gate. The positive forms assert what a model derives — assert derivable F(x) succeeds when F(x) holds. The assertion is world-honest: it reads F’s world directly, so an absent row under a closed-world concept is a definite non-derivability, while an absent row under an open-world concept is unknown and the runner reports a distinct INCONCLUSIVE rather than a silent pass. The negative form, assert rejects { … }, runs a write block against an isolated copy of the store and passes exactly when the write is refused — the test that a constraint holds the line. Because the example corpus runs in CI, the tests inside it are part of the language’s own regression surface.
Serving and SDKs
A loaded .oxbin is served over HTTP. ox runtime serve binds a versioned /v1 API that dispatches the package’s declared queries and mutations by descriptor name, with batch and health endpoints alongside. Beyond declared dispatch, the API accepts ad-hoc query and mutation bodies as source text, type-checked against the loaded module by the same checker the build runs and then routed through the same path the declared forms use; the declared forms are a named convenience over this generic path. Ad-hoc submission is on by default and a deployment locks it down with --no-adhoc or restricts it to reads. There is no untyped entity-write surface: every write, declared or ad-hoc, goes through a typed mutate. The first-order tier is not served — a query touching an unsafe logic rule is refused, the same loud refusal the build makes. The reference fixes the runtime surface under the runtime contract.
An artifact also generates client code. ox gen reads the schema and emits a dependency-free TypeScript SDK, a typed runtime client, a JSON Schema, or generated documentation, so a host application calls the knowledge base through types that match its declarations. A schema-hash check rejects an SDK built against a stale artifact.
What runs today
ox build, run, query (with as_of), run-scenario, derive, and test work end to end over the in-memory store, which is the live default every example uses; the .oxbin reader and writer handle the preamble, version negotiation, validation, and all 26 axiom-body codecs. ox runtime serve answers the /v1 API, and ox gen emits the TypeScript and JSON-Schema artifacts. A Postgres backend crate exists behind the same storage trait and is selected explicitly; the in-memory backend is what the runtime exercises by default, durable only for the life of the process. A hosted production registry, the per-context incremental cache, and several optional artifact sections are specified rather than wired. The worked packages in Argon by Example are the live, CI-verified account of what runs; the reference fixes the precise rules under the build pipeline, the runtime contract, and the storage layer.