Repository navigation
fix(store): correct hybrid FTS time/scope bindings - #87
Merged
Merged
Conversation
Move repeated ORDER BY IDs after all WHERE parameters without changing SQL predicates, candidate bounds, ranking weights or vector precision. Add positive FTS/time/multi-key-scope regressions and strengthen scoring parity to cover hits. Close the tracked TODO, document the binding contract and record a bounded context-level decoded/borrowed comparison only after correctness is restored.
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.
变更描述
What:修复 hybrid 检索在 FTS 命中时的 SQL 位置参数错位,补齐真实命中与时间/多键 scope 的组合回归。
Why:ORDER BY 的重复 FTS ID 原先在 WHERE 的日期与 scope 参数之前绑定,导致合法结果丢失,受控日期窗口还可能错误放行记录。没有用空结果相等代替正确性验证,也没有估计生产缺陷发生率。
Changes:
retrieval.ts只移动 ORDER BY ID 参数列表,不改 SQL 条件、候选上限、权重、精度或 API。searchContext路径的 decoded/borrowed scoring:300 条 synthetic memory、1024D、三个交替进程对、每种实现 192 次计时。总体中位数 10.3724 → 7.1587 ms(降低 31.0%),正向 FTS 10.8198 → 7.9370 ms(降低 26.6%);所有配对结果、完整分数、QPP/selection 与非计时 AG usage 精确一致,storage fingerprint 不变。详见 experiment。未验证项
Not verified:
真实 LoCoMo/Qwen 缓存嵌入、用户报告的约 40% 增益、production incidence、hierarchical semantic node/leaf routing、真实 chain 数据、trace 写入开销、RPC/harness/network、cloud/Sites/WASM/VFS、部署与恢复行为。没有调用 live provider 或 official benchmark。三个工作站进程对不是普遍或最坏情况速度保证。local advisory research/chaos 未运行,CI 的实际状态另由 forge 观察。
完成检查项
本地质量检查
verify:static的全部原子检查通过(经相同 blocking membership 的 scopedagent:verify)。test:product1687/1687 通过,0 failures/cancelled/skipped/todo(scopedagent:verify的完整 product suite,不是 impact subset)。check:lock通过,npm audit --omit=dev --audit-level=high为零漏洞。verify:packagesfrozen-install/build 通过。RCP(Repository Control Plane)
repo-developmentin-flight entry1791618473528_000495,现已 resolve。npm run agent:verify -- <九个路径>的 16 个 blocking checks 全通过:precommit receiptd523f2f5-88ba-4c2d-90d4-5a57801ea2dd;exact-head--require-cleanreceipt0b8bc332-7156-4ac3-bfa6-d85520b327b2,head1c56d47509197c663e1d31adca88cf1ef4c7ccae,dirty paths 0,timeout 150000ms,outer exit 0 / 72.788s。node bin/nmg-rcp.mjs forge-status --pr 87 --json已观察 required checks SUCCESS(run38040192830)。Windows chaos 在该 run 为 SKIPPED,不计作执行通过。CI 完成确认
All checks passedSUCCESS。PR remains OPEN/draft for review; merge/deployment not claimed. Push 提示默认分支已有一项 moderate Dependabot advisory;这与 local production audit 零漏洞是不同范围的观察。
Verification exit attribution
首次提交后同步调用的内层 receipt
96bd1922-dec1-4bdb-b30b-a33dc813c386为 clean head1c56d475、150000ms、16/16 passed、70.084s;但外层 tool 报 TIMED OUT(320.621s),不计作成功的 whole-shell exit。日志/receipt 保留。相同命令通过 windowsHide、file-backed stdio 的独立运行器重跑,outer exit 0 / 72.788s,receipt0b8bc332-7156-4ac3-bfa6-d85520b327b2,16/16 blocking checks、1687/1687 product tests 通过;没有改变 gates 或 deadline。临时运行器已删除。这不能诊断首次外层超时的根因。