Skip to content

[PR] test: pin #1387 stop-signal geometry to preserveRecentMessages 5 (#3061 follow-up) - #3074

Closed
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-13_pin-1387-tail-geometry
Closed

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-13_pin-1387-tail-geometry

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Follow-up to #3067 (merged on its 2-commit head — the third commit landed on the branch only and is not on master).

What

The two #1387 tail tests in tests/compress-success-tail.test.ts — "clean success that drains every compressible range emits the stop signal (pi #521)" and "partial failure (some ranges rejected) keeps the old silent tail" — were written against the then-default preserveRecentMessages: 5: 7 messages, fold m00001–m00002, the remaining 5 sit in the protected recent zone. They took that default implicitly via makeCtx() (no overrides).

Why they are red on master now

#3058 tuned the kernel default preserveRecentMessages 5 → 3. Under 3 the recent window only covers the last 3 messages, so after the fold a live range (m00003–…) stays actionable — the drained-state stop signal never fires and both tests fail deterministically (all 4 OS/node test lanes; seen as the only 2 remaining red tests on #3067's CI run 38426277025).

Fix

Pin preserveRecentMessages: 5 explicitly in both tests' makeCtx() overrides and spell out in the comments that 5 is the legacy tuning the geometry was designed under, not the owner-tuned default. The contract under test is the stop-signal semantics (#1387, pi #521); the default value itself is pinned by the wire-contract golden (tests/golden/wire-contract/kernel.json preserveRecentMessages: 3).

Test evidence

  • node --import tsx --test tests/compress-success-tail.test.ts: 8 pass / 0 fail ×3 consecutive runs (6 pass / 2 fail on master before this).
  • Full-suite verdict: CI lanes on this head.

… follow-up)

