{
  "component": "receipt-check",
  "baseCommit": "65995c0a126daa60e498acca1ff0e408bf842048",
  "changedPaths": [
    "receipt-check/audit.py",
    "receipt-check/README.md",
    "receipt-check/tests/test_audit.py"
  ],
  "oldBehavior": "The byte auditor applied a fixed, inclusive 100000-sat fee cap and omitted the measured fee when it rejected a payment on fee grounds.",
  "newBehavior": "The offline caller can set an inclusive cap with --max-fee-sats or the max_fee_sats audit() keyword. The default is 100000 sats. The CLI accepts only ASCII decimal digits and the Python API requires a nonnegative int, excluding booleans. Receipt v1 rejects extra fields, including attempted overrides. Fixed mainnet address and script checks still apply. The report includes the applied max_fee_sats and, when measurable, fee_sats computed from raw funding and spend amounts, including on fee-policy failure.",
  "checks": [
    {"command": "python3 -B -m unittest discover -s receipt-check/tests -v", "phase": "baseline", "exitCode": 0, "reported": "17 tests passed."},
    {"command": "python3 -B -m unittest discover -s receipt-check/tests -v", "phase": "after change", "exitCode": 0, "reported": "21 tests passed. Generated spend bytes exercise zero, tighter, default and looser caps at equality and one satoshi above. Coverage includes malformed CLI and API caps, receipt override rejection and preserved address checks."},
    {"command": "python3 -B receipt-check/audit.py --mode synthetic receipt-check/tests/synthetic_pass.json", "exitCode": 0, "reported": "PASS, max_fee_sats 100000, fee_sats 1000."},
    {"command": "python3 -B receipt-check/audit.py --mode regtest --max-fee-sats 1000 receipt-check/tests/regtest_synthetic_pass.json", "exitCode": 0, "reported": "PASS, max_fee_sats 1000, fee_sats 1000."},
    {"command": "python3 -B receipt-check/audit.py --mode regtest --max-fee-sats 999 receipt-check/tests/regtest_synthetic_pass.json", "exitCode": 1, "reported": "Expected FAIL (excessive fee), max_fee_sats 999, fee_sats 1000."},
    {"command": "git diff --check", "exitCode": 0, "reported": "No whitespace errors."},
    {"command": "git add -- receipt-check/audit.py receipt-check/README.md receipt-check/tests/test_audit.py", "exitCode": 128, "reported": "Could not create .git/index.lock because the Git metadata filesystem is read-only. Source remains in the working tree."},
    {"status": "skipped", "check": "Staged diff and commit", "reason": "Git staging was blocked by read-only metadata."},
    {"status": "skipped", "check": "Live node regtest, mainnet verification and search, transaction signing and broadcast, unrelated repository tests", "reason": "This item covers the offline receipt auditor. Regtest coverage used serialized fixture bytes."}
  ],
  "measurements": {
    "baselineTestsPassed": 17,
    "updatedTestsPassed": 21,
    "updatedSuiteSeconds": 0.897,
    "regtestFixtureInputSats": 300000,
    "regtestFixturePaidSats": 299000,
    "regtestFixtureFeeSats": 1000
  },
  "evidence": {
    "regtestFixture": "receipt-check/tests/regtest_synthetic_pass.json",
    "regtestFixtureTxid": "0f9ea4b65c18bba209664dd4c229fdd7fd8c48629597bddbd87c30328bf4a7f9",
    "generatedFeeTests": "receipt-check/tests/test_audit.py",
    "regtestFixtureUnspentStatus": "NOT ESTABLISHED",
    "regtestFixtureConfirmation": "NOT ESTABLISHED"
  },
  "limitations": [
    "The auditor establishes consistency of supplied bytes and snapshot under the selected policy. Chain state, consensus spendability and confirmation require separate evidence.",
    "The component reads receipts and reports audit results. Transaction creation, signing and transmission are outside its scope."
  ],
  "replay": {
    "cwd": "repository root",
    "command": "python3 -B receipt-check/audit.py --mode regtest --max-fee-sats 1000 receipt-check/tests/regtest_synthetic_pass.json",
    "expected": {"exitCode": 0, "verdict": "PASS", "max_fee_sats": 1000, "fee_sats": 1000},
    "rejectionCommand": "python3 -B receipt-check/audit.py --mode regtest --max-fee-sats 999 receipt-check/tests/regtest_synthetic_pass.json",
    "expectedRejection": {"exitCode": 1, "verdict": "FAIL", "max_fee_sats": 999, "fee_sats": 1000}
  },
  "objectiveStatus": "INCOMPLETE"
}
