fix(eval): build realistic Lore context for QA questions#414
Merged
Conversation
8185942 to
0a3c7e0
Compare
The CM-1 eval was comparing Lore unfairly: tail-window got the full conversation in context, while Lore got a brand new empty session with no context — only the recall tool. In real usage, Lore's gradient system allocates separate budgets: - 25% of usable context for distillation prefix - 40% for raw tail window (independent of distillation) - LTM injected separately by the gateway Fix: add buildLoreContext() that mimics the gradient context manager with separate budgets computed from usable context (after subtracting output reserve and overhead). Only non-archived distillations are included (matching gradient.ts). LTM is left to the gateway's own injection to avoid double-counting. Context is built once per baseline, not per question. Results (base CM-1 ~16K): Lore 4.8, tail-window 4.9, compaction 4.9 Results (400K inflated): Lore 3.9 > tail-window 2.6 (+50%) Compaction leads slightly at 4.1 — tracked in #417. Related to #410
0a3c7e0 to
d69634c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the CM-1 eval to test Lore the way it actually works in production — with distillation prefix + raw tail window + LTM + recall, using separate budgets that match the gradient context manager.
Problem
The eval's Lore baseline created a fresh gateway session per QA question. This new session had:
gradient.ts:691), and the QA session had a different IDisFirstTurn(pipeline.ts:2900)In real Lore usage, the gradient system allocates separate budgets: 25% of usable context for distillation prefix, 40% for raw tail window, with LTM injected separately. The eval was testing recall-in-isolation rather than the full Lore experience.
Fix
Adds
buildLoreContext()to the eval harness that mimics the gradient context manager:config.tsdefaults)gradient.tslogic)archived = 0filter matches what the gradient system includes in-contextThe recall tool is still available via the gateway for additional detail.
Results
Base CM-1 (~16K tokens):
Inflated CM-1 (400K tokens) — Lore beats tail-window by +50%:
Remaining gap vs compaction (3.9 vs 4.1) is due to distillation compression losses — tracked in #417.
Changes
packages/core/eval/harness.tsbuildLoreContext(turns, contextWindow)— builds distillation + raw tail context with separate budgets matching gradient defaultsaskQuestionViaGateway()to accept and inject Lore context into the QA requestsessionHeadersparameterRelated to #410