Skip to content

chore: remove confirmed dead code (−755 lines)#126

Merged
fshehadeh-sfl merged 3 commits into
mainfrom
chore/dead-code-cleanup
Jul 22, 2026
Merged

chore: remove confirmed dead code (−755 lines)#126
fshehadeh-sfl merged 3 commits into
mainfrom
chore/dead-code-cleanup

Conversation

@fshehadeh-sfl

Copy link
Copy Markdown
Collaborator

Summary

Dead code audit pass — removes everything verified to have zero callers/importers anywhere in the repo. All items were confirmed by full-repo grep before removal.

Changes

Unused devDependencies (commit 1)

Package Reason
@fontsource/material-icons Never @imported in any CSS file
@material-icons/svg No import in src, tests, or scripts
simple-icons No import anywhere

Dead code (commit 2)

src/admin/

  • defaultSkillSources.ts deleted — PRELOADED_PROJECT_SKILL_SOURCE / preloadedProjectSkillSources() had zero importers
  • ui/api.ts: removed generateSshKey() (superseded by generateSshKeyPair()) and getSshPublicKey() (no callers)

src/review/

  • copilotReviewAgent.ts deleted — CopilotReviewAgent was never instantiated in production; all reviews run via Docker REVIEW_MODE=1; docs already labelled it "legacy, unused"
  • ReviewAgent interface removed from reviewOrchestrator.ts (only existed to be implemented by the deleted class)

src/orchestrator/orchestrator.ts

  • handleGerritEvent() removed — one-line alias for handleReviewEvent(); 4 test call sites updated
  • Unreachable else { vcsConnector.push(...) } branch in pushProjectChanges removed — all three VCS connectors (GerritVcsConnector, GitHubVcsConnector, GitLabVcsConnector) implement pushDirect, so the non-pushDirect path was dead; replaced with a guard throw
  • appendTicketFooter() and buildTicketFooter() private methods removed (only consumed by the dead else-branch)
  • hasTicketFooter dropped from import; ticketUrl parameter removed from pushProjectChanges (only fed the deleted methods)

src/bootstrap/runtimeBuilder.ts

  • export dropped from getActiveIntegrationsByType and getPrimaryActiveIntegration — zero external callers; functions stay as module-private helpers

src/plugins/registry.ts

  • export dropped from getProviderTechnicalCapabilities — only called by getPluginCapabilities in the same file

Tests cleaned up

  • tests/unit/copilotReviewAgent.test.ts deleted (tests the deleted class)
  • Dead CopilotReviewAgent mock removed from runtimeBootstrap.test.ts
  • Two dead describe blocks removed from orchestratorCommitMessage.test.ts (tested the deleted private methods; logic is already covered by ticketFooterFormatter.test.ts)
  • 4 handleGerritEventhandleReviewEvent call site updates in orchestrator.test.ts

Stats

12 files changed, 13 insertions(+), 755 deletions(-)

Gates

npm test       ✓  137 files, 2129 tests
npm run typecheck  ✓  zero errors
npm run lint   ✓  zero errors

Copilot AI review requested due to automatic review settings July 21, 2026 17:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes verified dead code and unused devDependencies across the orchestrator, review flow, admin UI API client, and plugin/runtime helpers to reduce maintenance surface area and keep runtime paths aligned with the Docker-based review execution model.

Changes:

  • Deleted legacy/unused review agent implementation (CopilotReviewAgent) and related tests/mocks/types.
  • Removed dead orchestration helpers/branches (e.g., handleGerritEvent alias and unreachable non-pushDirect push path) and adjusted tests accordingly.
  • Dropped unused admin UI API functions and a no-longer-used default skill source module; removed unused devDependencies.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unit/runtimeBootstrap.test.ts Removes mocks/exports for deleted CopilotReviewAgent.
