|
1 | | -[](https://github.com/sponsors/hyperpolymath) |
2 | | - |
3 | | -// SPDX-License-Identifier: CC-BY-SA-4.0 |
4 | | -= a2ml-rs |
5 | | -Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
6 | | -:toc: |
7 | | -:toc-placement: preamble |
| 1 | +<!-- |
| 2 | +SPDX-License-Identifier: CC-BY-SA-4.0 |
| 3 | +SPDX-FileCopyrightText: 2025-2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
| 4 | +--> |
8 | 5 |
|
9 | 6 | Rust parser and renderer for A2ML (Attested Markup Language) — the |
10 | | -structured markup format used across the hyperpolymath estate for AI-agent |
11 | | -communication, machine state files, and provenance-tracked documentation. |
| 7 | +structured markup format used across the hyperpolymath estate for |
| 8 | +AI-agent communication, machine state files, and provenance-tracked |
| 9 | +documentation. |
| 10 | + |
| 11 | +# Overview |
12 | 12 |
|
13 | | -== Overview |
| 13 | +A2ML extends a Markdown-like surface syntax with two first-class |
| 14 | +constructs: |
14 | 15 |
|
15 | | -A2ML extends a Markdown-like surface syntax with two first-class constructs: |
| 16 | +- `@directives` — single-line machine-readable metadata prefixed with |
| 17 | + `@` |
16 | 18 |
|
17 | | -* `@directives` — single-line machine-readable metadata prefixed with `@` |
18 | | -* `!attest` blocks — record identity, role, and trust-level on any piece |
19 | | - of content, enabling provenance tracking across AI-agent and human review chains |
| 19 | +- `!attest` blocks — record identity, role, and trust-level on any piece |
| 20 | + of content, enabling provenance tracking across AI-agent and human |
| 21 | + review chains |
20 | 22 |
|
21 | 23 | `a2ml-rs` implements: |
22 | 24 |
|
23 | | -* `src/parser.rs` — line-oriented state machine: headings, directives, |
24 | | - attestation blocks, fenced code, block quotes, ordered/unordered lists. |
25 | | - Entry points: `parse()` and `parse_file()`. |
26 | | -* `src/renderer.rs` — serialises a `Document` AST back to canonical A2ML, |
27 | | - making round-trips deterministic. |
28 | | -* `src/types.rs` — core types: `Document`, `Block`, `Inline`, `Directive`, |
29 | | - `Attestation`, `TrustLevel` (Unverified → Automated → Reviewed → Verified), |
30 | | - `Manifest`. |
31 | | -* `src/error.rs` — `A2mlError`: `ParseError`, `Io`, `RenderError`. |
| 25 | +- `src/parser.rs` — line-oriented state machine: headings, directives, |
| 26 | + attestation blocks, fenced code, block quotes, ordered/unordered |
| 27 | + lists. Entry points: `parse()` and `parse_file()`. |
| 28 | + |
| 29 | +- `src/renderer.rs` — serialises a `Document` AST back to canonical |
| 30 | + A2ML, making round-trips deterministic. |
| 31 | + |
| 32 | +- `src/types.rs` — core types: `Document`, `Block`, `Inline`, |
| 33 | + `Directive`, `Attestation`, `TrustLevel` (Unverified → Automated → |
| 34 | + Reviewed → Verified), `Manifest`. |
32 | 35 |
|
33 | | -The crate root is `#![forbid(unsafe_code)]`. Dependencies: `serde`/`serde_derive` |
34 | | -for serialisation, `thiserror` for error types, `criterion` for benchmarks only. |
| 36 | +- `src/error.rs` — `A2mlError`: `ParseError`, `Io`, `RenderError`. |
35 | 37 |
|
36 | | -== Usage |
| 38 | +The crate root is `#![forbid(unsafe_code)]`. Dependencies: |
| 39 | +`serde`/`serde_derive` for serialisation, `thiserror` for error types, |
| 40 | +`criterion` for benchmarks only. |
37 | 41 |
|
38 | | -[source,rust] |
39 | | ----- |
| 42 | +# Usage |
| 43 | + |
| 44 | +```rust |
40 | 45 | use a2ml::{parse, render}; |
41 | 46 |
|
42 | 47 | let doc = parse(input_str)?; |
43 | 48 | let output = render(&doc)?; |
44 | | ----- |
45 | | - |
46 | | -== Attestation Trust Levels |
| 49 | +``` |
47 | 50 |
|
48 | | -[cols="1,3"] |
49 | | -|=== |
50 | | -| Level | Meaning |
| 51 | +# Attestation Trust Levels |
51 | 52 |
|
52 | | -| `Unverified` | No review — raw agent or tool output |
53 | | -| `Automated` | Processed by a pipeline without human review |
54 | | -| `Reviewed` | Human-reviewed (claimed, not cryptographically proved) |
55 | | -| `Verified` | Formally verified or cryptographically attested |
56 | | -|=== |
| 53 | +| Level | Meaning | |
| 54 | +|--------------|--------------------------------------------------------| |
| 55 | +| `Unverified` | No review — raw agent or tool output | |
| 56 | +| `Automated` | Processed by a pipeline without human review | |
| 57 | +| `Reviewed` | Human-reviewed (claimed, not cryptographically proved) | |
| 58 | +| `Verified` | Formally verified or cryptographically attested | |
57 | 59 |
|
58 | 60 | Attestations are syntactic declarations, not cryptographic signatures. |
59 | 61 | Signature verification belongs in the Groove protocol stack. |
60 | 62 |
|
61 | | -== Related |
| 63 | +# Related |
| 64 | + |
| 65 | +- [pandoc-a2ml](https://github.com/hyperpolymath/pandoc-a2ml) — Pandoc |
| 66 | + reader/writer for A2ML |
62 | 67 |
|
63 | | -* link:https://github.com/hyperpolymath/pandoc-a2ml[pandoc-a2ml] — Pandoc reader/writer for A2ML |
64 | | -* link:https://github.com/hyperpolymath/a2ml-haskell[a2ml-haskell] — Haskell implementation |
| 68 | +- [a2ml-haskell](https://github.com/hyperpolymath/a2ml-haskell) — |
| 69 | + Haskell implementation |
65 | 70 |
|
66 | | -== License |
| 71 | +# License |
67 | 72 |
|
68 | | -MPL-2.0. See link:LICENSE[LICENSE]. |
| 73 | +MPL-2.0. See [LICENSE](LICENSE). |
0 commit comments