Recipe: the launch gate
Two checks fail on purpose: three documents have no access label, and ingestion lags 45 minutes against a 30-minute limit. The limits are examples.
The checklist to run before real users arrive, written as a gate that reports blockers, and the alerts to watch every day of the first week.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write day_alerts(questions, refused, limit) returning 'alert' when refused / questions is greater than limit and 'ok' otherwise. Print the result for two days.
Write cost_ratio(day, baseline_day) that returns the cost per question of day divided by the baseline's, where each is a (questions, dollars) pair. Print it with two decimals for (1400, 3.6) against (1000, 1.2).
Explain it without notes
What are the four areas of the launch gate and one check from each?
Why express yes/no facts as numbers in the gate?
Which signals do you watch in the first week, and what does each point to?
Why launch in steps instead of all at once?
Expected output
[PASS] quality: hit rate at k=3 on the golden set 0.91 (needs >= 0.85)
[PASS] quality: unanswerable questions refused 1.00 (needs >= 0.95)
[PASS] quality: answers with a valid citation 0.98 (needs >= 0.95)
[PASS] security: cross-tenant leaks in the test suite 0.00 (needs <= 0.00)
[FAIL] security: documents without an access label 3.00 (needs <= 0.00)
[PASS] cost: dollars per 1000 questions 1.24 (needs <= 1.50)
[PASS] cost: daily spend limit set (1 = yes) 1.00 (needs >= 1.00)
[PASS] operations: p95 latency in seconds 5.20 (needs <= 6.00)
[FAIL] operations: ingestion lag in minutes 45.00 (needs <= 30.00)
[PASS] operations: rollback rehearsed (1 = yes) 1.00 (needs >= 1.00)
blockers: 2
- security: documents without an access label
- operations: ingestion lag in minutes
launch: NO