From 07e8de4766235fb0a550eef075e3e74589febf35 Mon Sep 17 00:00:00 2001 From: aien-spark Date: Wed, 4 Nov 2026 20:33:11 -0600 Subject: [PATCH] latent-payload: add run-native.sh so the LTP0 gate does not depend on a hand-made cwd seed link The unchanged om2 conductor reads its SHA-256 constant fixtures from the fixed relative path seed/qualification/om2/fixtures/. Without a root seed link it prints 'INVALID SHA-256 constant fixture unreadable or malformed' and exits 3, and results.json native_commands omit that step. run-native.sh takes OMEGA_SRC explicitly, resolves the repository root from its own location, names any missing Omega input, checks the pinned omc sha256, then creates the temporary seed link and removes it on exit. results.json, SPEC.md and the conductor are unchanged. Refs #69 Signed-off-by: aien-spark --- AGENTS.md | 5 ++ README.md | 2 +- specs/latent-payload/run-native.sh | 78 ++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100755 specs/latent-payload/run-native.sh diff --git a/AGENTS.md b/AGENTS.md index 84c182c..7d68f79 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -43,12 +43,17 @@ bash specs/osc-unit-artifact/tools/check-vectors.sh bash specs/execution-transcript/tools/check-corpus.sh bash specs/pi-spark-task/tools/check-vectors.sh bash specs/osh-platform/tools/check-stream-vectors.sh + +# The LTP0 native suite (seeded Omega; needs an omega-mv checkout at the sources.json revision) +sh specs/latent-payload/run-native.sh /path/to/omega-mv ``` Every gate is also one step of `tests/gates/run.sh `: `crumb-verify`, `fmt`, `check`, `clippy`, `test`, `zero-disk-secrets`, `anti-slop` and `c-vectors`. `c-vectors` runs every `specs/*/tools/check-*.sh` and passes only when all of them pass, so a new checker named `check-*.sh` is picked up automatically. `anti-slop` fails on any em dash or en dash in `crates/`, `docs/`, `README.md` and `ANTI_ENCLOSURE.md`. The `make-*.sh` scripts in `specs/*/tools/` regenerate vectors. Run one only when the specification itself changes, and commit the regenerated vectors together with the text. +`specs/latent-payload/run-native.sh` is not part of `c-vectors`, because it needs an outside omega-mv checkout. It resolves this repository root from its own location, checks that every Omega input (`seed/out/omc` at the pinned sha256, the om2 conductor and its two SHA-256 constant fixtures, `om/tls/sha2.om`) exists and names any missing path, then creates the temporary root `seed` link that the unchanged conductor needs and removes it on exit. Without that link the conductor prints `INVALID SHA-256 constant fixture unreadable or malformed` and exits 3. + ## Conventions - Specification changes follow `GOVERNANCE.md` and `VERSIONING.md`. Specifications and crates are versioned together with `vX.Y.Z` tags; while the major version is zero a breaking change needs a minor bump and migration notes in `CHANGELOG.md`. diff --git a/README.md b/README.md index 6ca95d6..3aac40e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The status column quotes the `Status` line at the top of each specification on ` | [osc-unit-artifact](specs/osc-unit-artifact/OSC_UNIT_ARTIFACT.md) | Signed container for a compiled Omega unit | v1 FROZEN, 2026-10-08 | `tools/check-vectors.sh` (see [vectors/README.md](specs/osc-unit-artifact/vectors/README.md)) | | [osh-platform](specs/osh-platform/OSH_PLATFORM_ABI.md) | Boundary between the Omega shell core and its platform | v1 DRAFT, not frozen | vector generator only (see [vectors/README.md](specs/osh-platform/vectors/README.md)) | | [pi-spark-task](specs/pi-spark-task/SPEC.md) | PST1, the task message between a Pi and the Spark | Draft v0.1, 2026-10-16; not yet produced or read by any runtime | `tools/check-vectors.sh` (C checker, 23 header vectors) and the Rust crate `aien-pi-spark-task` | -| [latent-payload](specs/latent-payload/SPEC.md) | Opt-in bounded LTP0 tensor CONTENT profile of draft MJB1, no new task/receipt/capability protocol | Draft v0; runtime integration NOT_RUN | Seeded handwritten Omega validator, fixed synthetic vectors and native mutation controls; see `results.json` | +| [latent-payload](specs/latent-payload/SPEC.md) | Opt-in bounded LTP0 tensor CONTENT profile of draft MJB1, no new task/receipt/capability protocol | Draft v0; runtime integration NOT_RUN | Seeded handwritten Omega validator, fixed synthetic vectors and native mutation controls, run by `sh specs/latent-payload/run-native.sh OMEGA_SRC` (omega-mv at the `sources.json` revision); see `results.json` | | [microjob](specs/microjob/SPEC.md) | MJB1 typed bounded microjob DAG (token profiles 64/16 to 512/128 or zero-neural, resource caps, required verifier, retry and cancel) and the MJR1 receipt | Draft v0.1, 2026-10-24; not yet produced or read by any runtime | `tools/check-vectors.sh` (C checker, 104 document vectors, 58 mutants) and the Rust crate `aien-microjob` (vectors plus receipt-ledger tests) | | [discovery-capsule](specs/discovery-capsule/SPEC.md) | DCP1 family: Discovery Capsule, owner consent, signed retraction, retraction ack and experience lineage | Draft v0.1, 2026-10-24; not yet produced or read by any runtime | `tools/check-vectors.sh` (C checker, 96 record vectors, 62 mutants) and the Rust crate `aien-discovery-capsule` (vectors plus two-owner lifecycle tests) | diff --git a/specs/latent-payload/run-native.sh b/specs/latent-payload/run-native.sh new file mode 100755 index 0000000..176b356 --- /dev/null +++ b/specs/latent-payload/run-native.sh @@ -0,0 +1,78 @@ +#!/bin/sh +# LTP0 native conformance runner: shell glue around the unchanged pinned +# omega-mv om2 conductor. It adds no protocol logic. +# +# Usage: sh specs/latent-payload/run-native.sh OMEGA_SRC +# OMEGA_SRC checkout of the omega-mv revision named in sources.json. +# The OMEGA_SRC environment variable is used when no argument +# is given. +# +# The conductor reads its SHA-256 constant fixtures from the fixed relative +# path seed/qualification/om2/fixtures/, and host.cases names its sources +# relative to this repository root. The runner therefore works from the +# repository root (found from its own location, not the caller's cwd), +# links build/nl3-omega and a temporary root `seed` to OMEGA_SRC, and removes +# the `seed` link again on exit. Every missing input is named before the +# conductor runs. +# +# Exit: the conductor's status (0 PASS, 1 FAIL, 3 INVALID, ...), or 2 when +# a prerequisite is missing or a path would be overwritten. + +pin=d6290c7663c2b4bafb59eb3fdf812476e977f4c144def71095c6248ef9b96b84 +cases=specs/latent-payload/host.cases +scratch=build/nl3-run + +die() { + printf 'run-native: %s\n' "$1" >&2 + exit 2 +} + +src=${1:-${OMEGA_SRC:-}} +[ -n "$src" ] || die 'usage: run-native.sh OMEGA_SRC (or set OMEGA_SRC)' +[ -d "$src" ] || die "OMEGA_SRC is not a directory: $src" +src=$(cd "$src" && pwd -P) || die "cannot resolve OMEGA_SRC: $src" + +here=$(dirname "$0") +root=$(cd "$here/../.." && pwd -P) || die "cannot resolve repository root from $0" +cd "$root" || die "cannot enter repository root $root" +[ -f "$cases" ] || die "missing $root/$cases" + +for rel in seed/out/omc \ + seed/qualification/om2/gate.om \ + seed/qualification/om2/fixtures/sha256-k.dec \ + seed/qualification/om2/fixtures/sha256-iv.dec \ + om/tls/sha2.om; do + [ -f "$src/$rel" ] || die "missing $src/$rel (OMEGA_SRC must be omega-mv at the sources.json revision)" +done + +got=$(sha256sum "$src/seed/out/omc") || die "cannot hash $src/seed/out/omc" +got=${got%% *} +[ "$got" = "$pin" ] || die "$src/seed/out/omc sha256 $got, expected $pin" + +# Link targets: reuse a link that already points at OMEGA_SRC, refuse anything else. +link() { + if [ -L "$2" ]; then + [ "$(cd "$2" && pwd -P)" = "$1" ] || die "$root/$2 links elsewhere; remove it or pass that tree" + return 1 + fi + [ ! -e "$2" ] || die "$root/$2 exists and is not a link to $1" + ln -s "$1" "$2" || die "cannot create link $root/$2" +} + +[ ! -e "$scratch" ] || die "scratch $root/$scratch exists; remove it first" +mkdir -p build || die "cannot create $root/build" +link "$src" build/nl3-omega +if link "$src/seed" seed; then + trap 'rm -f "$root/seed"' EXIT + trap 'exit 130' INT TERM +fi + +if build/nl3-omega/seed/out/omc < build/nl3-omega/seed/qualification/om2/gate.om > build/nl3-gate; then + chmod +x build/nl3-gate || die "cannot chmod $root/build/nl3-gate" +else + rc=$? + printf 'run-native: conductor compile failed, rc=%s\n' "$rc" >&2 + exit "$rc" +fi + +build/nl3-gate build/nl3-omega/seed/out/omc "$pin" "$cases" "$scratch"