Skip to content

Non-invasive MCP accelerator plugin for Google Antigravity (CLI/Desktop/IDE): cuts LLM turns (-34%), token quota (-31%), and upload traffic (-40%) without affecting native UI or diffs.

chore(read-slices): drop CHANGELOG entry and use explicit \uFEFF escapes in tests

BanszNeo6d7f918b4cd7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3bda4f4..d264ea2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,11 +19,6 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
- Fixed annotated-tag commit SHA peeling (`git ls-remote --tags` + `^{}` resolution in `pickLatestSemverTag`), persisted `knownTagCommits` in `update-state.json` to hard-refuse force re-tagged / hijacked release tags (even under `--force`), verified cloned `stagingDir` `HEAD` equals the observed commit SHA (blocking fetch-time TOCTOU hijacking), verified GitHub Release `SHA256SUMS.txt` digests via constant-time `timingSafeEqual` (with strict opt-in `AGY_FAST_REQUIRE_CHECKSUMS=1`), and printed target commit SHA + GitHub compare diff URL in `update --prompt` / `update --check`.
- Pinned all GitHub Actions in `ci.yml` and `release.yml` to immutable 40-char commit SHAs, enforced `package-lock.json` and `SERVER_VERSION` parity in `release.yml`, added `SHA256SUMS.txt` release assets + `actions/attest-build-provenance` SLSA attestations, added an opt-in zero-token npm OIDC `--provenance` publish job (`vars.NPM_TRUSTED_PUBLISHING == 'true'`), and expanded `SECURITY.md` with a 2-minute independent supply-chain audit guide.
-### Fixed
-
-- **Read BOM-marked UTF-16 files in `read_slices` / `quick_outline` (`src/utils/fs-utils.ts`, `src/tools/read-slices.ts`, Refs #40)**
- - Decoded UTF-16 LE/BE files with a BOM (e.g. Windows PowerShell 5.1 `>` / `Out-File` logs) for read-only outlines and slices instead of rejecting them, while rejecting malformed or NUL-containing payloads; `apply_edits` still refuses UTF-16 writes.
-
### Documentation
- **Antigravity Desktop `v2.34–v2.36` / CLI `v1.5.x` rule-truncation guard, context hygiene `doctor`, degradation-audit `benchmark` metrics & bilingual safety monitor report (`src/utils/snapshot.ts`, `src/session-start.ts`, `scripts/install.mjs`, `src/benchmark-core.ts`, `src/benchmark.ts`, `rules/AGENTS.md`, `docs/SAFETY_MONITOR_ANALYSIS.md`, `docs/SAFETY_MONITOR_ANALYSIS.zh-CN.md`)**
@@ -41,7 +36,6 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
- **`apply_edits` 默认工作区 `cwd` 写边界护栏与 Plan Mode 约束**:默认拦截越出工作区 `cwd` 的文件写入与 `verify.cwd`(含 `../`、工作区外绝对路径与软链接/目录软链接逃逸,`0` 文件改动;确需跨工作区写入可显式设置 `AGY_FAST_ALLOW_OUTSIDE_CWD=1`,`0 B` Schema 成本),并在规则中明示只读 Plan Mode 禁用写工具。
- **Antigravity Desktop `v2.34–v2.36` / CLI `v1.5.x` 专项加固、降智体检与官方安全审核报告**:`SessionStart` 新增 `<1 ms` 纯 `stat` 规则超限预警(仅当工作区规则文件超过宿主 `rules.go:736` 的 `24,000 B` 静默截断上限时追加 1 行告警,未超限 `0 B` 开销);显式 `doctor` 新增 `24,000 B` 规则体检与桌面/CLI 禁用插件残留 MCP Schema 检查;`benchmark` 新增首轮主会话基线上下文、可见思考摘要为空率 vs 估算隐藏思考深度、独立 UI 进度空转轮次与 `compare --surfaces`(Desktop vs CLI)对照;微调 `rules/AGENTS.md`(标注适用 `Desktop v2.34–v2.36 / CLI v1.5.x` 版本范围,防中途切档位缓存归零与单 UI 轮空转),并新增中英文脱敏安全审批分析报告 `docs/SAFETY_MONITOR_ANALYSIS.md` / `docs/SAFETY_MONITOR_ANALYSIS.zh-CN.md`。
- **三语 README 诚实化修订、已知权衡专节与 628 会话 Cache 对齐实测表**:如实区分 Git/文件列表感知与原生 `edit_file` 工具步级检查点差异、标明 `quick_outline` 为零依赖正则/词法启发式索引(非 AST/LSP),补充最小权限只读模式(`--tools batch_search,quick_outline,read_slices`)、`--project` 按项目安装建议与 628 会话(含图+文并行)Prompt Cache 前缀对齐实测表。
-- **`read_slices` / `quick_outline` 支持读取带 BOM 的 UTF-16 文件**:只读大纲与切片可直接解码 UTF-16 LE/BE(如 Windows PowerShell 5.1 `>` / `Out-File` 生成的日志),格式损坏或含 NUL 的内容仍拒绝;`apply_edits` 写入仍拒绝 UTF-16。
---
diff --git a/test/read-slices.test.ts b/test/read-slices.test.ts
index 73c81f2..198dde8 100644
--- a/test/read-slices.test.ts
+++ b/test/read-slices.test.ts
@@ -1557,7 +1557,7 @@ describe("read_slices", () => {
// Only the file BOM is removed: a leading U+FEFF in the content itself survives.
await fs.writeFile(
path.join(dir, "feff.txt"),
- Buffer.concat([Buffer.from([0xff, 0xfe]), Buffer.from("keep\r\n", "utf16le")]),
+ Buffer.concat([Buffer.from([0xff, 0xfe]), Buffer.from("\uFEFFkeep\r\n", "utf16le")]),
);
// BOM-only file, odd payload length, lone surrogate, and BOM-prefixed binary (decoded NUL).
await fs.writeFile(path.join(dir, "bom-only.txt"), Buffer.from([0xff, 0xfe]));
@@ -1568,7 +1568,7 @@ describe("read_slices", () => {
cwd: dir,
lineRanges: ["feff.txt:1-1", "bom-only.txt:1-1", "odd.txt:1-1", "lone.txt:1-1", "bin.dat:1-1"],
});
- assert.match(edge.text, /1: keep/);
+ assert.match(edge.text, /1: \uFEFFkeep/);
assert.match(edge.text, /## Slice: bom-only\.txt \(1 lines\)/);
assert.match(edge.text, /odd\.txt\nERROR: Malformed UTF-16 file cannot be read as text: .*\[UTF-16 LE\]/);
assert.match(edge.text, /lone\.txt\nERROR: Malformed UTF-16 file cannot be read as text: .*\[UTF-16 LE\]/);