Part I · Checkpoint 1 CP 1 · 35 min · ProveIt/Checkpoints/Cp1.lean

Checkpoint 1: Zero-Panic Rollout Router

Closed-notes synthesis: model a canary rollout state machine, run Gear 1 search, and prove fail-closed safety.

Checkpoint Spec · Canary Traffic Router
-- Requirements:
-- 1. Rollout mode is Disabled | Canary (pct : Nat) | Full.
-- 2. If backend health is Unhealthy, route MUST return Stable (fail-closed).
-- 3. Emergency killSwitch transitions ANY state to Disabled in 1 step.
Socratic Gate · Commit to a Prediction Unanswered · Locks on commit

Suppose `Canary (pct : Nat)` receives `pct = 150` from a misconfigured config file, while `healthy = false`. Does a fail-closed router `if healthy && matchMode mode bucket then .canary else .stable` ever send traffic to `.canary`?

Synthesizing Part I Without Training Wheels

This first checkpoint combines Chapters 01–04 into a clean production component: an algebraic rollout configuration (Disabled | Canary pct | Full), a total route function, an administrative state-transition function (promote, setCanary, killSwitch), and theorems guaranteeing both fail-closed unhealthy routing and kill-switch lockdown.

⊢ ProveIt/Checkpoints/Cp1.lean · Fail-Closed Canary Router
Step 1 / 1
Lean Infoview Open Goal
Hands-On Exercise (ProveIt/Checkpoints/Cp1.lean):

Complete `ProveIt/Checkpoints/Cp1.lean` locally and verify with `lake exe check cp1`.

Finished the Socratic gate, Infoview trace, and playground run?
Record completion in local browser storage to track your 20-unit progress.