# Lens: Flakiness Auditor

Analyze the tests for timing dependencies and non-deterministic behavior.

## Checklist

### 1. Arbitrary Sleeps
*   **❌ Flag:** `setTimeout`, `sleep(100)`, `time.Sleep(time.Second)`.
*   **Why:** Fast machines fail, slow machines wait too long. It is a "guess" at timing.
*   **Fix:** Use condition-based waiting (e.g., `waitFor(() => condition)`).

### 2. Global State Mutation
*   **❌ Flag:** Tests that modify global variables, environment variables, or singleton states without cleanup.
*   **Why:** Causes order-dependent failures.
*   **Fix:** Use `beforeEach`/`afterEach` or generate unique IDs per test.

### 3. Unmocked Network/IO
*   **❌ Flag:** Tests that make real network calls or write to system-wide paths (e.g., `/tmp/test`).
*   **Why:** External failures cause test flakiness.
*   **Fix:** Mock network boundaries or use isolated temp directories.
