Skip to content

docs(#2146): neutral JSDoc on noteCompressLoopFailure (content scanners read source that agents open) - #2319

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-07_breaker-receipt-wording
Oct 7, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-10-07_breaker-receipt-wording

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Context

A user's GPT-6 agent read this source, and the account owner then received a provider content-security warning email quoting the JSDoc of noteCompressLoopFailure. Out of context, the comment's engineering shorthand — "The breaker NEVER refuses execution", "streak arms", "it only changes what a FAILED call tells the model" — reads like model-manipulation vocabulary to a content-moderation classifier.

Scope (comment-only, per owner decision)

  • The runtime receipt text is untouched, verbatim. The direct voice is part of the dsh内部问题 出现这个错误后,重启dsh可以发消息 但陷入无限压缩失败 #2146 fix's measured behavior.
  • Only the JSDoc is reworded to neutral terms (what the function does, same facts: only failed-call receipts carry the paragraph; successes always go through; one success clears the streak), plus a note that receipts stay verbatim on purpose and that comments are written neutral because provider-side scanners read source files agents open.

Verification

  • tests/issue2146-compress-loop-breaker.test.ts 11/11, tests/issue847-compress-failure-guards.test.ts green (no test changes needed — code behavior identical)
  • npm run typecheck clean

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-07_breaker-receipt-wording (deb10ac)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2461-pr.2319.c988331

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

Install instructions are refreshed on each push.

…ent scanners read source that agents open

The runtime receipt text is kept verbatim (owner decision): the direct
voice is part of the #2146 fix's measured behavior. Only the comment is
reworded to neutral terms ('NEVER refuses execution' / 'streak arms' /
'FAILED call tells the model' — engineering shorthand that
content-moderation classifiers read as model-manipulation vocabulary out
of context).
@ranxianglei
ranxianglei force-pushed the 2026-10-07_breaker-receipt-wording branch from 1f8c0d5 to deb10ac Compare October 7, 2026 08:56
@ranxianglei ranxianglei changed the title refactor(#2146): breaker receipt as declarative status text (provider content scanners flagged the imperative wording) docs(#2146): neutral JSDoc on noteCompressLoopFailure (content scanners read source that agents open) Oct 7, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 已接手,正在 review PR #2319(分支 2026-10-07_breaker-receipt-wording,单 commit,3 文件 +17/-14)。初步结论:

  • 方向成立:provider 内容扫描器误报的根因是「全大写标签 + 祈使句链」这个形状本身,prompt-injection 教科书签名;改措辞是唯一正确的修复层(没有别的 producer 可修)。dsh内部问题 出现这个错误后,重启dsh可以发消息 但陷入无限压缩失败 #2146 事故中该段每轮失败重复一次(161×),形状问题被放大成 flooding 表象。
  • 回归清点:旧 marker COMPRESS CIRCUIT BREAKER 全仓仅 3 处引用(src/stream.ts:225 + 两个测试文件),本 PR 全覆盖;无其他代码/golden 依赖该字符串。breaker 机制(threshold 3、10min decay、success disarm、arm 日志行)未触碰。
  • CI:20/24 绿(e2e 全家 + 各 guard 已过),剩主 test matrix 4 job 在跑。
  • 发现一处措辞问题,直接修(小问题直接修,独立标注 commit):新句声称 "further attempts — any range, any spec, including acp_status checks — will keep failing",但 acp_status 是只读查询(src/acp-status.ts handleAcpStatus → 恒 toolOk),breaker 武装时它照样成功。旧文 "do not poll acp_status" 是指令,新文把它变成了错误的事实断言——模型若去验证,会看到成功,反而可能诱发「验证→再试」的额外往返(breaker 本来要省掉的正是这些 round-trip)。改为如实的陈述式表达。

稍后补完整七问结论。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review 结论(最终 head deb10ac77,force-push 后的状态)

先交代状态变化:review 过程中分支被 owner force-push 重写——初版的声明式措辞(原 issue 正文的 old→new 表)整体回滚,receipt 恢复 verbatim,JSDoc 记录了决定("Receipt wording is kept verbatim on purpose (owner decision, 2026-10-07)")。最终 diff 收敛为仅 JSDoc 中性化:单文件 src/stream.ts +7/-4,字符串与测试均与 master 逐字节一致。我此前针对第一版声明式文本的 acp_status 条款修复(local commit 9fe28ce)随回滚失效,已丢弃,未推送任何东西。

结构化七问:

  1. 是什么问题:用户 GPT-6 agent 读取 src/stream.ts 源码后,provider 内容安全扫描器就 request body 发出警告邮件并引用了 circuit-breaker 文本。是形状误报,不是 bili 功能 bug。
  2. 什么原因导致的:扫描器按形状分类——全大写 [COMPRESS CIRCUIT BREAKER: 标签 + 祈使句链是 prompt-injection 教科书签名;agent 打开源文件时文件内容整段进 request body,源码里的这段字面量+注释就是被扫到的字节。dsh内部问题 出现这个错误后,重启dsh可以发消息 但陷入无限压缩失败 #2146 事故中该段每轮失败重复一次(161×)放大了 flooding 表象。
  3. 怎么修复的(最终态):owner 拍板保留 runtime receipt verbatim(直接语气是 dsh内部问题 出现这个错误后,重启dsh可以发消息 但陷入无限压缩失败 #2146/fix: cross-spec compress-failure circuit breaker + stale-generation diagnosis (#2146) #2147 的 measured behavior,改措辞等于改模型行为),只把上方 JSDoc 注释中性化(去掉 circuit-breaker / arms / NEVER refuses execution 等直白表述),并把决定与理由写进注释本身。我 review 中核实过新 JSDoc 的每句描述与代码事实一致(breaker 只附在失败回执、成功恒通过且清 streak)。
  4. 是否有回归问题:无。最终 diff 纯注释:receipt 字符串、breaker 机制(threshold 3 / 10min decay / success disarm / arm 日志行)、测试断言全部与 master 逐字节相同,零行为变更。两种压缩模式(plugin/proxy)共用这条失败回执路径,字符串未动即双模式均未动。高危模式逐项过:无语义漂移、无 fail-fast 变化、无阈值/时序/输出格式变化。
  5. 是否破坏缓存:不涉及——不触碰缓存、重试、增量游标、去重键任何逻辑。
  6. 是否改了设计方向:无架构转向,但修复策略有一次显式转向并已记录在代码里:从「改 model-facing 措辞」改为「保措辞、中性化源码注释」。如实披露残余暴露:若触发源确为「agent 读源文件」,第 228 行的字符串字面量(未动)仍是该文件中签名最强的 injection 形状物,中性化 JSDoc 只减少了周边散文而非字面量本身;若触发源是 runtime receipt 在模型流量中的重复出现,verbatim 保留则维持了该暴露。两者都是 owner 已明确权衡拍板的取舍,我不推翻;建议留档:若后续再收到同类警告邮件,下一个 lever 是字面量本身(如 hex-escape 构造或拆独立模块降低同文件共现),现在不动。
  7. 是否引入了新的配置:不涉及。

验证证据:最终 head 上本地 npm run typecheck clean + tests/issue2146-compress-loop-breaker.test.ts / tests/issue847-compress-failure-guards.test.ts 定向跑 11/11 绿;CI 24/24 全绿(e2e 全家 + kernel/version/lane/docs guard),mergeStateStatus=clean。

一个收尾建议:PR 正文还是初版的 old→new 措辞表,与最终 diff(JSDoc-only)不符——合并前请更新一下 PR 描述,否则合并记录会误导后来的读者。

判定:可合并(待 owner 更新 PR 描述后由人合并——合并权限在人)。

@ranxianglei
ranxianglei merged commit dbd1307 into master Oct 7, 2026
24 checks passed
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.98-master.dbd1307 (rolling master tag).

npm install -g billion-context@0.0.98-master.dbd1307  # 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.

@ranxianglei
ranxianglei deleted the 2026-10-07_breaker-receipt-wording branch October 15, 2026 05:32
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