Repository navigation
Add native memory retrieval and BM25 evaluation tooling - #3258
Open
Hillary Mutisya (hillary-mutisya) wants to merge 7 commits into
Open
Hillary Mutisya (hillary-mutisya) wants to merge 7 commits into
Hillary Mutisya (hillary-mutisya) wants to merge 7 commits into
Conversation
Add corpus preparation, retrieval diagnostics, native answering and immutable paired experiments with opt-in native selection hooks. Honor named embedding selections when legacy settings remain. Keep production retrieval defaults unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reject both absent and null saved responses before attempting an answer, including older receipts without an attempt marker. Add regressions preserving receipt bytes and provider operation counts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expose the current host block-policy adapter alongside the query-term helper when loading the historical selector. Preserve the frozen selector checksum and unchanged-index upgrade assertions. Reproduces and fixes the CI module-link failure on Linux and Windows. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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
chunking-benchCLI for Qasper/QMSum corpus preparation, retrieval diagnostics, and native answer evaluation.Motivation
Compare retrieval and actual native answers on common datasets, then measure whether lexical reranking or additional lexical candidates improve native evidence selection. Retrieval span metrics are diagnostics, not answer-quality scores. This does not enable BM25 in production.
Behavior and configuration
none, take precedence over legacy variables with a warning. Legacy-only behavior and invalid-selector validation remain.Reviewer guide
datasets.ts,runner.ts,nativeAnswers.ts, andincrementalRunner.ts; compatibility, snapshot, receipt, and policy modules separate the integrity checks from scoring.Regression tests cover source-coordinate mapping, raw-source integrity, BM25 legacy parity, canonical policy outputs, real no-hit recovery, failed-answer replay prevention, and native-reader endpoint drift with a separate judge.
Validation
Tested integrated head:
b1bc84b0af232e19bcea883bdc0aa3545caa9585, including latest mainbe033bc58, the formatting bot's script-order correction, and generated documentation updates.Environment: Windows, Node 24.22.1, standalone pnpm 11.9.0.
pnpm run buildfromtsjest-esm --runInBand --silent, chunking/native answers/incremental BM25/original memory benchmark suitesjest-esm --runInBand --silent, ten affected memory-service suitesjest-esm --runInBand --silent --testPathPattern='embeddingCatalog.spec.js'git diff --checkpnpm run code-lint -- --ratchet --base origin/mainpnpm run code-complexity -- --ratchet --base origin/main --cyclomatic 25 --cognitive 30 --new-file-cyclomatic 25 --new-file-cognitive 30pnpm run code-circular -- --ratchet --base origin/main --exceptions-file tools/scripts/code/circular-baseline-exception.jsonpnpm run code-debt -- --gate --base origin/mainnode ts/tools/scripts/repo-policy-check.mjsfrom repository rootFocused benchmark selector:
incrementalBm25.spec.js|nativeAnswers.spec.js|chunkingBench.spec.js|memoryBench.spec.js.Memory-service selector:
indexedFragmentPolicy.spec.js|indexedFragmentPolicyIntegration.spec.js|indexedFragments.spec.js|answerKnowPro.spec.js|benchmarkBridge.spec.js|documentChunking.spec.js|retainedIndexService.spec.js|topicKnowPro.spec.js|viewSynthesisEvidence.spec.js|evidenceWindowUpgrade.spec.js.CI follow-through: Linux/Windows test jobs exposed a module-link failure in the
historical evidence-upgrade fixture: the frozen selector module did not expose
the current host's new
applyIndexedBlockPolicyadapter. Reproduced locallybefore the fix; the fixture now supplies that host helper alongside its
existing query-term shim. Frozen selector contents/checksum and both
unchanged-index upgrade assertions remain intact. All 40 focused
upgrade/block-policy/window regression cases pass after the correction.
These are local results; CI and human review are separate. One existing
view-publication archive-cleanup assertion passed the initial integrated run,
failed a later repetition, and passed its focused retry. No assertion was
weakened or disabled; the initial failure and retry are retained in validation
evidence. The 239-case total includes that passed-on-retry case.
Risks, limitations and rollout
raw-native-bm25-v2policy. Do not relabel or mutate old receipts. No new paid experiments were run during PR preparation.