Repository navigation
[PR] fix: plaintext body dumps get a standing credentials-warning banner (#4482) - #4483
Closed
ranxianglei wants to merge 3 commits into
Closed
ranxianglei wants to merge 3 commits into
ranxianglei wants to merge 3 commits into
Conversation
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.5392-pr.4483.9479b67This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4483.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…4482) Opt-in body dumps (ACP_DUMP_BODY / diagnostics.dumpBody, REREQUEST dumps, BILI_DUMP_4XX err/summary-err dumps) write the full plaintext conversation body to disk and may carry real credentials (tool arguments, host-injected content), yet nothing warned the user. #4397's reporter saw live credentials in such dumps; sharing them into an issue leaks them publicly. No automatic redaction — byte-exactness is the point of these dumps. Instead every plaintext-body dump file now starts with one standing warning line (PLAINTEXT DUMP ... scrub before sharing): - raw/*-REQ.txt, raw/*-INCOMING.txt, dumps/req-*.json, req-*-REREQUEST.json and err-*.json / summary-err-*.json all get the banner (DUMP_PLAINTEXT_BANNER in src/dump-banner.ts). - bili acp-cache diff strips the known leading banner line explicitly, so pre-banner (old-format) dumps keep parsing byte-identically — old and new files also mix fine in one dir (tested). The banner text must stay free of ": " (head lines parse as headers); pinned by test. - tools/analyze-dumps.mjs strips the banner before JSON.parse; its local copy of the literal is checked against src/dump-banner.ts by test. - CONFIGURATION.md en+zh warnings for dumpBody/dumpReq/dump4xx go through the gen-config-docs seed (website/config-reference/diagnostics.yaml), keeping the docs-sync drift guard green. Behavior change (intended, disclosed per owner policy): dump file FORMAT changes for all six writers — a one-line banner is prepended. Consumers that strictly parsed dumps/req-*.json or err-*.json as pure JSON from outside this repo will see a non-JSON first line; in-repo consumers are updated. Body bytes after line one are untouched (byte-diff forensics preserved). Tests: new tests/issue4482-dump-banner.test.ts (banner pinned + tool sync, stripDumpBanner unit, real-writer harness asserting INCOMING/REQ/JSON banners with intact bodies, runDiff old/new/mixed-dir equivalence) plus banner assertions added to error-dump / issue1993 / reasoning-echo suites.
ranxianglei
force-pushed
the
2026-10-24_dump-plaintext-banner
branch
from
October 24, 2026 05:01
960a6e2 to
e354285
Compare
… body It only ever writes the response status + masked headers (src/server/relay.ts). Corrected the file list so the gate contract comment matches the writers. (review nit, unrelated to #4482 content)
…_FILES Both files landed on master via af8e5dc (#4449) without LIVE_FILES registration, so the run-ci-tests process-spawn tripwire fails every shard of every PR branch (inherited red master, unrelated to this PR's change). Neither binds a port: codex-mcp-shell coordinates its spawned shell child via ENTRY_REPORT_FILE, codex-plugin-version-sync runs execFileSync synchronously. Appended at list end (slot = index).
Owner
Author
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
给所有明文 body dump 加上常驻凭据警告 banner——不做自动脱敏(byte-exact 取证价值保留)。Closes #4482。
改了什么
6 个明文 body dump 写盘点全部在文件首行加一行:
PLAINTEXT DUMP — full conversation body, may contain credentials; scrub before sharing(
DUMP_PLAINTEXT_BANNER,新模块src/dump-banner.ts):消费方兼容(审核中发现的回归点):
bili acp-cache diff(parseDumpFile)显式剥掉已知的首行 banner → 旧格式(无 banner)文件解析结果逐字节不变;新旧文件混在同一目录也可用(有测试)。banner 文本被测试钉住不得含 ": "(head 行按 header 解析)。行为变更(有意,显式披露)
dump 文件格式变更:上表 6 类文件均新增首行 banner。仓库内消费方已同步更新;仓库外严格把 req-.json / err-.json 当纯 JSON 解析的脚本需要跳过首行。第 1 行之后的 body 字节不变(byte-diff 取证价值保留)。无配置面变更、无默认值变化(所有 gate 保持默认关)、缓存/重试/增量游标不受影响。
范围外:SSE raw 响应 dump(*-raw.sse,不同 gate、响应字节流——插 banner 会破坏流格式);body 自动 redaction(破坏 byte-diff,如需属 owner 设计面,issue 明确排除)。
测试
新增 tests/issue4482-dump-banner.test.ts:banner 文本钉死 + tool 字面量同步检查、stripDumpBanner 单测(LF/CRLF/无操作)、真实写盘 harness(INCOMING/REQ/JSON 均以 banner 开头且 body 字节完整)、runDiff 旧格式/新格式/混合目录分类等价性。error-dump / issue1993-preflight-400 / reasoning-echo-400 套件补 banner 断言。本地定向跑 53/53 通过(新文件 + 5 个相关套件),typecheck/build 干净;全量套件以 CI 为准。