Skip to content

fix: drop orphaned export on codexRewriteInsertionIndex (Fixes #2314) - #2315

Closed
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-07_drop-codex-rewrite-export
Closed

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-07_drop-codex-rewrite-export

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What

One-line fix for the red unused-exports gate on master (#2314). Drops the leading export from codexRewriteInsertionIndex at src/launcher.ts:1020.

Root cause

PR #2282 (5336c0700) added the function with export, though its only caller is internal (src/launcher.ts:980). It merged green because the unused-export gate did not exist on master yet. PR #1443 then landed the gate (scripts/check-unused-exports.mjs) after #2282 and immediately detected the orphaned export — so master itself is red and every PR based on it fails the check.

Verification

  • Reproduced on current master: node scripts/check-unused-exports.mjs → ✗ 1 unused export(s): INTERNAL_ONLY src/launcher.ts: codexRewriteInsertionIndex (exit 1).
  • Zero importers of the symbol anywhere in src/, tests/, or scripts/ (full-repo grep: only the definition + internal call site + a doc comment).
  • src/launcher.ts is not an entry file (absent from tsup.config.ts), so it is not exempt from the gate.
  • After the change: gate exits 0 (✓ unused-export gate: clean (3 waived)); npm run typecheck clean.

Behavior change

None. The function keeps its name, signature, and all internal call sites; only its module visibility narrows from exported to module-private. No wire, config, persistence, or kernel surface touched.

Full suite/build left to CI per local-testing discipline (change touches no request-pipeline path).

Closes #2314

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-07_drop-codex-rewrite-export (1658583)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2448-pr.2315.1107da0

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr2315.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review of PR #2315 (head 16585835f, branch 2026-10-07_drop-codex-rewrite-export). Diff verified to be exactly one line: src/launcher.ts:1020 export function codexRewriteInsertionIndex → function …. All body claims re-verified locally; structured conclusion below.

结构化七问

  1. 是什么问题:refactor: drop dead declarations + demote internal-only exports + unused-export gate (#1440) #1443 引入的 unused-export gate 在 master 上自身红着(INTERNAL_ONLY src/launcher.ts: codexRewriteInsertionIndex),导致所有基于 master 的 PR 都挂这个 check。
  2. 什么原因导致的:fix(launcher): exec-resume 尾部 -c 吞掉用户 -c model + 真codex persona e2e×2通道(URL/launcher) #2282(5336c0700)引入该函数时带了 export,但文件外零 importer(仅同文件 src/launcher.ts:980 调用);当时 gate 尚不存在所以绿着合入,refactor: drop dead declarations + demote internal-only exports + unused-export gate (#1440) #1443(253bbfa1e)随后落地 gate 立即检出。时序已核实:fix(launcher): exec-resume 尾部 -c 吞掉用户 -c model + 真codex persona e2e×2通道(URL/launcher) #2282 的 merge commit cb239d349 在 first-parent 上确实早于 refactor: drop dead declarations + demote internal-only exports + unused-export gate (#1440) #1443 的 merge 0be9e838f,因果链成立。
  3. 怎么修复的:去掉 export 关键字,把可见性收窄为模块私有。对 INTERNAL_ONLY 符号这是最小正确处置——不删(内部有活调用)、不加 waiver(waiver 只留给有意保留公开的导出)。
  4. 是否有回归问题:逐项审了 diff 触碰路径的既有行为:①该符号的外部导入——不存在,且 src/launcher.ts 不是 tsup entry 文件(tsup.config.ts 中无 "launcher"),没有可破坏的外部面;②唯一内部调用点 src/launcher.ts:980——未动;③wire/config/persistence/kernel——未触碰;④gate 自身语义——未变,只是现在正确报 clean。无高危模式(无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式变化)。
  5. 是否破坏缓存:不涉及。
  6. 是否改了设计方向:不涉及(纯模块可见性收窄)。
  7. 是否引入了新的配置:不涉及。

本地定向验证(全量套件/typecheck 按本地测试纪律留给 CI):

  • master 74cf5246d 复现红:node scripts/check-unused-exports.mjs → exit 1,INTERNAL_ONLY src/launcher.ts: codexRewriteInsertionIndex。
  • PR head 同命令 → exit 0,✓ unused-export gate: clean (3 waived)。
  • 全仓 grep:符号仅 3 处出现,全在 src/launcher.ts(定义 :1020、调用 :980、doc comment :986);src/、tests/、scripts/ 零 importer。

CI 状态(head 16585835f):已过 unused-exports(本 PR 修的那个 gate)、lane-guard、version-guard、kernel-guard、docs-coverage、docs-sync、build-artifact 及全部 real-client e2e lane(codex/dsh/opencode/pi/codex-responses 等);test matrix(ubuntu/windows × 22/24)+ hermetic registry e2e 仍在跑。本改动运行时中性、不碰请求管线,预期转绿。

其他核查:PR base = 当前 master HEAD(74cf5246d),base 新鲜不 stale;热文件方面 #2306 也动 src/launcher.ts(buildXxxEnv 家族重构),与本行相距很远,冲突风险可忽略。diff 干净,一行一目的。

判定:可合并——待 test matrix 跑完转绿即可合入(当前已完成的所有 check 均绿)。合并请人工操作:#2315

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 跟进:head 16585835f 的 CI 已全部跑完——所有 check 绿,零失败(含此前还在跑的 test matrix ubuntu/windows × 22/24 与 hermetic registry e2e)。上一条回复的条件已满足,可以合入:https://github.com/ranxianglei/billion-context/pull/2315(合并请人工操作)。

@ranxianglei ranxianglei closed this Oct 7, 2026
ranxianglei pushed a commit to ReineLan/billion-context that referenced this pull request Oct 20, 2026
a4f2730 (ranxianglei#3811) introduced maskUrlForPublish with an export, but nothing
outside src/log-mask.ts imports it (only maskUrlsForPublish below calls it),
so scripts/check-unused-exports.mjs fails with:
  INTERNAL_ONLY src/log-mask.ts: maskUrlForPublish
Dropping the export keyword makes the gate pass again; no behavior change.
Same treatment as ranxianglei#2315 applied to maskUrlsInText.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: unused-exports gate red on master since #1443 — blocks every PR (orphaned export from #2282)

1 participant