Skip to content

[PR] Review follow-ups: 429 throttle saturation/scope guardrails, media-refs carry-forward filter, oversize-refusal messages that say what to do, doc typo - #5905

Merged
ranxianglei merged 5 commits into
masterfrom
fix/review-batch-5898
Nov 8, 2026
Merged

ranxianglei merged 5 commits into
masterfrom
fix/review-batch-5898

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Follow-up batch from the v0.1.212..cda6e73 review (#5898) — every item below came out of that review or its verification probes. No behavior change beyond the two marked fix; the rest is guardrails, messages, docs and tests.

Fixes

Guardrails & docs

kernel-change: 0.0.186 → 0.0.187 (media-refs carry-forward filter + cloud prefix families)

Test evidence

  • tests/issue5199-throttle429-scope.test.ts 7/7 · tests/issue4204-throttle-governor.test.ts + knobs-config-precedence (52/52 combined)
  • kernel tests/media-payload.test.ts 25/25 · tests/issue5620-ref-recoverable-media.test.ts 10/10
  • tests/dsh-native.test.ts 75/75 · native-intercept suite 101/101
  • tests/issue5755-refs-ord-crossing.test.ts + persist-active-pack 3/3

…d, media-refs carry-forward filter & cloud prefix families, oversize refusal messages that name the real fix, dsh durable lines with readable numbers, website streamKeepAliveMs typo, 5755 ord-crossing guard kept with regression tests

- upstream-throttle: a saturated hold map (64/64 account-wide, no model-scoped
  hold to evict) silently dropped the next model-scoped 429 — now it warns
  once and the send is documented as ungoverned (#5199/#5889)
- knobs: network.throttle429Scope matches its value EXACTLY; a typo now warns
  once and falls back to credential instead of silently doing so (#5199)
- kernel media-refs: block summaries written by older builds can carry refs
  looksEphemeralSignedUrl would reject today; the carry-forward into merged
  blocks now applies the same filter so a dead signed URL cannot survive
  forever (#5865 review). EPHEMERAL_QUERY_PARAM also gains the Huawei OBS
  x-obs-*, Tencent COS x-cos-* and Baidu BCE x-bce-* prefix families.
- native-intercept/dsh-native oversize refusals now say what to DO (restart
  host / fix the model window declaration), and dsh durable lines format
  numbers with thousands separators (#2924/#4068)
- website: streamKeepaliveMs → streamKeepAliveMs (the real knob name) across
  main.js, docs/index.html, config-reference/process.yaml
- CONFIGURATION.md/.zh-CN.md: throttle429Scope exact-match + model-string
  aliasing caveat documented
- store/persist: #5755 refs ord-crossing guard (touching rows stay in the
  old-refs set until the new-refs commit lands) kept as defense-in-depth
  with a regression test

kernel-change: 0.0.186 → 0.0.187 (media-refs carry-forward filter + cloud
prefix families; compress.ts starvation-bound comment corrected)
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: fix/review-batch-5898 (8173fd4)

Latest build — install this exact version

npm install -g billion-context@0.0.8580-pr.5905.5456a28

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
8173fd4 billion-context@0.0.8580-pr.5905.5456a28 build
7e94778 billion-context@0.0.8565-pr.5905.5f70049 build
8bbe7d5 billion-context@0.0.8559-pr.5905.8c2083f build
81619f3 billion-context@0.0.8558-pr.5905.ba36ab0 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title Review follow-ups: 429 throttle saturation/scope guardrails, media-refs carry-forward filter, oversize-refusal messages that say what to do, doc typo [PR] Review follow-ups: 429 throttle saturation/scope guardrails, media-refs carry-forward filter, oversize-refusal messages that say what to do, doc typo Nov 7, 2026
…ss.yaml seed (CONFIGURATION.* are generated), kernel lockfile 0.0.187
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 接单:PR #5905(fix/review-batch-5898,单提交 81619f3,直接落在当前 master cda6e7350 上,无漂移)。

查重: 不重复——镜像 open [PR] 行里只有本条针对该主题(#5898 review follow-up 批次);无并列的第二个修复 PR。

开始按 PR Review 规范审(方向关 → 回归审查 → 代码 → 测试有效性 → diff 整洁度),含 kernel 部分(media-refs carry-forward filter)按 Kernel Boundary 人工级对待。结论稍后以结构化八问给出。

PR #5905 review follow-up: the regression test named "one warn" only pinned
the no-phantom-hold behavior. Capture the logger via setLogCapture and assert
the saturation is reported exactly once, so a future change that drops or
duplicates the warn fails here (#5199/#5889).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

PR #5905 审核完成。分支 fix/review-batch-5898 @ 7e94778de4,base = 当前 master cda6e73501,零漂移;全部 diff 分段通读完毕(20 文件,+244/-34),本地定向测试全绿,docs 同步已验证。结论:建议合并;kernel 部分按 Kernel Boundary 规则 3 留人工评审层。

结构化八问

  1. 是什么问题:[PR] release v0.1.213 #5898 review 的后续清理批——429-hold 表满时新 hold 被静默丢弃(无任何日志)、旧版本写入的块摘要里的死签名 URL 可经合并/蒸馏块永生、oversize 拒绝消息把用户指错恢复动作、文档拼写错误,外加若干护栏与测试补齐。
  2. 什么原因导致的:① storeHold 表满返回 false 被调用方 if (!storeHold(...)) return 吞掉;② 合并/蒸馏时的 carry-forward 路径漏掉了活消息都过的 looksEphemeralSignedUrl 过滤;③ 拒绝消息文案写于 attribution-scope 语义出现之前;④ 纯笔误。
  3. 影响范围与严重程度:全是低频边缘/可观测性缺陷,p3 级。饱和需全账号 64 个并发 hold 才触发;carry-forward 只影响已有旧版本块摘要的会话;文案只影响 UX。无可用性问题。
  4. 怎么修复的:① 饱和时打一条 warn 并把该次发送文档化为 ungoverned(行为不变,只加可见性);② carry-forward 应用同一 ephemeral 过滤,EPHEMERAL_QUERY_PARAM 扩到 obs/cos/bce 前缀族;③ 两条拒绝消息改写为真实恢复动作(重启宿主 / 修模型声明窗口),dsh durable 行加千分位;④ 拼误从 yaml seed 修正并重新生成。另:throttle429Scope 未识别值每种拼写 warn 一次(原逻辑本就是精确匹配+回落 credential,本 PR 只加告警)、compress.ts estimate-hold 注释改为真实的饥饿界(纯注释)、[PR] fix(storage): refs ledger diffs instead of full-replace per save (#5744) #5755 ord-crossing 守卫保留并补回归测试。
  5. 是否有回归问题:逐项过完既有行为,两处行为变更在此显式披露(均严格更优,PR 正文用「[PR] fix(storage): refs ledger diffs instead of full-replace per save (#5744) #5755 guard kept」一笔带过、未点明实际语义):
    • src/persist.ts 加载路径:envelope savedAt 新于统一存储行但 importRecord 失败时,旧行为服务较旧的统一行(回滚),新行为服务内存中的较新 envelope + 一条 warn。仅 ingest 失败这一罕见分支触发,不回滚数据,严格更好。
    • src/storage/store.ts stale-block sweep:O(B²) .some() → O(B) Set 查找,语义完全相同,正文未提及。
      其余均为纯可观测性/文档/测试/注释;429 门控语义、hold TTL、probe 清除路径逐字节不变(已对照验证)。
  6. 是否破坏缓存:否。不动折叠判定、ref 账本、wire 格式;kernel 侧仅 media-refs 过滤(摘要文本卫生)+注释,版本纪律满足(0.0.186→0.0.187,lockfile 已同步,PR 正文已声明 kernel-change)。
  7. 是否改了设计方向:否。
  8. 是否引入了新的配置:否。throttle429Scope 取值语义不变(精确匹配一直如此),只是新增一次性 warn,并在 CONFIGURATION.md en/zh 文档化精确匹配规则与模型串别名注意(glm-5.2 ≠ GLM-5.2)。

本地定向验证(全量矩阵归 CI):issue5199-throttle429-scope + issue5755-ord-crossing 9/9 · dsh-native 75/75 · kernel media-payload 25/25 · issue4204-governor + knobs-precedence + native-intercept + persist-active-pack 四文件合计 125/125 · native-intercept-selfheal 22/22。docs 同步:node tools/gen-config-docs.mjs generate 后工作树干净(seed ↔ 生成物一致,EN/ZH 键集相等)。

review 中顺手修的一处(已推 PR 分支,commit 7e94778de4):saturated-map 回归测试名为 "one warn" 却只断言了 no-phantom-hold 行为——现通过 setLogCapture 捕获日志并断言恰好一条 "429 hold NOT stored" warn,让钉子配得上名字;修后该文件 7/7 绿。

补充说明两点:

CI 现状(镜像缓存实时读):30 项检查,0 失败,12 条 lane 在跑(含我推送触发的重跑),mergeable_state=blocked 仅因 checks 未完。目前零失败,全矩阵绿即收工。

判定:建议合并(kernel 部分待人工评审确认)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 收工确认:全矩阵在推送头 7e94778de4 上跑完——30/30,零失败(镜像缓存实时核对,sha 已对上)。审核结论维持:建议合并,kernel 部分(media-refs carry-forward 过滤 + 版本纪律)按 Kernel Boundary 留人工评审确认即可。

…write, print evidence map on red

Four hardening fixes from the #5904 forensics (gate red runs traced to
environment degradation, but the tool itself hid that):

1. Preflight now sends ONE tiny real completion (8 tokens) after the
   /v1/models liveness check. Liveness 200s while the scheduler drowns;
   a probe miss now aborts with 'environment degraded, NOT a product red'.
   Budget: GATE_PREFLIGHT_BUDGET_MS (default 30000).
2. --base-dir pointing at a NON-EMPTY dir now refuses without
   --reuse-base-dir (a rerun used to silently overwrite the previous
   run's bili.log / dsh-*.jsonl — this destroyed the 16:36 green run's
   evidence).
3. On any red check the summary prints an evidence map (bili.log,
   proxy.log, dsh-t*.jsonl, bili.json) next to SCRATCH KEPT.
4. Turn 1 without a single cache report now WARNs 'upstream may be
   degraded — results may measure the environment, not the product'
   (the degraded 19:39 run showed exactly this signature).
@ranxianglei

Copy link
Copy Markdown
Owner Author

追加一项 gate 工具加固(6e8f41cb0,来自 #5904 取证):scripts/release-gate-local.mjs ①预检增加一条真实 8-token 推理探针(GATE_PREFLIGHT_BUDGET_MS,默认 30s;探针失败=环境问题直接中止,不再烧 12 分钟跑出假红);②--base-dir 指向非空目录时默认拒绝(需 --reuse-base-dir),防止重跑覆盖上次证据;③任一检查红时打印证据文件清单(bili.log/proxy.log/dsh-t*.jsonl/bili.json);④t1 全程无 cache report 时 WARN 环境劣化。本地冒烟:guard 拒绝✅ 探针 177ms✅

Resolve the single textual conflict in src/storage/store.ts, where both
sides independently replaced the O(B^2) Array.some() stale-block sweep
with an O(1) Set lookup (master via #5744, this branch via #5755).
Kept master's incomingBlockIds form: behaviorally byte-identical, already
shipped and reviewed on master, so the merged hunk matches what v0.1.213
already carries. All other files auto-merged cleanly.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解决并推送。 上游 PR #5905(fix/review-batch-5898)与 master 的合并冲突(dirty)已收敛。

这次做了什么(CI 工程师车道):

实时核验(非记忆): mergeable false→true;mergeable_state dirty→blocked(冲突已消除,blocked=等评审/CI,属正常门禁态,不是冲突)。CI 正在新 head 上跑:0 failed / 14 pending(核心 test 矩阵各 shard + static-gates + mysql-contract 进行中;gate、config-surface-guard 已 success)。最终绿不在此断言——仍在跑;若后续有红,我在跟进轮次修(本自动修复车道 attempt 1/3)。

你追加的 gate 加固(6e8f41cb0):完好保留在分支上,SHA 未变,已被本次合并纳入。

结构化八问

  1. 是什么问题:PR 分支与 master 出现合并冲突(mergeable_state=dirty),阻塞合并。
  2. 什么原因导致的:master 与本分支各自独立实现了同一处优化(store.ts 陈旧块清扫改 O(1) Set,master 走 0.1.212: per-turn ingest is still O(history) — 96.5% of proxy CPU in StatementSync.run, event loop starves with 8 concurrent sessions (#4528 / #5469 follow-up) #5744、本分支走 [PR] fix(storage): refs ledger diffs instead of full-replace per save (#5744) #5755),落到同一段代码产生文本冲突;master 前进到 release v0.1.213 等提交是触发前提。
  3. 影响范围与严重程度:仅 src/storage/store.ts 一处纯文本冲突;两侧行为等价,无功能面变化。无用户可见影响(仅合并被卡)。
  4. 怎么修复的:取 master 的等价实现(已发布/过审)使该段与 master 字节一致;用 merge(非 rebase)保留你的新提交 SHA,快进推送。
  5. 是否有回归问题:无。本次未改动任何行为常量/默认值/时序;store.ts 结果与 master 完全相同。master 带入的 11 个提交均为已发布/已审工作,非本次引入的新变更。
  6. 是否破坏缓存:不涉及(未触碰折叠判定/ref 账本/wire 格式/重试/去重键)。
  7. 是否改了设计方向:不涉及(纯冲突收敛,无架构/数据流转向)。
  8. 是否引入了新的配置:不涉及(无新增 env/config/默认值)。

收工判定:冲突已解决并推送,PR 现处可合并待评审/CI 状态(mergeable=true)。等 CI 全绿 + 人工批准(kernel 部分按 Kernel Boundary 留人工评审层,见 floor 4 审核结论)即可合入。CI 若有红我再跟进。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

本轮为重复触发——冲突上一轮已解决,本轮仅做实时核验,未做任何改动。

实时核验(非记忆,均为本轮实测):

  • GitHub API:head=8173fd4cf6(上轮推的合并提交)、base=master 9ba70b8f05(自上次合并起未前进)、mergeable=true、mergeable_state=blocked —— 不是 dirty。触发信息里的「dirty」是推送前的旧状态。
  • 远端分支头仍是 8173fd4cf6,无人并发推送,master 未变 → 无新冲突可解。
  • CI(镜像缓存,本轮间隔两次读):30 项,0 失败;pending 由 14 → 12(正常推进中);gate、config-surface-guard 已 success,各 e2e lane 按门控 skipped。

为何本轮不动手:无冲突、无红项、master 未变。此时再跑 merge/rebase 只会得到 "Already up to date" 或制造一个空合并提交,属重复劳动/抢分支——按 push 纪律停手,只报状态。

归属与后续:等 CI 全绿(现 0 失败仍在跑)+ 人工批准(kernel 部分按 Kernel Boundary 留人工评审层)。若稍后 CI 出红,我来修;若再次收到同类「dirty」触发而实时仍为 blocked,一律以实时为准,不重做。

@ranxianglei
ranxianglei merged commit 6df7ae1 into master Nov 8, 2026
53 checks passed
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1081-master.6df7ae1 (rolling master tag).

npm install -g billion-context@0.0.1081-master.6df7ae1  # 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant