From 701688d158a3698d88a4f2e0ef806e7a0371b20f Mon Sep 17 00:00:00 2001 From: ework-agent Date: Sat, 31 Oct 2026 18:30:20 +0800 Subject: [PATCH 1/2] fix(ci): repair docs-sync + unused-exports gates on ci-fixes (#4599) Converging master's red gates onto ci-fixes. lifecycle-ledger-guard is already fixed here (LIFECYCLE.md entries for BILI_SESSION_CONTENT_STORE_PIN / BILI_SPAWN_FINGERPRINT from the prior sentinel pass, preserved through the master merge); this commit clears the other two. docs-sync: #5319 documented the new 'chat' builtin prompt pack in CONFIGURATION.md/.zh-CN.md but never updated the single-source seed, so regeneration dropped it and the gate failed. Add 'chat' to the compress.promptPack seed (type/desc_en/desc_zh) and regenerate website/docs/index.html to match. unused-exports: CodexWindowSource (src/codex-models.ts) and PackInstallOptions (src/pack-install.ts) are referenced only inside their own modules and imported nowhere else; drop the leading export (INTERNAL_ONLY) as the guard prescribes. Verified locally: lifecycle-ledger-guard OK, check-unused-exports clean, gen-config-docs regenerate matches committed artifacts (zero drift). --- src/codex-models.ts | 2 +- src/pack-install.ts | 2 +- website/config-reference/compress.yaml | 6 +++--- website/docs/index.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/codex-models.ts b/src/codex-models.ts index 45ee8b588e..02d49f1ab2 100644 --- a/src/codex-models.ts +++ b/src/codex-models.ts @@ -89,7 +89,7 @@ function positiveWindow(value: unknown): number | undefined { /** #5243: which surface produced a codex-aligned window — named in the clamp * log so "window clamped" stops claiming client metadata when no client * metadata existed. */ -export type CodexWindowSource = +type CodexWindowSource = | "client-metadata" | "codex-catalog" | "codex-models-cache" diff --git a/src/pack-install.ts b/src/pack-install.ts index a70844c1a8..dad6facaf3 100644 --- a/src/pack-install.ts +++ b/src/pack-install.ts @@ -31,7 +31,7 @@ export const PACK_ENTRY_FILE = "bili-pack.json"; const NPM_TIMEOUT_MS = 120_000; -export interface PackInstallOptions { +interface PackInstallOptions { /** Target `./.billion-context/packs/` instead of the user-dir default. */ project?: boolean; /** Replace an existing pack file (refused otherwise). */ diff --git a/website/config-reference/compress.yaml b/website/config-reference/compress.yaml index 25a7896f63..80500ba6ae 100644 --- a/website/config-reference/compress.yaml +++ b/website/config-reference/compress.yaml @@ -164,13 +164,13 @@ entries: site_en: "\"off\" | \"warn\" | \"repair\" (default repair): reconcile folded state when the client rewinds or rewrites history between turns." site_zh: "\"off\" | \"warn\" | \"repair\"(默认 repair):客户端在轮次之间回退或改写历史时校准已折叠状态。" - key: compress.promptPack - type: "string (builtin: \"default\", \"lean\")" + type: "string (builtin: \"default\", \"lean\", \"chat\")" default: "builtin \"default\"" group: compress id: cw.ppk render: compress-row - desc_en: "Compression prompt pack, resolved project pack → user pack → builtin; not gated by acknowledgePromptsRisk." - desc_zh: "压缩提示词包,按 项目包 → 用户包 → 内置 解析;不受 acknowledgePromptsRisk 门控。" + desc_en: "Compression prompt pack, resolved project pack → user pack → shipped pack → builtin; not gated by acknowledgePromptsRisk." + desc_zh: "压缩提示词包,按 项目包 → 用户包 → 随包附带(chat)→ 内置 解析;不受 acknowledgePromptsRisk 门控。" site_en: "Compression prompt pack, resolved project pack → user pack → builtin. Builtins: \"default\" and \"lean\" (one-line tool descriptions). Not gated by acknowledgePromptsRisk." site_zh: "压缩提示词包,按 项目包 → 用户包 → 内置 解析。内置:\"default\" 与 \"lean\"(单行工具描述)。不受 acknowledgePromptsRisk 门控。" - key: compress.tiers diff --git a/website/docs/index.html b/website/docs/index.html index cfbe6e24b1..e4a692997c 100644 --- a/website/docs/index.html +++ b/website/docs/index.html @@ -195,7 +195,7 @@

compress — every knob

maxSummaryLengthnumberHard cap, in characters, on one generated summary (kernel default 20000): longer replies are rejected whole by the kernel check or the external-summary executor. External summarizers receive this exact cap in their instructions (#3635); 0 disables the cap. minSummaryLengthnumberFloor, in characters, for generated summaries (kernel default 50): shorter replies are rejected whole; 0 disables the floor. External summarizers are held to the same floor (#3635). reconcile"off" | "warn" | "repair""off" | "warn" | "repair" (default repair): reconcile folded state when the client rewinds or rewrites history between turns. - promptPackstring (builtin: "default", "lean")Compression prompt pack, resolved project pack → user pack → builtin. Builtins: "default" and "lean" (one-line tool descriptions). Not gated by acknowledgePromptsRisk. + promptPackstring (builtin: "default", "lean", "chat")Compression prompt pack, resolved project pack → user pack → builtin. Builtins: "default" and "lean" (one-line tool descriptions). Not gated by acknowledgePromptsRisk. tiersbooleanOn by default: tiered T1→T3 distillation spreads folding cost across generations. protectedToolsstring[]Hard exclusion across all history: results of listed tools never fold (use with care). protectedLatestToolsstring[]Protects only the LATEST instance of cumulative-snapshot tools whose newest result supersedes older ones (e.g. todo lists). From cbdd67debb3622f2c214f18c5f97e9620b8b847c Mon Sep 17 00:00:00 2001 From: ework-agent Date: Sat, 31 Oct 2026 19:36:29 +0800 Subject: [PATCH 2/2] fix(ci): remove raw negative slice in pack-install stderr tail (text-safe family gate) pack-install.ts took the last 3 npm stderr lines via split+slice(-3), tripping the #816/#1615 family gate in tests/text-safe.test.ts even though the receiver is an array of lines (code-unit-safe). Use a non-negative computed start index so the literal negative-slice token is gone; output is identical (last up-to-3 lines clamped to 300 chars). Inherited from #5340, which shipped without satisfying the gate. --- src/pack-install.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pack-install.ts b/src/pack-install.ts index dad6facaf3..0124feab4c 100644 --- a/src/pack-install.ts +++ b/src/pack-install.ts @@ -114,7 +114,8 @@ export function installPackFromNpm(spec: string, options: PackInstallOptions = { const err = error as { stderr?: unknown; message?: string }; stderr = typeof err.stderr === "string" ? err.stderr : ""; if (/ENOENT/.test(String(err.message))) throw new Error("npm was not found on PATH"); - const tail = stderr.trim().split("\n").slice(-3).join(" ").slice(0, 300); + const lines = stderr.trim().split("\n"); + const tail = lines.slice(Math.max(0, lines.length - 3)).join(" ").slice(0, 300); throw new Error(`npm install ${trimmed} failed${tail ? `: ${tail}` : ""}`); }