From d52a4fa1e6bb51d2732cd91e4f2857323a931373 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Sat, 26 Sep 2026 17:57:14 -0700 Subject: [PATCH] P5b given test: the embedding-cache test used a 12-page document (4.6k tokens), under SmallDoc, so the rules make it "whole", not "hybrid"; use 30 pages (11.7k tokens, 10 chunks) and assert the precondition Found by Ornith in the p5b/02 session (it measured the document); my test's fault, not the task's. Co-Authored-By: Claude Opus 5.5 --- docs/plans/p5b/_files/internal/digest/retrieval_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/plans/p5b/_files/internal/digest/retrieval_test.go b/docs/plans/p5b/_files/internal/digest/retrieval_test.go index 017b1c6..c7193c0 100644 --- a/docs/plans/p5b/_files/internal/digest/retrieval_test.go +++ b/docs/plans/p5b/_files/internal/digest/retrieval_test.go @@ -126,7 +126,10 @@ func chatDoc(f *fakeDixie) string { func TestEmbeddingsAreCachedAcrossQuestions(t *testing.T) { f := newFakeDixie(t, false) e := f.engine(t, NewGate(2, 8, 5*time.Second), true) - doc := longDoc(12, 0) // ~12 pages, a few chunks: under EmbedSyncMax + doc := longDoc(30, 0) // ~11.5k tokens: over SmallDoc (so not "whole"), ~10 chunks: under EmbedSyncMax + if EstTokens(doc) <= SmallDoc { + t.Fatalf("test document is %d tokens; it must exceed SmallDoc (%d) to reach retrieval", EstTokens(doc), SmallDoc) + } r := e.Run(context.Background(), doc, "which berth did the tug use?", "https://ex.test/a.pdf", dcache.ClassFleet) if r.Fallback != "" || r.Retrieval != "hybrid" { t.Fatalf("first question: fallback %q retrieval %q", r.Fallback, r.Retrieval)