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 -5
View File
@@ -6,9 +6,9 @@ Non-normative. Part of the [implementation plan](README.md).
**Exit criterion:** `parallel_map` and `channel_transfer` examples run under deterministic and randomized schedules.
**Spec inputs:** spec 04 §1–19, 11 §3, §5–6. RFC 0002 moves to Accepted.
**Spec inputs:** spec 04 §1–19, 11 §3, §5–6. RFC 0002 is proposed for acceptance (owner decision); acceptance integrates it into the spec.
**Blocking questions:** Q-013 deterministic `select` and seeds, Q-014 Send/Share for capability-holding aggregates.
**Blocking questions:** Q-013 deterministic `select` and seeds, Q-014 Send/Share for capability-holding aggregates. (Q-019 is resolved: fuel, schedule budget and quantum are defined in spec 11 §7.)
## Invariants (AGENTS.md change checklist applies to every task here)
@@ -22,9 +22,9 @@ Non-normative. Part of the [implementation plan](README.md).
| ID | Status | Task | Depends | Output | Done when |
|---|---|---|---|---|---|
| P3-1 | todo | Resolve Q-013, Q-014; RFC 0002 to Accepted | — | spec 04, 11 | questions resolved |
| P3-1 | todo | Resolve Q-013, Q-014; propose RFC 0002 for acceptance | — | spec 04, 11 | questions resolved |
| P3-2 | todo | Contract tables: `task.*`, `thread.*`, `channel.*`, `mutex.*`, `rwlock.*`, select | P3-1 | spec 07 appendix | all spec 07 §4 fields including synchronization effects |
| P3-3 | todo | Deterministic scheduler: seeds, choice points, choice log | P3-2 | `src/interp/sched.zig` | same seed ⇒ identical trace; choice log replays a run |
| P3-3 | todo | Deterministic scheduler: seeds, choice points, choice log; global fuel across tasks and a separate `quantum` (spec 11 §7.2) | P3-2 | `src/interp/sched.zig` | same seed ⇒ identical trace; choice log replays a run; fuel is the sum over all tasks |
| P3-4 | todo | Send/Share/Local derivation | P3-1 | `src/verifier/send_share.zig` | E4001, E4002 accept/reject |
| P3-5 | todo | Task-scope verifier and scoped borrows | P3-2 | `src/verifier/tasks.zig` | E4301, E4302 accept/reject |
| P3-6 | todo | Concurrent alias / data-race rejection | P3-5 | `src/verifier/borrow.zig` | E4101 accept/reject; disjoint `split_mut` halves accepted in two tasks |
@@ -33,7 +33,7 @@ Non-normative. Part of the [implementation plan](README.md).
| P3-9 | todo | Mutex and RwLock with linear guards | P3-7 | interpreter + verifier | guard not `Send`; unlock consumes guard; E3002 on leaked guard |
| P3-10 | todo | Async I/O buffer claims | P3-7 | verifier + runtime | E4303 accept/reject |
| P3-11 | todo | Blocking effect and blocking pool policy | P3-7 | spec 04 §18, runtime | `thread.block` from ordinary task handled per spec |
| P3-12 | todo | Runner: `seed:`/`schedules:` headers; stress modes (1/2/N workers, random, forced yield, slow consumer, cancellation during waits, I/O reordering) | P3-3 | `tools/conformance.zig` | stress modes selectable; failing seed printed for replay |
| P3-12 | todo | Runner: `seed:`/`schedules:`/`quantum:` headers (schedule budget kept separate from fuel); stress modes (1/2/N workers, random, forced yield, slow consumer, cancellation during waits, I/O reordering) | P3-3 | `tools/conformance.zig` | stress modes selectable; failing seed printed for replay |
| P3-13 | todo | Reference programs: parallel-map, channel transfer, tcp-echo with tasks | P3-8, P3-9 | `tests/programs/` | pass under all stress modes |
| P3-14 | todo | Phase exit review | all | plan status | exit criterion passes |