Repository navigation
refactor: drop dead declarations + demote internal-only exports + unused-export gate (#1440) - #1443
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2398-pr.1443.846d640This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1443.tgz
npm install -g packageInstall instructions are refreshed on each push. |
62f20dd to
2cdbaa6
Compare
The gate commit accidentally re-indented a pre-existing line in the version-guard job (10 -> 11 leading spaces). Functionally inert, but it muddied the diff; restore the original bytes so ci.yml changes are purely additive.
[bot] 🏷 Review complete — mergeable (human merge required per §7.4; see below). Full verification against rebased head, including a force-push that landed mid-review (old head ① Direction (original issue #1440)Batch 1 targets #1440's P4 (dead code) + P6 (export-bloat root cause). The direction is right: removing the 8 dead declarations fixes the instances, and the new mechanical gate attacks the producer of future bloat rather than masking symptoms — root-cause, not symptom (§7.3). Verified the audit's claims independently rather than trusting them:
② Regression review (existing-behavior ledger)
Behavior-change disclosure (Deliverables #4): empirical build comparison, master vs PR head, all 15 dist bundles: 14 have byte-identical named-export sets; the single delta is ③ Code review (gate script,
|
…s; re-export symbols master now consumes (AffinitySnapshotEntry, UpstreamFailureKind)
…esh #1440 pass) Regenerates PR #1443's batch-1 against current master (d1d24ba): the original branch became unrebasable after master evolved (kernel/ vendored in-repo and 15 conflicted files). Fresh textual gate run: 269 findings — 14 DEAD declarations deleted (incl. test seams with no remaining consumer) and 255 INTERNAL_ONLY symbols demoted by stripping the export keyword. No behavioral change; tsc/build/focused e2e suites green.
Ports the gate from PR #1443 to current master: npm script check:unused-exports plus a zero-dep CI job. Adapted since the original: scans exclude kernel/ (its own package with its own suite and human-gated boundary) and the entry list gains src/agent/dsh-native-client.ts to match the second tsup.config.ts entry.
a44609e to
e89a4bb
Compare
…esh #1440 pass) Regenerates PR #1443's batch-1 against current master (d1d24ba): the original branch became unrebasable after master evolved (kernel/ vendored in-repo and 15 conflicted files). Fresh textual gate run: 269 findings — 14 DEAD declarations deleted (incl. test seams with no remaining consumer) and 255 INTERNAL_ONLY symbols demoted by stripping the export keyword. No behavioral change; tsc/build/focused e2e suites green.
e89a4bb to
ec30f04
Compare
Ports the gate from PR #1443 to current master: npm script check:unused-exports plus a zero-dep CI job. Adapted since the original: scans exclude kernel/ (its own package with its own suite and human-gated boundary) and the entry list gains src/agent/dsh-native-client.ts to match the second tsup.config.ts entry.
…esh #1440 pass) Regenerates PR #1443's batch-1 against current master (d1d24ba): the original branch became unrebasable after master evolved (kernel/ vendored in-repo and 15 conflicted files). Fresh textual gate run: 269 findings — 14 DEAD declarations deleted (incl. test seams with no remaining consumer) and 255 INTERNAL_ONLY symbols demoted by stripping the export keyword. No behavioral change; tsc/build/focused e2e suites green.
Ports the gate from PR #1443 to current master: npm script check:unused-exports plus a zero-dep CI job. Adapted since the original: scans exclude kernel/ (its own package with its own suite and human-gated boundary) and the entry list gains src/agent/dsh-native-client.ts to match the second tsup.config.ts entry.
ec30f04 to
253bbfa
Compare
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.94-master.0be9e83 # this exact build
npm install -g billion-context@master # always the newest merged build
|
…ate) Labeled in-passing fix found while reviewing #2303: the new unused-exports gate (master-only, post-#1443) flags src/launcher.ts codexRewriteInsertionIndex as INTERNAL_ONLY on current master itself, which kept every rebased PR red. All references are file-local (call site + doc comment); dropping the export keyword is behavior-neutral.
…dex (#1443 residue) In-passing gate fix during #2307 review: the unused-export check fails on master itself (INTERNAL_ONLY src/launcher.ts: codexRewriteInsertionIndex), blocking every PR's unused-exports job. The function is used only inside launcher.ts (:980); the export keyword is dead surface left by the #1443 cleanup pass. One-word removal; no behavior, wire, or cache impact.
v2 note (2026-10-06) — regenerated on current master (
d1d24ba6).This branch had drifted 727 commits behind master with conflicts across 15 files, so instead of force-resolving the stale hunks I re-ran the same pass fresh: used this PR's own gate (
scripts/check-unused-exports.mjs) to flag today's tree, then applied every verdict — 14 DEAD declarations deleted, 255 INTERNAL_ONLY exports demoted (87 files, +358/−352). Two deliberate gate adaptations for post-kernel-vendor master: (1) the scan corpus excludeskernel/**(vendored package behind the human-gated kernel boundary — unscoped it would flag 22 findings there); (2)ENTRY_FILESgainssrc/agent/dsh-native-client.ts(second tsup entry since #1590). Every deleted/export-stripped symbol was verified zero-reference repo-wide (rg -w, including docs/ and hermes-plugin/) before removal. Local verification: gate clean,tsc --noEmitclean, tsup build OK, focused suites green (wire-contract / web-sessions / dsh-settings-ui / advisory-parity, 41/41); full matrix delegated to CI. One judgment call flagged for review:Localein src/web/i18n.ts is demoted — reference/architecture.md mentions it in prose description only, not as an API-surface nomination (and the gate has no exemption list, so leaving it exported keeps CI red).Rebuild v3 (new base
9f82bbed) — 2026-10-07Master moved 15 commits after this branch's original base; rebuilt on top of
9f82bbed(clean cherry-pick of both commits):ensureCanonicalIdkept exported. Master commit 4884498 (post-rebuild usage estimate inflates ~3.4x after a big fold, firing an EMERGENCY T1 nudge into an over-budget context #1820) re-added an import-only reference to it insrc/server.tsafter our base; dropping the declaration broke the merge-ref typecheck (TS2305, two CI lanes). It is restored verbatim from upstream text (still no call site upstream — once they drop the dead import, a future pass of this gate removes the declaration itself).noteCompressLoopFailure,clearCompressLoopStreak(src/stream.ts, both referenced only within that file).tsc --noEmitclean, tsup build OK, focused suites 48/48 (incl. issue2146-compress-loop-breaker). One e2e lane (native-opencode) hit an unrelated port-race flake (assertPortDead … squatted between freePort() and use (#1689)); rerun issued.Rebuild v4 (
253bbfa1) — lane-guard (#2170) compliancelane-guardjob (side-lane test discipline, dsh 回归防护:泳道判定真值表 + 侧请求不变量 + dsh e2e lane + 运行时金丝雀 + lane-guard(5 项) #2170) fails on ANY hunk insrc/server/side-request.tsunless a pinned side-lane suite moves with it. This pass had demoted three type-exports there; those three demotions are reverted (exports restored verbatim, diff vs master now zero for that file) — churning truth-table-pinned suites purely for export hygiene is exactly what the guard exists to prevent.WAIVERSlist (file → symbols, each with its reason written right there) so those three exports stay waived by documented decision instead of being re-demoted in a future pass. Waivers print as~ waived …lines on every run. Paired fix: the scanner no longer counts self-references (naming a symbol inside the gate script itself previously counted as "used", which would have masked any waiver). Detection sanity-checked: removing one waiver entry makes the gate fail as expected.