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
omega-mv / calibration / scripts / indep_source_digest.sh
| 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # indep_source_digest.sh: independent_scorer_source_sha256 of EXP-001 (rule turing.cal.indep_source.v1). |
| 18 | # |
| 19 | # sh calibration/scripts/indep_source_digest.sh [--lines] |
| 20 | # |
| 21 | # Listing = for every regular file under tools/turing_verify_indep/ (the lane D independent scorer: src/, |
| 22 | # SPEC_GAPS.md), one line '<sha256 of the file, 64 lowercase hex> <path relative to |
| 23 | # tools/turing_verify_indep>' + LF, sorted by path in LC_ALL=C byte order. The digest is SHA-256 of the listing |
| 24 | # bytes. A build/ directory (made if someone runs the scorer's own Makefile in place) is skipped; make |
| 25 | # turing-verify-indep builds outside the tree. --lines prints the listing. |
| 26 | # The value is written into candidate_manifest.json by freeze_candidate.sh and checked by freeze_receipt.sh and |
| 27 | # by turing-cal-eval in sealed mode. No Python: POSIX sh + find + sha256sum + sort. |
| 28 | set -eu |
| 29 | dir=$(cd "$(dirname "$0")/../.." && pwd) |
| 30 | src="$dir/tools/turing_verify_indep" |
| 31 | [ -d "$src" ] || { echo "indep_source_digest: REFUSED: $src missing" >&2; exit 1; } |
| 32 | list=$(cd "$src" && find . -path ./build -prune -o -type f -print | sed 's|^\./||' | LC_ALL=C sort | while IFS= read -r p; do |
| 33 | printf '%s %s\n' "$(sha256sum "$p" | cut -c1-64)" "$p" |
| 34 | done) |
| 35 | if [ "${1:-}" = "--lines" ]; then printf '%s\n' "$list"; else printf '%s\n' "$list" | sha256sum | cut -c1-64; fi |