Skip to content

refactor: prune dead code (ProgressBar, parseSize dup, unused MoEngine facade methods)#88

Merged
caezium merged 3 commits into
mainfrom
prune/dead-code-cleanup
Jun 17, 2026
Merged

refactor: prune dead code (ProgressBar, parseSize dup, unused MoEngine facade methods)#88
caezium merged 3 commits into
mainfrom
prune/dead-code-cleanup

Conversation

@caezium

@caezium caezium commented Jun 17, 2026

Copy link
Copy Markdown
Owner

A /prune audit of the repo. Headline: the codebase is clean — the engine
fold (#48/#71) left almost nothing behind, no unused deps, no dead files. This
PR removes the only three confirmed findings. −104 net lines, 6 files.

1. Remove dead ProgressBar view (b514d6e)

Unreferenced SwiftUI View in StatusView.swift — zero call sites anywhere
(progress UI uses IndeterminateBar / LowSpaceBar / count-up heroes).

2. Dedupe size-string parsing into Fmt.parseSize (55c8be0)

MoleClient.parseSize and CleanList.parseSize were near-identical 1024-based
parsers. Consolidated into one canonical Fmt.parseSize (the inverse of
Fmt.bytes); both keep their public names as thin forwarders, so all call
sites and both test suites are unchanged
. The canonical is the superset
(raw-number fallback), so every existing assertion still holds.

3. Drop unused MoEngine.stream() / runElevatedClassified() (8e15bfc)

Both facade methods were production-unused: OperationFlow takes the streaming
port via the exposed MoEngine.shared.streamPort, and elevation runs through
MoleCLI.runElevatedClassified. They were exercised only by MoEngineTests.
Removed them plus the now-orphaned privilegeBroker dependency and the
MoLocator.locateTrusted() seam they alone used — no new dead code left behind.
The 3 deleted elevation tests are fully covered against the production path
by PrivilegeBrokerTests (launchFailed / authCancelled / exited) and
MoleCLITests ("trusted lookup must never come from PATH"). Docs updated.

Verification

  • Adversarial multi-agent review (behavior, compile/strand, coverage): green.
  • All changed files pass swiftc -parse; zero dangling refs to removed symbols.
  • ⚠️ Build + full test suite not run locally (disk/sandbox limits) — relying
    on CI to run the gate.

No behavior change intended.

caezium added 3 commits June 17, 2026 02:30
Unreferenced SwiftUI view in StatusView.swift — zero call sites across Sources/Tests/Resources (progress UI uses IndeterminateBar / LowSpaceBar / count-up heroes). Surfaced by a /prune audit.
MoleClient.parseSize and CleanList.parseSize were near-identical 1024-based size-string parsers. Consolidate into one canonical Fmt.parseSize (the inverse of Fmt.bytes); both keep their public names as thin forwarders, so all call sites and the MoleClient/CleanList test suites are unchanged. The canonical is the superset (raw-number fallback), so every existing assertion still holds. Surfaced by a /prune audit.
Both facade methods were unused in production: OperationFlow takes the streaming port via the exposed MoEngine.shared.streamPort, and elevation runs through MoleCLI.runElevatedClassified (SettingsView) — they were exercised only by MoEngineTests. Remove them, plus the now-orphaned privilegeBroker dependency and the MoLocator.locateTrusted() seam they alone used, so no new dead code is left behind. The three deleted MoEngine elevation tests are fully covered against the production path by PrivilegeBrokerTests (.launchFailed / authCancelled / exited) and MoleCLITests (trustedExecutable never resolves from PATH). Header/docs updated to match. Surfaced by a /prune audit.
@caezium caezium merged commit 385b642 into main Jun 17, 2026
1 check passed
@caezium caezium deleted the prune/dead-code-cleanup branch June 17, 2026 09:44
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.

1 participant