{
  "schemaVersion": 1,
  "sourceRepo": "https://github.com/RevanthM/lean-jev-bridge",
  "sourceRef": "2b8b8af1d0322d449f08f6492fd6476632c07a92",
  "sourceFile": "Bridge/Kernel.lean",
  "toolchain": "leanprover/lean4:v4.35.0",
  "evaluationType": "offline-prerecorded-lean-execution",
  "disclosure": "Five manually authored synthetic packets were executed against the pinned Lean bridge. No Jev model was called. The browser selects recorded results and does not execute Lean. Per-check booleans explain the frozen fixture in Python; each decision and exit code comes from the actual Lean executable.",
  "policy": {
    "id": "synthetic-refund-v1",
    "sourceId": "synthetic-ledger-TX42-v1",
    "sourceLine": "TX42 was charged twice; the duplicate amount is USD 25.00.",
    "factId": "duplicate-charge-25-reviewed",
    "validFrom": 20261101,
    "validThrough": 20261130,
    "day": 20261115,
    "reviewedFact": true,
    "minChoiceBps": 9800,
    "minNoulBps": 9800,
    "maxRiskNumerator": 500
  },
  "verification": {
    "generator": "scripts/generate-jev-replay.py",
    "scenarioCount": 5,
    "compiledTarget": "bridge",
    "expectedDecisionsVerified": true,
    "expectedExitCodesVerified": true,
    "expectedExplanatoryChecksVerified": true,
    "kernelSha256": "cc0b46d6eb993d30c5aad332247d122a1f6fdf94d44518fb64bb750fddcb3ad0",
    "toolchainOutput": "Lean (version 4.35.0, arm64-apple-darwin24.6.0, commit eb6cafb7290e8bd5f2937522d8d804f58f02bafc, Release)",
    "transcriptPathHandling": "The temporary local packet argument is replaced by a portable placeholder and the public packet path. Lean stdout and exit code are recorded verbatim.",
    "reproduce": "Check out sourceRef, install its pinned toolchain, download a packet, and run lake exe bridge path/to/packet.json. Invalid packets intentionally exit with code 2."
  },
  "scenarios": [
    {
      "id": "accepted",
      "title": "Supported refund",
      "description": "The authored packet matches the reviewed duplicate-charge fact and passes every fixture gate.",
      "change": "Original synthetic packet; no fields changed.",
      "decision": "accepted",
      "metrics": {
        "choiceProbability": 0.99,
        "noulProbability": 0.995,
        "expectedRisk": 0.011,
        "choiceBps": 9900,
        "noulBps": 9950,
        "riskNumerator": 110
      },
      "checks": [
        {
          "id": "recognized-model",
          "label": "Pinned model version",
          "passed": true
        },
        {
          "id": "valid-mass",
          "label": "Valid probability mass",
          "passed": true
        },
        {
          "id": "certificate-match",
          "label": "Exact evidence certificate",
          "passed": true
        },
        {
          "id": "reviewed-fact",
          "label": "Reviewed fact attestation",
          "passed": true
        },
        {
          "id": "policy-date",
          "label": "Fixture policy date",
          "passed": true
        },
        {
          "id": "choice-gate",
          "label": "Refund Choice at least 98%",
          "passed": true
        },
        {
          "id": "noul-gate",
          "label": "Noul support at least 98%",
          "passed": true
        },
        {
          "id": "risk-gate",
          "label": "Expected risk at most 0.05",
          "passed": true
        }
      ],
      "packetPath": "/research/jev-replay/accepted.json",
      "packetSha256": "972a8ed2a4be3daa5820441645216798402de1a375c7e920db4b75d3f7dc8e6a",
      "transcript": {
        "command": "lake exe bridge <downloaded-packet.json>",
        "packetPath": "/research/jev-replay/accepted.json",
        "exitCode": 0,
        "stdout": "{\"decision\":\"accepted\",\"policy\":\"synthetic-refund-v1\",\"scope\":\"synthetic reviewed refund fixture only\"}\n",
        "stderr": ""
      }
    },
    {
      "id": "forged-evidence",
      "title": "High confidence, wrong quote",
      "description": "The model-shaped probabilities stay high, but the proposed amount changes the source sentence.",
      "change": "Quote changes USD 25.00 to USD 250.00; all probabilities are unchanged.",
      "decision": "review",
      "metrics": {
        "choiceProbability": 0.99,
        "noulProbability": 0.995,
        "expectedRisk": 0.011,
        "choiceBps": 9900,
        "noulBps": 9950,
        "riskNumerator": 110
      },
      "checks": [
        {
          "id": "recognized-model",
          "label": "Pinned model version",
          "passed": true
        },
        {
          "id": "valid-mass",
          "label": "Valid probability mass",
          "passed": true
        },
        {
          "id": "certificate-match",
          "label": "Exact evidence certificate",
          "passed": false
        },
        {
          "id": "reviewed-fact",
          "label": "Reviewed fact attestation",
          "passed": true
        },
        {
          "id": "policy-date",
          "label": "Fixture policy date",
          "passed": true
        },
        {
          "id": "choice-gate",
          "label": "Refund Choice at least 98%",
          "passed": true
        },
        {
          "id": "noul-gate",
          "label": "Noul support at least 98%",
          "passed": true
        },
        {
          "id": "risk-gate",
          "label": "Expected risk at most 0.05",
          "passed": true
        }
      ],
      "packetPath": "/research/jev-replay/forged-evidence.json",
      "packetSha256": "e2fc81169f058c53195b952aabc4d06c84e8b49e614674794dc8218c3df0c361",
      "transcript": {
        "command": "lake exe bridge <downloaded-packet.json>",
        "packetPath": "/research/jev-replay/forged-evidence.json",
        "exitCode": 0,
        "stdout": "{\"decision\":\"review\",\"policy\":\"synthetic-refund-v1\",\"scope\":\"synthetic reviewed refund fixture only\"}\n",
        "stderr": ""
      }
    },
    {
      "id": "weak-choice",
      "title": "Below the Choice threshold",
      "description": "The evidence still matches, but the refund proposal falls below the illustrative 98% Choice requirement.",
      "change": "Refund probability changes from 99% to 97%; review rises to 2.9%, preserving total probability mass.",
      "decision": "review",
      "metrics": {
        "choiceProbability": 0.97,
        "noulProbability": 0.995,
        "expectedRisk": 0.011,
        "choiceBps": 9700,
        "noulBps": 9950,
        "riskNumerator": 110
      },
      "checks": [
        {
          "id": "recognized-model",
          "label": "Pinned model version",
          "passed": true
        },
        {
          "id": "valid-mass",
          "label": "Valid probability mass",
          "passed": true
        },
        {
          "id": "certificate-match",
          "label": "Exact evidence certificate",
          "passed": true
        },
        {
          "id": "reviewed-fact",
          "label": "Reviewed fact attestation",
          "passed": true
        },
        {
          "id": "policy-date",
          "label": "Fixture policy date",
          "passed": true
        },
        {
          "id": "choice-gate",
          "label": "Refund Choice at least 98%",
          "passed": false
        },
        {
          "id": "noul-gate",
          "label": "Noul support at least 98%",
          "passed": true
        },
        {
          "id": "risk-gate",
          "label": "Expected risk at most 0.05",
          "passed": true
        }
      ],
      "packetPath": "/research/jev-replay/weak-choice.json",
      "packetSha256": "277e073d74fc3a9dc79221b927c7c056617781b38207619d8369f8286a6fdce9",
      "transcript": {
        "command": "lake exe bridge <downloaded-packet.json>",
        "packetPath": "/research/jev-replay/weak-choice.json",
        "exitCode": 0,
        "stdout": "{\"decision\":\"review\",\"policy\":\"synthetic-refund-v1\",\"scope\":\"synthetic reviewed refund fixture only\"}\n",
        "stderr": ""
      }
    },
    {
      "id": "unpinned-model",
      "title": "Unrecognized model identifier",
      "description": "A moving model alias fails the pinned input contract before acceptance is considered.",
      "change": "Model identifier changes from jev-1.14.0 to the unrecognized alias jev-latest.",
      "decision": "invalid",
      "metrics": {
        "choiceProbability": 0.99,
        "noulProbability": 0.995,
        "expectedRisk": 0.011,
        "choiceBps": 9900,
        "noulBps": 9950,
        "riskNumerator": 110
      },
      "checks": [
        {
          "id": "recognized-model",
          "label": "Pinned model version",
          "passed": false
        },
        {
          "id": "valid-mass",
          "label": "Valid probability mass",
          "passed": true
        },
        {
          "id": "certificate-match",
          "label": "Exact evidence certificate",
          "passed": true
        },
        {
          "id": "reviewed-fact",
          "label": "Reviewed fact attestation",
          "passed": true
        },
        {
          "id": "policy-date",
          "label": "Fixture policy date",
          "passed": true
        },
        {
          "id": "choice-gate",
          "label": "Refund Choice at least 98%",
          "passed": true
        },
        {
          "id": "noul-gate",
          "label": "Noul support at least 98%",
          "passed": true
        },
        {
          "id": "risk-gate",
          "label": "Expected risk at most 0.05",
          "passed": true
        }
      ],
      "packetPath": "/research/jev-replay/unpinned-model.json",
      "packetSha256": "c4a91541a53b54942dc7a66471d310c0cfcb9b398c8c455e157119640c9ee07a",
      "transcript": {
        "command": "lake exe bridge <downloaded-packet.json>",
        "packetPath": "/research/jev-replay/unpinned-model.json",
        "exitCode": 2,
        "stdout": "{\"decision\":\"invalid\",\"policy\":\"synthetic-refund-v1\",\"scope\":\"synthetic reviewed refund fixture only\"}\n",
        "stderr": ""
      }
    },
    {
      "id": "elevated-risk",
      "title": "Expected risk exceeds the limit",
      "description": "Strong Choice and Noul support cannot override the fixture's independent risk requirement.",
      "change": "Risk distribution becomes 94% at level 0, 4% at level 1, and 2% at level 2; expected risk becomes 0.08.",
      "decision": "review",
      "metrics": {
        "choiceProbability": 0.99,
        "noulProbability": 0.995,
        "expectedRisk": 0.08,
        "choiceBps": 9900,
        "noulBps": 9950,
        "riskNumerator": 800
      },
      "checks": [
        {
          "id": "recognized-model",
          "label": "Pinned model version",
          "passed": true
        },
        {
          "id": "valid-mass",
          "label": "Valid probability mass",
          "passed": true
        },
        {
          "id": "certificate-match",
          "label": "Exact evidence certificate",
          "passed": true
        },
        {
          "id": "reviewed-fact",
          "label": "Reviewed fact attestation",
          "passed": true
        },
        {
          "id": "policy-date",
          "label": "Fixture policy date",
          "passed": true
        },
        {
          "id": "choice-gate",
          "label": "Refund Choice at least 98%",
          "passed": true
        },
        {
          "id": "noul-gate",
          "label": "Noul support at least 98%",
          "passed": true
        },
        {
          "id": "risk-gate",
          "label": "Expected risk at most 0.05",
          "passed": false
        }
      ],
      "packetPath": "/research/jev-replay/elevated-risk.json",
      "packetSha256": "953c939d80d5b162290db9e07b25dddd83801bae53de94b605486db309c167b8",
      "transcript": {
        "command": "lake exe bridge <downloaded-packet.json>",
        "packetPath": "/research/jev-replay/elevated-risk.json",
        "exitCode": 0,
        "stdout": "{\"decision\":\"review\",\"policy\":\"synthetic-refund-v1\",\"scope\":\"synthetic reviewed refund fixture only\"}\n",
        "stderr": ""
      }
    }
  ]
}
