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 / tests / one_layer / exp445 / pack_dev.sh

38 lines · 2091 bytes Raw Blame History
1#!/usr/bin/env bash
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/one_layer/exp445/pack_dev.sh <outdir> -- pack and seal the PUBLIC exp445 dev tasks (omega#445,
18# HARNESS_INTERFACE_V2.md section 4) into <outdir>/tasks.tar + <outdir>/TASKS.sha256, exactly the
19# held-out layout. First checks every hidden/expected against gen_expected.c (computed from the
20# prompts, independently of reference.osc); a mismatch refuses. Reproducible bytes (ustar, sorted,
21# owner 0, mtime 0). Then: tests/one_layer/acceptance/ola.sh tasks-check <outdir>/tasks.tar <outdir>/TASKS.sha256
22set -euo pipefail
23HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
24OUT="${1:?usage: pack_dev.sh <outdir>}"
25mkdir -p "$OUT"; OUT="$(realpath -e "$OUT")"
26T="$(mktemp -d "${TMPDIR:-/tmp}/exp445-pack.XXXXXXXX")"; trap 'rm -rf "$T"' EXIT
27${CC:-cc} -std=gnu11 -Wall -Wextra -Werror -O2 -o "$T/gen" "$HERE/gen_expected.c"
28n=0
29for c in "$HERE"/dev/tasks/cases/*/; do
30 id="$(basename "$c")"
31 "$T/gen" "$id" < "$c/hidden/inputs" > "$T/exp"
32 cmp -s "$T/exp" "$c/hidden/expected" || { echo "pack_dev: $id hidden/expected differs from gen_expected" >&2; exit 1; }
33 n=$((n + 1))
34done
35(cd "$HERE/dev" && tar --format=ustar --sort=name --owner=0 --group=0 --numeric-owner --mtime=@0 -cf "$OUT/tasks.tar.tmp" tasks)
36mv "$OUT/tasks.tar.tmp" "$OUT/tasks.tar"
37(cd "$OUT" && sha256sum tasks.tar > TASKS.sha256.tmp && mv TASKS.sha256.tmp TASKS.sha256)
38echo "pack_dev: $n dev tasks -> $OUT/tasks.tar ($(cut -c1-16 "$OUT/TASKS.sha256")...)"