Repository navigation
test(persona): dual-run retired persona-anchor pins against the live session-resolver + import-graph gate - #2990
Conversation
…ion import graph (#2989) A green suite over a retired module guarantees nothing about the wired path: #2988 finding ① shipped while every persona-anchor pin stayed green. New zero-dep gate scripts/check-test-import-graph.mjs BFS-walks the tsup entry set and fails on any tests/** import of an unreachable src module unless whitelisted (test-only registries marker/spec.ts, exit-matrix.ts) or the importing file carries a 'retired-module pin' label. Wired into ci.yml as the test-import-graph leg gating both test and static-gates.
…session-resolver (#2989) The #2815 stack swapped production session-identity wiring to personaConversationOrder (src/session-resolve.ts); persona-anchor.ts is retired from production but at least seven suites still pinned it. - issue2601-model-drift-absorption: 7 live-twin tests over the same corpus — shared expectations where OLD and NEW agree (absorption keeps the raw key, fork keys byte-identical), designed divergences marked: v2 folds model-switch absorption into the reanchor branch (no separate action), requires a deep main-shaped history (shallow switches fork), and never parses system line-diff (drift + header change rides raw). - dsh-persona-continuity: twin unit block with one shared key expectation per old-ladder row; e2e rigs already run through live wiring and pass unchanged. - issue2601-persona-fork-lineage: twin for the resolvePersonaKey migrate row — the re-serialized switch rides raw via the continuation branch on order+fragment evidence; control arm proves unproven switches still fork. Part-A chainContinues rows kept: prefix-affinity stays LIVE (server.ts anonymous-ladder). - Category B (fingerprint/durable-tool-identity/issue2419/2446/2447/ 2481/responses-instructions-drift): rig hygiene now resets the live session-order registry instead of the retired anchor ladder (dsh-persona-fingerprint's import was dead — its absence leaked skeletons across rigs; now reset in startRig like every sibling). - issue2944-neutral-skeleton / session-continuity-proof: label stale references to the retired module. Targeted verification: 12 suites, 91 tests green; typecheck clean; new import-graph gate passes.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3384-pr.2990.8ef387eThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2990.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 已完成 #2990 审查(agent-authored [PR],走 review 姿态:拉分支核对代码 + 独立复算 + 确认 CI,未重做实现)。结论先行:可合(mergeable),按 §7.4 触及 结构化八问1. 是什么问题 2. 什么原因导致 3. 影响范围与严重程度 4. 怎么修复的(四个 ask 逐一对应)
5. 是否有回归问题(逐项过既有行为)
6. 是否破坏缓存:不涉及。无持久化格式/版本变更;fork key 字节格式 7. 是否改了设计方向:不涉及。不转向架构/边界/数据流;只是让测试对齐既有接线 + 加一道静态门禁(镜像既有 8. 是否引入了新的配置:不涉及运行时配置。仅新增 质量 & diff 整洁度
CI 状态head 收工判定可合。 方向正确、零生产回归、twin 有牙、diff 干净、新门禁独立验证通过。等最后 2 个 Windows test job 落地即可合并;若翻红我再定向排查。按 §7.4 我不代合,请人工 merge:#2990 |
[bot] 🏷 更新:CI 已全部落地 —— head 上一条八问结论维持:可合。零生产回归、twin 有牙、新门禁独立验证通过、diff 干净。请人工 merge:#2990 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.362-master.663fdb2 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2989
What this is
The #2815 stack swapped production session-identity wiring to
personaConversationOrder(src/session-resolve.ts);src/persona-anchor.tsis retired from production (comment refs only). At least seven suites still imported and pinned the retired module directly — a green matrix that guarantees nothing about the wired path. #2988 finding ① is the proof: the post-restart persona race shipped while every persona-anchor pin stayed green.Changes
Inventory (ask 1): an import-graph audit (BFS from the 16 tsup entries) found exactly one unreachable module with test importers:
src/persona-anchor.ts. The other unreachable modules are intentional test-only registries (src/marker/spec.ts,src/exit-matrix.ts) plus build-time artifacts (pi-host-stub.ts,.d.tsshims).Dual-run (ask 2), patterned on
tests/issue2944-neutral-skeleton.test.ts:tests/issue2601-model-drift-absorption.test.ts— 7 live-twin tests over the same corpus. Shared expectations where OLD and NEW agree (absorption keeps the raw key; fork keys byte-identical${id}|sub:<sha16>). Designed divergences, each marked with the justifying principle:reanchorbranch — no separate action (the ladder'smigrate-modelwas a display distinction; the key outcome is identical);≥3 turns incl. assistant) before trusting the two host declarations — shallow switches fork where the old ladder absorbed;tests/dsh-persona-continuity.test.ts— twin unit block, one shared key expectation per old-ladder row (claim/match/migrate/fork/passthrough all agree on the KEY; actions differ by design). Both e2e rigs already run through live wiring and pass unchanged.tests/issue2601-persona-fork-lineage.test.ts— twin for theresolvePersonaKeymigrate row: the re-serialized model switch rides raw through the continuation branch on order+fragment evidence (the dsh anthropic-messages lane bypasses native-intercept fetch patch: anonymous pfa-* session, fold ledger orphaned, silent ~182s re-fold on cross-protocol switch #2791 projection fragments equal across provider re-serialization — verified insrc/affinity-neutral.ts). Control arm: same prefix with a genuinely different tail still forks when nothing corroborates it. Part-AchainContinuesrows kept unmodified:prefix-affinitystays LIVE (server.ts anonymous-ladder consults it).Clean up (ask 3): Category-B suites (
dsh-persona-fingerprint,durable-tool-identity,issue2419,issue2446,issue2447,issue2481,responses-instructions-drift) now reset the LIVE session-order registry in rig hygiene instead of the retired anchor ladder. Notable:dsh-persona-fingerprint's import was dead (never called) — its absence leaked session-order skeletons across rigs; now reset instartRiglike every sibling suite. Retired-module pins kept for characterization are labeled// retired-module pin: persona-anchor.Hardening (ask 4): new zero-dep CI leg
test-import-graph(scripts/check-test-import-graph.mjs) fails when anytests/**file imports a src module absent from the production import graph, unless whitelisted (the two test-only registries) or labeled with aretired-module pincomment. Gates bothtestandstatic-gatesjobs. The debt cannot silently re-accumulate on the next wiring swap.Behavior changes
None in production code. This PR touches only
tests/, one newscripts/lint,package.jsonscripts, andci.yml. The twin tests PIN pre-existing production behaviors that differ from the retired ladder (shallow-history switches fork; system line-diff is not inspected) — those shipped with #2815, they are not introduced here. One test-isolation fix:dsh-persona-fingerprintrigs previously leaked session-order state between tests (dead reset import); each rig now starts cold.Verification
node --import tsx --test <files>) — full regression left to CI per local-testing discipline.npm run typecheckclean;node scripts/check-test-import-graph.mjspasses (every remaining persona-anchor import is labeled; both registries whitelisted).