open-standards/wai/oer-conformance/settle
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science ac387a1db5
Some checks failed
no-vanity-metrics / Scan committed Markdown for vanity metrics (push) Successful in 4s
standards workspaces build + test / jouleclaw-rs (push) Successful in 1m50s
standards workspaces build + test / eoc-rs (push) Successful in 1m54s
standards workspaces build + test / arl-rs (push) Successful in 2m10s
standards workspaces build + test / aac-rs (push) Successful in 40s
standards workspaces build + test / joule-code-rs (push) Successful in 38s
standards workspaces build + test / jcp-rs (push) Successful in 1m18s
standards workspaces build + test / joulecontract-rs (push) Successful in 30s
standards workspaces build + test / map-rs (push) Successful in 30s
standards workspaces build + test / proof-rs (push) Successful in 1m11s
standards workspaces build + test / mesh-rs (push) Successful in 26s
standards workspaces build + test / joule-ui-rs (push) Successful in 2m32s
standards workspaces build + test / openpay (push) Successful in 1m21s
standards workspaces build + test / sandbox-rs (push) Successful in 2m12s
WAI conformance / cargo-class corpora · linux-arm64 (push) Successful in 51s
WAI conformance / cross-arch byte-equality · linux-arm64 (push) Successful in 18s
standards workspaces build + test / jouledesk-rs (push) Successful in 2m39s
standards workspaces build + test / smart-byte-rs (push) Successful in 2m30s
WAI conformance / cargo-class corpora · linux (push) Successful in 1m11s
WAI conformance / cross-arch byte-equality · linux (push) Successful in 15s
standards workspaces build + test / joulehook-rs (push) Successful in 3m48s
WAI conformance / C2PA manifest emission · signed, read back, validated (push) Successful in 40s
standards workspaces build + test / sense-rs (push) Successful in 2m22s
standards workspaces build + test / macOS energy backend (jcp-energy) (push) Successful in 2m32s
WAI conformance / cargo-class corpora · macos (push) Successful in 55s
WAI conformance / cross-arch byte-equality · macos (push) Successful in 14s
WAI conformance / cargo-class corpora · windows (push) Has been cancelled
WAI conformance / cross-arch byte-equality · windows (push) Has been cancelled
wai/oer: settle draft 0.1's open points; make the two verifiers agree on every input
Departures from OER/2 draft 0.1, each in extensions/oer-receipts.md §9:
- decisions are named oer.decision.*, not wai.settle.* (WAI's namespace is for payload formats)
- the stage list behind bundle.provenance_root is serialised exactly as the body is,
  pinned by a non-ASCII fixture
- the number profile is normative: I-JSON integers, decimal strings in JSON's number
  grammar (<=34 digits), anything else malformed
- a document outside the document profile is refused whole: a number whose nearest
  binary64 is infinite, NaN/Infinity, an unpaired surrogate, a repeated member name,
  nesting past 64
- every composition check is exact (num-bigint / exact decimal context), ln 2 pinned
  as a decimal, every tolerance scaled by the figure's magnitude
- the order of the reasons reported alone, and every member judged on its value, are
  stated, so each mistyped member has one named reason
- published Ed25519 keys are decoded strictly: canonical encoding, not small order
- abstention is its own outcome (abstain, no answer, no record), held by a new reason,
  abstention_settled; escalate is a verdict returned from upstream

Four rounds of adversarial review with differential fuzzing drove this; the last fuzz
found one remaining divergence (repeated member names), now refused by both. The
edge corpus grows to 99 hand-declared vectors plus unreadable/ (11 documents every
verifier must refuse); each rule was falsified in both verifiers. serde_json gains
float_roundtrip under the oer feature so Rust rounds as Python does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 09:15:31 -04:00
..
zephyr wai: ingest OER/2 receipts — extension, conformance corpus, wai-rs verifier, C kernel in CI 2026-09-27 03:58:55 -04:00
host_main.c wai: ingest OER/2 receipts — extension, conformance corpus, wai-rs verifier, C kernel in CI 2026-09-27 03:58:55 -04:00
Makefile wai: ingest OER/2 receipts — extension, conformance corpus, wai-rs verifier, C kernel in CI 2026-09-27 03:58:55 -04:00
README.md wai/oer: settle draft 0.1's open points; make the two verifiers agree on every input 2026-09-28 09:15:31 -04:00
settle.c wai/oer: settle draft 0.1's open points; make the two verifiers agree on every input 2026-09-28 09:15:31 -04:00
settle.h wai/oer: settle draft 0.1's open points; make the two verifiers agree on every input 2026-09-28 09:15:31 -04:00
sha256.c wai: ingest OER/2 receipts — extension, conformance corpus, wai-rs verifier, C kernel in CI 2026-09-27 03:58:55 -04:00
sha256.h wai: ingest OER/2 receipts — extension, conformance corpus, wai-rs verifier, C kernel in CI 2026-09-27 03:58:55 -04:00
tweetnacl.c wai: ingest OER/2 receipts — extension, conformance corpus, wai-rs verifier, C kernel in CI 2026-09-27 03:58:55 -04:00
tweetnacl.h wai: ingest OER/2 receipts — extension, conformance corpus, wai-rs verifier, C kernel in CI 2026-09-27 03:58:55 -04:00

settle: the settlement kernel in portable C

The keystone loop as code that runs on a microcontroller and on a host: canonicalize a question, hash its key, look it up, verify, decide with compiled rules, record with a validity window, and emit an OER/2 receipt (draft 0.1 as profiled by extensions/oer-receipts.md): canonical bytes in the envelope's fixed order, SHA-256 receipt id and chain hash, Ed25519 signature.

Files: settle.c/.h (the kernel), sha256.c/.h, tweetnacl.c/.h (public domain Ed25519), host_main.c (host harness with a modelled meter), zephyr/ (application skeleton for a Zephyr board; untested build).

Build and cross-verify against the Python reference verifier from the OER/2 vector set:

make
./settle_host firmware_vectors.json 400
python3 ../oer2_verify.py firmware_vectors.json          # PASS v10 firmware chain from the C kernel
cmp firmware_vectors.json ../firmware_vectors.json       # the pinned corpus: no drift

The harness writes 400 receipts, the records they cite and a ledger identity; the verifier checks canonical bytes, ids, chain, sums, floors, records and signatures. Two implementations, one receipt — three with wai_oer_vectors in wai-rs, which CI runs over this output.

What the kernel does not do yet: escalate new questions upstream (a callback hook is the next addition), read a rail meter (the host models one; the Zephyr skeleton counts cycles), and hold the signing seed in a secure element. Energy constants inside the kernel (cycle energy, bits committed) are the model's projected values until the bench node measures them.