From 7572403b87e22f3e17133ab5f42d5408cfcdee4b Mon Sep 17 00:00:00 2001 From: ranxianglei Date: Sat, 31 Oct 2026 17:30:21 +0800 Subject: [PATCH 1/4] Empty vehicle PR for the v0.1.209 -> master full regression review From 701688d158a3698d88a4f2e0ef806e7a0371b20f Mon Sep 17 00:00:00 2001 From: ework-agent Date: Sat, 31 Oct 2026 18:30:20 +0800 Subject: [PATCH 2/4] 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 3/4] 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}` : ""}`); } From 0f78649b5ed52b731ac29e11e350b7b8993a8c87 Mon Sep 17 00:00:00 2001 From: billion-bot Date: Sat, 31 Oct 2026 20:22:33 +0800 Subject: [PATCH 4/4] fix(gate): read assertions from state-dir bili.log; tolerate host-masked relay URLs Local gate harness broke on its own master without anyone noticing because GitHub CI never runs the local gate (needs real model/dsh/registry): - #5012 mutes the stdout/stderr tee for managed (launch-token) processes once the log-file leg proves live, so a detached gate proxy now leaves proxy.log with only the boot banner while every log line goes to the state-dir bili.log. mark()/slice() therefore saw an empty stream and every log-pattern row failed even though all mechanisms fired correctly. - Log URL masking (#4191/#4254) renders private hosts as in bili.log, so the Lane-B routing assertion's exact-URL match missed. Fix: assert against xdg/state/billion-context/bili.log (append-only within a run), and match relay egress on :port/path which survives masking. --- scripts/release-gate-local.mjs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/release-gate-local.mjs b/scripts/release-gate-local.mjs index 0282fa0561..0c16fd78c3 100644 --- a/scripts/release-gate-local.mjs +++ b/scripts/release-gate-local.mjs @@ -58,7 +58,7 @@ // corpus mass leaves the turn viable) // // Exit code 0 = every ran lane green. Non-zero = at least one red assertion. -// Evidence (proxy.log, per-turn ndjson, config, corpus) stays in the scratch +// Evidence (state-dir bili.log, per-turn ndjson, config, corpus) stays in the scratch // dir on failure. import { spawn, spawnSync } from "node:child_process"; @@ -370,8 +370,14 @@ async function main() { fs.writeFileSync(path.join(baseDir, "work", "corpus.md"), buildCorpus(G.corpusTokens)); const ctx = { workDir: path.join(baseDir, "work"), childEnv, proxyLog, port, profileEntry, sessionId: null }; - const mark = () => fs.statSync(proxyLog).size; - const slice = (from, to) => fs.readFileSync(proxyLog, "utf8").slice(from, to ?? undefined); + // Assertions read the STATE-DIR log, not proxy.log: #5012 mutes the + // stdout/stderr tee for managed (launch-token) processes once the log-file + // leg proves live, so a detached gate proxy leaves proxy.log with only the + // boot banner. The state-dir bili.log carries every line and is append-only + // within a gate run (rotation threshold far above a run's ~50KB). + const biliLog = path.join(baseDir, "xdg", "state", "billion-context", "bili.log"); + const mark = () => { try { return fs.statSync(biliLog).size; } catch { return 0; } }; + const slice = (from, to) => { try { return fs.readFileSync(biliLog, "utf8").slice(from, to ?? undefined); } catch { return ""; } }; async function turn(prompt, label) { const r = spawnSync( @@ -488,7 +494,10 @@ async function main() { const noBaseline = !/usage-baseline=\d/.test(s3); record("B", "cross-upstream baseline demoted when cited", noBaseline || /demoting to untrusted/.test(s3), noBaseline ? "no baseline cited this run" : "demoting to untrusted"); record("B", "both markers recalled after switch", has(t3.final, CODEWORDS[6]) && has(t3.final, CODEWORDS[39]), `final="${t3.final.trim().slice(0, 90)}"`); - record("B", `request routed to ${G.relayModel}`, s3.includes(G.relayUrl) || s3.includes(G.relayModel), ""); + // Host masking (#4191/#4254) rewrites private hosts to `` + // but keeps :port/path — assert on the port-suffixed forward line too. + const relayPort = /:(\d+)\/?$/.exec(G.relayUrl)?.[1]; + record("B", `request routed to ${G.relayModel}`, s3.includes(G.relayUrl) || (relayPort && new RegExp(`forward[^\\n]*:${relayPort}\\b`).test(s3)) || s3.includes(G.relayModel), ""); const m4 = mark(); const t4 = await turn("Reply with exactly: OK", "t4");