● ● ● ● ○ ○ ○ ○ ○   Lesson 4 of 9

Build a docs Skill · A brown-bag

Evals that sample the blind spot

"Full-text search is better." Says who? Prove it — without cheating.

Why · the problem

In Lesson 3 we made a confident claim: full-text search beats title-only, because the good words hide in the page body. It sounds right. But "sounds right" is exactly what got us into trouble in Lesson 1.

So we need proof. And proof has two traps:

What we want is a pile of fair, hard, body-only questions — many of them — that nobody cherry-picked. Writing 50 of those by hand is slow and biased. Dead end?

⏱️ Worth it? Measuring is ancillary work — it's not "the actual work." So be honest: it's only worth it if the skill will be reused enough that shipping a worse search would cost more than the test costs to build. For a one-off, skip it. For a skill many agents lean on, a benchmark is the cheapest insurance you can buy.
What · the solution approach

Two moves. First we generate the questions fairly; then we score both engines on them.

1. Let a workflow build the test set. Don't write questions from your head. Read the actual page bodies and let the data pick the questions:

  1. Take a page. List the distinctive words in its body.
  2. Throw away any that also appear in its title or description.
  3. What's left is body-only by construction. Build a question from those words, and record which page is the right answer.

Because step 2 removes every title word, you cannot accidentally write a question title-only could win. The fairness is baked in by the method, not by your good intentions.

2. Run the benchmark. For each question, ask both engines: did you rank the correct page #1? Count the wins. Now "better" is a number, not an opinion.

Why a workflow, not a prompt This sampling is repeatable, fans out over hundreds of pages, and removes the human's bias. That's the whole point of doing it as a workflow: the machine produces fair, hard questions at a scale and neutrality you can't match by hand.
How · the mechanics

Here's the pipeline, end to end:

every page ─▶ body words ─▶ drop title/description words ─▶ body-only terms │ build a question using them, note the right page │ ▼ ┌────────── benchmark ──────────┐ for each question ─▶ │ title-only engine: rank? │ ─▶ count wins │ full-text engine: rank? │ └───────────────────────────────┘
The sampler guarantees body-only questions; the benchmark turns "better" into a score.

What does one generated question look like? Exactly like the real test set. Here are two, straight from evals.json — note the discriminating words live only in the body:

{ "id": 9,
  "prompt": "How do I find the EKPub hash for a TPM join token so my bot can join?",
  "expected_output": "...EKPub, EKCert, `tbot tpm identify` appear ONLY in the page
                      BODY... title-only search misses it (rank 0); full-text ranks #1." }

{ "id": 13,
  "prompt": "...require client certs for self-hosted Postgres — pg_hba.conf / hostssl?",
  "expected_output": "...pg_hba.conf, hostssl are body-only; title-only ranks 0,
                      full-text ranks #1." }

Now the part with tension. Before you read the result — guess. Over 16 of these body-only questions, how badly does title-only lose?

Reveal the benchmark (guess first: how many did each engine win?)

Full-text 15 — title-only 0 — both missed 1. And in 9 of the 16, title-only was a complete miss (rank 0) that full-text caught at rank 1 — e.g. EKPub hash for TPM join token, generation mismatch / locked renewable cert, pg_hba.conf hostssl. The blind spot wasn't a few unlucky cases. It was the rule.

"on 16 body-only queries, TF-IDF won 15–0–1 … with 9 queries where lexical had complete misses (rank 0) that TF-IDF caught at rank 1." — CORPUS.md, Act E (the review benchmark)

This is the moment the claim stops being a story and becomes evidence. And here's the discipline that makes it stick: we don't delete these questions after they pass. We keep them forever, as a wall against the next change. In fact, the body-only suite was written before the better engine even existed — a failing test on purpose, waiting for the fix to turn it green.

🔴 → 🟢   The regression we locked in

Red: title-only search missed body-only questions — 0 of 16 wins, 9 complete misses (rank 0).

Green: evals 9–13 assert the right page ranks #1 on those questions — added before the fix, kept in the suite to guard every future change. ("Use these to confirm the relevance improvement holds.")

Meet the idea by name. We don't design the perfect skill up front. We ship a minimal version, put it to the test, and improve — in short rounds. That's plain Agile iteration: borrow the index, then search the body, then (next) rank it well, then index code too. Each short loop sources more accurate data than the last, and every fix is locked by a test (red → green).

We've proven full-text wins. But Lesson 3 warned that building a full-text index has a cost. So what do we actually build — and how do we ship it without a server or a giant model?

That's Lesson 5: pick the engine. (Spoiler: the fancy option loses — on shippability.)

Quick self-check (recall before you peek):

1. Why generate the test questions with a workflow instead of by hand?

It removes human bias (you can't cherry-pick winners) and scales over hundreds of pages — fair, hard, body-only questions by construction.

2. What one step makes a question "body-only by construction"?

Dropping every word that also appears in the page's title or description — so only body words remain to build the question from.

3. What is the red → green discipline here?

Write the failing test first (title-only misses), then build the fix to turn it green — and keep the test forever as a regression bar against future changes.

4. When is building this benchmark NOT worth it?

For a one-off skill few will reuse. The effort only pays off when many agents depend on the skill and a worse search would cost more than the test does.