Skip to content

Add reference verifier for MCP payment classification derivation#52

Merged
sftimeless merged 1 commit into
mainfrom
codex/mcp-payment-derivation-verifier
Jul 24, 2026
Merged

Add reference verifier for MCP payment classification derivation#52
sftimeless merged 1 commit into
mainfrom
codex/mcp-payment-derivation-verifier

Conversation

@sftimeless

Copy link
Copy Markdown
Member

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_derivation re-derives the authorized_action offline:

(connector_identity, canonical_tool_name)  ->  value_movement  ->  payment.execute

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_conformance runs 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

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>
@sftimeless
sftimeless merged commit cb3d4b9 into main Jul 24, 2026
7 of 8 checks passed
@sftimeless sftimeless mentioned this pull request Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant