Skip to content

[PR] fix: name the unknown nudge baseline in idle diagnostics (Part A of #5928) - #5935

Open
ranxianglei wants to merge 2 commits into
masterfrom
2026-11-08_nudge-baseline-visibility
Open

ranxianglei wants to merge 2 commits into
masterfrom
2026-11-08_nudge-baseline-visibility

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Part A of #5928 — visibility for the blind nudge baseline (no change to fold-decision behavior).

Background (#5928)

After a resume-inheritance miss ([resume-inheritance] miss: no byte-exact resume among N eligible chain(s)), the conversation lands on a fresh session key whose meter reads 0 — no usage report yet this turn, no prior-turn estimate — while pendingT1 already sits far over its T1 threshold (reporter's case: usage=0% (0/356250) ... pendingT1=260393/50000). The nudge decision is structurally unfireable for that turn (every pressure band, and the firstSightMassReady mass bypass from #194, is usage-gated), so one oversized forward goes out with ~473K prompt tokens sent uncompressed; the state self-heals on the next turn via the #728 estimate fallback. Today that turn only leaves an ordinary info line, so nothing in the log explains why nothing was folded.

This PR is Part A of a two-part fix: make the blind state visible. Part B (root cause: let firstSightMassReady drain a known backlog when the meter is blind) is a kernel change awaiting owner approval (posted as 🔶 需要决策 in the issue thread); when approved it lands on this same branch — one PR per thread.

Changes

  • diagNudge() appends , baseline=unknown when the meter read 0, so the idle line states WHY nothing fired. Byte-identical for measured turns.
  • New nudgeDiagLogLevel(): the exact state (blind meter + pendingT1 >= interval + not injecting) logs at warn instead of info; every other state keeps its level. Applied at all four prepare lanes (openai / responses / google / anthropic).
  • /__bili/stats gains a per-session boolean nudgeBaselineUnknown (lastInputTokens <= 0 && localInputEstimate <= 0). /__bili/status stays process-level (it has no per-session list) and is untouched.

Behavior changes (disclosed)

Surface Old New Why
nudge idle: log line, blind meter + pendingT1 ≥ interval info, no baseline tag warn, ... pendingT1=260393/50000, baseline=unknown model=... that state is an anomaly worth noticing, not routine idling
every other nudge log line unchanged unchanged (byte-identical) no behavior drift
/__bili/stats sessions no such field additive nudgeBaselineUnknown: bool observability; additive, no migration

No config-surface changes (no new keys / env vars / flags). No wire or message-shape changes. No kernel changes in this commit.

Tests

Related to #5928 (Part A; the root-cause Part B is pending owner approval and will extend this branch rather than open a second PR).

@ranxianglei ranxianglei added bug Something isn't working p2 scope/kernel labels Nov 8, 2026
@ranxianglei ranxianglei changed the title fix: name the unknown nudge baseline in idle diagnostics (Part A of #5928) [PR] fix: name the unknown nudge baseline in idle diagnostics (Part A of #5928) Nov 8, 2026
@ranxianglei
ranxianglei force-pushed the 2026-11-08_nudge-baseline-visibility branch from 10f17a4 to 2652f69 Compare November 8, 2026 08:45
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-08_nudge-baseline-visibility (1c13656)

Latest build — install this exact version

npm install -g billion-context@0.0.9075-pr.5935.264ebaa

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
1c13656 billion-context@0.0.9075-pr.5935.264ebaa build
5927e65 billion-context@0.0.9062-pr.5935.d8ddfc4 build
d694e36 billion-context@0.0.8923-pr.5935.488e1f5 build
0996789 billion-context@0.0.8909-pr.5935.cf4d113 build
2652f69 billion-context@0.0.8605-pr.5935.0164df7 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5935.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)

查重: 不重复。Searched open upstream issues/PRs for the same failure signature (blind nudge meter after resume-inheritance miss, baseline=unknown, #5928): only this PR targets it. The sole sibling work is Part B (kernel root cause), which intentionally lands on THIS branch per one-PR-per-thread — no parallel PR exists in the mirror or upstream.

标签: bug + p2 + scope/kernel(诊断可见性缺陷;nudge/折叠判定域,跨车道无单一客户端归属)

What this session did (verify-and-refresh, not re-implement)

  1. Code audit vs description — every claimed change verified hunk-by-hunk on the branch: diagNudge baseline tag, nudgeDiagLogLevel warn gate, all four prepare-lane call sites (openai / responses / google / anthropic — grep confirms these are the ONLY diagNudge callers), additive /__bili/stats field, and the new truth-table test file.
  2. Stale-base rebase — the branch sat 268 commits behind master, and master had touched all six files the PR touches. Rebased onto current master; single import-line conflict in src/server/prepare-anthropic.ts resolved as the union (master's dedupeAdjacentOutputConfig + PR's nudgeDiagLogLevel). Force-with-lease push to the same branch → new head 2652f69849 (replaces 10f17a492a).
  3. Local verification on the rebased head — npm run typecheck clean; targeted suites 26/26 green (issue5928-nudge-baseline-visibility 2/2 + fork-nudge-trigger + issue4383-stale-usage-anchor + issue2155-self-heal 24/24), matching the numbers claimed in the PR body. Full-suite verdict comes from CI on the pushed head.

Consistency notes from the audit:

  • The warn gate uses exactly the same breakdown keys and defaults as the interval diagNudge prints, so log level and message cannot disagree about the threshold.
  • ARMED-SUPPRESSED under a blind meter stays info — conservative and documented in the code comment (that state already announces itself in the line); the reported case is structurally-idle, which is what gets promoted.
  • nudgeBaselineUnknown is purely additive on /__bili/stats; existing consumers read named fields, no migration.
  • Diagnostics-only: no wire/message-shape/config-surface/kernel changes; both compression modes unaffected beyond the log line.

CI status (live at posting)

Running on fresh head 2652f69849: 29 checks — 3 passed, 3 skipped, 23 in progress, 0 failed. Master CI coordination (#4599) has been quiet since 10-24 with no inherited-red reports, so nothing suggests expected inheritance failures. I will post the final verdict when the suite completes.

Part B status

Part B (letting firstSightMassReady drain a known backlog when the meter is blind) is a kernel change still awaiting owner approval — posted as 🔶 需要决策 on #5928, which carries needs-decision. Not implementing until approved; when approved it extends this same branch rather than opening a second PR.

Verdict: mergeable once CI is green on 2652f69849 — merge itself is human-only.


八问(结构化审核结论)

  1. 是什么问题:resume-inheritance miss 之后新会话的 nudge 计量器读数为 0(盲态),而 pendingT1 已远超 T1 阈值——该轮 nudge 结构性不可触发,超大请求未压缩直接转发(报告案例 ~473K prompt tokens),日志却只有一条普通 info,看不出为什么没折叠。本 PR 只解决「看不见」(Part A),不改折叠判定行为。
  2. 什么原因导致的:nudge 各压力档与 fix: compress over unpruned view + acp-kernel 0.0.38 (billion-context-pi#195) #194 的 mass bypass 全部以 usage 为门,盲态下全灭;诊断行既不标注基线未知、也不升级级别,异常轮与正常闲置在日志里无法区分。根因(盲态下应排空已知积压)在 kernel 侧,即待批的 Part B。
  3. 影响范围与严重程度:所有发生 resume-inheritance miss 的会话(dsh 车道为主),miss 后第一轮的大额未压缩转发无声无息;属可观测性缺陷而非功能损坏——下一轮经 [Bug] 上游从不报告 usage 时 nudge 永不触发——上下文无界增长直到超窗(ChatGPT 登录态后端) #728 estimate fallback 自愈,但排查时日志无线索。p2 合理。
  4. 怎么修复的:三处联动——diagNudge 在计量为 0 时追加 , baseline=unknown(实测轮逐字节不变);新增 nudgeDiagLogLevel(),仅「盲态 + pendingT1 ≥ interval + 非注入」这一精确状态升 warn,其余状态级别不变,四个 prepare 车道统一接入;/__bili/stats 每会话加只增字段 nudgeBaselineUnknown。
  5. 是否有回归问题:审过 diagNudge 全部调用点(仅四处 prepare 车道,已全部换动态级别);warn 门与 diagNudge 显示的 interval 用同一套 breakdown key/默认值(级别与信息不会打架);stats 消费者按命名字段读取(加字段安全);两种压缩模式均不受线格式影响。未发现回归。ARMED-SUPPRESSED 保持 info 是有意保守选择,已注释说明。
  6. 是否破坏缓存:不涉及——纯诊断面,不触碰缓存键/重试/增量游标/去重逻辑。
  7. 是否改了设计方向:不涉及——观测性增强,数据流与架构不变。
  8. 是否引入了新的配置:不涉及——无新 env/config/默认值。

收工判定:代码与描述一致、定向验证全绿、diff 干净(单 commit、每行相关),CI 绿后即可合并;合并由人工执行。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI red resolved — known flaky timing cell, re-run green, no code change.

What I did this run:

  1. Re-verified live first: mirror cache + GitHub API confirmed exactly one red job at head 2652f69849 — test (windows-latest, 22, 2) (run 42464291482); all other 28 checks green/skipped.
  2. Diagnosed from the job log: single failing test = tests/wire-exit-matrix.test.ts → abort x proxy-openai-sse: client abort mid-stream destroys the upstream request, error upstream socket(s) must be destroyed after the client abort (closed=0), duration 22.2s while sibling cells in the same run passed in 0.15–0.67s. This cell carries an in-file documented flake history on exactly this platform/shard (windows-latest node22 shard 2) with budget ladder 3s→6s→10s→20s(win32)→lag-aware cap (commit d7a1a91, tracked under CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599); the recorded audit found no defect in the relay destroy/abort wiring.
  3. Ruled out PR causation: the PR diff is diagnostic-only (nudge log line/level + one stats field in src/server.ts / prepare-*.ts / admin.ts) and cannot touch the relay/abort path; master is green at its head; ci-fixes has zero delta on this test file vs master (both already at d7a1a91, which the PR head contains) — merging ci-fixes would buy nothing.
  4. Action: the failed-job re-run was already in progress when I arrived (started ~09:16Z by an earlier wake; my own re-run POST correctly refused with 403 "already running" — I did not fight it). Verified live: run 42464291482 → completed/success at 09:22:58Z on the same head 2652f69849. No commits pushed, no branch changes, PR head untouched.
  5. Posted the one-line conclusion to CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 per CI-coordination policy.

七问:

  1. 是什么问题:PR 的 CI 只有一个红 job(windows node22 shard 2),红在 wire-exit-matrix 的 client-abort→上游 socket 销毁计时用例上(closed=0)。
  2. 什么原因导致的:已知负载饥饿型 flake——该 cell 在 windows-latest node22 上有完整记录史(测试文件头部注释+ CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599),本次签名完全一致(22.2s = 20s win32 base + ~2.2s 实测 lag 扩展后仍 closed=0,同 run 兄弟 cell 0.15–0.67s 全绿);非本 PR 代码引入(diff 只改 nudge 诊断日志行与一个 stats 字段,不触及 relay/abort 路径,master 本身是绿的)。
  3. 影响范围与严重程度:仅该 PR 的一次 CI 运行、单个 shard 单个计时用例;产品行为零影响,纯测试门禁抖动。
  4. 怎么修复的:不改代码(预算阶梯已由 d7a1a91 的 lag-aware 设计宣告走完,再抬阈值属设计决策不在本 lane 权限内);复用已触发的 failed-job re-run,验证整 run 转绿。
  5. 是否有回归问题:无——未推任何 commit,分支字节级未动;既有行为清单不受影响。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向/引入新配置:均不涉及。若该 cell 再次复红,下一步应升级为 🔶 需要决策(选项如:测试内单次重试语义 / 重构门禁为相对不变量),本轮按 attempt 1 只做最小处置。

判定:CI 已全绿(run 42464291482 success @ 2652f69),PR 可进入正常合并流程;本轮收工。

@ranxianglei
ranxianglei force-pushed the 2026-11-08_nudge-baseline-visibility branch from 2652f69 to 0996789 Compare November 10, 2026 07:13
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge conflict resolved — PR rebased onto current master, pushed, conflict cleared.

What I did this run:

  1. Live verification first: mirror cache snapshot was stale (11-08, old head 2652f69849), so I verified against git + a one-shot PR-object read: master had advanced 028f870656 → 4dea18eabf ([PR] Upstream hang on compressed summary no longer silent: added first-byte budget + watchdog/preflight logging (#5904) | 压缩摘要上游卡死不再静默:新增首字节预算+看门狗/预检日志(#5904) #5917, [PR] persist: wire debounce/max-delay knobs into session-order & prefix-affinity writers #6066, [PR] ci: master-CI convergence branch (sentinel-maintained, per #4599) #6073 ci-fixes merge among others) while the PR branch was untouched — the drift caused the conflict. No concurrent agent activity on the branch (remote head still 2652f69849 at fetch time).
  2. Rebased the single PR commit onto 4dea18eabf. Four files conflicted (src/server/prepare-{anthropic,google,openai,responses}.ts); src/server.ts + admin.ts auto-merged cleanly keeping both sides.
  3. Resolved by union of intent: master inserted a recordNudgeObservation(...) observation line above the existing log("info", diagNudge(...)) call in all four lanes; the PR changed exactly that call's level to log(nudgeDiagLogLevel(tokenCount, turn.nudge), ...). Resolution = keep master's observation lines AND apply the PR's level change. One additional mechanical piece: master moved repairResponsesAssistantOrdering out of server.js into ./responses-ordering.js, so I dropped that stale member from the merged server.js import list (caught by local typecheck as a duplicate identifier, fixed before push).
  4. Local gates on the rebased head: npm run typecheck exit 0, npm run build success, targeted tests/issue5928-nudge-baseline-visibility.test.ts 2/2 pass. Full-suite verdict left to remote CI on the new head per §7.2.
  5. Pushed with --force-with-lease pinned to the pre-rebase head (explicitly sanctioned for this conflict rebase): branch now 0996789212, still a single linear commit. Live PR-object read confirms head 0996789212 / base 4dea18eabf, mergeable: true, mergeable_state: blocked — i.e. the conflict is gone; blocked means required checks are simply running/pending on the new head.

No code changes beyond conflict resolution, no PR-body edits, no gates hit, no new issues filed.


七问:

  1. 是什么问题:PR 与目标分支冲突(merge state dirty)——master 两天内从 028f870 推进到 4dea18e,新增的 nudge 观测行与本 PR 改动的日志行在 4 个 prepare 文件同一区域重叠。
  2. 什么原因导致的:双方改了同一行附近——master 在 log("info", diagNudge(...)) 上方插入 recordNudgeObservation 观测行并把 repairResponsesAssistantOrdering 迁到 ./responses-ordering.js;本 PR 把该调用级别改为 nudgeDiagLogLevel(...) 并扩充 import。纯文本重叠,无语义对立。
  3. 怎么修复的:rebase 到 master 后按「意图并集」解冲突——保留 master 的观测行 + 应用本 PR 的级别变更;import 列表取 master 新布局 + 本 PR 新增的 nudgeDiagLogLevel,删掉已迁移符号;本地 typecheck/build/定向测试全绿后才推送(force-with-lease 防并发覆盖)。
  4. 是否有回归问题:无——typecheck exit 0、build 成功、PR 定向测试 2/2;自动合并区核对过(baselineTag src/server.ts:2840、nudgeDiagLogLevel :2849、breakdown key pendingT1 完好);全量回归按纪律交给新 head 的远程 CI。
  5. 是否破坏缓存:不涉及。
  6. 是否改了设计方向 / 引入新配置:均不涉及——纯冲突消解,未引入任何新行为或配置面。
  7. 当前状态与判定:分支 head 0996789212(单提交线性),GitHub 实测 mergeable: true / blocked(冲突已除,等 CI);本次冲突处理收工,若新 head 出现红 CI 归下一轮 auto-fix lane 处理。

@ranxianglei

Copy link
Copy Markdown
Owner Author

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

Review verdict: APPROVE (posted as a thread comment — GitHub rejects a formal approve review from the PR's own author account)

— clean, well-scoped visibility fix; one small rebase artifact fixed on the spot (below).

Independent verification (not copied from the issue)

Read the PR body, issue #5928, and the full diff hunk-by-hunk against base 4dea18eabf — which is the CURRENT master tip, so there is no stale-base exposure.

  • Warn gate correctness (src/server.ts:2849): warns iff tokenCount === 0 AND a decision exists AND !shouldInject AND breakdown.nudgeGrowthTokens > 0 AND breakdown.pendingT1 >= nudgeGrowthTokens. Both keys are the same ones diagNudge() renders (src/server.ts:2820-2821), so the gate and the line can never disagree about the threshold. Verified against the real meter: effectiveTokenCount() (src/server.ts:2895) returns 0 only via its final fallthrough (localInputEstimate <= 0 with no usage-grade anchor, no grade, no post-rebuild anchor, not anonymous-prefix-affinity) — exactly the "fresh key, nothing measured yet" state [Bug][DSH] Resume-inheritance miss resets the nudge baseline to 0 — usage=0% coexists with pendingT1 far above the threshold and nothing is folded #5928 describes, and anonymous fork 会话 lastInputTokens=0 时 preflight 退化为字符估算,大载荷被低估后不压缩直接裸转上游 #553 sessions size on the raw bound and can never trip the warn (correct: they are not blind).
  • Baseline tag (src/server.ts:2840): , baseline=unknown appears iff tokenCount === 0; measured turns stay byte-identical. Placement between the pendingT1 segment and modelTag yields valid punctuation in all three tag combinations (checked empty-model, model, and surface-off cases).
  • Coverage: grep confirms the four prepare lanes (openai/responses/google/anthropic) are the ONLY diagNudge callers — no lane left behind.
  • No hidden consumers: the web log view (src/web/logs-query.ts) is a pure display/selection engine; nothing escalates, counts, or alerts on warn-level lines, so the info→warn promotion has no downstream side effects. Logger sinks (file+stderr) are level-independent.
  • Stats field (src/server/admin.ts:1222): additive boolean, type-safe (lastInputTokens: number required in-memory, src/session.ts:425; localInputEstimate optional → ?? 0). It is a deliberately coarser approximation of the log-level predicate (stats have no access to the per-turn meter inputs) — acceptable for an observability flag, and the PR discloses the exact formula.
  • Tests (tests/issue5928-nudge-baseline-visibility.test.ts): real teeth per Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 — positive case, boundary case (pendingT1 == interval still warns, would catch a > regression), and five negative directions (measured meter, below-threshold backlog, injecting turn, null/undefined/degenerate breakdown), plus the message-shape pin (tag iff meter read 0, comma-free pendingT1=X/Y model= on measured turns). Ran locally: 26/26 green across this file + fork-nudge-trigger + issue4383-stale-usage-anchor + issue2155-self-heal; npm run typecheck clean.
  • CI: mirror cache shows head 0996789212 fully green (30 checks, 0 failed, skipped lanes gated by design).

已顺手修

已顺手修:rebase 解冲突时 responses 车道的 nudge 诊断行被留在了消息变换之后(其余三车道都在变换前),导致该车道日志相对顺序漂移、且变换抛异常时丢失诊断行——已恢复回原位置,四车道一致 + commit d694e36a31(本地 typecheck + 定向测试复绿;CI 将在新 head 重跑)。

结构化八问

  1. 是什么问题:resume-inheritance miss(或 subagent 命名空间重键)后,会话落在一个全新会话键上,用量计读数为 0(无 usage 报告、无上一轮估算),而 pendingT1 可折叠积压早已远超其 T1 阈值——decideNudge 在该轮结构性不可触发,一次超大请求未压缩发出,日志里只有一行普通 info,看不出为什么没折叠。
  2. 什么原因导致的:盲态本身由上游产生(resume-miss / 内存态命名空间表——属 Part B 根因域);本 PR 治的是诊断层无法区分「计为 0 因为没测到」和「上下文真的为空」——idle 行对两种情形渲染完全相同,异常因此不可见。不可见的直接原因:diagNudge 没有基线标记,日志级别硬编码 info。
  3. 影响范围与严重程度:受影响面 = 任何撞上 resume-miss 或命名空间重键且可折叠历史 ≥50K 的会话(报告者为 DSH desktop subagent;四条 prepare 车道共用此路径)。严重程度 p2:无数据丢失、下一轮经估算回退自愈,但单轮可静默发出 >1× 窗口的请求;属可观测性缺陷而非可用性缺陷。
  4. 怎么修复的:只让盲态可见,不动折叠判定:(a) diagNudge 在计读数为 0 时追加 , baseline=unknown;(b) 新增 nudgeDiagLogLevel(),把且仅把「盲计 + pendingT1 ≥ T1 间隔 + 未注入」这一可行动状态从 info 升为 warn,四条 prepare 车道统一应用;(c) /__bili/stats 增加每会话只读布尔 nudgeBaselineUnknown(附加字段,无迁移)。行为性根因(firstSightMassReady 在盲计时排空已知积压)保留为待 owner 批准的独立 kernel 变更(Part B)。
  5. 是否有回归问题:逐项清点触碰路径的既有行为——nudge 日志行:所有有测量轮次逐字节不变(标签仅 tokenCount>0 时缺席;级别函数对其余全部状态返回 info,含注入轮与退化 breakdown);其余日志行未动;/__bili/stats 仅新增附加字段;nudge 节奏未变(KDD feat: release CI (npm auto-publish on release branch) #8 平直 50K 完好——门复用判定所用的同一个 nudgeGrowthTokens 值);无 wire/消息形状变化;两种压缩模式均不受影响(诊断挂在共享决策点周围)。发现一处未披露漂移并已当场修复:rebase 后 responses 车道日志调用位置后移(详见上方「已顺手修」)。无残留回归。
  6. 是否破坏缓存:不涉及——未触碰任何缓存/重试/游标/去重键逻辑;前缀缓存字节不受影响(仅日志级别与行内容)。
  7. 是否改了设计方向:无——纯可见性,架构与数据流不变;明确限定为 [Bug][DSH] Resume-inheritance miss resets the nudge baseline to 0 — usage=0% coexists with pendingT1 far above the threshold and nothing is folded #5928 的 Part A,行为根因留给单独审批的 kernel 变更。
  8. 是否引入了新的配置:无——无新配置键/env/flag;/__bili/stats 增加一个只读附加字段(已在 PR 披露表中列明)。

收工判定

可合——等新 head d694e36a31 的 CI 跑绿即可合并(该提交只是单行语句归位,实质 head 0996789212 已全绿,本地 typecheck + 定向测试对归位提交复验通过)。Part B(kernel 根因)继续按 🔶 需要决策 流程等 owner 拍板,与本 PR 合并不耦合。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) Review lane complete: GitHub PR #5935 reviewed end-to-end — verdict APPROVE (posted as a thread comment; GitHub rejects a formal approve review from the PR's own author account); one small finding fixed on the spot (rebase had left the responses-lane nudge diag line after the message transform — restored to its pre-rebase position, commit d694e36a31); CI fully green on new head d694e36a31 (30 checks, 0 failed) — ready for human merge. Part B (kernel root cause) stays in #5928 under 🔶 需要决策, decoupled from this merge.

@ranxianglei
ranxianglei force-pushed the 2026-11-08_nudge-baseline-visibility branch from d694e36 to 5927e65 Compare November 11, 2026 05:00
ci-check added 2 commits November 11, 2026 13:20
…5928)

After a resume-inheritance miss the conversation lands on a fresh key whose
meter reads 0 while pendingT1 already sits far over its T1 threshold; the
nudge decision is structurally unfireable for that turn but was only visible
as an ordinary info line, so the oversized forward went unremarked.

Part A (visibility, no behavior change to the fold decision):
- diagNudge appends ', baseline=unknown' when the meter read 0 so the idle
  line states WHY nothing fired (byte-identical for measured turns).
- that exact state (blind meter + pendingT1 >= interval + not injecting)
  logs at warn instead of info via nudgeDiagLogLevel(); all other states
  keep their level.
- /__bili/stats gains per-session nudgeBaselineUnknown.

The root-cause fix (letting firstSightMassReady drain a known backlog when
the meter is blind) is a kernel change awaiting owner approval.
…ition

The conflict rebase onto 4dea18e left the nudge diagnostic log call
after repairResponsesAssistantOrdering()/applyReasoningDrop() while all
three other lanes (openai/google/anthropic) keep it before the message
transform, right after the recordNudgeObservation line. None of the moved
code touches diagNudge's inputs, so the move only changed relative log
order (reasoning-drop warnings now precede the nudge line in this lane)
and dropped the line from the exception path. Restored for cross-lane
consistency; no semantic change.
@ranxianglei
ranxianglei force-pushed the 2026-11-08_nudge-baseline-visibility branch from 5927e65 to 1c13656 Compare November 11, 2026 05:26
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge conflict resolved again — branch rebased onto current master tip, conflict cleared, live-verified.

What I did this run:

  1. Live verification first: the mirror snapshot was stale; a one-shot PR-object read confirmed the real state — mergeable: false / dirty at head d694e36a31. Git fetch showed the branch carried one extra commit since my last run (d694e36a31 "restore the responses-lane nudge diag line to its pre-rebase position", on top of my earlier rebase), and master had advanced 4dea18eabf → 33104b1f95 — 95 files, including every file this PR touches (Remove the compressAtFoldPoint feature — it reorders resent history and caused an authorship-misattribution incident in a live session #6132 fold-point removal among them).
  2. Rebase (first pass) onto 33104b1f95: only the import lines conflicted in the four src/server/prepare-*.ts lanes — master's Remove the compressAtFoldPoint feature — it reorders resent history and caused an authorship-misattribution incident in a live session #6132 dropped makeFoldPointReasoningDroppable from those imports while the PR adds nudgeDiagLogLevel. Resolved by union: master's import list + nudgeDiagLogLevel (verified makeFoldPointReasoningDroppable is fully gone from src/server.ts, so it must not be re-imported). Call sites auto-merged with both master's recordNudgeObservation line and the PR's level change intact; the second commit (position fix) replayed cleanly. Gates green (typecheck exit 0, build OK, targeted test 2/2) → pushed 5927e65a3e.
  3. Master moved mid-run (#6166 merged → e3220adc0f). Rather than hand the PR back one merge behind into the next wake, I rebased once more onto e3220adc0f — applied with zero conflicts — re-ran all gates (typecheck exit 0, build OK, targeted test 2/2), and pushed 1c136560b3 with lease protection (each push preceded by fetch + remote-head verification; no concurrent activity found either time).
  4. Final live check (one-shot PR-object reads): head 1c136560b3 / base e3220adc0f (current master tip), mergeable: true, mergeable_state: blocked — i.e. the conflict is gone; blocked just means required checks/review are pending on the new head.

No code changes beyond conflict resolution, no PR-body edits, no gates hit, no new issues filed. Both commits (the fix + the position fix) are preserved as-is on top of master.


七问:

  1. 是什么问题:PR 再次与目标分支冲突(dirty)——master 从 4dea18e 推进到 33104b1(95 个文件,Remove the compressAtFoldPoint feature — it reorders resent history and caused an authorship-misattribution incident in a live session #6132 移除 fold-point 特性触及本 PR 全部 4 个 prepare 文件的 import 行)。
  2. 什么原因导致的:双方在同一 import 行两侧改动——master(Remove the compressAtFoldPoint feature — it reorders resent history and caused an authorship-misattribution incident in a live session #6132)删掉 makeFoldPointReasoningDroppable,本 PR 新增 nudgeDiagLogLevel;纯文本重叠,无语义对立。(分支上另有他人/他 agent 的一个位置修正提交 d694e36,原样保留。)
  3. 怎么修复的:rebase 到 master 后按「意图并集」解 4 处 import 冲突(取 master 列表 + 插入 nudgeDiagLogLevel,确认被删符号不再存在后才敢排除);调用点区自动合并结果逐文件核对(caLine 观测行与级别变更都在);本地 typecheck/build/定向测试全绿后 force-with-lease 推送。期间 master 又合入 [PR] thirdparty-scan: flag dsh-live-compact as a known conflict (#5984) #6166,遂二次 rebase(零冲突)+ 重跑门禁再推。
  4. 是否有回归问题:无——两轮 rebase 后均 typecheck exit 0、build 成功、定向测试 2/2;makeFoldPointReasoningDroppable 已从 server.ts 彻底移除(grep 计数 0),未误留引用;responses 车道 diag 行位置经第二提交恢复为 pre-rebase 原始位置(已核对 :412-417 区域);全量回归交给新 head 的远程 CI。
  5. 是否破坏缓存:不涉及。
  6. 是否改了设计方向 / 引入新配置:均不涉及——纯冲突消解,零新行为、零新配置面。
  7. 当前状态与判定:分支 head 1c136560b3,直接落在当前 master 顶(e3220adc0f)上,GitHub 实测 mergeable: true / blocked(冲突已除,等 CI/评审);本次冲突处理收工,若新 head 出现红 CI 归下一轮 auto-fix lane。

@ranxianglei

Copy link
Copy Markdown
Owner Author

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

Review verdict: APPROVE (re-review after rebase; posted as a thread comment — GitHub rejects a formal approve review from the PR's own author account)

The branch was rebased onto the current master tip (e3220adc0f, merge of #6166) and force-pushed since my previous review at d694e36a31. Re-audited end-to-end on the new head 1c136560b3:

Rebase fidelity (the actual risk of this update)

  • git range-diff old vs new commit set: both commits re-applied identically — same hunks, same content; only import-line context shifted because master's own advance edited those files.
  • Tree diff of the PR's 7 files between my previously-reviewed head and the new head equals EXACTLY master's own churn on those files (same --stat: 158/6/7/6/6 lines) — i.e. zero rebase drift: new head = old reviewed head + master's changes, nothing else.
  • My earlier spot fix survived the rebase verbatim: the responses-lane diag line sits right after recordNudgeObservation and BEFORE repairResponsesAssistantOrdering(...) (src/server/prepare-responses.ts:414), consistent with the other three lanes.

Master-advance interaction check (old base..new base on the PR's files)

Master advanced ~10 merges in the window (#6150/#6166/#5991/#5809/#5609/#6132 …). On the 5 source files this PR touches, the advance consists of: the experimental fold-point feature removal (#6132 — dead-code excision of makeFoldPointReasoningDroppable + its per-lane install blocks), the #5974 preflight view-vs-reconstruction corrective pass, a PreflightDeps refactor, and a declaration/pin conflict-warn set. Grep of the entire advance diff for every PR symbol (diagNudge, nudgeDiagLogLevel, effectiveTokenCount, baseline=unknown, nudgeBaselineUnknown) returns nothing — the advance touches no PR region; the four prepare lanes' nudge blocks are byte-unchanged by master. No semantic interaction possible.

Gates on the new head

  • Local: fresh npm ci (lockfile moved with master), npm run typecheck clean; targeted suites 26/26 green (issue5928-nudge-baseline-visibility 2/2 + fork-nudge-trigger + issue4383-stale-usage-anchor + issue2155-self-heal).
  • CI: all 30 checks completed on 1c136560b3 — 14 success, 16 skipped (gated by design), 0 failed.
  • PR body unchanged; the behavior-disclosure table (info→warn for the blind-backlog state only, byte-identical otherwise; additive /__bili/stats field) still matches the code exactly.
  • Still no kernel/ changes, no kernel-change declaration — the human-tier gate is not triggered. Part B remains parked under 🔶 需要决策 in [Bug][DSH] Resume-inheritance miss resets the nudge baseline to 0 — usage=0% coexists with pendingT1 far above the threshold and nothing is folded #5928, decoupled from this merge.

No new findings; nothing to fix on the spot this round.

结构化八问(新 head 复审)

  1. 是什么问题:resume-inheritance miss(或 subagent 命名空间重键)后落在全新会话键上,用量计读数为 0,而 pendingT1 可折叠积压已远超 T1 阈值——decideNudge 该轮结构性不可触发,超大请求未压缩发出,日志只有一行普通 info 看不出原因。
  2. 什么原因导致的:盲态由上游产生(resume-miss / 内存态命名空间表,属 Part B 根因域);本 PR 治的是诊断层无法区分「计为 0 因为没测到」与「上下文真的为空」——idle 行对两者渲染相同。直接原因:diagNudge 无基线标记、级别硬编码 info。
  3. 影响范围与严重程度:任何撞上 resume-miss / 命名空间重键且可折叠历史 ≥50K 的会话(四条 prepare 车道共用);p2——无数据丢失、下一轮估算回退自愈,但单轮可静默发出 >1× 窗口请求;可观测性缺陷而非可用性缺陷。
  4. 怎么修复的:只让盲态可见、不动折叠判定:(a) 计读数为 0 时 diagNudge 追加 , baseline=unknown;(b) 新增 nudgeDiagLogLevel(),仅「盲计 + pendingT1 ≥ T1 间隔 + 未注入」从 info 升 warn,四车道统一应用;(c) /__bili/stats 增加只读附加布尔 nudgeBaselineUnknown。行为根因留给待批的独立 kernel 变更(Part B)。
  5. 是否有回归问题:逐项清点——nudge 日志行所有有测量轮次逐字节不变(标签仅在 tokenCount>0 时缺席;级别函数对其余状态一律返回 info);其余日志行未动;stats 仅新增附加字段;nudge 节奏不变(KDD feat: release CI (npm auto-publish on release branch) #8 平直 50K 完好,门复用判定同一 nudgeGrowthTokens);无 wire/消息形状变化;两种压缩模式均不受影响。本轮新增核查:rebase 零漂移(范围 diff 逐块一致)、master 前进与本 PR 符号零交集、上一轮顺手修(responses 车道日志位置)在新 head 原样存活。无残留回归。
  6. 是否破坏缓存:不涉及——未触碰缓存/重试/游标/去重键逻辑;前缀缓存字节不受影响。
  7. 是否改了设计方向:无——纯可见性,架构与数据流不变;限定为 [Bug][DSH] Resume-inheritance miss resets the nudge baseline to 0 — usage=0% coexists with pendingT1 far above the threshold and nothing is folded #5928 Part A。
  8. 是否引入了新的配置:无——无新配置键/env/flag;/__bili/stats 增加一个只读附加字段(PR 披露表已列明)。

收工判定

可合——新 head 1c136560b3 的 CI 已全部跑完(30 项:14 success + 16 skipped,0 failed),本地 typecheck + 定向测试复绿,与上一轮结论一致:APPROVE,等人合并即可。Part B 继续按 🔶 需要决策 流程等 owner 拍板,与本 PR 合并不耦合。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) Review lane complete (round 2): GitHub PR #5935 re-audited end-to-end on the rebased head 1c136560b3 — verdict APPROVE (thread comment 6790435648; GitHub blocks formal self-approve from the author account). Rebase onto new master e3220adc0f verified drift-free (range-diff identical; master-advance touches zero PR symbols); prior spot fix survived intact; local typecheck + targeted tests 26/26 green; CI fully green (30 checks: 14 success + 16 skipped, 0 failed). No new findings — ready for human merge. Part B stays under 🔶 需要决策 in #5928, decoupled.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review lane closed out for GitHub PR #5935 — final state:

Verdict: APPROVE, ready for human merge.

  • Round 1 (head 099678921): full hunk-by-hunk audit + independent verification of the warn-gate semantics against effectiveTokenCount; one undisclosed rebase drift found and fixed on the spot (fix: commit d694e36a31 — responses-lane diag line restored before the message transform, consistent with the other three lanes). Review comment: pull/5935#issuecomment-6764010568.
  • Round 2 (rebased head 1c136560b3): rebase proven drift-free (range-diff identical; master advance touches zero PR symbols); spot fix survived verbatim; local typecheck + targeted tests 26/26 green; CI fully green (30 checks: 14 success + 16 skipped by design, 0 failed). No new findings. Review comment: pull/5935#issuecomment-6790435648.
  • Disclosed behavior change (unchanged across both rounds): blind-meter + pendingT1≥interval nudge idle line goes info→warn with , baseline=unknown tag; every other log line byte-identical; /__bili/stats gains additive read-only nudgeBaselineUnknown: bool. No config/wire/kernel changes.
  • Part B (kernel root cause) remains under 🔶 需要决策 in [Bug][DSH] Resume-inheritance miss resets the nudge baseline to 0 — usage=0% coexists with pendingT1 far above the threshold and nothing is folded #5928 awaiting owner approval — decoupled from this merge.

Nothing further pending on my side.

This branch has not been deployed

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

Labels

bug Something isn't working p2 scope/kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant