Skip to content

[PR] test: pin the live session-resolve ladder (live twins + live-state resets) — #2989 - #2991

Closed
ranxianglei wants to merge 2 commits into
masterfrom
2026-10-12_session-resolve-twins
Closed

ranxianglei wants to merge 2 commits into
masterfrom
2026-10-12_session-resolve-twins

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What

The #2815 stack rewired production session identity to personaConversationOrder (src/session-resolve.ts, ddf366b) and retired src/persona-anchor.ts from the wiring. The proof surface kept driving the retired module: three suites pin its ladder, six suites reset only its (now inert) anchor map while the LIVE order skeletons never reset, and nothing pinned the new resolver's contract directly (#2988 finding ① class).

Changes

  1. tests/session-resolve-twins.test.ts (new, 14 tests) — live twins pinning the ladder where it runs:
  2. Old-vs-new parity probe (ephemeral, results below) — every scenario the retired pins cover agrees at the key level except (a)/(b); fork keys verified byte-identical (incl. whitespace-padded carriers — both hash the raw text).
  3. Retired-pin headers on dsh-persona-continuity, issue2601-persona-fork-lineage, issue2601-model-drift-absorption (the last notes divergence (a) explicitly: its strict "extra changed lines keep forking" cases migrate in the live resolver). Do-not-extend markers.
  4. Live-state resets: resetSessionOrderForTest() beside every resetPersonaAnchorsForTest() call site (durable-tool-identity, issue2481/2446/2447/2419, responses-instructions-drift) and in dsh-persona-fingerprint's startRig — previously these suites reset only the inert module, leaving the live skeletons map un-reset across tests.

