From 58c8e983e772745b0c2aaf125f26afde1366ad0f Mon Sep 17 00:00:00 2001 From: awork Date: Thu, 22 Oct 2026 11:26:56 +0800 Subject: [PATCH 1/4] kernel: honor merged flat compress form, U+2212/FF0D separators, honest rejection reasons (#4252) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - RC1: a string content holding the summary text beside top-level refs (startId/startRef/messageId x endId/endRef) is recovered as ONE flat range — plain prose or a JSON-encoded {summary,topic} object; top-level summary wins over content text. Line-form strings whose first line carries refs headers are never hijacked, so every input that parses today is untouched. Broken JSON shells / non-object structures beside refs stay rejected. Diagnostics gain flatSummarySalvage. - RC2: the refs separator class gains U+2212 (minus sign) and U+FF0D (fullwidth hyphen-minus); a header with two refs separated by an unrecognized non-wordy divider is now REJECTED naming the separator instead of silently narrowing to the first ref. A wordy gap stays a topic citation (single-message read unchanged). - RC3: string content whose entries carry refs headers but validate to zero ranges reports kind=no-valid-ranges with the per-entry reasons (missing summary etc.) instead of a blanket content-not-array that dropped them (#362 visibility). Prose without refs headers keeps content-not-array. - Schema descriptions document the accepted merged shape (goldens follow in the host commit). kernel-change: model-facing compress parser accepts one more documented shape and stops two silent-misfold paths observed live in v0.1.204 (#4252); owner-approved by the issue's fix plan. --- kernel/package.json | 2 +- kernel/src/compress-tools.ts | 10 +- kernel/src/parse-compress-input.ts | 189 ++++++++++++++++++-- kernel/tests/parse-compress-input.test.ts | 203 ++++++++++++++++++++++ package-lock.json | 2 +- 5 files changed, 381 insertions(+), 25 deletions(-) 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/kernel/src/compress-tools.ts b/kernel/src/compress-tools.ts index 0b7d3cc071..c6d772372d 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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", anyOf: [ { type: "array", @@ -123,12 +123,12 @@ export const COMPRESS_PARAMETERS = { startId: { type: "string", description: - "Flat single-range form (no content): mNNNNN ref at the start of the range", + "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds.", }, endId: { type: "string", description: - "Flat single-range form (no content): mNNNNN ref at the end of the range", + "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied).", }, startRef: { type: "string", @@ -141,7 +141,7 @@ export const COMPRESS_PARAMETERS = { summary: { type: "string", description: - "Flat single-range form (no content): self-contained summary replacing the range", + "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present.", }, }, }; @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", input_schema: COMPRESS_PARAMETERS, }; diff --git a/kernel/src/parse-compress-input.ts b/kernel/src/parse-compress-input.ts index 3a77446cda..a2925b83e3 100644 --- a/kernel/src/parse-compress-input.ts +++ b/kernel/src/parse-compress-input.ts @@ -47,6 +47,9 @@ export interface CompressParseDiagnostics { /** True when a non-array `content` value (single entry object or nested * `ranges` array) was recovered into the canonical array form (#470). */ contentSalvage?: boolean; + /** True when a string `content` holding the summary text beside top-level + * refs (startId/endId) was recovered as one flat range (#4252). */ + flatSummarySalvage?: boolean; /** First 800 chars of the raw string input (string inputs only). */ rawPrefix?: string; /** Raw string input length (string inputs only). */ @@ -198,25 +201,57 @@ function parseObjectValue( parsed === null || (parsed.entries.length === 0 && content.trim().length > 0) ) { - // Not a JSON array (or nothing salvageable): bare line-form text. - // Strip JSON-wrapper residue (stringified ["…"] with broken - // escaping) — the line form needs structure only in the refs - // header line, so the summary body never has to parse. + // Not a JSON array (or nothing salvageable): either the merged flat + // single-range form (#4252) or bare line-form text. Strip + // JSON-wrapper residue (stringified ["…"] with broken escaping) — + // the line form needs structure only in the refs header line, so + // the summary body never has to parse. const bare = stripJsonWrapperResidue(content); - const entries = splitLineEntries(bare); - const { ranges, invalid, reasons } = validateEntries(entries, callId); - if (ranges.length > 0) { - diag.invalidItems = invalid; - if (reasons.length > 0) diag.invalidReasons = reasons; - diag.kind = "ok"; - return finish(ranges, diag); + const flat = flatSummaryEntry(value, content); + if (flat !== undefined) { + entries = [flat]; + diag.flatSummarySalvage = true; + // fall through to the shared validation tail below + } else { + const lineEntries = splitLineEntries(bare); + const { ranges, invalid, reasons } = validateEntries( + lineEntries, + callId, + ); + if (ranges.length > 0) { + diag.invalidItems = invalid; + if (reasons.length > 0) diag.invalidReasons = reasons; + diag.kind = "ok"; + return finish(ranges, diag); + } + // #4252 RC3: entries whose first line IS a refs header are line- + // form drift (usually a missing summary under the header), not + // "not an array" — report no-valid-ranges with the per-entry + // reasons so the model can fix the call instead of retrying blind + // (#362 visibility). Prose without any refs header stays + // content-not-array. + const looksLikeLineForm = lineEntries.some((e) => { + 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) + ); + }); + if (looksLikeLineForm) { + diag.invalidItems = invalid; + if (reasons.length > 0) diag.invalidReasons = reasons; + diag.kind = "no-valid-ranges"; + } else { + diag.kind = "content-not-array"; + } + return finish([], diag); } - diag.kind = "content-not-array"; - return finish([], diag); + } else { + entries = parsed.entries; + salvaged = parsed.salvaged; + if (parsed.quoteRepaired) diag.quoteSalvage = true; } - entries = parsed.entries; - salvaged = parsed.salvaged; - if (parsed.quoteRepaired) diag.quoteSalvage = true; } else if (content !== null && typeof content === "object") { // #470: a single entry OBJECT in the content slot instead of a // one-element array — the SAME drift the top level already recovers @@ -374,9 +409,16 @@ type EntryOutcome = { range: CompressRangeSpec } | { reason: string }; // hard requirement is refs at the START of the first line. Both patterns are // anchored (^): summaries cite mNNNNN/bN refs routinely, so an unanchored // scan would let a citation inside a headerless entry supply fake bounds. +// #4252 RC2: the separator class includes U+2212 (minus sign) and U+FF0D +// (fullwidth hyphen-minus) — models copy the dash from rendered summaries, +// where it is usually the Unicode minus, not ASCII '-'. 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*(?:[-\u2212\uFF0D\u2013\u2014\u2026~]|\.\.\.|to)\s*([mb]\d{1,7})\b/i; const SINGLE_REF_IN_LINE = /^([mb]\d{1,7})\b/i; +// #4252 RC2: second-ref scan for the single-ref fallback — catches pairs +// whose separator the class above missed. The lookbehind keeps refs glued +// to a preceding alphanumeric run ("idm00168") from matching. +const SECOND_REF_IN_HEADER = /(?", adjacent refs…). + // Silently narrowing to ONE message is the expensive failure — reject + // with the offending separator named so the retry can fix it. A wordy + // gap ("see also m00168") is a topic citing another ref, not a pair: + // keep the honest single-message reading. + const rest = head.slice(single.index + single[0].length); + const second = SECOND_REF_IN_HEADER.exec(rest); + if (second !== null) { + const sep = rest.slice(0, second.index).trim(); + if (!/\p{L}{2,}/u.test(sep)) { + return { + reason: + sep.length === 0 + ? `line entry: two refs (${single[1]} ${second[1]}) with no recognized separator between them — use one of - – — … ~ .. − - or "to"` + : `line entry: unrecognized range separator "${sep}" between ${single[1]} and ${second[1]} — use one of - – — … ~ .. − - or "to"`, + }; + } + } startRef = normalizeLineRef(single[1]!); endRef = startRef; afterRefs = single.index + single[0].length; @@ -438,8 +499,9 @@ export function deriveTopicFromSummary(summary: string): string | undefined { return text.length > 60 ? clampPrefix(text, 60).trimEnd() : text; } +// Separator class mirrors REF_PAIR_IN_LINE (keep the two in step, #4252). 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*(?:[-\u2212\uFF0D\u2013\u2014\u2026~]|\.\.\.|to)\s*[mb]\d{1,7}\b/iy; const WHITESPACE_RE = /\s/; function skipWhitespace(s: string, i: number): number { @@ -561,6 +623,97 @@ function stringOr(value: unknown): string | undefined { return typeof value === "string" && value.length > 0 ? value : undefined; } +// #4252 RC1: the merged flat single-range form. The schema documents the +// multi-range `content` string and the flat {startId,endId,summary} form +// separately, so models combine them: the summary TEXT rides in `content` +// beside top-level refs (plain prose, or a JSON-encoded object with +// summary/topic fields). Recover it as ONE object entry so the shared +// validation tail applies unchanged. Never hijacks line form: a first line +// that already carries refs headers keeps its line-form reading, so every +// input that parses today is untouched. Top-level `summary` wins over the +// content text; a content payload that parses to a non-object structure +// (array, scalar) or a summary-less JSON object is not the documented +// shape and stays rejected. +function flatSummaryEntry( + value: Record, + raw: string, +): Record | undefined { + // Same field-name variants as validateEntry (startRef/startId/messageId). + 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; + const text = stripJsonWrapperResidue(raw).trim(); + if (text.length === 0) return undefined; + const firstLine = (text.split("\n")[0] ?? "").trim(); + if (REF_PAIR_IN_LINE.test(firstLine) || SINGLE_REF_IN_LINE.test(firstLine)) + return undefined; + const fenced = stripFence(raw.trim()); + // Structural reading of the content text, most specific first: a strict + // or lenient JSON OBJECT supplies summary/topic fields; a quoted string + // is prose (its text, carried by `text` below); anything else coherent + // (number, boolean, null, array) is not the documented shape — reject + // rather than fold its text. Strict JSON.parse only on the first rung: + // prose fails it instantly, so the lenient repair ladder stays reserved + // for JSON-shaped payloads; a JSON-shaped payload that still does not + // parse is a broken shell, also rejected. + let inner: Record | undefined; + { + let strict: unknown; + let strictOk = false; + try { + strict = JSON.parse(fenced); + strictOk = true; + } catch { + // not strict JSON — shape-specific paths below + } + if (strictOk) { + if ( + strict !== null && + typeof strict === "object" && + !Array.isArray(strict) + ) { + inner = strict as Record; + } else if (typeof strict !== "string") { + return undefined; + } + } else if (/^[\[{]/.test(fenced)) { + const lenient = tryParseLenient(fenced); + if (lenient === undefined) return undefined; + if ( + lenient !== null && + typeof lenient === "object" && + !Array.isArray(lenient) + ) { + inner = lenient as Record; + } else if (typeof lenient !== "string") { + return undefined; + } + } + } + let summary = stringOr(value["summary"]); + let topic = stringOr(value["topic"]); + if (inner !== undefined) { + if (summary === undefined) summary = stringOr(inner["summary"]); + if (topic === undefined) topic = stringOr(inner["topic"]); + if (summary === undefined) return undefined; + } + if (summary === undefined) summary = text; + if (summary.length === 0) return undefined; + const entry: Record = { + startRef: start, + endRef: end, + summary, + }; + if (topic !== undefined) entry["topic"] = topic; + return entry; +} + // --- tolerant JSON parsing ------------------------------------------------- function tryParseLenient(s: string): unknown { diff --git a/kernel/tests/parse-compress-input.test.ts b/kernel/tests/parse-compress-input.test.ts index c5152fe0cb..c509b8369f 100644 --- a/kernel/tests/parse-compress-input.test.ts +++ b/kernel/tests/parse-compress-input.test.ts @@ -1236,3 +1236,206 @@ test("line-form split still breaks on headers after blank lines and element resi ], ); }); + +// --------------------------------------------------------------------------- +// #4252: merged flat single-range form (summary text in content beside +// top-level refs), U+2212/U+FF0D separators, unrecognized-separator +// rejection instead of silent narrowing, header-only string visibility +// --------------------------------------------------------------------------- + +test("merged flat form: summary text in content + top-level refs parses as one range (#4252)", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: "## Session\nWorked on auth; chose X because Y.", + startId: "m00150", + endId: "m00168", + topic: "Auth exploration", + }); + assert.equal(diagnostics.kind, "ok"); + assert.equal(diagnostics.flatSummarySalvage, true); + assert.equal(ranges.length, 1); + assert.equal(ranges[0]!.startRef, "m00150"); + assert.equal(ranges[0]!.endRef, "m00168"); + assert.equal( + ranges[0]!.summary, + "## Session\nWorked on auth; chose X because Y.", + ); + assert.equal(ranges[0]!.topic, "Auth exploration"); +}); + +test("merged flat form: startRef/endRef and messageId spellings accepted (#4252)", () => { + const a = parseCompressArgs({ + content: "sum a", + startRef: "b114", + endRef: "b121", + }); + assert.equal(a.ranges.length, 1); + assert.equal(a.ranges[0]!.startRef, "b114"); + assert.equal(a.ranges[0]!.endRef, "b121"); + const b = parseCompressArgs({ + content: "sum b", + messageId: "m00007", + }); + assert.equal(b.ranges.length, 1); + assert.equal(b.ranges[0]!.startRef, "m00007"); + assert.equal(b.ranges[0]!.endRef, "m00007"); +}); + +test("merged flat form: JSON-encoded object with summary/topic inside the content string (#4252)", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: JSON.stringify({ summary: "sum from json", topic: "t-json" }), + startId: "b114", + endId: "b121", + }); + assert.equal(diagnostics.kind, "ok"); + assert.equal(diagnostics.flatSummarySalvage, true); + assert.equal(ranges.length, 1); + assert.equal(ranges[0]!.startRef, "b114"); + assert.equal(ranges[0]!.endRef, "b121"); + assert.equal(ranges[0]!.summary, "sum from json"); + assert.equal(ranges[0]!.topic, "t-json"); +}); + +test("merged flat form: top-level summary field wins over content text (#4252)", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: "prose summary text", + startId: "m00001", + endId: "m00005", + summary: "top-level wins", + }); + assert.equal(diagnostics.kind, "ok"); + assert.equal(diagnostics.flatSummarySalvage, true); + assert.equal(ranges[0]!.summary, "top-level wins"); +}); + +test("merged flat form: line-form content with refs headers is never hijacked (#4252)", () => { + const pair = parseCompressArgs({ + content: "m00150–m00168 real topic\nline-form summary", + startId: "m00001", + endId: "m00002", + }); + assert.equal(pair.diagnostics.kind, "ok"); + assert.equal(pair.diagnostics.flatSummarySalvage, undefined); + assert.equal(pair.ranges.length, 1); + assert.equal(pair.ranges[0]!.startRef, "m00150"); + assert.equal(pair.ranges[0]!.endRef, "m00168"); + assert.equal(pair.ranges[0]!.topic, "real topic"); + const single = parseCompressArgs({ + content: "m00042 lone ref line\nsummary", + startId: "m00001", + endId: "m00002", + }); + assert.equal(single.diagnostics.flatSummarySalvage, undefined); + assert.equal(single.ranges[0]!.startRef, "m00042"); + assert.equal(single.ranges[0]!.endRef, "m00042"); +}); + +test("merged flat form: prose without top-level refs stays content-not-array (#4252)", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: "just some prose with no refs anywhere", + }); + assert.equal(diagnostics.kind, "content-not-array"); + assert.equal(diagnostics.flatSummarySalvage, undefined); + assert.equal(ranges.length, 0); +}); + +test("merged flat form: broken JSON shell or non-object structure beside refs stays rejected (#4252)", () => { + const broken = parseCompressArgs({ + content: '{"summary": "cut off mid-string', + startId: "m00001", + endId: "m00005", + }); + assert.equal(broken.ranges.length, 0); + const scalar = parseCompressArgs({ + content: "123", + startId: "m00001", + endId: "m00005", + }); + assert.equal(scalar.ranges.length, 0); + const emptyObj = parseCompressArgs({ + content: "{}", + startId: "m00001", + endId: "m00005", + }); + assert.equal(emptyObj.ranges.length, 0); +}); + +test("U+2212 minus and U+FF0D fullwidth dash are recognized range separators (#4252)", () => { + for (const header of [ + "m00150\u2212m00168", + "m00150\uFF0Dm00168", + "m00150 − m00168", + "m00150-m00168", + ]) { + const { ranges, diagnostics } = parseCompressArgs({ + content: [`${header} topic\nsum`], + }); + assert.equal(diagnostics.kind, "ok", `separator in ${JSON.stringify(header)}`); + assert.equal(ranges[0]!.startRef, "m00150", `separator in ${JSON.stringify(header)}`); + assert.equal(ranges[0]!.endRef, "m00168", `separator in ${JSON.stringify(header)}`); + assert.equal(ranges[0]!.topic, "topic", `separator in ${JSON.stringify(header)}`); + } +}); + +test("unrecognized separator with a second ref is rejected, not narrowed (#4252)", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: ["m00150 => m00168 topic\nsum"], + }); + assert.equal(ranges.length, 0); + assert.equal(diagnostics.invalidItems, 1); + const reason = diagnostics.invalidReasons?.[0] ?? ""; + assert.ok(reason.includes('"=>"'), reason); + assert.ok(reason.includes("m00150"), reason); + assert.ok(reason.includes("m00168"), reason); +}); + +test("two adjacent refs with no separator are rejected, not narrowed (#4252)", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: ["m00150 m00168 topic\nsum"], + }); + assert.equal(ranges.length, 0); + assert.ok( + (diagnostics.invalidReasons?.[0] ?? "").includes( + "no recognized separator", + ), + JSON.stringify(diagnostics.invalidReasons), + ); +}); + +test("wordy gap between refs stays a single-message read (topic citation) (#4252)", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: ["m00150 see also m00168 for context\nsum"], + }); + assert.equal(diagnostics.kind, "ok"); + assert.equal(ranges.length, 1); + assert.equal(ranges[0]!.startRef, "m00150"); + assert.equal(ranges[0]!.endRef, "m00150"); + assert.equal(ranges[0]!.topic, "see also m00168 for context"); +}); + +test("header-only string entries report no-valid-ranges with per-entry reasons (#4252)", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: "m00010–m00020 topic\nm00030–m00040 other", + }); + assert.equal(ranges.length, 0); + assert.equal(diagnostics.kind, "no-valid-ranges"); + assert.equal(diagnostics.invalidItems, 2); + assert.ok( + (diagnostics.invalidReasons ?? []).every((r) => + r.includes("missing summary"), + ), + JSON.stringify(diagnostics.invalidReasons), + ); +}); + +test("header-only plus valid entry in one string keeps ok kind with the invalid count (#4252)", () => { + const { ranges, diagnostics } = parseCompressArgs({ + content: "m00010–m00020 topic\nm00030–m00040 other\nbody under other", + }); + assert.equal(diagnostics.kind, "ok"); + assert.equal(ranges.length, 1); + assert.equal(ranges[0]!.startRef, "m00030"); + assert.equal(diagnostics.invalidItems, 1); + assert.ok( + (diagnostics.invalidReasons?.[0] ?? "").includes("missing summary"), + ); +}); 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 c901fd6be303faa52d42d51b6161308e9b754f41 Mon Sep 17 00:00:00 2001 From: awork Date: Thu, 22 Oct 2026 11:27:06 +0800 Subject: [PATCH 2/4] test: regenerate wire-contract goldens for the #4252 compress schema text Description-text-only changes (verified: every diff line is a description field, 78 symmetric pairs across the four goldens): the content/startId/endId/summary parameter descriptions and the tool description now document the accepted merged flat single-range shape (summary text in content beside top-level startId/endId). No schema structure, type, or requirement change. --- tests/golden/wire-contract/bili.json | 32 +++++----- tests/golden/wire-contract/kernel.json | 64 +++++++++---------- .../wire-contract/manifest-default.json | 30 ++++----- .../golden/wire-contract/manifest-optin.json | 30 ++++----- 4 files changed, 78 insertions(+), 78 deletions(-) diff --git a/tests/golden/wire-contract/bili.json b/tests/golden/wire-contract/bili.json index 95b5629723..50af93aab6 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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -98,11 +98,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -114,7 +114,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -301,11 +301,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -317,7 +317,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -516,11 +516,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -532,7 +532,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "parameters": { "type": "object", "properties": { diff --git a/tests/golden/wire-contract/kernel.json b/tests/golden/wire-contract/kernel.json index 4d746ccd8d..c7237cfe20 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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -98,11 +98,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -114,7 +114,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -289,11 +289,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -305,7 +305,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -492,11 +492,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -508,7 +508,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -860,11 +860,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -876,7 +876,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -980,11 +980,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -996,7 +996,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -1100,11 +1100,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -1116,14 +1116,14 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } }, "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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "parameters": { "type": "object", "properties": { diff --git a/tests/golden/wire-contract/manifest-default.json b/tests/golden/wire-contract/manifest-default.json index e911e898d3..d5b08deb59 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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -111,11 +111,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -127,7 +127,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -322,11 +322,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -338,7 +338,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -548,11 +548,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -564,7 +564,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } diff --git a/tests/golden/wire-contract/manifest-optin.json b/tests/golden/wire-contract/manifest-optin.json index 54507d9713..074e0bc2eb 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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -114,11 +114,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -130,7 +130,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -391,11 +391,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -407,7 +407,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } @@ -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 with content holding the summary text and startId/endId giving that text its bounds). 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.", "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?}. Single-range forms: {startId,endId,summary,topic?} without content, OR the summary text in this string with the bounds in top-level startId/endId (plain prose, or a JSON object with summary and topic fields; a top-level summary field wins over the text). Batch multiple ranges into ONE call — do not split into one call per range. REQUIRED unless the flat single-range form is used.", "anyOf": [ { "type": "array", @@ -692,11 +692,11 @@ }, "startId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the start of the range" + "description": "Flat single-range form: mNNNNN ref at the start of the range. Without content the summary comes from the summary field; with a string content holding the summary text, startId/endId give that text its bounds." }, "endId": { "type": "string", - "description": "Flat single-range form (no content): mNNNNN ref at the end of the range" + "description": "Flat single-range form: mNNNNN ref at the end of the range. Pairs with startId for the bounds of a flat single range (see startId for how the summary is supplied)." }, "startRef": { "type": "string", @@ -708,7 +708,7 @@ }, "summary": { "type": "string", - "description": "Flat single-range form (no content): self-contained summary replacing the range" + "description": "Flat single-range form: self-contained summary replacing the range. Wins over summary text riding in content when both are present." } } } From e2ffe4689fa12c9779211b614a3d39f715509dc9 Mon Sep 17 00:00:00 2001 From: awork Date: Thu, 22 Oct 2026 11:27:06 +0800 Subject: [PATCH 3/4] fix: log flat-summary salvage in the proxy compress-input warn lines (#4252) parseCompressInput emits a flat-summary salvage warn (same style as the #3780 double-escape and #603 quote salvages) when the kernel recovers a range from summary text riding in content beside top-level refs. --- src/compress-tool.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compress-tool.ts b/src/compress-tool.ts index b0e4249684..a3ef837989 100644 --- a/src/compress-tool.ts +++ b/src/compress-tool.ts @@ -539,6 +539,13 @@ 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})`); } + // #4252: the model put the summary text in content beside top-level + // startId/endId (the two documented forms merged) — the kernel now + // honors it; the warn line makes the salvage visible in the proxy log, + // same style as the #3780/#603 salvage lines above. + if (parsed.diagnostics.flatSummarySalvage === true) { + loggerLog("warn", `[acp-compress-input] flat-summary salvage: recovered ${parsed.ranges.length} range(s) from summary text riding in content beside top-level refs (kind=${parsed.diagnostics.kind}) (#4252)`); + } 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") { From a10751733391065b4fa203ebdecfe4768eb18674 Mon Sep 17 00:00:00 2001 From: awork Date: Thu, 22 Oct 2026 11:32:57 +0800 Subject: [PATCH 4/4] fix: sync kernel/package-lock.json with the 0.0.152 bump (#4252) The lock-sync CI lane (#3782) also enforces the kernel's own lockfile; the 0.0.151 -> 0.0.152 bump in kernel/package.json left it stale. --- kernel/package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 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",