title: T81 Foundation Specification — Axion Kernel nav:
Version 1.0 — Draft
Status: Draft
Last Revised: 2026-03-01
Applies to: T81VM, TISC, T81Lang, Cognitive Tiers
The Axion Kernel is the supervisory intelligence of the T81 Ecosystem.
It enforces:
Axion does not execute user code; rather, it governs how code may execute.
This document defines Axion’s responsibilities, invariants, hooks, visibility, and interaction model.
Axion sits above all executable layers:
┌─────────────────────────────┐
│ Cognitive Tiers │
├─────────────────────────────┤
│ Axion Kernel │ ← THIS LAYER
├─────────────────────────────┤
│ T81VM | TISC | DataTypes│
├─────────────────────────────┤
│ System │
└─────────────────────────────┘
Axion:
Axion has seven core responsibilities.
Axion MUST:
Axion is the final arbiter of “deterministic enough.”
Implementation status (AX-M5): Determinism stewardship is partially implemented.
axion_logcaptures instruction events but does not yet perform active nondeterminism detection (cross-run divergence comparisons). Active detection is AX-M5, targeting 2026-03-14.
Axion MUST enforce:
Axion MAY terminate execution if invariants are violated.
Axion measures:
These metrics guide tier transitions.
Implementation status: Complexity measurement currently tracks call depth and tensor operation counts. Call graph complexity, shape explosion detection, and branching factor metrics are not yet implemented.
Axion:
Tier rules are defined in cognitive-tiers.md.
Conformance program:
spec/conformance/axion-kernel/tier-supervision-invariant.t81
Axion maintains the META segment:
Axion MUST keep metadata deterministic and canonical.
Conformance program:
spec/conformance/axion-kernel/metadata-determinism.t81
Axion also ingests the loop hints, match metadata s-expressions, and enum metadata described in RFC-0019. The compiler populates tisc::Program.axion_policy_text, match_metadata_text, and enum_metadata so the runtime can emit deterministic EnumIsVariant/EnumUnwrapPayload events whose AxionEvent.verdict.reason strings include enum=<name>, variant=<name>, payload=<type>, and the guard result (match=pass/match=fail). These entries give DTS/VS the canonical guard context they need to enforce safety and determinism.
Axion is the arbiter of:
AXREADAXSETAXVERIFYAll privileged operations MUST invoke Axion before evaluating their effects.
Axion is not technically part of T81VM, but all VM behavior MUST be visible and conformant to Axion’s expectations.
Axion also receives a deterministic trace of every segment transition and guarded decision inside the HanoiVM as described in RFC-0020. Each AxionEvent.verdict.reason includes the segment name, address, and action (e.g., stack frame allocated stack addr=243 size=16, tensor slot allocated tensor addr=5, meta slot axion event segment=meta addr=1283, AxRead guard segment=stack addr=42, AxSet guard segment=heap addr=128). CanonFS writes traverse AXSET/AXREAD, trigger the same meta-slot logging, and emit meta slot axion event segment=meta ... action=Write/Read so policy runners can enforce persistence guards deterministically. These strings anchor Axion policies and audits to the runtime’s deterministic layout without requiring additional instrumentation. Axion MUST reject programs whose required segment-trace strings are missing when the policy explicitly requests them.
Implementation status (AX-M6): The full canonical reason string form
segment=<name> addr=<value> action=<desc>is the normative target. Current implementation emits the segment, address, and action fields as separate structuredAxionEventfields; verbatim concatenated string construction is AX-M6, targeting 2026-03-14.Conformance program:
spec/conformance/axion-kernel/segment-trace-strings.t81
The Axion Kernel exposes a constrained syscall surface (AXREAD, AXSET, AXVERIFY, AXTRACE, etc.) that every privileged opcode must call before performing non-deterministic or privileged actions. Each syscall supplies the opcode, the target addresses or handles, the calling snapshot, and any associated guard metadata (loop id, match metadata, enum/variant ids). The Axion Engine returns a deterministic Verdict (Allow/Deny) plus a canonical reason string. Denials immediately trigger deterministic Axion Faults; allows append the reason to State::axion_log.
Policies are encoded via the (policy ...) s-expression embedded in tisc::Program.axion_policy_text. Axion parses these forms (see include/t81/axion/policy.hpp) and enforces:
tier, max-stack);require-match-guard);require-loop-hint);require-segment-event).Regression tests axion_policy_match_guard_test and
axion_policy_segment_event_test exercise those requirements against the
canonical enum guard and stack frame allocated strings, proving that the
policy engine never allows a privileged opcode unless the deterministic
trace strings already exist in State::axion_log.
Because the policy lexer is deterministic and the verdict strings are canonical (per RFC-0020/RFC-0019), Axion’s policy enforcement remains purely declarative: it denies unless the runtime has already emitted the expected strings.
Conformance programs:
spec/conformance/axion-kernel/policy-deny-requires-reason.t81·policy-enforcement-allow-deny.t81
Canonical File System (CanonFS) is the deterministic store where Axion writes loop/match policy hints, bounds-fault snippets, and trace exports. Each CanonFS write traverses AXSET, so Axion can validate shape/segment constraints and record meta slot events before persistence. The axion_policy_runner example (documented in docs/guides/axion-trace.md) mirrors this path and shows auditors how to capture the required verdict.reason strings without digging into VM sources. CanonFS therefore acts as the official audit trail for Axion policy enforcement, and the persistent driver described in spec/supplemental/canonfs-spec.md guarantees those meta slot axion event segment=meta ... action=Write/Read strings fire before bytes hit objects/<hash>.blk.
Implementation status (AX-M7): CanonFS observability integration is partial. Full
AXSETpropagation to CanonFS meta slots and end-to-endmeta slot axion eventemission for all persistence paths is AX-M7, targeting 2026-03-14.
Implementation status note: The five subsystems described below are architectural targets. In the current implementation their functionality is distributed across
kernel/axion/policy_engine.cppandcore/vm/vm.cpprather than realized as distinct classes with formal boundaries. Formal subsystem separation is a post-Alpha milestone.
Axion consists of five deterministic subsystems.
DTS receives:
axion_policy_text and match guard metadata (variant ids, declared payload types, guard presence) captured by EnumIsVariant/EnumUnwrapPayload events. These guard-aware logs show the file/line/column hint, the canonical enum/variant identity, the guard result, and payload reason strings, so DTS keeps a complete, deterministic record of guard coverage together with the normal instruction trace.DTS MUST maintain a canonical record of the program’s observable behavior.
Responsible for:
If verification fails:
CRS ensures:
Tracks and checks:
RCS MAY impose a hard stop if recursion becomes unbounded or unsafe.
Decides when execution should:
TTS requires metadata from:
Axion enforces deterministic recursion limits:
If T81Lang provides an annotation like:
@bounded(100)
Axion MUST enforce it strictly.
Axion evaluates recursion signatures:
If a recursion does not appear to converge, Axion MAY halt it.
Higher tiers allow deeper recursion but require explicit annotation.
If execution resembles:
Axion MUST halt with a deterministic Axion Fault.
Axion is the gatekeeper of cognitive tiers.
Simple arithmetic, no recursion, no large tensors.
Controlled loops, branching, bounded recursion.
Complex recursion, structural transformations, limited tree search.
Only allowed with explicit tier annotation and Axion approval.
Axion MUST verify the program’s declared tier intent matches its behavior.
Axion defines normative semantics for all AX* instructions.
Tier restriction: AXREAD and AXSET are restricted to Tier 2 and above.
AXVERIFY is the only AX* instruction permitted in Tier 1. See
cognitive-tiers.md §1.
Used to read Axion metadata.
Used to request Axion to alter metadata or policy.
Used to request verification of the current execution state.
Axion MUST interact with T81VM as follows:
Before T81VM executes:
Axion receives the machine state and may veto.
After execution:
On any fault:
Axion faults are distinct from VM/TISC faults.
Determinism Fault Execution deviated from deterministic rules.
Safety Fault Unsafe memory or control-flow pattern detected.
Policy Fault Axion policy violation (security, ethics, recursion policies).
Tier Fault Execution attempted to enter a higher tier without annotation.
Canonicalization Fault Value failed canonical validation.
Axion MUST:
Faulting MUST never leave VM state ambiguous.
Axion MUST interoperate with:
t81-overview.mdt81-data-types.mdtisc-spec.mdt81vm-spec.mdt81vm-spec.mdt81lang-spec.mdcognitive-tiers.md