Reproduce Bug
When to Use
Use for the reproduction step of patching-bugs with one finding.json and a local
baseline checkout. Read the record contract.
Before target commands, follow its project guidance.
When NOT to Use
Do not use for bug discovery, patching, or a claim that cannot be exercised locally.
Report a blocker when the build or environment cannot exercise the claim.
Procedure
Select failure_type from the record contract. Build the current baseline with the
project's own command. Exercise the planned scoped inputs before any edit and
retain their observations, including valid controls. Save raw stdout, stderr,
exit status, and timing. If the behavior is absent with trustworthy evidence,
report not_reproduced; if setup or observations are unreliable, report blocked.
Runtime: exercise the built target_artifact with a PoC that records PATCH_LOADED
as defined in the contract, then prints PATCH_REACHED immediately before the assertion.
Exit nonzero for the bug, zero otherwise; a setup crash is inconclusive.
Compile: record the target expected_diagnostic from the failed compiler invocation;
use empty poc_argv and null target_artifact.
Save any unchanged PoC source under reproduce/poc/ and raw receipts
under reproduce/receipts/. Write reproduce.json with the baseline commit,
command argument arrays, artifact path, observed result, outcome, and your agent
identity. Set finding.status to reproduced or not_reproduced from the result.
If reproduction is blocked, leave finding.status as hypothesis.
Reproduce record schema:
{
"schema_version": 1,
"failure_type": "runtime",
"outcome": "reproduced",
"baseline_commit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"build_argv": ["python", "build.py"],
"poc_argv": ["python", "poc.py"],
"target_artifact": "dist/app.py",
"observed": "The PoC wrote outside uploads after PATCH_REACHED.",
"blocker": null,
"agent": "reproducer-1"
}
- Manifest the complete
reproduce/ directory, including the PoC and record, using
the record helper: run
uv run --no-project <script> manifest <reproduce-step-dir>. Then check the
record before handoff. State blocked with the actual failure when build or setup
prevents a valid run.
Rationalizations to Reject
| Shortcut |
Required action |
| A unit test imitates the bug. |
Exercise the target compiler or built runtime artifact. |
| A nonzero exit proves reproduction. |
Require the target diagnostic, or runtime marker and assertion. |
1---2name: reproduce-bug3description: Use when a named runtime or compiler bug in a local repository needs independent reproduction.4metadata:5 source: https://skillmd.com/skills/trailofbits/reproduce-bug6---78# Reproduce Bug910## When to Use1112Use for the reproduction step of `patching-bugs` with one `finding.json` and a local13baseline checkout. Read the [record contract](../../references/records.md).14Before target commands, follow its [project guidance](../../references/records.md#project-guidance).1516## When NOT to Use1718Do not use for bug discovery, patching, or a claim that cannot be exercised locally.19Report a blocker when the build or environment cannot exercise the claim.2021## Procedure22231. Select `failure_type` from the record contract. Build the current baseline with the24 project's own command. Exercise the planned scoped inputs before any edit and25 retain their observations, including valid controls. Save raw stdout, stderr,26 exit status, and timing. If the behavior is absent with trustworthy evidence,27 report `not_reproduced`; if setup or observations are unreliable, report `blocked`.282. Runtime: exercise the built `target_artifact` with a PoC that records `PATCH_LOADED`29 as defined in the contract, then prints `PATCH_REACHED` immediately before the assertion.30 Exit nonzero for the bug, zero otherwise; a setup crash is inconclusive.31 Compile: record the target `expected_diagnostic` from the failed compiler invocation;32 use empty `poc_argv` and null `target_artifact`.333. Save any unchanged PoC source under `reproduce/poc/` and raw receipts34 under `reproduce/receipts/`. Write `reproduce.json` with the baseline commit,35 command argument arrays, artifact path, observed result, outcome, and your agent36 identity. Set `finding.status` to `reproduced` or `not_reproduced` from the result.37 If reproduction is `blocked`, leave `finding.status` as `hypothesis`.3839 [Reproduce record schema](../../schemas/reproduce.schema.json):40```json41{42 "schema_version": 1,43 "failure_type": "runtime",44 "outcome": "reproduced",45 "baseline_commit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",46 "build_argv": ["python", "build.py"],47 "poc_argv": ["python", "poc.py"],48 "target_artifact": "dist/app.py",49 "observed": "The PoC wrote outside uploads after PATCH_REACHED.",50 "blocker": null,51 "agent": "reproducer-1"52}53```54554. Manifest the complete `reproduce/` directory, including the PoC and record, using56 the [record helper](../../scripts/records.py): run57 `uv run --no-project <script> manifest <reproduce-step-dir>`. Then check the58 record before handoff. State `blocked` with the actual failure when build or setup59 prevents a valid run.6061## Rationalizations to Reject6263| Shortcut | Required action |64| --- | --- |65| A unit test imitates the bug. | Exercise the target compiler or built runtime artifact. |66| A nonzero exit proves reproduction. | Require the target diagnostic, or runtime marker and assertion. |