v4.0.1 Kernel Specification
Normative. 94 lines. Co-authoritative with grammar.bnf.
The kernel defines packet syntax, field constraints, parsing contract, version negotiation, error contract, alias scope, and backward compatibility. The kernel is the deterministic syntax that does not change. Extensions are compression conventions layered above it.
AXL Rosetta v4 Kernel
Version: 4.0.2-draft Status: Research draft Tier: NORMATIVE KERNEL License: Apache 2.0
Identity
Model-teachable compression protocol for machine-to-machine communication. Kernel = deterministic syntax. Extensions = compression conventions. Code layer = experimental lossy IR. Thesis = speculation.
Packet Syntax
PKT[VER|CLS|SUB|TAG|ARG1|ARG2|META]
Seven pipe-delimited fields inside PKT[ and ].
Trailing empty fields may be omitted.
Field Constraints
| Field | Width | Required | Default |
|---|---|---|---|
| VER | 1-3 char | yes | 4 |
| CLS | 3 char | yes | none |
| SUB | 2-48 char | yes | none |
| TAG | 2-16 char | yes | none |
| ARG1 | free | no | empty |
| ARG2 | free | no | empty |
| META | free | no | empty |
Class Codes
INF (inform), ACT (act), QRY (query), RSP (respond), ERR (error).
Parsing Contract
- Extract all fields by pipe-split.
- Parse META first (caret-prefixed ^key:value flags, space-separated).
- META determines ARG2 dispatch: ^mode:code activates code-body grammar; VER >= 3.1 without ^mode:code activates math-arg grammar; else kernel-arg.
- TAG dispatch follows the same META/VER logic.
- Parse legality is separated from interpretation legality. A v3 parser legally extracts all fields from a v4 packet; it does not interpret extension semantics.
Reserved Characters and Escaping
Reserved: | [ ] \ ^ ;
Escape with backslash: \| \[ \] \\ \; \^
In kernel-arg and math-arg: pipe, brackets, backslash must be escaped.
In code-body: semicolons are statement separators; literal semicolon: \;
Caret is literal in ARG fields; flag prefix only in META.
Version Negotiation
VER values: 3, 3.1, 3.2, 4. Senders declare VER in every packet. A receiver must accept any VER <= its own. Unknown VER: PKT[4|ERR|sys|val|unsupported_ver|VER=X]
Error Contract
Validation failure produces ERR packet with TAG indicating error class. Error classes: syntax, version, alias, escape, mode, field. See grammar.bnf ERROR TAXONOMY for full definitions and examples.
Mid-sequence behavior: - Valid packets before the error are accepted (partial sequence is valid). - Malformed packet triggers ERR identifying position via ^ref. - Protocol is best-effort; retransmission is not required.
Alias Scope
^alias:XX registers current SUB as alias XX for the remainder of the current sequence. New sequence resets alias table. Re-registration replaces previous binding. Implementation guidance: alias tables should support at least 64 entries.
Defaults
Missing VER defaults to 4. Missing optional fields default to empty. Unknown ^meta keys are ignored. Verbose uncompressed content is always valid.
Backward Compatibility
All v3 packets parse under v4 rules without modification. Extension content in TAG/ARG2 is opaque text to older parsers. Unknown ^meta flags are ignored by all versions.
Grammar
See spec/grammar.bnf. This document and the grammar are co-authoritative. Conflict: grammar governs syntax; this document governs semantics.
Source & Raw Text
Repos are PRIVATE. Public visitors will see HTTP 404 unless authenticated.