feat(adapters): TraceAGTAdapter — one-line AGT → TRACE upgrade path#65
Merged
Conversation
Two new tutorials filling gaps identified in the tutorial coverage audit: - anchoring-to-the-registry.md: how to set the transparency field via direct SCITT HTTP submission (no SDK registry client exists yet); explains the pending-placeholder pattern for dev, re-sign after anchoring, and what verification step 6 requires of a verifier - verifying-the-audit-chain.md: how to verify tool_transcript.hash against the external transcript bytes, validate call count, and understand external execution receipts per spec §3.3.1 mkdocs.yml: adds both tutorials to the Tutorials nav Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…erplate Closes #64. Adds `src/agentrust_trace/adapters/agt.py` with `TraceAGTAdapter` and `AGTSessionResult`. Replaces ~50 lines of manual policy-hash + audit-transcript + measurement wiring with a single `build_trust_record()` call. Exported from `agentrust_trace.adapters` and re-exported from the top-level package. - 16 unit tests covering all field mappings, edge cases, sign/verify round-trip, and structural TrustRecord validation (56/56 suite passes) - docs/integration/agt.md updated to show adapter as the recommended path - docs/tutorials/agt-adapter.md: full walkthrough including field mapping table, how to collect AGT session inputs, and Level 0 → Level 2 upgrade path via cMCP Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove ConfirmationKey, JWK, TrustRecord from agt.py imports (unused) - Break cnf placeholder and json.dumps calls to fit 100-char limit - Remove unused time import from test_agt_adapter.py - Rewrite dict() calls as dict literals (C408) Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
TraceAGTAdapterinsrc/agentrust_trace/adapters/agt.py— replaces ~50 lines of manual AGT→TRACE field wiring with a singlebuild_trust_record()callAGTSessionResultdataclass as the typed input (carriesagent_did,policy_bundle_bytes,audit_entries,merkle_chain_tip)agentrust_trace.adaptersand re-exports from the top-levelagentrust_tracepackagedocs/integration/agt.md— adapter is now the recommended path; manual wiring moved to "legacy" sectiondocs/tutorials/agt-adapter.md— full walkthrough with field mapping table, collecting AGT inputs, Level 0→Level 2 upgrade path via cMCPField mapping
subjectAGTSessionResult.agent_didpolicy.bundle_hashsha256(policy_bundle_bytes)tool_transcript.hashsha256(canonical_json(audit_entries))runtime.platformsoftware-only(Level 0)runtime.measurementsha256(merkle_chain_tip)appraisal.statusaffirming(Phase 1)Test plan
python -m pytest -v— 56/56 pass, zero regressionsTrustRecord.model_validate()accepts every record produced by the adapterCloses #64
🤖 Generated with Claude Code