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 / source-aware / sa

17 lines · 739 bytes Raw Blame History
1#!/bin/sh
2# Transport only; all parsing, typing, hashing and decisions execute in native Omega.
3set -eu
4cd "$(dirname "$0")/../.."
5[ "$#" = 1 ] || { echo BAD_COMMAND >&2; exit 64; }
6case "$1" in
7encode) mode='\001';; decode) mode='\002';; identity) mode='\003';;
8provenance) mode='\004';; replay) mode='\005';; legality) mode='\006';;
9*) echo BAD_COMMAND >&2; exit 64;;
10esac
11build=${SA_BUILD:-build/L574}
12[ -x "$build/sa" ] || { echo 'MISSING_IMPLEMENTATION: run tools/source-aware/build' >&2; exit 69; }
13tmp=$(mktemp -d)
14trap 'rm -f "$tmp/out"; rmdir "$tmp"' EXIT HUP INT TERM
15# The native entry reads through EOF and checks the bounded input before output.
16{ printf "$mode"; cat; } | "$build/sa" > "$tmp/out" || exit "$?"
17cat "$tmp/out"