# step: receipt ledger · wai-rs and receipt_ledger_verify.py # order: 400 # features: receipt_ledger # paths: wai/extensions/receipt-ledger.md # independent: receipt-ledger live needs=cryptography python3 -I live-conformance/receipt_ledger_verify.py live-conformance/ledger # # wai.delivery.ledger (extensions/receipt-ledger.md): the reference module's unit tests and # tests/receipt_ledger.rs (vectors.json regenerates byte for byte from its fixed seeds and # from the sources it takes from the metering, settlement, ads, presentation, stitched and # routes corpora and the packs of pack-conformance, and no other file is there; wai-rs gives every vector its # stated outcome; every reason of §10 and every reused code refuses a vector, and so does # each source kind's own extension; §10 lists exactly the reference's codes; under a tariff # of version 3, jobs priced per operation and a chain that bills a job's work once, its # output's receipt cited again by a re-run, with version 2 billing as before; under a tariff of # version 8, a holder's storage billed by byte-days from records whose byte-seconds its snapshots # recompute, two days of it remade byte for byte, and each planted fault refused: byte-seconds over # what the snapshots support, an interval overlapping the set's previous record, a snapshot after # the interval, a unit mismatch and a signature over other bytes); and, in the step of every # independent verifier above, the corpus's second implementation, receipt_ledger_verify.py, written from the # extension's text and sharing no code with wai-rs, which verifies each source with that corpus's own # second implementation (live_metering_verify.py, settlement_verify.py, live_ads_verify.py # with ad_presentation_verify.py, stitched_presentation_verify.py, pack_verify.py, and for a # media job route_record_verify.py and _int_motion_receipt.py, and reads a holder's snapshots and # storage records itself) and # reports a stitched stream's statement as that verifier gives it, checks signatures with # WAI's strict Ed25519 rule, recomputes every line, citation, energy row and report, # requires every mutated copy of the corpus to fail, and drops each of its own checks in turn and requires # the corpus to catch the weakened verifier; run isolated (-I), with the `cryptography` package # installed above for the OER/2 reference verifier that checks a job's hop receipts. # # The paths this step brings to the workflow's trigger, and why: # wai/extensions/receipt-ledger.md: tests/receipt_ledger.rs requires this extension's §10 to list # the codes the reference reports, receipt_ledger_verify.py reads that table, and the registry's # wire identifiers test reads its sections. Its corpus is generated from the metering, # settlement, ads, presentation and stitched corpora and the packs of pack-conformance, all # under the paths above. set -euo pipefail (cd wai-rs && cargo test --no-default-features --features "$WAI_FEATURES" --lib receipt_ledger::) (cd wai-rs && cargo test --no-default-features --features "$WAI_FEATURES" --test receipt_ledger)