- 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
3.5 KiB
3.5 KiB
Contributing
Read AGENTS.md first. It holds the non-negotiable principles and the checklists every change must satisfy. This file covers the mechanics.
Toolchain
- Zig 0.17.0 (pinned in
mise.tomlandbuild.zig.zon). With mise:mise install.
Commands
zig build # build ./zig-out/bin/aji
zig build test # unit tests (includes registry ↔ docs sync check)
zig build conformance # conformance suite, see tests/conformance/README.md
zig build run -- check f.air # verify a text AIR module
zig build run -- run f.air # verify and execute @main
zig fmt --check build.zig src tools
CI runs zig fmt --check, zig build test and zig build conformance on every push and pull request.
Repository layout
docs/spec/ normative specification
docs/rfcs/ design RFCs (template: 0000-template.md)
docs/reference/ grammar, error codes, intrinsics, glossary
docs/design/ design decisions log, open questions
docs/plan/ implementation plan, phase task breakdowns
docs/dev/ implementation architecture, testing guide
src/ reference implementation (Zig)
root.zig library root
diag.zig diagnostic envelope + error-code registry
air.zig AIR data model, text parser/serializer
verifier.zig verifier passes
interp.zig deterministic AIR interpreter
check.zig parse → verify pipeline used by CLI and tools
main.zig `aji` CLI
tools/conformance.zig conformance runner
tests/conformance/ .air conformance tests
examples/ illustrative Aji source programs
Everything under src/ except main.zig is part of the trusted computing base or feeds it. Keep it small and free of heuristics.
Workflow for a change
- Find the governing text. Precedence:
docs/spec/→docs/reference/→ examples → README. RFCs explain decisions; their accepted rules are already in the spec. If the spec does not answer the question, add aQ-NNNentry todocs/design/open-questions.mdand resolve it in the spec before relying on an answer. - Spec first. If the behavior is not specified, change the spec (or write an RFC for major changes) before code. Never let the implementation define semantics silently.
- Tests first. Add conformance tests (
acceptandreject) for every verifier rule touched. - Implement.
- Features. A new AIR construct belongs to a feature in
docs/reference/air-features.md; publishing a feature means specifying it fully, changing its status topublishedin the registry andsrc/air/features.zig, and adding it tosupported. - Diagnostics. A new rejection needs a code in
docs/reference/error-codes.mdandsrc/diag.zig; the unit test fails if they drift. - Run
zig fmt,zig build test,zig build conformance.
Definition of done
- Spec/reference updated or confirmed unchanged.
- Positive and negative conformance tests.
- Stable diagnostic code for every new rejection.
- Interpreter test if observable at runtime.
- Memory/concurrency/FFI/unsafe changes: the 8-point checklist from
AGENTS.md. - AIR changes: the instruction contract from
AGENTS.md/ spec 07 §4. - Concurrency changes: deterministic scheduler tests and randomized schedule stress tests.
Commits
One logical change per commit. Prefix the subject with the area: spec:, rfc:, air:, verifier:, interp:, diag:, cli:, tests:, build:, docs:.