answering(): ASK 5
segment · lines 705–714View on GitHubWhere the ask reranks the pool and widens the choice.
// ASK 5 · rerank (Claude picks the best passages), then widen (add their neighbours) // Each chosen chunk with its neighbours, unless every chunk is already given. It passed 5 of 5 // boundary cases against 4 of 5 for 60% more a question, past the bar set before the runs; // Joel switched it on for the better answers (/blog/widening, evals/runs/*-widen-*).Why widening is on Never runs
WhatThe comment names the stage and records the evidence for widening. With widening, 5 of 5 boundary cases passed; without it, 4 of 5 passed, and widening cost about 60% more a question. The 60% holds for the boundary questions themselves (about $0.0113 to $0.0181 each); the cost of a whole run rose about 54%.
WhyThe boundary cases (evals/cases.jsonl, boundary-01 to -05) each put the question's words in one chunk and the answer in the next chunk of the same file. Without widening, boundary-03 failed in both runs; with it, all five passed in both.
evals/runs/2026-10-21T21-17-59-widen-before, 21-27-27-widen-before: boundary 4 of 5evals/runs/2026-10-21T21-37-07-widen-after, 21-45-42-widen-after: boundary 5 of 5evals/runs/2026-10-21T21-17-59-widen-before vs 21-37-07-widen-after: boundary cases $0.0563 → $0.0910 in all (+62%)evals/runs/*-widen-*: run cost $0.32–0.33 before, $0.50 after (about +54%)
yield { type: 'stage', stage: 'reranking' } const chosen = await rerank(models.claude, question, pool)Rerank the pool Query time
Whatanswering() yields a stage event, which the demo page shows as "Choosing passages…", then awaits rerank() with the Claude client, the question and the pool. The pool is the fused candidates, or every chunk when the documents were read whole.
Whyrerank() never throws. Any failure inside it returns the pool in fusion order, so the ask always reaches ASK 6 with passages to answer from. The stage event goes out first because the Haiku call can take seconds.
// When every chunk is already given there is nothing to widen into. const given = whole || options.widen === false ? chosen : widen(chosen, all)Widen, unless everything is already given Query time
Whatgiven is the reranker's choice unchanged when the documents were read whole (12 chunks or fewer) or when Options.widen is false. Otherwise it is widen(chosen, all).
WhyWhen the documents were read whole, rerank() already returned every chunk, so there is no neighbour left to add. widen: false exists so the tests can compare both paths, and the deployed demo app never sets it.
