Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/check/receipt.sh # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / check / receipt.sh` 22 lines ยท 1195 bytes Raw Blame History 1 #!/bin/sh 2 # receipt.sh OUT REC [FILE...] -- compare a gate run's results (OUT, under build/) with the recorded receipt 3 # (REC, under evidence/). REC is only read: a rerun never writes a recorded receipt (evidence/ is additions 4 # only, OMEGA-EVIDENCE-IMMUTABLE). Each file in OUT whose name REC also holds is compared byte for byte, 5 # except *.log (a log carries the run's date and commit). Each FILE, a recorded copy kept outside REC 6 # (seed/rung4/om4.audit), is compared with OUT/. Prints one line. Exit 0: all the same; 7 # 1: some differ; 2: no receipt (REC empty or missing), nothing compared. 8 set -eu 9 out=$1; rec=$2; shift 2 10 if [ -z "$rec" ] || [ ! -d "$rec" ]; then echo "receipt ${rec:-(none)}: none recorded, nothing compared"; exit 2; fi 11 n=0; d="" 12 for f in "$out"/*; do 13 b=${f##*/} 14 case $b in *.log) continue ;; esac 15 [ -f "$f" ] && [ -f "$rec/$b" ] || continue 16 n=$((n + 1)); cmp -s "$f" "$rec/$b" || d="$d $b" 17 done 18 for r in "$@"; do 19 n=$((n + 1)); cmp -s "$out/${r##*/}" "$r" || d="$d $r" 20 done 21 if [ -z "$d" ]; then echo "receipt $rec: $n files compared, all the same (not rewritten)"; exit 0; fi 22 echo "receipt $rec: $n files compared, differ (not rewritten):$d"; exit 1