|
| 1 | +[](https://github.com/sponsors/hyperpolymath) |
| 2 | + |
| 3 | +// SPDX-License-Identifier: MPL-2.0 |
| 4 | +// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
| 5 | += a2mliser — Cryptographic Attestation for Any Markup or Configuration |
| 6 | +Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
| 7 | +:toc: left |
| 8 | +:toclevels: 3 |
| 9 | +:icons: font |
| 10 | +:source-highlighter: rouge |
| 11 | + |
| 12 | +== What Is a2mliser? |
| 13 | + |
| 14 | +a2mliser wraps any markup, configuration, or manifest file in an |
| 15 | +**A2ML (Attestable Markup Language) envelope** — adding cryptographic signatures, |
| 16 | +provenance chains, and tamper detection without altering the original content. |
| 17 | + |
| 18 | +Where most signing tools operate on opaque blobs, a2mliser understands |
| 19 | +structure. It parses TOML, YAML, JSON, XML, and INI files, then generates |
| 20 | +attestation wrappers that cover both the content and its schema. A consumer can |
| 21 | +verify not only that a file has not been tampered with, but that its structure |
| 22 | +conforms to the attested schema at the moment of signing. |
| 23 | + |
| 24 | +a2mliser is part of the |
| 25 | +https://github.com/hyperpolymath/iseriser[-iser acceleration family] — tools |
| 26 | +that wrap existing code in a target language's capabilities via manifest-driven |
| 27 | +code generation. |
| 28 | + |
| 29 | +== Key Value Proposition |
| 30 | + |
| 31 | +* **Any file can be attested** — configs, manifests, CI definitions, lock files, |
| 32 | + even other A2ML documents. |
| 33 | +* **Cryptographic proof** of authenticity and integrity (SHA-256, BLAKE3). |
| 34 | +* **Provenance chains** — trace any artifact back through its chain of custody. |
| 35 | + A attests B attests C, forming a directed acyclic graph of trust. |
| 36 | +* **Structure-aware signing** — unlike GPG detached signatures, a2mliser |
| 37 | + understands the file format and signs individual fields or sections. |
| 38 | +* **Supply chain security** — verify that CI configs, dependency manifests, and |
| 39 | + deployment descriptors have not been altered since the authorised signer |
| 40 | + produced them. |
| 41 | +* **Format-preserving** — the original file remains readable; attestation |
| 42 | + metadata is carried in a sidecar `.a2ml` envelope or embedded as comments. |
| 43 | + |
| 44 | +== Architecture |
| 45 | + |
| 46 | +a2mliser follows the hyperpolymath ABI-FFI-codegen architecture: |
| 47 | + |
| 48 | +[source] |
| 49 | +---- |
| 50 | + a2mliser.toml (user manifest) |
| 51 | + | |
| 52 | + v |
| 53 | + +------------------------+ |
| 54 | + | Manifest Parser (Rust) | <-- reads user intent |
| 55 | + +------------------------+ |
| 56 | + | |
| 57 | + +-------------+-------------+ |
| 58 | + | | |
| 59 | + v v |
| 60 | + +---------------------+ +-----------------------+ |
| 61 | + | Idris2 ABI Proofs | | Format Handlers | |
| 62 | + | (signature correct- | | (TOML, YAML, JSON, | |
| 63 | + | ness, non-repudia- | | XML, INI parsers) | |
| 64 | + | tion, chain valid- | +-----------------------+ |
| 65 | + | ity) | | |
| 66 | + +---------------------+ v |
| 67 | + | +-----------------------+ |
| 68 | + v | Attestation Engine | |
| 69 | + +---------------------+ | (hash, sign, embed) | |
| 70 | + | Zig FFI Bridge | +-----------------------+ |
| 71 | + | (crypto primitives: | | |
| 72 | + | BLAKE3, Ed25519, | v |
| 73 | + | SHA-256) | +-----------------------+ |
| 74 | + +---------------------+ | Codegen (A2ML wrapper | |
| 75 | + | | generation) | |
| 76 | + v +-----------------------+ |
| 77 | + +---------------------+ | |
| 78 | + | C Headers (generated| v |
| 79 | + | from ABI) | attested output files |
| 80 | + +---------------------+ (.a2ml envelopes) |
| 81 | +---- |
| 82 | + |
| 83 | +=== Layer Responsibilities |
| 84 | + |
| 85 | +Manifest Parser (Rust):: |
| 86 | + Reads `a2mliser.toml`, validates user intent, dispatches to format handlers |
| 87 | + and the attestation engine. |
| 88 | + |
| 89 | +Idris2 ABI (`src/interface/abi/`):: |
| 90 | + Formally proves that signature operations are correct: signing a document and |
| 91 | + verifying the same document always agree; provenance chains form a valid DAG; |
| 92 | + attestation envelopes are non-repudiable. |
| 93 | + |
| 94 | +Zig FFI (`src/interface/ffi/`):: |
| 95 | + Implements the actual cryptographic primitives (BLAKE3 hashing, Ed25519 |
| 96 | + signing, SHA-256 digests) as a C-compatible shared library. Zero runtime |
| 97 | + overhead from the proof layer — Idris2 proofs are erased at compile time. |
| 98 | + |
| 99 | +Format Handlers (`src/codegen/`):: |
| 100 | + Parse each supported format while preserving structure, identify attestable |
| 101 | + regions, and generate the A2ML envelope that wraps the original content. |
| 102 | + |
| 103 | +== Supported Formats |
| 104 | + |
| 105 | +[cols="1,3"] |
| 106 | +|=== |
| 107 | +| Format | Notes |
| 108 | + |
| 109 | +| TOML |
| 110 | +| Full structural attestation. Individual tables and key-value pairs can be |
| 111 | + signed independently. |
| 112 | + |
| 113 | +| YAML |
| 114 | +| Document and sub-document attestation. Anchors and aliases are resolved |
| 115 | + before signing. |
| 116 | + |
| 117 | +| JSON |
| 118 | +| Object-level and array-level attestation. JSON Schema can be co-attested. |
| 119 | + |
| 120 | +| XML |
| 121 | +| Element-level signing with XPath selectors. Namespace-aware. |
| 122 | + |
| 123 | +| INI |
| 124 | +| Section-level attestation. Comments are preserved but excluded from |
| 125 | + signatures by default. |
| 126 | + |
| 127 | +| Custom |
| 128 | +| Plugin system (Phase 3+) for arbitrary formats via a trait-based handler |
| 129 | + interface. |
| 130 | +|=== |
| 131 | + |
| 132 | +== CLI Commands |
| 133 | + |
| 134 | +[source,bash] |
| 135 | +---- |
| 136 | +# Create a new a2mliser.toml in the current directory |
| 137 | +a2mliser init |
| 138 | + |
| 139 | +# Validate an existing manifest |
| 140 | +a2mliser validate --manifest a2mliser.toml |
| 141 | + |
| 142 | +# Generate A2ML attestation envelopes for all declared files |
| 143 | +a2mliser generate --manifest a2mliser.toml --output attested/ |
| 144 | + |
| 145 | +# Build the generated artifacts (compile Zig FFI, link) |
| 146 | +a2mliser build --manifest a2mliser.toml [--release] |
| 147 | + |
| 148 | +# Run the attestation workload end-to-end |
| 149 | +a2mliser run --manifest a2mliser.toml |
| 150 | + |
| 151 | +# Show manifest information and attestation summary |
| 152 | +a2mliser info --manifest a2mliser.toml |
| 153 | +---- |
| 154 | + |
| 155 | +== Example Manifest |
| 156 | + |
| 157 | +An `a2mliser.toml` that attests a Cargo.toml and a CI workflow: |
| 158 | + |
| 159 | +[source,toml] |
| 160 | +---- |
| 161 | +# a2mliser manifest — declare which files to attest |
| 162 | +[workload] |
| 163 | +name = "my-project-attestation" |
| 164 | +entry = "Cargo.toml" |
| 165 | +strategy = "structure-aware" |
| 166 | + |
| 167 | +[data] |
| 168 | +input-type = "toml" |
| 169 | +output-type = "a2ml-envelope" |
| 170 | + |
| 171 | +[options] |
| 172 | +flags = ["sign-sections", "provenance-chain"] |
| 173 | + |
| 174 | +# Files to attest |
| 175 | +[[targets]] |
| 176 | +path = "Cargo.toml" |
| 177 | +format = "toml" |
| 178 | +granularity = "table" # sign each [section] independently |
| 179 | + |
| 180 | +[[targets]] |
| 181 | +path = ".github/workflows/ci.yml" |
| 182 | +format = "yaml" |
| 183 | +granularity = "document" # sign the entire document |
| 184 | + |
| 185 | +[signing] |
| 186 | +algorithm = "ed25519" |
| 187 | +hash = "blake3" |
| 188 | +key-source = "env:A2ML_SIGNING_KEY" # or "file:keys/signing.pem" |
| 189 | +---- |
| 190 | + |
| 191 | +== Integration With Other -isers |
| 192 | + |
| 193 | +k9iser:: |
| 194 | + Contract validation. k9iser validates that configuration files satisfy K9 |
| 195 | + contracts; a2mliser then attests the validated result, proving that the file |
| 196 | + both conforms to its contract and has not been modified since validation. |
| 197 | + |
| 198 | +typedqliser:: |
| 199 | + Query attestation. When typedqliser generates type-safe query wrappers, |
| 200 | + a2mliser can attest the generated code, proving it was produced by a specific |
| 201 | + version of typedqliser from a specific schema. |
| 202 | + |
| 203 | +verisimiser:: |
| 204 | + Database augmentation. Attestation records (who signed what, when) can be |
| 205 | + stored in VeriSimDB octads via verisimiser, providing a tamper-evident |
| 206 | + audit trail. |
| 207 | + |
| 208 | +== Build and Test |
| 209 | + |
| 210 | +[source,bash] |
| 211 | +---- |
| 212 | +# Build |
| 213 | +cargo build --release |
| 214 | + |
| 215 | +# Test |
| 216 | +cargo test |
| 217 | + |
| 218 | +# Full quality check (format, lint, test) |
| 219 | +just quality |
| 220 | + |
| 221 | +# Pre-commit scan |
| 222 | +just assail |
| 223 | +---- |
| 224 | + |
| 225 | +== Status |
| 226 | + |
| 227 | +**Pre-alpha (Phase 0 complete).** |
| 228 | + |
| 229 | +The CLI skeleton, manifest parser, and ABI/FFI scaffolding are in place. |
| 230 | +Codegen stubs exist but do not yet produce real attestation envelopes. |
| 231 | + |
| 232 | +See link:ROADMAP.adoc[ROADMAP.adoc] for the full development plan. |
| 233 | + |
| 234 | +See link:TOPOLOGY.md[TOPOLOGY.md] for the repository structure map. |
| 235 | + |
| 236 | +== License |
| 237 | + |
| 238 | +SPDX-License-Identifier: MPL-2.0 |
| 239 | + |
| 240 | +Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) |
0 commit comments