Regression check (the issue's third ask)

  • No active regressions found: conversation ids are unique per test in the affected suites (checked), so the missing live reset was hygiene debt, not pollution.
  • The audit also confirmed the suspected production-visibility gap is real: the retired module is unreachable from the build graph (201/202 reachable files; persona-anchor is a true island together with 4 by-design registries/stubs).

Test evidence

  • New twins 14/14; affected suites 98/98 green (11 files + issue2419 + session-continuity-proof e2e 13/13); typecheck clean.
  • Corpus tests/issue2944-neutral-skeleton.test.ts unchanged and green.

Refs #2989

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-12_session-resolve-twins (5a03ab9)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.3388-pr.2991.d145a4d

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr2991.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

Follow-up commit a3f64b5 (小问题直接修, found during the pre-merge sweep): the #841 cold-load test in tests/search-context-cross-session.test.ts walked every top-level entry of the store dir as a subdirectory — the unified store (#2772) now writes a top-level index.db (+WAL siblings) there, so the scan died with ENOTDIR on master (deterministic, pre-existing, reproduced on origin/master before the fix). The walk now descends only into directories. Unrelated to the twins; parked on this branch per the minor-fix rule.

@ranxianglei
ranxianglei force-pushed the 2026-10-12_session-resolve-twins branch from a3f64b5 to 223e755 Compare October 13, 2026 06:45
…es that exercise it (#2989)

The #2815 stack rewired production session identity to
personaConversationOrder (src/session-resolve.ts) and retired
src/persona-anchor.ts from the wiring, but the proof surface kept
driving the retired module: three suites pin its ladder, six suites
reset only its (now inert) anchor map while the LIVE order skeletons
never reset, and nothing pinned the new resolver's contract directly.

- tests/session-resolve-twins.test.ts: live twins for the full ladder
  (claim/shallow tag claim/|sub:aux, match/ride, fork-lane byte
  continuity vs a locally computed sha256-16 so persisted pre-upgrade
  lanes keep their keys, grown/compacted reanchor, line-confined model
  switch migration, post-restart chain-race rescue + control, head
  truncation, #150 task lane) plus the two DESIGNED divergences from
  the retired ladder pinned explicitly: (a) header-corroborated
  absorption is looser (any persona change + declared model switch),
  (b) tag-less shallow first sight derives |sub:aux.
- Old-vs-new parity was probed exhaustively first: every scenario the
  retired pins cover agrees at the key level except (a)/(b).
- Mark the three retired-module suites as retired pins; do not extend.
- resetSessionOrderForTest() beside every resetPersonaAnchorsForTest()
  call site (incl. dsh-persona-fingerprint's startRig) so test
  isolation covers the live state.

Refs #2989
…nified store's top-level index.db broke the scan)
@ranxianglei
ranxianglei force-pushed the 2026-10-12_session-resolve-twins branch from 223e755 to 5a03ab9 Compare October 13, 2026 06:46
@ranxianglei

Copy link
Copy Markdown
Owner Author

Rebased onto master (663fdb2) after #2990 landed in parallel — same issue, overlapping surface. Resolution = union of intent:

Verification on the rebased head: twins + all affected suites 106/106 green, session-continuity-proof e2e 9/9, node scripts/check-test-import-graph.mjs ok, typecheck clean.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Upstream conflict resolved — rebased onto current master and pushed (683a4e13d+a3f64b54 → 32e2bd7a7+223e7551d).

What conflicted. Master moved while the branch sat open: #2990 (the sibling half of the #2989 stack) merged first and already did the rig-hygiene cleanup in the same 7 suites this PR touches — replacing the dead resetPersonaAnchorsForTest() imports/calls with resetSessionOrderForTest(). Both sides edited the same lines → 7 textual conflicts (plus one duplicated live-reset call in dsh-persona-fingerprint's startRig from independent additions).

Resolution. Rebased onto master (663fdb233); every conflict resolved to #2990's shape — the live-reset intent this PR carries is fully preserved there, and keeping the dead persona-anchor imports would trip #2990's new import-graph CI gate anyway (unlabeled import of an unreachable module). Net effect: the rebased commit now contains exactly what master lacks — tests/session-resolve-twins.test.ts (14 tests) + the three RETIRED-MODULE-PIN headers, plus the parked #841 minor fix. Final diff vs master: 5 files, +207/−2, all under tests/.

Verification on the rebased head (local, targeted):

  • twins 14/14; search-context-cross-session + the 3 dual-run ladder suites: 51/51 green
  • typecheck clean; check:test-import-graph gate ok (twins file imports only reachable modules)
  • production parity confirmed: handle.ts passes the raw system/instructions text + pluginReportedModel into personaConversationOrder, so the fork-lane byte-continuity pin (|sub:<sha256(system)[0..16]>) pins real production usage, not a library artifact; the tag-less |sub:aux case is correctly labeled library-defense (production guards empty tags verbatim)
  • parked minor fix verified empirically: a default-configured SessionStore leaves index.db/-shm/-wal at the store-dir top level (unified shadow mode, fix: survive a corrupt unified index by degrading to legacy-only (#2771) + storage-engine proof battery #2772) → the old scan's readdirSync(dir/index.db) throws ENOTDIR deterministically; the isDirectory() guard is the right minimal fix
  • full regression delegated to CI per local-test discipline

State. Merge conflict cleared (mergeable=true; blocked = waiting on required checks, not a conflict). CI on new head 223e7551d: e2e-dsh-plugin-lane ✅, PR Build Artifact ✅, main CI in progress — I'll follow up here if anything goes red.

结构化结论(八问):

  1. 是什么问题:PR 分支落后于 master——同属 Test debt: suites still pin the retired persona-anchor ladder after the v2.2 wiring swap — dual-run them against the live resolver (ework work item) #2989 栈的 test(persona): dual-run retired persona-anchor pins against the live session-resolver + import-graph gate #2990 先合入,对同样 7 个测试文件做了重叠的 rig-hygiene 清理,本分支与目标分支文本冲突(merge state dirty)。
  2. 什么原因导致的:两个并行分支修同一 issue 的同一批行,test(persona): dual-run retired persona-anchor pins against the live session-resolver + import-graph gate #2990 先合并;本 PR 基于其之前的 master,冲突是重叠工作的预期结果,不是内容分歧。
  3. 影响范围与严重程度:纯测试代码,无生产行为面;冲突期间 PR 不可合并,用户不受影响。
  4. 怎么修复的:rebase 到最新 master;7 处冲突全部取 test(persona): dual-run retired persona-anchor pins against the live session-resolver + import-graph gate #2990 形态——live reset 意图在 master 侧已完整存在,而保留死的 persona-anchor import 会违反 test(persona): dual-run retired persona-anchor pins against the live session-resolver + import-graph gate #2990 新增的 import-graph CI 门禁(除非加 retired-module 标签,但那 7 个文件本就不是 pin 套件)。
  5. 是否回归:无。7 个冲突文件解决后与 master 逐字节一致(零 diff,行为=master 已测状态);3 个头部文件同时保留 test(persona): dual-run retired persona-anchor pins against the live session-resolver + import-graph gate #2990 的 dual-run 说明与本 PR 的 RETIRED-MODULE PIN 头,已核对无重复无矛盾;定向验证 51/51 绿 + typecheck + import-graph 门禁;全量回归由 CI 把关。
  6. 是否破坏缓存:不涉及(纯测试变更)。
  7. 是否改设计方向:不涉及。
  8. 是否引入新配置:不涉及。

判定:冲突已解除,CI 全绿后即可由人合并(按规则我不执行 merge)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Confirmed the final head (5a03ab99c) after your dedup pass — verified, no objections:

  • Diff vs master is now minimal: 2 files, +186/−2 — tests/session-resolve-twins.test.ts (new) + the feat: 支持 search_context 显式查询历史 session #841 cold-load fix. The dropped headers were pure dedup: all three suites keep test(persona): dual-run retired persona-anchor pins against the live session-resolver + import-graph gate #2990's // retired-module pin: persona-anchor labels (import-graph gate still satisfied), and divergence (a) stays documented both in the twins file (pinned with rationale) and in issue2601-model-drift-absorption's dual-run block. No load-bearing info lost.
  • Re-ran on this exact head: targeted 51/51 green (twins 14 + search-context + the 3 dual-run ladder suites), check:test-import-graph ok, typecheck clean (from my earlier run on the identical tree minus comments).
  • My prior findings stand: production call sites pass raw system/instructions + pluginReportedModel into personaConversationOrder, so the fork-lane byte-continuity pin matches real usage; the feat: 支持 search_context 显式查询历史 session #841 ENOTDIR repro was confirmed empirically (default store leaves index.db/-shm/-wal at top level).

State: mergeable=true, conflict-free (blocked = required checks only). Main CI on 5a03ab99c in progress (PR Build Artifact already ✅) — I'll follow up here if it goes red; otherwise ready for you to merge when it's green.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

CI update on 5a03ab99c: first pass was red on exactly ONE job — test (windows-latest, 22) — and the rerun I triggered is now fully green. The whole run is passing; ready to merge whenever you are.

What failed (one test, unrelated to this PR):

not ok 5049 - storage engine: full-mode restart is invisible on the chat wire
error: "EBUSY: resource busy or locked, unlink '...Temp\golden-chat-0RuQsl\sessions\index.db'"
(tests/storage-engine-proofs.test.ts; all other legs green in the same run: ubuntu-22/24, windows-24)

Why it's not this PR's fault:

No action needed on the PR itself — conflict resolved, tests verified locally (51/51 targeted + gate + typecheck), CI green after rerun. Per repo rules the merge stays with you.

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

孤儿票清理:标题指向的 issue 已关闭,修复已由其他路径落地。关单;误判请 reopen。

@ranxianglei ranxianglei changed the title test: pin the live session-resolve ladder (live twins + live-state resets) — #2989 [PR] test: pin the live session-resolve ladder (live twins + live-state resets) — #2989 Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant