Skip to content

refactor(tee): delegate the TPMT_SIGNATURE parse to agent-manifest 0.8 - #79

Merged
imran-siddique merged 2 commits into
mainfrom
feat/tee-union-tpm-adopt
Aug 1, 2026
Merged

refactor(tee): delegate the TPMT_SIGNATURE parse to agent-manifest 0.8#79
imran-siddique merged 2 commits into
mainfrom
feat/tee-union-tpm-adopt

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

Phase B1 of the TEE consolidation, the sibling of cmcp#464. The TPMT_SIGNATURE layout 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_SIGNATURE as "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_signature stays in __all__ and still raises AttestationFailed. It is now delegation plus error translation, which is the same idiom _delegate already uses for verify_tpm_quote. ParsedSignature is 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"), and test_parse_tpmt_signature_rejects_unsupported_algorithm failed 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 skipped with 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

imran-siddique and others added 2 commits August 1, 2026 14:32
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>
@imran-siddique
imran-siddique merged commit c0be574 into main Aug 1, 2026
11 checks passed
@imran-siddique
imran-siddique deleted the feat/tee-union-tpm-adopt branch August 1, 2026 21:36
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