Repository navigation
[PR] test: pin the D2 fit-forward estimate-only warn (#5414, post-#5409 supplement) - #5423
ranxianglei wants to merge 9 commits into
Conversation
Converging master's red gates onto ci-fixes. lifecycle-ledger-guard is already fixed here (LIFECYCLE.md entries for BILI_SESSION_CONTENT_STORE_PIN / BILI_SPAWN_FINGERPRINT from the prior sentinel pass, preserved through the master merge); this commit clears the other two. docs-sync: #5319 documented the new 'chat' builtin prompt pack in CONFIGURATION.md/.zh-CN.md but never updated the single-source seed, so regeneration dropped it and the gate failed. Add 'chat' to the compress.promptPack seed (type/desc_en/desc_zh) and regenerate website/docs/index.html to match. unused-exports: CodexWindowSource (src/codex-models.ts) and PackInstallOptions (src/pack-install.ts) are referenced only inside their own modules and imported nowhere else; drop the leading export (INTERNAL_ONLY) as the guard prescribes. Verified locally: lifecycle-ledger-guard OK, check-unused-exports clean, gen-config-docs regenerate matches committed artifacts (zero drift).
…safe family gate) pack-install.ts took the last 3 npm stderr lines via split+slice(-3), tripping the #816/#1615 family gate in tests/text-safe.test.ts even though the receiver is an array of lines (code-unit-safe). Use a non-negative computed start index so the literal negative-slice token is gone; output is identical (last up-to-3 lines clamped to 300 chars). Inherited from #5340, which shipped without satisfying the gate.
Inherited red resolved by convergence, not rewrite: ci-fixes was 12 commits behind master and its two unique fix commits (cbdd67d negative-slice, 701688d docs-sync/unused-export) are strict subsets of what master already merged better (e030d3b+4a12c1a4 safePrefix+windows npm shim, 3491e2d dead export, b76f0c9 lifecycle reconcile). Both failing shards were inherited from master's own newer commits that ci-fixes lacked: - #5103 refusal-remedy test -> pinned by 892a378 - flushAll dirty content store -> fixed by 1f209ff (src/store.ts adopt) Conflicts (codex-models.ts, pack-install.ts) resolved toward master = superset. Resulting ci-fixes tree is byte-identical to origin/master (git diff empty).
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7691-pr.5423.7a4666bThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5423.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。本 PR 就是 #5414(D2 fit-forward estimate-only WARN 缺回归钉)的实现本体——按失败签名(fit-forward / estimate-only / margin pin 变体)检索 open+closed issue 与 PR,无其他针对该守卫的 pin 条目,也无同目的在途 PR;相关线程只有 #5409(交付守卫的 PR)与 #5414(本 pin 的来源 issue),两者均非重复。 标签: bug + scope/kernel + p3 —— 守卫随 #5409 上线却缺正负双向断言,违反 #3617 gate discipline,属交付完整性缺陷而非功能请求;preflight 折叠判定面归 scope/kernel;纯测试增量、无行为变化,p3。(已打:pr, bug, scope/kernel, p3) 审核进行中(先报结构面):分支相对当前 master 仅一个 commit 接下来做本地定向验证(单文件运行 + 变异检查:margin 改 0.999 应使正向与单元边界同时变红),CI 结果出来后按八问给最终结论。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Verdict: APPROVE (posted as a comment: GitHub's API refuses a formal approval from the PR's own author account) — the pin is real and toothed in both directions; the one defect I found (a mirror/GitHub issue-number mix-up) is already fixed on this branch.
Independent verification (re-derived from source, not taken from the PR text)
- Diff vs master (
c78ecb4b5): exactly one additive test file (+328 lines). No src/, kernel/, config, wire, or persistence changes. - Assertions cross-checked against source: constant at
src/preflight.ts:147; guard atsrc/preflight.ts:2207-2208(condition!armedBaseline && baselineFloor < textTarget && payloadEstimate >= MARGIN * limit; warn text incl.~N tok vs window M,(baseline ~N), provenance(#5408/#4288)) — every substring/regex the test asserts matches. The guard sits inside the fit-forward exit (src/preflight.ts:2197-2211), so the forward still happens — warn is observability-only, as claimed. The non-vacuity line ("reached preflight target … preflight compressing before forward") exists atsrc/server.ts:4084. - Local run at head: 3/3 pass (~8 s).
- Mutation checks, both directions (the PR claimed only the first):
- margin → 0.999: e2e-positive + unit-boundary RED, negative stays green (as claimed);
- margin → 0.5: e2e-negative + unit-boundary RED, positive stays green (extra verification — the sub-margin control also has teeth).
- Gate discipline #3617 satisfied: positive AND negative directions, each with proof the walk actually ran.
Defect found & fixed during this review (disclosed)
The PR was drafted against an internal mirror issue number (#5414); on GitHub that number is an unrelated open PR (blog pipeline), while the D2-pin issue is #5413. Left as-is, merging would have auto-closed the unrelated open PR via Closes #5414.
- PR body edited:
Closes #5414→Closes #5413(+ the test-filename reference in the body). - Additive commit
6d5f1aacd: renamedtests/issue5414-*→tests/issue5413-*(repo convention: filename = GitHub issue number, cf. issue532/issue564/…) and updated the six in-file references. Re-ran after rename: 3/3 green; test content otherwise unchanged. - Residual, cosmetic only: the PR title and the original commit message still carry "(#5414)" — the title is system-owned (not renamed per policy) and the original commit is not rewritten under the additive-commit rule.
Regression audit (existing behaviors carried by touched paths)
The diff touches no existing path — new file only. Adjacent behaviors the new tests EXERCISE (the D2 warn itself, the fit-forward exit, the preflight walk) are asserted unchanged: warn fires exactly once in-band, zero folds, zero summarization calls, forward returns 200. No threshold/default/timing/output-format drift, no fail-fast→swallow change, no cache/retry/cursor impact, no new config surface, no kernel change. Note: my rename commit triggers a fresh CI pass on head 6d5f1aacd (pure rename, content-identical assertions).
Structured eight questions
- 是什么问题: #5409 上线的 D2「estimate-only 近窗 WARN」守卫没有任何回归钉——守卫若退化(阈值错、分支错、静默丢失)无人察觉。
- 什么原因导致: 交付完整性缺口——pin 原本备在 #5409 分支上,#5409 先合入,按仓库规则以 follow-up PR 形式补交。
- 影响范围与严重程度: 无用户直接影响(纯观测性 WARN);严重度 = 防御性信号缺回归覆盖(内部实现面)。
- 怎么修复的: 三枚钉——e2e 正向(恰好一次 WARN、引用估计值落在 [0.85·window, window)、baseline ~0)、e2e 反向(同形状低于 margin → 零 WARN,带非空证明)、单元边界(直接 preflightCompress ~90% vs ~80%,margin 常量有意重写不 import,源常量一动即断)。
- 是否有回归问题: 无。diff 只新增测试文件,未触碰任何既有路径;新测试对 D2 守卫/fit-forward 出口/预检走查的既有行为做了只读断言且全部保持。
- 是否破坏缓存: 不涉及。
- 是否改了设计方向: 不涉及。
- 是否引入新配置: 无。
判定:可合入(mergeable),待人工合并。
(ai: vllm-qwen/qwen3.8-27b) 审核完成:APPROVE(已发至 GitHub PR #5423,以 review comment 形式——GitHub API 拒绝作者账号自批正式 approval,结论与完整八问写在评论里)。 审中发现并直接修复一处缺陷:PR 正文按内部镜像编号写了 "Closes #5414",而 GitHub 上 #5414 是另一个无关的 open PR(blog pipeline),合并会误关它;D2 pin issue 的 GitHub 真实编号是 #5413。已改正文 Closes 行 + 文件名引用,并按仓库惯例把测试文件重命名为 技术面独立核验:断言逐条对照 标签判定:bug + scope/kernel + p3(镜像 shim 未实现 labels API,未能落标,仅记录)。待人工合并;新 head |
(ai: vllm-qwen/qwen3.8-27b) 审核结论:PASS——代码就绪,等新 head 的 test 车道绿灯后由 owner 合并八问:
独立验证(未采信 PR 自述,全部自己复跑/比对):
CI 处置说明(为什么我动了分支):
顺带发现两处:
判定:满足 §7.4 自动合入标准(纯 fix/test 增量、单模块、clean diff、引用 issue、无行为面变更),行为变更:无;合并动作留给人——新 head 的 test 车道绿灯后即可合。 标签:pr / bug / scope/kernel / p3(内核域回归钉缺失,严重度低——影响仅限可观测性守卫,无用户可见行为)。 |
Closes #5413
Post-merge supplement for #5409: the D2 stale-view guard (
FIT_FORWARD_ESTIMATE_ONLY_MARGIN = 0.85, src/preflight.ts) shipped in #5409 without its regression pin. The pin was prepared as an additive commit on #5409's branch but #5409 merged first (1ef7bd2), so per house rules it lands here as a small follow-up PR referencing the original.What this pins
When the #4288 fit-forward exit judges on ESTIMATE ONLY (no usage baseline) at >= 85% of the hard window limit, a WARN must fire exactly once (observability only — the forward still happens).
tests/issue5413-fit-forward-estimate-only-warn.test.tsadds:(baseline ~0)(no usage backing), zero folds, zero summarization calls.preflightCompressat ~90% vs ~80% of the window with the margin constant deliberately re-stated (not imported) so the pin breaks if the source constant moves.The e2e fixture uses many SMALL messages (each below the emergency-truncate keep window / min-output gate) so the kernel's truncate node cannot clip+latch a shrunken view under the margin and mask the guard — the header documents the derivation, including why the issue's usage-baseline sketch cannot reach the guard through the classic trigger.
Verified: targeted file green locally, typecheck clean, mutation-checked (raising the margin to 0.999 turns both the e2e positive and the unit boundary red).
Behavior change: none — test-only additive file. No config surface, wire, persistence, or kernel changes.