Capstone: research bot with citations
Debug invented citations and overconfident prose
When model invents kb://minutes-2099 citation, the system must degrade on purpose without widening blast radius.
1Learn the idea
Read
Classify and bound retries
Map failure classes for POST /v1/research/brief: retryable vs fatal vs needs-human. Retries need budgets, jitter, and idempotency rules aligned to claim without evidence → abstain or drop claim; no orphan sentences. The chapter’s signature failure — model invents kb://minutes-2099 citation — must take a deliberate branch, not a generic catch-all.
Read
Containment path
Implement the degrade/rollback/refuse behavior analyst compiling a brief on bike-share policy from a fixed corpus needs when CAP-RESEARCH-FAKE-ID-3 repeats. Prefer scoped controls (one flag, one weight, one tenant, one secret version) over fleet-wide restarts. Preserve evidence; do not delete logs to “clean the demo.”
Read
Implementation artifact
brief.claims = [c for c in brief.claims if c.evidence_ids]
if not brief.claims:
brief.abstain = True
Read
Verify harm reduction
After containment, check claim_citation_coverage and fabricated_id_rate moves in the safe direction and watch for retry amplification. Write the stop condition that ends the incident response for this lab.
Read
Stage depth
Chaos note: inject only one fault class at a time and restore fixtures after. Watch for dual failures — dependency down and retry amplifier — which is how model invents kb://minutes-2099 citation becomes an outage. Customer communication templates (even if only for the drill) beat silence. If you queue deferred work, define poison-message handling. Budget documents should state the maximum extra spend allowed during retries. Close the loop by linking the containment action to a dashboard panel for claim_citation_coverage and fabricated_id_rate.
Read
Field notes for `capstone-research-bot` / `failure-handling`
Draw a state diagram for degrade modes and put it in the repo as ASCII if needed. Cap concurrent retries across the process, not only per request. Ensure cancellation propagates to downstream HTTP clients. When failing closed, choose a user-visible message that does not leak internals. Practice the single command that flips the kill switch or weight to zero. After recovery, drain or inspect deferred work before declaring green. In this chapter the product is citation-first research assistant that maps every claim to evidence IDs, the human stakeholder is analyst compiling a brief on bike-share policy from a fixed corpus, and the incident id you design against is CAP-RESEARCH-FAKE-ID-3. Re-state the oracle in your notes — brief on fixture corpus: ≥ 0.95 claims cited; fabricated ID rate 0 — and keep the invariant visible: claim without evidence → abstain or drop claim; no orphan sentences. Track claim_citation_coverage and fabricated_id_rate as the scoreboard. Surface under change control: POST /v1/research/brief. If you only have forty minutes, finish the fixture for model invents kb://minutes-2099 citation 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
Assume model invents kb://minutes-2099 citation is happening right now. Write the first safe action, the signal that confirms containment, and the action you will not take (infinite retry, broad restart, deleting evidence). Tie the plan to invariant: claim without evidence → abstain or drop claim; no orphan sentences.
Capstone failure drills reuse CAP-RESEARCH-FAKE-ID-3 as the story you tell in the ship review.
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.