From 8b14609181415eadc3decb77373cf8f5822dd8d9 Mon Sep 17 00:00:00 2001 From: ework-agent Date: Thu, 22 Oct 2026 10:45:53 +0800 Subject: [PATCH 1/6] fix(#4252): accept flat single-range compress with summary text in content; guard unrecognized refs separators; unmask line-form reject reasons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - kernel parseObjectValue: a string content with NO refs headers plus top-level bounds ({content, startId, endId, topic}) is the two schema-advertised forms merged — recover it as one range (JSON-encoded {summary,topic} in the string unwrapped; explicit top-level summary wins). Line-form content with refs headers is never redirected. - REF_PAIR_IN_LINE / LINE_ENTRY_REFS_RE: accept U+2212 minus and U+FF0D fullwidth hyphen as range separators; a pair with an unrecognized separator is rejected with a precise reason instead of silently narrowing to the first ref. - Header-only line entries now report kind=no-valid-ranges with their per-entry missing-summary reasons instead of a blanket content-not-array (#362 visibility). - Schema text documents the accepted flat shape; proxy logs a flat-summary salvage warn line (#3780 style). - Tests: 10 kernel parse tests + 3 proxy reject-reason tests; full kernel suite 1428/1428, compress sweep 179/179. --- kernel/src/compress-tools.ts | 4 +- kernel/src/parse-compress-input.ts | 101 +++++++++++++++++- kernel/tests/parse-compress-input.test.ts | 124 ++++++++++++++++++++++ src/compress-tool.ts | 5 + tests/compress-reject-reasons.test.ts | 44 ++++++++ 5 files changed, 273 insertions(+), 5 deletions(-) diff --git a/kernel/src/compress-tools.ts b/kernel/src/compress-tools.ts index 0b7d3cc071..3d80a5f842 100644 --- a/kernel/src/compress-tools.ts +++ b/kernel/src/compress-tools.ts @@ -95,7 +95,7 @@ export const COMPRESS_PARAMETERS = { }, content: { description: - "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", anyOf: [ { type: "array", @@ -149,7 +149,7 @@ export const COMPRESS_PARAMETERS = { export const COMPRESS_TOOL = { name: COMPRESS_TOOL_NAME, description: - "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", input_schema: COMPRESS_PARAMETERS, }; diff --git a/kernel/src/parse-compress-input.ts b/kernel/src/parse-compress-input.ts index 3a77446cda..1fbdfa1941 100644 --- a/kernel/src/parse-compress-input.ts +++ b/kernel/src/parse-compress-input.ts @@ -44,6 +44,10 @@ export interface CompressParseDiagnostics { kind: CompressParseKind; /** True when the winning parse came from single→double quote repair. */ quoteSalvage?: boolean; + /** True when a flat single-range call carried its summary text in the + * `content` STRING alongside top-level refs ({content, startId, endId}) + * — the two schema-advertised shapes merged — and was recovered. */ + flatSummarySalvage?: boolean; /** True when a non-array `content` value (single entry object or nested * `ranges` array) was recovered into the canonical array form (#470). */ contentSalvage?: boolean; @@ -211,7 +215,28 @@ function parseObjectValue( diag.kind = "ok"; return finish(ranges, diag); } - diag.kind = "content-not-array"; + if (entries.length === 0 || entries.every(isHeaderlessLineEntry)) { + // No refs headers inside the string: the text may be the SUMMARY of + // a single flat range whose bounds sit at the TOP level — the two + // schema-advertised shapes ("content = ONE plain string" + the + // {startId, endId} single-range form) merged into one call. + // Observed live as bursts of identical `content-not-array` + // rejections while the model retried the same valid-intent call. + const flat = flatSingleRangeFromContent(value, content, callId); + if (flat !== undefined) { + diag.flatSummarySalvage = true; + diag.kind = "ok"; + return finish([flat], diag); + } + } + // Refs-bearing entries that failed validation are a real line-form + // attempt (report no-valid-ranges + reasons); all-headerless text was + // never line-form (keep the generic content-not-array classification). + diag.invalidItems = invalid; + if (reasons.length > 0) diag.invalidReasons = reasons; + diag.kind = entries.some((e) => !isHeaderlessLineEntry(e)) + ? "no-valid-ranges" + : "content-not-array"; return finish([], diag); } entries = parsed.entries; @@ -258,6 +283,62 @@ function parseObjectValue( return finish(ranges, diag); } +// A split line entry whose first line carries NO refs at all — pure prose. +// Only headerless content is eligible for the flat single-range recovery +// below (text with refs headers must keep its line-form reading, whatever +// its validation outcome). +function isHeaderlessLineEntry(e: unknown): boolean { + if (typeof e !== "string") return false; + const nl = e.indexOf("\n"); + const head = (nl === -1 ? e : e.slice(0, nl)).trim(); + return !REF_PAIR_IN_LINE.test(head) && !SINGLE_REF_IN_LINE.test(head); +} + +// Flat single-range recovery: summary text in the `content` STRING with +// bounds at the top level ({content, startId, endId, topic?}). Applies only +// when the content string carries NO refs headers of its own — a line-form +// string with headers was already parsed (or reported) above. A JSON-encoded +// {summary, topic} object inside the string (gateway double-encode) is +// unwrapped first. Returns undefined when the shape does not fit. +function flatSingleRangeFromContent( + value: Record, + content: string, + callId: string | undefined, +): CompressRangeSpec | undefined { + const start = + stringOr(value["startRef"]) ?? + stringOr(value["startId"]) ?? + stringOr(value["messageId"]); + const end = + stringOr(value["endRef"]) ?? + stringOr(value["endId"]) ?? + stringOr(value["messageId"]); + if (start === undefined || end === undefined) return undefined; + let summary = stringOr(value["summary"]); + let topic = stringOr(value["topic"]); + if (summary === undefined) { + const inner = tryParseLenient(stripFence(content.trim())); + if ( + inner !== null && + typeof inner === "object" && + !Array.isArray(inner) + ) { + const o = inner as Record; + summary = stringOr(o["summary"]); + if (topic === undefined) topic = stringOr(o["topic"]); + } + if (summary === undefined) { + const text = content.trim(); + if (text.length > 0) summary = text; + } + } + if (summary === undefined) return undefined; + const entry: Record = { startRef: start, endRef: end, summary }; + if (topic !== undefined) entry["topic"] = topic; + const outcome = validateEntry(entry, callId); + return "range" in outcome ? outcome.range : undefined; +} + function parseContentArray( s: string, ): { entries: unknown[]; salvaged: boolean; quoteRepaired?: boolean } | null { @@ -375,8 +456,13 @@ type EntryOutcome = { range: CompressRangeSpec } | { reason: string }; // anchored (^): summaries cite mNNNNN/bN refs routinely, so an unanchored // scan would let a citation inside a headerless entry supply fake bounds. const REF_PAIR_IN_LINE = - /^([mb]\d{1,7})\s*(?:[-\u2013\u2014\u2026~]|\.\.\.|to)\s*([mb]\d{1,7})\b/i; + /^([mb]\d{1,7})\s*(?:[-\u2013\u2014\u2026~\u2212\uFF0D]|\.\.\.|to)\s*([mb]\d{1,7})\b/i; const SINGLE_REF_IN_LINE = /^([mb]\d{1,7})\b/i; +// An unrecognized divider between two refs (punctuation run + a ref right +// after) — the pair regex missed a separator variant. Folding as a single +// ref would silently compress ONE message of a many-message range. +const UNRECOGNIZED_REF_SEP_RE = + /^\s*[^\p{L}\p{N}\s]{1,3}\s*[mb]\d{1,7}\b/iu; function normalizeLineRef(raw: string): string { const lower = raw.toLowerCase(); @@ -403,6 +489,15 @@ function parseLineEntry( const single = SINGLE_REF_IN_LINE.exec(head); if (single === null) return { reason: "line entry: no mNNNNN/bN refs in header" }; + // A second ref behind an unrecognized separator means this was meant to + // be a PAIR — accept it as a single ref and the fold would silently + // cover ONE message of a many-message range. Reject with a precise + // reason so the caller restates the range with a known separator. + const rest = head.slice(single.index + single[0].length); + if (UNRECOGNIZED_REF_SEP_RE.test(rest)) + return { + reason: "line entry: refs separator not recognized — refusing to narrow a ref pair to its first ref (use -, –, —, …, ~, .., or to)", + }; startRef = normalizeLineRef(single[1]!); endRef = startRef; afterRefs = single.index + single[0].length; @@ -439,7 +534,7 @@ export function deriveTopicFromSummary(summary: string): string | undefined { } const LINE_ENTRY_REFS_RE = - /[mb]\d{1,7}\s*(?:[-\u2013\u2014\u2026~]|\.\.\.|to)\s*[mb]\d{1,7}\b/iy; + /[mb]\d{1,7}\s*(?:[-\u2013\u2014\u2026~\u2212\uFF0D]|\.\.\.|to)\s*[mb]\d{1,7}\b/iy; const WHITESPACE_RE = /\s/; function skipWhitespace(s: string, i: number): number { diff --git a/kernel/tests/parse-compress-input.test.ts b/kernel/tests/parse-compress-input.test.ts index c5152fe0cb..e106255ed5 100644 --- a/kernel/tests/parse-compress-input.test.ts +++ b/kernel/tests/parse-compress-input.test.ts @@ -1236,3 +1236,127 @@ test("line-form split still breaks on headers after blank lines and element resi ], ); }); + +// --------------------------------------------------------------------------- +// Flat single-range: summary text in the content STRING + top-level bounds +// ({content, startId, endId, topic?}) — the two schema-advertised shapes +// merged into one call. Observed live as repeated kind=content-not-array +// rejections while the model retried the same valid-intent compress. +// --------------------------------------------------------------------------- + +test("parseCompressArgs recovers a flat single-range call with summary text in content", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: "Summary of the folded range.\nSecond line of the summary.", + startId: "m00150", + endId: "m00168", + }); + assert.equal(diagnostics.ok, true); + assert.equal(diagnostics.flatSummarySalvage, true); + assert.equal(diagnostics.kind, "ok"); + assert.equal(ranges.length, 1); + assert.equal(ranges[0]?.startRef, "m00150"); + assert.equal(ranges[0]?.endRef, "m00168"); + assert.equal(ranges[0]?.summary, "Summary of the folded range.\nSecond line of the summary."); +}); + +test("parseCompressArgs flat single-range keeps top-level topic and ref variants", () => { + const { ranges } = parseCompressArgs({ + content: "The summary text.", + startRef: "m00002", + endRef: "m00009", + topic: "repro loop", + }); + assert.equal(ranges.length, 1); + assert.equal(ranges[0]?.startRef, "m00002"); + assert.equal(ranges[0]?.endRef, "m00009"); + assert.equal(ranges[0]?.topic, "repro loop"); +}); + +test("parseCompressArgs flat single-range unwraps a JSON-encoded {summary,topic} in content", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: JSON.stringify({ summary: "encoded summary", topic: "inner topic" }), + startId: "m00001", + endId: "m00004", + }); + assert.equal(diagnostics.flatSummarySalvage, true); + assert.equal(ranges[0]?.summary, "encoded summary"); + assert.equal(ranges[0]?.topic, "inner topic"); +}); + +test("parseCompressArgs flat single-range prefers an explicit top-level summary over content text", () => { + const { ranges } = parseCompressArgs({ + content: "ignored prose", + summary: "explicit summary wins", + startId: "m00001", + endId: "m00002", + }); + assert.equal(ranges[0]?.summary, "explicit summary wins"); +}); + +test("parseCompressArgs does NOT apply flat single-range when content carries refs headers", () => { + // Line-form material keeps its line-form reading even with top-level refs: + // valid headers parse as ranges... + const ok = parseCompressArgs({ + content: "m00010–m00020 topic\nsummary text.", + startId: "m00001", + endId: "m00099", + }); + assert.equal(ok.ranges.length, 1); + assert.equal(ok.ranges[0]?.startRef, "m00010"); + assert.equal(ok.diagnostics.flatSummarySalvage, undefined); + // ...and header-only entries report the missing summary, not a salvage. + const bad = parseCompressArgs({ + content: "m00010–m00020 topic only", + startId: "m00001", + endId: "m00099", + }); + assert.equal(bad.diagnostics.ok, false); + assert.equal(bad.diagnostics.flatSummarySalvage, undefined); + assert.equal(bad.diagnostics.kind, "no-valid-ranges"); + assert.match(bad.diagnostics.invalidReasons?.[0] ?? "", /missing summary/); +}); + +test("parseCompressArgs keeps headerless prose without top-level refs as content-not-array", () => { + const { diagnostics } = parseCompressArgs({ content: "just prose, no refs, no bounds" }); + assert.equal(diagnostics.kind, "content-not-array"); + assert.equal(diagnostics.flatSummarySalvage, undefined); +}); + +test("parseCompressArgs reports header-only line entries as no-valid-ranges with reasons", () => { + const { diagnostics } = parseCompressArgs({ + content: "m00010–m00020 topic one\nsummary ok.\nm00030–m00040 topic two", + }); + assert.equal(diagnostics.kind, "ok"); // 1 valid + 1 invalid + assert.equal(diagnostics.invalidItems, 1); + assert.match(diagnostics.invalidReasons?.[0] ?? "", /missing summary/); + const none = parseCompressArgs({ content: "m00010–m00020 topic only" }); + assert.equal(none.diagnostics.kind, "no-valid-ranges"); + assert.match(none.diagnostics.invalidReasons?.[0] ?? "", /missing summary/); +}); + +// --------------------------------------------------------------------------- +// Refs separator variants: a pair divider outside the recognized dash class +// must never silently narrow the range to its first ref. +// --------------------------------------------------------------------------- + +test("parseCompressArgs accepts U+2212 minus and fullwidth hyphen as range separators", () => { + const minus = parseCompressArgs({ content: "m00150−m00168 topic\nsummary." }); + assert.equal(minus.ranges[0]?.startRef, "m00150"); + assert.equal(minus.ranges[0]?.endRef, "m00168"); + const fw = parseCompressArgs({ content: "m00150-m00168 topic\nsummary." }); + assert.equal(fw.ranges[0]?.startRef, "m00150"); + assert.equal(fw.ranges[0]?.endRef, "m00168"); +}); + +test("parseCompressArgs refuses to narrow a ref pair with an unrecognized separator", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: "m00150 => m00168 topic\nsummary.", + }); + assert.equal(ranges.length, 0); + assert.equal(diagnostics.kind, "no-valid-ranges"); + assert.match(diagnostics.invalidReasons?.[0] ?? "", /separator not recognized/); + // A legit single-ref header with a punctuation topic still parses. + const single = parseCompressArgs({ content: "m00150 — intro notes\nsummary." }); + assert.equal(single.ranges[0]?.startRef, "m00150"); + assert.equal(single.ranges[0]?.endRef, "m00150"); +}); diff --git a/src/compress-tool.ts b/src/compress-tool.ts index b0e4249684..2cd8a24e3c 100644 --- a/src/compress-tool.ts +++ b/src/compress-tool.ts @@ -539,6 +539,11 @@ export function parseCompressInput(input: unknown, callId?: string) { if (parsed.diagnostics.quoteSalvage === true) { loggerLog("warn", `[acp-compress-input] quote-salvage: recovered ${parsed.ranges.length} range(s) after single->double quote normalization (kind=${parsed.diagnostics.kind})`); } + if (parsed.diagnostics.flatSummarySalvage === true) { + // Flat single-range call ({content: "", startId, endId}) + // — the two schema-advertised shapes merged — recovered by the kernel. + loggerLog("warn", `[acp-compress-input] flat-summary salvage: recovered ${parsed.ranges.length} range(s); summary text arrived in content alongside top-level refs`); + } if (!parsed.diagnostics.ok && parsed.diagnostics.kind !== "ok") { loggerLog("warn", `[acp-compress-input] rejected: kind=${parsed.diagnostics.kind} invalidItems=${parsed.diagnostics.invalidItems}${parsed.diagnostics.keys ? ` keys=[${parsed.diagnostics.keys.join(",")}]` : ""}${parsed.diagnostics.length !== undefined ? ` len=${parsed.diagnostics.length}` : ""}${parsed.diagnostics.invalidReasons && parsed.diagnostics.invalidReasons.length > 0 ? ` reasons=[${parsed.diagnostics.invalidReasons.join(" | ")}]` : ""}`); } else if (parsed.diagnostics.invalidItems > 0 || parsed.diagnostics.kind === "truncated") { diff --git a/tests/compress-reject-reasons.test.ts b/tests/compress-reject-reasons.test.ts index 57fb1768f5..f42ba1136b 100644 --- a/tests/compress-reject-reasons.test.ts +++ b/tests/compress-reject-reasons.test.ts @@ -70,3 +70,47 @@ test("#362: diagnostics flow — valid parse returns ranges + ok diagnostics", ( assert.equal(parsed.diagnostics.ok, true); assert.equal(parsed.diagnostics.kind, "ok"); }); + +// --------------------------------------------------------------------------- +// Flat single-range: summary text in the content STRING + top-level bounds — +// the two schema-advertised shapes merged into one call. Live incident: +// six identical kind=content-not-array rejections in a single compress burst +// while the model retried the same valid-intent call. +// --------------------------------------------------------------------------- + +test("flat single-range call with summary text in content parses (live incident shape)", () => { + const parsed = parseCompressInput({ + content: "Investigated the repro loop; root cause was the parse gate rejecting valid payloads.", + startId: "b114", + endId: "b114", + topic: "repro loop", + }); + assert.equal(parsed.diagnostics.ok, true); + assert.equal(parsed.diagnostics.flatSummarySalvage, true); + assert.equal(parsed.ranges.length, 1); + assert.equal(parsed.ranges[0]?.startRef, "b114"); + assert.equal(parsed.ranges[0]?.endRef, "b114"); + assert.ok(parsed.ranges[0]?.summary.startsWith("Investigated the repro loop")); +}); + +test("flat single-range salvage also unwraps a JSON-encoded summary object in content", () => { + const parsed = parseCompressInput({ + content: JSON.stringify({ summary: "encoded summary body", topic: "inner" }), + startId: "m00150", + endId: "m00168", + }); + assert.equal(parsed.diagnostics.ok, true); + assert.equal(parsed.ranges[0]?.summary, "encoded summary body"); + assert.equal(parsed.ranges[0]?.topic, "inner"); +}); + +test("line-form string content with refs headers is not redirected to flat salvage", () => { + const parsed = parseCompressInput({ + content: "m00010–m00020 topic\nsummary line.", + startId: "m00001", + endId: "m00030", + }); + assert.equal(parsed.diagnostics.ok, true); + assert.equal(parsed.diagnostics.flatSummarySalvage, undefined); + assert.equal(parsed.ranges[0]?.startRef, "m00010"); +}); From d5848cf1a4eebe18fbab12adf007d9683fc06cf1 Mon Sep 17 00:00:00 2001 From: awork Date: Thu, 22 Oct 2026 11:14:16 +0800 Subject: [PATCH 2/6] test(#4252): regenerate wire-contract goldens for the compress schema text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The compress tool description and content param description now document the accepted flat single-range form {content: "", startId, endId, topic?}. Golden regeneration via scripts/update-wire-contract-goldens.ts; the diff is exactly those two description strings across the four wire shapes (tool + param) in kernel.json/bili.json/manifest-*.json — no other surface moved. --- tests/golden/wire-contract/bili.json | 14 +++++----- tests/golden/wire-contract/kernel.json | 28 +++++++++---------- .../wire-contract/manifest-default.json | 12 ++++---- .../golden/wire-contract/manifest-optin.json | 12 ++++---- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/golden/wire-contract/bili.json b/tests/golden/wire-contract/bili.json index 95b5629723..26020a098d 100644 --- a/tests/golden/wire-contract/bili.json +++ b/tests/golden/wire-contract/bili.json @@ -3,7 +3,7 @@ "anthropic": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "input_schema": { "type": "object", "properties": { @@ -12,7 +12,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -206,7 +206,7 @@ "type": "function", "function": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -215,7 +215,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -421,7 +421,7 @@ { "type": "function", "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -430,7 +430,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -626,7 +626,7 @@ "google": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { diff --git a/tests/golden/wire-contract/kernel.json b/tests/golden/wire-contract/kernel.json index 4d746ccd8d..9371da57a2 100644 --- a/tests/golden/wire-contract/kernel.json +++ b/tests/golden/wire-contract/kernel.json @@ -3,7 +3,7 @@ "ACP_TOOLS_ANTHROPIC": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "input_schema": { "type": "object", "properties": { @@ -12,7 +12,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -194,7 +194,7 @@ "type": "function", "function": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -203,7 +203,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -397,7 +397,7 @@ { "type": "function", "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -406,7 +406,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -665,7 +665,7 @@ "ACP_TOOLS_GOOGLE": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -765,7 +765,7 @@ "individual": { "COMPRESS_TOOL": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "input_schema": { "type": "object", "properties": { @@ -774,7 +774,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -885,7 +885,7 @@ "type": "function", "function": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -894,7 +894,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -1005,7 +1005,7 @@ "COMPRESS_TOOL_RESPONSES": { "type": "function", "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -1014,7 +1014,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -1123,7 +1123,7 @@ }, "COMPRESS_TOOL_GOOGLE": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { diff --git a/tests/golden/wire-contract/manifest-default.json b/tests/golden/wire-contract/manifest-default.json index e911e898d3..e4a3b8b309 100644 --- a/tests/golden/wire-contract/manifest-default.json +++ b/tests/golden/wire-contract/manifest-default.json @@ -16,7 +16,7 @@ "anthropic": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "input_schema": { "type": "object", "properties": { @@ -25,7 +25,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -227,7 +227,7 @@ "type": "function", "function": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "parameters": { "type": "object", "properties": { @@ -236,7 +236,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -453,7 +453,7 @@ { "type": "function", "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "parameters": { "type": "object", "properties": { @@ -462,7 +462,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", diff --git a/tests/golden/wire-contract/manifest-optin.json b/tests/golden/wire-contract/manifest-optin.json index 54507d9713..2b786c6d47 100644 --- a/tests/golden/wire-contract/manifest-optin.json +++ b/tests/golden/wire-contract/manifest-optin.json @@ -19,7 +19,7 @@ "anthropic": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "input_schema": { "type": "object", "properties": { @@ -28,7 +28,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -296,7 +296,7 @@ "type": "function", "function": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "parameters": { "type": "object", "properties": { @@ -305,7 +305,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", @@ -597,7 +597,7 @@ { "type": "function", "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content. Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. REQUIRED — compress without content or flat range fields is invalid. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "parameters": { "type": "object", "properties": { @@ -606,7 +606,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", + "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", "anyOf": [ { "type": "array", From 541d1e2f89673e7ec10a6d40ebbdff7067bb5052 Mon Sep 17 00:00:00 2001 From: awork Date: Thu, 22 Oct 2026 11:14:16 +0800 Subject: [PATCH 3/6] kernel(#4252): bump acp-kernel 0.0.151 -> 0.0.152 Kernel Boundary rule 2 (CI kernel-guard): kernel/src changes require a version bump in kernel/package.json so accumulated changes can ship as an independent acp-kernel release later. Regenerates both lockfiles (version lines only). --- kernel/package-lock.json | 4 ++-- kernel/package.json | 2 +- package-lock.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/package-lock.json b/kernel/package-lock.json index 9baae27bd2..c38844609e 100644 --- a/kernel/package-lock.json +++ b/kernel/package-lock.json @@ -1,12 +1,12 @@ { "name": "acp-kernel", - "version": "0.0.151", + "version": "0.0.152", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "acp-kernel", - "version": "0.0.151", + "version": "0.0.152", "license": "MIT", "devDependencies": { "@types/node": "^22.0.0", diff --git a/kernel/package.json b/kernel/package.json index e2c2fc639d..0bf842da94 100644 --- a/kernel/package.json +++ b/kernel/package.json @@ -1,6 +1,6 @@ { "name": "acp-kernel", - "version": "0.0.151", + "version": "0.0.152", "description": "Framework-agnostic context-compression engine (model-driven, 3-tier LSM). Pure core: no host dependency.", "license": "MIT", "author": "ranxianglei", diff --git a/package-lock.json b/package-lock.json index bdf36da011..fa5d911e0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ }, "kernel": { "name": "acp-kernel", - "version": "0.0.151", + "version": "0.0.152", "dev": true, "license": "MIT", "devDependencies": { From f771c71724a0d4ab86addc7663368a8e11800308 Mon Sep 17 00:00:00 2001 From: awork Date: Thu, 22 Oct 2026 11:59:38 +0800 Subject: [PATCH 4/6] test(#4252): regen storage-render goldens for the compress schema text The compress tool description/param text is injected into every outbound body (compress.injectTool=true in the golden drive), so the schema-text change shifts all pinned per-turn digests by the ~173-byte tool-JSON delta. Regenerated via scripts/update-storage-render-goldens.ts (digest-only diff, matches the CI failure pair 2a7d4d40 -> f98b8102 on chat turn 0). --- tests/golden/storage-render/anthropic.json | 70 +++++++++++----------- tests/golden/storage-render/chat.json | 70 +++++++++++----------- tests/golden/storage-render/google.json | 70 +++++++++++----------- tests/golden/storage-render/responses.json | 70 +++++++++++----------- 4 files changed, 140 insertions(+), 140 deletions(-) diff --git a/tests/golden/storage-render/anthropic.json b/tests/golden/storage-render/anthropic.json index 91c052b92d..4ad5af6712 100644 --- a/tests/golden/storage-render/anthropic.json +++ b/tests/golden/storage-render/anthropic.json @@ -3,94 +3,94 @@ "turns": [ { "i": 0, - "sha": "7c4f857fd5fae962d49f3bd05b9095598891b44daa1ca5362da597abca546138", - "bytes": 23307 + "sha": "d60fde295513c13c8ad7203f8f8f36b9b63beecd65d2c4bfa9c9f6e02257f8ce", + "bytes": 23480 }, { "i": 1, - "sha": "63db660a4919986ddbc0cc3879e5c5b5f87264caf935da49afe0c6447e3d36ed", - "bytes": 32017 + "sha": "fb5cfface659d45feca8efa97c2aee0c08753e880f376879a484fa4c4cd58172", + "bytes": 32190 }, { "i": 2, - "sha": "8831efb84b9edf619fe16bc167091d372e7241ee80a20cb2b7fd1868f198c225", - "bytes": 37916 + "sha": "7a64f19b44be5f1ca85c0f276349b67293317bc6cfb7477085a1dd2ddd6248b2", + "bytes": 38089 }, { "i": 3, - "sha": "ef8660e6ab3af9a916b060760b114f281b032be989442664de22650377a35683", - "bytes": 46589 + "sha": "cd47dd4568e645d8ea9caa5c5e56d4991dab5fec515286bbbc64b800205d921c", + "bytes": 46762 }, { "i": 4, - "sha": "b7a2f1a03d58237b95c0ebd66c9732dcd175bf81f395b7167ea99121770730bc", - "bytes": 52451 + "sha": "4c4d2c089152aaab4f4b44aba0f00985134db190220582b5efbcf37f28fb590f", + "bytes": 52624 }, { "i": 5, - "sha": "0896198415344f5090542851b4be843bf56aba58d2dfe05f749268af893c0192", - "bytes": 61124 + "sha": "affa9850a4bf9cb418a4616456d577112a0473a0abee0388d14a11b1f2097ffe", + "bytes": 61297 }, { "i": 6, - "sha": "7e79f4ba7417cdfe22104abd66c2280e83baefa70b455be329942954a0e2a8ed", - "bytes": 66986 + "sha": "72a73c88c5ee95cc8ec35b1ccadfda28f120c800d7e3f11aa378a6aa6a8294bf", + "bytes": 67159 }, { "i": 7, - "sha": "8ca054c3511ffaa93af23fdef0511d51b434fa0966507128a3bbb0894ced5190", - "bytes": 75659 + "sha": "aaa7be198afefa0eda46954bd2d57e0bdeceba0f4e6973fe168eaaf54b7d40d2", + "bytes": 75832 }, { "i": 8, - "sha": "af1acac0915dc3c1d2ad6e281a3025baa8518b04f5a5d5e15995d35d3243b434", - "bytes": 81521 + "sha": "0cad24e8d7a2b898306fcf17b1eb236474191e22a99e4763337348086b7ceb10", + "bytes": 81694 }, { "i": 9, - "sha": "f665c17563482a816287f24d7f6bdf39965daaf89075e31b2122ea3208615584", - "bytes": 50548 + "sha": "945e2223f480ee5de8f50883c374da4bb1d652701c92c4c4874ca34d6cfc36d8", + "bytes": 50721 }, { "i": 10, - "sha": "b0c1c8b2f38f3535478dbf46ad066c5b8082ebf383502d88ce3016cc2ae896b1", - "bytes": 58090 + "sha": "c6dff575ed60eeaf877ebcd201afe51275d6a4af547217ef0dba082f75f92c66", + "bytes": 58263 }, { "i": 11, - "sha": "b9b7261c92ef512eabc194481d943dfb1091f0b1745317fcea122f7ed857c19c", - "bytes": 63912 + "sha": "4542905c00be0d07006383b84f5e3c95c1d8c0be7268fc1fd68d6d2371658cc0", + "bytes": 64085 }, { "i": 12, - "sha": "1851a6b5696c53d5a618aae8763c3aa434e387dcdf474b5b5034515e1d99f4fc", - "bytes": 78050 + "sha": "4b7b9917da2b8601ea13baa9b0730a184c10a014438b542712925bc1c8d9cc09", + "bytes": 78223 }, { "i": 13, - "sha": "954dff3e43aaac3bdab2b3351d420f0eee91277e2abf72d75dbbf7f266a58c4b", - "bytes": 83835 + "sha": "444a9aee090b8a6443ebab439aa6fbeedd5e06363c8bd049607f1ad54eaf7676", + "bytes": 84008 }, { "i": 14, - "sha": "5a5e6af48bd42439bf8acf6465ca0823e51f4b5e37b48c784c649a87d69a7d85", - "bytes": 92484 + "sha": "a95aad2ccc698d37d5ca91b059ecfbb2afeebe5dfa389f4b5306daf502281e33", + "bytes": 92657 } ], "foldAt": 9, "editedAt": 12, "summaryFrom": 9, - "stateDigest": "5839fb455554a276e973fc8e2a6039971d430df48c5e64970728cc66f3005ae7", + "stateDigest": "e119ed8e25dc36e7f7e857df4326944ff6cb4ec9e2343d349ddb6d53e47b8242", "sectionDigests": { - "state": "a4b83f873d16bfc4", + "state": "d3ead7b0084732f8", "blockContents": "dc7d13d250c94bb4", - "stats": "cff3c2546898aeb3", - "metadata": "95795174db0e1e50" + "stats": "ab25c8ac52f138ac", + "metadata": "acab1dafd6447f6a" }, "stateKeyDigests": { "blocks": "3a454b9a16e4f0b9", "messageRefs": "3d09c9004582bdbc", - "nudge": "416b77eda589e737", + "nudge": "647e80dde348d578", "stats": "23312f7d5a0b9e27", "nextBlockId": "d4735e3a265e16ee", "nextRunId": "d4735e3a265e16ee", diff --git a/tests/golden/storage-render/chat.json b/tests/golden/storage-render/chat.json index ebe66d6ae6..b074e9f89b 100644 --- a/tests/golden/storage-render/chat.json +++ b/tests/golden/storage-render/chat.json @@ -3,94 +3,94 @@ "turns": [ { "i": 0, - "sha": "2a7d4d402bd55342bf8bfd8d5adf87591d84e1398174540d3813cd95172d0fb5", - "bytes": 23417 + "sha": "f98b81028d0c8dd88121a87e79146492cb098c3b52617fc1829b1a3261b27e4b", + "bytes": 23590 }, { "i": 1, - "sha": "ce55234b88db48e3d7b0b52085963b727e30e485a39af819594fce77097b7207", - "bytes": 31995 + "sha": "f7e672c25bb4aa44db839d4c3a76d7c5c9adc22e69520d3982146f0fc123bb9b", + "bytes": 32168 }, { "i": 2, - "sha": "1c6a2f7169fee01285819f84146bee61aef7934b68cf5c16838b3b7a0960fff3", - "bytes": 37807 + "sha": "172364b1f2363bc1319e388db5a29d823aa66fdacf1ccdabbf6914b0b510dfaa", + "bytes": 37980 }, { "i": 3, - "sha": "8bbfe9c4af21ba7626f9c2abbe94a287730448c09bc544955d4a16e5fb0e0cde", - "bytes": 46385 + "sha": "01e976391ff471763e96144261a9f8390ace9a1156039d0132bddcb594e01ec6", + "bytes": 46558 }, { "i": 4, - "sha": "0b16037a50efcb87bbdfdc321bf75f9847771f1552bed7e9ccb0f0a9a1a39fa7", - "bytes": 52197 + "sha": "419e9f3de9a65ba7e21e3c93b6c646b7f5ea38ceeb3449017692af9630917f27", + "bytes": 52370 }, { "i": 5, - "sha": "1a7edb8f445334cfd25e0ca159060a54a8c37bff53d9f0a3efd4acd2ca0059da", - "bytes": 60775 + "sha": "d3a926eb546eafa6c6ac8c1c4b2e16cf3f01ca2f99a8452e776a338f7dfab16b", + "bytes": 60948 }, { "i": 6, - "sha": "afd6a636915f86a3cb7064fc807a8be72f12f86b5f90b1b9147320c526aab92b", - "bytes": 66587 + "sha": "ca12f73c90b867d2238f16a0654df41edda6b945b3b4072d4cc00e4c4cb8f822", + "bytes": 66760 }, { "i": 7, - "sha": "ae088e5256b0e6b5b771f382e55bd3c5b8f6f3df81194721f3284f62f3b7e392", - "bytes": 75165 + "sha": "5d471c6819b6399ef3f0ccb190cd86d5afe4b3bbaa83b9bee10dc587c32b0d1f", + "bytes": 75338 }, { "i": 8, - "sha": "5623e4626136cb65156548acf8c801770f445709aa5c1d57f0de056441230162", - "bytes": 80977 + "sha": "e63601c58dec9de8bf30b8090b539156f243971794a8606fb81ee816bab9a9be", + "bytes": 81150 }, { "i": 9, - "sha": "187920f4d4b1cc5ce43a3e52027008e193441ed834026669cd5a37dc4034ee17", - "bytes": 50478 + "sha": "d5e2f07892a99b339e0669cab800d96d2e841a09a7c859627cc4426dc1e665b0", + "bytes": 50651 }, { "i": 10, - "sha": "89ab8419c57248c79777d523f0c888ea798bdef146ace4f52b14a0d672d593b2", - "bytes": 57879 + "sha": "21d5911f066ad71f90f376fdf22b26333492a29cb2f8ae86e9d2995dc6e68e9d", + "bytes": 58052 }, { "i": 11, - "sha": "a830324598bd68492380344532152dae98ae91fca26a9fb9917cf2dc16450fd9", - "bytes": 63614 + "sha": "130a0fa66ed15ce88f223aed5a7ea55b3a782ab79945bd93a019dec06d6d967b", + "bytes": 63787 }, { "i": 12, - "sha": "7e2fb54ac5c850cd92d0e1a63585f729d6883426357677f394674fb49f1c2068", - "bytes": 77660 + "sha": "bf6a5be76a62bf03b7dcc8ad3376600579707c436a9222f7ce30cc1b7ce32619", + "bytes": 77833 }, { "i": 13, - "sha": "6e09bf973ab1de4ea1e6c350e169147de681237522ed2e414d967cefc925d59c", - "bytes": 83395 + "sha": "c20c1a521bba9dc4f91f464d8c736af7c31c4077e03f24b26bd3cb868d9de49d", + "bytes": 83568 }, { "i": 14, - "sha": "42209cfddbd623dc6ee3f23564ab2f57e3d711f24b1eabbe5cd16d27dbed2bf4", - "bytes": 91949 + "sha": "ec30818d215815b4816cfebc05cd7036937754e6b2b56286622686795ea28e43", + "bytes": 92122 } ], "foldAt": 9, "editedAt": 12, "summaryFrom": 9, - "stateDigest": "38d6459bd83802b5c7ba79b10d6e12a82ba99086377ae2ec8676c41558e08b3d", + "stateDigest": "8ab601b915ac7b1e4d79d86759b79338b8b23b57fe02005d5014b2d6462cdbcc", "sectionDigests": { - "state": "463b3dc26a100c2a", + "state": "d934242379b7a2ba", "blockContents": "94a58f96d7c5cfc3", - "stats": "59842ce5415d3a4d", - "metadata": "d16fb5934a3e8779" + "stats": "eb2d2559feb8aebe", + "metadata": "78d04d89e561cfa4" }, "stateKeyDigests": { "blocks": "d9770feee91dafc6", "messageRefs": "48135bb278ef6a47", - "nudge": "b539bf305b125cb7", + "nudge": "12d5737f91f6fb43", "stats": "f85b2ad1a3b86e2f", "nextBlockId": "d4735e3a265e16ee", "nextRunId": "d4735e3a265e16ee", diff --git a/tests/golden/storage-render/google.json b/tests/golden/storage-render/google.json index 13d78598b0..7507efb8ae 100644 --- a/tests/golden/storage-render/google.json +++ b/tests/golden/storage-render/google.json @@ -3,94 +3,94 @@ "turns": [ { "i": 0, - "sha": "f5dc4cf53560506a6512df6705e8a19b0ceb083d498e0238c6fdbfac2d7fc557", - "bytes": 20757 + "sha": "6d4c7fe3c6eab87bdf845de9514cad49d3d58f0bcb3fc9b10ace7a6d5467ec28", + "bytes": 20810 }, { "i": 1, - "sha": "6d09d7c16d2da11d69830e37c7b686544ac9303705890f19878a3ac30326cded", - "bytes": 29312 + "sha": "1ad332a6bc6cfe194bcde07239794f6e86a2afac4259e51de9f6913423389825", + "bytes": 29365 }, { "i": 2, - "sha": "73176e2f6f0cd153757fd7b7aa53e1264ec906d5327fd766e8575efa1ed4b3d1", - "bytes": 35138 + "sha": "f3d575fe349bebdbb3a0f788e0f87ee87946e0dab249e2d4f0d205847beb34b8", + "bytes": 35191 }, { "i": 3, - "sha": "f402f8cb7a82f1f18778bcad90c92df1aef605ff36c89f4a676ab978d8f50831", - "bytes": 43693 + "sha": "4b5651c2d10f2c0b753ffe132af57b590ed641c0076449bd8758485f7892ae1f", + "bytes": 43746 }, { "i": 4, - "sha": "ec4e7603429b589ca4159d603b2d7170abdca50a2daff76b9e937eedc7769a39", - "bytes": 49519 + "sha": "7f91730a209b5b592cf49ed92fb147ad27271874b40d14b0042722d7e86ee7f1", + "bytes": 49572 }, { "i": 5, - "sha": "575b63163cdbf0a891e4b9fe0bfe701ad7420d357fff22d2f93af17cd2e5ee23", - "bytes": 58074 + "sha": "8ab89c1b4dbeea59ee8103fdd225be1fd2e5c3c036102ee4639db3f938578787", + "bytes": 58127 }, { "i": 6, - "sha": "939c1376f6be5f13c039332459ed815bdc067d80776ead20cbc1ce67bb75bf86", - "bytes": 63900 + "sha": "c482f7008fbbaa3bf2a44d0c6fb33cd84f394a79059948f4fd8bb96c07d9e3f3", + "bytes": 63953 }, { "i": 7, - "sha": "2345e668666b71cae9eb1c19a6689df16e1df1c1976cc885c821edcfd2f561f5", - "bytes": 72455 + "sha": "0e0afdb8f3160df0e3f36b9a54837aae9290066b5a8c2f741c5eeab6802389ee", + "bytes": 72508 }, { "i": 8, - "sha": "a50b8a3b217fb6bbf88305838d160f5d460c77bd2a3946a3b4d996780500a858", - "bytes": 78281 + "sha": "f098d8b829b12e075c32074de8f2a1ce2bbd89fe416b4dc8b3d318afcea626a3", + "bytes": 78334 }, { "i": 9, - "sha": "e38ba572fc6a78edd320383f084bba8ed93b8c687a0fda490eff3083af87e8ca", - "bytes": 50867 + "sha": "9aeb9ad098fd9ba8341254299372f5f0ac5a6df48024c58ff4d6656e5674254b", + "bytes": 50920 }, { "i": 10, - "sha": "8a05cf4b7f1faba876e0aca26af58d4d2d826d3edfcd3fc3b61ba6ce29cb53ff", - "bytes": 58270 + "sha": "af22944e5c62b4713b00055f37ee5c941133db3f7c5f2f4540377889ed395e0e", + "bytes": 58323 }, { "i": 11, - "sha": "6ddc8da9e5c8a3ea1f8b97ba7e18f8c20d2d43b2568266778aa3e4b5fa9c011f", - "bytes": 64019 + "sha": "e486ed0770c7772f42767bba15d2b830c09d734a333d006a6f12d6b35794f715", + "bytes": 64072 }, { "i": 12, - "sha": "6473158a0c3f366bde820cf1a09670ca87fe7904edf62b38213f04a727e89274", - "bytes": 78024 + "sha": "b0b92b1f97e7945091a9fff2ecf9bb4cc9aff4cdcc0e662f633d3f79628d5c23", + "bytes": 78077 }, { "i": 13, - "sha": "33707b02a77dbbffe32bda03406fcd826e6c65c16530d0d577fd0dc2d0d4495f", - "bytes": 83773 + "sha": "94022cfaa0d77d9ee8adbb36079aef5492bd71d8a8618bb14b8750ef60add9eb", + "bytes": 83826 }, { "i": 14, - "sha": "d37fa868f12bde6c04a3b8383a2a935443b5c82ef5262e36a5ce2827afd177ea", - "bytes": 92303 + "sha": "012523e6afffdbd76f170ec17200d7e0f744d1e0c78c3165f867375df22b951f", + "bytes": 92356 } ], "foldAt": 9, "editedAt": 12, "summaryFrom": 9, - "stateDigest": "f4bb18cf96a64525a323d3db05cd160a375464fdfdf5c788f823acdf96a95825", + "stateDigest": "dd5b8a444b8f774de4b846717a0750e7851a036adec73911e7b0f4a52836c64f", "sectionDigests": { - "state": "a9b9531d952b48d8", + "state": "0b6a85f6e5249f4f", "blockContents": "473264d9df8ba338", - "stats": "e358dc992395fc7e", - "metadata": "9e864ac22f86950a" + "stats": "59c180a2b9704039", + "metadata": "c1c6d29825b48aca" }, "stateKeyDigests": { "blocks": "0cfd0b9c0fc53073", "messageRefs": "61ee2b1599995c19", - "nudge": "1aafe7b2e5e10a1f", + "nudge": "634df39949dc3161", "stats": "e4ee14ae39539ff8", "nextBlockId": "d4735e3a265e16ee", "nextRunId": "d4735e3a265e16ee", diff --git a/tests/golden/storage-render/responses.json b/tests/golden/storage-render/responses.json index 36ae5150bd..5a247ac7d5 100644 --- a/tests/golden/storage-render/responses.json +++ b/tests/golden/storage-render/responses.json @@ -3,94 +3,94 @@ "turns": [ { "i": 0, - "sha": "8f7fe882b204b87f0d28cc4fad5e6a9cd717593533899edd7bb9f72a390f3d51", - "bytes": 23487 + "sha": "48a85b9eff41cbd7457458beb1f507ca8be74af07bbab4c24c4caa7f150255a8", + "bytes": 23660 }, { "i": 1, - "sha": "b7c6685343959dbd35cec18d93dc20ae5df7404d0324f6948cf351d32d2f6511", - "bytes": 32415 + "sha": "c35d546f3a7e90fef4065f9fcfc4bb9c83794e6f53f611e6a760f2c61984bd40", + "bytes": 32588 }, { "i": 2, - "sha": "d0807c404fbf2d278c4edbdd0c5406e6318a43a10105623adea008799a8a378b", - "bytes": 38537 + "sha": "93e24c550cb9fe030c06b06531533cb7a70adfa8b3eba270b0f5a57baad7bb6f", + "bytes": 38710 }, { "i": 3, - "sha": "344ec7d98e122eafe5d908f75b9e14570ae1f0b19a75588d3ce98c6bc445c68b", - "bytes": 47465 + "sha": "cd6fdfba3eadb8fa4d193ee9d495d47e9ecfa89ff1a889db1cc131d4ffbf4d2e", + "bytes": 47638 }, { "i": 4, - "sha": "9e92dd38e69ce31990eb49ff2be6bf758cefef48117288d3f5571fddfc51a274", - "bytes": 53587 + "sha": "18c6412e43da1fb4827cb3b3f00e61f88b0b48c5934fe8fae82abb77d4fb68e9", + "bytes": 53760 }, { "i": 5, - "sha": "e510f67bf4a49feb039b035052d11f2a5c62b999df72e8073c9c2cedc6d768fd", - "bytes": 62515 + "sha": "ec041b5442f212756505f51d6a6a5590eef52ad01c38d50ed556924eb4292b21", + "bytes": 62688 }, { "i": 6, - "sha": "bda3d63689056063257dcc7482903753968cbcdd7f9f180c91a321dad6342c8f", - "bytes": 68637 + "sha": "9ac1bf370114aa3ee2c1f656ffbc6d35b5d1700931fe3e8d25ba08bdac5c0ae9", + "bytes": 68810 }, { "i": 7, - "sha": "982a3f91bf62f2e77983ac4f8db96a1bd9dbd32ed71a2b3eab65214db6ed53d6", - "bytes": 77565 + "sha": "3d2f069ff2e63eb29d6ad329d46802ccfbd2e2fda845eae5f624608d867df20c", + "bytes": 77738 }, { "i": 8, - "sha": "c4adba183f2679265a437137751d9f2bcc8ad69e8feb7698aef025ed7691d8be", - "bytes": 83687 + "sha": "b1e01a5b1a21460a16ceed8d8ad23fdbee9b27dc8eb52763eeaf652c138ed08d", + "bytes": 83860 }, { "i": 9, - "sha": "daebf0f41596a36f6ac771914b25faaec133c64d1c57af6bad79522d2a9d017b", - "bytes": 51518 + "sha": "091d2d01e392d1bd50b011fc60768275ffb131cadabcfdabd7ee1a1b886b7d66", + "bytes": 51691 }, { "i": 10, - "sha": "15837717dc9105a1b839ae7b563781ed12e26b31b9cf59979433a79aad97d8c8", - "bytes": 59303 + "sha": "8eb5f073888b9a582010f4a1aa3d85a6c1b8d542c76259b3776acc1f8ec68eb1", + "bytes": 59476 }, { "i": 11, - "sha": "bf3672bc32cce638b825857f2d021cf8c83c1e44a8a2dc4530d1d1b644b0eaee", - "bytes": 65348 + "sha": "15392d06e0a05b9fdecbc328143537d3b5bd7397482c16b5e29fa18bf43c3a41", + "bytes": 65521 }, { "i": 12, - "sha": "9a62d5a7c2eadb353592fce37a5462626ab34922d7475776266e7093458d440c", - "bytes": 79766 + "sha": "21ba25edd128eae1d76f40e18b7401849e827a8fdfe29f5b315579e0b6cf67bf", + "bytes": 79939 }, { "i": 13, - "sha": "b432dccdc0defcd19dad09fb3d0fc963380e343af0d2bd5b4fdcdc3d8d9494c9", - "bytes": 85814 + "sha": "f9116e8ff7de04c122b18c43495812b07e98a2bab11044fcb488a9c806e9ec0b", + "bytes": 85987 }, { "i": 14, - "sha": "16d09d0ec116265cbdcdeebcf43531078f32e11c9cb6913d0cfcaac16470c150", - "bytes": 94723 + "sha": "79fc569cc520ad65003ed2280c59a377ff1ba98ab90696587a8a984a30e1aed7", + "bytes": 94896 } ], "foldAt": 9, "editedAt": 12, "summaryFrom": 9, - "stateDigest": "2f2c59befaa51d0bc726d44821f8c8ddf12d6237ff84dfbe213af7c74ca885cf", + "stateDigest": "b75c20503f278de7355ea63a56c2ffaa2bcb26562717dc705013f7bced96794a", "sectionDigests": { - "state": "d7951fa36f9e6fe9", + "state": "26e89c1b5ac27e7d", "blockContents": "b6701268a0bdcd8a", - "stats": "67e33bcc612fdcc1", - "metadata": "71bc14af02391230" + "stats": "865d73d26a93fdaf", + "metadata": "d7dbf9fe5f1990db" }, "stateKeyDigests": { "blocks": "34b0dc17f8c24595", "messageRefs": "68b7f104b71dcc22", - "nudge": "68f3819d2a1d7c7c", + "nudge": "e3bde676eb7e04a3", "stats": "352f12b97e7f7c2d", "nextBlockId": "d4735e3a265e16ee", "nextRunId": "d4735e3a265e16ee", From 7e104d0e214e93425b2d9736cefe648ef88d1a1c Mon Sep 17 00:00:00 2001 From: ework-agent Date: Thu, 22 Oct 2026 12:54:27 +0800 Subject: [PATCH 5/6] =?UTF-8?q?schema(#4252):=20advertise=20exactly=20one?= =?UTF-8?q?=20compress=20call=20form=20=E2=80=94=20content=20=3D=20ONE=20p?= =?UTF-8?q?lain=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per review decision on #4252: the multi-form advertisement (array-of-objects entries + flat single-range calls + summary-in-content hybrids) is what led models to blend forms into shapes the parser rejected. The schema now teaches ONLY the string form; every legacy shape stays functional in parseCompressInput (open object schema, no required / additionalProperties — flat calls still validate), it is just no longer documented. - kernel compress-tools.ts: content + tool descriptions trimmed to the string form; flat-form top-level properties dropped; header contract comment rewritten for the new policy - tests/wire-contract.test.ts: COMPRESS_FORM_PROPS guard reduced to [topic, content] with the rationale - kernel 0.0.152 -> 0.0.153 (kernel-guard rule: schema change ships a bump) - goldens regenerated: storage-render (4 wires) + wire-contract (4 manifests) Verified: kernel 1428/1428, wire-contract 22/22, golden-storage-render + compress-reject-reasons 12/12. --- kernel/package-lock.json | 4 +- kernel/package.json | 2 +- kernel/src/compress-tools.ts | 55 +++---- package-lock.json | 2 +- tests/golden/storage-render/anthropic.json | 70 ++++----- tests/golden/storage-render/chat.json | 70 ++++----- tests/golden/storage-render/google.json | 70 ++++----- tests/golden/storage-render/responses.json | 70 ++++----- tests/golden/wire-contract/bili.json | 74 +-------- tests/golden/wire-contract/kernel.json | 148 ++---------------- .../wire-contract/manifest-default.json | 72 +-------- .../golden/wire-contract/manifest-optin.json | 72 +-------- tests/wire-contract.test.ts | 5 +- 13 files changed, 201 insertions(+), 513 deletions(-) diff --git a/kernel/package-lock.json b/kernel/package-lock.json index c38844609e..865977d1cf 100644 --- a/kernel/package-lock.json +++ b/kernel/package-lock.json @@ -1,12 +1,12 @@ { "name": "acp-kernel", - "version": "0.0.152", + "version": "0.0.153", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "acp-kernel", - "version": "0.0.152", + "version": "0.0.153", "license": "MIT", "devDependencies": { "@types/node": "^22.0.0", diff --git a/kernel/package.json b/kernel/package.json index 0bf842da94..859ed61896 100644 --- a/kernel/package.json +++ b/kernel/package.json @@ -1,6 +1,6 @@ { "name": "acp-kernel", - "version": "0.0.152", + "version": "0.0.153", "description": "Framework-agnostic context-compression engine (model-driven, 3-tier LSM). Pure core: no host dependency.", "license": "MIT", "author": "ranxianglei", diff --git a/kernel/src/compress-tools.ts b/kernel/src/compress-tools.ts index 3d80a5f842..f410926e23 100644 --- a/kernel/src/compress-tools.ts +++ b/kernel/src/compress-tools.ts @@ -69,21 +69,29 @@ const COMPRESS_RANGE_OBJECT = { /** Shared parameter schema for every compress wire shape (anthropic * `input_schema`, openai `function.parameters`, responses flat - * `parameters`). Contract (#374): a deliberate SUPERSET of what - * parseCompressArgs accepts — array content (line strings / range objects), - * string content (bare line form or JSON-encoded array), and the flat - * single-range form ({startId|startRef, endId|endRef, summary}, no content). - * Pre-validating hosts must never kill a call the kernel would honor; do not - * narrow this below the parser without re-checking parse-compress-input.ts. + * `parameters`). + * + * ADVERTISED FORM (#4252 decision): exactly one — content = ONE plain + * string holding ALL ranges (line form). The parser keeps honoring the + * legacy shapes (array content of line strings / range objects, the flat + * single-range call, and summary-as-plain-text in content with top-level + * refs), but the schema no longer teaches them: advertising several forms + * is what led models to blend them into invalid hybrids. + * + * Contract (#374, still holds): the schema must never kill a call the + * kernel would honor. It stays an OPEN object schema — no top-level + * `required`, no `additionalProperties: false` — so a flat single-range + * call {startId, endId, summary} still validates even though those + * properties are no longer declared. Do not add strictness here without + * re-checking parse-compress-input.ts. * * Wire-legality constraint (bili #1299, fixed after the #374 follow-up * regressed it): the TOP LEVEL must stay a plain object schema — no * `oneOf`/`allOf`/`anyOf`/`not`. Anthropic rejects tool input_schema with * top-level combinators (400 on every request carrying the tool), so the - * content-vs-flat alternation lives in the descriptions and is enforced by - * parseCompressInput, never by a top-level combinator or `required` (a - * top-level `required: ["content"]` would let strict hosts kill the flat - * form). Copilot Gemini also needs scalar types and self-contained typed + * content string-vs-array alternation lives in the `anyOf` under `content` + * and is enforced by parseCompressInput, never by a top-level combinator. + * Copilot Gemini also needs scalar types and self-contained typed * alternatives; keep each nested object alternative's properties with it. */ export const COMPRESS_PARAMETERS = { @@ -95,7 +103,7 @@ export const COMPRESS_PARAMETERS = { }, content: { description: - "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", anyOf: [ { type: "array", @@ -120,36 +128,13 @@ export const COMPRESS_PARAMETERS = { { type: "string" }, ], }, - startId: { - type: "string", - description: - "Flat single-range form (no content): mNNNNN ref at the start of the range", - }, - endId: { - type: "string", - description: - "Flat single-range form (no content): mNNNNN ref at the end of the range", - }, - startRef: { - type: "string", - description: "Flat single-range form: alternate spelling of startId", - }, - endRef: { - type: "string", - description: "Flat single-range form: alternate spelling of endId", - }, - summary: { - type: "string", - description: - "Flat single-range form (no content): self-contained summary replacing the range", - }, }, }; export const COMPRESS_TOOL = { name: COMPRESS_TOOL_NAME, description: - "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", input_schema: COMPRESS_PARAMETERS, }; diff --git a/package-lock.json b/package-lock.json index fa5d911e0b..2c15e33725 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ }, "kernel": { "name": "acp-kernel", - "version": "0.0.152", + "version": "0.0.153", "dev": true, "license": "MIT", "devDependencies": { diff --git a/tests/golden/storage-render/anthropic.json b/tests/golden/storage-render/anthropic.json index 4ad5af6712..9922bf5c88 100644 --- a/tests/golden/storage-render/anthropic.json +++ b/tests/golden/storage-render/anthropic.json @@ -3,94 +3,94 @@ "turns": [ { "i": 0, - "sha": "d60fde295513c13c8ad7203f8f8f36b9b63beecd65d2c4bfa9c9f6e02257f8ce", - "bytes": 23480 + "sha": "daf2182687948ef53790608f8fe13f21f457552bd56c61e914699d71793a95d0", + "bytes": 22287 }, { "i": 1, - "sha": "fb5cfface659d45feca8efa97c2aee0c08753e880f376879a484fa4c4cd58172", - "bytes": 32190 + "sha": "2894d8949694f953aef9b0a7d4c4ad03b3633b8cd90886852109468d10e72b45", + "bytes": 30997 }, { "i": 2, - "sha": "7a64f19b44be5f1ca85c0f276349b67293317bc6cfb7477085a1dd2ddd6248b2", - "bytes": 38089 + "sha": "911f0c635e145362329fef63920e7b4802f2f9c9528062173e867ad891832873", + "bytes": 36896 }, { "i": 3, - "sha": "cd47dd4568e645d8ea9caa5c5e56d4991dab5fec515286bbbc64b800205d921c", - "bytes": 46762 + "sha": "425dee6b9938613b65f9c944aea28228eda5679915fd39597196876dda2915f6", + "bytes": 45569 }, { "i": 4, - "sha": "4c4d2c089152aaab4f4b44aba0f00985134db190220582b5efbcf37f28fb590f", - "bytes": 52624 + "sha": "e62cbddd7d1facbcf2efe3c781c09b14b5cf096067b7d7ae4818ee7a4639e0b6", + "bytes": 51431 }, { "i": 5, - "sha": "affa9850a4bf9cb418a4616456d577112a0473a0abee0388d14a11b1f2097ffe", - "bytes": 61297 + "sha": "03a6265741bdb3f74788ae479f5b1505e552e6082009dd3419605dff8143b5da", + "bytes": 60104 }, { "i": 6, - "sha": "72a73c88c5ee95cc8ec35b1ccadfda28f120c800d7e3f11aa378a6aa6a8294bf", - "bytes": 67159 + "sha": "c7f62d7a595006a08aaa71427f0bcdb3b620c8eac104723bc6ace7516aa3321c", + "bytes": 65966 }, { "i": 7, - "sha": "aaa7be198afefa0eda46954bd2d57e0bdeceba0f4e6973fe168eaaf54b7d40d2", - "bytes": 75832 + "sha": "edb9fadc1d20813a24f45ea2d1e2ab0d92972d1cee22d45ac278d9dd1c17bd4c", + "bytes": 74639 }, { "i": 8, - "sha": "0cad24e8d7a2b898306fcf17b1eb236474191e22a99e4763337348086b7ceb10", - "bytes": 81694 + "sha": "d2be70c3953a492bf1b974ff4922001d74d0d61012446c59e732fec18852d713", + "bytes": 80501 }, { "i": 9, - "sha": "945e2223f480ee5de8f50883c374da4bb1d652701c92c4c4874ca34d6cfc36d8", - "bytes": 50721 + "sha": "2ddad1b2186f7f0444543f1b72b2f4fe3dcfe6d8cf709211a54e820b7c3a6a4a", + "bytes": 49528 }, { "i": 10, - "sha": "c6dff575ed60eeaf877ebcd201afe51275d6a4af547217ef0dba082f75f92c66", - "bytes": 58263 + "sha": "7da7b1f5aed39a2af9df234e8ad97fff4fe1cf49623a3adc4a3c45cd22989be0", + "bytes": 57070 }, { "i": 11, - "sha": "4542905c00be0d07006383b84f5e3c95c1d8c0be7268fc1fd68d6d2371658cc0", - "bytes": 64085 + "sha": "fca40b7b4dae14bfa94542cb8d802ce7b097b7b2946f987437db98a1cbc0385c", + "bytes": 62892 }, { "i": 12, - "sha": "4b7b9917da2b8601ea13baa9b0730a184c10a014438b542712925bc1c8d9cc09", - "bytes": 78223 + "sha": "8b5ff77e47604fe58cbb19234306863e3ec754c1d51a7a354bab40ffb12ef59a", + "bytes": 77030 }, { "i": 13, - "sha": "444a9aee090b8a6443ebab439aa6fbeedd5e06363c8bd049607f1ad54eaf7676", - "bytes": 84008 + "sha": "375a80af22ca3da9763155fd5394cff9066e0695490105830137cdcd9432f7d1", + "bytes": 82815 }, { "i": 14, - "sha": "a95aad2ccc698d37d5ca91b059ecfbb2afeebe5dfa389f4b5306daf502281e33", - "bytes": 92657 + "sha": "3f23c183e08dfe04772ea8cf1b5196f8ad92a57868896d55aafc7eb9300ed53a", + "bytes": 91464 } ], "foldAt": 9, "editedAt": 12, "summaryFrom": 9, - "stateDigest": "e119ed8e25dc36e7f7e857df4326944ff6cb4ec9e2343d349ddb6d53e47b8242", + "stateDigest": "cf0f44631a155d96c30f5f4c5aed5c9a811627b73fd6ff150bc33bd803b1eb69", "sectionDigests": { - "state": "d3ead7b0084732f8", + "state": "f93dc1c876c672d4", "blockContents": "dc7d13d250c94bb4", - "stats": "ab25c8ac52f138ac", - "metadata": "acab1dafd6447f6a" + "stats": "c6f1d434975d047d", + "metadata": "385b2c8a1a78693b" }, "stateKeyDigests": { "blocks": "3a454b9a16e4f0b9", "messageRefs": "3d09c9004582bdbc", - "nudge": "647e80dde348d578", + "nudge": "ba03a8a4b58554a7", "stats": "23312f7d5a0b9e27", "nextBlockId": "d4735e3a265e16ee", "nextRunId": "d4735e3a265e16ee", diff --git a/tests/golden/storage-render/chat.json b/tests/golden/storage-render/chat.json index b074e9f89b..088fca8f81 100644 --- a/tests/golden/storage-render/chat.json +++ b/tests/golden/storage-render/chat.json @@ -3,94 +3,94 @@ "turns": [ { "i": 0, - "sha": "f98b81028d0c8dd88121a87e79146492cb098c3b52617fc1829b1a3261b27e4b", - "bytes": 23590 + "sha": "824973c12a04e4a9c6fc8a5b84555886597d1a41874e6b0da33a489fe5f9fe9b", + "bytes": 22397 }, { "i": 1, - "sha": "f7e672c25bb4aa44db839d4c3a76d7c5c9adc22e69520d3982146f0fc123bb9b", - "bytes": 32168 + "sha": "4261484dd0b52e37019fe840a217bf4940369c7cb3c6d1ac28cb6353d4a68a37", + "bytes": 30975 }, { "i": 2, - "sha": "172364b1f2363bc1319e388db5a29d823aa66fdacf1ccdabbf6914b0b510dfaa", - "bytes": 37980 + "sha": "e8050d3ec8b0e3dd2f0ca67a4a0328a8e280e23b6f4a3e34380af58e8d38d678", + "bytes": 36787 }, { "i": 3, - "sha": "01e976391ff471763e96144261a9f8390ace9a1156039d0132bddcb594e01ec6", - "bytes": 46558 + "sha": "73d69f8b8f1bd2899cfe2181b95bc2f3697695e9b85ad682d82f6cbd9e7355ff", + "bytes": 45365 }, { "i": 4, - "sha": "419e9f3de9a65ba7e21e3c93b6c646b7f5ea38ceeb3449017692af9630917f27", - "bytes": 52370 + "sha": "d3a73b4a74f7975de837b7848f24d875866b1f2b0b15f4ef78064e3602da6665", + "bytes": 51177 }, { "i": 5, - "sha": "d3a926eb546eafa6c6ac8c1c4b2e16cf3f01ca2f99a8452e776a338f7dfab16b", - "bytes": 60948 + "sha": "60ce463e424f124a2dc346479091cbd4b7a32c69696b798a1de6b1a3c0f3ef7b", + "bytes": 59755 }, { "i": 6, - "sha": "ca12f73c90b867d2238f16a0654df41edda6b945b3b4072d4cc00e4c4cb8f822", - "bytes": 66760 + "sha": "1298d5f45146b76a42b5b75c712de8011fb091c5754f99d490a7df2e81ba2466", + "bytes": 65567 }, { "i": 7, - "sha": "5d471c6819b6399ef3f0ccb190cd86d5afe4b3bbaa83b9bee10dc587c32b0d1f", - "bytes": 75338 + "sha": "b20457e685b4a1fecf0195f57b93e052a0d00a83feb8b1569ccb08d385663aa2", + "bytes": 74145 }, { "i": 8, - "sha": "e63601c58dec9de8bf30b8090b539156f243971794a8606fb81ee816bab9a9be", - "bytes": 81150 + "sha": "a0ba24010c6faf10f11b66faca6f3aa915dde7ac006d66a434777cbd765328ca", + "bytes": 79957 }, { "i": 9, - "sha": "d5e2f07892a99b339e0669cab800d96d2e841a09a7c859627cc4426dc1e665b0", - "bytes": 50651 + "sha": "f1e08e530a96ecb4996c0a63e840e3f374a82b095e285ffea94e70391eb32fe0", + "bytes": 49458 }, { "i": 10, - "sha": "21d5911f066ad71f90f376fdf22b26333492a29cb2f8ae86e9d2995dc6e68e9d", - "bytes": 58052 + "sha": "8f3e444b1951f67e4f86abf6e727162108ba39d389b1ee4c90eea69df15bada0", + "bytes": 56859 }, { "i": 11, - "sha": "130a0fa66ed15ce88f223aed5a7ea55b3a782ab79945bd93a019dec06d6d967b", - "bytes": 63787 + "sha": "94a8e322c3c0822a18bccd6295c3d2bfb4c7961d897298361612f286fb6108fe", + "bytes": 62594 }, { "i": 12, - "sha": "bf6a5be76a62bf03b7dcc8ad3376600579707c436a9222f7ce30cc1b7ce32619", - "bytes": 77833 + "sha": "2c0a965647d8832dc74ebe5edc8cfe59b67abc936714119e89c93410f985e1af", + "bytes": 76640 }, { "i": 13, - "sha": "c20c1a521bba9dc4f91f464d8c736af7c31c4077e03f24b26bd3cb868d9de49d", - "bytes": 83568 + "sha": "a7497d037a324f1fdb6f605db0b8161e4e183f1e2354bb68035fb9f1373ee0d0", + "bytes": 82375 }, { "i": 14, - "sha": "ec30818d215815b4816cfebc05cd7036937754e6b2b56286622686795ea28e43", - "bytes": 92122 + "sha": "abd73cec691568d84e72384aa5facdc71c759eeafc865d62df7b4eca6683675a", + "bytes": 90929 } ], "foldAt": 9, "editedAt": 12, "summaryFrom": 9, - "stateDigest": "8ab601b915ac7b1e4d79d86759b79338b8b23b57fe02005d5014b2d6462cdbcc", + "stateDigest": "fc56136834423d14c5ba7d067e5f6199644a457be99d2b4e67099ed7834a5414", "sectionDigests": { - "state": "d934242379b7a2ba", + "state": "8390f21336885863", "blockContents": "94a58f96d7c5cfc3", - "stats": "eb2d2559feb8aebe", - "metadata": "78d04d89e561cfa4" + "stats": "24d705b0e39bd13c", + "metadata": "e2e52ff012db9ec9" }, "stateKeyDigests": { "blocks": "d9770feee91dafc6", "messageRefs": "48135bb278ef6a47", - "nudge": "12d5737f91f6fb43", + "nudge": "81a983f31c4d9ef2", "stats": "f85b2ad1a3b86e2f", "nextBlockId": "d4735e3a265e16ee", "nextRunId": "d4735e3a265e16ee", diff --git a/tests/golden/storage-render/google.json b/tests/golden/storage-render/google.json index 7507efb8ae..dc85099f53 100644 --- a/tests/golden/storage-render/google.json +++ b/tests/golden/storage-render/google.json @@ -3,94 +3,94 @@ "turns": [ { "i": 0, - "sha": "6d4c7fe3c6eab87bdf845de9514cad49d3d58f0bcb3fc9b10ace7a6d5467ec28", - "bytes": 20810 + "sha": "45998d29279880c0b19002f5ca40489e1e9dfcbdb53b9203a5ffe868ea3e51b8", + "bytes": 20510 }, { "i": 1, - "sha": "1ad332a6bc6cfe194bcde07239794f6e86a2afac4259e51de9f6913423389825", - "bytes": 29365 + "sha": "f61275d77406c502c11238e2764ea84c8bf03c8302856749b8f5b73572fb5331", + "bytes": 29065 }, { "i": 2, - "sha": "f3d575fe349bebdbb3a0f788e0f87ee87946e0dab249e2d4f0d205847beb34b8", - "bytes": 35191 + "sha": "98b77dc7c79575218c8e52ddec9386d5db7a7d30587dd992cb64c18536fb7667", + "bytes": 34891 }, { "i": 3, - "sha": "4b5651c2d10f2c0b753ffe132af57b590ed641c0076449bd8758485f7892ae1f", - "bytes": 43746 + "sha": "2f3024ee57f441a1c0d1b06d38ccf1f4c74ef297aa3d58622bc29f69c21c93d6", + "bytes": 43446 }, { "i": 4, - "sha": "7f91730a209b5b592cf49ed92fb147ad27271874b40d14b0042722d7e86ee7f1", - "bytes": 49572 + "sha": "27f6f223e7682e0e0790a69e43c982c3fe0e505153be7fa4d3ec6cf4532ff2e2", + "bytes": 49272 }, { "i": 5, - "sha": "8ab89c1b4dbeea59ee8103fdd225be1fd2e5c3c036102ee4639db3f938578787", - "bytes": 58127 + "sha": "6a7e23920335f91762a8ac72b177a1cd68538ce1872325b6aa9e3b44191f3ca4", + "bytes": 57827 }, { "i": 6, - "sha": "c482f7008fbbaa3bf2a44d0c6fb33cd84f394a79059948f4fd8bb96c07d9e3f3", - "bytes": 63953 + "sha": "5b770ce0c9456af96904cd5b007fbb07fb4194f2636db8b6ad2602ef71d3834d", + "bytes": 63653 }, { "i": 7, - "sha": "0e0afdb8f3160df0e3f36b9a54837aae9290066b5a8c2f741c5eeab6802389ee", - "bytes": 72508 + "sha": "9bab6f659c0dcd05e6576e6d47b1d1d2378a6ace1a7effec721958f6f7476cd8", + "bytes": 72208 }, { "i": 8, - "sha": "f098d8b829b12e075c32074de8f2a1ce2bbd89fe416b4dc8b3d318afcea626a3", - "bytes": 78334 + "sha": "c179b940520413ba2a0e267165a9914712c3a9ff3c045761d61da876aeccedd7", + "bytes": 78034 }, { "i": 9, - "sha": "9aeb9ad098fd9ba8341254299372f5f0ac5a6df48024c58ff4d6656e5674254b", - "bytes": 50920 + "sha": "1b1448a075964dae98ad3b09565d31590cc9fdadb4d37300c4460030f67990e6", + "bytes": 50620 }, { "i": 10, - "sha": "af22944e5c62b4713b00055f37ee5c941133db3f7c5f2f4540377889ed395e0e", - "bytes": 58323 + "sha": "eddf6ad2081f5eb1e4822bf9805a7953eff3241269ed5f3eec346909c9da5bf2", + "bytes": 58023 }, { "i": 11, - "sha": "e486ed0770c7772f42767bba15d2b830c09d734a333d006a6f12d6b35794f715", - "bytes": 64072 + "sha": "0ae5c9b7b31dbb0d52c1b4a157bcc08c549ff435229383ec33fb0225b3c93f4e", + "bytes": 63772 }, { "i": 12, - "sha": "b0b92b1f97e7945091a9fff2ecf9bb4cc9aff4cdcc0e662f633d3f79628d5c23", - "bytes": 78077 + "sha": "d9a62f5c48f849bdc9514ae4586f2204ef5ac624aaf97c50dbc8ed2c1bee9706", + "bytes": 77777 }, { "i": 13, - "sha": "94022cfaa0d77d9ee8adbb36079aef5492bd71d8a8618bb14b8750ef60add9eb", - "bytes": 83826 + "sha": "f60319947e77097d08edfcc5fdddd46057c44596a30d1d6bb33c5af4bad5001f", + "bytes": 83526 }, { "i": 14, - "sha": "012523e6afffdbd76f170ec17200d7e0f744d1e0c78c3165f867375df22b951f", - "bytes": 92356 + "sha": "275f3b3e103dbfbf545448f8c421254cc7b025f8c081d941cd39bef4a90023be", + "bytes": 92056 } ], "foldAt": 9, "editedAt": 12, "summaryFrom": 9, - "stateDigest": "dd5b8a444b8f774de4b846717a0750e7851a036adec73911e7b0f4a52836c64f", + "stateDigest": "78dcd31a4bec1b25e44ffbe71c7d4b73aaddbe0d189c21af6dc5cb2c9a41f14b", "sectionDigests": { - "state": "0b6a85f6e5249f4f", + "state": "2e1def3a3234afdc", "blockContents": "473264d9df8ba338", - "stats": "59c180a2b9704039", - "metadata": "c1c6d29825b48aca" + "stats": "900481685c848462", + "metadata": "b7d88f55cd40b838" }, "stateKeyDigests": { "blocks": "0cfd0b9c0fc53073", "messageRefs": "61ee2b1599995c19", - "nudge": "634df39949dc3161", + "nudge": "4a4dab18d9297f4d", "stats": "e4ee14ae39539ff8", "nextBlockId": "d4735e3a265e16ee", "nextRunId": "d4735e3a265e16ee", diff --git a/tests/golden/storage-render/responses.json b/tests/golden/storage-render/responses.json index 5a247ac7d5..5170e2a244 100644 --- a/tests/golden/storage-render/responses.json +++ b/tests/golden/storage-render/responses.json @@ -3,94 +3,94 @@ "turns": [ { "i": 0, - "sha": "48a85b9eff41cbd7457458beb1f507ca8be74af07bbab4c24c4caa7f150255a8", - "bytes": 23660 + "sha": "57662dd5517499b0833b00df645aacd9ec25a1add3b6efa94703cc40006824a8", + "bytes": 22467 }, { "i": 1, - "sha": "c35d546f3a7e90fef4065f9fcfc4bb9c83794e6f53f611e6a760f2c61984bd40", - "bytes": 32588 + "sha": "ade76466ddbffb25c3eba9e06896c110c147ce1daf7f1e231fe054d9d1832c4b", + "bytes": 31395 }, { "i": 2, - "sha": "93e24c550cb9fe030c06b06531533cb7a70adfa8b3eba270b0f5a57baad7bb6f", - "bytes": 38710 + "sha": "09ee3e5a15865e5cc5c10c28026c1501f565212134c64a03214fbf367f63b881", + "bytes": 37517 }, { "i": 3, - "sha": "cd6fdfba3eadb8fa4d193ee9d495d47e9ecfa89ff1a889db1cc131d4ffbf4d2e", - "bytes": 47638 + "sha": "cd3e38d97e64660eb60f1e387a1e53de8723ae1aa916db4d0a7b8f7ec181c266", + "bytes": 46445 }, { "i": 4, - "sha": "18c6412e43da1fb4827cb3b3f00e61f88b0b48c5934fe8fae82abb77d4fb68e9", - "bytes": 53760 + "sha": "b8ff4f16ca15cc1b8589251a849e3e30ec7d7d82b92abc0bb262bd2f8422db38", + "bytes": 52567 }, { "i": 5, - "sha": "ec041b5442f212756505f51d6a6a5590eef52ad01c38d50ed556924eb4292b21", - "bytes": 62688 + "sha": "70f002ab5e7c3301ec440fd6863b7635c38874842445794bf87229f783ce2124", + "bytes": 61495 }, { "i": 6, - "sha": "9ac1bf370114aa3ee2c1f656ffbc6d35b5d1700931fe3e8d25ba08bdac5c0ae9", - "bytes": 68810 + "sha": "aa63e444c4b86e426d949d2030a2b2a4f84a1018ebb152f0dd429c9747f357b3", + "bytes": 67617 }, { "i": 7, - "sha": "3d2f069ff2e63eb29d6ad329d46802ccfbd2e2fda845eae5f624608d867df20c", - "bytes": 77738 + "sha": "4cef1346cac328fc82bd552007051118cc95751e62d4b3f10a4432297a6801e5", + "bytes": 76545 }, { "i": 8, - "sha": "b1e01a5b1a21460a16ceed8d8ad23fdbee9b27dc8eb52763eeaf652c138ed08d", - "bytes": 83860 + "sha": "adee16938078b6c6cac3ca423ffe427d2199493d6cbbbc01059b223de3bba077", + "bytes": 82667 }, { "i": 9, - "sha": "091d2d01e392d1bd50b011fc60768275ffb131cadabcfdabd7ee1a1b886b7d66", - "bytes": 51691 + "sha": "a6cefd10bbb51de65d7c363ea6f299a2301f4d8104a5ce8b59f4de87e711130d", + "bytes": 50498 }, { "i": 10, - "sha": "8eb5f073888b9a582010f4a1aa3d85a6c1b8d542c76259b3776acc1f8ec68eb1", - "bytes": 59476 + "sha": "ed8590ef249a0756d077fcea24230dd83a7f805a03da6f91457c607b27351c5e", + "bytes": 58283 }, { "i": 11, - "sha": "15392d06e0a05b9fdecbc328143537d3b5bd7397482c16b5e29fa18bf43c3a41", - "bytes": 65521 + "sha": "461eb77a6cc41abbf8046fb3dc5858f18c8d848a8dff4a2c888a38a1d16df707", + "bytes": 64328 }, { "i": 12, - "sha": "21ba25edd128eae1d76f40e18b7401849e827a8fdfe29f5b315579e0b6cf67bf", - "bytes": 79939 + "sha": "b356956d375e951d2d5a05fe55c1e28b09c616f9b2d7eca6fea5e62924dbe53e", + "bytes": 78746 }, { "i": 13, - "sha": "f9116e8ff7de04c122b18c43495812b07e98a2bab11044fcb488a9c806e9ec0b", - "bytes": 85987 + "sha": "1b3d93417fce2ba8f70c52d0425626398a571d7afbd287ffb89a6ba7ae37bd29", + "bytes": 84794 }, { "i": 14, - "sha": "79fc569cc520ad65003ed2280c59a377ff1ba98ab90696587a8a984a30e1aed7", - "bytes": 94896 + "sha": "9c82e4523129ef8df61cf7622bb637c7379cce153c78e3814bd3000853034323", + "bytes": 93703 } ], "foldAt": 9, "editedAt": 12, "summaryFrom": 9, - "stateDigest": "b75c20503f278de7355ea63a56c2ffaa2bcb26562717dc705013f7bced96794a", + "stateDigest": "f1f4810c773dbc73a492fc1875dd10d8dcd1a32513b13d74b0fc79791b75a840", "sectionDigests": { - "state": "26e89c1b5ac27e7d", + "state": "db313e8eba2d65fc", "blockContents": "b6701268a0bdcd8a", - "stats": "865d73d26a93fdaf", - "metadata": "d7dbf9fe5f1990db" + "stats": "327d3967b8371aa8", + "metadata": "23bf7ae84bfda524" }, "stateKeyDigests": { "blocks": "34b0dc17f8c24595", "messageRefs": "68b7f104b71dcc22", - "nudge": "e3bde676eb7e04a3", + "nudge": "044f74006fb27efd", "stats": "352f12b97e7f7c2d", "nextBlockId": "d4735e3a265e16ee", "nextRunId": "d4735e3a265e16ee", diff --git a/tests/golden/wire-contract/bili.json b/tests/golden/wire-contract/bili.json index 26020a098d..60d86ddd2f 100644 --- a/tests/golden/wire-contract/bili.json +++ b/tests/golden/wire-contract/bili.json @@ -3,7 +3,7 @@ "anthropic": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "input_schema": { "type": "object", "properties": { @@ -12,7 +12,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -95,26 +95,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -206,7 +186,7 @@ "type": "function", "function": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -215,7 +195,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -298,26 +278,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -421,7 +381,7 @@ { "type": "function", "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -430,7 +390,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -513,26 +473,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -626,7 +566,7 @@ "google": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { diff --git a/tests/golden/wire-contract/kernel.json b/tests/golden/wire-contract/kernel.json index 9371da57a2..8e4d2e51ad 100644 --- a/tests/golden/wire-contract/kernel.json +++ b/tests/golden/wire-contract/kernel.json @@ -3,7 +3,7 @@ "ACP_TOOLS_ANTHROPIC": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "input_schema": { "type": "object", "properties": { @@ -12,7 +12,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -95,26 +95,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -194,7 +174,7 @@ "type": "function", "function": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -203,7 +183,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -286,26 +266,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -397,7 +357,7 @@ { "type": "function", "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -406,7 +366,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -489,26 +449,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -665,7 +605,7 @@ "ACP_TOOLS_GOOGLE": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -765,7 +705,7 @@ "individual": { "COMPRESS_TOOL": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "input_schema": { "type": "object", "properties": { @@ -774,7 +714,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -857,26 +797,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -885,7 +805,7 @@ "type": "function", "function": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -894,7 +814,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -977,26 +897,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -1005,7 +905,7 @@ "COMPRESS_TOOL_RESPONSES": { "type": "function", "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { @@ -1014,7 +914,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -1097,33 +997,13 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } }, "COMPRESS_TOOL_GOOGLE": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed.", "parameters": { "type": "object", "properties": { diff --git a/tests/golden/wire-contract/manifest-default.json b/tests/golden/wire-contract/manifest-default.json index e4a3b8b309..be961602c6 100644 --- a/tests/golden/wire-contract/manifest-default.json +++ b/tests/golden/wire-contract/manifest-default.json @@ -16,7 +16,7 @@ "anthropic": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "input_schema": { "type": "object", "properties": { @@ -25,7 +25,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -108,26 +108,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -227,7 +207,7 @@ "type": "function", "function": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "parameters": { "type": "object", "properties": { @@ -236,7 +216,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -319,26 +299,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -453,7 +413,7 @@ { "type": "function", "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "parameters": { "type": "object", "properties": { @@ -462,7 +422,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -545,26 +505,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } diff --git a/tests/golden/wire-contract/manifest-optin.json b/tests/golden/wire-contract/manifest-optin.json index 2b786c6d47..f68993ff19 100644 --- a/tests/golden/wire-contract/manifest-optin.json +++ b/tests/golden/wire-contract/manifest-optin.json @@ -19,7 +19,7 @@ "anthropic": [ { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "input_schema": { "type": "object", "properties": { @@ -28,7 +28,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -111,26 +111,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -296,7 +276,7 @@ "type": "function", "function": { "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "parameters": { "type": "object", "properties": { @@ -305,7 +285,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -388,26 +368,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } @@ -597,7 +557,7 @@ { "type": "function", "name": "compress", - "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. PREFERRED form: content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Also accepted: object entries {startId,endId,summary,topic?} in the content array, and a flat single-range call {startId,endId,summary,topic?} without content — or the same flat call with the summary as plain text in content ({content: \"\", startId, endId, topic?}). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", + "description": "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. content = ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string — internal quotes \\\", newlines \\n; a JSON-encoded array as that string is also accepted for gateways that stringify arrays). Batch multiple ranges into ONE call — do not split into one call per range. Use when content is genuinely consumed. Calling convention: if this environment only allows `run_code` to be called directly (code-mode/PTC harness), call this tool from inside a run_code program via the harness's generated SDK; otherwise call it directly as a tool. Context management is provided by billion-context — report billion-context problems at github.com/ranxianglei/billion-context/issues.", "parameters": { "type": "object", "properties": { @@ -606,7 +566,7 @@ "description": "Optional short title for the compressed range" }, "content": { - "description": "One or more ranges to compress into separate summary blocks. PREFERRED (multi-range batch): ONE plain string holding ALL ranges — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Array form: one entry per range — a line-form string or an object {startId,endId,summary,topic?}. Batch multiple ranges into ONE call — do not split into one call per range. For a single range you may instead send the summary as plain text in content together with top-level startId/endId ({content: \"\", startId, endId, topic?}).", + "description": "ONE plain string holding ALL ranges to compress — each block starts with its 'm00150–m00220 optional topic' header line followed by that block's summary markdown (a valid JSON string: internal quotes \\\" and newlines \\n; a JSON-encoded array as that string is also accepted). Batch multiple ranges into ONE call — do not split into one call per range.", "anyOf": [ { "type": "array", @@ -689,26 +649,6 @@ "type": "string" } ] - }, - "startId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" - }, - "endId": { - "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" - }, - "startRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of startId" - }, - "endRef": { - "type": "string", - "description": "Flat single-range form: alternate spelling of endId" - }, - "summary": { - "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" } } } diff --git a/tests/wire-contract.test.ts b/tests/wire-contract.test.ts index e851c78080..244468554e 100644 --- a/tests/wire-contract.test.ts +++ b/tests/wire-contract.test.ts @@ -151,7 +151,10 @@ function toolNameOf(wire: Wire, t: ToolShape): string | undefined { return typeof t.name === "string" ? t.name : undefined; } -const COMPRESS_FORM_PROPS = ["topic", "content", "startId", "endId", "startRef", "endRef", "summary"]; +// #4252: only the string form is advertised (topic + content). The legacy +// flat-form fields (startId/endId/startRef/endRef/summary) and array content +// remain functional in parseCompressInput but are deliberately NOT taught. +const COMPRESS_FORM_PROPS = ["topic", "content"]; function assertCompressFormsKept(tool: ToolShape | undefined, source: string): void { assert.ok(tool, `${source}: compress tool present`); From 8259905d2752b2bdf40a85220f6eaf4ea501aef2 Mon Sep 17 00:00:00 2001 From: ework-agent Date: Thu, 22 Oct 2026 14:04:09 +0800 Subject: [PATCH 6/6] fix(#4252): name the ref ceiling for partially-past-frontier compress ranges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit beyondFrontierNote (#2146) only fires when EVERY requested endpoint sits above the session's highest mapped ref. The incident shape — start inside, end above (allocation lags rendering: refs visible in the transcript are not yet minted in the store) — fell through to generic guidance, and the model blind-retried against a moving ceiling (session 01a15993: 5× gate:none-resolved inside 8 minutes, compress-loop breaker armed). frontierClampNote now fires for exactly that partial case: names the highest stored ref, says numbers visible in the transcript may not be ingestible yet, and gives the actionable clamp (Retry with endId ≤ highest). Mutually exclusive with the all-above note; b-ref endpoints and empty states never fire; the above-frontier endpoint stays verbatim in the receipt (typo-correctable, per the #2146 mixed-case contract). Verified: issue2146 suite 9/9, e2e-update-state + compress-reject-reasons + preflight-compress 11/11. --- src/stream.ts | 47 ++++++++++++++++--- tests/issue2146-compress-loop-breaker.test.ts | 34 +++++++++++++- 2 files changed, 74 insertions(+), 7 deletions(-) diff --git a/src/stream.ts b/src/stream.ts index e2290ee6f0..260029ccb3 100644 --- a/src/stream.ts +++ b/src/stream.ts @@ -365,6 +365,16 @@ function compressFailureCause(errs: string, session: Session): string { return ""; } +/** Highest allocated mNNNNN number in the session's ref map (0 when empty). */ +function highestMappedRef(state: Pick): number { + let highest = 0; + for (const ref of Object.keys(state.messageRefs?.byRef ?? {})) { + const m = M_REF_NUM_RE.exec(ref); + if (m) highest = Math.max(highest, Number(m[1])); + } + return highest; +} + /** #2146: every requested endpoint sits strictly ABOVE the session's highest * mapped m-ref. Such refs cannot exist in this session (refs are never * pre-allocated); the kernel now classifies that case as above-frontier @@ -372,11 +382,7 @@ function compressFailureCause(errs: string, session: Session): string { * NO superset of such refs can ever compress — so the model stops re-anchoring * on other stale artifacts instead. */ export function beyondFrontierNote(state: Pick, ranges: Array<{ startRef: string; endRef: string }>): string { - let highest = 0; - for (const ref of Object.keys(state.messageRefs?.byRef ?? {})) { - const m = M_REF_NUM_RE.exec(ref); - if (m) highest = Math.max(highest, Number(m[1])); - } + const highest = highestMappedRef(state); if (highest <= 0 || ranges.length === 0) return ""; const allAbove = ranges.every((r) => { const s = M_REF_NUM_RE.exec(r.startRef.trim()); @@ -388,6 +394,34 @@ export function beyondFrontierNote(state: Pick, return ` All requested refs are above this session's highest ref (${hi}) — they cannot exist here (this session allocates no future refs). They are stale artifacts from an earlier session generation left in your visible history; NO superset of them can ever compress. Request only refs ≤ ${hi}, or call acp_status for the live ranges.`; } +/** #4252 follow-up: PARTIALLY past the frontier — some endpoint above the + * highest stored ref while another sits inside it. beyondFrontierNote + * (#2146) only fires when EVERY endpoint is above, so a start-in/end-out + * range fell through to generic guidance while allocation lagged rendering + * (the model sees refs in its transcript that the store has not minted yet) + * and it blind-retried against a moving ceiling (incident session 01a15993: + * 5× gate:none-resolved inside 8 minutes, breaker armed). Name the ceiling + * and the clamp explicitly so one retry converges. Fires only when the + * all-above note is absent (the two are mutually exclusive by design). */ +export function frontierClampNote( + state: Pick, + ranges: Array<{ startRef: string; endRef: string }>, + beyond: string, +): string { + if (beyond !== "" || ranges.length === 0) return ""; + const highest = highestMappedRef(state); + if (highest <= 0) return ""; + const over = ranges.filter((rg) => { + const s = M_REF_NUM_RE.exec(rg.startRef.trim()); + const e = M_REF_NUM_RE.exec(rg.endRef.trim()); + return !!s && !!e && (Number(s[1]) > highest || Number(e[1]) > highest); + }); + if (over.length === 0) return ""; + const hi = `m${String(highest).padStart(5, "0")}`; + const list = over.map((rg) => `${rg.startRef}–${rg.endRef}`).join(", "); + return ` Range(s) ${list} extend past this session's highest stored ref (${hi}) — refs are minted as messages are stored, so numbers you can already see rendered may not be ingestible yet. Retry with endId ≤ ${hi}, or call acp_status for the live compressible span.`; +} + /** #2592/F3: after a host-native compaction rebase (resetSessionCompression) * the ref numbering restarted, so pre-rebase refs the model still cites can * never resolve again. Name the rebase as the deterministic cause so the @@ -1019,11 +1053,12 @@ export function applyRanges(parsed: ReturnType, ctx: const repeatGuard = recordCompressFailure(ctx.session, specKey); const loopGuard = trackLoop ? noteCompressLoopFailure(ctx, specKey, errs) : ""; const beyond = beyondFrontierNote(ctx.session.state, ranges); + const clamp = frontierClampNote(ctx.session.state, ranges, beyond); // #2146: once the breaker arms, the diagnostic hint cluster it used // to lead with has proven unread by the looping model — swap it for // the hard-stop paragraph instead of stacking more ignored advice. const hints = loopGuard === "" - ? `${beyond}${rebaseNote(ctx.session, errs, beyond)}${currentRefsSnapshot(ctx)}${repeatGuard}${spanHint}${noViableAnywhere}` + ? `${beyond}${clamp}${rebaseNote(ctx.session, errs, beyond)}${currentRefsSnapshot(ctx)}${repeatGuard}${spanHint}${noViableAnywhere}` : `${beyond}${loopGuard}`; // #2360 §2: one instruction per receipt — while armed, the kernel's // "run acp_status and retry" guidance is scrubbed from the model- diff --git a/tests/issue2146-compress-loop-breaker.test.ts b/tests/issue2146-compress-loop-breaker.test.ts index bf2f3b9635..02e2e7344c 100644 --- a/tests/issue2146-compress-loop-breaker.test.ts +++ b/tests/issue2146-compress-loop-breaker.test.ts @@ -5,7 +5,7 @@ import type { Config, CoreMessage } from "acp-kernel"; import { createCore, createInitialState, assignRefs, emptyRefMap, defaultConfig } from "acp-kernel"; import type { Session } from "../src/session.ts"; import { SessionStore, _setStoreForTest } from "../src/persist.ts"; -import { applyRanges, beyondFrontierNote, type RewriteCtx } from "../src/stream.ts"; +import { applyRanges, beyondFrontierNote, frontierClampNote, type RewriteCtx } from "../src/stream.ts"; import { parseCompressInput } from "../src/compress-tool.ts"; _setStoreForTest(new SessionStore({ enabled: false })); @@ -137,6 +137,38 @@ test("#2146: beyondFrontierNote unit shapes", () => { assert.equal(beyondFrontierNote(emptyState, [{ startRef: "m00001", endRef: "m00002" }]), "", "no mapped refs"); }); +test("#4252: partially-past-frontier ranges get the ceiling clamp note", () => { + const res = assignRefs([textMsg("r1", "assistant", "abc"), textMsg("r2", "assistant", "def")], { existing: emptyRefMap(), nextIndex: 0 }); + const state = createInitialState(); + state.messageRefs = res.map; + // start inside, end above: the incident shape (allocation lags rendering) + const note = frontierClampNote(state, [{ startRef: "m00001", endRef: "m00006" }], ""); + assert.match(note, /highest stored ref \(m00002\)/, "names the ceiling"); + assert.match(note, /Retry with endId ≤ m00002/, "gives the actionable clamp"); + // suppressed when the all-above note already fired + assert.equal(frontierClampNote(state, [{ startRef: "m00006", endRef: "m00010" }], "beyond"), "", "beyond note takes precedence"); + // fully in-frontier ranges get nothing + assert.equal(frontierClampNote(state, [{ startRef: "m00001", endRef: "m00002" }], ""), "", "in-frontier suppresses"); + // b-refs have no cross-namespace ordering — never fire + assert.equal(frontierClampNote(state, [{ startRef: "b1", endRef: "b9" }], ""), "", "block-id endpoints ignored"); + // empty state / empty ranges + assert.equal(frontierClampNote(createInitialState(), [{ startRef: "m00001", endRef: "m00002" }], ""), "", "no mapped refs"); + assert.equal(frontierClampNote(state, [], ""), "", "empty range list"); +}); + +test("#4252: mixed receipt names the ceiling instead of generic guidance", () => { + const msgs: CoreMessage[] = [ + textMsg("raw_1", "assistant", "a".repeat(800)), + textMsg("raw_2", "assistant", "b".repeat(800)), + ]; + const ctx = makeCtx(msgs); + const mixed = applyRanges(parseCompressInput(compressArgs("m00001", "m00010")), ctx).text; + assert.ok(mixed.startsWith("[Compression FAILED:"), "still fails"); + assert.match(mixed, /highest stored ref \(m00002\)/, "clamp note present for start-in/end-out"); + assert.match(mixed, /Retry with endId ≤ m00002/, "actionable clamp in the receipt"); + assert.match(mixed, /m00010/, "the above-frontier endpoint stays verbatim (typo-correctable)"); +}); + test("#2146: loopTracking:false (preflight lane) never touches the model-facing streak", () => { const ctx = makeCtx(fixtureMessages()); for (let i = 0; i < 5; i++) {