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 / mk / turing_exp001_indep.mk
| 1 | # Turing calibration EXP-001, lane D: the independent scorer (tools/turing_verify_indep, copied unchanged from |
| 2 | # the lane D workspace; its own Makefile is kept as delivered but not used here). Picked up by -include mk/*.mk. |
| 3 | # All variables TVI_-prefixed. |
| 4 | # |
| 5 | # make turing-verify-indep build build/turing-verify-indep/indep-scorer (+ indep-selftest) |
| 6 | # make test-turing-verify-indep independence grep check + the scorer's own self-test (no dev data needed) |
| 7 | # |
| 8 | # Independence: the build uses ONLY tools/turing_verify_indep/src (never -Isrc, never an omega object), and the |
| 9 | # check refuses any #include outside that directory's own headers and libc, and any ty_/tc_ identifier in code |
| 10 | # (comments stripped first; the scorer's comments cite omega file names as provenance only). |
| 11 | .PHONY: turing-verify-indep test-turing-verify-indep |
| 12 | TVI_SRC = tools/turing_verify_indep/src |
| 13 | TVI_DIR = $(OUT_DIR)/turing-verify-indep |
| 14 | TVI_BIN = $(TVI_DIR)/indep-scorer |
| 15 | TVI_SELF = $(TVI_DIR)/indep-selftest |
| 16 | TVI_OMC ?= seed/out/omc |
| 17 | TVI_BASE = $(TVI_SRC)/sha256.om $(TVI_SRC)/core.om |
| 18 | |
| 19 | $(TVI_BIN): $(TVI_BASE) $(TVI_SRC)/main.om $(TVI_OMC) |
| 20 | @mkdir -p $(TVI_DIR) |
| 21 | cat $(TVI_BASE) $(TVI_SRC)/main.om | $(TVI_OMC) > $@.tmp.$$$$ && chmod +x $@.tmp.$$$$ && mv -f $@.tmp.$$$$ $@ |
| 22 | $(TVI_SELF): $(TVI_BASE) $(TVI_SRC)/selftest.om $(TVI_OMC) |
| 23 | @mkdir -p $(TVI_DIR) |
| 24 | cat $(TVI_BASE) $(TVI_SRC)/selftest.om | $(TVI_OMC) > $@.tmp.$$$$ && chmod +x $@.tmp.$$$$ && mv -f $@.tmp.$$$$ $@ |
| 25 | |
| 26 | turing-verify-indep: $(TVI_BIN) $(TVI_SELF) |
| 27 | |
| 28 | test-turing-verify-indep: $(TVI_BIN) $(TVI_SELF) |
| 29 | @bad=$$(grep -h '^[[:space:]]*#[[:space:]]*include' $(TVI_SRC)/* | grep -v -E '#[[:space:]]*include[[:space:]]*(<[a-z0-9_/]+\.h>|"(core|sha256)\.h")' || true); \ |
| 30 | [ -z "$$bad" ] || { echo "turing-verify-indep: non-local include: $$bad"; exit 1; } |
| 31 | @ids=$$(for f in $(TVI_SRC)/*; do awk '{ s = s $$0 "\n" } END { gsub(/\/\*([^*]|\*+[^*\/])*\*+\//, "", s); printf "%s", s }' "$$f" \ |
| 32 | | sed 's://.*$$::' | grep -n -E '\b(ty|tc)_[A-Za-z0-9_]+' | sed "s|^|$$f:|"; done); \ |
| 33 | [ -z "$$ids" ] || { echo "turing-verify-indep: omega identifiers in code:"; echo "$$ids"; exit 1; } |
| 34 | @echo "turing-verify-indep: no omega include, no ty_/tc_ identifier" |
| 35 | cd $(TVI_DIR) && ./indep-selftest |
| 36 | @echo "turing-verify-indep source digest: $$(sh calibration/scripts/indep_source_digest.sh)" |