refactor(tee): delegate the TPMT_SIGNATURE parse to agent-manifest 0.8 - #79
Merged
Conversation
Phase B1 of the TEE consolidation, matching cmcp#464. The TPMT_SIGNATURE layout now lives in agent-manifest, so cA2A stops carrying its own copy of it. cmcp had a byte-identical implementation of the same parse; both are retired. The module docstring said this was "the piece agent-manifest does not model", which stopped being true in 0.8. parse_tpmt_signature stays in __all__ and keeps raising AttestationFailed, so nothing downstream changes: it is now a delegation plus error translation, the same idiom _delegate already uses for verify_tpm_quote. ParsedSignature is re-exported; its fields are unchanged. The upstream reason is passed through as the message rather than collapsed into a generic one. A first pass flattened everything to "TPMT_SIGNATURE is malformed" and a test caught it: "unsupported algorithm" and "truncated" are different faults and a caller that cannot tell them apart cannot report usefully. Verified against the published wheel rather than an editable install: 251 passed, 3 skipped with agent-manifest 0.8.0 resolved from PyPI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An assignment is a variable, not a type alias, so mypy rejected it in the parse_tpmt_signature return annotation. Importing the name directly keeps the re-export and the annotation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Phase B1 of the TEE consolidation, the sibling of cmcp#464. The
TPMT_SIGNATURElayout now lives in agent-manifest 0.8.0, so cA2A stops carrying its own copy.cmcp had a byte-identical implementation of the same parse, differing only in which exception it raised. Both are retired. This module's docstring described
TPMT_SIGNATUREas "the piece agent-manifest does not model" — that stopped being true in 0.8, and the docstring is corrected.Nothing changes for callers
parse_tpmt_signaturestays in__all__and still raisesAttestationFailed. It is now delegation plus error translation, which is the same idiom_delegatealready uses forverify_tpm_quote.ParsedSignatureis re-exported from agent-manifest; its fields (sig_alg,hash_alg,signature) are unchanged.One thing the tests caught
My first pass collapsed every upstream failure into
AttestationFailed("TPMT_SIGNATURE is malformed"), andtest_parse_tpmt_signature_rejects_unsupported_algorithmfailed on it. Correctly: "unsupported algorithm" and "truncated" are different faults, and a caller that cannot tell them apart cannot report usefully. The upstream reason is now passed through as the message.That is the risk in this kind of consolidation worth naming — the wire format is easy to share, the error contract is where behaviour quietly degrades.
Testing
251 passed, 3 skippedwith agent-manifest 0.8.0 resolved from PyPI, not an editable local checkout, since an editable install is what let the agentrust-trace publishing gap hide.🤖 Generated with Claude Code