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
This commit is contained in:
1 parent
72192c2331
commit
6eceb4405b
13 files changed
+470
-11
No files matched your search
@@ -0,0 +1,47 @@
|
||||
# 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](bundle.txt) | manifest: files and sections in bundle order |
|
||||
| [syntax-example.air](syntax-example.air) | the one example in the bundle: a minimal syntax reference that verifies and runs |
|
||||
| [history.json](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
|
||||
|
||||
```sh
|
||||
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).
|
||||
@@ -0,0 +1,63 @@
|
||||
# Agent Reference Bundle manifest (spec 14 §3.7).
|
||||
#
|
||||
# The minimal material a model must receive to write correct AIR without the
|
||||
# rest of the repository. One entry per line:
|
||||
# <path> the whole file
|
||||
# <path> :: <heading prefix> one section: the heading that starts with the
|
||||
# prefix and everything up to the next heading
|
||||
# of the same or a higher level
|
||||
# Order is the order of the bundle. Rationale (RFCs), plans, design history,
|
||||
# README prose and benchmark descriptions are deliberately absent.
|
||||
|
||||
# Minimal syntax reference
|
||||
docs/agent/syntax-example.air
|
||||
|
||||
# AIR text grammar and format rules
|
||||
docs/reference/air-text.ebnf
|
||||
docs/spec/07-air.md :: ## 8. Text AIR
|
||||
|
||||
# Instruction set, run results, canonical record
|
||||
docs/spec/07a-air-instructions.md
|
||||
|
||||
# Types and integer semantics
|
||||
docs/spec/02-types-and-values.md :: ## 2. Integer semantics
|
||||
|
||||
# Traps
|
||||
docs/spec/01-language-overview.md :: ## 6. Trap
|
||||
|
||||
# Verifier: limits and accounted sizes, borrows, facts, initialization, stage order
|
||||
docs/spec/08-verifier.md :: ## 7. Bounded analysis
|
||||
docs/spec/08-verifier.md :: ## 11. Borrow verification
|
||||
docs/spec/08-verifier.md :: ## 12. Bounds facts
|
||||
docs/spec/08-verifier.md :: ## 13. Initialization
|
||||
docs/spec/08-verifier.md :: ## 14. Stage order
|
||||
|
||||
# Effects, capabilities, intrinsics
|
||||
docs/spec/05-effects-and-capabilities.md :: ## 9. Effects in AIR
|
||||
docs/spec/05-effects-and-capabilities.md :: ## 10. Capabilities in AIR
|
||||
docs/spec/05-effects-and-capabilities.md :: ## 11. Intrinsic calls
|
||||
docs/spec/05-effects-and-capabilities.md :: ## 12. Runtime
|
||||
|
||||
# Resources and I/O errors
|
||||
docs/spec/06-resources-and-errors.md :: ## 6. Resources in AIR
|
||||
docs/spec/06-resources-and-errors.md :: ## 7. I/O errors
|
||||
|
||||
# Heap, regions, budgets
|
||||
docs/spec/03-memory-model.md :: ## 18. Allocation authority in AIR
|
||||
docs/spec/03-memory-model.md :: ## 19. Heap in AIR
|
||||
docs/spec/03-memory-model.md :: ## 20. Regions in AIR
|
||||
|
||||
# Unsafe boundaries
|
||||
docs/spec/13-contracts-and-unsafe.md :: ## 6. Unsafe code in AIR
|
||||
|
||||
# Deterministic runtime contract: fuel, profiles, PRNG
|
||||
docs/spec/11-determinism-and-replay.md :: ## 7. Execution limits
|
||||
docs/spec/11-determinism-and-replay.md :: ## 8. Execution profiles
|
||||
|
||||
# Diagnostics format and registries
|
||||
docs/spec/10-diagnostics-and-agent-protocol.md :: ## 2. Stable codes
|
||||
docs/reference/error-codes.md
|
||||
docs/reference/air-features.md
|
||||
docs/reference/effects.md
|
||||
docs/reference/capabilities.md
|
||||
docs/reference/intrinsics.md
|
||||
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"label": "phase-2 baseline (AIR format 0)",
|
||||
"language": "aji",
|
||||
"air": 0,
|
||||
"phase": 2,
|
||||
"files": 18,
|
||||
"sections": 29,
|
||||
"bytes": 104250,
|
||||
"lines": 1630,
|
||||
"words": 16197,
|
||||
"tokens": {
|
||||
"cl100k_base": 27347,
|
||||
"o200k_base": 27445,
|
||||
"qwen2.5": 28230
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,38 @@
|
||||
; Minimal syntax reference for text AIR format 0 (part of the Agent Reference Bundle).
|
||||
; Run: aji run --grant out=io.write --grant heap=mem.alloc:64 docs/agent/syntax-example.air
|
||||
module example.syntax
|
||||
air 0
|
||||
lang 0.1
|
||||
features [arrays, capabilities, effects, heap, ownership, resources]
|
||||
|
||||
type @Pair = struct { a: u8, b: u8 }
|
||||
|
||||
; Entry point: capabilities arrive as named parameters.
|
||||
fn @main(%out: cap<io.write>, %heap: cap<mem.alloc>) -> u8
|
||||
effects [io.write, mem.alloc]
|
||||
entry:
|
||||
%msg = local.alloc array<u8, 3> ; frame storage, only in entry
|
||||
%c = const.u8 104 ; 'h'
|
||||
%arr = array.splat array<u8, 3> %c
|
||||
local.store %msg, %arr ; initializes the local
|
||||
%r = borrow.ref %msg ; second-class borrow
|
||||
%s = slice.make %r
|
||||
intrinsic io.stdout_write(%out, %s), ok -> @written, err -> @io_failed
|
||||
written:
|
||||
borrow.end %s ; every borrow ends on every path
|
||||
borrow.end %r
|
||||
%one = const.u8 1
|
||||
%two = const.u8 2
|
||||
%p = struct.make @Pair(%one, %two)
|
||||
own.new %p, %heap, ok -> @owned, err -> @no_memory
|
||||
owned(%o: own<@Pair>): ; results arrive as block parameters
|
||||
%v = own.take %o ; linear owner consumed
|
||||
%b = struct.get @Pair.b, %v
|
||||
%sum = add.checked.u8 %b, %one ; traps T0003 on overflow
|
||||
br @done(%sum)
|
||||
done(%result: u8):
|
||||
ret %result
|
||||
io_failed(%e: io_error):
|
||||
trap
|
||||
no_memory(%a: alloc_error):
|
||||
trap
|
||||
@@ -4,7 +4,8 @@ Non-normative. Empirical validation of the Aji hypothesis stated in [spec 14](..
|
||||
|
||||
| Document | Purpose |
|
||||
|---|---|
|
||||
| [protocol.md](protocol.md) | Agent Language Evaluation Protocol 0.1: variables, tasks T01–T10, maintenance and seeded-bug benchmarks, metrics, statistics, stages A–E, success and falsification criteria |
|
||||
| [protocol.md](protocol.md) | Agent Language Evaluation Protocol 0.2: variables, benchmark families T01–T10, conditions `Aji/AIR` and `Aji/source`, maintenance and seeded-bug benchmarks, metrics, statistics, stages A–E, success and falsification criteria |
|
||||
| [../agent/README.md](../agent/README.md) | Agent Reference Bundle: contents, measurement, growth policy, milestones |
|
||||
|
||||
## Integrity rules (protocol §7, §29; spec 14 §12)
|
||||
|
||||
@@ -23,4 +24,6 @@ Non-normative. Empirical validation of the Aji hypothesis stated in [spec 14](..
|
||||
| D — Systems integration | T09, T10 | Phases 3–5; stable features | blocked |
|
||||
| E — Maintenance campaign | M1–M8 on T03, T07, T09, T10 | D | blocked |
|
||||
|
||||
Until the source language (Phase 6) exists, an Aji run means an agent writing text AIR directly. Stage A therefore measures AIR as the agent-facing language; results must say so.
|
||||
Until the source language (Phase 6) exists, Aji runs use the condition `Aji/AIR`: the agent writes text AIR directly. This is a deliberate experiment, not a stopgap: if AIR alone helps weaker models, that is strong evidence, and after Phase 6 `Aji/source` is compared against `Aji/AIR`.
|
||||
|
||||
Order (protocol §30a): bundle baseline (done) → Phase 3 → second bundle measurement → private benchmark repository (in parallel) → harness → 36-run smoke test (§39a) → 108-run Stage A pilot.
|
||||
@@ -1,7 +1,8 @@
|
||||
# Aji Agent Language Evaluation Protocol
|
||||
|
||||
Version: 0.1
|
||||
Version: 0.2
|
||||
Status: Proposed
|
||||
Changes in 0.2: T01–T10 are benchmark families (§9); Aji conditions `Aji/AIR` and `Aji/source` (§2); engineering smoke test before the pilot (§39a); stage order (§30a).
|
||||
Purpose: empirical validation of the Aji language hypothesis (spec 14)
|
||||
|
||||
# 1. Goal
|
||||
@@ -48,6 +49,15 @@ C
|
||||
|
||||
C is useful as a low-level baseline but is not required for every experiment.
|
||||
|
||||
Aji is evaluated as two separate conditions:
|
||||
|
||||
```text
|
||||
Aji/AIR the agent writes text AIR directly
|
||||
Aji/source the agent writes .aji source lowered to AIR (from Phase 6)
|
||||
```
|
||||
|
||||
Results MUST be labelled with the condition. Comparing the two answers whether an agent needs a high-level source language at all, or whether AIR is the better agent-facing interface while `.aji` serves humans.
|
||||
|
||||
## Model capability
|
||||
|
||||
At least four capability classes:
|
||||
@@ -241,7 +251,9 @@ Broken tasks are removed before results are examined.
|
||||
|
||||
---
|
||||
|
||||
# 9. Task classes
|
||||
# 9. Benchmark families
|
||||
|
||||
T01–T10 below are **benchmark families**, not concrete tasks. Each family names the properties it exercises and gives an illustrative task. The private corpus contains concrete tasks that instantiate a family with different wire formats, storage models, requirements and hidden mutations (for example a family T03 task might be "A17 Segmented Journal"). The published descriptions are therefore never the evaluated tasks, which keeps this protocol public without disclosing the held-out corpus (§7, §29).
|
||||
|
||||
## T01 — Binary Frame Decoder
|
||||
|
||||
@@ -1309,6 +1321,28 @@ No claims about concurrency yet.
|
||||
|
||||
---
|
||||
|
||||
# 30a. Order of work
|
||||
|
||||
```text
|
||||
E0-1 Agent Reference Bundle, baseline after Phase 2
|
||||
↓
|
||||
Phase 3 structured concurrency
|
||||
↓
|
||||
second bundle measurement
|
||||
↓
|
||||
private benchmark repository (in parallel, outside this repository)
|
||||
↓
|
||||
E0-3 harness
|
||||
↓
|
||||
engineering smoke test (§39a)
|
||||
↓
|
||||
Stage A pilot on Aji/AIR (§39)
|
||||
```
|
||||
|
||||
The full Stage A is deliberately run after the basic Phase 3, so that early benchmark work does not start shaping the language before its concurrency model exists.
|
||||
|
||||
---
|
||||
|
||||
# 31. Stage B — Phase 3 validation
|
||||
|
||||
After structured concurrency:
|
||||
@@ -1495,9 +1529,25 @@ Do not add syntax or instructions merely because one model struggled with one ta
|
||||
|
||||
---
|
||||
|
||||
# 39a. Engineering smoke test
|
||||
|
||||
Before the pilot, a small run checks the infrastructure, not the hypothesis:
|
||||
|
||||
```text
|
||||
2 families (e.g. binary frame decoding, append log)
|
||||
× 3 languages (Aji/AIR, Rust, Zig)
|
||||
× 3 model classes
|
||||
× 2 runs
|
||||
= 36 runs
|
||||
```
|
||||
|
||||
It verifies that task statements are equivalent across languages, the harness works, the Agent Reference Bundle is sufficient, token and cost accounting is right, traces are stored completely and prompts carry no bias. No result of the smoke test is reported as evidence.
|
||||
|
||||
---
|
||||
|
||||
# 39. First concrete experiment
|
||||
|
||||
As soon as RFC 0008 is implemented, run a pilot:
|
||||
After the smoke test (§39a), run a pilot:
|
||||
|
||||
```text
|
||||
tasks:
|
||||
|
||||
+6
-5
@@ -92,18 +92,19 @@ Evaluation runs alongside the phases; each stage starts when the language featur
|
||||
|
||||
| ID | Status | Task | Depends | Done when |
|
||||
|---|---|---|---|---|
|
||||
| E0-1 | todo | Define the Agent Reference Bundle (spec 14 §3.7) and a deterministic size measurement (bytes and tokens) recorded per release | — | bundle manifest in the repository; size reported in CI |
|
||||
| E0-2 | todo | Private benchmark repository: task specs, evaluators, reference implementations, hidden tests for T01–T04; dev/validation/test split | — | evaluator hashes published; nothing hidden in this repository |
|
||||
| E0-3 | todo | Language-neutral agent scaffold and run recorder (protocol §5, §28) | — | identical loop drives Aji, Rust and Zig; every run record complete |
|
||||
| E0-1 | done | Define the Agent Reference Bundle (spec 14 §3.7) and a deterministic size measurement (bytes and tokens) recorded per release | — | `docs/agent/bundle.txt`, `zig build agent-reference`, `tools/agent_bundle_tokens.py`; Phase 2 baseline recorded; measured in CI |
|
||||
| E0-2 | todo | (owner; in parallel with Phase 3, outside this repository) Private benchmark repository: task specs, evaluators, reference implementations, hidden tests for T01–T04; dev/validation/test split | — | evaluator hashes published; nothing hidden in this repository |
|
||||
| E0-3 | todo | (after basic Phase 3) Language-neutral agent scaffold and run recorder (protocol §5, §28) | — | identical loop drives Aji, Rust and Zig; every run record complete |
|
||||
| E0-4 | todo | Rust and Zig baseline solutions and pinned local documentation | E0-2 | baselines pass the hidden tests |
|
||||
| E-A | todo | Stage A pilot: T01–T04 × Aji/Rust/Zig × 3 model classes × 3 runs = 108 runs (protocol §39); not headline evidence | E0-1…E0-4, Phase 2 | pilot report: effect size, broken tasks, cost, instrumentation |
|
||||
| E-S | todo | Engineering smoke test: 2 families × 3 languages × 3 model classes × 2 runs = 36 runs (protocol §39a); infrastructure only | E0-2, E0-3, E0-4 | harness, bundle sufficiency, accounting and traces verified |
|
||||
| E-A | todo | Stage A pilot (condition `Aji/AIR`): T01–T04 families × Aji/Rust/Zig × 3 model classes × 3 runs = 108 runs (protocol §39); not headline evidence | E-S, basic Phase 3 | pilot report: effect size, broken tasks, cost, instrumentation |
|
||||
| E-B | todo | Stage B: T05–T07 | Phase 3 | stage report |
|
||||
| E-C | todo | Stage C: T08, litmus repair | Phase 5 | stage report |
|
||||
| E-D | todo | Stage D: T09, T10 | Phases 3–5, stable features | stage report |
|
||||
| E-E | todo | Stage E: maintenance campaign M1–M8 | E-D | stage report |
|
||||
| E-1 | todo | First confirmatory experiment: 8 held-out tasks × 3 languages × 4 model classes × 6 runs = 576 runs (protocol §40); thresholds frozen beforehand (§35) | E-A fixes | published evaluation |
|
||||
|
||||
Until Phase 6 delivers the source language, agents write text AIR directly; Stage A results must state this.
|
||||
Until Phase 6 delivers the source language, Aji runs use the condition `Aji/AIR`; after Phase 6, `Aji/source` is evaluated as a separate condition. Every Phase 3+ semantic RFC re-measures the Agent Reference Bundle (`docs/agent/README.md`).
|
||||
|
||||
## Task conventions
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ Required for semantic features (spec 14 §6):
|
||||
- Interaction with existing features:
|
||||
- Expected effect on repairability:
|
||||
- Could existing primitives express it?
|
||||
- Agent Reference Bundle growth (`zig build agent-reference` + `tools/agent_bundle_tokens.py`, tokens before → after; > 20 % needs a justification):
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
|
||||
Reference in new issue
Block a user