route-record: a third party's hop has a signed record of what was sent, what came back, and what the provider bills #572
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/third-party-hop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A hop sent to a third party's endpoint is work the router did not do. Its OER/2 receipt says the hop served or failed. Nothing WAI defines says what was sent, to whom, what came back, or what the provider bills, so an implementation has to carry that in a record of its own that WAI's verifier cannot read. This adds WAI's record for it.
The record (route-record §6.2)
wai-route-third-party-hop, signed by the router under its own domain and named by its digest:operatororcustomer, never the key), and the provider's id for the work.It holds no secret. No header has a member, since a key travels in one, and no URL states its query, since a provider's signed link is a bearer token.
third_party::kept_responseandurl_without_querymake a response and a URL what a record may state, and a record that keeps one is refused.Three design choices
usage.unitmust be the unit of its endpoint's candidate. A ledger line can then bill the record's usage at the entry's price, which is the next step.Verification (§7.2 step 9)
A verification document may carry
third_party, the records' texts, beside its receipts. Each record is held to:Three new reasons:
third_party_invalid,third_party_mismatch,third_party_output_mismatch. A document withoutthird_partyreads exactly as before, and its outcome has no such member.Tests
Routes corpus 126 → 236 vectors: nine accepted and 101 controls of one defect each, including every form and bound of §6.2 at its first value past the limit.
tests/route_record.rspasses. Each of 79 mutations ofthird_party.rsand ofverify's step 9, one per rule, is caught by the corpus, and the restored tree passes.wai breakingreports nothing unacknowledged.route_record_verify.py, written from the text, gives every vector its outcome. All 1,119 mutated copies fail, and the corpus catches each of its 103 checks when dropped. It now stops a mutated copy at its first failure, since it only asks whether one fails.Not covered: the record states what the router says it sent and received. The provider signs nothing, so the record proves the router's statement and binds it by digest to the bytes, which only a holder of the bytes can check. §11 says so.
Not in this PR
Ledger kind 17, a job line billing the record's usage, and the provider's charge beside the line come next, then the catalogue operations and kinds for exact upscale and tonemap. This record is usable and verifiable without them.
🤖 Generated with Claude Code
010c66d01e2e3f09bcf0