Initial import: Aji 0.1 draft spec and Zig scaffolding
Draft specification, RFCs, reference registries and examples, plus the reference-implementation skeleton: build.zig, diagnostic envelope with error-code registry synced to docs, aji CLI, conformance runner with seed tests, CI and contributor docs.
This commit is contained in:
commit
17a55a7fef
67 files changed
+4197
No files matched your search
@@ -0,0 +1,64 @@
|
||||
# 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.toml` and `build.zig.zon`). With mise: `mise install`.
|
||||
|
||||
## Commands
|
||||
|
||||
```sh
|
||||
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 # run the CLI
|
||||
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
|
||||
|
||||
```text
|
||||
docs/spec/ normative specification
|
||||
docs/rfcs/ design RFCs (template: 0000-template.md)
|
||||
docs/reference/ grammar, error codes, intrinsics, glossary
|
||||
docs/roadmap/ implementation plan, phase task breakdowns
|
||||
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
|
||||
|
||||
1. **Find the governing text.** Precedence: accepted RFCs → `docs/spec/` → `docs/reference/` → examples → README.
|
||||
2. **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.
|
||||
3. **Tests first.** Add conformance tests (`accept` and `reject`) for every verifier rule touched.
|
||||
4. **Implement.**
|
||||
5. **Diagnostics.** A new rejection needs a code in `docs/reference/error-codes.md` *and* `src/diag.zig`; the unit test fails if they drift.
|
||||
6. **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:`.
|
||||
Reference in new issue
Block a user