agentleFS
yezhwiyezhwi/superpowers-engineering-harness/skills/reproduce-finding/SKILL.md

reproduce-finding

Skill3 starsChanged 45 days agoApache-2.0View on GitHub

Reproduce an adversarial finding through the mandatory lifecycle PROPOSED -> REPRODUCING -> CONFIRMED (bug reproduced, test RED) -> FIXING -> FIXED (test GREEN) -> VERIFIED (full regression) -> CLOSED, or REJECTED. Each status has one meaning and its own evidence requirement. No status may skip or shortcut this path.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Mandatory lifecycle: Every finding's status moves only along:

    line 37
  2. Very specific:

    "Could not reproduce" is NOT "rejected": If attempts were made but you cannot deterministically rule the scenario out, leave the finding in …

    line 70
  3. Very specific:

    If no .harness/findings/*.yaml exists, STOP — run adversarial-review first.

    line 84
  4. Distinctive:

    Run it. It MUST fail (red).

    line 121
  5. Very specific:

    Run it RED? Write status: CONFIRMED NOW, with the test path:

    line 126
  6. Very specific:

    Write status: FIXING, implement the minimal fix that makes the failing test pass.

    line 141
  7. Distinctive:

    If you can articulate why the violation cannot occur (existing guard proven by code path, premise contradicts contract), record attempts + …

    line 173

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Reproduce Finding Skill

You are the Finding Reproducer for the Engineering Harness.

Your only job:

PROPOSED finding
    -> REPRODUCING   (write failing test)
    -> test RED      -> CONFIRMED            # bug reproduced, nothing fixed yet
    -> FIXING        (implement minimal fix)
    -> test GREEN    -> FIXED
    -> full regression green -> VERIFIED -> CLOSED
    -> cannot trigger, with recorded attempts -> REJECTED

One status = one meaning:

StatusMeansEvidence
REPRODUCINGattempting reproductionattempts log
CONFIRMEDbug IS real: failing test runs REDtest: path
FIXINGfix in progresswork-in-progress
FIXEDthe failing test now passes GREENsame test path
VERIFIEDClosure policy proof greenevidence reference
CLOSEDverified finding archivedterminal
REJECTEDscenario proven impossibleattempts + reasoning

Hard Boundaries (不得违反)

  1. Mandatory lifecycle. Every finding's status moves only along:

    PROPOSED -> REPRODUCING -> CONFIRMED -> FIXING -> FIXED -> VERIFIED -> CLOSED
                            -> REJECTED

    Forbidden jumps include but are not limited to:

    • PROPOSED -> CONFIRMED (skipping reproduction)
    • REPRODUCING -> CONFIRMED without a RED failing test
    • FIXING -> FIXED while the reproduction test is still red
    • FIXED -> VERIFIED without a full regression run
    • any transition not listed above
  2. Persisted state only. Status lives in the finding's yaml under .harness/findings/. Never change status in conversation/context alone. Each transition must be written to disk.
  3. Each status transition carries exactly its own evidence — no exceptions:

    • REPRODUCING -> CONFIRMED: a failing test that reproduces the scenario ran RED. Nothing more. Do NOT fix anything before CONFIRMED.
    • CONFIRMED -> FIXING: record the regression test path (regression_test.path) — the red test will become the regression test.
    • FIXING -> FIXED: that exact test now runs GREEN.
    • FIXED -> VERIFIED: major findings may use fresh related evidence covering every nonempty impact required_tests entry. Critical findings need the same coverage plus explicit per-finding user approval, or may use full-suite evidence; store evidence reference.
    • VERIFIED -> CLOSED: archive; terminal.

    Writing any status without its evidence is a violation of this skill.

  4. REJECTED requires justification. A rejection must record:
    • concrete reproduction attempts (what you tried, exact inputs/steps)
    • why the scenario cannot occur (guard exists, premise false, etc.)
  5. "Could not reproduce" is NOT "rejected". If attempts were made but you cannot deterministically rule the scenario out, leave the finding in REPRODUCING and surface it to the user. Only reject when you can state WHY the violation is impossible.
  6. Code changes scoped to findings at FIXING or later only. You may write the reproduction test during REPRODUCING, but implementation fixes ONLY after CONFIRMED. No drive-by edits, no refactoring, no style changes.

Inputs

  • .harness/findings/<FND-nnn>.yaml (per-finding records from adversarial-review, all status: PROPOSED)
  • The target codebase and its test suite

If no .harness/findings/*.yaml exists, STOP — run adversarial-review first.

Process

1. Pick a Finding

Work one FND-nnn at a time, critical/major first. Read its target, kind, and scenario.

2. Enter REPRODUCING

Create/update .harness/findings/FND-nnn.yaml:

id: FND-001
target: INV-001
scenario: >
  Two workers pick up the same action_id concurrently; ...
status: REPRODUCING
attempts:
  - described attempt, command/test name, result
test: null              # path to failing test once written
regression_test: {}     # {path: ...} filled at CONFIRMED -> FIXING
fix: null               # commit/files changed once fixed
evidence: null          # regression evidence reference at VERIFIED

3. Write the Failing Test FIRST

Translate the scenario into a deterministic executable test:

  • concurrency scenarios → race under controlled interleaving or repeat N times
  • retry/duplication → invoke the operation twice, assert side effect count
  • crash/recovery → simulate interruption at the stated point
  • boundary input → feed the exact adversarial value

Run it. It MUST fail (red). If it passes on first run:

  • the scenario premise may be false, OR the test doesn't capture the race
  • refine up to 3 times; record each attempt in attempts
  • still green after refinement → go to step 6 (reject with reasoning) or stay

Run it RED? Write status: CONFIRMED NOW, with the test path:

status: CONFIRMED
test: tests/test_recovery.py::test_duplicate_action_single_side_effect
regression_test:
  path: tests/test_recovery.py::test_duplicate_action_single_side_effect
confirmed_at: <ISO timestamp>

The bug is now confirmed-real and NOT yet fixed. If refinement stays green, go to step 6 (reject) or stay REPRODUCING and surface to the user.

4. Fix (only after CONFIRMED)

Write status: FIXING, implement the minimal fix that makes the failing test pass. No unrelated changes. Run the test — green → status: FIXED.

Any regression failure later → back to FIXING; iterate.

5. Closure Proof + VERIFIED

Adversarial related closure supports native batches:

harness finding transition FND-nnn VERIFIED --evidence batch-a.json --evidence batch-b.json

All 2–64 receipts must independently prove successful actual execution at the current HEAD/workspace; union covers all nonempty impact required_tests. Each file <=4 MiB, total <=16 MiB. One stale/invalid/unsupported member refuses the whole request. The Finding stores closure_evidence references and original-byte digests, not a synthesized test_execution. Gate reopens every member for VERIFIED/CLOSED; no manual aggregate receipt, old-proof editing or coverage-only claim.

Critical related closure requires existing Finding-level user approval for both single receipts and batches; --critical-related-approved writes the candidate approval before validation. Approval requires mode: related, critical_related_approved: true, source: user, and a nonempty string approved_at. Major related closure does not read/require closure; legacy full-suite single proof does not require related approval. Nonempty approved_at has no extra recency requirement; approval is not bound to the digest set. Gate also rejects historical single-receipt VERIFIED/CLOSED critical related proof without valid approval on re-evaluation. Do not fabricate approval, rewrite old receipts, or grandfather missing approval; terminal proof maintenance remains a separate explicitly authorized workflow. Single-proof loading and evidence formats are otherwise unchanged. Batch proof does not replace separate RED/GREEN. Other lifecycle targets/diagnosability reject repeated evidence. VERIFIED -> CLOSED with no evidence arguments retains the same batch; do not resubmit or synthesize proof.

Choose proof from persisted policy: full-suite impact is advisory. Major findings may use related evidence only when structured covered_tests contains every nonempty impact required_tests entry. Critical related closure additionally requires explicit per-finding user approval. All required proof green → write to the finding file:

status: VERIFIED
fix: "guard action_id with per-id lock"
evidence: .harness/evidence/<evidence-file>
verified_at: <ISO timestamp>

Then archive: status: CLOSED.

Any regression failure → status: FIXING, iterate on the fix.

6. Reject (only with proof of impossibility)

If you can articulate why the violation cannot occur (existing guard proven by code path, premise contradicts contract), record attempts + reason:

status: REJECTED
rejection_reason: >
  Idempotency guard at src/worker.py:42 rejects duplicate action_id before
  dispatch; attempts FND-001-a/b both blocked there.
attempts: [...]

Cannot rule it out → keep REPRODUCING, report to user.

Outputs (complete list)

FileAction
.harness/findings/FND-nnn.yamlcreated/updated per finding
failing testwritten during REPRODUCING
fixonly at FIXING (post-CONFIRMED)
business codeonly within confirmed-finding scope

Self-check before finishing

  • Every status change persisted to disk?
  • No forbidden jumps (PROPOSED→CONFIRMED, REPRODUCING→CONFIRMED without chain)?
  • CONFIRMED means test RED only (nothing fixed yet)?
  • FIXED means that exact test GREEN?
  • VERIFIED backed by policy-required fresh closure evidence?
  • Every REJECTED has attempts + impossibility reasoning?
  • Unresolved findings left in REPRODUCING and surfaced?
  • Code changes limited to confirmed findings' scope?

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.