Why compile a self-hosted AI workflow?
On this page
With a compiled refund policy, you can point to the code that checks the delivery date and the amount paid. At a manual desk, a person applies the policy. In a tool-calling agent loop, an LLM chooses the next step. Cernanto compiles the policy before deployment, and on its self-hosted runtime those checks run as code. Models still read the request and draft the reply, and a person handles exchanges and other exceptions.
See the refund workflow · When does a workflow call a model? · What does it cost?
The argument in full: Intent becomes source: the next generation of programming languages.
From the blog: The TypeScript is not your source code anymore · What “however soon” means in a program written in English
Cernanto keeps a specification in natural language as the source of a program. A coding assistant translates it into TypeScript; contracts, static gates and independently written tests check the translation; a durable runtime executes it.
That design addresses two separate problems: maintaining the intent of generated code, and running a procedure whose progress must survive failures.
Keep the source you meant
A coding assistant can produce a working application from a conversation. What stays in your repository is its output. The source was what you asked for, and a conversation holds no single state of that: a request, a correction, and a fix that undid an earlier fix. When a better coding model arrives, the code tells it what the earlier one did and cannot tell it what you meant. The long-term question is what you maintain when the requirements change, or when the model does.
With Cernanto, the source remains authoritative. You change the English and deploy again. The compiler edits the code it already tested, checks it, and updates tests when the promise they check has changed. The source and its compiled package live together in git.
This makes a policy change reviewable at the level of the policy. Specifications outlive models: a future compiler or coding model has a source to translate again against the established contracts and tests. Recompilation can produce different code; it must pass the same applicable checks.
The generated TypeScript is still available for inspection and diagnosis. It is the translation that Cernanto manages, while the source is what the author maintains.
Give a model a question, and code a procedure
An agent loop can ask a model which tool to call and what to do next. That is useful when the route cannot be specified in advance.
Many business procedures have a different shape. The route is known, while particular steps need a judgment:
- Which team should handle this support request?
- What total is printed on this receipt?
- Which handbook pages answer this question?
- How should this outcome be explained to the customer?
Cernanto compiles the procedure and places model calls at those steps. A receipt's amount can come from a model, while the approval limit is an ordinary numeric comparison. A reply can be generated, while the decision to refund follows a policy in code.
That does not remove model error. It makes the model's role explicit and gives the program a place to handle an inconclusive answer, apply a threshold, or ask a person.
The reliability argument
As a simplified illustration, if ten required model decisions each succeed independently with probability 0.99, all ten succeed with probability 0.99 ** 10, about 90.4 percent. This is an illustration of compounded uncertainty, not a measured failure rate for agent frameworks. Real errors are not necessarily independent.
Measured evaluations illustrate why one successful demonstration is not enough. In the June 2024 τ-bench study, the GPT-4o function-calling agent achieved a retail task success rate of 61.2 percent. Its retail pass^8, which measures success across all eight trials, was below 25 percent. Those results describe that model, benchmark and agent setup in 2024; they are not a measurement of current models or of Cernanto.
In its May 2026 revision, the AgentPex study evaluated 424 traces from τ²-bench and found specification violations that outcome-only scoring did not capture. A correct final result and a procedure that followed every required rule are different things to test.
Compiling a procedure avoids asking a model to rediscover that procedure on each run. It does not make a wrong implementation correct, nor make the remaining judgments infallible. Those are reasons for the gates, tests, explicit branches and traces.
Frameworks such as LangGraph and Mastra also support procedures with predefined control flow. The distinction is that Cernanto maintains the procedure as English and supplies the compilation and execution system around it. Comparisons explains that boundary.
What an enterprise needs
A procedure needs more than a successful demonstration: behavior QA can exercise, failure security reviewers can bound, evidence operations can inspect, and rules the business owner can read and change.
| Need | What Cernanto supplies |
|---|---|
| Repeatability | A compiled procedure, retained tests and recorded results for recovery. Fresh model judgments can still vary. |
| Bounded failure | Declared dependencies, typed model questions, and explicit branches for uncertainty or human approval. |
| Evidence | The source, the code, the tests and the compile's pins in one package, with traces of execution. |
| Predictable model use | Explicit model-call sites. Steps that require no model run as code; provider availability and charges still apply to judgments. |
| Operational continuity | Journaled execution that can resume after a process failure, subject to the documented external-write and version boundaries. |
| Ownership of the procedure | English policies reviewed as diffs and recompiled when they change. |
These are mechanisms to evaluate against the team's requirements, not automatic security approval or a guarantee that every rule was specified correctly. The examples make each claim inspectable.
Compose through contracts
Each callable agent exposes a typed contract: its operations, arguments and results. Other agents compile against that contract without needing its implementation.
An interface gives several providers the same contract. A workflow can call the chat interface while the runtime binds it to sandbox chat or Slack. A module is linked into its consumers; a service owns state and can be called across processes or machines.
The compiler hands the coding session the dependency contracts named by the source, keeping their implementations out of that session's context. This applies information hiding to compilation: the consumer learns what a dependency promises, not how it is implemented. Import and structure checks constrain the generated implementation to its declared surface. This is an architectural boundary to inspect and test, not a claim that generated software cannot have defects.
How it works follows a concrete system.
Check the translation
The coding session writes the implementation. A separate session writes tests from the source and the contract without seeing that implementation. The tests then run against the deployed agent and its dependencies.
When a check fails, the compiler reports the failure and attempts a repair. The resulting package retains the source, implementation, tests, contract and compile pins, so the evidence can be inspected.
Independent sessions reduce one kind of coupling between code and tests. They can still share a misunderstanding of ambiguous prose. The author must review the behavior, clarify the source and add cases where necessary. Live testing also needs appropriate accounts or explicit replacements for actions a test must not perform.
This is what “verified” means here. It is not a formal proof that arbitrary English and generated code are equivalent.
Keep execution evidence
The runtime journals calls, timers and model results. Recovery reuses recorded work, including the answer to a judgment, rather than asking the model again.
That is different from claiming that two fresh runs will produce identical model responses. A model can return another answer on a fresh call. A restart recovers an existing call from its recorded results.
The runtime also does not eliminate every external side-effect boundary. If a process crashes after an external write but before its result is recorded, a retry can repeat the write. The operation and supporting API need an idempotency mechanism when duplication is unacceptable.
Runtime guarantees covers recovery, service versions, state and data flow.
The compiler is written in Cernanto
The compiler, parser, controller, gateway, trace reader and auth agents are specified under cernanto/. Their compiled packages sit beside their sources.
Start with cernanto/compile.cern.md. It describes the compiler in the same language used by application agents, and composes other agents through their contracts. The compiler can compile its next version through the same gates and live tests.
The language runtime, process package, package-format kit and CLI are handwritten. This is a concrete use of the language for its own platform, rather than a claim that every part of the repository was generated. The sources and packages are the inspectable evidence: the compiler agents' implementations are generated from their sources.
Fit and direction
The natural starting point is the business-logic layer: services, integrations, workflows, schedulers and data movement. A team can begin with an assistant, add human approval for actions, and automate more of a procedure as its tests and traces justify it.
The useful property is that the operations manual and the maintained program can be the same set of sources. Extending that approach into other domains requires appropriate control, testing and evidence for those domains.
Research and background
The original design discussion referenced the following work. These are background reading, not benchmarks of Cernanto or proof of its runtime guarantees.
- τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains, on evaluating tool-using agents.
- Willful Disobedience: Automatically Detecting Failures in Agentic Traces, on detecting rule violations in traces.
- The Register's report on the Replit/SaaStr database incident, an operational incident discussed in the original rationale.
- McKinsey's State of AI, Gartner's agentic-AI project forecast, and MIT Project NANDA's GenAI Divide report, on adoption and deployment.
For evidence specific to this project, inspect the examples, their generated tests, and their recorded walkthroughs.
Copyright (c) 2026 Cernanto. This document is licensed under the Apache License, Version 2.0.