Skip to content

refactor(macos): delete orphaned OpenClaw* directories from RemoteClawKit (16 git-tracked files, dead code) #2622

@alexey-pelykh

Description

@alexey-pelykh

Problem

apps/shared/RemoteClawKit/ contains three legacy OpenClaw* directories that parallel the active RemoteClaw* directories. The legacy dirs are dead code: they are NOT declared in Package.swift and NOT imported by any Swift target.

Legacy (delete) Active (keep) Files in legacy
Sources/OpenClawKit/ Sources/RemoteClawKit/ (58 files) 8
Sources/OpenClawChatUI/ Sources/RemoteClawChatUI/ (16 files) 7
Tests/OpenClawKitTests/ Tests/RemoteClawKitTests/ (20 files) 7

Total: 16 git-tracked files in 3 dirs to delete.

Evidence

apps/shared/RemoteClawKit/Package.swift declares targets:

  • RemoteClawProtocolSources/RemoteClawProtocol
  • RemoteClawKitSources/RemoteClawKit
  • RemoteClawChatUISources/RemoteClawChatUI
  • RemoteClawKitTestsTests/RemoteClawKitTests

No declaration references OpenClawKit, OpenClawChatUI, or OpenClawKitTests.

apps/macos/Package.swift likewise references only RemoteClawKit/RemoteClawChatUI/RemoteClawProtocol targets.

# Reproduce zero-import claim:
grep -rln "import OpenClawKit\|import OpenClawChatUI\|@testable import OpenClawKit\|@testable import OpenClawChatUI" apps/ scripts/ src/ ui/ docs/ 2>/dev/null | wc -l
# Expected: 0

Likely origin

Partial-rename leftover from the macOS native-app rebrand work (PR #124 / #222 era). The new dirs were created and Package.swift updated; the old dirs were left in place but excluded from the build manifest.

This was surfaced indirectly via:

  • A REBRAND_LEAKAGE finding that flagged apps/shared/RemoteClawKit/Sources/OpenClawKit/GatewayNodeSession.swift as containing openclaw markers (the file is dead code; markers are stale rebrand state inside an orphaned dir)
  • The remediation PR ci(rebrand): clean up 61 REBRAND_LEAKAGE entries from v2026.3.22 audit #2621 fixed the markers in the dead file rather than deleting it (the right fix)

Proposed work

git rm -r apps/shared/RemoteClawKit/Sources/OpenClawKit
git rm -r apps/shared/RemoteClawKit/Sources/OpenClawChatUI
git rm -r apps/shared/RemoteClawKit/Tests/OpenClawKitTests

Then verify:

cd apps/shared/RemoteClawKit && swift build && swift test
cd ../../macos && swift build

Acceptance criteria

  • All 16 git-tracked files under the three legacy dirs deleted
  • apps/shared/RemoteClawKit/Package.swift unchanged (was already correct)
  • cd apps/shared/RemoteClawKit && swift build succeeds
  • cd apps/shared/RemoteClawKit && swift test succeeds
  • cd apps/macos && swift build succeeds (downstream consumer)
  • bash scripts/ci/check-rebrand-leakage.sh --all exits 0
  • find apps -name '*OpenClaw*' -not -path '*/.build/*' returns only the 2 Kotlin protocol files (intentional retain — see Out of Scope)

Out of scope

  • apps/android/.../protocol/OpenClawProtocolConstants.kt and its test — these are intentional cross-implementation protocol-name retention (Android channel uses upstream's wire-protocol naming for compat). Address separately if at all.
  • The OpenClaw_OpenClaw.bundle and similar artifacts under .build/ — build cache, not source.

Estimated effort

~30 minutes (delete + 2 swift builds + 1 swift test).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions