Files
aji/docs/agent/README.md
T
dev 6eceb4405b E0-1: Agent Reference Bundle and Phase 2 baseline
- docs/agent/bundle.txt: minimal AIR reference by file and section
  (grammar, instructions, types, traps, verifier rules, resources,
  effects, capabilities, intrinsics, heap/regions, unsafe, runtime
  contract, diagnostics and registries); syntax-example.air verifies
  and runs
- zig build agent-reference: deterministic bundle and report (files,
  sections, bytes, lines, words); section extraction ignores fenced code
- tools/agent_bundle_tokens.py: cl100k_base, o200k_base and Qwen2.5 BPE
  counts; growth warnings >10 % and review >20 % against history.json
- baseline after Phase 2: 104 250 bytes, 16 197 words, ~27.3k tokens
- CI builds the bundle and counts tokens (non-blocking)
- evaluation protocol 0.2: benchmark families, Aji/AIR and Aji/source
  conditions, 36-run engineering smoke test, order of work
- RFC template and AGENTS.md: report bundle growth
2026-10-04 15:44:26 +03:00

2.3 KiB

Agent Reference Bundle

Non-normative tooling for spec 14 §3.7. The bundle is the minimal material a model must receive to write correct AIR without access to the rest of the repository. Its size is a language complexity metric.

File Purpose
bundle.txt manifest: files and sections in bundle order
syntax-example.air the one example in the bundle: a minimal syntax reference that verifies and runs
history.json recorded measurements, one entry per milestone

Contents

Included: AIR text grammar and format rules, instruction set, type and integer semantics, traps, verifier rules (limits, borrows, facts, initialization, stage order), resources, effects, capabilities, intrinsics, heap and regions, unsafe boundaries, the deterministic runtime contract, the diagnostic format and all registries (codes, features, effects, capabilities, intrinsics).

Excluded: RFC rationale, plans and roadmap, design history, README prose, benchmark descriptions, examples other than the syntax reference.

A section enters the bundle through bundle.txt only. When a semantic RFC adds normative text an agent needs, the RFC adds the corresponding entry.

Measuring

zig build agent-reference                     # zig-out/agent/reference-bundle.md, report.json
uv run --with tiktoken --with tokenizers tools/agent_bundle_tokens.py
uv run --with tiktoken --with tokenizers tools/agent_bundle_tokens.py --record "<milestone>"

Counted: files, sections, bytes, lines, words, and tokens with OpenAI cl100k_base and o200k_base and the independent byte-level BPE of Qwen2.5. The trend matters more than any single tokenizer.

Growth policy

Compared with the last recorded milestone:

Growth per semantic RFC Consequence
≤ 10 % none
> 10 % CI warning
> 20 % review required: the RFC explains the growth in its Agent complexity impact section

Growth never blocks a merge automatically; a complex feature can be justified, but not silently.

Milestones

Milestone Files Sections Bytes Words cl100k o200k Qwen2.5
Phase 2 baseline (AIR format 0) 18 29 104 250 16 197 27 347 27 445 28 230

Next measurement: after Phase 3 (structured concurrency).