Skip to content

[PR] fix(#5943): requireNudge judges a nudge credit window, not this-round arm - #5945

Merged
ranxianglei merged 4 commits into
masterfrom
2026-11-08_nudge-credit-window
Nov 10, 2026
Merged

ranxianglei merged 4 commits into
masterfrom
2026-11-08_nudge-credit-window

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

是什么问题

开了 compress.requireNudge(禁止未提示压缩)后,模型只在「nudge 实际注入的那一轮」能调 compress,隔轮回来把 nudge 推荐的剩余范围压完 → 每一轮都被拒(现场:session 01a1b6a5,18:41 当轮压成功 5 块后,18:42–18:46 连续 4 轮 REFUSED,全部白烧)。多轮清理式压缩这个最常见用法被整个禁掉了。

根因

src/server/handle.ts 每轮 prepare 重新盖章 armed: prepared.nudgeOutcome === "injected" —— 资格是单轮布尔,无跨轮延续。src/stream.ts applyRanges 里 requireNudge && !armed → 拒。

修法(nudge credit)

armed 从「本轮布尔」改为 nudge 信用窗口(src/unprompted-gate.ts):

  • 注入轮铸券 K=20 个模型轮(NUDGE_CREDIT_ROUNDS 常量,无新配置面);
  • 新 nudge 刷新窗口;每个未提示的模型轮衰减 1;非模型请求形态(countTokens / responsesCompact / codexForge / threadsLane)既不刷新也不衰减;
  • 成功折叠不消耗信用(见下方偏离说明)——长期严格性由增长驱动提醒保证:安静会话 K 轮后回到严格拒绝,增长中的会话持续刷新;
  • requireRecommendation 范围门不动;拒收回执文案同步改为「信用过期 / 从未铸券」并写明窗口长度。

⚠️ Behavior change(opt-in only,默认关 = 零变化)

compress.requireNudge 的放行条件:旧 = 仅 nudge 注入当轮 → 新 = 距最近一次真实注入 ≤ 20 个模型轮内(新注入刷新、未提示模型轮逐轮衰减、折叠不消耗)。该开关默认未开,未开启者行为完全不变;已开启者的跨轮清理压缩从「全拒」变为「窗口内放行」。

对 issue 修复建议第 3 条的偏离(已在 issue 线程披露)

issue 建议「券在首次成功折叠时消耗、下一轮边界作废」。按现场回放推演:18:41 那次当轮折叠就会吃掉券,18:42–18:46 的四连拒依旧发生——issue 标题现象(多轮清理全白拒)修不掉。故采用纯窗口语义;若 owner 更想要一次性语义,是几行内的 follow-up(消耗点加进 applyRanges 成功路径即可),等拍板。

验证

  • 定向测试:tests/issue5683-forbid-unprompted-compress.test.ts 22/22 绿(新增 5 例:窗口内延迟履约、K±1 双向过期、衰减中刷新、折叠后继续、非模型形态保持);
  • npm run typecheck 干净;全量回归走 CI。
  • 触碰文件不在 verif 守护清单内;无 kernel/ 改动;无配置面新增(K 为代码常量,符合 owner spec)。

Closes #5943

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-08_nudge-credit-window (9ad3db7)

Latest build — install this exact version

npm install -g billion-context@0.0.8756-pr.5945.e84eae6

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

Recent builds (commit → version)

commit version build
9ad3db7 billion-context@0.0.8756-pr.5945.e84eae6 build
4461fe3 billion-context@0.0.8727-pr.5945.95d7be1 build
ea2b895 billion-context@0.0.8723-pr.5945.461aee9 build
e6210e5 billion-context@0.0.8712-pr.5945.f8b7780 build
cd98cca billion-context@0.0.8629-pr.5945.cb70af5 build
98409f9 billion-context@0.0.8625-pr.5945.cdd0302 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei added bug Something isn't working p2 scope/kernel labels Nov 8, 2026
@ranxianglei ranxianglei changed the title fix(#5943): requireNudge judges a nudge credit window, not this-round arm [PR] fix(#5943): requireNudge judges a nudge credit window, not this-round arm Nov 8, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI auto-fix run (attempt 1/3) — both red gates fixed and verified green on the new head cd98cca82d.

查重: 不重复 — this is the CI-blocker lane for this PR; before my push no earlier wake had landed a fix (branch head was still the failing sha 98409f90a2), so there was nothing to reconcile with.

What was red, and why:

  1. unused-exports — src/unprompted-gate.ts exported UnpromptedGate / UnpromptedGateStamp, referenced nowhere outside their own file (INTERNAL_ONLY per the audit: 全仓冗余审计与重构计划——server.ts 解体、客户端矩阵去重、死代码、AGENTS.md 模块图腐化 #1440 P6 gate).
  2. docs-sync ([docs][website] 配置文档单一事实源:从声明式 schema 生成 CONFIGURATION.md 与网站 /docs/(一步到位) #2107 drift guard) — the PR hand-edited the GENERATED docs/configuration.md / docs/configuration.zh-CN.md (table row + detail section for compress.requireNudge) without updating the single source of truth website/config-reference/compress.yaml; regenerating from the seed reverted those lines → drift → red.

Fix (one labeled commit, cd98cca82d):

  • Dropped the leading export from the two interfaces — pure type-visibility change, zero runtime effect. UnpromptedGateState stays exported because src/session.ts imports it.
  • Wrote the PR's own credit-window wording into the seed entry for compress.requireNudge (desc_en/desc_zh) and regenerated: docs/configuration.{md,zh-CN.md} now come out byte-identical to the PR's committed doc edits, i.e. seed and documented intent finally agree. In passing (labeled in the commit): the one-line website summaries (site_en/site_zh) still said "reached the model this turn" — updated them to the credit-window phrasing and regenerated website/main.js + website/docs/index.html; diff is limited to the requireNudge i18n rows.

Verification:

八问:

  1. 是什么问题:PR 上两个机械门禁失败——unused-exports 指出 unprompted-gate.ts 导出了两个仅本文件使用的类型;docs-sync 发现配置文档被手改生成产物而未同步 yaml 种子(单一事实源),重新生成即产生漂移。
  2. 什么原因导致的:作者写文档时直接改了生成物 docs/configuration.{md,zh-CN.md},没改种子 website/config-reference/compress.yaml([docs][website] 配置文档单一事实源:从声明式 schema 生成 CONFIGURATION.md 与网站 /docs/(一步到位) #2107 纪律);实现信用窗口时顺带导出了两个无外部引用的接口。均为流程疏漏,非设计缺陷。
  3. 影响范围与严重程度:零运行时影响——去 export 只改类型可见性,文档同步只是让文案对齐本 PR 已实现的语义。严重度:仅 CI 门禁阻塞,不影响任何用户行为。
  4. 怎么修复的:① 按门禁自身建议对 INTERNAL_ONLY 处置——去掉 UnpromptedGate/UnpromptedGateStamp 的前导 export;UnpromptedGateState 因 session.ts 引用保持导出。② 把 PR 自己的信用窗口文案写进种子四个字段(desc_en/desc_zh/site_en/site_zh),再跑 gen-config-docs 重生成全部产物。
  5. 是否有回归问题:无。重生成后的 md 与 PR 已提交的文档措辞逐字节一致(证明种子与意图相符,无语义漂移);website 差异仅限 requireNudge 的 i18n 行;typecheck/build 干净;定向套件 22/22 绿;未触碰任何运行时代码路径。
  6. 是否破坏缓存:不涉及——未触碰任何缓存/重试/增量游标/去重键逻辑。
  7. 是否改了设计方向:不涉及——纯机械对齐,无设计决策,无需 owner 拍板。
  8. 是否引入了新的配置:无——没有新 env/config/默认值。

结论:我负责的两个红项(unused-exports、docs-sync)在 cd98cca82d 上已验证转绿;其余测试矩阵仍在 CI 运行中,等全量结论。本修复提交不改变任何运行时行为。

@ranxianglei

Copy link
Copy Markdown
Owner Author

review

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 审完 #5945。代码本身正确、能真正修复现场;初版那两处 CI 红灯你已在 cd98cca82d 修好(我本地复验双绿,CI 上 0 failure)。唯一剩项是分支 behind master,合入前 rebase 一下即可。

查重

同 issue(#5943)的姊妹 PR #5946(consume-on-fold 语义)已是 closed / 未合并,本 PR #5945(no-consume)为存活版本——不构成并行冲突。我的独立分析也支持关掉 #5946 保留 #5945:现场是「一次成功折叠后,隔轮续压 4 次全被拒」,只有 no-consume 能让这几轮落在 20 轮窗口内放行;consume-on-fold 会在首次折叠时就把信用烧掉、把原抱怨原样复现。

结构化八问

  1. 是什么问题:开了 opt-in 的 compress.requireNudge(禁止模型没被提醒就自己压缩)后,模型只在「nudge 真正注入的那一轮」能调 compress;提醒推荐的范围没压完、隔几轮回来续压,每一轮都被拒。现场 session 01a1b6a5:一次 5 块成功折叠(72%→38%)后,收尾剩余范围的 4 次压缩连被拒。最常见「多轮清理式压缩」被整个禁掉。
  2. 什么原因导致的:根因是「单轮枪」——src/server/handle.ts 每轮 prepare 重新盖章 armed = (nudgeOutcome==="injected"),资格是单轮布尔、无跨轮延续;src/stream.ts applyRanges 里 requireNudge && !armed 即拒。模型干活那几轮没有新 nudge,武装位就被重置了。
  3. 影响范围与严重程度:只影响显式开启该开关的人(默认关 = 零变化)。对开启者:主流用法(nudge 后分多轮收尾剩余推荐范围)从「基本全拒」变「窗口内放行」。属可用性缺陷但仅 opt-in 面。
  4. 怎么修复的:把 armed(单轮布尔)改成 nudge 信用窗口(src/unprompted-gate.ts):真实注入铸 K=20 个模型轮的信用(常量 NUDGE_CREDIT_ROUNDS),新注入刷新、每个未提示的模型轮衰减 1、非模型请求形态(countTokens/responsesCompact/codexForge/threadsLane)既不刷新也不衰减;成功折叠不消耗信用。读侧 unpromptedGateOf() 用 credit>0 推 armed。长期严格性靠增长驱动 nudge 兜底:安静会话 K 轮后回到严格拒绝,增长中会话持续刷新。
  5. 是否有回归问题:消费面收敛——只有 src/stream.ts 读 .armed/.requireRecommendation(读侧接口两者都保留)、src/session.ts 字段类型改 UnpromptedGateState、handle.ts 盖章调用更新,无其他读者。modelRound 谓词与紧邻其下的 preflight 守卫逐字符一致(四变量都在作用域)。纯内存态(session.transient),重启信用清零回默认全关,安全。无 wire/协议/持久化格式改动;requireRecommendation 范围门不动;bili 自身溢出兜底折叠(preflight lane, loopTracking:false)照旧豁免。
  6. 是否破坏缓存:不涉及。这只是模型主动压缩的资格门,不触碰消息重建 / system 前缀 / pf 水位等任何缓存敏感路径。
  7. 是否改了设计方向:无架构转向,只是把既有 Provide a non-intrusive feature to disable compression, and allow web-based configuration. | 提供非注入禁止压缩功能,并允许web配置 #5683 门的时序语义从单轮细化成 K 轮窗口。有一处有意偏离 issue 建议第 3 条(「券在首次成功折叠时消耗」):按现场回放,consume-on-fold 会让 18:41 当轮折叠吃掉券、18:42–18:46 四连拒依旧 = 修不掉标题现象,故采用纯窗口语义。[PR] compress.requireNudge single-round arming changed to 20-round nudge credit: the model returning on alternating rounds to | compress.requireNudge 的单轮武装改为 20 轮 nudge 信用:模型隔轮回来压缩不再被误拒(#5943) #5946 正是 consume-on-fold 实现、已被关闭,与此判断一致。
  8. 是否引入了新的配置:无新增配置面 / env / 默认值。K=20 是代码常量(符合「不加新配置面」约束)。文档 en+zh 同步(table row 走 seed 生成器 + 手写长文段 + i18n 四件套)。

CI 现状 & 行为变更披露

  • 行为变更(opt-in only,默认关 = 零变化):requireNudge 放行条件 旧 = 仅 nudge 注入当轮 → 新 = 距最近一次真实注入 ≤20 个模型轮内(新注入刷新、未提示模型轮衰减、折叠不消耗)。已开启者的跨轮清理从「全拒」变「窗口内放行」。
  • CI:初版 2 个红灯——unused-exports(UnpromptedGate/UnpromptedGateStamp 变内部专用却仍 export)与 docs-sync(手改的是生成物 .md 而非源 seed website/config-reference/compress.yaml)。你在 cd98cca82d 已修好;我本地复验两门均绿(gate clean + 生成幂等),CI 侧 30 项 = 18 skip + 12 success、0 failure。
  • 剩项:分支 behind master(mergeable_state=behind),合入前需 rebase/更新到当前 master。常规步骤,我没擅自动你的分支。
  • 说明:我本地也备过一份等价修复,但你已先推 cd98cca82d(功能等价、仅 website 文案更简),我没推重复 commit。沙箱缺 node_modules,本地 typecheck/全量测试跑不了,最终判定以 CI 为准。

判定

可合——逻辑正确、真正修复现场多轮续压,测试有牙(K±1 双向过期 / 衰减中刷新 / 折叠不消耗 / 非模型形态保持 / 延迟履约),消费面收敛无回归,CI 门全绿。合入前只需 rebase 一下 master。按规则我不代你 rebase / 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

冲突

@ranxianglei
ranxianglei force-pushed the 2026-11-08_nudge-credit-window branch from cd98cca to e6210e5 Compare November 9, 2026 01:23
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解决,PR 分支已 rebase 到 master 并推送(新 head e6210e5dbf)。

冲突情况与处理:rebase 到 master(当时 33d495180a)时只有一个文件冲突——src/web/i18n.ts(中英文各一处 hunk)。成因是双方改了相邻行:master 侧的 #5949(fold-summary-v2)改写了 cfg.q_cafp/cfg.q_cafp_hint 两条文案("原位置替换"→"摘要前置到折叠点"),本 PR 改的是紧邻的 cfg.q_require_nudge(信用窗口措辞),git 无法自动取舍。按意图并集解决:cafp 两条取 master 新版文案(本 PR 从未打算动 cafp),require_nudge 取本 PR 的信用窗口措辞。解完逐字核对过:与最新 master 相比,该文件的差异只剩 require_nudge 两行(en+zh),cafp 与 master 完全一致。第二个提交(文档种子同步)自动合并,无冲突。

本地验证(rebase 后全绿):unused-exports 门禁干净;docs-sync 重新生成后四个产物零漂移;typecheck、build 干净;定向套件 tests/issue5683-forbid-unprompted-compress.test.ts 22/22 通过(含本 PR 新增的 5 个 #5943 信用窗口用例);NUDGE_CREDIT_ROUNDS = 20 语义完整保留(src/unprompted-gate.ts:23)。

推送纪律:push 前 fetch 确认远端 head 未变(仍为 cd98cca82d),用带租约的 force-push 完成本次任务明确允许的冲突 rebase;推送后远端分支 = e6210e5dbf。

实时状态(本轮验证到的):CI 已在新 head 上重跑(快照 18 项排队中 / 0 失败);GitHub 的 mergeable 状态在本轮两次查询时仍在计算中(unknown),但本地 git merge-tree 对最新 master(de7bbc9f9a——推送期间又合入了 #5973 gate-count-ingest)证明可干净合并、无新冲突。CI 全量结论要等矩阵跑完,本轮无法当场断言绿,不冒充。

八问:

  1. 是什么问题:PR 分支落后 master 且与 base 产生合并冲突(系统报 dirty),接掉冲突才能继续走合并流程。
  2. 什么原因导致的:master 在 PR 建立后合入了多个 PR([PR] Put each compression summary at its fold point; the old slot keeps a pointer instead of a full compress command (compressAtFoldPoint v2) #5949 fold-summary-v2、Context: "Stuck at N%, won't compress any further" — missing analysis tools: initialization size / injection frequency / | 上下文"卡在 N% 压不下去"缺少分析工具:初始化多大 / 注入多频 / 压缩接受率 / 诊断意见(2026-11-08 session-aedc188c 排查) #5963 context-analysis、[PR] Compression cycle fix: identify and confirm pointer echo, condense duplicate failure receipts into a single line, and co | 压缩循环修复:认出并确认指针回声、把重复失败回执缩成一行、修复折叠后压力表虚高 #5961 compress-burst-loop 等),其中 [PR] Put each compression summary at its fold point; the old slot keeps a pointer instead of a full compress command (compressAtFoldPoint v2) #5949 改写了 i18n 里与本 PR 改动相邻的 cafp 文案行,形成文本冲突;其余重叠文件(stream/handle/docs)均自动合并成功。
  3. 影响范围与严重程度:只影响该 PR 自身的合并流程(未合并前无用户可见影响);风险点在取舍错误——若把 cafp 退回旧文案会丢 [PR] Put each compression summary at its fold point; the old slot keeps a pointer instead of a full compress command (compressAtFoldPoint v2) #5949 的新语义,若丢了 require_nudge 新措辞则本 PR 的文档失真,两者都已核对保留。
  4. 怎么修复的:标准 rebase(保持线性历史,不用 merge commit)+ 按「意图并集」解冲突:每个字符串取其真正意图来源的版本(cafp→master 新版,requireNudge→本 PR 新版),不做折中拼接。
  5. 是否有回归问题:无。逐项核过:cafp 两条文案与 master 当前版本逐字一致;requireNudge 两条为本 PR 已审定的信用窗口措辞;docs 生成物零漂移;typecheck/build/定向测试全绿;运行时逻辑零改动(纯 rebase + 文案行取舍)。
  6. 是否破坏缓存:不涉及——未触碰任何缓存/游标/去重键逻辑。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:无。

结论:冲突已解除,分支更新到 e6210e5dbf;本地证据齐全(merge-tree 对最新 master 干净 + 门禁/typecheck/build/定向测试全绿),等 CI 矩阵在新 head 上跑完出最终结论即可。

@ranxianglei

Copy link
Copy Markdown
Owner Author

冲突

ci-check added 2 commits November 9, 2026 10:08
… arm

compress.requireNudge previously refused every model-initiated compress
except in the exact round where a nudge was injected: the per-prepare
stamp re-set `armed` to a single-round boolean, so a model coming back
one or several rounds later to finish a nudge's recommended cleanup
(the common multi-round cleanup pattern) was refused on every attempt.

Replace the single-round arm with a nudge CREDIT (src/unprompted-gate.ts):
an actually-injected nudge mints NUDGE_CREDIT_ROUNDS (= 20) model rounds
of eligibility; each new injection refreshes it; every un-nudged MODEL
round decays it by one; non-model request shapes (countTokens /
responsesCompact / local forges) hold it open without refreshing.
Successful folds do NOT consume the credit — long-term strictness is
preserved by growth-driven nudges (quiet sessions lapse back to strict
refusal after K un-nudged rounds).

Behavior change (opt-in knob only, default off): eligibility for
model-initiated compress under compress.requireNudge extends from "the
injection round only" to "within 20 model rounds of the last injected
nudge". Refusal receipt text now names the window. Stamp field renamed
armed -> nudgeInjected (write side); read-side UnpromptedGate keeps its
shape. Credit is in-memory only (session.transient), lapses on restart.

Docs (en/zh configuration.md + web i18n) updated to the credit-window
semantics; tests pin delayed fulfillment, both expiry directions,
refresh mid-decay, post-fold continuation and non-model hold.
…un-export internal gate types

- website/config-reference/compress.yaml: desc_en/desc_zh/site_en/site_zh for
  compress.requireNudge now describe the 20-model-round nudge credit window
  (#5943) instead of the retired current-turn arm — the PR hand-edited the
  generated docs/configuration.{md,zh-CN.md} without updating the single
  source of truth, which is what the #2107 docs-sync drift guard caught.
  Regenerated website/main.js + website/docs/index.html from the updated seed.
- src/unprompted-gate.ts: UnpromptedGate / UnpromptedGateStamp are referenced
  only inside unprompted-gate.ts — drop the leading export per the unused-exports
  gate (#1440 P6); UnpromptedGateState stays exported (imported by session.ts).
@ranxianglei
ranxianglei force-pushed the 2026-11-08_nudge-credit-window branch from e6210e5 to ea2b895 Compare November 9, 2026 02:10
…in LIVE_FILES

#5989 landed the suite without registering it; its spawnSync import trips
the SPAWN_RE gate (#1248) so every PR head rebased past that merge fails
all 11 test shards at pretest self-check before running any test.
Concurrency-reviewed per #1248: fully mocked children + fake clock, the only
real spawn is one bare node child for a dead pid — no ports, no zone band.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI auto-fix attempt 1/3 — fixed & pushed.

What I did this run:

  1. Re-verified live state first (mirror cache): all 11 test shards genuinely red on old head ea2b895047 — not a stale event.
  2. Fetched job logs via the Actions API: every shard died at the pretest self-check, before running a single test, with the identical line: process-spawning test files missing from LIVE_FILES in scripts/run-ci-tests.mjs: tests/issue5955-wedged-same-lane-takeover.test.ts.
  3. Root cause — inherited (master-born-red): PR [PR] test(launcher): cover the #5955 wedged-takeover escalation ladder + win32 ESRCH silence #5989 (wedged-takeover-coverage) landed tests/issue5955-wedged-same-lane-takeover.test.ts on master without registering it in scripts/live-files.mjs; its spawnSync import trips the SPAWN_RE gate (tests/claude-native.test.ts linux live-E2E subtests fail/hang in shared multi-agent sandboxes #1248), so every PR head rebased past merge 48f9e69160 inherits the full-matrix red. Verified directly on origin/master: file present, registration absent. This PR's diff touches none of it.
  4. Why not just merge ci-fixes: origin/ci-fixes (1f63882960) is 126 commits behind master and 0 ahead — it does not contain this fix yet, so merging it is a no-op. Per the few-line mechanical-fix discipline (fleet precedent in CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599), I applied the registration directly on this branch instead of leaving the PR red waiting on convergence.
  5. The fix (commit 4461fe3871, scripts/live-files.mjs only): appended the registration entry, append-only so no existing zone-port slot renumbers. Concurrency reviewed per tests/claude-native.test.ts linux live-E2E subtests fail/hang in shared multi-agent sandboxes #1248 as the gate requires: the suite drives fully mocked children + a fake clock; its only real spawn is one bare node -e "" child used to obtain a dead pid for the hardKillProxyTree row — no ports bound, no servers, XDG state redirected to a per-pid scratch dir, so no zone band is needed (entry is tripwire-only, like [Bug] Windows: Proxy falsely detects parent-gone and self-terminates on every forwarded request (same live PID triggered | [Bug] Windows:代理每转发一次请求就误判 parent-gone 自杀(同一存活 PID 在 2.5h 内触发 12 次) #3890/Running tests locally writes test sessions into the real ~/.local/billion-context (polluting the production index.db | 本地跑测试会把测试会话写进真实的 ~/.local/billion-context(污染生产 index.db 和 sessions 目录) #5114/[bug] After event loop wedge, zombie still holds port 18789 — parent respawn loop spins on EADDRINUSE indefinitely; manu | [bug] 事件循环卡死后僵尸仍握 18789 端口,parent 重拉全部 EADDRINUSE 死循环,只能手工杀进程恢复(event loop wedge holds listen socket, respawn loop fails with EADDR… #4762).
  6. Local verification (targeted only, per local-testing discipline): replicated the exact tripwire scan over all 1140 test files → clean; ran the suite standalone → 18/18 pass in ~1.5 s.
  7. Push discipline: fetched + rebased on the remote head (clean, no concurrent changes) before pushing. New head 4461fe3871.
  8. Coordination: posted a one-line note in CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 asking the sentinel to converge the same registration into ci-fixes/master so the other PRs rebased past 48f9e69160 clear by rebase alone; this branch's commit becomes droppable-duplicate once that lands.

Live state after push (mirror cache 02:31Z snapshot, head 4461fe3871): 0 failed / 12 pending — fresh run in progress; I will confirm green on the next wake if anything is still red.


结构化清单(八问)

  1. 是什么问题:PR 的 11 个 test 分片在跑任何测试之前就全部失败——一个起子进程的测试文件没登记进 LIVE_FILES,tripwire 门禁直接杀掉所有分片的 pretest 自检。
  2. 什么原因导致的:[PR] test(launcher): cover the #5955 wedged-takeover escalation ladder + win32 ESRCH silence #5989(wedged-takeover-coverage)合入 master 时只带了测试文件、漏了 scripts/live-files.mjs 登记;该文件 import spawnSync(仅用于取一个死 pid)命中 SPAWN_RE(tests/claude-native.test.ts linux live-E2E subtests fail/hang in shared multi-agent sandboxes #1248)。属 master 自身 born-red,任何 rebase 过 48f9e69160 的 PR head 都继承,与本 PR 的 nudge credit-window 改动无关。
  3. 影响范围与严重程度:所有 rebase 过该合并点的在途 PR(11 个 test 分片全红、零真实测试信号);用户侧功能零影响——纯 CI 信号级问题。
  4. 怎么修复的:在 scripts/live-files.mjs 追加一条 append-only 登记(带 tests/claude-native.test.ts linux live-E2E subtests fail/hang in shared multi-agent sandboxes #1248 并发评审注释),独立标注 commit 4461fe3871;本地复跑 tripwire 全量扫描干净 + 该套件 18/18 绿后推送。
  5. 是否有回归问题:无。纯表格追加,不触碰任何运行时代码、断言、阈值或时序;尾部追加使既有条目的 zone 端口带编号不变。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:没有。同一登记需哨兵收敛进 ci-fixes/master(已在 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 留言请求),届时本分支 commit 作为重复项丢弃即可。
  8. 是否引入了新的配置:没有。

判定:继承红已修并推送,新 CI run 进行中(0 failed / 12 pending);预期本轮分片转绿后本 PR 红灯全部清除。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

已实时核查:没有合并冲突,页面上看到的是分支保护门禁而非文本冲突——

  • GitHub API 当前值(head 4461fe3871 vs base master@1f311dd8d5):mergeable: true,mergeable_state: blocked;
  • 本地核实:本分支完全包含当前 master(0 behind、merge-base 即 master HEAD),不存在可产生文本冲突的窗口;我推送前(旧 head ea2b895047)的镜像快照同样是 blocked 而不是 dirty,即从未处于冲突态;
  • blocked 的成因是 master 的分支保护:required status checks 未全绿(修复 LIVE_FILES 登记后的新 run 仍在跑,02:35Z 镜像快照 0 failed / 4 pending)+ required reviews。

所以无需 rebase:等最后几个 check 转绿、评审通过,合并按钮即可用。新 run 出结果我会跟一条确认。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

新 run 出结果了:全绿。head 4461fe3871 上 30 个 check 全部完成、0 失败(02:45Z 镜像快照;此前在跑的 4 个重分片 ubuntu 22/2、22/3、24/2 与 windows 22/4 均通过)。

  • 继承红(LIVE_FILES tripwire)已随 4461fe3871 清除,本 PR 自身 nudge credit-window 改动无任何测试回归;
  • mergeable: true,无冲突;合并按钮现在只差分支保护的 required reviews。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

APPROVE — correct root-cause fix, well-tested, cleanly scoped. No kernel/ touched; no new config surface; behavior change fully disclosed.

Reviewed against the true base 1f311dd8d5 (the branch merged master repeatedly, so the raw diff vs a stale base looks huge — the real PR is 12 files, +204/−61, three commits).

Correctness. Root cause confirmed: src/server/handle.ts re-stamped armed as a per-prepare single-round boolean (nudgeOutcome === "injected"), so applyRanges' requireNudge && !armed refused every multi-round cleanup continuation. The credit-window transition (src/unprompted-gate.ts:58) is sound:

  • inject → mint NUDGE_CREDIT_ROUNDS (=20); un-nudged model round → −1; non-model shape → hold; clamped ≥0; a successful fold does not consume it.
  • The modelRound predicate (!countTokens && !responsesCompact && !prepared.codexForge && !prepared.threadsLane) is byte-identical to the preflight exclusion guard directly below the call site (handle.ts:2972) — the "mirrors preflight" comment holds.
  • Read side derives armed: credit > 0; the OFF default is unchanged, so routes without requireNudge see zero behavior change. Legacy/malformed state is guarded by Number.isFinite.
  • session.transient is non-persisted (persist.ts:3283 "state/transient is non-droppable"), so the stored-shape rename (armed→credit) has no migration surface; restart lapses to OFF safely.
  • Scope gate requireRecommendation is untouched — the relaxed timing does not weaken range validation (stale ranges still fail live validation).
  • Reasoned in both compression modes: applyRanges is the single execution point for model-initiated compress in plugin and proxy modes alike, so the relaxation is uniform — no mode-specific break.

Tests. tests/issue5683-forbid-unprompted-compress.test.ts pins every transition both directions (gate discipline #3617): delayed fulfillment (the reported defect), expiry at K−1 (live) vs K (refused), refresh mid-decay, post-fold continuation (the consumption variant would refuse this), non-model-hold. Uses real storeUnpromptedGate+applyRanges, not mocks.

Docs / conventions. Behavior change disclosed old→new+why in both commit and PR body; en/zh configuration.md, web i18n, and the seed yaml (regenerated, fixing the #2107 drift) are all consistent; internal types un-exported per the unused-exports gate; deliberately no new config surface (K is a named constant) — correct per owner spec. The live-files.mjs addition registers #5989's unregistered issue5955 suite whose spawnSync trips the SPAWN_RE gate — a necessary, correctly-labeled few-line CI fix, not scope creep.

Non-blocking note (author's, not mine). The PR ships window semantics and flags that the issue's suggested one-shot variant (consume-on-first-fold) would not have fixed the 18:42–18:46 refusal storm — replay shows the 18:41 fold would eat the credit and the four refusals persist. Window semantics is the right default; if the owner wants one-shot as an option it's a small follow-up. Not a blocker.

CI 30/30 relevant green (test×shards×OS×node, static-gates, mysql-contract, gate); no kernel-guard gate present; mergeable — only the review gate holds it.


8问(中文)

  1. 是什么问题:开了 compress.requireNudge 后,模型只能在 nudge 实际注入的那一轮调 compress;隔轮回来把 nudge 推荐的剩余范围压完会被逐轮拒绝(现场 session 01a1b6a5:18:41 当轮压成功 5 块后,18:42–18:46 连续 4 轮 REFUSED 全白烧)。最常见的多轮清理式压缩被整个禁掉。
  2. 什么原因导致的:src/server/handle.ts 每轮 prepare 把 armed 重新盖成单轮布尔(nudgeOutcome === "injected"),资格无跨轮延续;src/stream.ts applyRanges 里 requireNudge && !armed 即拒。根因是「资格 = 本轮布尔」这一设计,不是表面现象。
  3. 影响范围与严重程度:仅影响显式开启 compress.requireNudge 的路由(默认关,未开启者零变化)。开启者:跨轮清理压缩从「全拒」变为「窗口内放行」——属可用性修复(此前该常见用法完全不可用),非数据丢失、非安全面。
  4. 怎么修复的:把单轮武装布尔改成 nudge 信用窗口(K=20 模型轮):注入铸券、新 nudge 刷新、每个未提示模型轮衰减 1、非模型形态保持、成功折叠不消耗、安静会话 K 轮后回到严格拒绝;范围门 requireRecommendation 不动。
  5. 是否有回归问题:逐项过既有行为——(a) 未开 requireNudge 路由:OFF 默认不变,零变化;(b) 范围门 requireRecommendation:未触碰,放松时序不削弱范围校验(陈旧 range 仍走 live 校验被拒);(c) bili 自身溢出兜底折叠:走 loopTracking:false,仍豁免;(d) 重启:transient 不持久化,回落到 OFF 安全态,无迁移面;(e) 双压缩模式:applyRanges 是唯一执行点,plugin/proxy 对称放松,无模式特异性回归。结论:无回归。
  6. 是否破坏缓存:不涉及。不触碰前缀缓存 / 重试 / 增量游标 / 去重键;改动仅在一个内存计数器与一个策略门判决上。
  7. 是否改了设计方向:不改架构。仅在既有 #5683 未提示压缩门的内部,把「本轮武装」细化为「信用窗口」;数据流、边界、模块划分不变。
  8. 是否引入新配置:无。K 为代码常量 NUDGE_CREDIT_ROUNDS=20,刻意不开配置面(符合 owner spec:已有 knob 对,仅窗口长度固定)。无新 env/config/默认值。

判定:可合(APPROVE)。行为变更已在 PR 正文按旧值→新值+原因披露,属有意放宽且默认关,合并人已知悉。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review complete — APPROVE-level: clean, no blockers.

Reviewed PR #5945 (= mirror #5947), head 4461fe3871, true base 1f311dd8d5 (real diff 12 files, +204/−61, 3 commits). fix(#5943): requireNudge now judges a 20-model-round nudge CREDIT window instead of a single-round arm. Verified: root cause confirmed; credit transition sound (inject→mint 20 / un-nudged model round→−1 / non-model hold / fold does not consume); modelRound predicate byte-identical to the preflight exclusion guard (handle.ts:2972); scope gate requireRecommendation untouched; reasoned in both compression modes; tests pin every transition both directions; en/zh/i18n/seed-yaml docs consistent; behavior change disclosed old→new+why; no kernel/ changes, no new config surface. CI 30/30 relevant green, mergeable.

⚠️ One process note: GitHub blocks self-approval — this reviewer's credential is the same ranxianglei account that authored the in-repo PR, so I cannot file a formal APPROVE event. The full review (incl. the 8问) is attached as a COMMENT review for you to approve + merge: #5945 (review)

Non-blocking (author's note, not mine): window semantics shipped; the issue's suggested one-shot (consume-on-first-fold) variant would not have fixed the reported 18:42–18:46 refusal storm — a small follow-up only if you want it offered as an option. Nothing needed before merge.

@ranxianglei

Copy link
Copy Markdown
Owner Author

冲突

Resolve the scripts/live-files.mjs conflict on the issue5955 LIVE_FILES
registration: both sides added the same entry line, only the explanatory
comment differed, so master's canonical comment was kept (superset of detail,
references #5666). No change to the PR's requireNudge credit-window fix.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 冲突已解决并推送,PR 现在可合并。

发生了什么:PR #5945 落后 master 多个提交,master 前进到 5c3c2688f8(Merge #6001)后与 PR 分支冲突。唯一冲突点在 scripts/live-files.mjs——两侧都新增了同一行 tests/issue5955-wedged-same-lane-takeover.test.ts 注册,只是注释措辞不同(功能注册行完全一致);其余文件(含 src/stream.ts)自动合并干净。

怎么解的:把当前 master merge 进 PR 分支(保留原作者三个 commit、不 rebase 改写署名),冲突处取 master 侧注释(信息更全:reaped-pid / win32 taskkill / 引用 #5666),注册行仍为单条。已核对 PR 核心修复在自动合并后逐字节完好(NUDGE_CREDIT_ROUNDS=20、armed=credit>0、handle.ts 无条件盖章、session.ts 类型字段、测试文件均在位),全仓无残留冲突标记。

当前状态:已推送 4461fe3871..9ad3db7d0e → 分支 2026-11-08_nudge-credit-window;PR mergeable=True。CI 已在新 head 上启动:快门(typecheck / static-gates)已过,test shards 进行中,目前 0 失败(完整绿红以远程 CI 为准)。

待你操作:本 reviewer 凭据与 PR 作者同为 ranxianglei,GitHub 禁止自批,我无法发正式 APPROVE / 合并。请在 PR 上 approve + merge:#5945


8问(中文)

  1. 是什么问题:owner 标记「冲突」——PR 分支落后 master,master 前进后产生合并冲突,导致 PR 无法合并。
  2. 什么原因导致的:PR 基于旧 base 1f311dd8d5 开发,期间 master 合入 [PR] docs: permit root README.<locale>.md community translations (#6000) #6001 / [PR] fix(#5951): replay a stream cut that lands after reasoning-only output #5956 等提交;两侧各自独立给 live-files.mjs 加了 issue5955 注册行(内容相同、注释不同),git 无法自动裁决注释差异。
  3. 影响范围与严重程度:仅阻塞这一个 PR 的可合并性(mergeable=False/dirty);不影响任何已发布行为或线上用户。属流程阻塞,非功能性缺陷。
  4. 怎么修复的:merge 当前 master 进分支(不 rebase,保原作者 commit 与署名),唯一冲突取 master 规范注释;核心 requireNudge 信用窗口修复不受影响。
  5. 是否有回归问题:无。冲突是纯注释裁决,功能注册行两侧本就一致;已核对 PR 全部改动文件合并后完好、无残留标记;master 带入的都是其自身已发布的合法变更。高危模式逐项过:无语义漂移、无阈值/时序/输出格式变化、无 fail-fast 变吞错。
  6. 是否破坏缓存:不涉及。未触碰压缩/缓存/重试/增量游标逻辑,仅一次合并加一条注释裁决。
  7. 是否改了设计方向:不涉及。方向不变,仍是 compress.requireNudge is only valid in the round where the nudge is injected: if the model comes back in a later round t | compress.requireNudge 只在 nudge 注入的那一轮有效:模型隔轮回来压缩就被拒,多轮清理式压缩全部白拒 #5943 的 nudge 信用窗口方案。
  8. 是否引入新配置:不涉及。无新 env/config/默认值。

判定:冲突已解、可合并;代码评审结论维持上一条 APPROVE-level 不变,待你 approve + merge。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 收尾确认:冲突已解并推送(新 head 9ad3db7d0e),PR mergeable=True。新 head 上 CI 快门(typecheck / static-gates)已过,test shards 仍在跑,目前 0 失败——完整绿红以远程 CI 为准。评审结论维持 APPROVE-level 不变,待你 approve + merge:#5945

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解除,CI 全绿。 本轮处理过程与结论(结构化八问):

  1. 是什么问题:master 前进 22 个提交后,PR 与 base 出现真实文本冲突(mergeable_state: dirty,已实时 API 核实)。
  2. 什么原因导致的:此前修继承红时在 PR 分支加的 tests/issue5955-wedged-same-lane-takeover.test.ts LIVE_FILES 登记,被哨兵经 ci-fixes 收敛进了 master(commit b3aed0b);于是双方在同一位置加了同一行登记 → scripts/live-files.mjs add/add 冲突。merge-tree 确认这是唯一文本冲突文件(src/stream.ts 两侧改动相距远,可自动合并)。
  3. 影响范围与严重程度:仅"PR 暂不可合并",无用户面影响;不解决则一直卡在 dirty。
  4. 怎么修复的:rebase 到最新 master@5c3c2688f8,冲突取 master 侧规范注释,冗余的登记提交因内容已在 master 而跳过。本地验证: typecheck 干净、tripwire 扫描干净(1142 文件/62 条登记/无缺失)、tests/issue5683-forbid-unprompted-compress.test.ts 22/22、tests/issue5955-wedged-same-lane-takeover.test.ts 18/18。推送时发现另一并发 agent 已用 merge 方式推了等价解法(9ad3db7)——我核对其与我验证过的树逐字节相同(diff 为空),按推送纪律不覆盖并发工作、不强抢分支,本地同步到远端 head 收工。
  5. 是否有回归问题:无——最终树与我本地全项验证通过的树完全一致;PR 对 master 的净 diff 恰好就是原 11 个 nudge 修复文件,未混入任何无关改动。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及(纯冲突消解 + rebase)。
  8. 是否引入了新的配置:不涉及。

当前状态(head 9ad3db7):30 个 check = 15 success + 15 skipped、0 失败;mergeable: true,blocked 仅剩分支保护的 required reviews。等评审通过即可合并。

@ranxianglei
ranxianglei merged commit 658499a into master Nov 10, 2026
54 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1157-master.658499a (rolling master tag).

npm install -g billion-context@0.0.1157-master.658499a  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

1 participant