Every search happens inside a language.
Before a candidate can be evaluated, selected, or mutated, it must be representable. The representation decides which variations are nearby, which compositions are natural, which mistakes are easy to detect, and which ideas remain too expensive to attempt.
This matters more now that generative models can produce programs in large numbers. Candidate generation has become cheap, as described in After Mutation Became Cheap. The quality of the search increasingly depends on the structure into which those candidates are born.
General-purpose source code gives an agent enormous freedom. It also makes every mutation responsible for memory, timing, error handling, integration, serialization, observability, and performance. A configuration file avoids much of that work and much of the behavior worth exploring.
There is useful ground between them: a small executable language whose host owns the machinery and whose programs express the changing behavior.
I have called the trading instance a keyframe DSL. That name is becoming too narrow. It is developing into a behavioral language with a reusable core, domain vocabulary, executable semantics, and several possible compilation targets.
Programs
A program reads observation history, local state, and authorization, then emits an intent. The intent might request a position, schedule an experiment, change a controller, operate an instrument, deploy software, or abstain.
The domain supplies those nouns. The language supplies recurring operations over time and state: observe a variable, combine evidence, retain a mode, invalidate and rearm it, import another behavior, resolve concurrent claims, and emit an attributable intent.
The trading dialect uses S-expressions. Stripped of transport and bookkeeping, a policy can look like this:
(keyframes
(use (key "flow-state") (prefix "flow"))
(use (key "passive-entry") (prefix "entry"))
(defmode unresolved-pressure
(active-when
(and (var "flow.credible-pressure")
(var "flow.price-unresolved")
(< (var "liquidity.toxicity")
(var "risk.max-toxicity"))))
(invalidated-when
(or (var "flow.credible-opposition")
(>= (var "claim.giveback")
(var "claim.allowed-giveback"))
(var "risk.breach")))
(rearm condition_reset)
(intent :bias (var "flow.side")
:targets (position
(capacity_fraction
(* (var "authority.capacity")
(var "flow.conviction")
(var "liquidity.safety"))))
:execution
(entry/passive-until
(var "flow.response-horizon")
:fallback cross_if_edge_remains))))
The imported flow state owns direction, posterior, variance, and expected-response calculation. Credibility, capacity, giveback, liquidity safety, and execution horizon come from the current state and authorization rather than one set of universal constants. The second import owns passive entry.
When this mode fires, the host can retain the exact variables and values that passed, the import closure, the chosen target, the authority available at that moment, and the execution that followed. An event inspector can expand flow.credible-pressure into its posterior and variance calculation, then continue through target scaling and the resulting order. The source explains the possible behavior; the event record explains why one path occurred.
Why S-expressions
S-expressions have one recursively compositional syntax. A condition, mode, import, or target is already a tree. Mutation can replace a subtree, move it, wrap it in a guard, or compare it with its parent without recovering an abstract syntax tree from a large surface grammar.
The parser can remain small. Validation operates on explicit forms. A stable printer makes hashing and structural comparison straightforward. An agent can generate the representation directly while a human can still inspect the consequential parts.
Succinctness matters when programs are generated and reviewed inside token budgets. Most of the saving comes from building timing, state, execution, replay, and attribution into the host once. Later candidates use those capabilities without regenerating their implementation.
The representation resembles WAT for WebAssembly: textual, compact, and close to an executable machine model. It carries more domain meaning and remains part of the research record, so it is more durable than a typical compiler intermediate form.
Stored with its context
An adaptive system needs the behavioral representation to survive execution. It belongs in lineage together with its resolved imports, language semantics, domain binding, and evaluation history. Historical replay and live operation should consume the same source object.
A program’s identity therefore includes its source, import closure, interpreter semantics, and domain binding.
The trading implementation already content-addresses imported policy closures and parses them into Rust structures. The same behavior can consume historical or streaming observations. Faster targets can be compared against that reference through differential replay over the same event stream.
Future targets might include specialized Rust state machines, native code, WebAssembly, a GPU evaluator, or a compact device runtime. The durable program remains the unit of critique; each compiled target is one execution of it.
Extending the language
Repeated research pressure exposes missing operations.
Early controls accepted literal values. Policies soon needed values computed from current state, so runtime expressions became a host operation. Boolean reversal conditions proved brittle, so held predicates acquired duration and gap semantics. Fixed cooldowns confused recovery with elapsed time, leading to explicit rearming. Composition required imports, namespaces, priorities, disable edges, and parent-owned actions. Positional policies required targets and lifecycle evidence.
Each extension captured a distinction that had previously been repeated, encoded indirectly, or omitted. Once implemented by the host, it became cheap for every descendant.
Adding a primitive changes the geometry of the search. A verified temporal operator creates different nearby programs from dozens of candidates approximating time through counters and incidental resets.
Agents can propose programs, discover where the language resists an important idea, and propose an extension. The extension earns its place by making useful behavior expressible and verifiable across a population.
Compilation
Multi-Clock Intelligence described expensive reasoning leaving bounded machinery on a faster clock. The behavioral language is a natural destination for that process.
An agent may spend substantial effort understanding a failure. Perhaps a signal should remain valid through brief missing observations, an exit should depend on accumulated adverse evidence, or two behaviors should share a resource without losing attribution. That insight can become a language operation, a library behavior, or a composition rule.
Fast programs then use it without repeating the reasoning. Mutation gains a building block. Static analysis gains a distinction. Replay gains an event it can inspect. An insight from one investigation becomes part of the substrate available to future generations.
Across domains
The current implementation is still trading-shaped. Its Rust types refer to quotes, positions, fees, and market signals. The reusable boundary is nevertheless visible.
The core handles state, time, modes, lifecycle, composition, and intent. A domain binds observations, actions, constraints, and resources. An execution target interprets or compiles the result.
A scientific instrument can bind observations to sensor state and intents to experiments. Software operations can bind them to telemetry, rollout, and rollback. A controller can bind them to physical state and bounded actuation. The vocabularies differ while persistence, composition, authority, and replay retain the same structure.
This is why “domain-specific language” no longer quite fits. Domain bindings can vary while the behavioral language remains recognizably the same.
Before execution
A small language gives agents a constrained way to propose action. The host can determine which variables a program reads, which actions it may emit, which resources it can address, and whether its lifecycle is complete.
Real authority remains a separate decision, as described in The Right to Act. The language defines possible behavior. Authorization determines which program may operate, over what scope, and under which constraints. Execution records what happened.
The language is part of the search because it determines what a nearby thought looks like. It is part of memory because old programs remain replayable. It is part of execution because the same source can run at the speed of its environment.
A mature adaptive system improves its candidates, its search operators, and the vocabulary available to both. A valuable language makes hard-won distinctions cheap to express and difficult to forget.