diff --git a/docs/decisions/2026-11-16-consumer-boundary-proof-design.adoc b/docs/decisions/2026-11-16-consumer-boundary-proof-design.adoc index ccf5862..b04b0db 100644 --- a/docs/decisions/2026-11-16-consumer-boundary-proof-design.adoc +++ b/docs/decisions/2026-11-16-consumer-boundary-proof-design.adoc @@ -36,10 +36,14 @@ Probe inputs, in order: lone CR, lone LF, CRLF, `clean`, embedded CR in `a\rZ`. Idris2 0.8.0 RefC output: `True True True False True`. Zig 0.15.2 output: `false false true false false`, each with status 0. This is executable evidence of disagreement, not just two models disagreeing. -Reproduce with `ZIG=/path/to/zig-0.15.2 IDRIS2=/path/to/idris2 -bash tests/consumer-boundary/proven-header-probe.sh /path/to/proven`. -The diagnostic deliberately exits 1 on disagreement and retains its -input identities, build output and differing results outside the repository. +These are historical results for the pinned Proven revision above. To replay +that mismatch, use the diagnostic from Atoma commit +`8377513cb93beec96148c5995bec8aadb8e74c09` with Proven at `c13619f9a67a1b9e8234e22e22dae0940d2480cb`. +That diagnostic exits 1 on disagreement and retains the input identities, +build output and differing results outside the repository. The current +diagnostic instead requires the repaired RefC bundle builder and checks the +five matching rows; follow link:../../tests/consumer-boundary/README.adoc[its instructions] +with Proven at `24fd48e954b7c124a195412a35c9c0be6f54990b` or a compatible later repair. == Decision 1: preserve boundary semantics, not spelling conventions @@ -177,9 +181,12 @@ behavioral disagreement, not the unproved source/compiler refinement relation. The adapter's finite decoder now has both decoding laws and its partial registration model has a no-fabricated-handler theorem. Its executable RefC matrix covers all 256 tags and four registration states. The actual Zig -registration table and network transports are still pending. See -link:../../tests/consumer-boundary/README.adoc[the consumer diagnostic] for -reproduction and the explicit receipt boundary. +registration table and network transports are still pending. Reproduce that +matrix at unified-api-adapter commit `259eff356e72fde2dadb1e144442f7a736da3601` +with `bash scripts/check-registry.sh`; see +link:https://github.com/hyperpolymath/unified-api-adapter/blob/259eff356e72fde2dadb1e144442f7a736da3601/scripts/check-registry.sh[the pinned registry gate]. +The link:../../tests/consumer-boundary/README.adoc[consumer diagnostic] +documents only the Proven experiment and its explicit receipt boundary. [cols="1,3,4",options="header"] |=== diff --git a/tests/consumer-boundary/README.adoc b/tests/consumer-boundary/README.adoc index ead8b57..768f3fd 100644 --- a/tests/consumer-boundary/README.adoc +++ b/tests/consumer-boundary/README.adoc @@ -5,6 +5,13 @@ Run `bash tests/consumer-boundary/proven-header-probe.sh /path/to/proven` with Idris2 `b6cbc25d5cd2ef2a250556266fd7b68dfc360f8b` and Zig 0.15.2 on native Linux x86_64 GNU. `IDRIS2`, `ZIG` and `EVIDENCE_DIR` may select explicit paths. +The repaired experiment was checked against Proven commit +`24fd48e954b7c124a195412a35c9c0be6f54990b`; older revisions without +`scripts/build-header-refc.sh` cannot run this version of the diagnostic. +To reproduce the historical mismatch at Proven `c13619f9a67a1b9e8234e22e22dae0940d2480cb`, +use this script from Atoma `8377513cb93beec96148c5995bec8aadb8e74c09` instead. +For that historical script, set both `IDRIS2` and `ZIG` to absolute executable +paths; its directory changes do not preserve relative tool overrides. The diagnostic compiles the existing Idris String predicate independently, builds Proven's actual RefC byte kernel and SDK bundle, then links the exported diff --git a/tests/consumer-boundary/proven-header-probe.sh b/tests/consumer-boundary/proven-header-probe.sh index 126d6f1..247f12a 100644 --- a/tests/consumer-boundary/proven-header-probe.sh +++ b/tests/consumer-boundary/proven-header-probe.sh @@ -4,12 +4,18 @@ # Execute the actual Idris predicate and Zig export, not handwritten oracles. # A disagreement is exit 1. This is a diagnostic, not a proof certificate. set -euo pipefail +# A caller's CDPATH must not add stdout to captured directory resolutions. +unset CDPATH proven=${1:?usage: proven-header-probe.sh /path/to/proven} proven=$(cd "$proven" && pwd) zig=${ZIG:-zig} idris=${IDRIS2:-idris2} -command -v "$zig" >/dev/null -command -v "$idris" >/dev/null +# Resolve overrides before any subshell changes directory. Preserve the +# executable's basename (Idris wrappers may locate their data through $0). +zig=$(command -v "$zig") +zig=$(cd "$(dirname "$zig")" && printf '%s/%s' "$PWD" "$(basename "$zig")") +idris=$(command -v "$idris") +idris=$(cd "$(dirname "$idris")" && printf '%s/%s' "$PWD" "$(basename "$idris")") evidence=${EVIDENCE_DIR:-$(mktemp -d -t atoma-header-evidence.XXXXXXXX)} mkdir -p "$evidence" evidence=$(cd "$evidence" && pwd) @@ -23,6 +29,9 @@ cp -R "$proven/src/Proven" "$work/src/Proven" "$zig" version git -C "$proven" diff --stat sha256sum "$proven/src/Proven/SafeHeader/Types.idr" "$proven/src/Proven/Core.idr" "$proven/src/Proven/SafeHeader/ByteKernel.idr" "$proven/ffi/zig/src/core.zig" "$proven/ffi/zig/src/header_refc.zig" "$proven/ffi/zig/src/main_refc.zig" + if [[ -d "$proven/ffi/zig/src/refc" ]]; then + find "$proven/ffi/zig/src/refc" -type f -name '*.zig' -exec sha256sum {} + + fi } > "$evidence/inputs.log" cat > "$work/src/AtomaHeaderProbe.idr" <<'IDRIS' module AtomaHeaderProbe