Skip to main content

Documentation Index

Fetch the complete documentation index at: https://gump.build/docs/llms.txt

Use this file to discover all available pages before exploring further.

Bugfix

Reproduce first, then fix.

When to use

When you have a bug report and want to enforce the “reproduce first, fix second” discipline. The workflow ensures a regression test exists before the fix is implemented.
gump run bugfix --spec bug-report.md

The workflow

name: bugfix
max_budget: 3.00

steps:
  - name: analyze
    type: split
    get:
      prompt: |
        Analyze this bug report. Identify the root cause.
        Produce a single task with the reproduction strategy and affected files.
    run:
      agent: claude-sonnet
    gate: [schema]
    each:
      - name: reproduce
        type: code
        get:
          prompt: |
            Write a test that reproduces this bug: {task.description}
        run:
          agent: claude-haiku
          guard:
            max_turns: 30
        gate: [compile, tests_found]
        retry:
          - attempt: 2
            agent: claude-sonnet
          - exit: 3

      - name: patch
        type: code
        get:
          session: from: reproduce
          prompt: |
            Fix the bug. The reproduction test must pass.
            Only modify: {task.files}
        run:
          agent: claude-haiku
          guard:
            max_turns: 40
        gate: [compile, test]
        retry:
          - attempt: 3
            agent: claude-sonnet
          - exit: 4

  - name: quality
    gate: [compile, test]

How it works

The “reproduce” step writes a test that exposes the bug — the gate checks that code compiles and tests exist, but not that tests pass (the bug is still present). The “patch” step reuses the session (session: from: reproduce) and fixes the bug. The compile + test gate verifies all tests pass, including the reproduction test.

Typical metrics

The cheapest workflow. Average cost: 0.200.20–0.80. Duration: 30s–2 minutes.

Customize

Add untouched: "*_test.*" to the patch gate.
Add context: [bash: "git log --oneline -20"] to the analyze step.