Repository navigation
[PR] Repeated invocation guard: on the 5th occurrence, warn only without killing the turn; terminate on the next violation (# | 重复调用守卫:第 5 次只警告不杀回合,再犯一次才终止 (#5225) - #5327
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7514-pr.5327.51173b3This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5327.tgz
npm install -g packageInstall instructions are refreshed on each push. |
c7e219a to
cc86419
Compare
|
补两笔(前一轮矩阵红的根因与修复):
结论:本轮 5 片矩阵红 = 我漏跑的文案钉 ×1 + master 既有红 ×1,均不涉及 guardrail 逻辑本身。 |
b40e9de to
9bdfba8
Compare
|
全绿了。最后两笔记录:
至此矩阵 12 腿+全部 gate 绿。本 PR 期间顺手修掉的 master 侧小病清单:#5103 文案钉漏网、store.ts flushAll 懒库恢复(#4788 phase 2)、PackInstallOptions 内部导出、pack-install 裸负切片、npm shim Windows 三件套。均独立小提交,不混入 #5225 主线。 |
…and only kills the turn on the repeat after it (#5225)
…nsumed; master self-red on unused-exports)
…ltin chat pack)
…4788 phase-2 side effect)
…, unused-export gate)
… follow-ups, gate green)
…er (ci-fixes owns both registrations) Rebased onto master (485c5ea). master's ci-fixes commit 0371089 already registers BILI_SESSION_CONTENT_STORE_PIN and BILI_SPAWN_FINGERPRINT in LIFECYCLE.md; this PR's own registrations would have landed as duplicate rows in two different tables. Drop this branch's copies, keep the ci-fixes-owned rows. lifecycle-ledger-guard green (171 readers / 174 entries).
3cb9346 to
b76f0c9
Compare
(ai: vllm-qwen/qwen3.8-27b) 核验完毕,终态全绿。 你上一条评论之后我又做了一笔收尾:master 在分支 base(d108df3)之后前进了一个提交(#5322 dns-wedge-alarm,485c5eaf),merge-tree 无冲突,但两边各自在 LIFECYCLE.md 登记了同样的两个 env( 结构化八问
行为变更披露(旧值→新值+原因)
判定:可合并(mergeable,CI 全绿,等你合)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.958-master.f9cec9f # this exact build
npm install -g billion-context@master # always the newest merged build
|
…st entry Three follow-ups so this lane's diff contains only the thinking-leak work: - LIFECYCLE.md: master's ranxianglei#5327 registered BILI_SESSION_CONTENT_STORE_PIN in the §2 standing table, and the lifecycle guard accepts that. This lane also added a §1 transition-ledger row for the same variable, i.e. two registrations for one name — the guard has no opinion, but a duplicate row is how registration drift starts. Kept master's §2 row only. - tests/text-safe.test.ts: the allowlist row for `stderr.trim().split("\n").slice(-3)` in src/pack-install.ts is dead — master rewrote that code to `safePrefix((tailLines.length > 3 ? tailLines.slice(...) : tailLines).join(" "), 300)` (ranxianglei#5340 follow-up), so the literal no longer exists and the gate never consults the entry. Verified the gate is still live by injecting `("x").slice(-3)` back into src/pack-install.ts: 17/1 with `not ok 18 - family gate: no raw negative string slices outside the allowlist`; restored -> 18/0. Battery after this: store 29, issue5175 34, tag-echo 79, text-safe 18, issue5103 5, pack-install 6, memory-contentstore-lazy 8, issue4788-resident-minimal 4, foreign-block-sweep 7, issue4666 2; the four static gates exit 0; `npx tsc --noEmit` clean; gen-config-docs is a fixed point.
…ence (ranxianglei#5505) Config surface registration (house pattern per ranxianglei#5327: sub-behavior documented in the parent entry desc, no separate seed key for object sub-fields, no new env var -- file-only like enabled/warn/abort). Regenerated CONFIGURATION.md/.zh-CN.md via tools/gen-config-docs.mjs.
…ence (ranxianglei#5505) Config surface registration (house pattern per ranxianglei#5327: sub-behavior documented in the parent entry desc, no separate seed key for object sub-fields, no new env var -- file-only like enabled/warn/abort). Regenerated CONFIGURATION.md/.zh-CN.md via tools/gen-config-docs.mjs.
…ile existence (ranxianglei#4599) The receiver fixture creates its .port file before the write lands; on a loaded runner the existsSync poll can win that race and read back an empty file, so Number("") === 0 tripped the assertion (CI: ubuntu-24 shard 2, run 42202673910 — second occurrence of this signature after PR ranxianglei#5327's one-off, recorded in ranxianglei#4599 as record-only). Poll until the content parses as a positive integer instead; the 15s deadline and the diagnostic message are unchanged.
…only, serving-immune) - src/perf-telemetry.ts: perf_events table (WAL, retention cap 200k rows, ring buffer), kill switch BILI_PERF_TELEMETRY, pure-JSON mode frozen/off, degrade-not-throw discipline (#5327 culture) - src/server.ts logRequestCost: structured mirror row through the single observation point every lane already flows through (#5408) - src/persist.ts: arm sqlite/mysql lanes at the two sidecar-open paths, explicit json-mode off - LIFECYCLE.md §2.4: BILI_PERF_TELEMETRY registered - tests/issue5460-perf-telemetry.test.ts: 8 cases incl. pinned DDL/WAL golden
…only, serving-immune) - src/perf-telemetry.ts: perf_events table (WAL, retention cap 200k rows, ring buffer), kill switch BILI_PERF_TELEMETRY, pure-JSON mode frozen/off, degrade-not-throw discipline (#5327 culture) - src/server.ts logRequestCost: structured mirror row through the single observation point every lane already flows through (#5408) - src/persist.ts: arm sqlite/mysql lanes at the two sidecar-open paths, explicit json-mode off - LIFECYCLE.md §2.4: BILI_PERF_TELEMETRY registered - tests/issue5460-perf-telemetry.test.ts: 8 cases incl. pinned DDL/WAL golden
…e extra payload perfRecordRequest built payload_json via JSON.stringify OUTSIDE any guard, so a BigInt / circular value in the exported `extra` field would throw synchronously out of the request hot path (logRequestCost) — violating the module's stated "degrades, never throws" / serving-immune contract (#5327/#5460). DORMANT today (request-cost passes no extra) but the exported API invites it. Wrap both record functions in try/catch that degrades telemetry (one-shot warn, state.dead) rather than propagating into the caller. Matches the existing ensureDb/insertRow degrade style. Adds a regression test pinning the never-throw behavior (a BigInt extra must not reach the caller).
…only, serving-immune) - src/perf-telemetry.ts: perf_events table (WAL, retention cap 200k rows, ring buffer), kill switch BILI_PERF_TELEMETRY, pure-JSON mode frozen/off, degrade-not-throw discipline (#5327 culture) - src/server.ts logRequestCost: structured mirror row through the single observation point every lane already flows through (#5408) - src/persist.ts: arm sqlite/mysql lanes at the two sidecar-open paths, explicit json-mode off - LIFECYCLE.md §2.4: BILI_PERF_TELEMETRY registered - tests/issue5460-perf-telemetry.test.ts: 8 cases incl. pinned DDL/WAL golden
…ile existence (ranxianglei#4599) The receiver fixture creates its .port file before the write lands; on a loaded runner the existsSync poll can win that race and read back an empty file, so Number("") === 0 tripped the assertion (CI: ubuntu-24 shard 2, run 42202673910 — second occurrence of this signature after PR ranxianglei#5327's one-off, recorded in ranxianglei#4599 as record-only). Poll until the content parses as a positive integer instead; the 15s deadline and the diagnostic message are unchanged. (cherry picked from commit 8d283b9)
…only, serving-immune) - src/perf-telemetry.ts: perf_events table (WAL, retention cap 200k rows, ring buffer), kill switch BILI_PERF_TELEMETRY, pure-JSON mode frozen/off, degrade-not-throw discipline (#5327 culture) - src/server.ts logRequestCost: structured mirror row through the single observation point every lane already flows through (#5408) - src/persist.ts: arm sqlite/mysql lanes at the two sidecar-open paths, explicit json-mode off - LIFECYCLE.md §2.4: BILI_PERF_TELEMETRY registered - tests/issue5460-perf-telemetry.test.ts: 8 cases incl. pinned DDL/WAL golden
这是啥问题?
pi/omp 插件里的重复调用守卫(防小模型死循环)在同一工具+同样参数连发第 5 次时,直接在调用执行前掐掉整个回合。但合法的等待/轮询天生就是"参数不变、结果随外部状态变":调试器
kd_wait每 10 秒问一次、omp 任务等待器每次返回下一个完成的——第 5 次(约 40-60s)被整段杀掉,等待还没到期(Codemode、omp 两起真实报告,issue #5225)。如何解决的?
升级链从「警告→一刀杀」改成三段式(owner 定稿):
abort阈值处只拒绝这一次调用并发出明确的最后警告(reason 里写明:再重发一次同样调用整个回合终止;轮询请改一次更长等待;换任何参数/工具计数立即重置)——回合保留,模型还有一次反应机会;ctx.abort()杀回合(原有 kill 语义后移一位)。真死循环保护不受削弱:最多多烧一次调用。同时修正两处误导文案("byte-for-byte identical"实为规范化排序键后相同;"re-running will not produce a new result"对轮询类不成立)。配置旋钮(
guardrails.repetition,warn=3/abort=5)不变,仅语义文档化:"abort=N"= N 次发最后警告,N+1 次杀回合(process.yaml + 生成的 CONFIGURATION*.md 已同步)。附带两处小修(都是合并遗留的既有红,非本 PR 引入)
BILI_SPAWN_FINGERPRINT([Bug] Plugin bootstrap spawns a new instance while the old one still holds the port and drops proxying (goes direct): la | [Bug] 插件 bootstrap 在旧实例仍占端口时新起实例并放弃代理(goes direct):大会话随即以未压缩历史撞上游上限(400 Range of input length / 413) #4125/本仓库已合的 [PR] Two installations differing by one version no longer deadlock on the same port; traffic is no longer sent in the clear ( | 两份安装差一个版本不再死锁在同一端口上,流量不再裸奔(#4125) #5303 引入)、BILI_SESSION_CONTENT_STORE_PIN(master [PR] fold idle session content stores between requests (#4788 phase 2) #5292 引入)——两者都在 src/ 读取但未登记,导致 master 自身 lifecycle-ledger-guard 红。CoreMessage[]塞了带ts的字面量,tsc 报 TS2353×4 → stub 参数类型放宽为(CoreMessage & { ts?: number })[]。tests/issue4313-message-timestamp-toggle.test.ts引用 acp-kernel 当前未导出的LEAN_HOW_TO_COMPRESS_TIMESTAMPED/CompressionState.tsStamps(kernel 产物需重建同步),master 既有的 typecheck 红,需要 feat: Support precise timestamps for each message, allowing the model to recognize which messages are outdated and which | feat: 给每个消息支持精确时间,以让模型认识到什么消息是过期的什么是当前的新的 #4313 一侧处理。回归测试与判定
node --import tsx --test tests/tool-guardrails-pi.test.ts:41/41(含新增:升级链 none→warn→final-refuse→abort;kd_wait 形态轮询活过第 5 次拒绝且换参即逃生;自定义阈值 warn=2/abort=3 同构;原 master 侧两个测试缺陷把每个 PR 的 CI 测试通道卡红(pi 工厂测试必崩 + 测试锁路径断言不兼容 Windows) #3170 missing-ctx 容错不变)tests/storage-unified.test.ts+ 上述合跑 58/58 pass(1 skipped);lifecycle-ledger-guard 绿;node tools/gen-config-docs.mjs generate无漂移URL
issue: #5225