tests/unit/orchestratorCommitMessage.test.ts Removes tests for deleted private footer helpers; narrows file to commit message tests.
tests/unit/orchestrator.test.ts Updates call sites from handleGerritEvent to handleReviewEvent.
tests/unit/copilotReviewAgent.test.ts Deletes tests for the removed legacy review agent.
src/review/reviewOrchestrator.ts Removes the legacy ReviewAgent interface formerly used only by CopilotReviewAgent.
src/review/copilotReviewAgent.ts Deletes the legacy host-side Copilot SDK review agent implementation.
src/plugins/registry.ts Makes getProviderTechnicalCapabilities module-private (internal helper).
src/orchestrator/orchestrator.ts Removes dead alias/methods and unreachable push branch; enforces pushDirect usage and removes now-unused footer helpers.
src/bootstrap/runtimeBuilder.ts Makes integration helper functions module-private (no external callers).
src/admin/ui/api.ts Removes unused SSH key API helpers superseded by generateSshKeyPair().
src/admin/defaultSkillSources.ts Deletes unused preloaded project skill source constants/helpers.
package.json Removes unused devDependencies (@fontsource/material-icons, @material-icons/svg, simple-icons).

Remove @fontsource/material-icons, @material-icons/svg, and
simple-icons — none are imported anywhere in src/, tests/, or
CSS. Verified by full-repo grep before removal.
admin
- Delete defaultSkillSources.ts (PRELOADED_PROJECT_SKILL_SOURCE /
  preloadedProjectSkillSources — zero importers)
- Drop generateSshKey() and getSshPublicKey() from ui/api.ts
  (superseded by generateSshKeyPair; no callers)

review
- Delete CopilotReviewAgent class + its test file; the class was
  never instantiated in production (all reviews run via Docker
  REVIEW_MODE=1); docs already called it 'legacy, unused'
- Remove the ReviewAgent interface from reviewOrchestrator.ts
  (only existed to be implemented by the deleted class)
- Clean dead CopilotReviewAgent mock from runtimeBootstrap.test.ts

orchestrator
- Remove handleGerritEvent() — Gerrit-named alias for
  handleReviewEvent(); update 4 test call sites
- Remove unreachable else-branch in pushProjectChanges: all three
  VCS connectors implement pushDirect, making vcsConnector.push()
  path dead; replace with an explicit guard throw
- Remove appendTicketFooter() and buildTicketFooter() private
  methods (only consumed by the dead else-branch)
- Drop hasTicketFooter from the ticketFooterFormatter import and
  the now-unused ticketUrl parameter from pushProjectChanges
- Remove the two dead test describe blocks from
  orchestratorCommitMessage.test.ts (same logic covered by
  ticketFooterFormatter.test.ts)

plugins / bootstrap
- Drop export from getActiveIntegrationsByType and
  getPrimaryActiveIntegration in runtimeBuilder.ts (zero external
  callers; functions remain as module-private helpers)
- Drop export from getProviderTechnicalCapabilities in registry.ts
  (only called by getPluginCapabilities in the same file)

All gates pass: npm test (2129), typecheck, lint.
Copilot AI review requested due to automatic review settings July 22, 2026 19:49
@fshehadeh-sfl
fshehadeh-sfl force-pushed the chore/dead-code-cleanup branch from bd492c2 to 633e3d9 Compare July 22, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment thread package.json
Comment thread src/review/reviewOrchestrator.ts
Address Copilot review comments on PR #126:
- Remove copilotReviewAgent.ts / ReviewAgent references from
  .github/copilot-instructions.md, .github/context/architecture.md,
  .github/context/testing.md, docs/ARCHITECTURE.md (file deleted in
  the prior refactor commit).
- Regenerate package-lock.json after dropping @fontsource/material-icons,
  @material-icons/svg, and simple-icons devDependencies so npm ci stays
  consistent with package.json.
Copilot AI review requested due to automatic review settings July 22, 2026 19:58
@fshehadeh-sfl
fshehadeh-sfl merged commit be16b18 into main Jul 22, 2026
4 checks passed
@fshehadeh-sfl
fshehadeh-sfl deleted the chore/dead-code-cleanup branch July 22, 2026 20:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Comment on lines 1533 to +1538
const subjectHash = createHash("sha1").update(fallbackCommitMessage.split("\n")[0] ?? "").digest("hex");

let pushResult;
if (vcsConnector.pushDirect) {
pushResult = await vcsConnector.pushDirect(handle.hostWorkspacePath, ref, topic, volumeOpts);
} else {
pushResult = await vcsConnector.push(handle.hostWorkspacePath, ref, commitMsg, undefined, volumeOpts);
if (!vcsConnector.pushDirect) {
throw new Error(`VCS connector for ${reviewSystemLabel} does not implement pushDirect`);
}
const pushResult = await vcsConnector.pushDirect(handle.hostWorkspacePath, ref, topic, volumeOpts);
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.

2 participants