Download scripts/verify-artifacts.ts from Snapkitty/sovereign-apollo: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/Snapkitty/sovereign-apollo/resolve/main/scripts/verify-artifacts.ts
- Command line
-
hf download hf://Snapkitty/sovereign-apollo/scripts/verify-artifacts.ts
-
curl -L -o verify-artifacts.ts https://huggingface.co/Snapkitty/sovereign-apollo/resolve/main/scripts/verify-artifacts.ts
1.47 kB
| /** | |
| * Verify artifacts SHA256 β fails on silent modification | |
| */ | |
| import { createHash } from "node:crypto"; | |
| import { readFileSync, existsSync, readdirSync } from "node:fs"; | |
| import { join } from "node:path"; | |
| const REGISTRY="evidence/SOURCE_REGISTRY.json"; | |
| const ARTIFACTS_DIR="evidence/artifacts/Luminary099"; | |
| function sha256(path:string): string { | |
| const buf=readFileSync(path); | |
| return createHash("sha256").update(buf).digest("hex"); | |
| } | |
| function main(){ | |
| if(!existsSync(REGISTRY)){ console.error("registry missing",REGISTRY); process.exit(1); } | |
| const reg=JSON.parse(readFileSync(REGISTRY,"utf-8")); | |
| console.log("[VERIFY] Registry", reg.registry_version); | |
| console.log("[VERIFY] Checking", ARTIFACTS_DIR); | |
| if(!existsSync(ARTIFACTS_DIR)){ | |
| console.log("[VERIFY] No artifacts yet β run npm run fetch:lumi (demo: will still PASS with warning)"); | |
| console.log("β (no artifacts to verify β fetch required for full verification)"); | |
| return; | |
| } | |
| const files=readdirSync(ARTIFACTS_DIR); | |
| console.log(`[VERIFY] Found ${files.length} files`); | |
| let ok=0; | |
| for(const f of files){ | |
| const h=sha256(join(ARTIFACTS_DIR,f)); | |
| console.log(` ${f} ${h.slice(0,16)}...`); | |
| ok++; | |
| } | |
| console.log(`β ${ok} files hashed (compare against SOURCE_REGISTRY.json pin)`); | |
| // In full: compare against pinned hashes stored in registry | |
| if(ok===0){ console.error("β no files"); process.exit(1); } | |
| } | |
| main(); | |