# Implementation Plan ## Phase 0 — Semantic skeleton Deliver: - AIR value/type model; - text AIR parser and serializer; - basic blocks and SSA validation; - integer operations; - structs/enums; - interpreter; - stable diagnostic envelope. Exit criterion: AIR `hello` and arithmetic tests execute identically across runs. ## Phase 1 — Ownership and memory Deliver: - `Own`; - `ref` / `mut`; - slices; - initialization tracking; - `Region` and generation semantics; - bounds/range facts; - ownership/borrow diagnostics. Exit criterion: file-copy can be implemented and verifier rejects representative UAF/alias/OOB cases. ## Phase 2 — Effects, capabilities and resources Deliver: - effects; - capability values; - linear File/Socket resources; - runtime intrinsics; - explicit cleanup lowering. Exit criterion: safe file-copy and basic TCP echo. ## Phase 3 — Structured concurrency Deliver: - task scopes; - spawn/join; - `Send` / `Share` derivation; - scoped borrowing; - bounded channels; - mutex; - cancellation; - deterministic scheduler. Exit criterion: parallel-map and channel ownership-transfer examples. ## Phase 4 — Islands Deliver: - island allocator; - `iref`; - closure verification; - move/transfer; - freeze; - `Frozen`. Exit criterion: cyclic graph can move between tasks with no deep copy and no shared mutation. ## Phase 5 — Atomics and memory model Deliver: - atomic scalar types; - all five orderings; - fences; - happens-before model in interpreter/testing tools; - weak-atomic audit marking; - schedule exploration. Exit criterion: atomic publication litmus/conformance tests. ## Phase 6 — Source language Deliver: - source parser; - source-to-AIR lowering; - generics/monomorphization; - contracts syntax; - formatter. Exit criterion: all reference programs authored primarily as `.aji`. ## Phase 7 — Native backend Deliver: - LLVM lowering; - Linux x86_64; - Linux aarch64; - macOS aarch64; - ABI tests. Exit criterion: interpreted and native executions pass the same conformance corpus. ## Phase 8 — Agent protocol Deliver: - `ajid`; - structured diagnostics; - inspect/trace endpoints; - machine-readable verifier state summaries; - benchmark protocol. Exit criterion: an external coding agent can implement/repair a reference task using only the protocol and repository spec.