Prove Patch
Use the original baseline, final patch commit, declared repair_scope, and unchanged
reproduction package. Read the record contract. Do not
edit the patch or validate an uncommitted tree. Return failures for a new attempt.
Before target commands, follow its project guidance.
- Review the scoped cases and the patch without the patcher's conclusion. Execute
each planned input on clean baseline and patched trees with the same retained
harness source and command. The harness must print exactly one
PATCH_CASE {"input": ..., "actual": ...} from the exercised input and observed
result, then print PATCH_REACHED as its final stdout line immediately before
the assertion. Representatives must fail on the
baseline and pass on the patch. Valid controls must pass on both. Keep the
baseline and patched stdout, stderr, exit status, elapsed time, command, and
harness source under receipts/. A timeout, setup failure, missing marker,
mismatched input, or ambiguous observation is an evidence gap. A trustworthy
patched failure is a finding. Never relabel a gap as a pass.
- Run relevant project checks on the patch and retain the same raw receipts. Use
baseline comparison for behavior checks and to attribute failed project checks;
a passing patched suite may omit a baseline run. Include focused tests, regression
and security checks where relevant. Record specific unproven limits; an empty
list leaves the result inconclusive.
- Run the three-arm helper with the proof-type recipe in
the record contract,
reproduce.baseline_commit, and final patch_commit.
Require the baseline to fail, patch to pass, and complete baseline revert to
fail again. Require receipts/source.json to identify the pinned commits and
the reverted tree to equal the original baseline tree. Require the type's build
identity result. Retain all source-tree,
build, and execution receipts.
- Write
prove.json and a final manifest covering it and every receipt. Run
uv run --no-project <script> manifest <prove-attempt-dir> and then
uv run --no-project <script> check <run-dir> with the validator.
Independently inspect the native proof assessment
and raw receipts before reporting a result. A complete proof has no findings or
gaps. Return exact failures and receipt paths to the orchestrator.
Prove record schema:
{
"schema_version": 2,
"attempt": 1,
"failure_type": "runtime",
"baseline_commit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"patch_commit": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"reverted": "pass",
"build_identity": "pass",
"hashes": {
"baseline": "1111111111111111111111111111111111111111111111111111111111111111",
"patched": "2222222222222222222222222222222222222222222222222222222222222222",
"reverted": "1111111111111111111111111111111111111111111111111111111111111111"
},
"reverted_hash_note": null,
"cases": [{
"check_id": "reported-input",
"argv": ["python", "receipts/case.py", "reported-input"],
"source": "receipts/case.py",
"runs": {
"baseline": {"exit_code": 1, "elapsed_ms": 15, "stdout": "receipts/case-base.stdout", "stderr": "receipts/case-base.stderr"},
"patched": {"exit_code": 0, "elapsed_ms": 14, "stdout": "receipts/case-patched.stdout", "stderr": "receipts/case-patched.stderr"}
}
}],
"project_checks": [{
"check_id": "focused-suite",
"kind": "suite",
"argv": ["pytest", "tests/test_upload.py"],
"baseline": null,
"patched": {"exit_code": 0, "elapsed_ms": 860, "stdout": "receipts/suite.stdout", "stderr": "receipts/suite.stderr"}
}],
"unproven": ["Inputs outside the declared boundary were not assessed."],
"agent": "prover-1"
}
For a bounded class, include at least two distinct failing representatives and a
valid control. The record must cover every planned case by unique check_id.
Use the same harness and command on both commits; do not reveal the side to the
harness or change expectations by side. Review the selected cases for relevance;
retained receipts establish only what those cases exercised.
1---2name: prove-patch3description: Use when a local security patch commit needs independent scoped and three-arm proof.4metadata:5 source: https://skillmd.com/skills/trailofbits/prove-patch6---78# Prove Patch910Use the original baseline, final patch commit, declared `repair_scope`, and unchanged11reproduction package. Read the [record contract](../../references/records.md). Do not12edit the patch or validate an uncommitted tree. Return failures for a new attempt.13Before target commands, follow its [project guidance](../../references/records.md#project-guidance).14151. Review the scoped cases and the patch without the patcher's conclusion. Execute16 each planned input on clean baseline and patched trees with the same retained17 harness source and command. The harness must print exactly one18 `PATCH_CASE {"input": ..., "actual": ...}` from the exercised input and observed19 result, then print `PATCH_REACHED` as its final stdout line immediately before20 the assertion. Representatives must fail on the21 baseline and pass on the patch. Valid controls must pass on both. Keep the22 baseline and patched stdout, stderr, exit status, elapsed time, command, and23 harness source under `receipts/`. A timeout, setup failure, missing marker,24 mismatched input, or ambiguous observation is an evidence gap. A trustworthy25 patched failure is a finding. Never relabel a gap as a pass.262. Run relevant project checks on the patch and retain the same raw receipts. Use27 baseline comparison for behavior checks and to attribute failed project checks;28 a passing patched suite may omit a baseline run. Include focused tests, regression29 and security checks where relevant. Record specific unproven limits; an empty30 list leaves the result inconclusive.313. Run the [three-arm helper](../../scripts/arms.py) with the proof-type recipe in32 the record contract, `reproduce.baseline_commit`, and final `patch_commit`.33 Require the baseline to fail, patch to pass, and complete baseline revert to34 fail again. Require `receipts/source.json` to identify the pinned commits and35 the reverted tree to equal the original baseline tree. Require the type's build36 identity result. Retain all source-tree,37 build, and execution receipts.384. Write `prove.json` and a final manifest covering it and every receipt. Run39 `uv run --no-project <script> manifest <prove-attempt-dir>` and then40 `uv run --no-project <script> check <run-dir>` with the [validator](../../scripts/records.py).41 Independently inspect the [native proof assessment](../../scripts/native_proof.py)42 and raw receipts before reporting a result. A complete proof has no findings or43 gaps. Return exact failures and receipt paths to the orchestrator.4445[Prove record schema](../../schemas/prove.schema.json):46```json47{48 "schema_version": 2,49 "attempt": 1,50 "failure_type": "runtime",51 "baseline_commit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",52 "patch_commit": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",53 "reverted": "pass",54 "build_identity": "pass",55 "hashes": {56 "baseline": "1111111111111111111111111111111111111111111111111111111111111111",57 "patched": "2222222222222222222222222222222222222222222222222222222222222222",58 "reverted": "1111111111111111111111111111111111111111111111111111111111111111"59 },60 "reverted_hash_note": null,61 "cases": [{62 "check_id": "reported-input",63 "argv": ["python", "receipts/case.py", "reported-input"],64 "source": "receipts/case.py",65 "runs": {66 "baseline": {"exit_code": 1, "elapsed_ms": 15, "stdout": "receipts/case-base.stdout", "stderr": "receipts/case-base.stderr"},67 "patched": {"exit_code": 0, "elapsed_ms": 14, "stdout": "receipts/case-patched.stdout", "stderr": "receipts/case-patched.stderr"}68 }69 }],70 "project_checks": [{71 "check_id": "focused-suite",72 "kind": "suite",73 "argv": ["pytest", "tests/test_upload.py"],74 "baseline": null,75 "patched": {"exit_code": 0, "elapsed_ms": 860, "stdout": "receipts/suite.stdout", "stderr": "receipts/suite.stderr"}76 }],77 "unproven": ["Inputs outside the declared boundary were not assessed."],78 "agent": "prover-1"79}80```8182For a bounded class, include at least two distinct failing representatives and a83valid control. The record must cover every planned case by unique `check_id`.84Use the same harness and command on both commits; do not reveal the side to the85harness or change expectations by side. Review the selected cases for relevance;86retained receipts establish only what those cases exercised.