### ERROR FIXING PROMPT

You were given:

- A full code diff (unified diff format, with row numbers, file headers, and all metadata).
- Your previous JSON response describing change groups (available above in the conversation history).

Your task was to identify groups of changes from the original diff.

YOUR PREVIOUS RESPONSE CONTAINED ERRORS THAT NEED TO BE FIXED. ANALYZE THE ERRORS BELOW AND PRODUCE A NEW GROUPS DESCRIPTION THAT FIXES THEM, STRICTLY FOLLOWING THE REQUIRED JSON SCHEMA AND THE ORIGINAL SYSTEM RULES.

---

### INSTRUCTIONS

1. Error Analysis: Carefully read and understand each error described below.
2. Diff Context Review: Examine the specific diff sections mentioned by each error.
3. Root Cause Identification: Identify why each error occurred in your previous response.
4. Recreate Groups Description: Recreate the full groups description.
   - Reuse the correct parts of your previous response verbatim where they are valid.
   - Fix only the erroneous/missing parts and add any missing information.
5. Adhere to Original Rules: All rules from the original system prompt for grouping still apply (functional grouping, splitting within files, separation of concerns, importance scoring, ordering, summary wording, and “What not to do”).
6. Quality Assurance: Double‑check that your new response fixes all errors, follows the schema, and remains internally consistent.

---

### ERRORS TO FIX

The following errors were found in your previous response with their specific diff context:

{errors}

---

### RESPONSE FORMAT (JSON)

CRITICAL: Your entire response must be a single valid JSON object, with no markdown fences and no extra text.

{
  "summary": "[One‑sentence global summary of all changes.]",
  "preliminary_analysis": {
    "reasoning": "[Short step-by-step reasoning of preliminary group selection and subdivision decisions.]"
  },
  "groups": [
    {
      "group_id": 1,
      "title": "Set 'MAX_RETRIES' to 5 in Payment API",
      "importance": 0.8,
      "summary": "Set higher retry limit to align with gateway SLA.",
      "reasoning": "Updates 'MAX_RETRIES' constant from 3→5 to align with gateway SLA.<br>Prevents duplicate payment attempts and ensures retry consistency.",
      "files": [
        {
          "path": "src/payment/config.py",
          "summary": "Increases 'MAX_RETRIES' to 5 to prevent gateway overload; located in src/payment/config.py.",
          "importance": 0.7
        },
        {
          "path": "tests/payment/test_retries.py",
          "summary": "Adjusts test for new 'MAX_RETRIES' limit; Fail → Pass after update.",
          "importance": 0.3
        }
      ]
    },
    {
      "group_id": 2,
      "title": "Add 'AuthTokenExpiredException' handling in 'AuthFilter'",
      "importance": 0.9,
      "summary": "Handle expired tokens to prevent unauthorized access.",
      "reasoning": "Introduces exception handling for expired tokens in 'AuthFilter'.Prevents unauthorized access and ensures proper re-authentication flow.",
      "files": [
        {
          "path": "src/auth/AuthFilter.java",
          "summary": "Implements handling for 'AuthTokenExpiredException' in authentication filter chain; improves session security.",
          "importance": 0.9
        }
      ]
    }
  ]
}

---

### CRITICAL REQUIREMENTS

- Provide only the JSON response, no explanations or additional text.
- Ensure that all listed errors are fixed.
- Follow the grouping rules from the original system prompt (do not invent files or changes; split files by distinct problems; separate core logic, configuration, and UI; assign and order by importance; summarize functionality first, then location).
