Repository navigation
kernel: swap the JSON-poisoning phrases in the compress copy for escape hints (#2587) - #2647
Conversation
…pe hints (#2587) Minimal-diff redo of #2622 per review: the ONE-string line-form stays the PREFERRED shape everywhere; only the phrases that taught models to write invalid tool-call JSON are replaced, each delta under ten words: - compress-tools.ts content param: '(plain text survives lossy gateways best; …)' -> '(a valid JSON string: internal quotes \" and newlines \n; …)' - compress-tools.ts line-form entry: 'verbatim (no JSON escaping)' -> 'verbatim (a JSON string: quotes \", newlines \n)' - COMPRESS_TOOL description: '(no JSON structure, no escaping; …)' -> '(a valid JSON string — internal quotes \", newlines \n; …)' - TOOLS system-prompt example: '(plain text survives lossy gateways best)' -> '(a valid JSON string: \" and \n)' - nudge ONE_CALL_HINT / gentle 💡 line / lean pack: 'plain string' -> 'JSON-escaped string'; '(most robust through lossy gateways)' -> '(a valid JSON string: \" and \n)' Wire-contract goldens + prompt-function-default fixture regenerated. kernel 0.0.112 -> 0.0.113.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2862-pr.2647.a7678bcThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2647.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 收到,开始 review PR #2647(head |
[bot] 🏷 Review 结论:可合并——CI 26/26 独立核实全绿、分支干净落在当前 master、diff 收敛、Kernel Boundary 逐项合规。合并动作按规矩留给你(human-only)。 结构化八问
Kernel Boundary 逐项核对
两个收尾项(均不阻塞本 PR)
|
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.228-master.cd35263 # this exact build
npm install -g billion-context@master # always the newest merged build
|
kernel-change: kernel/src copy edits + kernel/package.json 0.0.112 → 0.0.113; wire-contract goldens regenerated; golden/fixture updates are mechanical.
Fixes #2580 (the tool-description root cause; original report #2579) — minimal-diff redo of #2622 (closed): keep the ONE-string line-form as the PREFERRED compress shape everywhere, and swap only the phrases that taught models to emit invalid tool-call JSON, each delta under ten words.
The failure being fixed (#2587 cluster)
Models wrote
compresstool arguments with bare unquoted ranges ({"content": m00099–…+ real newlines) or unescaped quotes inside strings. Anthropic-lane arguments are the only transport and are parsed as strict JSON, so one bad call fails the whole turn (DSH: MALFORMED_RESPONSE, unretried). The kernel copy was actively teaching this: "ONE plain string", "no JSON escaping", "no JSON structure, no escaping", "plain text survives lossy gateways best", "most robust through lossy gateways".Changes (7 spots, ≤10 words each)
contentparam description(plain text survives lossy gateways best; …)(a valid JSON string: internal quotes \" and newlines \n; …)verbatim (no JSON escaping)verbatim (a JSON string: quotes \", newlines \n)(no JSON structure, no escaping; …)(a valid JSON string — internal quotes \", newlines \n; …)(plain text survives lossy gateways best)(a valid JSON string: \" and \n)one plain stringone JSON-escaped string(most robust through lossy gateways)(a valid JSON string: \" and \n)contentparamONE plain stringONE JSON-escaped stringThe preferred wire format is unchanged:
content = "m00110–m00115 topic\nsummary…"— one string, header line, newline, summary — with the newline written\nand internal quotes\"inside the quoted value. Array entries stay accepted as before.Verification
"ONE call, ONE string"signature is untouched — zero test repins needed beyond the regenerated fixture/goldens);tsc --noEmitclean.kernel/tests/fixtures/prompt-function-default.txtregenerated (mechanical).#2591 (host-side salvage of malformed compress args) remains the backstop for residual B-class failures.