Trusted evidence pack verification library and CLI for MoonBit.
graph TD
subgraph adapters["Adapters (the only place IO happens)"]
CLI["src/cmd/main<br/>CLI: verify / explain"]
API["src/api<br/>browser esm adapter"]
end
subgraph core["Pure verification core (zero IO, portable across 3 backends)"]
VERIFY["verify<br/>7-step pipeline + chain linearity"]
MODEL["model<br/>manifest / version chain"]
DIAG["diag<br/>findings · explain · canonical report"]
CANON["canonjson<br/>RFC 8785"]
DIGEST["digest<br/>pure SHA-256"]
MERKLE["merkle<br/>RFC 6962 style tree"]
end
CLI --> VERIFY
API --> VERIFY
VERIFY --> MODEL
VERIFY --> DIAG
VERIFY --> CANON
VERIFY --> MERKLE
VERIFY --> DIGEST
MODEL --> DIGEST
MERKLE --> DIGEST
DIAG --> CANON# build the CLI (js artifact, runs via node; native works wherever a C compiler exists)
moon build --target js
# verify the bundled example packs
node _build/js/debug/build/src/cmd/main/main.js verify examples/valid-pack
node _build/js/debug/build/src/cmd/main/main.js verify examples/tampered-pack
# machine-readable report / human-readable findings
node _build/js/debug/build/src/cmd/main/main.js verify --json examples/valid-pack
node _build/js/debug/build/src/cmd/main/main.js explain examples/tampered-pack
# run the full black-box suite (12 cases)
powershell -ExecutionPolicy Bypass -File tools/cli-test.ps1 -Target jsmoon build --target js
# serve the repository root with any static server, then open
# http://localhost:8765/demo/web/
python -m http.server 8765
verification FAILED
[E2003] files/data.csv: digest mismatch, expected sha256:ab.. got sha256:cd..
[W1001] files/extra.bin: file present in pack but not listed in manifest
checked 12 files, 11 passed; merkle root verified; 1 error, 1 warning{"findings":[],"ok":true,"stats":{"files_passed":2,"files_total":2,"merkle_checked":true}}| Benchmark | Mean ± σ | Derived rate |
|---|---|---|
| SHA-256, 1 MiB payload | 17.10 ms ± 0.21 ms | ~58 MiB/s |
| SHA-256, 64 KiB payload | 1.12 ms ± 0.02 ms | ~56 MiB/s |
| Full verify, 1k-file manifest (64 B files) | 25.65 ms ± 0.78 ms | ~26 µs/file |
| Full verify, 10k-file manifest (64 B files) | 283.52 ms ± 6.18 ms | ~28 µs/file |
moon check
moon test --target wasm-gc,js
moon build --target js
powershell -ExecutionPolicy Bypass -File tools/cli-test.ps1 -Target js
node tools/smoke-api.mjs
moon bench --target jsInstall
Download zipTrusted evidence pack verification library and CLI for MoonBit.