Repository navigation
fix: make prefix-affinity chains permanent (#1724) - #1749
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1720-pr.1749.350dcffThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1749.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Picked up. This is a completed-work PR — verifying per protocol: fetching branch |
[bot] 🏷 Review of PR #1749 (head ① Issue direction. Follow-up to the #1724 LRU review: the 7-day TTL was the mechanism producing "chain idle >1 week loses recognition → resume forks a fresh session" — it directly contradicted the month/year-level single-session promise. The fix removes that mechanism (constant + sweep + gates) rather than masking the symptom, and keeps ② Regression walk — existing behaviors of the touched paths:
③ Code. Minimal and clean: no leftover ④ Tests. The two suites have teeth: LRU-cap test drives 1030 distinct conversations and asserts exactly 1024 tracked; import test asserts a 400-day-old entry imports (count=1) while malformed entries (non-string sessionId, non-number depth, null) still yield 0. Deterministic (Date.now() arithmetic with large offsets, no env luck). Minor gap (non-blocking): no direct unit pinning ⑤ Diff cleanliness. Single commit, 4 files, every line serves the purpose; no whitespace/lockfile churn. version-guard passed (no version bump on a content branch). Behavior change disclosure (old → new):
Verification reproduced locally on the PR head: typecheck clean; Verdict: 本 PR 可以合并。 中文摘要:修复了前缀亲和链 7 天 TTL 与「月/年级单会话」产品承诺矛盾的问题(闲置超一周的会话恢复时丢失识别、分叉出新会话)——移除 TTL 门控与清扫、链改为永久(仅在容量压力下按 LRU 淘汰,上限 256→1024),快照格式不变;已本地复验(typecheck 干净、两套件 29/29)并确认 CI 12 项全绿,注意 #1737 rebase 时必须同步去掉 normalizeForWrite 里的 TTL/256 重放,否则会在下次落盘时把本修复静默打回,可以合并。 |
The 7-day TTL contradicted the month/year-level single-session promise: a chain idle over a week lost its recognition, forking the resumed conversation into a fresh session on the next request. Chains are now permanent — they leave the table only under LRU capacity pressure (raised 256 -> 1024, ~8MB worst case): - drop the TTL gate in peekChain() and the sweep in resolve()/ findResumeParent(); lastSeen stays as the LRU/freshness tie-break - importSnapshot() no longer drops aged entries (400-day-old chains reattach); malformed-entry defenses unchanged - note for #1737: its normalizeForWrite TTL/256 re-application should be dropped on rebase; the union + deeper-depth-wins merge survives
303e95f to
82d97ae
Compare
Follow-up to the #1724 LRU review: the 7-day TTL contradicted the month/year-level single-session promise — a chain idle over a week lost recognition and the resumed conversation forked into a fresh session.
Verification: typecheck clean; affinity-persist + prefix-affinity suites 29/29.