The two #1387 tail tests were written against the then-default
preserveRecentMessages 5 (7 messages, fold m00001–m00002, the remaining 5
sit in the protected recent zone) and took that default implicitly via
makeCtx(). #3058 tuned the kernel default 5 → 3, so after the fold the
recent window only covers m00005–m00007 and a live range (m00003–…) stays
actionable — the drained-state stop signal never fires and both tests fail
on every CI lane (all 4 OS/node test lanes on #3061 and #3067 runs).

The contract under test is the stop-signal semantics (#1387, pi #521), not
the default tuning — the default is pinned by the wire-contract golden
(kernel.json preserveRecentMessages: 3). Pin the geometry explicitly and
spell out in the comments that 5 is the legacy tuning the geometry was
designed under, not the owner-tuned default.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-13_pin-1387-tail-geometry (afe08df)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.3487-pr.3074.ebda485

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-pr3074.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

PR 审核结论(独立审核,已核代码与 CI)

这个「issue」即本 PR(#3074 = GitHub 同号 PR)。我没有重做工作,而是按 PR 审核流程独立核验了 diff、机制与 CI。

核验过程(非照抄描述):

  • diff 逐行读过:仅动 tests/compress-success-tail.test.ts,两个 compress 成功输出缺剩余范围快照与停止提示(pi 侧 #420/#521 对齐) #1387 测试的 makeCtx() 显式钉 { preserveRecentMessages: 5, preserveRecentTokens: 0 },注释同步改写。除 issue 要求的 preserveRecentMessages: 5 外还多钉了 preserveRecentTokens: 0——这是严格加分项:保护窗是 last-N-messages 与 last-N-tokens 两规则的并集(kernel/src/recommend.ts:103-121),token 规则只会加保护不会减,但钉 0 消除了对 token 默认值(5000)的残余耦合,与本文件其余测试的钉法一致。
  • 注释里的两个事实主张都查证为真:默认 3 由 ca93ef49f kernel: default preserveRecentMessages 5 → 3 (#3058) 引入;「default 由 wire-contract golden 钉住」属实——tests/golden/wire-contract/kernel.json:1650-1651 钉着 preserveRecentMessages: 3 / preserveRecentTokens: 5000。
  • 几何推演成立:fold m00001–m00002 后存活消息恰为 m00003–m00007 共 5 条,钉 5 后全部落入保护区 → 测试 1 进入 drained 态、停信号触发;测试 2 提交的 m00003–m00007 整段受保护被拒 → 走 partial-failure 门。tail 的重算路径(src/stream.ts:506-527)消费 ctx.config,override 确实生效。
  • 溯源核实:issue 所说「第三个 commit 只落在分支上」属实——fix: unblock master lanes — restore personaNamespace import + storage-render goldens after #3061 #3067 分支顶端有游离 commit 152cc415a(同标题同文件),其补丁与本 PR head afe08df00 的 diff 逐字节相同(md5 一致)。本 PR 就是该工作在当前 master 上的干净重切,无内容漂移。
  • CI:head afe08df00 上 19/19 check runs 全绿(含 ubuntu/windows × node 22/24 四条 test lane、kernel-guard、static-gates 等),mergeable_state: clean。

结构化八问:

  1. 是什么问题:两个 compress 成功输出缺剩余范围快照与停止提示(pi 侧 #420/#521 对齐) #1387 停信号测试的消息几何隐式依赖旧内核默认 preserveRecentMessages: 5;compress.preserveRecentMessages default 5 → 3 (kernel default + web display + docs) #3058 把默认调到 3 后,master 上这两个测试确定性变红。
  2. 什么原因导致的:根因是测试夹具对可变内核默认的隐式依赖(makeCtx() 无 override);compress.preserveRecentMessages default 5 → 3 (kernel default + web display + docs) #3058 的有意调参改变了被测几何(fold 后仍留活动 range,drained 停信号永不触发)。次生原因:原修复 commit 在 fix: unblock master lanes — restore personaNamespace import + storage-render goldens after #3061 #3067 合并时落在分支顶端未进 master,红一直留在 master。
  3. 影响范围与严重程度:仅 CI——master 四条 test lane 各挂这 2 个测试;零生产行为影响(test-only)。
  4. 怎么修复的:在两个测试里显式钉回设计该几何时的旧调参(5+token 0),注释写明 5 是 legacy 几何而非当前默认;被测契约(停信号语义,compress 成功输出缺剩余范围快照与停止提示(pi 侧 #420/#521 对齐) #1387/pi feat: dsh 进 PLUGIN_AGENTS——native 插件部署 + 拦截层(native 模式 D) #521)保持不变,默认值治理仍归 compress.preserveRecentMessages default 5 → 3 (kernel default + web display + docs) #3058 + golden。修的是「隐式依赖」这个根因,不是把断言改成迁就新默认。
  5. 是否有回归问题:无。审过的既有行为:同文件其余测试各自显式钉 override(不受影响)、golden 仍钉默认 3 未被触碰、config surface / wire / 持久化 / kernel 零改动,无语义漂移、无 fail-fast 变化。
  6. 是否破坏缓存:不涉及(无运行时代码)。
  7. 是否改了设计方向:没有——与 issue 方向一致:契约照旧测几何,默认值归 owner 调参管。
  8. 是否引入了新的配置:不涉及(测试内 override,非配置面)。

判定:可合并(等人工 merge;我不合 PR)。分支命名合规、单 commit、diff 每行都与本 PR 目的相关。

@ranxianglei

Copy link
Copy Markdown
Owner Author

关闭:superseded by #3084。同一 #1387 PRM=5 test pin 已由 #3084 合并(master 多个测试文件已带 preserveRecentMessages=5 钉死),本 PR 仅 2 行,纯冗余。(孤儿 PR 扫描)

@ranxianglei ranxianglei changed the title test: pin #1387 stop-signal geometry to preserveRecentMessages 5 (#3061 follow-up) [PR] test: pin #1387 stop-signal geometry to preserveRecentMessages 5 (#3061 follow-up) Oct 21, 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