Repository navigation
test: two-live-instance proofs over one sessions dir (#394/#405/#2401) - #2744
Conversation
- multi-instance-live: two spawned proxies share BILI_SESSIONS_DIR; pins serve-through-interleave, on-disk envelope always-valid + counter monotonic under a 5ms reader loop, stale-resident write rejection, convergence onto the disk lineage, and the tie-passthrough end state - multi-instance-persist (unit, two SessionStore over one dir): interleave storm never rolls back; documented residual pins for counter catch-up re-clobber (persist.ts:81-84) and content-store companion last-writer-wins — these flip red intentionally when the guard is tightened
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3000-pr.2744.3c80b3dThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2744.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 收到。这是一个 [PR] review 任务(两实例同 dir 的 live proof + persist 单测)。我先核对分支代码、CI 状态与既有行为回归面,再按八问体例给结论。开始审查。 |
[bot] 🏷 PR #2744 review 结论:可合(recommend merge) 证据(本地定向验证,非全量——全量交 CI):在 PR tip
结构化八问
判定:方向正确(正是「要搞最好彻底的搞」要点 B 要的那一层)、测试有牙(三个 unit 均非常态恒真断言,live 的 reader loop 是真并发牙)、引用准确、diff 干净(3 个纯新增文件,无跑题/无空行 churn)。建议合并,全量回归交 CI 把关。 |
|
The Fix queued in #2747 (2-line count update to the sibling rigs' |
[bot] 🏷 收到,诊断与我的独立核对一致。 我这边的独立证据(上一轮 review 已核实):本 PR diff 纯新增文件( 结论维持:代码层面可合;CI 全绿等 #2747(#2658 rig 的 我这边待命:#2747 合入 + 你 rebase 之后,若要我复核(rebase 后相邻套件,或再跑一遍 #2658 确认 @93c53e8c 2/6 vs @251cb961 6/6),说一声即可。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.268-master.b67d7d5 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Follow-up to the consumer-path proof audit (m04170 "要搞 最好彻底的搞", big-item B). The multi-instance researcher pass found NO test anywhere spawns two real servers over one
BILI_SESSIONS_DIR— the pool (session.tsmodule map) andSessionStoreare per-process singletons, so one-process tests cannot simulate resident divergence. This PR adds that tier.1. tests/multi-instance-live.test.ts (end-to-end, ~2s)
Spawns two child proxies (
tests/fixtures/multi-instance-child.ts, each with its own pool +SessionStore, 30ms debounce) over ONE sessions dir + state dir, mock anthropic upstream, one shared session id. Phases:stats.requests === 3#394+ "another bili instance" at registrationnextBlockId→staleDiskPayloadreturns null → passthrough; disk stays 6 and stays valid2. tests/multi-instance-persist.test.ts (unit, two
SessionStoreover one dir)persist.ts:81-84): a lagging instance that catches up numerically (tie requests + tienextBlockId) silently overwrites NEWER content. Pinned as CURRENT contract, explicitly not endorsed — this test turns red on purpose when someone tightens the guard (content fingerprints / writer epochs), forcing a conscious changesaveContentStore): last writer wins; refs only the other instance stored vanish from disk (degraded retrieves, not main-record corruption)Verification
Config surface
None — no config keys, env vars, or CLI flags added; children use existing
BILI_SESSIONS_DIR/XDG_STATE_HOME/BILI_PERSIST_DEBOUNCE_MS.Kernel boundary
None —
kernel/untouched; host-side tests only.Refs #394, #405, #2401.