refactor: prune dead code (ProgressBar, parseSize dup, unused MoEngine facade methods)#88
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
/pruneaudit of the repo. Headline: the codebase is clean — the enginefold (#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
ProgressBarview (b514d6e)Unreferenced SwiftUI
ViewinStatusView.swift— zero call sites anywhere(progress UI uses
IndeterminateBar/LowSpaceBar/ count-up heroes).2. Dedupe size-string parsing into
Fmt.parseSize(55c8be0)MoleClient.parseSizeandCleanList.parseSizewere near-identical 1024-basedparsers. Consolidated into one canonical
Fmt.parseSize(the inverse ofFmt.bytes); both keep their public names as thin forwarders, so all callsites 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:
OperationFlowtakes the streamingport via the exposed
MoEngine.shared.streamPort, and elevation runs throughMoleCLI.runElevatedClassified. They were exercised only byMoEngineTests.Removed them plus the now-orphaned
privilegeBrokerdependency and theMoLocator.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) andMoleCLITests("trusted lookup must never come from PATH"). Docs updated.Verification
swiftc -parse; zero dangling refs to removed symbols.on CI to run the gate.
No behavior change intended.