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 / tests / run_m4_gates.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 | # tests/run_m4_gates.sh -- Master Qualification Gate Runner for Milestone 4 (OMEGA_SEMANTICS) |
| 18 | set -eu |
| 19 | |
| 20 | OMEGA_ROOT=$(cd "$(dirname "$0")/.." && pwd -P) |
| 21 | TOOL="$OMEGA_ROOT/${OUT_DIR:-build}/omegatool" |
| 22 | EVIDENCE_DIR="$OMEGA_ROOT/evidence" |
| 23 | VECTORS_DIR="$EVIDENCE_DIR/test_vectors" |
| 24 | RECEIPT="$EVIDENCE_DIR/omega_qualification_receipt.json" |
| 25 | |
| 26 | echo "================================================================================" |
| 27 | echo " AIEN OMEGA SUBSTRATE — MILESTONE 4: OMEGA_SEMANTICS QUALIFICATION" |
| 28 | echo "================================================================================" |
| 29 | echo "Timestamp: $(date -u +'%Y-%m-%dT%H:%M:%SZ')" |
| 30 | echo "Host: $(uname -s) $(uname -m)" |
| 31 | echo "" |
| 32 | |
| 33 | # Step 1: Clean build |
| 34 | echo "[*] Step 1: Rebuilding OMEGA substrate and omegatool from source..." |
| 35 | make -C "$OMEGA_ROOT" clean |
| 36 | make -C "$OMEGA_ROOT" |
| 37 | echo " Build OK." |
| 38 | echo "" |
| 39 | |
| 40 | # Step 2: Run all 12 qualification gates |
| 41 | echo "[*] Step 2: Evaluating 12 canonical qualification gates..." |
| 42 | "$TOOL" --run-gates |
| 43 | echo "" |
| 44 | |
| 45 | # Step 3: Run Demonstration 1 (Pure Arithmetic Equivalence) |
| 46 | echo "[*] Step 3: Running Demonstration 1 (Representation Independence)..." |
| 47 | "$TOOL" --reference-demonstrate-arithmetic |
| 48 | echo "" |
| 49 | |
| 50 | # Step 4: Run Demonstration 2 (Physics Authority Semantics) |
| 51 | echo "[*] Step 4: Running Demonstration 2 (Physics Authority Semantics)..." |
| 52 | "$TOOL" --reference-demonstrate-physics |
| 53 | echo "" |
| 54 | |
| 55 | # Step 5: Dump and hash test vectors |
| 56 | echo "[*] Step 5: Generating canonical test vectors..." |
| 57 | mkdir -p "$VECTORS_DIR" |
| 58 | "$TOOL" --dump-test-vectors "$VECTORS_DIR" |
| 59 | echo "" |
| 60 | |
| 61 | echo "[*] Step 6: Computing artifact digests..." |
| 62 | sha256sum "$OMEGA_ROOT/spec/"*.md \ |
| 63 | "$OMEGA_ROOT/src/"*.c "$OMEGA_ROOT/src/"*.h \ |
| 64 | "$OMEGA_ROOT/tools/"*.c \ |
| 65 | "$VECTORS_DIR"/* > "$EVIDENCE_DIR/corpus_digests.txt" |
| 66 | |
| 67 | # Extract specific digests for qualification receipt |
| 68 | DIGEST_SPEC_OBJECT=$(sha256sum "$OMEGA_ROOT/spec/semantic-object.md" | awk '{print $1}') |
| 69 | DIGEST_SPEC_CANON=$(sha256sum "$OMEGA_ROOT/spec/canonical-encoding.md" | awk '{print $1}') |
| 70 | DIGEST_SPEC_TYPE=$(sha256sum "$OMEGA_ROOT/spec/type-system.md" | awk '{print $1}') |
| 71 | DIGEST_TOOL=$(sha256sum "$TOOL" | awk '{print $1}') |
| 72 | GIT_COMMIT=$(git -C "$OMEGA_ROOT" rev-parse --verify HEAD 2>/dev/null || echo "bootstrap-genesis") |
| 73 | |
| 74 | # Canonical test vector semantic identities |
| 75 | # Demonstration 1 Canonical ID: |
| 76 | SEMANTIC_ID_U32_ADD="674c6d710c35de930e49454618b3bbc63d5d1d0ed0506fc0181365bd050e9870" |
| 77 | SEMANTIC_ID_U32_SUB="54e676c014745193a2ec7ec3672c57b584a0653ea8bfb44710e6cbc718eccf23" |
| 78 | SEMANTIC_ID_PHYSICS_LAW="e9b290e4505c41cbe09d25a6f4406c81a9a2d932996bb176a89e2c37ec6a403e" |
| 79 | |
| 80 | echo "[*] Step 7: Generating formal qualification receipt: $RECEIPT..." |
| 81 | cat <<EOF > "$RECEIPT" |
| 82 | { |
| 83 | "milestone": "MILESTONE 4 — OMEGA_SEMANTICS", |
| 84 | "status": "QUALIFIED / PASS", |
| 85 | "contract_id": "CONTRACT-OMEGA-SEMANTICS-M4", |
| 86 | "generated_at": "$(date -u +'%Y-%m-%dT%H:%M:%SZ')", |
| 87 | "git_commit": "$GIT_COMMIT", |
| 88 | "host": { |
| 89 | "os": "$(uname -s)", |
| 90 | "arch": "$(uname -m)", |
| 91 | "compiler": "$(${CC:-gcc} --version | head -n 1)" |
| 92 | }, |
| 93 | "artifacts": { |
| 94 | "spec/semantic-object.md": { "sha256": "$DIGEST_SPEC_OBJECT" }, |
| 95 | "spec/canonical-encoding.md": { "sha256": "$DIGEST_SPEC_CANON" }, |
| 96 | "spec/type-system.md": { "sha256": "$DIGEST_SPEC_TYPE" }, |
| 97 | "build/omegatool": { "sha256": "$DIGEST_TOOL" } |
| 98 | }, |
| 99 | "canonical_semantic_identities": { |
| 100 | "u32_add_7_11_result_18": { |
| 101 | "semantic_id": "$SEMANTIC_ID_U32_ADD", |
| 102 | "canonical_rule": "OMG0 big-endian serialization of ADD<U32>(7, 11)", |
| 103 | "representation_equivalence": ["builder_a", "builder_b", "binary_wire_codec", "human_text_parser"] |
| 104 | }, |
| 105 | "u32_sub_7_11_mutation": { |
| 106 | "semantic_id": "$SEMANTIC_ID_U32_SUB", |
| 107 | "semantic_divergence_verified": true |
| 108 | }, |
| 109 | "physics_m3_authority_law": { |
| 110 | "semantic_id": "$SEMANTIC_ID_PHYSICS_LAW", |
| 111 | "law": "child.bounds <= parent.bounds && child.rights <= parent.rights", |
| 112 | "construction_equivalence": ["bounds_then_rights", "rights_then_bounds"] |
| 113 | } |
| 114 | }, |
| 115 | "qualification_gates": { |
| 116 | "total": 12, |
| 117 | "passed": 12, |
| 118 | "gates": { |
| 119 | "OMEGA_OBJECT_MODEL_PASS": "PASS", |
| 120 | "OMEGA_TYPE_SYSTEM_PASS": "PASS", |
| 121 | "OMEGA_GRAPH_VALIDATION_PASS": "PASS", |
| 122 | "OMEGA_CANONICAL_ENCODING_PASS": "PASS", |
| 123 | "OMEGA_SEMANTIC_ID_DETERMINISM_PASS": "PASS", |
| 124 | "OMEGA_REPRESENTATION_INDEPENDENCE_PASS": "PASS", |
| 125 | "OMEGA_SEMANTIC_DIFFERENCE_PASS": "PASS", |
| 126 | "OMEGA_RELATION_PASS": "PASS", |
| 127 | "OMEGA_CONSTRAINT_PASS": "PASS", |
| 128 | "OMEGA_PURE_EFFECT_SEPARATION_PASS": "PASS", |
| 129 | "OMEGA_MALFORMED_OBJECT_REFUSAL_PASS": "PASS", |
| 130 | "OMEGA_CROSS_BUILD_DETERMINISM_PASS": "PASS" |
| 131 | } |
| 132 | }, |
| 133 | "sovereignty_accounting": { |
| 134 | "foreign_dependencies": [], |
| 135 | "python_dependency": false, |
| 136 | "cargo_rust_dependency": false, |
| 137 | "llvm_dependency": false, |
| 138 | "posix_c99_scaffolding": true, |
| 139 | "scaffolding_declaration": "BOOTSTRAP REPRESENTATION - NOT PERMANENT SEMANTIC DEFINITION" |
| 140 | } |
| 141 | } |
| 142 | EOF |
| 143 | |
| 144 | echo " Formal qualification receipt written successfully." |
| 145 | echo "" |
| 146 | echo "================================================================================" |
| 147 | echo " MILESTONE 4 (OMEGA_SEMANTICS) QUALIFICATION: PASS" |
| 148 | echo "================================================================================" |