Skip to content

feat(adapters): TraceAGTAdapter — one-line AGT → TRACE upgrade path#65

Merged
imran-siddique merged 3 commits into
mainfrom
feat/trace-agt-adapter
Jun 25, 2026
Merged

feat(adapters): TraceAGTAdapter — one-line AGT → TRACE upgrade path#65
imran-siddique merged 3 commits into
mainfrom
feat/trace-agt-adapter

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

Summary

  • Adds TraceAGTAdapter in src/agentrust_trace/adapters/agt.py — replaces ~50 lines of manual AGT→TRACE field wiring with a single build_trust_record() call
  • Adds AGTSessionResult dataclass as the typed input (carries agent_did, policy_bundle_bytes, audit_entries, merkle_chain_tip)
  • Exports both from agentrust_trace.adapters and re-exports from the top-level agentrust_trace package
  • 16 unit tests, 56/56 full suite passes; covers all field mappings, edge cases, sign/verify round-trip, structural TrustRecord validation
  • Updates docs/integration/agt.md — adapter is now the recommended path; manual wiring moved to "legacy" section
  • Adds docs/tutorials/agt-adapter.md — full walkthrough with field mapping table, collecting AGT inputs, Level 0→Level 2 upgrade path via cMCP

Field mapping

TRACE field Source
subject AGTSessionResult.agent_did
policy.bundle_hash sha256(policy_bundle_bytes)
tool_transcript.hash sha256(canonical_json(audit_entries))
runtime.platform Always software-only (Level 0)
runtime.measurement sha256(merkle_chain_tip)
appraisal.status Always affirming (Phase 1)

Test plan

  • python -m pytest -v — 56/56 pass, zero regressions
  • All 16 adapter-specific tests pass, including sign/verify round-trip
  • TrustRecord.model_validate() accepts every record produced by the adapter

Closes #64

🤖 Generated with Claude Code

imran-siddique and others added 3 commits June 22, 2026 13:09
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>
@imran-siddique imran-siddique merged commit e82ca69 into main Jun 25, 2026
5 checks passed
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.

feat: add TraceAGTAdapter to eliminate AGT integration boilerplate

1 participant