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/cortex/blob/main/check.sh # cortex aien-dev/cortex Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `cortex / check.sh` 55 lines ยท 3178 bytes Raw Blame History 1 #!/bin/sh 2 # check.sh : every local gate of the Omega Cortex, one after the other (no CI; see README.md). 3 # sh check.sh SRC.db 4 # SRC.db is a cortex-rs database (opened read-only; take a copy with sqlite3 .backup first). 5 # Steps: build, page-unit encoder (tools/pageunit), JSON/number differentials, FTS/LIKE differentials, 6 # importer checks, Company Brain gate and its mutants, Brain load/alarm/kill -9, wire parity gate, 7 # parity mutant (must be caught), load and kill -9 durability. 8 # Logs and fresh evidence go to $CHECK_DIR (default build/check); the committed evidence/ files are 9 # not touched. 10 # Exit 0 only when every step passes. Runs at lowest CPU and I/O priority, one step at a time. 11 set -u 12 if [ -z "${CXO_NICED:-}" ]; then CXO_NICED=1 exec nice -n 19 ionice -c3 sh "$0" "$@"; fi 13 SRC=${1:?usage: check.sh SRC.db} 14 [ -f "$SRC" ] || { echo "check: $SRC not found" >&2; exit 2; } 15 SRC=$(cd "$(dirname "$SRC")" && pwd)/$(basename "$SRC") 16 R=$(cd "$(dirname "$0")" && pwd) 17 C=${CHECK_DIR:-$R/build/check} 18 rm -rf "$C" 19 mkdir -p "$C" || exit 2 20 fails=0 21 step() { # step NAME COMMAND... 22 name=$1; shift 23 t0=$(date +%s) 24 "$@" > "$C/$name.log" 2>&1 25 rc=$? 26 t1=$(date +%s) 27 if [ $rc -eq 0 ]; then echo "PASS $name ($((t1 - t0)) s)"; else echo "FAIL $name rc=$rc ($((t1 - t0)) s), log $C/$name.log"; fails=$((fails + 1)); fi 28 return $rc 29 } 30 cd "$R" || exit 2 31 step build sh build.sh || { echo "check: build failed, nothing else can run"; exit 1; } 32 step pin env WORK="$C/pin-work" sh tests/pin/run.sh 33 step pageunit env WORK="$C/pageunit-work" sh tests/pageunit/run.sh 34 step json env W="$C/json-work" bash tests/json/run.sh 35 step fts env WORK="$C/fts-work" FTS_EVIDENCE="$C/fts" sh tests/fts/run.sh "$SRC" 36 step import env LIVE="$SRC" sh tests/import/run.sh "$C/import-work" 37 step big env WORK="$C/big-work" sh tests/big/run.sh "$SRC" 38 step brain env BRAIN_WORK="$C/brain-work" BRAIN_EVIDENCE="$C/brain" sh tests/brain/run.sh 39 step brainmut env BRAIN_MUTANT_WORK="$C/brain-mutant" BRAIN_EVIDENCE="$C/brain" sh tests/brain/mutant.sh 40 step brainload env BRAIN_LOAD_WORK="$C/brain-load" BRAIN_EVIDENCE="$C/brain" sh tests/brain/load.sh "$SRC" 41 rm -rf "$C/pageunit-work" "$C/json-work" "$C/fts-work" "$C/import-work" "$C/big-work" "$C/brain-work" "$C/brain-mutant" "$C/brain-load" 42 if step parity env PARITY_WORK="$C/parity-work" PARITY_EVIDENCE="$C/parity" sh tests/parity/run.sh "$SRC"; then 43 step mutant env MUTANT_WORK="$C/mutant-work" MUTANT_EVIDENCE="$C/parity" sh tests/parity/mutant.sh "$SRC" 44 rm -rf "$C/mutant-work" 45 step load env PARITY_WORK="$C/parity-work" LOAD_WORK="$C/load-work" LOAD_EVIDENCE="$C/load" sh tests/load/run.sh "$SRC" 46 rm -rf "$C/load-work" 47 step conc env PARITY_WORK="$C/parity-work" CONC_WORK="$C/conc-work" CONC_EVIDENCE="$C/conc" sh tests/conc/run.sh "$SRC" 48 rm -rf "$C/conc-work" 49 step claims env PARITY_GEN="$R/tests/claims/gen.sh" PARITY_WORK="$C/claims-work" PARITY_EVIDENCE="$C/claims" sh tests/parity/run.sh "$SRC" 50 rm -rf "$C/claims-work" 51 else 52 echo "SKIP mutant, load, conc, claims (they need a passing parity run)"; fails=$((fails + 4)) 53 fi 54 if [ $fails -eq 0 ]; then echo "check: ALL PASS"; exit 0; fi 55 echo "check: $fails step(s) failed"; exit 1