Skip to content

[PR] fix(#5317): drop the internal-only CodexWindowSource export (master unused-exports gate) - #5318

Closed
Louie0806 wants to merge 1 commit into
ranxianglei:masterfrom
Louie0806:2026-10-31_unused-export-codex-window
Closed

Louie0806 wants to merge 1 commit into
ranxianglei:masterfrom
Louie0806:2026-10-31_unused-export-codex-window

Conversation

@Louie0806

Copy link
Copy Markdown
Contributor

(ai: deepseek/deepseek-v41-flash)

Why

unused-exports is a required check and it is red on master itself (afdf889cf), so it is red on every branch that merges master:

✗ 1 unused export(s):
  INTERNAL_ONLY src/codex-models.ts: CodexWindowSource

Filed as #5317.

The export came in with 062948078 (PR #5305, fix: honor codex's model_catalog_json when aligning windows). CodexWindowSource has exactly four occurrences and all of them are in the same file — the declaration at src/codex-models.ts:92 and three uses at :168/:177 — so it is INTERNAL_ONLY by construction. Dropping the keyword is the fix; no WAIVERS entry is warranted, because nothing outside the file ever imports it.

Change

One line, src/codex-models.ts:

-export type CodexWindowSource =
+type CodexWindowSource =

No behaviour change: the type is not in any public signature (all three uses are in alignedResult / its caller, both file-local).

Verification

gate result
node scripts/check-unused-exports.mjs ✓ unused-export gate: clean (6 waived), exit 0
negative control: restore the export same command exit 1, re-reports INTERNAL_ONLY src/codex-models.ts: CodexWindowSource — the assertion is not loosened
npx tsc --noEmit 0
tests/codex-models.test.ts + tests/codex-live-window.test.ts + tests/issue5243-codex-catalog-window.test.ts 27 pass / 0 fail
node scripts/lifecycle-ledger-guard.mjs OK (this branch is based on current master, so it inherits #5313's two unregistered names — #5314 fixes those separately)
node scripts/config-surface-guard.mjs OK
node scripts/check-test-import-graph.mjs ok: every test import of an unreachable module is whitelisted or labeled
node tools/gen-config-docs.mjs generate + git diff --exit-code exit 0
node tools/gen-config-docs.mjs check-coverage coverage ok: 193 env names + 59 top-level keys
npm run build exit 0, build-info: commit=23f6b9061, both dist gates OK

Note the lifecycle-ledger-guard line above: it is still red on this branch too, because #5314 has not landed yet. That is expected and independent — this PR deliberately does not bundle that fix.

Related

Closes #5317.

@ranxianglei ranxianglei changed the title fix(#5317): drop the internal-only CodexWindowSource export (master unused-exports gate) [PR] fix(#5317): drop the internal-only CodexWindowSource export (master unused-exports gate) Oct 31, 2026
@Louie0806

Copy link
Copy Markdown
Contributor Author

(ai: deepseek/deepseek-v41-flash)

Superseded by #5347.

#5347 fixes this same finding (INTERNAL_ONLY src/codex-models.ts: CodexWindowSource) and the two other inherited master-red gates that landed since — PackInstallOptions from #5340 and the lost chat-pack docs seed from #5319. All three are now green on #5347's head.

Keeping this open would mean two branches racing to demote the same line. Suggest closing this in favour of #5347 (or merging #5347 first — either order is conflict-free for this one line, but only #5347 also unblocks the other two gates).

Note for whoever merges #5276: it still carries the export type CodexWindowSource line against an older base and will need to drop it on rebase. This is already flagged in #5347 and #5318's original body.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 重复 #5347。 本 PR 的唯一改动(去掉 CodexWindowSource 的 export)被 #5347 完整包含——同症状(master 恒红的 unused-exports 必需门)、同机制(降掉 internal-only 导出)、同根因(#5305 合入时多给了一个文件内类型 export),且 #5347 是严格超集,还一并修了 PackInstallOptions 和 chat-pack 文档种子两处。以下结论全部经本地实测核对,不是转述。

标签: bug / scope/ci / p2 / duplicate(CI 必需门在 master 恒红、全体 merge master 的 PR 合并信号失效并实际钉住无关修复;产品功能本身不受影响,故 p2 不升 p1)。已打齐,关闭权在 owner,我未关闭。

实测证据(对照当前 master tip 485c5eaff 与各 PR head):

  1. master 上三处红全部仍在:src/codex-models.ts:92 仍是 export type CodexWindowSource;src/pack-install.ts:34 仍是 export interface PackInstallOptions(全仓仅本文件引用,确属 INTERNAL_ONLY);文档种子 website/config-reference/compress.yaml 的 builtin 只列 "default"/"lean" 两个,而 master 的 CONFIGURATION.md 已写三个(含 "chat")——生成器一跑就把文档改回去,docs-sync 必红。
  2. [PR] fix(ci): clear the three inherited master-red gates — two unused exports + the lost chat-pack seed #5347 head(e154f787f)正好基于当前 master tip,diff 仅 5 文件 10 行(两处去 export + 种子恢复 + 两份生成物),无无关改动。
  3. 在 [PR] fix(ci): clear the three inherited master-red gates — two unused exports + the lost chat-pack seed #5347 head 实跑两个门脚本:check-unused-exports.mjs → clean (6 waived)、exit 0;gen-config-docs.mjs generate → 零 diff、exit 0。「三项全绿」的说法成立。
  4. 本 PR head 的 diff 只有 1 文件 1 行(src/codex-models.ts),是 [PR] fix(ci): clear the three inherited master-red gates — two unused exports + the lost chat-pack seed #5347 对同一行的字节级子集——两个先后合并不冲突,但只有 [PR] fix(ci): clear the three inherited master-red gates — two unused exports + the lost chat-pack seed #5347 能一次清掉三道门。
  5. 对 [PR] fix: read Codex model_catalog_json so custom-catalog installs stop falling back to 272K (#5243) #5276 的附注也成立:其分支 2026-10-31_codex-model-catalog-window 上该行仍是 export type CodexWindowSource(该分支第 85 行),将来若 rebase 复用需一并去掉。

编号说明(防后续混淆):本线程引用的都是 GitHub 编号。本 PR 是 GitHub #5318(分支 2026-10-31_unused-export-codex-window),正文「Closes #5317」指的是 GitHub 侧的 unused-exports 发现 issue;镜像里的 #5317/#5318 是另外两个条目(lifecycle ledger 一族),与本 PR 无关。

结构化八问:

  1. 是什么问题:master 的 unused-exports 必需检查因一个文件内类型被误加 export 而恒红;本 PR 当初为修这一项而开,后来出现的 [PR] fix(ci): clear the three inherited master-red gates — two unused exports + the lost chat-pack seed #5347 把它连同另外两道同源的门一起修了。
  2. 什么原因导致的:[PR] fix(#5243): honor codex's model_catalog_json when aligning windows #5305 合入时给只在本文件使用的 CodexWindowSource 加了 export,此后每个 merge master 的分支都继承这道红。
  3. 影响范围与严重程度:产品用户无感;受影响的是仓库合并信号——所有继承 master 的 PR 在这几道门上恒红,reviewer 无法区分「自己弄坏」还是「master 本来就坏」,且已实际钉住无关的根治修复([PR] fix(openai-lane): name the compress tool in the draft-tail retry nudge #4785 一类)。能用但有明显问题、有绕行,判 p2。
  4. 怎么修复的:本轮未改代码,纯审核。修复收敛到超集 PR [PR] fix(ci): clear the three inherited master-red gates — two unused exports + the lost chat-pack seed #5347:把两个 internal-only 类型降回非导出(行为中性,零跨文件引用)+ 恢复文档生成器的 builtin 种子使文档回到不动点。
  5. 是否有回归问题:不涉及(本轮零代码改动)。[PR] fix(ci): clear the three inherited master-red gates — two unused exports + the lost chat-pack seed #5347 所含改动本身是行为中性的类型降级与文档种子恢复,无语义/阈值/时序漂移。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

收工判定:supersede 属实,#5322(镜像)/#5318(GitHub)已被 #5347 完整覆盖,建议优先合 #5347(一次清三道门)后把本条按 duplicate 关闭;若想避免双合并混淆,现在直接关本条也可以——两种顺序均已验证对该行无冲突。关不关由 owner 定。

@ranxianglei ranxianglei added bug Something isn't working duplicate This issue or pull request already exists p2 scope/ci labels Oct 31, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

关单说明:本 PR(去掉 src/codex-models.ts 的 CodexWindowSource 内部导出)与 #5327 撞同一行,#5327 已先并入 master(f9cec9f)并让 unused-exports gate 转绿,本 PR 重开后 diff 归零。—— 由 #5327 交付方代为关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working duplicate This issue or pull request already exists p2 scope/ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI unused-exports gate red on master: CodexWindowSource is exported but only used inside codex-models.ts

2 participants