{
  "created_at": "2026-11-13T03:32:40Z",
  "result": {
    "engine": "commerce_authority",
    "limits": "Reviews the session record. It is not an implementation of any commerce protocol and does not talk to a merchant, wallet or payment network. The run is Ed25519-signed; pin the issuer key out of band.",
    "module": "cain_a75_engines/commerceauthority/engine.py",
    "profile": "tent_purchase_and_return",
    "run": {
      "label": "Recomputes a commerce session's authority: phase-specific scopes, the mandate carried only into checkout, payment limits, hash-bound phase handoffs and bounded returns. It does not talk to a merchant or payment network.",
      "public_key_b64": "FG/ZpCZ4JYgv1qNaK+oiUja+VyypVdUV4JZPN2Hos6E=",
      "records": [
        {
          "checks": [
            {
              "detail": "issued by 'human:shopper', principal 'human:shopper'",
              "id": "mandate.principal",
              "ok": true
            },
            {
              "detail": "validity window is non-empty",
              "id": "mandate.validity",
              "ok": true
            },
            {
              "detail": "per-payment cap 200.0 <= total cap 250.0",
              "id": "mandate.caps",
              "ok": true
            },
            {
              "detail": "discovery scopes only",
              "id": "P1.scopes",
              "ok": true
            },
            {
              "detail": "discovery carries mandate None",
              "id": "P1.mandate",
              "ok": true
            },
            {
              "detail": "phase window is non-empty",
              "id": "P1.window",
              "ok": true
            },
            {
              "detail": "discovery after start",
              "id": "P1.order",
              "ok": true
            },
            {
              "detail": "first phase has no handoff",
              "id": "P1.handoff",
              "ok": true
            },
            {
              "detail": "checkout scopes only",
              "id": "P2.scopes",
              "ok": true
            },
            {
              "detail": "checkout carries mandate 'M-1'",
              "id": "P2.mandate",
              "ok": true
            },
            {
              "detail": "phase window is non-empty",
              "id": "P2.window",
              "ok": true
            },
            {
              "detail": "checkout after discovery",
              "id": "P2.order",
              "ok": true
            },
            {
              "detail": "handoff from P1 bound to its hash",
              "id": "P2.handoff",
              "ok": true
            },
            {
              "detail": "starts after the previous phase ended",
              "id": "P2.no_overlap",
              "ok": true
            },
            {
              "detail": "post_purchase scopes only",
              "id": "P3.scopes",
              "ok": true
            },
            {
              "detail": "post_purchase carries mandate None",
              "id": "P3.mandate",
              "ok": true
            },
            {
              "detail": "phase window is non-empty",
              "id": "P3.window",
              "ok": true
            },
            {
              "detail": "post_purchase after checkout",
              "id": "P3.order",
              "ok": true
            },
            {
              "detail": "handoff from P2 bound to its hash",
              "id": "P3.handoff",
              "ok": true
            },
            {
              "detail": "starts after the previous phase ended",
              "id": "P3.no_overlap",
              "ok": true
            },
            {
              "detail": "at 1010.0 inside P1",
              "id": "a1.in_phase",
              "ok": true
            },
            {
              "detail": "search needs search:read in P1",
              "id": "a1.scope",
              "ok": true
            },
            {
              "detail": "at 1020.0 inside P1",
              "id": "a2.in_phase",
              "ok": true
            },
            {
              "detail": "view needs catalog:read in P1",
              "id": "a2.scope",
              "ok": true
            },
            {
              "detail": "at 1110.0 inside P2",
              "id": "a3.in_phase",
              "ok": true
            },
            {
              "detail": "add_to_cart needs cart:write in P2",
              "id": "a3.scope",
              "ok": true
            },
            {
              "detail": "at 1150.0 inside P2",
              "id": "a4.in_phase",
              "ok": true
            },
            {
              "detail": "pay needs payment:mandate in P2",
              "id": "a4.scope",
              "ok": true
            },
            {
              "detail": "payment only in checkout",
              "id": "a4.pay.checkout",
              "ok": true
            },
            {
              "detail": "payment cites the session mandate",
              "id": "a4.pay.mandate",
              "ok": true
            },
            {
              "detail": "merchant 'merchant:outdoor-co'",
              "id": "a4.pay.merchant",
              "ok": true
            },
            {
              "detail": "currency 'USD'",
              "id": "a4.pay.currency",
              "ok": true
            },
            {
              "detail": "179.0 <= per-payment cap 200.0",
              "id": "a4.pay.cap",
              "ok": true
            },
            {
              "detail": "running total 179.0 <= 250.0",
              "id": "a4.pay.total",
              "ok": true
            },
            {
              "detail": "1 payment(s) in 3600.0s <= 2",
              "id": "a4.pay.velocity",
              "ok": true
            },
            {
              "detail": "inside the mandate validity",
              "id": "a4.pay.valid",
              "ok": true
            },
            {
              "detail": "order O-1 paid once",
              "id": "a4.pay.unique_order",
              "ok": true
            },
            {
              "detail": "at 1400.0 inside P3",
              "id": "a5.in_phase",
              "ok": true
            },
            {
              "detail": "order_status needs order:read in P3",
              "id": "a5.scope",
              "ok": true
            },
            {
              "detail": "at 1900.0 inside P3",
              "id": "a6.in_phase",
              "ok": true
            },
            {
              "detail": "return needs return:create in P3",
              "id": "a6.scope",
              "ok": true
            },
            {
              "detail": "order 'O-1' was paid in this session",
              "id": "a6.return.order",
              "ok": true
            },
            {
              "detail": "refunds 179.0 <= paid 179.0",
              "id": "a6.return.amount",
              "ok": true
            },
            {
              "detail": "claimed True, computed True",
              "id": "claims.handoffs_recorded",
              "ok": true
            },
            {
              "detail": "claimed True, computed True",
              "id": "claims.mandate_only_in_checkout",
              "ok": true
            },
            {
              "detail": "claimed True, computed True",
              "id": "claims.payments_within_mandate",
              "ok": true
            },
            {
              "detail": "claimed True, computed True",
              "id": "claims.phase_scoped",
              "ok": true
            },
            {
              "detail": "claimed True, computed True",
              "id": "claims.returns_bounded",
              "ok": true
            }
          ],
          "created_at": "2026-11-13T03:32:40Z",
          "engine": "a75-047/1.0.0",
          "extra": {
            "computed": {
              "handoffs_recorded": true,
              "mandate_only_in_checkout": true,
              "payments_within_mandate": true,
              "phase_scoped": true,
              "returns_bounded": true
            },
            "payments": [
              {
                "amount": 179.0,
                "id": "a4",
                "merchant": "merchant:outdoor-co"
              }
            ],
            "phases": {
              "P1": {
                "phase": "discovery",
                "scopes": [
                  "catalog:read",
                  "search:read"
                ]
              },
              "P2": {
                "phase": "checkout",
                "scopes": [
                  "address:read",
                  "cart:write",
                  "payment:mandate"
                ]
              },
              "P3": {
                "phase": "post_purchase",
                "scopes": [
                  "order:read",
                  "return:create"
                ]
              }
            },
            "returns": [
              {
                "amount": 179.0,
                "id": "a6",
                "order_id": "O-1"
              }
            ],
            "total_paid": 179.0
          },
          "failed": [],
          "label": "Recomputes a commerce session's authority: phase-specific scopes, the mandate carried only into checkout, payment limits, hash-bound phase handoffs and bounded returns. It does not talk to a merchant or payment network.",
          "prev_record_hash": "33001d896a7ed9e4302874a7f91fa978661c7385cb4f625c78f079a328f3e7df",
          "public_key_b64": "FG/ZpCZ4JYgv1qNaK+oiUja+VyypVdUV4JZPN2Hos6E=",
          "record_hash": "bed1fd6bd111010d8dc6a315d6767833feaf9cd474bf6ef6249b89380de2332c",
          "schema": "cain42.a75.commerce.record.v1",
          "signature_b64": "EGVDzqakA2nfvAmiFk/8jPOLH+jS343XbJLt3L22HZnDDpRUGkRMjD1VGoyPtrEqUYnC0pGebpAuiLV0NKfEBQ==",
          "sku": "CAIN-A75-047",
          "subject": {
            "actions": [
              {
                "at": 1010.0,
                "id": "a1",
                "kind": "search",
                "phase_id": "P1",
                "query": "2-person tent"
              },
              {
                "at": 1020.0,
                "id": "a2",
                "item": "tent-22",
                "kind": "view",
                "phase_id": "P1"
              },
              {
                "at": 1110.0,
                "id": "a3",
                "item": "tent-22",
                "kind": "add_to_cart",
                "phase_id": "P2"
              },
              {
                "amount": 179.0,
                "at": 1150.0,
                "currency": "USD",
                "id": "a4",
                "kind": "pay",
                "mandate_id": "M-1",
                "merchant": "merchant:outdoor-co",
                "order_id": "O-1",
                "phase_id": "P2"
              },
              {
                "at": 1400.0,
                "id": "a5",
                "kind": "order_status",
                "order_id": "O-1",
                "phase_id": "P3"
              },
              {
                "at": 1900.0,
                "id": "a6",
                "kind": "return",
                "order_id": "O-1",
                "phase_id": "P3",
                "refund_amount": 179.0
              }
            ],
            "claims": {
              "handoffs_recorded": true,
              "mandate_only_in_checkout": true,
              "payments_within_mandate": true,
              "phase_scoped": true,
              "returns_bounded": true
            },
            "mandate": {
              "currency": "USD",
              "expires_at": 4600.0,
              "id": "M-1",
              "issued_at": 1000.0,
              "issued_by": "human:shopper",
              "max_amount": 200.0,
              "max_payments": 2,
              "max_total": 250.0,
              "merchants": [
                "merchant:outdoor-co"
              ],
              "velocity_window_s": 3600.0
            },
            "phases": [
              {
                "ended_at": 1100.0,
                "handoff_from": null,
                "id": "P1",
                "mandate_id": null,
                "phase": "discovery",
                "scopes": [
                  "catalog:read",
                  "search:read"
                ],
                "started_at": 1000.0
              },
              {
                "ended_at": 1200.0,
                "handoff_from": "P1",
                "handoff_sha256": "d2f4e5e451dd09df1e5dada922ae7d732a106ceb3f61311d61f664ec29a292bb",
                "id": "P2",
                "mandate_id": "M-1",
                "phase": "checkout",
                "scopes": [
                  "cart:write",
                  "payment:mandate",
                  "address:read"
                ],
                "started_at": 1100.0
              },
              {
                "ended_at": 2000.0,
                "handoff_from": "P2",
                "handoff_sha256": "b358eca91075b2d8ce1bc237e632f2d71a9f6fd59e83bc6eb87f702cd89c5886",
                "id": "P3",
                "mandate_id": null,
                "phase": "post_purchase",
                "scopes": [
                  "order:read",
                  "return:create"
                ],
                "started_at": 1300.0
              }
            ],
            "schema": "cain42.a75.commerce.session.v1",
            "session": {
              "agent": "agent:shopping-assistant",
              "id": "S-1",
              "principal": "human:shopper"
            }
          },
          "subject_sha256": "3505db56d91be5ffccf6368910e11cd4ac7cbf157cc9ede99718c1a41e254b92",
          "verdict": "SOUND"
        }
      ],
      "run_hash": "28ba31fa372b8b6d3c6665d839da8056c1b93d086c9da13487de3270943c6f3a",
      "schema": "cain42.a75.commerce.run.v1",
      "sku": "CAIN-A75-047",
      "verdict": "VERIFIED",
      "verdicts": [
        "SOUND"
      ]
    },
    "scenarios": [
      {
        "name": "tent_purchase_and_return",
        "phases": {
          "P1": {
            "phase": "discovery",
            "scopes": [
              "catalog:read",
              "search:read"
            ]
          },
          "P2": {
            "phase": "checkout",
            "scopes": [
              "address:read",
              "cart:write",
              "payment:mandate"
            ]
          },
          "P3": {
            "phase": "post_purchase",
            "scopes": [
              "order:read",
              "return:create"
            ]
          }
        },
        "run_hash": "28ba31fa372b8b6d3c6665d839da8056c1b93d086c9da13487de3270943c6f3a",
        "total_paid": 179.0,
        "verdict": "VERIFIED"
      },
      {
        "expected": "SOUND",
        "name": "honest_session",
        "verdict": "SOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "session_wide_grant",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "mandate_in_discovery",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "mandate_in_post_purchase",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "pay_from_post_purchase",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "merchant_not_allowed",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "over_per_payment_cap",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "over_total_cap",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "velocity_exceeded",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "wrong_currency",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "mandate_expired",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "mandate_not_from_principal",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "duplicate_order_payment",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "refund_exceeds_paid",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "return_unknown_order",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "action_outside_phase",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "action_missing_scope",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "tampered_handoff",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "phase_edited_after_handoff",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "phases_out_of_order",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "claim_overstates",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "unknown_claim",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "wrong_schema",
        "verdict": "UNSOUND"
      },
      {
        "expected": "UNSOUND",
        "name": "garbage",
        "verdict": "UNSOUND"
      }
    ],
    "summary": "VERIFIED: phase scopes, mandate confinement to checkout, payment limits, hash-bound handoffs and bounded returns recomputed; 24/24 commerce-authority failure cases as expected"
  },
  "schema": "cain42.agentic75.findings.v1",
  "sku": "CAIN-A75-047"
}
