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/omega-mv/blob/main/research/atemporal/at1/oracle/isolation.sh # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / research / atemporal / at1 / oracle / isolation.sh` 79 lines ยท 4445 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 # Symbol-isolation gate for the AT-1 oracle compute crate (src/at1/), Rust adaptation of the 18 # charter's nm gate. 19 # 1. Source rule: no compute file names a std::time, std::fs, std::process, std::thread, 20 # std::net, std::env, random or clock facility. 21 # 2. Object rule: the compute crate compiled alone (rlib) has no undefined reference to a 22 # clock, file, process, thread, network, environment or random symbol (nm -u over its 23 # objects). Two symbol families are banned: libc entry points (the extern "C" route) and 24 # mangled Rust std paths (the std route: a std::time call leaves no libc symbol in the 25 # rlib, only a mangled std path; both the v0 form _RNv..NtCs_3std4time.. and the 26 # legacy form _ZN3std4time.. contain the substring 3std4time). 27 # 3. Negative control: a copy of the crate with a hidden std::time read must be caught by the 28 # source rule AND by the object rule on its own. 29 # Portable to macOS (BSD nm prefixes C symbols with an underscore, so anchored names allow 30 # an optional leading underscore; Mach-O mangled std paths keep the 3std4time substring). 31 # Exit 0 PASS, 1 FAIL. Prints every offending line. 32 set -u 33 cd "$(dirname "$0")" 34 FLAGS="--edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -C panic=abort" 35 fail=0 36 37 echo "== source rule (src/at1/)" 38 if grep -n -E 'std::(time|fs|process|thread|net|env|io::std(in|out|err))|SystemTime|Instant::|getrandom|rand::|libc::|extern "C"' src/at1/*.rs; then 39 echo "FAIL: forbidden facility named in compute code"; fail=1 40 else 41 echo "ok: no clock, file, process, thread, network, environment or random facility named" 42 fi 43 44 echo "== object rule (nm -u on the compute rlib)" 45 ./build.sh lib >/dev/null || { echo "FAIL: compute crate did not build alone"; exit 1; } 46 rm -rf target/iso && mkdir -p target/iso && (cd target/iso && ar x ../libat1.rlib) || { echo "FAIL: cannot unpack rlib"; exit 1; } 47 objs=$(ls target/iso/*.o 2>/dev/null) 48 [ -n "$objs" ] || { echo "FAIL: no objects in rlib"; exit 1; } 49 libc_names='clock_gettime|gettimeofday|^_?time$|nanosleep|getrandom|/dev/urandom|pthread_create|socket|connect|fopen|open64|openat|^_?read$|^_?write$|pread64|pwrite64|fork|execve|system|getenv|mach_absolute_time|arc4random' 50 std_paths='3std4time|3std2fs|3std7process|3std6thread|3std3net|3std3env|3std2io5stdio|6random' 51 banned="$libc_names|$std_paths" 52 object_rule() { 53 nm -u "$@" 2>/dev/null | awk '{print $NF}' | sort -u | grep -E "$banned" 54 } 55 if object_rule $objs; then 56 echo "FAIL: banned undefined symbol in compute objects"; fail=1 57 else 58 echo "ok: no clock, random, thread, socket, file, process or environment symbol referenced (libc names and mangled std paths)" 59 fi 60 61 echo "== negative control: a copy that reads the clock must be caught" 62 rm -rf target/mutant && mkdir -p target/mutant && cp -r src/at1 target/mutant/at1 63 printf '\npub fn hidden_clock() -> u64 { std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(0) }\n' >> target/mutant/at1/mod.rs 64 if grep -q -E 'std::(time|fs|process|thread|net|env)' target/mutant/at1/*.rs; then 65 echo "ok: mutant caught by the source rule" 66 else 67 echo "FAIL: mutant not caught by the source rule"; fail=1 68 fi 69 # Agent 5 finding D5: the object rule must catch the std::time mutant on its own. 70 if rustc $FLAGS --crate-type lib --crate-name at1_mutant target/mutant/at1/mod.rs -o target/mutant/libat1_mutant.rlib 2>/dev/null \ 71 && rm -rf target/mutant/iso && mkdir -p target/mutant/iso && (cd target/mutant/iso && ar x ../libat1_mutant.rlib) \ 72 && object_rule target/mutant/iso/*.o >/dev/null; then 73 echo "ok: mutant caught by the object rule (nm -u, mangled std path)" 74 else 75 echo "FAIL: mutant not caught by the object rule"; fail=1 76 fi 77 78 [ $fail -eq 0 ] && echo "ISOLATION PASS" || echo "ISOLATION FAIL" 79 exit $fail