{% set language = instance.repo_language | default('python') %}
I've uploaded a {{ language }} repository in the directory {{ workspace_path }}.

<issue>
{{ instance.problem_statement }}
</issue>

Implement the necessary changes to non-test files in {{ workspace_path }} to resolve this issue.

Follow this root-cause analysis process:

Step 1 — Understand the Symptom
  Read the issue carefully. Identify:
  a) The observable symptom (error, wrong behavior, crash)
  b) The context in which it occurs (what operation, what inputs)
  c) Any error messages or stack traces

Step 2 — Trace Backwards from the Symptom
  Don't start fixing at the symptom. Instead, trace backwards:
  a) Find the line where the error/wrong behavior occurs
  b) Ask: "What upstream code produced the state that caused this?"
  c) Follow the data flow backwards through the call chain
  d) At each level, ask: "Is this code correct given its contract? Or is it receiving bad input from further upstream?"
  e) Continue until you find the point where the code's actual behavior first diverges from its intended behavior

Step 3 — Understand the Original Intent
  For the code containing the root cause:
  a) Use git blame to find when the code was written/last modified
  b) Use git log to find the commit message and PR context
  c) Read surrounding code and comments to understand the original design
  d) Ask: "What did the author intend? What assumption was violated?"

Step 4 — Determine the Correct Fix
  With root cause and original intent understood:
  a) Identify the minimal change that corrects the root cause
  b) Ensure the fix respects the original design intent
  c) Check if the same type of bug exists elsewhere in similar code
  d) Consider edge cases: will the fix work for all valid inputs?

Step 5 — Implement and Verify
  a) Make the minimal, targeted fix
  b) Run relevant tests to verify
  c) Check for regressions in related functionality