|
1 | 1 | // SPDX-License-Identifier: CC-BY-SA-4.0 |
2 | 2 | // Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
3 | | -// Template: QUICKSTART-DEV.adoc — clone → build → test → PR |
4 | | -// Replace maa-framework, {{BUILD_CMD}}, {{TEST_CMD}}, {{LANG_STACK}} with actuals |
5 | | -= maa-framework — Quick Start for Developers |
| 3 | += QUICKSTART-DEV — maa-framework contributor setup |
6 | 4 | :toc: |
7 | | -:toclevels: 2 |
8 | 5 |
|
9 | | -== Tech Stack |
| 6 | +// What a working dev loop looks like here, in one page. End users start |
| 7 | +// at QUICKSTART-USER.adoc, maintainers at QUICKSTART-MAINTAINER.adoc. |
10 | 8 |
|
11 | | -{{LANG_STACK}} |
| 9 | +== The stack |
12 | 10 |
|
13 | | -== Set Up Development Environment |
| 11 | +* **Rust 1.98.1** (pinned in `mise.toml` / `.tool-versions`): the |
| 12 | + `aletheia/` crate, edition 2021, MSRV 1.80, **zero dependencies** by |
| 13 | + RSR Bronze rule (`just deps-check` enforces it). |
| 14 | +* **Just** (any recent release; `cargo install just`): every task in |
| 15 | + this file is a Just recipe. Run from the repo root. |
| 16 | +* **GitHub Actions**: `just check` mirrors the CI gate exactly, same |
| 17 | + recipes in the same order — if it passes locally, CI passes. |
| 18 | +* **absolute-zero/** is a submodule (the Certified Null Operation |
| 19 | + reference, developed upstream; bump the pointer deliberately, never |
| 20 | + develop in place). Its `proofs/coq/` tree is where the Coq proofs |
| 21 | + live — there is no in-tree `verification/` directory. |
14 | 22 |
|
15 | | -=== Option A: Guix (preferred) |
| 23 | +== Option A: Guix (reproducible) |
16 | 24 |
|
17 | | -[source,bash] |
| 25 | +[source,shell] |
18 | 26 | ---- |
19 | | -guix shell |
| 27 | +guix shell # auto-discovers manifest.scm at the root |
| 28 | +just check |
20 | 29 | ---- |
21 | 30 |
|
22 | | -=== Option B: Nix (fallback) |
| 31 | +`manifest.scm` provides rust + just + git (specs verified 2026-09-21). |
| 32 | +It is new: if `guix shell` fails on a spec, file an issue rather than |
| 33 | +working around it. There is no `flake.nix` — Guix is primary by design |
| 34 | +(RSR 1.2.1), Nix was retired, so there is no Option B for it. |
23 | 35 |
|
24 | | -[source,bash] |
25 | | ----- |
26 | | -nix develop |
27 | | ----- |
28 | | - |
29 | | -=== Option C: Manual |
| 36 | +== Option B: rustup (recommended for most) |
30 | 37 |
|
31 | | -[source,bash] |
| 38 | +[source,shell] |
32 | 39 | ---- |
33 | | -git clone https://github.com/hyperpolymath/maa-framework.git |
34 | | -cd maa-framework |
35 | | -git submodule update --init # absolute-zero/ (pinned upstream proofs) |
36 | | -just setup-dev |
| 40 | +rustup toolchain install stable # 1.98.1 at time of writing; MSRV is 1.80 |
| 41 | +cargo install just |
| 42 | +just check |
37 | 43 | ---- |
38 | 44 |
|
39 | | -== Build |
40 | | - |
41 | | -[source,bash] |
42 | | ----- |
43 | | -{{BUILD_CMD}} |
44 | | ----- |
| 45 | +System rustc from your distro also works if it meets MSRV — the gate is |
| 46 | +`just check`, not how the toolchain arrived. |
45 | 47 |
|
46 | | -== Test |
| 48 | +== Build, test, MUST |
47 | 49 |
|
48 | | -[source,bash] |
| 50 | +[source,shell] |
49 | 51 | ---- |
50 | | -{{TEST_CMD}} |
| 52 | +just build # debug + release, locked |
| 53 | +just test # full aletheia suite (unit + integration; green since #124) |
| 54 | +just check # the whole CI gate: build test fmt lint deps-check |
51 | 55 | ---- |
52 | 56 |
|
53 | | -== Project Structure |
| 57 | +`Mustfile` is the MUST contract: `security` → `just lint`, |
| 58 | +`tests` → `just test`, `format` → `just fmt`. The generated |
| 59 | +`contractile.just` adds `must-check` (license/readme/SPDX/no-banned-files) |
| 60 | +and `trust-verify` (license-content/no-secrets-committed/pinned-images). |
| 61 | +Run `just must-check trust-verify` before pushing anything structural. |
54 | 62 |
|
55 | | -[source] |
56 | | ----- |
57 | | -maa-framework/ |
58 | | -├── src/ # Source code |
59 | | -├── src/abi/ # Idris2 ABI definitions (if applicable) |
60 | | -├── ffi/zig/ # Zig FFI bridge (if applicable) |
61 | | -├── tests/ # Test suite |
62 | | -├── docs/ # Documentation |
63 | | -├── .machine_readable/ # Checkpoint files (STATE, META, ECOSYSTEM) |
64 | | -├── Justfile # Task runner recipes |
65 | | -├── guix.scm # Guix environment |
66 | | -├── flake.nix # Nix environment (fallback) |
67 | | -└── 0-AI-MANIFEST.a2ml # AI agent entry point |
68 | | ----- |
| 63 | +Landmines (each bought with a real incident): |
69 | 64 |
|
70 | | -== Key Recipes |
| 65 | +* Workflows run **only** from `.github/workflows/` — a workflow file |
| 66 | + anywhere else is silently dead (#98). |
| 67 | +* Clippy denies **all warnings including dead code**; keep the tree |
| 68 | + warning-free or CI fails (#125). |
| 69 | +* A recipe that echoes and exits 0 is a fake gate. Recipes MUST fail |
| 70 | + loudly (#99). |
| 71 | +* `main` takes **squash-merges on PRs only**, commits signed |
| 72 | + (Optimus-Branch ruleset, zero bypass actors) — direct pushes fail. |
71 | 73 |
|
72 | | -[source,bash] |
73 | | ----- |
74 | | -just build # Build the project |
75 | | -just test # Run tests |
76 | | -just doctor # Self-diagnostic |
77 | | -just lint # Lint and format |
78 | | -just panic-scan # Security scan via panic-attacker |
79 | | -just tour # Guided tour of the codebase |
80 | | ----- |
| 74 | +== Recipes you will actually use |
81 | 75 |
|
82 | | -== Before Submitting a PR |
| 76 | +`just --list` is authoritative; the daily set is `build`, `test`, |
| 77 | +`check`, `lint`, `fmt` (`fmt-fix` applies), `deps-check`, |
| 78 | +`self-verify` (runs aletheia against this repo), `doctor` (setup |
| 79 | +self-diagnostic), `assail` (panic-attack pre-commit scan — needs the |
| 80 | +external `panic-attack` binary), `tour`, and `help-me`. |
83 | 81 |
|
84 | | -[source,bash] |
85 | | ----- |
86 | | -just lint # Format and lint |
87 | | -just test # All tests pass |
88 | | -just panic-scan # No new security issues |
89 | | ----- |
90 | | - |
91 | | -== Contractile Invariants |
| 82 | +== Wiring a new agent / LLM session in |
92 | 83 |
|
93 | | -Read `.machine_readable/MUST.contractile` before making changes. |
94 | | -Key invariants that must never be violated: |
| 84 | +Start it on `llm-warmup-dev.adoc` (repo root), then this file. For |
| 85 | +deep background: `docs/usage.adoc`, `docs/architecture.adoc`, |
| 86 | +`docs/troubleshooting.adoc`, `EXPLAINME.adoc`, and the normative |
| 87 | +`STATE.a2ml` under `.machine_readable/6a2/`. |
95 | 88 |
|
96 | | -{{MUST_INVARIANTS}} |
| 89 | +== Layout (trimmed) |
97 | 90 |
|
98 | | -== LLM/AI Agent Development |
99 | | - |
100 | | -If using an AI assistant, load the warmup context first: |
101 | | - |
102 | | -[source,bash] |
103 | | ----- |
104 | | -just llm-context # Outputs role-appropriate context |
| 91 | +[source] |
105 | 92 | ---- |
106 | | - |
107 | | -Or read `0-AI-MANIFEST.a2ml` and `.claude/CLAUDE.md` directly. |
108 | | - |
109 | | -== Get Help |
110 | | - |
111 | | -* **Architecture**: link:EXPLAINME.adoc[EXPLAINME.adoc] |
112 | | -* **Wiki**: https://github.com/hyperpolymath/maa-framework/wiki |
113 | | -* **Report issue**: `just help-me` |
| 93 | +maa-framework/ |
| 94 | +├── .github/ # workflows, hooks, agents, funding |
| 95 | +├── .machine_readable/ # STATE, MUST schemas, gates, rsr-profile |
| 96 | +├── .well-known/ # symlinks → www/.well-known (canonical bundle) |
| 97 | +├── aletheia/ # the Rust crate: src/, tests/, benches/ |
| 98 | +├── absolute-zero/ # submodule: CNO reference + Coq proofs |
| 99 | +├── docs/ # usage, architecture, troubleshooting, decisions |
| 100 | +├── tests/ # aspect/, e2e/, fuzz/ suites |
| 101 | +├── www/ # the canonical .well-known/ bundle |
| 102 | +├── manifest.scm # Guix dev environment (Option A) |
| 103 | +├── mise.toml / .tool-versions # toolchain pins |
| 104 | +├── Justfile / contractile.just / Mustfile |
| 105 | +└── *.adoc # README, EXPLAINME, STATE pointers, this file |
| 106 | +---- |
| 107 | + |
| 108 | +== Stuck? |
| 109 | + |
| 110 | +* `just doctor`, then `just help-me` (paste both into your issue). |
| 111 | +* `docs/troubleshooting.adoc` for the known-good fixes. |
| 112 | +* Issues: https://github.com/hyperpolymath/maa-framework/issues/new |
| 113 | +* Wiki: https://github.com/hyperpolymath/maa-framework/wiki |
0 commit comments