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 <noreply@anthropic.com>
This commit is contained in:
2026-09-26 17:57:14 -07:00
co-authored by Claude Opus 5.5
parent b1da18d49e
commit d52a4fa1e6
@@ -126,7 +126,10 @@ func chatDoc(f *fakeDixie) string {
func TestEmbeddingsAreCachedAcrossQuestions(t *testing.T) { func TestEmbeddingsAreCachedAcrossQuestions(t *testing.T) {
f := newFakeDixie(t, false) f := newFakeDixie(t, false)
e := f.engine(t, NewGate(2, 8, 5*time.Second), true) 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) 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" { if r.Fallback != "" || r.Retrieval != "hybrid" {
t.Fatalf("first question: fallback %q retrieval %q", r.Fallback, r.Retrieval) t.Fatalf("first question: fallback %q retrieval %q", r.Fallback, r.Retrieval)