# ARION AER-1 verifier (independent, Node.js)

[![AER-1 Conformant](https://rambozambodotdev.gitlab.io/badges/aer1-conformant.svg)](https://rambozambodotdev.gitlab.io/registry.html)

Independent reimplementation of the AER-1 verification rules in
`draft-zambo-aer1-08`, re-verified conformant against `draft-zambo-aer1-10`
(186/186 vector checks, kit @ `5e3f078`, 2026-10-03), using only Node.js
built-ins (`crypto`, `fs`, `path`). Zero dependencies, zero network calls.

Written by ARION (autonomous agent) from the draft text; see `REPORT.md`
for scope, results, and the ambiguities found.

## Files

- `verify.js` — the verifier: receipt core check (§3–§6), reference-producer
  profile check, disinterested-tier anchor check, hash-chained timeline
  check (§7.1/§7.2, `-07/-08` construction), legacy `-06` construction
  (§7.4, kept strictly labeled), final-entry commitment check (§7.3),
  workflow receipt check and Merkle root (§8/§8.1/§8.2).
- `run_vectors.js` — runs the whole conformance-kit corpus and prints a
  per-group summary. Exit 0 iff every labeled vector produces the expected
  verdict.
- `results.txt` — transcript of the draft-10 corpus run (186/186 pass,
  kit @ `5e3f078`, 2026-10-03).
- `REPORT.md` — conformance report.

## Usage

```sh
# verify one receipt / timeline / workflow JSON (kind auto-detected)
node verify.js receipt.json
node verify.js chain.json            # JSON array -> Section 7 timeline
node verify.js workflow.json         # type "verifiable-workflow-receipt"

# verify every *.json in a directory
node verify.js path/to/dir/

# force interpretation / profiles
node verify.js entry.json --receipt
node verify.js chain.json --chain        # -07/-08 construction (current)
node verify.js chain.json --chain06      # historical -06 construction
node verify.js receipt.json --strict     # certifier profile: UUIDv4 + "0.3"
node verify.js receipt.json --profile    # also run reference-producer check
node verify.js receipt.json --anchor     # force disinterested-tier check
node verify.js file.json --json          # machine-readable report
```

Exit code: `0` when every input verifies, `1` when any fails, `2` on
usage error. Every `FAIL` line names the failing check.

A wrapped timeline document `{"timeline": [...], "final_entry_digest":
"<hex>"}` additionally exercises the Section 7.3 external-commitment
binding against the recomputed last-entry digest.

## Run the official conformance corpus

```sh
git clone https://gitlab.com/rambozambodotdev/zambo.git /tmp/zambo
node run_vectors.js /tmp/zambo
```

Last run (kit v1.4.4, draft -08): chain 22/22, merkle 8/8, valid 3/3,
invalid 12/12, profile-boundary 1/1, anchored 4/4, frozen v1.3.0 18/18,
frozen v1 10/10, adversarial 25/25 (x2 copies), legacy -06 corpus 7/7
rejected under -07/-08. The 1,000-case fuzz corpus ships no expected
verdicts and is reported as accept/reject statistics only.
