Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/decisions/2026-11-16-consumer-boundary-proof-design.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ headers; no successful checker leg is claimed for it.

== Next implementation packets and acceptance criteria

Follow-up implementation evidence: Proven now has a reachable Idris byte-state
kernel and a native RefC bundle path. The consumer diagnostic links that actual
library; the five original cases agree. Its stronger ABI corpus covers all byte
pairs and rejects an always-clean compiled mutant. This closes the observed
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.
Comment on lines +181 to +182

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Link the adapter matrix to its reproduction steps

In the context of the preceding adapter claims, this link promises reproduction of the 256-tag/four-state RefC matrix, but its target documents only proven-header-probe.sh, and the consumer-boundary directory contains no adapter runner or adapter revision. Readers therefore cannot reproduce or identify the evidence supporting those new claims; link the adapter’s actual pinned test instructions, or scope this sentence explicitly to the Proven diagnostic.

Useful? React with 👍 / 👎.


[cols="1,3,4",options="header"]
|===
|Order |Packet |Evidence needed to finish
Expand Down
35 changes: 35 additions & 0 deletions tests/consumer-boundary/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// SPDX-License-Identifier: CC-BY-SA-4.0
// Copyright (c) 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
= Proven header consumer diagnostic

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 diagnostic compiles the existing Idris String predicate independently,
builds Proven's actual RefC byte kernel and SDK bundle, then links the exported
C ABI into a Zig caller. The standalone unavailable-backend wrapper is not a
successful substitute. Missing build scripts, SDKs, symbols or nonzero statuses
are failures.

The five expected rows (Idris and Zig columns) are:

[source,text]
----
cr true true
lf true true
crlf true true
clean false false
embedded-cr true true
----

The earlier adjacent-pair implementation disagreed on three rows. The repaired
bridge agrees on all five. Logs bind source hashes, compiler versions and the
actual generated SDK. Proven's separate `scripts/test-header-bridge.sh` covers
all single bytes and byte pairs, NUL, non-UTF-8 and length boundaries, including
a broken-backend rejecting control.

This script is a differential executable diagnostic. It does not issue an
Atoma source-proof receipt. The current source frontend cannot represent the
loop, pointer span, foreign-call state transition or all compilation steps.
The corresponding source/refinement result therefore remains INCOMPLETE.
9 changes: 6 additions & 3 deletions tests/consumer-boundary/proven-header-probe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ cp -R "$proven/src/Proven" "$work/src/Proven"
git -C "$proven" rev-parse HEAD
"$idris" --version
"$zig" version
sha256sum "$proven/src/Proven/SafeHeader/Types.idr" "$proven/src/Proven/Core.idr" "$proven/ffi/zig/src/main.zig"
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the pinned mismatch reproduction path

When a reader follows the design document’s reproduction instructions against its pinned Proven revision c13619f9..., this line and the later build-header-refc.sh invocation require repair-only artifacts from the newer Proven revision, so set -e aborts before producing the documented five-row disagreement. Keep a legacy probe mode/script for the pinned observation, or update the historical reproduction section so it no longer directs readers to this incompatible script.

Useful? React with 👍 / 👎.

} > "$evidence/inputs.log"
cat > "$work/src/AtomaHeaderProbe.idr" <<'IDRIS'
module AtomaHeaderProbe
Expand All @@ -47,8 +48,10 @@ pub fn main() !void {
}
}
ZIG
"$zig" build-obj "$proven/ffi/zig/src/main.zig" -lc -femit-bin="$work/proven.o" > "$evidence/zig-build.log" 2>&1
"$zig" build-exe "$work/probe.zig" "$work/proven.o" -lc -femit-bin="$work/probe" >> "$evidence/zig-build.log" 2>&1
IDRIS2="$idris" bash "$proven/scripts/build-header-refc.sh" "$work/bundle" > "$evidence/header-build.log" 2>&1
cp "$work/bundle/identity.log" "$evidence/header-identity.log"
(cd "$proven/ffi/zig"; "$zig" build --build-file build_standalone.zig -Dheader-refc="$work/bundle" --prefix "$work/install") > "$evidence/zig-build.log" 2>&1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve the Zig executable before changing directories

When ZIG is a relative pathname such as tools/zig, the initial command -v and version check succeed from the caller’s directory, but this subshell changes into Proven’s ffi/zig directory before invoking that pathname, so the advertised tool override fails despite naming a valid executable. Resolve the executable to an absolute path up front or invoke the build without changing directories.

Useful? React with 👍 / 👎.

"$zig" build-exe "$work/probe.zig" "$work/install/lib/libproven_ffi.a" "$work/bundle/libidris2_refc.a" "$work/bundle/libidris2_support.a" -lc -lgmp -lm -lpthread -femit-bin="$work/probe" >> "$evidence/zig-build.log" 2>&1
"$work/probe" > "$evidence/zig-results.txt" 2>&1
for result in idris-results.txt zig-results.txt; do
if [[ $(wc -l < "$evidence/$result") -ne 5 ]] || grep -Evq '^(true|false)$' "$evidence/$result"; then
Expand Down
Loading