Canary deploy lab
Prove behavior with deterministic tests
Executable checks prove promote only if canary error_rate ≤ baseline+0.5pp and groundedness ≥ baseline−1pp for two 10m windows on fixtures — including the known misshape behind CANARY-PROMOTE-BLIND-6.
1Try it yourself
Decision drill
Canary deploy desk
Split traffic, watch metrics, rollback or promote — never big-bang without a safety net.
1/3You routed 10% of traffic to v2. Smoke looks fine so far.
2Learn the idea
Read
Schema and policy checks
Add executable validation at the trust boundaries of containerized answer API releasing image v2 at 5%→25%→100% weights. Reject unknown fields where they matter, bound string sizes, and coerce only after auth/signature checks when raw bytes are security-relevant. Invariant under test: promote only if canary error_rate ≤ baseline+0.5pp and groundedness ≥ baseline−1pp for two 10m windows. A TypeScript type or Python annotation is not runtime validation — pair them with parsers.
Read
Golden and adversarial fixtures
Automate the fixtures from setup, including a recreation of CANARY-PROMOTE-BLIND-6. Assert both the visible error and the absence of side effects (no provider call, no queue write, no flag flip). Where metrics matter, assert label enums stay bounded.
Read
Implementation artifact
sum(rate(http_requests_total{revision="v2",status=~"5.."}[10m]))
/
sum(rate(http_requests_total{revision="v2"}[10m]))
Read
Gate semantics
Document which failures are client mistakes (4xx) versus operator/config mistakes (5xx/503). Oracle still stands: 5% canary healthy 20m → promote to 25%; guardrail breach → weight 0 in < 2m. Validation should make accidental “success with empty body” impossible for release commander watching revision-sliced error rate.
Read
Stage depth
Property ideas: shuffled field order, Unicode edges, maximum-length strings, and replayed timestamps. Where money, identity, or citations matter, assertion messages should cite the field name. Do not snapshot entire provider payloads in tests; assert semantically. If validation fails open “to keep the demo working,” you have inverted the lab. Tie at least one CI job to the CANARY-PROMOTE-BLIND-6 fixture so main cannot regress silently. Re-read promote only if canary error_rate ≤ baseline+0.5pp and groundedness ≥ baseline−1pp for two 10m windows after each new parser — convenience helpers love to bypass it.
Read
Field notes for `canary-deploy-lab` / `validation`
Table-drive status codes and error codes so reviewers see coverage at a glance. Include a Unicode normalization case if user text is accepted. Verify that oversized bodies fail before CPU-heavy work. Where digests or versions are pinned, assert mismatch behavior. Keep golden files small enough to read in review. CI should fail on skipped tests that mark the incident fixture as xfail without a ticket link. In this chapter the product is containerized answer API releasing image v2 at 5%→25%→100% weights, the human stakeholder is release commander watching revision-sliced error rate, and the incident id you design against is CANARY-PROMOTE-BLIND-6. Re-state the oracle in your notes — 5% canary healthy 20m → promote to 25%; guardrail breach → weight 0 in < 2m — and keep the invariant visible: promote only if canary error_rate ≤ baseline+0.5pp and groundedness ≥ baseline−1pp for two 10m windows. Track canary_weight, error_rate_by_revision, grounded_rate_by_revision as the scoreboard. Surface under change control: POST /answer. If you only have forty minutes, finish the fixture for automation promotes while scrape_up{revision=v2}==0 before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.
Go deeper
Before you start
Why this matters
List three fixtures: one golden success, one schema/auth reject, and one regression for CANARY-PROMOTE-BLIND-6. For each, write the exact assertion (status, code, metric, or citation) that must turn red if broken.
In the wild
See how this idea shows up as a product and a company — then come back to the lesson. Skills transfer across vendors.
Related lessons
Check your understanding
Page assessment
Answer from memory. Completion is saved from this evidence, not from opening the next page.
All responses are required.