# Launch checks

Local use on one computer does not wait for these checks. Set `VAANI_PRODUCTION=1` only after each one is true in `config/launch-gates.json`. While any check is open, the desk still loads and `/api/health` still answers, and every other API call returns 503.

Copy `config/launch-gates.example.json` to `config/launch-gates.json` if the file is not already there. The desk also copies it on first start.

## 1. Which videos may be processed

The desk already refuses live videos, upcoming videos, private or member-only videos, videos with no length, and videos over the length limit. The person at the desk must also check "I have the right to download and transcribe this recording" before audio starts.

Confirm that this is the policy you want. Then set `eligible_video_policy_confirmed` to true.

## 2. Maximum length

Default is 2700 seconds (45 minutes). The hard ceiling is 4 hours. Confirm the number you will actually run, set `max_duration_confirmed` to true, and set `notes.max_duration_seconds` to the same number as `VAANI_MAX_DURATION_SECONDS`. If they differ, production stays closed.

## 3. How long files stay

Default is 24 hours. Confirm it, set `retention_confirmed` to true, and set `notes.retention_hours` to the same number as `VAANI_RETENTION_HOURS`.

## 4. Hindi test set and accuracy

There is no Hindi test set in this repository. Use recordings you have the right to keep. For each sample, put a wav and a matching reference transcript in one folder:

```text
data/hindi-test/sample.wav
data/hindi-test/sample.txt
```

The reference is Devanagari, the words that were spoken. Then, with the medium or large-v3 model:

```powershell
.\.venv\Scripts\python.exe -m app.eval_hindi data\hindi-test --model medium
```

The command prints a character error rate per file and the mean. Spaces are ignored. 0.18 means about 18 characters wrong in every 100. That is the default ceiling (`VAANI_HINDI_CER_MAX`). It is a bar for clear speech, not a claim that this desk has already met it.

Production accepts the check only when all of these are true:

- `hindi_accuracy_confirmed` is true
- `notes.hindi_cer` is a number at or below the ceiling
- `notes.whisper_model` is `medium`, `large`, `large-v2`, or `large-v3`
- the running `VAANI_WHISPER_MODEL` is one of those models

Write `notes.test_set` and `notes.measured_on` so a later operator can see what was measured. The desk does not read those two fields. They are for you.

Do not confirm this check to unblock a deploy. A missing or too-high rate keeps production closed on purpose.

## 5. Upload fallback

When YouTube will not return audio, the desk stops with the reason and accepts an audio or video file the operator is allowed to use. It does not use cookies or a signed-in YouTube session. Confirm that this fallback is the one you want, then set `audio_fallback_confirmed` to true.

Try it once before you confirm: open a video whose audio YouTube refuses, upload a short file you may use, and see the queue continue at the transcript step.

## A confirmed file looks like this

Only fill this in after the measurements are real.

```json
{
  "eligible_video_policy_confirmed": true,
  "max_duration_confirmed": true,
  "retention_confirmed": true,
  "hindi_accuracy_confirmed": true,
  "audio_fallback_confirmed": true,
  "notes": {
    "max_duration_seconds": 2700,
    "retention_hours": 24,
    "hindi_cer": 0.14,
    "whisper_model": "medium",
    "test_set": "internal hindi set, 12 clips",
    "measured_on": "2026-11-04"
  }
}
```
