# DAG Receipt Tree Claim Mapping

Internal reduction-to-practice mapping. Confirm claim scope with counsel before external assertion.

## Claim 2: DAG Trust Attestation verification

- TAT node fields: `ReceiptDagNode` defines version, timestamp, msgHash, trustScore, blocked, signerFingerprint, topology, parents, entryHash, and signature in `packages/agentguard-spend/src/receipts/dag.ts:8`.
- Signature verification against signer keys: `verifyReceiptDag()` resolves the signer public key and verifies Ed25519 signatures in `packages/agentguard-spend/src/receipts/dag.ts:182`.
- Kahn topological sort and cycle failure: `topologicalOrder()` computes in-degree, visits zero-parent nodes, and returns `CYCLE_DETECTED` in `packages/agentguard-spend/src/receipts/dag.ts:358`.
- Diamond common-ancestor and msgHash correlation: `verifyDiamondCorrelation()` traverses parent ancestry and checks correlation values in `packages/agentguard-spend/src/receipts/dag.ts:386`.
- Minimum-of-chain composite trust: `verifyReceiptDag()` returns `Math.min(...trustScore)` in `packages/agentguard-spend/src/receipts/dag.ts:215`.
- Legacy linear chain compatibility: `normalizeDagNode()` maps `previousHash` to `parents` and preserves old entry verification in `packages/agentguard-spend/src/receipts/dag.ts:310`.

Python mirror:

- TAT node signing and canonical fields: `agentguard_spend/receipts/dag.py:45`.
- Verification, topological sort, and composite trust: `agentguard_spend/receipts/dag.py:115` and `agentguard_spend/receipts/dag.py:236`.

## Claim 3: Attestation-gated capability escalation

- Capability levels are the ordered enum `READ_ONLY`, `TRANSACT`, `ADMIN`, `ORCHESTRATE` in `packages/agentguard-spend/src/receipts/dag.ts:6`.
- Default trust and depth thresholds are defined in `packages/agentguard-spend/src/receipts/dag.ts:69`.
- `gateCapability()` denies invalid DAGs, trust below threshold, or insufficient DAG depth before granting a requested capability in `packages/agentguard-spend/src/receipts/dag.ts:223`.
- Python parity lives in `agentguard_spend/receipts/dag.py:165`.

## Claim 7: Merkle compression and inclusion proofs

- DAGs over the default threshold are compressed by `compressReceiptDag()` in `packages/agentguard-spend/src/receipts/dag.ts:270`.
- Inclusion proofs are produced by `merkleInclusionProof()` in `packages/agentguard-spend/src/receipts/dag.ts:278`.
- Inclusion proofs are verified by `verifyInclusion()` in `packages/agentguard-spend/src/receipts/dag.ts:296`.
- Python parity lives in `agentguard_spend/receipts/dag.py:181`, `agentguard_spend/receipts/dag.py:185`, and `agentguard_spend/receipts/dag.py:202`.

## Workflow and Reviewer Cascade practice points

- Outcome runtime attaches a DAG envelope to signed outcome receipts when drafter, reviewer, or final signed entries exist in `packages/agentguard-spend/src/outcomes/runtime.ts:168`.
- The DAG envelope uses only metadata signed entries. It excludes prompt, completion, source, and PII fields through the data-plane guard in `packages/agentguard-spend/src/receipts/dag.ts:514`.
- The public verifier renders DAG topology, composite trust, depth, and capability status in `agentguard-site/verify/index.html`.
