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/tests/argus_lock_validation.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 / tests / argus_lock_validation.sh` 63 lines ยท 2035 bytes Raw Blame History 1 #!/usr/bin/env bash 2 # SPDX-License-Identifier: Apache-2.0 3 # Copyright 2026 Drake Stapleton (AIEN / aien-dev) 4 5 set -u 6 ROOT=$(cd "$(dirname "$0")/.." && pwd) 7 TMP=$(mktemp -d "${TMPDIR:-/tmp}/omega-argus-lock.XXXXXX") || exit 2 8 trap 'rm -rf "$TMP"' EXIT INT TERM 9 GOOD=$(tr -d '\n' < "$ROOT/argus.lock") 10 # The Makefile also parses aienos.lock at load; give the fixture the real one. 11 cp "$ROOT/aienos.lock" "$TMP/aienos.lock" 12 FAILS=0 13 14 accept() { 15 local name=$1 content=$2 16 printf '%s' "$content" > "$TMP/argus.lock" 17 if make -s -C "$TMP" -f "$ROOT/Makefile" check-argus-lock >"$TMP/make.log" 2>&1; then 18 printf 'ok %s\n' "$name" 19 else 20 printf 'FAIL %s\n' "$name" 21 FAILS=$((FAILS + 1)) 22 fi 23 } 24 25 reject() { 26 local name=$1 content=$2 27 printf '%s' "$content" > "$TMP/argus.lock" 28 if make -s -C "$TMP" -f "$ROOT/Makefile" check-argus-lock >"$TMP/make.log" 2>&1; then 29 printf 'FAIL %s\n' "$name" 30 FAILS=$((FAILS + 1)) 31 elif grep -q 'argus.lock must contain exactly one lowercase 40-hex commit' "$TMP/make.log"; then 32 printf 'ok %s\n' "$name" 33 else 34 printf 'FAIL %s (wrong refusal)\n' "$name" 35 FAILS=$((FAILS + 1)) 36 fi 37 } 38 39 accept "one lowercase commit" "$GOOD"$'\n' 40 accept "commit without final newline" "$GOOD" 41 reject "empty lock" "" 42 reject "abbreviated commit" "${GOOD:0:39}"$'\n' 43 reject "uppercase commit" "${GOOD^^}"$'\n' 44 reject "leading whitespace" " $GOOD"$'\n' 45 reject "trailing whitespace" "$GOOD "$'\n' 46 reject "extra field" "$GOOD extra"$'\n' 47 reject "option-like value" "--$GOOD"$'\n' 48 reject "second commit" "$GOOD"$'\n'"$GOOD"$'\n' 49 reject "trailing blank line" "$GOOD"$'\n\n' 50 reject "trailing comment" "$GOOD"$'\n# comment\n' 51 52 PWNED="$TMP/shell-metacharacters-ran" 53 reject "shell metacharacters" "$GOOD ; touch $PWNED"$'\n' 54 if [ -e "$PWNED" ]; then 55 echo "FAIL shell metacharacters executed" 56 FAILS=$((FAILS + 1)) 57 fi 58 59 if [ "$FAILS" -ne 0 ]; then 60 echo "argus lock validation: $FAILS FAILED" 61 exit 1 62 fi 63 echo "argus lock validation: PASS"