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 / create"]
API["src/api<br/>browser esm adapter"]
CREATE["src/create<br/>evidence pack creation"]
AUDIT["src/audit<br/>audit log + signatures"]
end
subgraph core["Verification Core (zero IO, 3-backend portable)"]
VERIFY["verify<br/>7-step pipeline + version chain"]
MODEL["model<br/>manifest / version chain"]
DIAG["diag<br/>structured findings · explain"]
end
subgraph foundation["Foundation Layer"]
CANON["canonjson<br/>RFC 8785 canonicalization"]
DIGEST["digest<br/>SHA-256 / SHA-512 / HMAC"]
MERKLE["merkle<br/>RFC 6962 style tree"]
CRYPTO["crypto<br/>Ed25519 signatures"]
STORE["store<br/>content-addressed storage"]
end
CLI --> VERIFY
CLI --> CREATE
API --> VERIFY
CREATE --> DIGEST
CREATE --> MERKLE
CREATE --> CANON
AUDIT --> CRYPTO
AUDIT --> DIGEST
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
$cli = "_build/js/debug/build/src/cmd/main/main.js"
# verify the bundled example packs
node $cli verify examples/valid-pack
node $cli explain examples/tampered-pack
# create your own evidence pack
node $cli create examples/valid-pack/files my-pack
node $cli verify my-pack
# machine-readable report / human-readable findings
node $cli verify --json examples/valid-pack
node $cli explain examples/tampered-pack
# run the full black-box suite
powershell -ExecutionPolicy Bypass -File tools/cli-test.ps1 -Target js
bash ./tools/cli-test.sh 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 native,wasm-gc,js
moon build --target js
moon build --target native
powershell -ExecutionPolicy Bypass -File tools/cli-test.ps1 -Target js
powershell -ExecutionPolicy Bypass -File tools/cli-test.ps1 -Target native
bash ./tools/cli-test.sh js
bash ./tools/cli-test.sh native
node tools/smoke-api.mjs
moon bench --target jsInstall
Download zipTrusted evidence pack verification library and CLI for MoonBit.