Skip to content

refactor(deadcode): localize core helpers#101869

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/deadcode-all-surfaces-20260707-v52
Jul 7, 2026
Merged

refactor(deadcode): localize core helpers#101869
vincentkoc merged 1 commit into
mainfrom
refactor/deadcode-all-surfaces-20260707-v52

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Internal core helpers remained exported even though no code outside their defining modules referenced them. Those unnecessary exports expand module APIs and make dead-code analysis less precise.

Why This Change Was Made

Localize 99 functions across 79 core modules after a fresh codebase-memory graph index and repository-wide reference audit.

Each changed symbol:

  • still has at least one local caller
  • has zero external JavaScript or TypeScript references
  • is not exposed through a wildcard re-export
  • is not part of a package entry surface

The formatter also compacted ten declarations, leaving the production diff at net -10 lines.

User Impact

None. Runtime behavior is unchanged; this only narrows internal module surfaces.

Evidence

  • codebase-memory graph: 21,039 files, 281,257 nodes, 1,133,831 edges, zero extraction errors
  • exact committed-state audit: 99 private functions across 79 files, local callers, zero external code references
  • git diff --check
  • Testbox tbx_01kwz049syz11bmqsfhw9gx148: pnpm check:changed passed
  • 31 direct non-gateway test files: 419 tests passed across 10 Vitest shards
  • 9 direct gateway test files: 1,007 tests passed across 23 project files
  • src/gateway/model-pricing-cache.test.ts: 75 tests passed twice in isolated reruns
  • broad pnpm test:changed completed its earlier shards but the gateway shard hit the repository's 15-minute no-output retry path; the retry exposed one project-order-sensitive pricing-cache assertion and then repeated the teardown stall. The affected test passed twice in isolation.
  • autoreview local: clean, confidence 0.93
  • autoreview branch: clean, confidence 0.82

No transcript is attached.

@vincentkoc vincentkoc self-assigned this Jul 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Jul 7, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Land-ready.

What changed:

  • localized 99 core helpers across 79 modules
  • verified every helper retains local callers and has zero external code references
  • verified no wildcard re-export or package entry surfaces expose the removed exports
  • final diff: 99 additions, 109 deletions, net -10 lines

Validation:

  • codebase-memory index: 21,039 files, 281,257 nodes, 1,133,831 edges, zero extraction errors
  • git diff --check
  • Testbox tbx_01kwz049syz11bmqsfhw9gx148: pnpm check:changed passed
  • 31 non-gateway direct test files: 419 tests passed
  • 9 gateway direct test files: 1,007 tests passed
  • pricing-cache isolated repro: 75 tests passed twice
  • autoreview local: clean at 0.93
  • autoreview branch: clean at 0.82
  • repo-native scripts/pr prepare-run 101869: exact hosted CI/Testbox gates passed

Proof gap:

  • broad pnpm test:changed hit the gateway shard's 15-minute no-output retry path. Its retry exposed one project-order-sensitive pricing-cache assertion before repeating the teardown stall. The affected direct suite and isolated test both passed, including two 75-test isolated reruns.

No docs or changelog update is required because runtime behavior is unchanged.

@vincentkoc
vincentkoc marked this pull request as ready for review July 7, 2026 20:16
@vincentkoc
vincentkoc requested a review from a team as a code owner July 7, 2026 20:16
@vincentkoc
vincentkoc merged commit f565138 into main Jul 7, 2026
143 of 148 checks passed
@vincentkoc
vincentkoc deleted the refactor/deadcode-all-surfaces-20260707-v52 branch July 7, 2026 20:17
@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(deadcode): localize core helpers This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

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

Labels

agents Agent runtime and tooling app: web-ui App: web-ui cli CLI command changes commands Command implementations gateway Gateway runtime maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant