Auto-repair loop (bounded)
auto_repair_loopScans a TouchDesigner subtree for cook errors, routes each cluster to the appropriate fix, re-checks, and iterates until clean or stalled. Dry-run by default for planning.
Instructions
Driver: scan a subtree for cook errors, cluster them, route each cluster to the right fix (calls repair_network for structural/expression/flag issues; surfaces fix_shader / fix_reactivity as prompt hand-offs the agent must execute next turn), re-check, and iterate until clean, no-progress (stalled), or max_iterations (exhausted). Dry-run by default — one planning iteration, no writes. The loop CANNOT fix shaders or dead reactivity itself; it points the agent at them via recommended_prompts. Returns {status, iterations[], errors_before, errors_after, remaining[], recommended_prompts[], warnings}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Root of the subtree to scan + repair. | /project1 |
| max_iterations | No | Hard cap on outer iterations — each iteration = one scan + one route + one apply. | |
| dry_run | No | When true (default), PLAN routes only (no writes). Propagated to repair_network; the loop runs exactly one iteration in dry-run mode. | |
| allowed_fixers | No | Subset of fixers the loop may route to. Drop 'repair_network' to make the loop advisory only (prompts + remaining, no writes). | |
| min_progress | No | Convergence threshold — if an iteration clears fewer than this many errors, the loop stops (stalled). | |
| include_warnings | No | When true, treat 'warning' severity errors as in-scope. Default ignores warnings (no-op until the bridge surfaces severity). |