version: 1
id: bugfix-diagnostic-loop
title: Bugfix Diagnostic Loop
inputs:
  input: Bug report, failing behavior or regression.
max_iterations: 3
nodes:
  - id: reproduce
    action: skill
    skill: execution-discipline
    description: Reproduce the failure with a test, script, command or fixture.
  - id: inspect
    action: skill
    skill: code-intelligence
    description: Map affected files and callers before editing.
  - id: change
    action: stage
    stage: execution
    description: Apply the smallest behavior-preserving fix.
  - id: test
    action: command
    command: sdd eval stage --name {input} --stage execution --json
    description: Run fresh verification and capture evidence.
  - id: review
    action: stage
    stage: review
    description: Review the diff and evidence.
edges:
  - from: reproduce
    to: inspect
  - from: inspect
    to: change
  - from: change
    to: test
  - from: test
    to: review
  - from: review
    to: reproduce
    condition: failed
