Page 8 of 8~112 min topic

Semantic cache lab

Ship and explain the reversible cache rollout

A second person can reproduce paraphrase hit returns cached answer with cache=HIT; different tenant never hits from a clean checkout and name the owner for CACHE-XTENANT-2.

~14 min this pageMastery and shipping

1Learn the idea

Read

Clean-room demo

From a fresh clone/directory, run the commands that prove paraphrase hit returns cached answer with cache=HIT; different tenant never hits. A second person plays cost owner cutting duplicate GPT calls for Acme Corp FAQs and follows your script without coaching. The demo includes limitations: what tenant-scoped semantic cache for repeated FAQ paraphrases still will not do.

Read

Evidence pack

Bundle: contract snippet, passing tests, metric snapshot for hit_rate ∈ [0.25,0.55] and cross_tenant_hits == 0, security negative probe, rollback note, owner name. Reference CACHE-XTENANT-2 as the drill you rehearsed. If any item is missing, the ship gate fails even if the happy path dazzles.

Read

Implementation artifact

pytest tests/test_cache_isolation.py -k tenant

Read

Ownership and next review

For Semantic cache lab, name the human who gets paged, the review date for thresholds, and the condition that triggers reevaluation. Endpoint POST /v1/answer remains the production surface you operate for tenant-scoped semantic cache for repeated FAQ paraphrases — not a slide. Keep CACHE-XTENANT-2 in the handoff template so the next owner inherits the drill.

Read

Stage depth

After the peer demo, schedule the next threshold review date. File a short changelog that mentions CACHE-XTENANT-2 and the control that addresses it. Archive the evidence pack where your team already stores launch records. Resist rewriting everything “for real production” in one weekend — operate this slice until the metrics bore you, then widen. Final self-check: if telemetry vanished, would you still know to hold? If yes, you learned the operating posture this lane teaches.

Read

Field notes for `semantic-cache-lab` / `mastery-ship`

Trim the demo script until every command is necessary. Record a peer signature line: name, date UTC, pass/fail. File known limitations as bullets, not apologies. Link the evidence pack from the README. Schedule the next game day on a calendar, even if it is solo. Archive the branch tag or release digest you actually shipped. In this chapter the product is tenant-scoped semantic cache for repeated FAQ paraphrases, the human stakeholder is cost owner cutting duplicate GPT calls for Acme Corp FAQs, and the incident id you design against is CACHE-XTENANT-2. Re-state the oracle in your notes — paraphrase hit returns cached answer with cache=HIT; different tenant never hits — and keep the invariant visible: cache key includes tenant_id + policy_version; similarity ≥ 0.92 and risk≠high. Track hit_rate ∈ [0.25,0.55] and cross_tenant_hits == 0 as the scoreboard. Surface under change control: POST /v1/answer. If you only have forty minutes, finish the fixture for cross-tenant near-duplicate question returns Acme's private pricing blurb 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

Draft a two-minute demo script that proves paraphrase hit returns cached answer with cache=HIT; different tenant never hits from a clean directory. Include the failure rehearsal for cross-tenant near-duplicate question returns Acme's private pricing blurb and the rollback/owner line. If the script needs tribal knowledge, the lab is not shipped.

Check your understanding

Page assessment

Answer from memory. Completion is saved from this evidence, not from opening the next page.

1. Can a peer reproduce without coaching?
2. Does the pack include hit_rate ∈ [0.25,0.55] and cross_tenant_hits == 0 and rollback?
3. Is ownership for CACHE-XTENANT-2-class events explicit?

All responses are required.