test: conformance vectors for seven unexercised receipt rules - #122
Open
lywinged wants to merge 1 commit into
Open
test: conformance vectors for seven unexercised receipt rules#122lywinged wants to merge 1 commit into
lywinged wants to merge 1 commit into
Conversation
The receipt verifier applies rules that no fixture exercises. An implementation
can omit each of these checks entirely and still pass the published set, which is
the one thing a conformance suite is supposed to prevent.
action_ref_invalid recomputing the action reference rather than trusting
the declared value
call_id_mismatch that the receipt is bound to this call
session_id_mismatch that it is bound to this session
evidence_hash_mismatch recomputing the evidence digest
issuer_key_untrusted the signing key against a pinned set at all
receipt_from_future a receipt issued after the verification time
decision_invalid refusing to read an unknown verb as accept or reject
Two are load-bearing for the trust model rather than tidiness. Without
issuer_key_untrusted a receipt authenticates itself, since a signature verifies
against whatever key it names and only a pinned set decides whether that key was
entitled to speak. Without evidence_hash_mismatch the signature covers a digest
whose document can be swapped, because the receipt signs the digest and not the
evidence body.
One fixture per rule, each triggering exactly that rule and nothing else, so a
failure names the check that broke. They pin their own deterministic test key:
the private half of the key behind 01-09 is not published, and each fixture
already carries its own trusted_issuer_keys. gen_rule_coverage_vectors.py
regenerates the set byte-for-byte and only public JWKs appear in the files.
Found by walking the verifier's source for every failure code it can emit and
comparing that against the codes the fixtures expect, rather than by reading the
set and guessing what was missing.
Signed-off-by: lywinged <48041247+lywinged@users.noreply.github.com>
Contributor
|
❔ Contributor Check: UNKNOWN
Automated check by AgenTrust Contributor Check. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Seven conformance fixtures, one per receipt rule that the verifier applies and that no
fixture previously exercised.
action_ref_invalidcall_id_mismatchsession_id_mismatchevidence_hash_mismatchissuer_key_untrustedreceipt_from_futuredecision_invalidWhy these two matter beyond tidiness
Without
issuer_key_untrusted, a receipt authenticates itself. A signature verifiesagainst whatever key it names, and only a pinned set decides whether that key was ever
entitled to speak.
Without
evidence_hash_mismatch, the signature covers a digest whose document can beswapped. The receipt signs
evidence_hash, not the evidence body, so only recomputationcatches a substituted body.
The other five are ordinary binding and freshness checks, and the same argument applies
in weaker form: a suite that never exercises a rule certifies implementations that skip
it.
How they were found
By walking the verifier's source for every failure code it can emit and comparing that
against the codes the fixtures expect. The seven above were emitted by the verifier and
expected by nothing.
I am happy to contribute the check itself as a follow-up if it is wanted — it recovers
the rule inventory from source with
astrather than from a hand-maintained list, so arule added without a fixture fails rather than passing quietly. Keeping it out of this PR
so the fixtures can be judged on their own.
Shape
One fixture per rule, each triggering exactly that rule and nothing else, so a failure
names the check that broke rather than a set of them.
They pin their own deterministic test key. The private half of the key behind
01–09is not published, and each fixture already carries its own
trusted_issuer_keys, so aseparate key changes nothing about how the set is verified.
gen_rule_coverage_vectors.pyregenerates the set byte-for-byte; only public JWKs appearin the files. Worth stating plainly that the keys are deliberately deterministic test
keys rather than leaving a reviewer to notice the pattern.
Scope
Additive. No existing fixture changes, no verifier changes, no schema or spec changes.
The only edits to existing files are the filename list in
test_fixture_set_is_completeand a table in the examples README.
Under
GOVERNANCE.mdthis is a conformance-test addition: no normative text, so nosponsor and no comment window. Please tell me if you read it differently.
Checks
ruff check src testsandmypy src/agentrust_traceclean