Repository navigation
[PR] verif: adapter buildRequest link stability judge (three vendors + cacheMarks variants) | verif: adapter buildRequest 线稳定判官(三家 + cacheMarks 变体) - #4112
Conversation
tests/verif-tag-echo-filter.test.ts: property judge over the REAL filter
family (src/loop/tag-echo-filter.ts). No solver — the interesting entry
points are outside the symbolic sublanguage today (lookaround +
\\p{So} regexes in stripAcpTags' family, stateful re.exec loops in the
stream filters), so this judge runs real code over adversarial
grammar-generated shapes (deterministic seed 0x7ea4c0de):
- P1 chunk-split equivalence (streaming ≡ whole-text) across 5 filter
factories, all split points for short texts + sampled + 3-way
- P1b absorb-instructed emission hold split-stability
- P2 stripAcpTags/normalizeEchoArtifacts idempotence
- P3 monotone length, P4 clean-prose passthrough, P5 residue duality
(strip-acted ⇒ strict detectors silent), P6 stats accounting,
P7 identity/compose sanity
- per-issue controls pinning the file's own history: #644 #1720 #1760
#1881 #2023 #2862 #717 #2405
TWO real bugs found immediately by the properties:
- #4106 stripAcpTags is NOT idempotent: the gated DEAD_REF_CLOSE pass
evaluates `out !== text` BEFORE the marker-line pass (which runs
LAST), so a marker line + trailing dead-ref-close text strips once
(keeps the dead ref) then strips MORE on the second call (marker
removal enabled an end-anchored TRUNC_REF_CLOSE match). Re-normalized
messages shrink per pass = unstable sent bytes. Pinned C#4106;
P2 domain excludes the shape until fixed.
- #4107 stream output depends on chunk boundaries (two shapes): (a)
dead-ref residue `m1255</acPA` is cleaned on whole-text push but
RELEASED to the client when the transport splits at the payload/close
boundary; (b) a bare close fragment `</apc ` at the chunk boundary
leaks in the split path. Both pinned (C#4107/C#4107-2); P1 domain
excludes tag-bearing texts until fixed.
Property overreach fixed during calibration (documented in-test):
containsMarkerLineText is the raw includes() pre-check (#717) while
removal is line-anchored (detect-but-keep for mid-line markers);
containsEchoResidue is an audit signal, not a strip guarantee
(#1760 close-only preservation); dropped vs dropCount are different
documented concepts.
README: judge table rows for the conflict-watch/snapshot/wire quartet,
responses-ingress, tag-echo-filter; found-bugs list += #4052 #4106
#4107.
Suite: 47/47 green (17/17 here). tsc clean.
…ogle) Turn-merging-aware append stability: completed turns' wire bytes must never change when history grows (P1 strict at turn boundaries, drop-last open-turn carve-out); idempotence + input non-mutation; notes tail-only; tool rounds verbatim. Generalizes the #1637/#1876/#2499 byte-prefix property across all three adapters. No solver needed (pure replay).
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4901-pr.4112.626258dThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4112.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 的实质内容( 标签: pr + scope/ci + p3(测试基建新增,非缺陷;跨三家 vendor 无特定客户端车道,不打客户端标) 审核结论(独立审,不复读 issue 描述)八问:
独立验证(不止读 diff):
小瑕疵(不拦):P4 非空性检查与 P3b 末轮检查用子串 contains 而非元素级断言——作为非空性守卫可接受,承重断言(P1/P3 的 deepEqual)是严格的,不值得为此返工。 判定: 可合。 顺序按你的注来——先合 #4108,本 PR 即剩单提交直接合。合并由人执行(AGENTS.md 规矩)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.720-master.7790bea # this exact build
npm install -g billion-context@master # always the newest merged build
|
这是什么
方向 3(脆弱面调查的第 2 项):给三个 provider adapter 的
buildRequest出站重建层加回归判官tests/verif-adapter-wire-stability.test.ts(纯回放,不需要求解器,CI 可跑)。为什么
#3837 家族的核心主张是"入站纯追加,出站也必须纯追加"。
adapter-anthropic.ts的注释(#1637 累计 cache_control 前缀稳定、#1876 system 追加不合并、#2499 客户端 marks 回退)只护住了 anthropic 一家;openai / google 的同一层没有任何判官。这条性质推广到三家并钉死。判官内容(17 项,全绿)
覆盖
createOpenaiAdapter/createAnthropicAdapter(含 cacheMarks 变体)/createGoogleAdapter,消息形状含 user 文本、tool-call+result 双轮、reasoning(thinkingTokens)、连续 assistant。结果
全部通过——buildRequest 层当前是稳的(#1637/#1876 的工作生效)。这条判官的作用是把该性质变成常驻回归:任何未来的出站重建改动若动了已完成轮次的字节,CI 直接红。
已知缺口(不在本 PR)
parseStream的 SSE 分块重切稳定性(#4107 家族真正的所在)需要按 provider 造 SSE 夹具,留作下一步。测试
node --import tsx --test tests/verif-adapter-wire-stability.test.ts→ 17/17tests/verif-*.test.ts→ 64/64npx tsc --noEmit干净(仅既有 pi-subagents/mysql 例外)人工合并(AGENTS.md 规矩)。