Skip to content

Dead code: remove unused helper modules#38318

Merged
vincentkoc merged 4 commits intomainfrom
vincentkoc-code/deadcode-remove-unused-files
Mar 6, 2026
Merged

Dead code: remove unused helper modules#38318
vincentkoc merged 4 commits intomainfrom
vincentkoc-code/deadcode-remove-unused-files

Conversation

@vincentkoc
Copy link
Copy Markdown
Member

Summary

  • Problem: Knip still reported a set of unused files after the config landed on main.
  • Why it matters: these fully unreferenced helper modules add maintenance surface and distract from the remaining, harder dead-code triage.
  • What changed: removed three helper modules with no non-self references in the repo.
  • What did NOT change (scope boundary): no channel adapter removals, no runtime behavior changes in referenced code paths, and no dependency manifest cleanup.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

None.

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: pnpm / Node 22 workspace
  • Model/provider: N/A
  • Integration/channel (if any): N/A
  • Relevant config (redacted): none

Steps

  1. Run pnpm deadcode:knip on main after the Knip config lands.
  2. Confirm src/config/runtime-group-policy-provider.ts, src/infra/env-file.ts, and src/secrets/auth-store-paths.ts are still reported as unused.
  3. Remove them and rerun Knip.

Expected

  • The unused-file count drops by three with no new dependency findings.

Actual

  • Knip dropped from 27 unused files to 24 on this branch.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: searched for non-self references to each removed file before deletion; reran pnpm deadcode:knip after deletion.
  • Edge cases checked: kept all borderline files (channel outbound adapters, media host/server, UI data) out of this PR.
  • What you did not verify: full repo build/test matrix.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert the three deletion commits.
  • Files/config to restore: src/config/runtime-group-policy-provider.ts, src/infra/env-file.ts, src/secrets/auth-store-paths.ts.
  • Known bad symptoms reviewers should watch for: missing imports from these modules during build or test, which would indicate a hidden dynamic reference.

Risks and Mitigations

  • Risk: a hidden string-based or generated reference could still exist.
    • Mitigation: each deleted file was checked for repo references before removal, and the remaining dead-file set was intentionally left untouched when it looked less certain.

@vincentkoc vincentkoc self-assigned this Mar 6, 2026
@openclaw-barnacle openclaw-barnacle bot added size: S maintainer Maintainer-authored PR labels Mar 6, 2026
@vincentkoc vincentkoc marked this pull request as ready for review March 6, 2026 21:52
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 6, 2026

Greptile Summary

This PR removes three dead-code TypeScript helper modules — src/config/runtime-group-policy-provider.ts, src/infra/env-file.ts, and src/secrets/auth-store-paths.ts — that were identified as fully unreferenced by Knip and confirmed via manual grep searches. No runtime behavior is affected, and no referenced code paths are touched.

  • Verified no imports or string-based references to any of the three deleted files exist anywhere in the repository.
  • upsertSharedEnvVar, resolveProviderRuntimeGroupPolicy, and collectAuthStorePaths are each exported but never consumed outside their own file.
  • The removal is clean with no side-effects; the Knip unused-file count drops from 27 to 24.

Confidence Score: 5/5

  • This PR is safe to merge — it is a pure dead-code deletion with no runtime impact.
  • All three removed files are confirmed to have zero non-self references in the repository (no static imports, no dynamic requires, no string-based paths). The exported symbols are unused across the entire codebase, and the change has no effect on any running code path.
  • No files require special attention.

Last reviewed commit: 1962d2c

@vincentkoc vincentkoc merged commit 455430a into main Mar 6, 2026
29 of 30 checks passed
@vincentkoc vincentkoc deleted the vincentkoc-code/deadcode-remove-unused-files branch March 6, 2026 22:53
vincentkoc added a commit to BryanTegomoh/openclaw-fork that referenced this pull request Mar 8, 2026
* Dead code: remove unused provider runtime policy helper

* Dead code: remove unused shared env writer

* Dead code: remove unused auth store path collector
Saitop pushed a commit to NomiciAI/openclaw that referenced this pull request Mar 8, 2026
* Dead code: remove unused provider runtime policy helper

* Dead code: remove unused shared env writer

* Dead code: remove unused auth store path collector
jenawant pushed a commit to jenawant/openclaw that referenced this pull request Mar 10, 2026
* Dead code: remove unused provider runtime policy helper

* Dead code: remove unused shared env writer

* Dead code: remove unused auth store path collector
dhoman pushed a commit to dhoman/chrono-claw that referenced this pull request Mar 11, 2026
* Dead code: remove unused provider runtime policy helper

* Dead code: remove unused shared env writer

* Dead code: remove unused auth store path collector
senw-developers pushed a commit to senw-developers/va-openclaw that referenced this pull request Mar 17, 2026
* Dead code: remove unused provider runtime policy helper

* Dead code: remove unused shared env writer

* Dead code: remove unused auth store path collector
V-Gutierrez pushed a commit to V-Gutierrez/openclaw-vendor that referenced this pull request Mar 17, 2026
* Dead code: remove unused provider runtime policy helper

* Dead code: remove unused shared env writer

* Dead code: remove unused auth store path collector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant