interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / tools / composition_gate.sh

57 lines · 2034 bytes Raw Blame History
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# COMPOSITION-2 gate wrapper: refuses a dirty tree, builds and runs the gate
18# against the committed source, stores the receipt under its content hash:
19# evidence/COMPOSITION-2/<sha256-of-receipt>.json
20# Extra arguments are passed to make (e.g. AIENOS_LOCK_REPO=...).
21# --gpu (first argument): the GPU tier, both Skills executed on the GB10.
22# Run it only while holding the quiet flag (~/workspace/.spark-quiet).
23set -eu
24bintarget=composition-gate-bin
25if [ "${1:-}" = "--gpu" ]; then
26 bintarget=composition-gate-gpu-bin
27 shift
28fi
29root=$(git rev-parse --show-toplevel)
30cd "$root"
31if [ -n "$(git status --porcelain --untracked-files=normal)" ]; then
32 echo "composition_gate: working tree is dirty; commit first" >&2
33 git status --short >&2
34 exit 2
35fi
36commit=$(git rev-parse HEAD)
37make "$@" "$bintarget" >/dev/null
38bin=$(make -s "$@" "print-$bintarget")
39tmp=$(mktemp /tmp/composition_gate_receipt.XXXXXX)
40set +e
41"./$bin" "$commit" "$tmp"
42status=$?
43set -e
44if [ ! -s "$tmp" ]; then
45 echo "composition_gate: no receipt written (exit $status)" >&2
46 rm -f "$tmp"
47 exit 2
48fi
49sum=$(sha256sum "$tmp" | cut -d' ' -f1)
50mkdir -p evidence/COMPOSITION-2
51out="evidence/COMPOSITION-2/$sum.json"
52mv "$tmp" "$out"
53chmod 0644 "$out"
54verdict=$(sed -n 's/.*"verdict": "\([A-Z]*\)".*/\1/p' "$out" | head -n 1)
55echo "receipt: $out"
56echo "verdict: $verdict (commit $commit)"
57exit $status