Fix demo/env.sgl and the cross-checkout gate for the lock/consume split
Three independent defects in one documented onboarding command, which together mean nobody has walked the README's first-run path in some time:
1. (pkg "hello" version: "2.12.2") -- pkg refuses a version argument; versions are metadata and selection is by binding. Exit 70. 2. sigil env shell -f demo/env.sgl -- env shell consumes an env.lock, never environment source. The lock step is separate and comes first. Exit 64, and this is the one the gate hit. 3. No SIGILREGISTRYMETADATA -- the gate never set it, so lock authoring refuses with "SIGILREGISTRYMETADATA is not configured" before it can verify the catalogue. Now required via :? like SIGIL_BIN already was, so the gate states its dependency instead of failing obscurely.
The missing core/hello binding fixed in the previous commit is the fourth, and only becomes visible once these three are out of the way.
Consumption deliberately runs without SIGILREGISTRYMETADATA and without SIGIL_CHANNEL, so the gate also holds the lock-only consumption boundary honest.
README.md | 9 ++++++++-
demo/env.sgl | 3 +--
scripts/gate-crosscheckout.sh | 18 +++++++++++++++---
3 files changed, 24 insertions(+), 6 deletions(-)README.mdmodified
```sh./bootstrapSIGIL_CHANNEL="$PWD" sigil env shell -f demo/env.sgl -- helloexport SIGIL_REGISTRY_METADATA=/path/to/root-signed/registry.jsonSIGIL_CHANNEL="$PWD" sigil env lock -f demo/env.sgl --lock-file env.locksigil env shell -f env.lock -- hello````sigil env shell` consumes an `env.lock`, never environment source, so the lockstep is separate and comes first. Only the lock step needs the channel and theregistry metadata; consumption deliberately needs neither. Requires sigil0.18.0 or newer, which is the first release with `env`.`bootstrap` downloads the seed and Zig archives from their manifest URLs,verifies their SHA-256 hashes before installation, and refuses altered orunexpected content. It requires `sh`, `sha256sum`, `tar`, and either `curl` ordemo/env.sglmodified
(environment packages: (list (pkg "hello" version: "2.12.2")))(environment packages: (list (pkg "hello")))scripts/gate-crosscheckout.shmodified
set -eurepo=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)sigil_bin=${SIGIL_BIN:?set SIGIL_BIN to a sigil binary with env support}sigil_bin=${SIGIL_BIN:?set SIGIL_BIN to a sigil binary with env support (0.18.0+)}registry=${SIGIL_REGISTRY_METADATA:?set SIGIL_REGISTRY_METADATA to root-signed registry metadata this binary accepts}scratch=$(mktemp -d /tmp/sigil-channel-clone.XXXXXX)trap 'rm -rf "$scratch"' EXIT HUP INT TERMgit clone --quiet --no-hardlinks "$repo" "$scratch/core-channel"SIGIL_BOOTSTRAP_ZIG_URL="${SIGIL_BOOTSTRAP_ZIG_URL:-}" \ "$scratch/core-channel/bootstrap"# Authoring: resolve demo/env.sgl against the clone's signed catalogue and# realize it. `env shell` consumes an env.lock, never environment source, so# the lock step is separate and comes first.SIGIL_REGISTRY_METADATA="$registry" \HOME="$scratch/home" SIGIL_CHANNEL="$scratch/core-channel" \ "$sigil_bin" env --store "$scratch/store" lock \ -f "$scratch/core-channel/demo/env.sgl" --lock-file "$scratch/env.lock"# Consumption: deliberately WITHOUT SIGIL_REGISTRY_METADATA and without# SIGIL_CHANNEL, which also holds the lock-only consumption boundary honest.HOME="$scratch/home" \ "$sigil_bin" env --store "$scratch/store" shell \ -f "$scratch/core-channel/demo/env.sgl" -- helloecho "cross-checkout gate: fresh clone, bootstrap, and sigil env shell green" -f "$scratch/env.lock" -- helloecho "cross-checkout gate: fresh clone bootstrapped, locked, and ran hello from the lock"