|
1 | | -[](https://github.com/sponsors/hyperpolymath) |
2 | | - |
3 | | -= a2ml-pre-commit |
4 | | -:toc: preamble |
5 | | -:icons: font |
| 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 | +--> |
6 | 5 |
|
7 | | -== Overview |
| 6 | +# Overview |
8 | 7 |
|
9 | 8 | **Pre-commit hook for validating A2ML manifest files.** |
10 | 9 |
|
11 | | -A2ML (Agnostic Agent Markup Language) is a manifest format for machine-readable |
12 | | -metadata, AI agent instructions, and project state. This hook validates `.a2ml` |
13 | | -files on commit for structural correctness and required fields. |
| 10 | +A2ML (Agnostic Agent Markup Language) is a manifest format for |
| 11 | +machine-readable metadata, AI agent instructions, and project state. |
| 12 | +This hook validates `.a2ml` files on commit for structural correctness |
| 13 | +and required fields. |
| 14 | + |
| 15 | +# Checks Performed |
| 16 | + |
| 17 | +1. **SPDX header** — `SPDX-License-Identifier` in the first 10 lines |
| 18 | + |
| 19 | +2. **Identity fields** — Requires `agent-id`, `name`, or `project` |
| 20 | + (relaxed for AI-MANIFEST files) |
14 | 21 |
|
15 | | -== Checks Performed |
| 22 | +3. **Version field** — `version` or `schema_version` presence |
16 | 23 |
|
17 | | -1. **SPDX header** — `SPDX-License-Identifier` in the first 10 lines |
18 | | -2. **Identity fields** — Requires `agent-id`, `name`, or `project` (relaxed for AI-MANIFEST files) |
19 | | -3. **Version field** — `version` or `schema_version` presence |
20 | | -4. **Attestation blocks** — Validates `proof`/`signature`/`hash` fields if `[attestation]` section exists |
| 24 | +4. **Attestation blocks** — Validates `proof`/`signature`/`hash` fields |
| 25 | + if `[attestation]` section exists |
21 | 26 |
|
22 | | -== Installation |
| 27 | +# Installation |
23 | 28 |
|
24 | 29 | Add to your `.pre-commit-config.yaml`: |
25 | 30 |
|
26 | | -[source,yaml] |
27 | | ----- |
| 31 | +```yaml |
28 | 32 | repos: |
29 | 33 | - repo: https://github.com/hyperpolymath/a2ml-pre-commit |
30 | 34 | rev: v1.0.0 |
31 | 35 | hooks: |
32 | 36 | - id: validate-a2ml |
33 | | ----- |
| 37 | +``` |
34 | 38 |
|
35 | 39 | Then install: |
36 | 40 |
|
37 | | -[source,bash] |
38 | | ----- |
| 41 | +```bash |
39 | 42 | pre-commit install |
40 | | ----- |
| 43 | +``` |
41 | 44 |
|
42 | | -== Manual Usage |
| 45 | +# Manual Usage |
43 | 46 |
|
44 | 47 | You can also run the hook script directly: |
45 | 48 |
|
46 | | -[source,bash] |
47 | | ----- |
| 49 | +```bash |
48 | 50 | ./hooks/validate-a2ml.sh path/to/file.a2ml [more-files.a2ml ...] |
49 | | ----- |
| 51 | +``` |
50 | 52 |
|
51 | | -== Author |
| 53 | +# Author |
52 | 54 |
|
53 | | -Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
| 55 | +Jonathan D.A. Jewell \<[j.d.a.jewell@open.ac](j.d.a.jewell@open.ac).uk\> |
54 | 56 |
|
55 | | -== License |
| 57 | +# License |
56 | 58 |
|
57 | 59 | SPDX-License-Identifier: CC-BY-SA-4.0 |
58 | 60 |
|
59 | | -See link:LICENSE[LICENSE] for details. |
| 61 | +See [LICENSE](LICENSE) for details. |
0 commit comments