From b92b301530d9664f1bbbfb25549b2ff8d9a8eccc Mon Sep 17 00:00:00 2001 From: Drake Stapleton <213298340+drakestapleton@users.noreply.github.com> Date: Fri, 6 Nov 2026 18:04:19 -0600 Subject: [PATCH 1/4] e2e: own Omega LLM only (schema si-rig-e2e/3, evcheck --model); armed-off nightly per DRA-163 DRA-55 was repointed to the own Omega LLM and the 35B is retired, but the harness still pinned model_repo Qwen/Qwen3.6-35B-A3B-FP8 and a REAL run would download its 37.5 GB of outside weights. - evcheck.om: schema si-rig-e2e/3 replaces the pinned model_repo and model_commit with model_name, model_url and model_manifest_sha256 (the sha256 of the installed model.manifest, which lists every checkpoint and tokenizer file hash). --want REAL and --want PRERELEASE refuse a model_url that is not an own-model origin (https://github.com/aien-dev/ followed by A-Z a-z 0-9 . _ - / only, no "..", no "//"). New mode evcheck --model MANIFEST judges a manifest before anything is installed. - e2e.sh: a REAL run (--tag or --ref) compiles evcheck.om (needs OMEGA_SRC), clones the tag or fetches the commit first, and exits 2 before any account, file or download when its manifest is not an own model. The installed manifest is kept as OUT.logs/model.manifest. FAKE-MODEL now records the test model actually installed. - e2e-test.sh: 27 new negative controls (manifest-sha member/format/mix/zero, url mix, empty name, outside weights and look-alike/".." origins certified REAL or PRERELEASE, 12 --model fixtures, REAL without OMEGA_SRC) and the own-model positive controls. - e2e-nightly.yml: DRA-163 decision: nightly 08:15 UTC (02:15 CST) clean- account run inside one exclusive spark-window lease (<= 20 min, cut at 19 min), newest release; off until repo variable SI_E2E_NIGHTLY=on; SI_E2E_RIG=dedicated for a test Spark of its own. Tag input validated. Agent: t_6bd4b620 (Hermes worker, claude-opus-5-5, anthropic) --- .github/workflows/e2e-nightly.yml | 79 +++++-- installer/rig/README.md | 72 ++++-- installer/rig/e2e-test.sh | 98 +++++++- installer/rig/e2e.sh | 81 +++++-- installer/rig/evcheck.om | 360 ++++++++++++++++++++++++++++-- 5 files changed, 603 insertions(+), 87 deletions(-) diff --git a/.github/workflows/e2e-nightly.yml b/.github/workflows/e2e-nightly.yml index 5126a5f..5ef4df7 100644 --- a/.github/workflows/e2e-nightly.yml +++ b/.github/workflows/e2e-nightly.yml @@ -1,12 +1,17 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # End-to-end run on the self-hosted SI test Spark (DRA-55, DRA-59): install -> verify -> chat -> -# uninstall of a release tag, evidence JSONL (schema si-rig-e2e/2) certified REAL by -# installer/rig/evcheck.om and uploaded as an artifact. Manual dispatch only, with the tag as a -# required input (no default). There is no schedule: DRA-163 holds the nightly schedule until the -# capacity conflict is decided, since DRA-39 allows downtime on the shared Spark only Sunday -# 06:00-10:00 Central. The hosted event-guard job refuses every other event before the -# self-hosted job can start, and installer/rig/wfcheck.om checks those rules on every pull -# request (DRA-45). +# uninstall of a release tag as a disposable account (--clean-account), evidence JSONL (schema +# si-rig-e2e/3) certified REAL by installer/rig/evcheck.om and uploaded as an artifact. e2e.sh +# refuses, before anything is installed, a release whose model is not the own Omega LLM. +# Manual dispatch takes the tag as a required input (no default). The nightly schedule follows the +# DRA-163 decision of 2026-11-06: every night at 08:15 UTC (02:15 CST, 03:15 CDT), inside the +# 02:00-04:00 Central nightly window, as a clean-account run on the shared Spark inside one +# exclusive GPU lease of at most 20 minutes; nothing shared is reset or stopped. It stays off until +# the repository variable SI_E2E_NIGHTLY is "on", which the operator sets once the test runner is +# registered (DRA-45) and a release ships the own Omega LLM; until then a scheduled run only +# reports that it is off. A scheduled run installs the newest release. The hosted event-guard job +# refuses every other event before the self-hosted job can start, and installer/rig/wfcheck.om +# checks those rules on every pull request (DRA-45). name: E2E run on: workflow_dispatch: @@ -15,6 +20,8 @@ on: description: Release tag to install (required; a tag published on this repository) required: true type: string + schedule: + - cron: "15 8 * * *" permissions: contents: read concurrency: @@ -23,23 +30,46 @@ concurrency: jobs: event-guard: runs-on: ubuntu-24.04-arm + timeout-minutes: 5 + outputs: + go: ${{ steps.guard.outputs.go }} + tag: ${{ steps.guard.outputs.tag }} env: TAG: ${{ inputs.tag }} + NIGHTLY: ${{ vars.SI_E2E_NIGHTLY }} + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} steps: - - run: | + - id: guard + run: | case "${{ github.event_name }}" in - workflow_dispatch) ;; + workflow_dispatch) + [ -n "$TAG" ] || { echo "e2e run needs the tag input; there is no default"; exit 2; } ;; + schedule) + if [ "$NIGHTLY" != on ]; then + echo "nightly e2e is off: repository variable SI_E2E_NIGHTLY is not on (DRA-163)" + echo "go=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + TAG=$(gh release list --limit 1 --json tagName --jq '.[0].tagName') + [ -n "$TAG" ] || { echo "nightly e2e: this repository has no release to install"; exit 2; } ;; *) echo "e2e run refuses event ${{ github.event_name }}"; exit 1 ;; esac - [ -n "$TAG" ] || { echo "e2e run needs the tag input; there is no default"; exit 2; } + case $TAG in + *[!A-Za-z0-9._-]*) echo "e2e run refuses tag $TAG: only A-Z a-z 0-9 . _ -"; exit 2 ;; + esac + echo "go=true" >> "$GITHUB_OUTPUT" + echo "tag=$TAG" >> "$GITHUB_OUTPUT" e2e: needs: event-guard + if: needs.event-guard.outputs.go == 'true' runs-on: [self-hosted, linux, ARM64, si-test-spark] timeout-minutes: 240 env: OMEGA_REV: bf54b19fa590e8ae925c0e80815516dbf41e7326 OMC_PIN: 62775d2a391cfef7cde64e387655caa9809a267093112910ec76bfa568f3712b - TAG: ${{ inputs.tag }} + TAG: ${{ needs.event-guard.outputs.tag }} + RIG: ${{ vars.SI_E2E_RIG }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -54,8 +84,27 @@ jobs: { printf 'om2\n'; cat installer/rig/vendor/json.om installer/rig/evcheck.om; } \ | "$RUNNER_TEMP/omega/seed/out/omc" > "$RUNNER_TEMP/evcheck" chmod +x "$RUNNER_TEMP/evcheck" - - name: Install, verify, chat, uninstall - run: sh installer/rig/e2e.sh --tag "$TAG" --out "$RUNNER_TEMP/evidence/e2e.jsonl" + - name: Install, verify, chat, uninstall (disposable account, exclusive GPU lease) + run: | + # On the shared Spark the GPU is used only inside one exclusive spark-window lease of at + # most 20 minutes; the run is cut at 19 minutes so it ends inside the lease, and e2e.sh + # still removes its disposable account when it is cut. SI_E2E_RIG=dedicated is for a + # test Spark of its own, where there is no lease to take. + e2e() { + OMEGA_SRC="$RUNNER_TEMP/omega" "$@" sh installer/rig/e2e.sh --clean-account \ + --tag "$TAG" --out "$RUNNER_TEMP/evidence/e2e.jsonl" + } + if [ "$RIG" = dedicated ]; then + e2e env + exit + fi + command -v spark-window > /dev/null || { + echo "shared Spark: spark-window is required for the GPU lease (DRA-163)"; exit 2; } + id=$(spark-window open "si-e2e-$GITHUB_RUN_ID" --lease 20 --gb10 exclusive --quiet none --wait) + rc=0 + e2e spark-window run timeout 1140 || rc=$? + spark-window close "$id" || true + exit "$rc" - name: Certify the evidence REAL if: always() run: | @@ -70,8 +119,8 @@ jobs: notify-failure: # DRA-59: a failed run opens or comments on the nightly-failure issue, mentioning the # maintainer and linking the run. Hosted runner, so it reports even when the self-hosted job - # never started; never on a fork or for any event other than schedule/dispatch (schedule is - # kept here so the rule holds when DRA-163 allows a schedule again). + # never started; never on a fork or for any event other than schedule/dispatch. A scheduled + # run while SI_E2E_NIGHTLY is off skips the e2e job and is not a failure. needs: [event-guard, e2e] if: failure() && github.repository == 'aien-dev/sovereign-intelligence' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') runs-on: ubuntu-24.04-arm diff --git a/installer/rig/README.md b/installer/rig/README.md index 0bf3641..e7aea1b 100644 --- a/installer/rig/README.md +++ b/installer/rig/README.md @@ -52,14 +52,27 @@ on a GitHub-hosted runner. `aienos verify`, `aienos chat` (a non-empty `model>` line is also required, because chat exits 0 after an engine error), and `aienos uninstall --yes`. Every step runs even after a failure, so uninstall always runs. Each -step writes one JSON line (schema `si-rig-e2e/2`): `step`, `mode` (`REAL`, `FAKE` or +step writes one JSON line (schema `si-rig-e2e/3`): `step`, `mode` (`REAL`, `FAKE` or `FAKE-MODEL`), `evidence`, `release_tag`, `source_commit` (the commit installed), `account`, -`engine_sha256` (of the installed `bin/aien-serve-http`), `model_repo` and `model_commit` (from -the installed `model.manifest`), `start_utc`, `end_utc` and `exit_code`. +`engine_sha256` (of the installed `bin/aien-serve-http`), `model_name` and `model_url` (the +`name` and `url` lines of the installed `model.manifest`), `model_manifest_sha256` (the sha256 +of that manifest, which lists the sha256 of every checkpoint and tokenizer file; the manifest +itself is kept as `OUT.logs/model.manifest`), `start_utc`, `end_utc` and `exit_code`. Step logs go to `OUT.logs/`. `--fake` replaces every step with a stub and writes `mode: FAKE`. TAG has no default: without `--tag` (or `--ref`) e2e.sh exits 2, and in REAL mode a TAG that `git ls-remote` does not find on origin exits 2 before anything is installed. +Own model only (DRA-55; the 2026-11-06 directive: the own Omega LLM is the model, and no outside +weights ship). Before a REAL run installs anything, `evcheck --model` judges the +`installer/share/model.manifest` of the tag or commit it would install, and e2e.sh exits 2 unless +its url starts with the own-model origin `https://github.com/aien-dev/` followed only by +`A-Z a-z 0-9 . _ - /`, with no `..` and no `//`. Outside weights such as the retired Qwen 35B, which +the manifest on main still names, are therefore never downloaded by this harness: today every +REAL run is refused (exit 2, nothing written, no account made) until a release ships the own Omega +LLM checkpoint and tokenizer. A REAL run needs `OMEGA_SRC` (omega-mv at the pinned revision) to +compile evcheck.om for that judgment. `evcheck --want REAL` and `--want PRERELEASE` also refuse a +receipt whose `model_url` is not an own-model origin. + Release evidence (`evidence: release`) comes only from `--tag`. A run of an unreleased commit is `--ref SHA` instead: SHA must be exactly 40 lowercase hex digits (a short sha, a branch name or uppercase exits 2 before anything is written), and is fetched from origin (exit 2 when it @@ -74,8 +87,9 @@ and `evcheck --want REAL` refuses them. `--ref SHA --fake-model` is the same run model download: the commit's `installer/tests/fake-engine.om` replaces the engine, a 5 MB test model comes from the same local server, the hardware is `installer/tests/fake-root.sh` `gb10` (`AIENOS_PROBE_ROOT`) and the wizard's server scan reads an empty folder (`AIENOS_PROC_ROOT`), so -nothing but the run's own fileserv and fake engine is contacted. Its `model_repo`/`model_commit` -are the commit's declared model, its `engine_sha256` the fake engine's. +nothing but the run's own fileserv and fake engine is contacted. Its `model_name`, `model_url` +and `model_manifest_sha256` are those of the test model's manifest as installed, its +`engine_sha256` the fake engine's. `--clean-account` (REAL or `--fake-model`) runs the steps as a disposable local user: `sudo useradd` makes `sie2e` and 6 hex digits before the install, every step runs as that user with its @@ -93,38 +107,58 @@ server), logs each answer to `LOG.prompts`, and stops the wizard with exit 3 at not know. One read prints no prompt in plain mode, the end of the first-chat panel (`engine.om` `stchat`); its unique last line `. Stop it with: aienos stop` is answered with Enter. -`evcheck FILE` checks the schema: exactly those members, the pinned model revision, steps in +`evcheck FILE` checks the schema: exactly those members, a non-empty model name and url and a +manifest sha256 that are the same in every record, steps in order, the same mode, evidence, tag, commit, account and engine hash in every record, and timestamps that never go back. Release evidence needs a tag and is never `FAKE-MODEL`; prerelease evidence needs an empty tag and a commit that is not all zeros. `evcheck --want WANT FILE` certifies a run: also all four steps, every exit code 0 and a non-zero -engine hash, and per WANT: `REAL` needs mode `REAL` and evidence `release`, so neither FAKE nor -prerelease evidence can be certified as release evidence; `PRERELEASE` needs mode `REAL` and -prerelease evidence; `FAKE` and `FAKE-MODEL` need that mode. +engine hash and manifest hash, and per WANT: `REAL` needs mode `REAL`, evidence `release` and an +own-model `model_url`, so neither FAKE nor prerelease evidence nor outside weights can be +certified as release evidence; `PRERELEASE` needs mode `REAL`, prerelease evidence and an +own-model `model_url`; `FAKE` and `FAKE-MODEL` need that mode. +`evcheck --model MANIFEST` judges a manifest: exactly one `name` and one `url` line, non-empty, +and an own-model url; `MODEL OWN name=N` exit 0, or `PROBLEM` lines and `MODEL FAIL` exit 1. Exit 0 pass, 1 a problem, 2 usage, 4 unreadable. evcheck uses `vendor/json.om`, a byte copy of omega-mv `bf54b19f` `seed/json/json.om`; `e2e-test.sh` checks the copy with `cmp`. `sh installer/rig/e2e-test.sh OMC` is the host arm (FAKE only): a FAKE `--tag` run and a FAKE `--ref` run must pass evcheck, and negative controls must be refused: a missing member, a bad sha256, a start before the previous end, FAKE records with `--want REAL`, a record relabelled -REAL, a schema `/1` record, a `--ref` receipt relabelled REAL with `--want REAL` (the same file -passes `--want PRERELEASE`; a `--tag` receipt relabelled REAL is the control that passes `--want -REAL`), release evidence without a tag, a prerelease with a tag or an all-zero commit, mixed -evidence, a changed commit, FAKE-MODEL as release, and a bad account. e2e.sh must exit 2 and +REAL, a schema `/2` record, a missing, malformed, mixed or all-zero `model_manifest_sha256`, a +mixed `model_url`, an empty `model_name`, outside weights (this checkout's huggingface.co url), a +look-alike origin and a `..` url certified REAL or PRERELEASE, a `--ref` receipt relabelled REAL +with `--want REAL` (the same file with an own-model url passes `--want PRERELEASE`; a `--tag` +receipt relabelled REAL with an own-model url is the control that passes `--want REAL`), release +evidence without a tag, a prerelease with a tag or an all-zero commit, mixed +evidence, a changed commit, FAKE-MODEL as release, and a bad account. `evcheck --model` must pass +an own-model manifest and refuse this checkout's manifest and look-alike, `..`, `//`, query, +bare-origin and local urls, a missing name or url line, two url lines and an empty name. e2e.sh +must exit 2 and write nothing without `--tag`/`--ref`, for a short, symbolic, uppercase or 41-digit `--ref`, for `--tag` with `--ref`, `--fake-model` with `--tag`, `--fake` with `--fake-model`, -`--clean-account` with `--fake`, and a `--ref` build without `OMEGA_SRC`/`ENGINE`. fileserv must +`--clean-account` with `--fake`, a `--ref` build without `OMEGA_SRC`/`ENGINE`, and a REAL run +without `OMEGA_SRC`. fileserv must send a 3 MB file byte for byte, answer 404 for a missing file or a folder, and answer 400 for `..`, a part starting with a dot, an empty part, a query, the bare root and a POST. It also checks that answer.sh answers a stand-in plain wizard correctly with and without a found server, that the old fixed newline string stops at the consent when a server is found, and that an unknown prompt stops answer.sh with exit 3. Rig checks runs it on every pull -request. `.github/workflows/e2e-nightly.yml` ("E2E run") runs the REAL harness on manual dispatch -with a required `tag` input on the runner labelled `si-test-spark`, certifies the evidence with -`--want REAL` and uploads it. A REAL run needs the test Spark and a registered runner. When the +request. `.github/workflows/e2e-nightly.yml` ("E2E run") runs the REAL harness with +`--clean-account` on the runner labelled `si-test-spark`, certifies the evidence with +`--want REAL` and uploads it: on manual dispatch with a required `tag` input, and nightly at +08:15 UTC (02:15 CST, 03:15 CDT) with the newest release. The nightly is off until the repository +variable `SI_E2E_NIGHTLY` is `on`; a scheduled run while it is off only says so and skips the +self-hosted job. On the shared Spark (DRA-163 decision, 2026-11-06) the run takes one exclusive +GPU lease (`spark-window open --lease 20 --gb10 exclusive --quiet none --wait`) and is cut at 19 +minutes so it ends inside it; nothing shared is reset or stopped. `SI_E2E_RIG=dedicated` runs it +without a lease on a test Spark of its own. A REAL run needs a registered runner (DRA-45) and a +release that ships the own Omega LLM. When the run fails, the hosted `notify-failure` job (`issues: write`, never on a fork) runs `installer/rig/notify-failure.sh`: it comments on the open issue labelled `nightly-failure`, or opens one assigned to the maintainer (`vars.SI_MAINTAINER`, default `drakestapleton`), with an @-mention and the run URL. -The `schedule:` trigger is withheld until DRA-163 resolves the capacity conflict with the -DRA-39 Sunday 06:00-10:00 Central downtime window; until then the workflow is dispatch-only. +Clean-account runs on the shared Spark are labelled `account: disposable`: they show a fresh +account installing, chatting and uninstalling on a machine that is not stock (shared drivers, +services and other users). They are not stock-Spark evidence; the stock rows stay NOT_RUN until a +second Spark exists, and seven weekly runs never count as seven consecutive nights. diff --git a/installer/rig/e2e-test.sh b/installer/rig/e2e-test.sh index 4a532b5..4c4ba84 100755 --- a/installer/rig/e2e-test.sh +++ b/installer/rig/e2e-test.sh @@ -6,14 +6,21 @@ # vendor/json.om is byte-identical to the pinned omega-mv seed/json/json.om; # a FAKE --tag run and a FAKE --ref run pass evcheck in schema mode and in --want FAKE; # negative controls, each must exit 1 with the named problem: a missing member, a bad sha256, -# a start before the previous end, the FAKE records presented with --want REAL, a schema /1 -# record, and the release/prerelease separation: a --ref receipt relabelled REAL fails -# --want REAL (and passes --want PRERELEASE; a --tag receipt relabelled REAL is the control that -# passes --want REAL), release evidence without a tag, a prerelease with a tag or an all-zero -# commit, mixed evidence, a changed source_commit, FAKE-MODEL claimed as release, a bad account; +# a start before the previous end, the FAKE records presented with --want REAL, a schema /2 +# record, a missing, malformed, mixed or all-zero model_manifest_sha256, a mixed model_url, an +# empty model_name, outside weights (this checkout's huggingface.co url), a look-alike origin and +# a ".." url certified REAL or PRERELEASE, and the release/prerelease separation: a --ref receipt +# relabelled REAL fails --want REAL (and passes --want PRERELEASE; a --tag receipt relabelled +# REAL with an own-model url is the control that passes --want REAL), release evidence without a +# tag, a prerelease with a tag or an all-zero commit, mixed evidence, a changed source_commit, +# FAKE-MODEL claimed as release, a bad account; +# evcheck --model passes an own-model manifest and refuses this checkout's manifest (outside +# weights), look-alike, "..", "//", query, bare-origin and local urls, and a manifest without a +# name or url line, with two url lines or an empty name; # e2e.sh refusals exit 2 and write nothing: no --tag or --ref, a short, symbolic, uppercase or # 41-digit --ref, --tag with --ref, --fake-model with --tag, --fake with --fake-model, -# --clean-account with --fake, a --ref build without OMEGA_SRC and ENGINE; +# --clean-account with --fake, a --ref build without OMEGA_SRC and ENGINE, a REAL run without +# OMEGA_SRC; # fileserv.om sends a 3 MB file byte for byte and answers 404 for a missing file or a folder # and 400 for "..", a dot part, an empty part, a query, the bare root and a POST; # answer.sh answers a stand-in plain wizard by its prompts with and without a found model @@ -70,17 +77,43 @@ neg non-monotonic "line 3: start_utc is before the previous record's end_utc" "$ neg fake-as-real "certify: mode is not the wanted mode" --want REAL "$f" sed '1s/"mode":"FAKE"/"mode":"REAL"/' "$f" > "$out/mixed.jsonl" neg mixed-mode "line 2: mode differs from the first record" --want REAL "$out/mixed.jsonl" -sed '1s|"schema":"si-rig-e2e/2"|"schema":"si-rig-e2e/1"|' "$f" > "$out/v1.jsonl" -neg schema-v1 "line 1: schema is not si-rig-e2e/2" "$out/v1.jsonl" +sed '1s|"schema":"si-rig-e2e/3"|"schema":"si-rig-e2e/2"|' "$f" > "$out/v2.jsonl" +neg schema-v2 "line 1: schema is not si-rig-e2e/3" "$out/v2.jsonl" +sed '2s/,"model_manifest_sha256":"[0-9a-f]*"//' "$f" > "$out/nomsha.jsonl" +neg missing-manifest-sha "line 2: missing member model_manifest_sha256" "$out/nomsha.jsonl" +sed '2s/"model_manifest_sha256":"[0-9a-f]/"model_manifest_sha256":"G/' "$f" > "$out/badmsha.jsonl" +neg bad-manifest-sha "line 2: model_manifest_sha256 is not 64 lowercase hex digits" "$out/badmsha.jsonl" +sed '3s/"model_manifest_sha256":"[0-9a-f]*"/"model_manifest_sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"/' "$f" > "$out/mixmsha.jsonl" +neg mixed-manifest-sha "line 3: model_manifest_sha256 differs from the first record" "$out/mixmsha.jsonl" +sed 's/"model_manifest_sha256":"[0-9a-f]*"/"model_manifest_sha256":"0000000000000000000000000000000000000000000000000000000000000000"/' "$f" > "$out/zmsha.jsonl" +neg zero-manifest-sha "certify: model_manifest_sha256 is all zeros" --want FAKE "$out/zmsha.jsonl" +sed '4s|"model_url":"[^"]*"|"model_url":"https://github.com/aien-dev/other/"|' "$f" > "$out/mixurl.jsonl" +neg mixed-model-url "line 4: model_url differs from the first record" "$out/mixurl.jsonl" +sed '2s|"model_name":"[^"]*"|"model_name":""|' "$f" > "$out/noname.jsonl" +neg empty-model-name "line 2: model_name is not 1..128 plain bytes" "$out/noname.jsonl" + +# Own model only. The outside url this checkout's manifest still names (the retired Qwen 35B) is +# replaced by an own-model url in the receipts that are meant to certify; with the outside url they +# must not. own is an aien-dev release-asset url as an own Omega LLM release would publish it. +own=https://github.com/aien-dev/sovereign-intelligence/releases/download/alpha-own/omega-llm/ +ownify() { sed "s|\"model_url\":\"[^\"]*\"|\"model_url\":\"$own\"|" "$1"; } # Release and prerelease evidence stay apart. rr is the --ref receipt with every mode relabelled # REAL, as a REAL --ref run would write it; tr is the --tag receipt relabelled the same way. rr=$out/ref-real.jsonl tr=$out/tag-real.jsonl -sed 's/"mode":"FAKE"/"mode":"REAL"/' "$out/ref.jsonl" > "$rr" -sed 's/"mode":"FAKE"/"mode":"REAL"/' "$f" > "$tr" +sed 's/"mode":"FAKE"/"mode":"REAL"/' "$out/ref.jsonl" | ownify /dev/stdin > "$rr" +sed 's/"mode":"FAKE"/"mode":"REAL"/' "$f" | ownify /dev/stdin > "$tr" neg ref-as-release "certify: prerelease evidence is not release evidence" --want REAL "$rr" "$ev" --want PRERELEASE "$rr" || { echo "ARM ref-certify-prerelease: want 0"; fail=1; } "$ev" --want REAL "$tr" || { echo "CONTROL tag-certify-real: want 0"; fail=1; } +sed 's/"mode":"FAKE"/"mode":"REAL"/' "$f" > "$out/outside-real.jsonl" +neg outside-weights-as-real "certify: model_url is not an own-model origin" --want REAL "$out/outside-real.jsonl" +sed 's/"mode":"FAKE"/"mode":"REAL"/' "$out/ref.jsonl" > "$out/outside-pre.jsonl" +neg outside-weights-as-prerelease "certify: model_url is not an own-model origin" --want PRERELEASE "$out/outside-pre.jsonl" +sed "s|\"model_url\":\"$own\"|\"model_url\":\"https://github.com/aien-devil/x/\"|" "$tr" > "$out/lookalike.jsonl" +neg lookalike-origin-as-real "certify: model_url is not an own-model origin" --want REAL "$out/lookalike.jsonl" +sed "s|\"model_url\":\"$own\"|\"model_url\":\"https://github.com/aien-dev/../evil/\"|" "$tr" > "$out/dotdot.jsonl" +neg dotdot-origin-as-real "certify: model_url is not an own-model origin" --want REAL "$out/dotdot.jsonl" neg tag-as-prerelease "certify: release evidence is not prerelease evidence" --want PRERELEASE "$tr" neg ref-as-fake-model "certify: mode is not the wanted mode" --want FAKE-MODEL "$out/ref.jsonl" sed 's/"evidence":"prerelease: not release evidence"/"evidence":"release"/' "$rr" > "$out/notag.jsonl" @@ -124,6 +157,51 @@ refused fake-model-tag "--fake-model needs --ref" --fake-model --tag alpha-20261 refused fake-and-fake-model "--fake and --fake-model exclude each other" --fake --fake-model --ref "$r" refused clean-fake "--clean-account needs a REAL or --fake-model run" --fake --clean-account --ref "$r" refused ref-no-inputs "set OMEGA_SRC and ENGINE" --fake-model --ref "$r" +refused real-no-omega "a REAL run judges the model with evcheck.om before installing" --tag alpha-20261029.1 + +# evcheck --model, the judgment a REAL run makes before it installs anything: an own-model +# manifest passes; this checkout's manifest (outside weights) and every malformed or look-alike +# manifest must exit 1 with the named problem. +mfx() { printf '%b' "$2" > "$out/m.$1"; } +mneg() { # NAME TEXT: evcheck --model on fixture NAME must exit 1 and print TEXT + rc=0 + "$ev" --model "$out/m.$1" > "$out/o" || rc=$? + if [ "$rc" = 1 ] && grep -qF -- "$2" "$out/o"; then + echo "NEGATIVE-CONTROL model-$1: refused as expected ($2)" + else + echo "NEGATIVE-CONTROL model-$1: rc=$rc (want 1), wanted text: $2"; cat "$out/o"; fail=1 + fi +} +mfx own "name omega-llm-test\nurl ${own}\nbytes 10\nfiles 1\n" +rc=0 +"$ev" --model "$out/m.own" > "$out/o" || rc=$? +if [ "$rc" = 0 ] && grep -qxF "MODEL OWN name=omega-llm-test" "$out/o"; then + echo "ARM model-own: MODEL OWN name=omega-llm-test" +else + echo "ARM model-own: rc=$rc (want 0)"; cat "$out/o"; fail=1 +fi +cp "$here/../share/model.manifest" "$out/m.checkout" +mneg checkout "the model url is not an own-model origin (outside weights): https://huggingface.co/" +mfx lookalike "name a\nurl https://github.com/aien-devil/x/\n" +mneg lookalike "not an own-model origin" +mfx dotdot "name a\nurl https://github.com/aien-dev/../evil/x/\n" +mneg dotdot "not an own-model origin" +mfx dslash "name a\nurl https://github.com/aien-dev//x/\n" +mneg dslash "not an own-model origin" +mfx query "name a\nurl https://github.com/aien-dev/x/?y=1\n" +mneg query "not an own-model origin" +mfx bare "name a\nurl https://github.com/aien-dev/\n" +mneg bare "not an own-model origin" +mfx local "name a\nurl http://127.0.0.1:8080/model/\n" +mneg local "not an own-model origin" +mfx noname "url ${own}\n" +mneg noname "the manifest has no name line" +mfx nourl "name a\n" +mneg nourl "the manifest has no url line" +mfx twourl "name a\nurl ${own}\nurl https://huggingface.co/x/\n" +mneg twourl "the manifest has more than one url line" +mfx emptyname "name \nurl ${own}\n" +mneg emptyname "the manifest's name or url is empty or too long" # answer.sh against a stand-in for the plain wizard: it prints "PROMPT: " and reads one line per # question, like ask in installer/wizard/steps.om. With a found server it asks one more question diff --git a/installer/rig/e2e.sh b/installer/rig/e2e.sh index 054b47b..70954f6 100755 --- a/installer/rig/e2e.sh +++ b/installer/rig/e2e.sh @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # End-to-end harness for the SI Alpha test Spark (DRA-55): install -> verify -> chat -> uninstall, -# one evidence record per step in OUT (JSONL, schema si-rig-e2e/2, checked by evcheck.om). +# one evidence record per step in OUT (JSONL, schema si-rig-e2e/3, checked by evcheck.om). # sh installer/rig/e2e.sh --tag TAG --out OUT REAL release run of published TAG # sh installer/rig/e2e.sh --ref SHA --out OUT REAL prerelease run of commit SHA # sh installer/rig/e2e.sh --ref SHA --fake-model --out OUT FAKE-MODEL prerelease run of SHA @@ -13,9 +13,18 @@ # so uninstall always runs. Exit 0 when every step exited 0 (and, with --clean-account, the # account and its home are gone afterwards); 2 a refused argument, before anything is written. # +# Own model only (DRA-55): before a REAL run installs anything, evcheck --model judges the +# model.manifest of the tag or commit it would install, and e2e.sh exits 2 unless its url is an +# own-model origin (the aien-dev Omega LLM checkpoint and tokenizer). Outside weights, such as the +# retired Qwen 35B, are never downloaded by this harness. A REAL run therefore needs OMEGA_SRC +# (omega-mv at the pinned revision) to compile evcheck.om. Each record names the model by the +# manifest's name and url lines and the sha256 of the installed model.manifest, which lists the +# sha256 of every checkpoint and tokenizer file; that manifest is kept as OUT.logs/model.manifest. +# # Release evidence (evidence "release"): only --tag. TAG has no default; in REAL mode a TAG that is -# not a tag on origin exits 2 before anything runs. REAL needs a stock DGX Spark with no AienOS -# install and network; it starts the engine on the GPU. evcheck --want REAL certifies only these. +# not a tag on origin exits 2 before anything runs. REAL needs a DGX Spark with no AienOS install +# for the account it runs as, and network; it starts the engine on the GPU, so on a shared Spark +# run it inside an exclusive GPU lease. evcheck --want REAL certifies only these. # # Prerelease (evidence "prerelease: not release evidence", release_tag empty, source_commit SHA): # --ref SHA takes exactly 40 lowercase hex digits; anything else exits 2. The commit is fetched @@ -31,9 +40,9 @@ # server, the hardware is the commit's installer/tests/fake-root.sh gb10 tree (AIENOS_PROBE_ROOT), # and the wizard's server scan reads an empty folder (AIENOS_PROC_ROOT). Install, wizard, verify, # chat and uninstall run for real; no GPU device is opened, no model is downloaded, and nothing -# but the run's own fileserv and fake engine (127.0.0.1:18100) is contacted. model_repo and -# model_commit are the commit's declared model -# (installer/share/model.manifest), engine_sha256 the fake engine's. evcheck --want FAKE-MODEL. +# but the run's own fileserv and fake engine (127.0.0.1:18100) is contacted. model_name, +# model_url and model_manifest_sha256 are those of the 5 MB test model's manifest as installed, +# engine_sha256 the fake engine's. evcheck --want FAKE-MODEL. # # --clean-account: sudo useradd makes a disposable account (sie2e and 6 hex digits) before the # install; every step runs as that account (sudo -u, env -i, its own HOME), and afterwards sudo @@ -75,6 +84,8 @@ if [ -n "$ref" ] && [ "$mode" != FAKE ]; then [ -n "${OMEGA_SRC:-}" ] && [ -n "${ENGINE:-}" ] \ || refuse "--ref builds the commit's bundle: set OMEGA_SRC and ENGINE as installer/build.sh documents" fi +[ "$mode" != REAL ] || [ -n "${OMEGA_SRC:-}" ] \ + || refuse "a REAL run judges the model with evcheck.om before installing: set OMEGA_SRC to omega-mv at the pinned revision" [ "$clean" = 0 ] || sudo -n true 2>/dev/null || refuse "--clean-account needs passwordless sudo" origin=https://github.com/aien-dev/sovereign-intelligence.git if [ "$mode" = REAL ] && [ -n "$tag" ] && ! git ls-remote --exit-code --tags \ @@ -121,21 +132,39 @@ if [ -n "$ref" ] && [ "$mode" != FAKE ]; then && [ "$(git -C "$pub/si" rev-parse HEAD)" = "$ref" ]; } \ || refuse "$ref is not a commit that can be fetched from aien-dev/sovereign-intelligence" fi +tsrc= +if [ "$mode" = REAL ] && [ -n "$tag" ]; then + git -c advice.detachedHead=false clone --quiet --depth 1 --branch "$tag" "$origin" "$pub/si" \ + || refuse "could not clone tag $tag of aien-dev/sovereign-intelligence" + tsrc=$(git -C "$pub/si" rev-parse HEAD) +fi + +# evcheck.om, compiled with the pinned omc: it judges the model before a REAL install. +evc= +if [ "$mode" = REAL ]; then + evc=$work/evcheck + { printf 'om2\n'; cat "$here/vendor/json.om" "$here/evcheck.om"; } | "$OMEGA_SRC/seed/out/omc" > "$evc" \ + || refuse "evcheck.om did not compile with $OMEGA_SRC/seed/out/omc" + chmod 755 "$evc" + "$evc" --model "$pub/si/installer/share/model.manifest" > "$work/model.verdict" 2>&1 || { + cat "$work/model.verdict" >&2 + refuse "${tag:-$ref} does not ship an own Omega LLM checkpoint (installer/share/model.manifest); outside weights are never downloaded, nothing was installed" + } +fi now() { date -u +%Y-%m-%dT%H:%M:%SZ; } if [ -n "$tag" ]; then - evidence=release src=0000000000000000000000000000000000000000 + evidence=release src=${tsrc:-0000000000000000000000000000000000000000} else evidence="prerelease: not release evidence" src=$ref fi -sha=$zero repo= commit= +sha=$zero name= url= msha=$zero -# The model revision as the release declares it: the url line of its model.manifest. -revision() { - u=$(sed -n 's|^url https://huggingface.co/||p' "$1") - repo=${u%%/resolve/*} - commit=${u#*/resolve/} - commit=${commit%/} +# The model as a model.manifest names it: its name and url lines and the sha256 of the file. +model() { + name=$(sed -n 's/^name //p' "$1" | head -n 1) + url=$(sed -n 's/^url //p' "$1" | head -n 1) + msha=$(sha256sum "$1" | cut -d' ' -f1) } # $work/as CMD...: runs CMD as the account the steps use, with that account's HOME. @@ -219,24 +248,26 @@ wizard() { if [ "$mode" = FAKE ]; then # FAKE: no install happens. The engine hash is the sha256 of a fixed FAKE label, and the model - # revision is read from this checkout's manifest. - sha=$(printf 'FAKE engine for si-rig-e2e/2\n' | sha256sum | cut -d' ' -f1) - revision "$here/../share/model.manifest" + # is read from this checkout's manifest. + sha=$(printf 'FAKE engine for si-rig-e2e/3\n' | sha256sum | cut -d' ' -f1) + model "$here/../share/model.manifest" s_install() { echo "FAKE install ${tag:-$ref}"; } s_verify() { echo "FAKE verify"; } s_chat() { echo "FAKE chat"; echo "model> FAKE"; } s_uninstall() { echo "FAKE uninstall"; } else + # The model the tag or commit declares, until the installed manifest replaces it after install. + model "$pub/si/installer/share/model.manifest" if [ -n "$tag" ]; then s_install() { - git clone --quiet --depth 1 --branch "$tag" "$origin" "$pub/si" || return - src=$(git -C "$pub/si" rev-parse HEAD) + echo "e2e: tag $tag is commit $src; its model: $(cat "$work/model.verdict")" "$as" env AIENOS_NO_WIZARD=1 sh "$pub/si/installer/install.sh" || return wizard } else - [ "$mode" != FAKE-MODEL ] || revision "$pub/si/installer/share/model.manifest" + [ -z "$evc" ] || echo "e2e: its model: $(cat "$work/model.verdict")" > "$work/model.note" s_install() { + [ ! -e "$work/model.note" ] || cat "$work/model.note" echo "e2e: building commit $ref with its installer/build.sh" OMEGA_SRC=$OMEGA_SRC ENGINE=$ENGINE sh "$pub/si/installer/build.sh" "$work/build" || return rel=$(sed -n 's/^TAG=//p' "$pub/si/installer/install.sh") @@ -301,13 +332,15 @@ for step in install verify chat uninstall; do if [ "$mode" != FAKE ] && [ "$step" = install ]; then "$as" test -x "$base/current/bin/aien-serve-http" \ && sha=$("$as" sha256sum "$base/current/bin/aien-serve-http" | cut -d' ' -f1) - if [ "$mode" = REAL ] && "$as" cat "$base/current/share/aienos/model.manifest" > "$work/manifest" 2>/dev/null; then - revision "$work/manifest" + if "$as" cat "$base/current/share/aienos/model.manifest" > "$logs/model.manifest" 2>/dev/null; then + model "$logs/model.manifest" + else + rm -f "$logs/model.manifest" fi fi [ "$rc" = 0 ] || all=1 - printf '{"schema":"si-rig-e2e/2","step":"%s","mode":"%s","evidence":"%s","release_tag":"%s","source_commit":"%s","account":"%s","engine_sha256":"%s","model_repo":"%s","model_commit":"%s","start_utc":"%s","end_utc":"%s","exit_code":%d}\n' \ - "$step" "$mode" "$evidence" "$tag" "$src" "$account" "$sha" "$repo" "$commit" "$start" "$end" "$rc" >> "$out" + printf '{"schema":"si-rig-e2e/3","step":"%s","mode":"%s","evidence":"%s","release_tag":"%s","source_commit":"%s","account":"%s","engine_sha256":"%s","model_name":"%s","model_url":"%s","model_manifest_sha256":"%s","start_utc":"%s","end_utc":"%s","exit_code":%d}\n' \ + "$step" "$mode" "$evidence" "$tag" "$src" "$account" "$sha" "$name" "$url" "$msha" "$start" "$end" "$rc" >> "$out" echo "e2e: $mode $step exit $rc" done [ ! -e "$work/http.log" ] || cp "$work/http.log" "$logs/http.log" diff --git a/installer/rig/evcheck.om b/installer/rig/evcheck.om index ea7dc92..9f7f24d 100644 --- a/installer/rig/evcheck.om +++ b/installer/rig/evcheck.om @@ -1,18 +1,28 @@ note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception note evcheck.om: checks the evidence JSONL of the SI Alpha end-to-end harness (DRA-55, DRA-59), -note schema si-rig-e2e/2. Usage: +note schema si-rig-e2e/3. Usage: note evcheck FILE schema mode: every record valid, any mode, any exit codes note evcheck --want WANT FILE certify: all four steps install verify chat uninstall are present, -note every exit_code is 0, engine_sha256 is not all zeros, and: -note REAL mode REAL and evidence "release": the only release evidence -note PRERELEASE mode REAL and evidence "prerelease: not release evidence" (an e2e.sh --ref run) +note every exit_code is 0, engine_sha256 and model_manifest_sha256 are +note not all zeros, and: +note REAL mode REAL, evidence "release" and an own model: the only release evidence +note PRERELEASE mode REAL, evidence "prerelease: not release evidence" (an e2e.sh --ref run) +note and an own model note FAKE mode FAKE, either evidence note FAKE-MODEL mode FAKE-MODEL (always prerelease) +note evcheck --model MANIFEST judge a model.manifest before anything is installed: exactly one +note name line and one url line, and the url is an own-model origin. +note MODEL OWN name=N, exit 0; or PROBLEM lines, MODEL FAIL, exit 1. +note An own model is one whose model_url starts with an own-model origin (k_own1) and whose rest +note is made only of A-Z a-z 0-9 . _ - / with no ".." and no "//": the own Omega LLM checkpoint +note and tokenizer published by aien-dev. Outside weights (any other origin, e.g. huggingface.co) +note are never certified REAL or PRERELEASE, and e2e.sh refuses to install them (DRA-55, the +note 2026-11-06 directive: the own Omega LLM is the model; no outside weights ship). note Composition (a program unit): { printf 'om2\n'; cat installer/rig/vendor/json.om note installer/rig/evcheck.om; } | omc. vendor/json.om is a byte copy of omega-mv bf54b19f note seed/json/json.om; arrays handed to js_* are locals, as its README requires. note One record per line, a JSON object with exactly these members, each once: -note schema "si-rig-e2e/2" step: one of install verify chat uninstall, in that order, no repeats +note schema "si-rig-e2e/3" step: one of install verify chat uninstall, in that order, no repeats note mode "REAL", "FAKE" or "FAKE-MODEL", the same in every record note evidence "release" or "prerelease: not release evidence", the same in every record; note FAKE-MODEL is prerelease only @@ -23,7 +33,10 @@ note prerelease evidence (it names the commit that was built and installed) note account "caller" (the run used the caller's HOME) or "disposable" (a user created for the run note and removed after it), the same in every record note engine_sha256: 64 lowercase hex digits, the same in every record -note model_repo "Qwen/Qwen3.6-35B-A3B-FP8" model_commit "95a723d08a9490559dae23d0cff1d9466213d989" +note model_name: 1..128 plain bytes (the manifest's name line), the same in every record +note model_url: 1..256 plain bytes (the manifest's url line), the same in every record +note model_manifest_sha256: 64 lowercase hex digits, the sha256 of the installed model.manifest, +note which lists the sha256 of every checkpoint and tokenizer file; the same in every record note start_utc, end_utc: YYYY-MM-DDTHH:MM:SSZ; start <= end, and end <= the next record's start note exit_code: an integer that fits a long note Output: PROBLEM line N: message per finding, then @@ -50,6 +63,16 @@ global sha0 uchar 64 global ev0 ulong 1 global acct0 ulong 1 global com0 uchar 40 +note the model of the first record: name, url (and their lengths), manifest sha256, and whether +note any record's model_manifest_sha256 is all zeros +global name0 uchar 128 +global name0n ulong 1 +global url0 uchar 256 +global url0n ulong 1 +global msha0 uchar 64 +global zman ulong 1 +note --model: name lines, url lines, a bad value (0/1), the first url's line number +global mcnt ulong 4 note the current record: mode, evidence, release_tag length (129 when invalid), and whether note source_commit is all zeros (2 when invalid) global cmode ulong 1 @@ -63,7 +86,7 @@ global fc ulong 14 text t_nl "\n" text t_prob "PROBLEM line " text t_cs ": " -text t_usage "usage: evcheck [--want REAL|PRERELEASE|FAKE|FAKE-MODEL] FILE\n" +text t_usage "usage: evcheck [--want REAL|PRERELEASE|FAKE|FAKE-MODEL] FILE | evcheck --model MANIFEST\n" text t_io "evcheck: cannot read the file, or it is larger than 262143 bytes\n" text t_pass "EVCHECK PASS records=" text t_mode " mode=" @@ -77,26 +100,33 @@ text t_prer "PRERELEASE" text t_er "release" text t_ep "prerelease" text t_wantf "--want" +text t_modf "--model" +text t_mown "MODEL OWN name=" +text t_mfail "MODEL FAIL problems=" +text k_mname "name " +text k_murl "url " +note The own-model origin: the aien-dev organisation's GitHub, where SI publishes its releases. +note A second origin is one more text and one more test in ownurl, after a recorded decision. +text k_own1 "https://github.com/aien-dev/" text k_sch "schema" text k_step "step" text k_mode "mode" text k_tag "release_tag" text k_sha "engine_sha256" -text k_repo "model_repo" -text k_comm "model_commit" +text k_repo "model_name" +text k_comm "model_url" text k_st "start_utc" text k_end "end_utc" text k_exit "exit_code" text k_ev "evidence" text k_com "source_commit" text k_acct "account" -text v_sch "si-rig-e2e/2" +text k_msha "model_manifest_sha256" +text v_sch "si-rig-e2e/3" text v_evr "release" text v_evp "prerelease: not release evidence" text v_accc "caller" text v_accd "disposable" -text v_repo "Qwen/Qwen3.6-35B-A3B-FP8" -text v_comm "95a723d08a9490559dae23d0cff1d9466213d989" text s_inst "install" text s_ver "verify" text s_chat "chat" @@ -105,7 +135,7 @@ text m_json "not one JSON object" text m_unk "unknown member" text m_dup "member appears more than once" text m_miss "missing member " -text m_sch "schema is not si-rig-e2e/2" +text m_sch "schema is not si-rig-e2e/3" text m_step "step is not install, verify, chat or uninstall" text m_order "step out of order (install, verify, chat, uninstall; no repeats)" text m_mode "mode is not REAL, FAKE or FAKE-MODEL" @@ -124,8 +154,20 @@ text m_acct "account is not caller or disposable" text m_acctx "account differs from the first record" text m_sha "engine_sha256 is not 64 lowercase hex digits" text m_shax "engine_sha256 differs from the first record" -text m_repo "model_repo is not Qwen/Qwen3.6-35B-A3B-FP8" -text m_comm "model_commit is not 95a723d08a9490559dae23d0cff1d9466213d989" +text m_repo "model_name is not 1..128 plain bytes" +text m_repox "model_name differs from the first record" +text m_comm "model_url is not 1..256 plain bytes" +text m_commx "model_url differs from the first record" +text m_msha "model_manifest_sha256 is not 64 lowercase hex digits" +text m_mshax "model_manifest_sha256 differs from the first record" +text m_zman "certify: model_manifest_sha256 is all zeros" +text m_out "certify: model_url is not an own-model origin (outside weights are never certified)" +text m_mnone "the manifest has no name line" +text m_mnone2 "the manifest has no url line" +text m_mtwo "the manifest has more than one name line" +text m_mtwo2 "the manifest has more than one url line" +text m_mbad "the manifest's name or url is empty or too long" +text m_mout "the model url is not an own-model origin (outside weights): " text m_ts "timestamp is not YYYY-MM-DDTHH:MM:SSZ: " text m_se "end_utc is before start_utc" text m_mono "start_utc is before the previous record's end_utc" @@ -245,6 +287,9 @@ end if js_streq ln o k_acct ret 12 end +if js_streq ln o k_msha +ret 13 +end ret 99 end @@ -297,12 +342,16 @@ if eq i 11 pr k_com ret end +if eq i 12 pr k_acct +ret +end +pr k_msha end note collects member value tokens into fv/fc; false when the record cannot be checked further fn members ln view uchar * tp view uint * to bool -for i ulong 13 +for i ulong 14 put fv i 0 put fc i 0 end @@ -323,7 +372,7 @@ put fv f add k 1 end k = js_mnext tp k end -for i ulong 13 +for i ulong 14 if eq get fc i 0 put prob 0 add get prob 0 1 pr t_prob @@ -683,13 +732,143 @@ fn ckfix ln view uchar * tp view uint * to void if not js_streq ln js_off tp get fv 0 v_sch prob1 m_sch end -if not js_streq ln js_off tp get fv 5 v_repo +end + +note the model's name (fv 5) and url (fv 6): plain, 1..128 and 1..256 bytes, the same in every +note record; the first record's are kept in name0 and url0 +fn ckname ln view uchar * tp view uint * to void +t = get fv 5 +n = js_slen tp t +if or or not plain tp t eq n 0 gt n 128 prob1 m_repo +ret +end +o = add js_off tp t 1 +if eq get nrec 0 0 +for i ulong n +put name0 i get ln add o i +end +put name0n 0 n +ret +end +same = eq n get name0n 0 +if same +for i ulong n +if ne get name0 i get ln add o i +same = false +end +end +end +if not same +prob1 m_repox end -if not js_streq ln js_off tp get fv 6 v_comm +end + +fn ckurl ln view uchar * tp view uint * to void +t = get fv 6 +n = js_slen tp t +if or or not plain tp t eq n 0 gt n 256 prob1 m_comm +ret +end +o = add js_off tp t 1 +if eq get nrec 0 0 +for i ulong n +put url0 i get ln add o i +end +put url0n 0 n +ret +end +same = eq n get url0n 0 +if same +for i ulong n +if ne get url0 i get ln add o i +same = false +end +end +end +if not same +prob1 m_commx +end +end + +fn ckmsha ln view uchar * tp view uint * to void +t = get fv 13 +if or not plain tp t ne js_slen tp t 64 +prob1 m_msha +ret +end +o = add js_off tp t 1 +z = true +for i ulong 64 +c = get ln add o i +if not ishex c +prob1 m_msha +ret +end +if ne c 48 +z = false +end +end +if z +put zman 0 1 +end +if eq get nrec 0 0 +for i ulong 64 +put msha0 i get ln add o i +end +ret +end +for i ulong 64 +if ne get msha0 i get ln add o i +prob1 m_mshax +ret +end +end +end + +note ======== own-model origin ======== + +fn urlc c uchar to bool +if or and ge c 65 le c 90 and ge c 97 le c 122 +ret true +end +if isdig c +ret true +end +ret or or eq c 46 eq c 95 or eq c 45 eq c 47 +end + +note true when url0[0 .. url0n) is an own-model url: k_own1, then at least one byte, every one +note of them A-Z a-z 0-9 . _ - /, with no ".." and no "//" (curl folds a ".." part out of a path) +fn ownurl to bool +n = get url0n 0 +p = len k_own1 +if le n p +ret false +end +for i ulong p +if ne get url0 i get k_own1 i +ret false +end +end +k = sub n p +for i ulong k +j = add p i +c = get url0 j +if not urlc c +ret false +end +d = get url0 sub j 1 +if and eq c 46 eq d 46 +ret false +end +if and eq c 47 eq d 47 +ret false end end +ret true +end note ======== records ======== @@ -714,6 +893,9 @@ ckacct ln tp cksha ln tp ckts ln tp ckexit ln tp +ckname ln tp +ckurl ln tp +ckmsha ln tp ckrel put nrec 0 add get nrec 0 1 end @@ -826,11 +1008,151 @@ end if ne get zsha 0 0 prob1 m_zsha end +if ne get zman 0 0 +prob1 m_zman +end +if or eq w 1 eq w 4 +if not ownurl +prob1 m_out +end +end +end + +note ======== --model MANIFEST ======== + +note b[o .. o+m) starts with the text t +fn starts b view uchar * o ulong m ulong t view uchar * to bool +if lt m len t +ret false +end +for i ulong len t +if ne get b add o i get t i +ret false +end +end +ret true +end + +note one manifest line src[s .. s+m), line number lno: counts name and url lines in mcnt (0 name, +note 1 url), sets mcnt 2 when a value is empty or too long, keeps the first url in url0 and its +note line number in mcnt 3 +fn mline src view uchar * s ulong m ulong to void +if starts src s m k_mname +put mcnt 0 add get mcnt 0 1 +k = sub m len k_mname +if or eq k 0 gt k 128 +put mcnt 2 1 +end +end +if starts src s m k_murl +put mcnt 1 add get mcnt 1 1 +k = sub m len k_murl +if or eq k 0 gt k 256 +put mcnt 2 1 +ret +end +if eq get mcnt 1 1 +o = add s len k_murl +for j ulong k +put url0 j get src add o j +end +put url0n 0 k +put mcnt 3 get lno 0 +end +end +end + +note judges the name and url lines of the manifest in src[0 .. n); the url goes to url0 +fn manif src view uchar * n ulong to void +s = ulong 0 +for i ulong add n 1 +if or eq i n eq get src i 10 +put lno 0 add get lno 0 1 +mline src s sub i s +s = add i 1 +end +end +put lno 0 0 +nn = get mcnt 0 +nu = get mcnt 1 +if eq nn 0 +prob1 m_mnone +end +if gt nn 1 +prob1 m_mtwo +end +if eq nu 0 +prob1 m_mnone2 +end +if gt nu 1 +prob1 m_mtwo2 +end +if ne get mcnt 2 0 +prob1 m_mbad +end +if and eq nu 1 gt get url0n 0 0 +if not ownurl +ul = get mcnt 3 +put prob 0 add get prob 0 1 +pr t_prob +prn ul +pr t_cs +pr m_mout +w = write 1 url0 0 get url0n 0 +pr t_nl +end +end +end + +note prints the manifest's first name line's value +fn prname src view uchar * n ulong to void +s = ulong 0 +for i ulong add n 1 +if or eq i n eq get src i 10 +m = sub i s +if starts src s m k_mname +w = write 1 src add s len k_mname sub m len k_mname +ret +end +s = add i 1 +end +end +end + +fn model to int +n = argread 2 pb 0 len pb +if le n 0 +pr t_usage +ret 2 +end +put pbn 0 ulong n +src = new uchar 262144 0 +r = readf src +if lt r 0 +pr t_io +ret 4 +end +manif src ulong r +if gt get prob 0 0 +pr t_mfail +prn get prob 0 +pr t_nl +ret 1 +end +pr t_mown +prname src ulong r +pr t_nl +ret 0 end fn main to int c = argcnt fa = ulong 1 +if eq c 3 +if argeq 1 t_modf +ret model +end +end if eq c 4 if or not argeq 1 t_wantf not setwant 2 pr t_usage From 364bab6945fc39192b7841de1b34afefd23679ee Mon Sep 17 00:00:00 2001 From: Drake Stapleton <213298340+drakestapleton@users.noreply.github.com> Date: Fri, 6 Nov 2026 18:04:28 -0600 Subject: [PATCH 2/4] installer/.crumb: crumb compile Agent: t_6bd4b620 (Hermes worker, claude-opus-5-5, anthropic) --- installer/.crumb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/installer/.crumb b/installer/.crumb index 520a2dc..514782a 100644 --- a/installer/.crumb +++ b/installer/.crumb @@ -3,14 +3,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-11-06T22:14:11Z", + "compiled_at": "2026-11-07T00:04:23Z", "compiler": "crumb-compile/1", - "digest": "sha256:a651b7fc6fea79a67bd555fa723b964d5416161815a497056a7912f072cd29db", + "digest": "sha256:65cb1c551ae8393cf1a78ceb64614c53a47c95930375a45ea3298f2422923931", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 127, - "generated_at_commit": "c7bdc6243dad584b80615df5410d4bd86ad4e625", - "source_tree": "sha256:25d6b97552179024ffb779f99d4ed9cb63061dd20ed959b89ff8f81431c1823f" + "generated_at_commit": "b92b301530d9664f1bbbfb25549b2ff8d9a8eccc", + "source_tree": "sha256:b2a84b44652d70f827301b9d85e2f119c7a0f9af8336aa794e0c75e6b35a5c26" } }, "invariants": [ From d1521c5a5a27218ddf84a52ec8ff07c4ddafacb9 Mon Sep 17 00:00:00 2001 From: Drake Stapleton <213298340+drakestapleton@users.noreply.github.com> Date: Fri, 6 Nov 2026 18:13:31 -0600 Subject: [PATCH 3/4] e2e.sh: --clean-account refuses a scratch folder the disposable account cannot enter The first FAKE-MODEL --clean-account run of this branch from a TMPDIR inside a private home failed at install with 'cannot open .../pub/www/rel/install.sh: Permission denied'. Refuse that up front (exit 2, account removed, nothing written) with the fix in the message. Agent: t_6bd4b620 (Hermes worker, claude-opus-5-5, anthropic) --- installer/rig/e2e.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/installer/rig/e2e.sh b/installer/rig/e2e.sh index 70954f6..9f58336 100755 --- a/installer/rig/e2e.sh +++ b/installer/rig/e2e.sh @@ -194,6 +194,11 @@ else fi chmod 755 "$work/as" as=$work/as +# The disposable account reads the checkout and installer from $pub: every folder above it must +# be one it can enter (a TMPDIR inside a private home is not). +if [ "$clean" = 1 ] && ! "$as" test -x "$pub"; then + refuse "the disposable account cannot reach $pub: set TMPDIR to a folder every user can enter" +fi base=$home/.local/share/aienos aienos=$base/current/bin/aienos From 0176b4aae68ce3de5b472a75e6ceb24563fc8ac9 Mon Sep 17 00:00:00 2001 From: Drake Stapleton <213298340+drakestapleton@users.noreply.github.com> Date: Fri, 6 Nov 2026 18:13:36 -0600 Subject: [PATCH 4/4] installer/.crumb: crumb compile Agent: t_6bd4b620 (Hermes worker, claude-opus-5-5, anthropic) --- installer/.crumb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/installer/.crumb b/installer/.crumb index 514782a..fd64ce9 100644 --- a/installer/.crumb +++ b/installer/.crumb @@ -3,14 +3,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-11-07T00:04:23Z", + "compiled_at": "2026-11-07T00:13:31Z", "compiler": "crumb-compile/1", - "digest": "sha256:65cb1c551ae8393cf1a78ceb64614c53a47c95930375a45ea3298f2422923931", + "digest": "sha256:70ecd16d10d3c6617af8cee7d869af17f8d33cd9a64425f0d5476c6e34681373", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 127, - "generated_at_commit": "b92b301530d9664f1bbbfb25549b2ff8d9a8eccc", - "source_tree": "sha256:b2a84b44652d70f827301b9d85e2f119c7a0f9af8336aa794e0c75e6b35a5c26" + "generated_at_commit": "d1521c5a5a27218ddf84a52ec8ff07c4ddafacb9", + "source_tree": "sha256:8ad81220fe2b43efd406adc1058e77704ab7bf62092408e9e9167a90bcc5b0a5" } }, "invariants": [