air: feature negotiation for AIR format 0 (DD-014)

- reference/air-features.md: normative feature registry (arrays,
  atomics, capabilities, channels, effects, islands, ownership, regions,
  sync, tasks; all reserved), dependency closures, reasons for E0006
- spec 07 §8.1/§8.5/§8.7: features are mandatory, validated before the
  body, full dependency closure declared, sorted canonically; every
  extension belongs to a feature; published feature semantics immutable
- spec 05 §8: features vs effects vs capabilities
- src/air/features.zig: registry, validation, sync test with the docs
- parser validates features first; E0006 carries `reason`
- `aji features` prints supported AIR format, language and features
- conformance: unknown, reserved and duplicate feature tests
- plan: feature publication tasks in phases 1-5
This commit is contained in:
dev committed 2026-10-04 12:49:29 +03:00
1 parent 03dda1245a
commit 19dff5dd52
24 files changed
+366 -17

No files matched your search

+6
View File
@@ -75,3 +75,9 @@ Reason: a stable foundation lets generated code, tests and tools rely on format
Runs are bounded by fuel (executed AIR instructions), never by wall-clock time. Exhaustion is the outcome `limit_exceeded` (exit code 5), not a trap.
Reason: timeouts make test outcomes depend on machine speed; a trap code for exhaustion would make the test harness part of the language semantics.
## DD-014 — AIR feature negotiation
AIR format 0 uses the mandatory `features [...]` header as an explicit semantic compatibility contract. Every post-baseline AIR 0 extension belongs to a registered feature (`reference/air-features.md`). Modules MUST declare every feature they use and its dependency closure. Implementations MUST validate the feature set before validating the module body. Unknown, unsupported, undeclared, duplicated or dependency-incomplete features are reported as `E0006` with a structured `reason`. Feature semantics are immutable once published. `aji features` reports what a toolchain supports.
Reason: format 0 is frozen; features make it an extensible protocol without an older implementation half-parsing a module it cannot understand. One code with a reason keeps the §8.7 exception for `E0006` intact.