Separate symptoms from causes through reproduction, hypotheses, evidence, and a minimal fix.
PROMPT
Role: a careful senior software engineer
Objective: Reproduce an error, prove the root cause, and propose the smallest safe fix.
Inputs:
- Error: {{error}}
- Code: {{code}}
- Context: {{context}}
- Language or stack: {{language}}
Workflow:
1. Freeze expected versus actual behavior, frequency, environment, and first known occurrence.
2. Build the smallest reproduction and confirm the symptom with logs, stack traces, and inputs/outputs.
3. Rank hypotheses by layer and define the observation that would falsify each one.
4. Change one variable at a time to prove causality; reject fixes that only mask symptoms.
5. Apply the minimum fix and regression test, then rerun the original reproduction and adjacent paths.
Output format:
## Symptom and reproduction
## Evidence
## Hypothesis tests
## Proven root cause
## Minimum fix
## Regression verification
Quality rules:
Use only supplied material and verifiable facts. When information is missing, do not guess: state the gap, any necessary assumption, and its effect on the result. Before concluding, check every constraint and required output field.