{
  "$schema": "../../../schemas/corpus-labels.schema.json",
  "schemaVersion": "1.0.0",
  "tag": "manual-wait",
  "samples": [
    {
      "file": "violating/redundant-expect-poll.spec.ts",
      "label": "violating",
      "language": "ts",
      "framework": "playwright",
      "rationale": "subCase=redundant — waitForTimeout before expect.poll",
      "expectedFindings": [{ "line": 5, "tag": "manual-wait", "subCase": "redundant" }]
    },
    {
      "file": "violating/redundant-waitForSelector.spec.ts",
      "label": "violating",
      "language": "ts",
      "framework": "playwright",
      "rationale": "subCase=redundant — waitForTimeout before waitForSelector",
      "expectedFindings": [{ "line": 5, "tag": "manual-wait", "subCase": "redundant" }]
    },
    {
      "file": "violating/stale-read-evaluate.spec.ts",
      "label": "violating",
      "language": "ts",
      "framework": "playwright",
      "rationale": "subCase=stale-read — waitForTimeout before page.evaluate",
      "expectedFindings": [{ "line": 5, "tag": "manual-wait", "subCase": "stale-read" }]
    },
    {
      "file": "violating/stale-read-getAttribute.spec.ts",
      "label": "violating",
      "language": "ts",
      "framework": "playwright",
      "rationale": "subCase=stale-read — waitForTimeout before getAttribute",
      "expectedFindings": [{ "line": 5, "tag": "manual-wait", "subCase": "stale-read" }]
    },
    {
      "file": "violating/intentional-bot-simulation.spec.ts",
      "label": "violating",
      "language": "ts",
      "framework": "playwright",
      "rationale": "subCase=intentional — bot simulation wait still flagged (downgraded severity)",
      "expectedFindings": [{ "line": 5, "tag": "manual-wait", "subCase": "intentional", "replaceable": false }]
    },
    {
      "file": "violating/intentional-animation-delay.spec.ts",
      "label": "violating",
      "language": "ts",
      "framework": "playwright",
      "rationale": "subCase=intentional — animation delay still flagged (downgraded severity)",
      "expectedFindings": [{ "line": 5, "tag": "manual-wait", "subCase": "intentional", "replaceable": false }]
    },
    {
      "file": "violating/test_python_sleep.py",
      "label": "violating",
      "language": "py",
      "framework": "pytest",
      "rationale": "subCase=intentional — time.sleep in pytest",
      "expectedFindings": [{ "line": 5, "tag": "manual-wait", "subCase": "intentional", "replaceable": false }]
    },
    {
      "file": "violating/ManualWaitTest.java",
      "label": "violating",
      "language": "java",
      "framework": "junit",
      "rationale": "subCase=intentional — Thread.sleep in JUnit",
      "expectedFindings": [{ "line": 6, "tag": "manual-wait", "subCase": "intentional", "replaceable": false }]
    },
    {
      "file": "violating/replaceable-polling-loop.py",
      "label": "violating",
      "language": "py",
      "framework": "pytest",
      "rationale": "subCase=intentional, replaceable=true, pollingLoop=true — while not ready + time.sleep → threading.Event.wait()",
      "expectedFindings": [{ "line": 7, "tag": "manual-wait", "subCase": "intentional", "replaceable": true, "pollingLoop": true, "suggestion": "threading.Event.wait()" }]
    },
    {
      "file": "violating/replaceable-busy-wait.py",
      "label": "violating",
      "language": "py",
      "framework": "pytest",
      "rationale": "subCase=intentional, replaceable=true, pollingLoop=true — while True + time.sleep → threading.Event.wait()",
      "expectedFindings": [{ "line": 7, "tag": "manual-wait", "subCase": "intentional", "replaceable": true, "pollingLoop": true, "suggestion": "threading.Event.wait()" }]
    },
    {
      "file": "violating/non-replaceable-intentional.py",
      "label": "violating",
      "language": "py",
      "framework": "pytest",
      "rationale": "subCase=intentional, replaceable=false — no polling loop or API call, genuinely intentional",
      "expectedFindings": [{ "line": 6, "tag": "manual-wait", "subCase": "intentional", "replaceable": false }]
    },
    {
      "file": "clean/native-waits.spec.ts",
      "label": "clean",
      "language": "ts",
      "framework": "playwright",
      "rationale": "native expect timeout; comment mentioning waitForTimeout must not fire"
    },
    {
      "file": "clean/intentional-wait-with-ignore.spec.ts",
      "label": "clean",
      "language": "ts",
      "framework": "playwright",
      "rationale": "tagged gavel-ignore: manual-wait with reason suppresses finding"
    },
    {
      "file": "violating/ThreadSleepTests.cs",
      "label": "violating",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "subCase=intentional — Thread.Sleep in NUnit",
      "expectedFindings": [{ "line": 11, "tag": "manual-wait", "subCase": "intentional", "replaceable": false }]
    },
    {
      "file": "violating/TaskDelayTests.cs",
      "label": "violating",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "subCase=intentional — fixed Task.Delay in NUnit",
      "expectedFindings": [{ "line": 12, "tag": "manual-wait", "subCase": "intentional", "replaceable": false }]
    },
    {
      "file": "violating/WaitForTimeoutAsyncTests.cs",
      "label": "violating",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "subCase=intentional — WaitForTimeoutAsync in Playwright.NET",
      "expectedFindings": [{ "line": 12, "tag": "manual-wait", "subCase": "intentional", "replaceable": false }]
    },
    {
      "file": "violating/RedundantExpectPollTests.cs",
      "label": "violating",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "subCase=redundant — Thread.Sleep before ToBeVisibleAsync",
      "expectedFindings": [{ "line": 14, "tag": "manual-wait", "subCase": "redundant" }]
    },
    {
      "file": "violating/StaleReadEvaluateTests.cs",
      "label": "violating",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "subCase=stale-read — Thread.Sleep before EvaluateAsync",
      "expectedFindings": [{ "line": 13, "tag": "manual-wait", "subCase": "stale-read" }]
    },
    {
      "file": "violating/ReplaceablePollingLoopTests.cs",
      "label": "violating",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "subCase=intentional, replaceable=true, pollingLoop=true — while (!ready) + Thread.Sleep",
      "expectedFindings": [{ "line": 14, "tag": "manual-wait", "subCase": "intentional", "replaceable": true, "pollingLoop": true, "suggestion": "ManualResetEventSlim.Wait()" }]
    },
    {
      "file": "clean/NativeWaitsTests.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "native Expect.ToBeVisibleAsync; comment mentioning Thread.Sleep must not fire"
    },
    {
      "file": "violating/pages/LoginPage.cs",
      "label": "violating",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "subCase=intentional, replaceable=true — WaitForLoadStateAsync(NetworkIdle) after click in page (lesson #12)",
      "expectedFindings": [{ "line": 16, "tag": "manual-wait", "subCase": "intentional", "replaceable": true, "suggestion": "Expect(locator).ToBeVisibleAsync() / WaitForURLAsync" }]
    },
    {
      "file": "violating/pages/CheckoutPage.cs",
      "label": "violating",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "subCase=intentional — WaitForLoadStateAsync(NetworkIdle) after click in page",
      "expectedFindings": [{ "line": 15, "tag": "manual-wait", "subCase": "intentional", "replaceable": false, "suggestion": "Expect(locator).ToBeVisibleAsync() / WaitForURLAsync" }]
    },
    {
      "file": "violating/NetworkIdleDirectTests.cs",
      "label": "violating",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "subCase=intentional — WaitForLoadStateAsync(NetworkIdle) in test body",
      "expectedFindings": [{ "line": 14, "tag": "manual-wait", "subCase": "intentional", "replaceable": false, "suggestion": "Expect(locator).ToBeVisibleAsync() / WaitForURLAsync" }]
    },
    {
      "file": "violating/ParameterlessLoadStateTests.cs",
      "label": "violating",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "subCase=intentional — parameterless WaitForLoadStateAsync()",
      "expectedFindings": [{ "line": 14, "tag": "manual-wait", "subCase": "intentional", "replaceable": false, "suggestion": "Expect(locator).ToBeVisibleAsync() / WaitForURLAsync" }]
    },
    {
      "file": "clean/WaitForURLTests.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "WaitForURLAsync instead of NetworkIdle — native navigation wait"
    },
    {
      "file": "clean/WaitForVisibleTests.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "WaitForAsync with Visible state — native element wait"
    },
    {
      "file": "clean/ExpectVisibleTests.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "native Expect.ToBeVisibleAsync / ToHaveTextAsync — auto-retrying assertions"
    },
    {
      "file": "clean/ExpectEnabledTests.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "native Expect.ToBeEnabledAsync / ToBeCheckedAsync — auto-retrying assertions"
    },
    {
      "file": "clean/WaitForResponseTests.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "WaitForResponseAsync — native API response wait"
    },
    {
      "file": "clean/NativeAssertionTests.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "native Expect assertions; comment mentioning Thread.Sleep must not fire"
    },
    {
      "file": "clean/PageGotoTests.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "GotoAsync + Expect URL — no manual wait"
    },
    {
      "file": "clean/WaitForSelectorTests.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "WaitForAsync with Detached/Hidden state — native element lifecycle wait"
    },
    {
      "file": "clean/ExpectURLTests.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "Expect.ToHaveURLAsync / ToHaveTitleAsync — native auto-retrying assertions"
    },
    {
      "file": "clean/pages/locators/CheckoutLocators.cs",
      "label": "clean",
      "language": "cs",
      "framework": "playwright-dotnet",
      "rationale": "locator class with GetByRole — no manual waits"
    }
  ]
}
