Fix the auth bug in auth.ts
Debug and resolve authentication failures in auth.ts until the issue is resolved.
Use this when
You have a reproducible authentication failure isolated to one file and a test or manual check that proves when it is fixed. Best for a known-bad symptom (a failing login, a rejected token) rather than open-ended "make auth better" work.
Done when
✓ Exit on the specific auth test or reproduction case passing, not on the agent asserting the fix. Re-run the full suite before merging — auth changes routinely break session and middleware tests that the loop never looked at. If the cap is hit, treat the run as a failed diagnosis and read the diff before rerunning.
Why it works
A ralph-style loop re-reads the file and its failure output on every pass, so each attempt starts from the current state rather than a stale plan. The --max-iterations 10 cap is what makes it safe to leave running: a bug that resists ten passes is a design problem, not a typo, and it should surface to you instead of burning more turns.
Source: pedromeneres ↗graded C · 55/100 — how grades work →
More debugging loops
Memory leak hunt
Drive a suspected memory leak to ground: reproduce growth under a repeated workload, capture heap snapshots, and fix the retention until memory stays flat.
Rewrite every user-facing error
Inventory user-visible errors, replace internal or confusing text, and prove each reachable error state reads clearly.