Active Infinity (Active ∞)
The canonical binary form of Active modules. Graph-native, unit-aware, secret-safe, content-addressed, zero-copy to read and streaming to ship — built for configuration, for data exchange, and for agents that exchange modules with each other.
AINF ──► validate (bounded, fail-closed) ──► view (zero copy) ──► evaluate
▲ │
└──────────── canonical encode ◄─────────────┘ same bytes, same Blake3 hash
Why it exists
JSON is a text format with no integers-versus-floats rule, no units, no graph, no identity and no way to tell a secret from a string. YAML adds ambiguity. Cap'n Proto and FlatBuffers give you bytes but not semantics: no units, no taint, no canonical content address, no graph queries.
Active Infinity is the serialization of the Active language model, which already has those things:
- Canonical: one logical module has exactly one byte image and one Blake3 content address. Two modules that describe the same values hash identically.
- Graph-native: dependency edges are derived from nodes and validated, so
why,impactand subgraph queries run on the binary form. - Unit-aware: quantities carry a permanent unit discriminant, including Active's AI-age units (tokens, tokens/second, FLOPS).
- Secret-safe: a secret is a kind, not a flag. It never equals anything,
never appears in
Debug/Display/JSON/diagnostics, and literal locators are moved out of the public string heap at canonicalization. - Zero-copy: a validated buffer hands out borrowed strings and blobs with no
copy, no alignment requirement and no
unsafe. - Streaming: frames carry the canonical sections plus semantic deltas, so a reassembled stream is byte-identical to the whole-module encoding.
- Fail-closed: a bounded, iterative validator rejects truncation, count bombs, bad offsets, invalid UTF-8, unknown units, cycles, unreachable nodes and hash mismatches with permanent machine-readable codes.
Quick start
use ;
let mut module = new;
let greeting = module.push;
let answer = module.push;
let root = module.push;
module.set_root;
let bytes = encode?; // canonical image
let meta = validate?; // bounded, fail-closed
let decoded = decode?; // equal values
let hash = content_hash?; // content address
assert_eq!; // re-encoding is byte-identical
# Ok::
From the Active text language (feature active-core, on by default):
use ;
let source = "port = 8080\npassword = secret(\"hunter2\")\n";
let module = from_active_source?;
let bytes = encode?;
let json = to_redacted_json?;
assert!;
# Ok::
Run the shipped examples:
Format at a glance
| Property | Value |
|---|---|
| Magic | AINF |
| Format | 1.0 (major 1, minor 0) |
| Header | 224 bytes, 17 section descriptors |
| Node record | 32 bytes, 25 kinds |
| Hash | Blake3-256 over the canonical payload with the hash field zeroed |
| Canonical | sorted tables, pre-order numbering, zero slack |
| Endianness | little, alignment 8 |
The normative specification is docs/spec/layout.md;
streaming is docs/spec/streaming.md; the threat model
is docs/spec/security.md.
Feature flags
| Feature | Default | Meaning |
|---|---|---|
active-core |
on | bridge to the Active text language IR (from_active_core, to_active_core, evaluate) |
json |
on | redacted JSON projection (to_redacted_json) |
--no-default-features builds a dependency-free wire codec (Blake3 and
thiserror only).
Testing
The conformance set under tests/vectors/ is checked in: valid images with
their expected hashes and invalid images with the exact error code each must
produce. Regenerate with cargo run --example generate_vectors; the diff is the
review.
Design invariants (never weakened)
- Structural secret taint, anti-oracle equality, redaction on every export path.
- Hard budgets: nodes, depth, array length, keys, value size, wall clock.
- Deterministic evaluation and content hashing.
- Dimensional unit safety, including non-arithmetic temperatures and decibels.
- Cycle rejection before any value exists.
- Capability security and no ambient authority (see
active-rpc). - A validated buffer is the only way to obtain a view.
Repository
src/layout.rs— header, sections, limits, dialectsrc/ir.rs— canonical module modelsrc/canonical.rs— normalization and orderingsrc/encode.rs/src/decode.rs/src/validate.rs— codec and validatorsrc/view.rs— zero-copy viewssrc/stream.rs— frames, reassembly, deltassrc/interop.rs—active-corebridge, redacted JSON, graph queriesdocs/spec/— normative specificationsdocs/adr/— architecture decisions
License
MIT OR Apache-2.0.