reproduce-bug

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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.
用于
patching-bugs
的复现阶段,配合一份
finding.json
和本地基线检出副本。阅读记录契约。 执行目标命令前,遵循其中的项目指南。

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.
不用于发现缺陷、修补缺陷,或验证无法在本地演练的主张。 如果构建或环境无法验证该主张,请报告 blocker。

Procedure

操作步骤

  1. 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
    .
  2. 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
    .
  3. 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:
json
{
  "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"
}
  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.
  1. 按照记录契约选择
    failure_type
    。使用项目自身的命令构建当前基线。在进行任何编辑前,演练计划范围内的输入,并保留观察结果,包括有效对照项。保存原始 stdout、stderr、退出状态和耗时。如果有可信证据表明未出现该行为,则报告
    not_reproduced
    ;如果设置过程或观察结果不可靠,则报告
    blocked
    。
  2. 运行时:使用 PoC 演练已构建的
    target_artifact
    ,按契约定义记录
    PATCH_LOADED
    ,然后在断言前立即输出
    PATCH_REACHED
    。出现缺陷时以非零状态退出,否则以零状态退出;设置过程崩溃时无法得出结论。 编译器:从失败的编译器调用中记录目标
    expected_diagnostic
    ;使用空的
    poc_argv
    和 null
    target_artifact
    。
  3. 将任何未经修改的 PoC 源代码保存在
    reproduce/poc/
    下,并将原始回执保存在
    reproduce/receipts/
    下。编写
    reproduce.json
    ,其中包含基线提交、命令参数数组、制品路径、观察结果、结果和 Agent 身份。根据结果将
    finding.status
    设置为
    reproduced
    或
    not_reproduced
    。 如果复现结果为
    blocked
    ,则将
    finding.status
    保持为
    hypothesis
    。
    复现记录 Schema:
json
{
  "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"
}
  1. 使用记录辅助脚本为完整的
    reproduce/
    目录生成清单,其中应包含 PoC 和记录:运行
    uv run --no-project <script> manifest <reproduce-step-dir>
    。然后在交付前检查记录。如果构建或设置过程导致无法进行有效运行,请说明
    blocked
    及实际失败情况。

Rationalizations to Reject

应拒绝的简化做法

ShortcutRequired 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.
简化做法必须采取的操作
使用单元测试模拟缺陷。演练目标编译器或已构建的运行时制品。
以非零退出状态证明已复现。必须获取目标诊断,或运行时标记和断言。