# Track Specification: Robust JSON Parsing for Tech Lead (robust_json_parsing_tech_lead_20260302)

## Overview
In `conductor_tech_lead.py`, the `generate_tickets` function relies on a generic `try...except` block to parse the LLM's JSON ticket array. If the Tier 2 model hallucinates or outputs invalid JSON, it silently returns an empty array `[]`, causing the GUI track creation process to fail silently. This track adds an auto-retry loop that catches `JSONDecodeError` and feeds the traceback back to the LLM for self-correction.

## Architectural Constraints
- **Max Retries**: The retry loop MUST have a hard cap (e.g., 3 retries) to prevent infinite loops and runaway API costs.
- **Error Injection**: The error message fed back to the LLM must include the specific `JSONDecodeError` trace and the raw string it attempted to parse.

## Functional Requirements
- Modify `generate_tickets` in `conductor_tech_lead.py` to wrap the `ai_client.send` call in a retry loop.
- If `json.loads()` fails, construct a corrective prompt (e.g., "Your previous output failed to parse as JSON: {error}. Here was your output: {raw_text}. Please fix the formatting and output ONLY valid JSON.")
- Send the corrective prompt via a new `ai_client.send` turn within the same session.
- Abort and raise a structured error if the max retry count is reached.

## Acceptance Criteria
- [ ] `generate_tickets` includes a `while` loop with a max retry cap.
- [ ] Invalid JSON responses automatically trigger a corrective reprompt to the model.
- [ ] Unit tests exist that use `unittest.mock` on the AI client to simulate 1 failure followed by 1 success, asserting the final valid parse.
- [ ] Unit tests exist simulating repeated failures hitting the retry cap.