Part 4 of 7 · Survey analyzer series ~5 min read

How a summary reaches the owner

The grouper handed off a handful of themes — each with a name, a count, and a real quote. Now the summary Lambda has to turn that into one short email the owner will actually read, and make sure every number and every quote in it is true. Get this wrong and the summary is worse than no summary: an inflated count, a quote nobody wrote, a wall of text nobody finishes. Four small guardrails sit between the grouped themes and the email that lands.

Key takeaways

  • Claude Sonnet 4.6 writes the summary from the grouped themes — never from one cherry-picked answer.
  • Counts in the email are checked against the real cluster sizes before anything is sent.
  • Every quote is verified to be a verbatim answer that actually exists in the store.
  • The voice doc sets the tone and a hard length cap so the email stays a one-page read.
  • SES emails the owner; the urgent items from the week are appended at the bottom.

Four guardrails on every summary

Four guardrails between the grouped themes and the summary email A horizontal flow diagram. On the far left, a "Themes ready" box: the grouper emitted the week's themes, each with a name, a real count, and one verbatim quote. Four guardrail gates sit in a row to the right, each drawn as a vertical bar. Gate 1: Draft from themes — Claude Sonnet 4.6 reads the named, counted, quoted themes plus the overall mood and writes a short summary, working only from the groups, never from a single answer. Gate 2: Check the counts — every number in the draft is compared against the real cluster sizes recorded by the grouper; if a count doesn't match, the draft is rejected and rebuilt from the true figures. Gate 3: Check the quotes — every quoted sentence is verified to be a verbatim answer that exists in the store; any quote the model reworded or invented is replaced with the real representative quote. Gate 4: Tone and length — the draft is shaped to the voice doc and held under a hard length cap so it stays a one-page read; the urgent items from the week are appended as a closing block. After all four gates pass, the summary ships via SES outbound to the owner. A note at the bottom: every number and every quote in the email is checked against the store before it sends. Themes ready name, count, one real quote each Gate 1 Draft from themes Sonnet 4.6 reads the grouped themes + overall mood writes short draft, groups only Gate 2 Check the counts numbers match cluster sizes? if not, rebuild from true figures Gate 3 Check the quotes quote exists in the store? if not, swap in the real one Gate 4 Tone + length voice template shapes the tone + hard length cap, append urgent block Ship — SES outbound email to the owner (one short weekly read) SES SendRawEmail · themes, counts, quotes, mood, urgent block every run logged to DDB sa-runs — the summary is reproducible Every number and every quote is checked against the store — the summary can’t drift from the truth.
Fig 4. Four guardrails between the grouped themes and the email. Draft from the groups. Check every count. Check every quote. Shape the tone and length. Then ship via SES and log the run so the summary is reproducible.

Gate 1: draft from the themes, not the answers

The summary Lambda hands Claude Sonnet 4.6 the structured output of the grouper: each theme’s name, its exact count, and its one real quote, plus the overall mood (a simple share of positive, neutral, and negative answers, computed in plain code from the ratings and the urgent flags). Sonnet’s job is narrow: write a short, warm, plain summary of this — a top line on volume and mood, then the themes in order of size, each with its count and quote. The prompt is explicit that it must work only from the supplied themes and may not introduce a topic, a number, or a quote that isn’t in the input. It never gets to rummage through raw answers and surface its own favourite.

Sonnet rather than Haiku here is a deliberate choice. This is the one piece of writing the owner actually reads, and it has to weigh several themes, judge what leads, and strike a tone — the kind of light reasoning the heavier model does noticeably better. Everywhere else, the cheap model is fine; here the extra cents buy a summary worth reading.

Gate 2: check every count against the real sizes

A model writing prose around numbers will, now and then, round “61” to “about 60” or merge two themes and add their counts wrong. So before anything sends, Gate 2 pulls every number out of the draft and compares it against the cluster sizes the grouper recorded. If a count doesn’t match exactly, the draft is rejected and rebuilt — the gate hands the true figures back to Sonnet and asks for the summary again, or, after a couple of tries, drops in the numbers itself. The owner never sees a count the system can’t stand behind.

Gate 3: check every quote is real

The same care goes to the quotes. Each quoted sentence in the draft is looked up against the store to confirm it’s a verbatim answer somebody actually wrote. A quote the model softened, tidied, or invented fails the check and is swapped for the real representative quote the grouper picked in Part 3. This matters more than it sounds: a quote is the one place a summary feels like real customers talking, and a made-up quote — however plausible — quietly turns the whole report into fiction. Every quote that ships is real.

Gate 4: tone, length, and the urgent block

The voice doc holds the tone — how warm, how blunt, how much hedging — and a hard length cap. Gate 4 shapes the verified draft to that voice and trims anything over the cap, because a summary that scrolls is a summary that doesn’t get read. Then it appends a short closing block: the answers that were flagged urgent during the week (from Part 5) and a one-line note on how each was routed, so the owner sees in one place both the slow signal (the themes) and the fast one (the urgents). The finished email goes out through SES outbound, and the whole run — inputs, draft, final — is written to DynamoDB so the summary is reproducible and auditable later.

Why the guardrails exist

None of these gates are exotic. They’re the care a thoughtful analyst would take if they were writing the summary by hand — quote real people, get the numbers right, keep it short, and put the urgent stuff where the boss will see it. Putting them in code as four sequential checks makes honesty a property of the system, not something you’re trusting one model call to remember on a busy Sunday night. The owner can act on the summary precisely because they never have to wonder whether a number or a quote was real.

Next post: the urgent lane — how a single answer that can’t wait until Sunday gets pulled out and sent to a human the minute it lands.

All posts