Capstone: ship a tiny AI app
Measure whether the grounded café FAQ application works
Executable checks prove unsupported questions abstain; every answer cites a note id; two-minute clean-room demo on fixtures — including the known misshape behind CAP-CAFE-DEMO-01.
1Learn the idea
Read
Schema and policy checks
Add executable validation at the trust boundaries of grounded café FAQ app with validation, five-note retrieval, citations, tests, demo. 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: unsupported questions abstain; every answer cites a note id; two-minute clean-room demo. 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 CAP-CAFE-DEMO-01. 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
assert ask("Who won the 1998 world cup?")["abstain"] is True
Read
Gate semantics
Document which failures are client mistakes (4xx) versus operator/config mistakes (5xx/503). Oracle still stands: gold 5/5 cited + 3/3 abstain; demo under 120s from clean checkout. Validation should make accidental “success with empty body” impossible for café ops lead answering hours/wifi/pets questions from a kiosk.
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 CAP-CAFE-DEMO-01 fixture so main cannot regress silently. Re-read unsupported questions abstain; every answer cites a note id; two-minute clean-room demo after each new parser — convenience helpers love to bypass it.
Read
Field notes for `capstone-ship-it` / `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 grounded café FAQ app with validation, five-note retrieval, citations, tests, demo, the human stakeholder is café ops lead answering hours/wifi/pets questions from a kiosk, and the incident id you design against is CAP-CAFE-DEMO-01. Re-state the oracle in your notes — gold 5/5 cited + 3/3 abstain; demo under 120s from clean checkout — and keep the invariant visible: unsupported questions abstain; every answer cites a note id; two-minute clean-room demo. Track gold_pass and demo_seconds as the scoreboard. Surface under change control: CLI faq_ask. If you only have forty minutes, finish the fixture for demo relies on personal .env and unreproducible notebook state 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 CAP-CAFE-DEMO-01. For each, write the exact assertion (status, code, metric, or citation) that must turn red if broken.
Capstone gold tests stay versioned beside the app so gold 5/5 cited + 3/3 abstain; demo under 120s from clean checkout remains reproducible.
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.