Add reference verifier for MCP payment classification derivation#52
Merged
Conversation
Productionizes keel.permit.action_classification_derivation.v1's decision algorithm as keel_verifier.action_classification_derivation: given a permit's signed classification facts and an explicit immutable trust config (accepted classification-registry digests -> validated bytes), it re-derives the authorized_action from signed facts plus the vendored, hash-pinned keel-permit artifacts alone. Display-only and strictly non-authorizing, like permit_presentation. This is the reference verifier the four-round contract review converged toward: the corpus decides, this proves the implementation conforms. All 14 vectors pass against the production module (test_action_classification_derivation_conformance, 16 tests incl. digest-match and outcome-coverage meta-checks). Vendors the two classification artifacts + the corpus byte-for-byte from keel-permit and adds all three to the cross-repo parity map, so they cannot drift from source unnoticed; verified by tampering — the guard names the file. Building this surfaced and fixed a real corpus modeling gap (the integrity vectors' abstract flags were not byte-realizable under content-addressing; now byte-concrete via given.store), pushed back to keel-permit#16. 599 passed / 37 skipped / 5 xfailed (was 583; +16 conformance). Parity holds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merged
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.
Pairs with keelapi/keel-permit#16, which adds the classification contract. Hold merge until #16 is reviewed (this vendors its artifacts).
What this is
The reference verifier that adjudicates the derivation chain — the thing the four-round contract review converged toward. Given a permit's signed classification facts and an explicit immutable trust configuration,
keel_verifier.action_classification_derivationre-derives theauthorized_actionoffline:from signed facts plus the vendored, hash-pinned keel-permit artifacts alone, trusting nothing the issuer asserts about the classification. Display-only and strictly non-authorizing, like
permit_presentation— never flows into verdicts, claim adjudication, cryptographic checks, or exit codes.Conformance
test_action_classification_derivation_conformanceruns the production module against all 14 corpus vectors (16 tests incl. digest-match and outcome-coverage meta-checks). The corpus decides; this proves the implementation conforms.The two classification artifacts + corpus are vendored byte-for-byte from keel-permit and added to the cross-repo parity map, so they cannot drift from source — verified by tampering (the guard names the file).
The build validated the contract
Productionizing with real bytes surfaced a modeling gap the review missed: the integrity vectors' abstract flags were not byte-realizable under content-addressing. Fixed with a byte-concrete
given.store, pushed back into keel-permit#16. That is the round-4 "store rules finalized during verifier build" obligation, discharged.Verification
599 passed / 37 skipped / 5 xfailed (was 583; +16 conformance). Parity holds byte-for-byte; registries remain display-only.
🤖 Generated with Claude Code