Commit fb8e040
fix(14-A): write chunk text under payload['document'] to match retrieval contract
Production retrieval (`tuned_hybrid.py`) reads chunk body via
`payload.get("document")`. Phase 14-A's `ingest()` was writing
`payload["text"]` instead, so every bench query returned chunk objects
with empty `.text` attributes — the scoped/unscoped passes ran end-to-end
but measured question-only token counts (`tpca ≈ input_tokens_p50`)
instead of retrieval-augmented context.
Discovered by direct Qdrant payload scroll comparison after the first
full bench run produced a deceptive-looking PASS (tpca=25.94 vs gate
≤962.2) with `recall_at_5=0.0` across all 470 records and 5 axes —
classic too-good-to-be-true.
Add an explicit anti-regression assertion in
`test_ingest_upserts_one_point_per_haystack_turn`: payload MUST contain
"document" and MUST NOT contain "text". Locks the contract so future
edits can't silently re-introduce the field-name drift.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d6de38c commit fb8e040
2 files changed
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
212 | 217 | | |
213 | | - | |
| 218 | + | |
214 | 219 | | |
215 | 220 | | |
216 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
235 | 244 | | |
236 | 245 | | |
237 | 246 | | |
| |||
0 commit comments