spec: single normative source, accept RFC 0004, freeze AIR format 0, fuel

Owner decisions after the Phase 0 review:

- precedence: docs/spec/ is the single normative source; RFCs are
  decision records whose accepted rules are integrated into the spec in
  the same change (AGENTS.md, docs/README.md, rfcs/README.md, DD-011)
- RFC 0004 Accepted (scope: AIR format 0, language 0.1)
- AIR format 0 frozen as the semantic baseline; spec 07 §8.7 defines the
  only permitted additive changes, everything else needs `air 1` (DD-012)
- Q-019 resolved: deterministic instruction fuel (spec 11 §7). Outcome
  `limit_exceeded` is a runner outcome, not a trap; `aji run --fuel N`,
  exit code 5; conformance runs always use fuel (default 1 000 000,
  `fuel:` header); fuel/schedule budget/quantum kept separate for P3
  (DD-013)
This commit is contained in:
dev committed 2026-10-04 12:40:32 +03:00
1 parent dc36b5cfc0
commit 03dda1245a
24 files changed
+268 -63

No files matched your search

+5 -4
View File
@@ -6,7 +6,7 @@ Non-normative. Part of the [implementation plan](README.md).
**Exit criterion:** AIR `hello` and arithmetic tests execute identically across runs. Per Q-008, Phase 0 `hello` is a `@main` returning a value; output to stdout arrives in P2-11.
**Spec inputs:** spec 00 §5–6, 01 §6, 02 §1–3, 07, 08 §1–2, §7, 10 §2, 11 §1. RFC 0004 moves to Accepted at the end of this phase.
**Spec inputs:** spec 00 §5–6, 01 §6, 02 §1–3, 07, 08 §1–2, §7, 10 §2, 11 §1. RFC 0004 was accepted for AIR format 0 after the exit review.
**Blocking questions:** Q-001 grammar, Q-002 contracts, Q-003 parse codes, Q-004 traps, Q-005 budget, Q-006 target description, Q-007 integer edge cases, Q-008 `hello`, Q-016 floats.
@@ -32,7 +32,7 @@ Out: floats (reserved until Q-016 is answered), fixed arrays (moved to P1 with s
| P0-10 | done | Deterministic verifier budget | P0-7 | `src/verifier/budget.zig` | E5101 test with an oversized module; budget value matches spec |
| P0-11 | done | Interpreter core | P0-8, P0-9 | `src/interp/machine.zig` | arithmetic programs run; overflow, assert and explicit `trap` produce the trap records defined in P0-2 |
| P0-12 | done | `aji run`; `expect: run` / `stdout:` / `trap:` in the conformance runner; double-run determinism check | P0-11 | `src/main.zig`, `tools/conformance.zig` | runner fails a test whose two runs differ |
| P0-13 | done | Phase exit review | all | plan status, RFC 0004 status | `hello` and arithmetic suite pass; RFC 0004 amended for format 0 (acceptance is an owner decision); P0 status set to done |
| P0-13 | done | Phase exit review | all | plan status, RFC 0004 status | `hello` and arithmetic suite pass; RFC 0004 Accepted for format 0; P0 status set to done |
## Conformance tests to add
@@ -45,6 +45,7 @@ Out: floats (reserved until Q-016 is answered), fixed arrays (moved to P1 with s
- Exit criterion met: `zig build conformance` runs 41 Phase 0 tests (3 accept, 19 reject, 15 run); every run test is executed twice and the run records compared byte-for-byte.
- Every code introduced in Phase 0 has a reject test: E0001–E0006, E1001–E1003, E5001, E5002, E5101; traps T0001–T0007 each have a run test.
- Parser and verifier survived 6 000 mutated corpus inputs through `aji check` and `aji run` without a crash (one crash found and fixed).
- RFC 0004 received Amendment 1 describing the format-0 additions; its status stays Proposed until the language owner accepts it.
- RFC 0004 with Amendment 1 was accepted by the language owner (scope: AIR format 0, language 0.1). Its rules live in spec 07 §8, spec 07a and `reference/air-text.ebnf`.
- **Format 0 is the frozen semantic baseline** (spec 07 §8.7, DD-012). Phases 1–3 may add instructions, types, features and codes; changing the meaning of an existing format-0 construct requires `air 1` and an RFC.
- Deferred: interpreter memory grows with the number of calls and aggregates created, because everything lives in one arena per run. Acceptable for conformance tests; revisit with the Phase 1 memory model.
- New open question Q-019 (non-terminating programs in test tooling).
- Q-019 resolved after the review: deterministic instruction fuel (spec 11 §7), outcome `limit_exceeded`, exit code 5; the conformance runner always runs with fuel.