● ● ● ● ○ ○ ○ ○ ○ Lesson 4 of 9
Build a docs Skill · A brown-bag
"Full-text search is better." Says who? Prove it — without cheating.
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?
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:
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.
Here's the pipeline, end to end:
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?
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.
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):
It removes human bias (you can't cherry-pick winners) and scales over hundreds of pages — fair, hard, body-only questions 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.
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.
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.