Repository navigation
[PR] kernel: map search preview offsets back to original Unicode text - #6686
ranxianglei wants to merge 3 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11159-pr.6686.419701fThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6686.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: opencode/qwen3.8-27b) 查重: 不重复 —— 本 PR 是 #6493 的 kernel 侧切面,host 侧修复在 #6494。两者分属不同 npm 包(acp-kernel 与 billion-context)、独立版本节奏,按包边界拆分成立;#6494 目前仍 open 未合,但两边触碰的文件不相交,无合入顺序依赖。 Review 结论:代码正确、测试有效、diff 干净 —— 可合(human-only tier,等 owner 合并)。 以下为独立验证,不是复述 PR 描述:
顺手小修(独立 commit CI:检查时 PR 的 47 个 check 全部 queued(PR 刚开);我推注释修复后重新入队。最终绿/红以远程 CI 为准。 结构化八问:
判定:修复机械安全,回归测试有牙(已验证 pre-fix 失败、post-fix 通过),diff 收敛到目的;唯一事实错误(注释里的 ſ)已在独立 commit 顺手修掉。kernel 变更适用 human-only review tier,可合,等 owner 合并(CI 绿为最终门禁)。 |
fab2ecb to
966b5e7
Compare
(ai: opencode/qwen3.8-27b) Merge conflict resolved. Rebased the PR branch onto current master and force-pushed the final head. What I did this run:
CI: the stale mirror cache (last polled 2026-11-14) showed no red checks — only the merge conflict was blocking. The final green/red verdict comes from the remote CI on the pushed head 结构化八问:
判定:冲突已解、定向测试绿、head 已推送,PR 现为 clean,等远程 CI 在 |
(ai: opencode/qwen3.8-27b)
Root cause: my previous rebase resolved the version conflict to Fix (one mechanical commit
No other drift in either lockfile (verified the diff is only the version lines). Verified locally before pushing: ran both lock-sync checks — CI: the mirror cache still shows the previous run ( 结构化八问:
判定:lock-sync 已修、本地双 lockfile 检查绿、最终 head |
(ai: opencode/qwen3.8-27b) No new work needed — this event reports a stale head. The Re-verified live in this run (not from memory):
The mirror cache is still showing the old head |
(ai: vllm-qwen/qwen3.8-27b) Independent review — PR #6686 (kernel: map search preview offsets back to original Unicode text) I reviewed this from scratch (not from the earlier review thread). Verdict up front: the fix is correct, the regression tests have teeth, the diff is clean, and Kernel Boundary conventions are met. The only gate is the human-only review tier for kernel changes — I cannot approve it; it needs the owner's merge. No blocking findings. What I independently verified on head
House conventions (Kernel Boundary): No small findings to fix — the code is correct as-is; I did not need to add any fix commit. 结构化八问:
判定: 修复机械安全、回归测试有牙(已独立验证 pre-fix 失败 / post-fix 通过)、diff 收敛到目的、Kernel Boundary 合规。kernel 变更适用 human-only review tier——我无法 approve,需 owner 人工合并;代码本身无阻塞项。 |
🔶 需要决策 PR #6686 (kernel: map search preview offsets back to original Unicode text) touches Gated diff awaiting your authorization (the kernel change):
Requesting owner authorization to merge (human-only tier). CI on head |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review summary (task #6686 review-lane, head fb74592): What I did: Independently reviewed the full diff (kernel/src/search/index.ts + kernel/tests/search.test.ts + kernel/package.json 0.0.199→0.0.200 + 2 lockfiles) against the linked defect #6493 and host-side fix #6494. Verified (not copied from prior thread):
Verdict: Code is correct, tests have teeth, diff is clean, Kernel Boundary compliant (kernel-change declaration present, kernel: commit prefix, version bump 0.0.199→0.0.200). No blocking findings. No small findings to fix. Cannot approve — this is a kernel/ change and sits at the human-only review tier per the Kernel Boundary. Posted a 🔶 需要决策 comment requesting owner authorization; |
makePreview located the hit in text.toLowerCase() but windowed the ORIGINAL text at that lowercased offset. Lowercasing expands U+0130 (İ) and U+017F (ſ) from one to two UTF-16 units, so any expanding character before the hit shifted the window right; for long text the window slid past the end and the preview came back empty for a real match. Map the hit offset back to the original before subtracting the half-window (originalOffsetOf) — the same span-mapping the host-side fix in billion-context#6494 uses for its evidence snippets. Regression tests pin both the distant (400x İ) and mid-text cases; both fail on the pre-fix windowing and pass after. kernel 0.0.197 -> 0.0.198.
…ngth A full-repertoire scan (Node 22 / V8) shows U+0130 (I with dot above, 1 to 2 UTF-16 units) is the only code point whose toLowerCase() changes length; U+017F (long s) is a fixed point (1 to 1). The comment claimed both expand — factually wrong. The mapping itself is unchanged and correct for any per-character length change; only the stated fact is fixed.
…ernel version bump)
fb74592 to
f408d6a
Compare
(ai: opencode/qwen3.8-27b) Merge conflict resolved (re-rebase). Re-verified live first: master had advanced to What I did:
CI: the mirror cache still shows the previous head 结构化八问:
判定:冲突已解、定向测试绿、双 lockfile 检查绿、head |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review at new head f408d6a (was fb74592). What changed since my last review: the branch was rebased onto latest master (merge-base ba2e819, master now at kernel 0.0.201). The code ( Verification (re-confirmed at the new head):
Verdict: Code is correct, tests have teeth, diff is clean, Kernel Boundary compliant (kernel-change declaration present, kernel: commit prefix, version bump 0.0.201→0.0.202, lockfiles in step). No blocking findings. No small findings to fix. The rebase introduced no regression. Cannot approve — kernel/ change, human-only review tier per the Kernel Boundary. See the 🔶 需要决策 comment below for the authorization request. 八问(中文,供人工 reviewer):
判定:代码正确、测试有牙、diff 干净、Kernel Boundary 合规,无阻塞项;因属 kernel 人审层,不 approve,待 owner 人工授权合并。 |
🔶 需要决策 PR #6686 (head f408d6a) 触碰 被门禁的 diff(merge-base ba2e819 → head f408d6a,5 文件):
review-lane 结论:代码正确、测试有牙(新 head 实测 54/54)、diff 干净、Kernel Boundary 合规、无阻塞项、无小问题需顺手修。rebase 干净(代码与上轮 fb74592 逐字节一致,仅版本号随 master 前进)。CI 0 失败。 等待 owner 人工 kernel 层授权后合并。 |
[ework] CI fix verified green ✓ |
kernel-change: fix lowercased-offset drift in search preview windowing — mechanical port of the host-side fix from #6494 (kernel-side facet of #6493)
What
makePreview(kernel/src/search/index.ts) located the first query-term hit intext.toLowerCase()but windowed the original text at that lowercased offset. Lowercasing expands U+0130 (İ) and U+017F (ſ) from one to two UTF-16 units, so any expanding character before the hit shifted the preview window right. For long text the window slid past the end of the string and the preview came back empty (…) for a real match.This is the kernel-side facet of the same defect family as #6493 (host-side
search_contextevidence snippets, fixed in #6494). Host and kernel are separate packages with separate version cadences, so the kernel fix ships here rather than in #6494.Fix
Map the hit offset back to the original text before subtracting the half-window (
originalOffsetOf) — the same span-mapping #6494 uses. The mapping is exact because the only length-changing lowercasing rules (İ, ſ) are context-free (per-character == whole-string); contextual rules (Greek sigma) are length-preserving and do not affect the offset arithmetic.Why mechanically safe
makePreview; no change to scoring, ranking, matching, or any other preview path.clampWindowalready snaps both edges off surrogate pairs, so the mapped start stays surrogate-safe.Regression tests
Two new tests in kernel/tests/search.test.ts, both verified to FAIL on the pre-fix windowing and PASS after:
…).kernel 0.0.197 → 0.0.198 (CI-enforced version discipline for kernel/src/** changes).
Human-only review tier applies (Kernel Boundary rule 3); this is a mechanical-bug-exemption fix (owner policy 2026-11-06) — no pre-approval issue, reproducing regression tests included.