Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cb23fe3
feat(app): solid canvas and calmer motion
Finjineersdev Nov 20, 2026
064b80e
fix(app): steady accessibility audit on Dev Stack
Finjineersdev Nov 20, 2026
ffc1c06
feat(app): switches for the character and automatic update checks
Finjineersdev Nov 20, 2026
3520a0c
feat(engine): flag sizes that share space with files elsewhere (F8)
Finjineersdev Nov 20, 2026
ecb4a4e
feat(app): move through projects and tick folders from the keyboard
Finjineersdev Nov 20, 2026
8609694
fix(app): show paths under HOME with ~, as the engine sees them
Finjineersdev Nov 20, 2026
4df5191
docs: README screenshots in light and dark
Finjineersdev Nov 20, 2026
c886aff
feat(app): cache map on the Caches screen
Finjineersdev Nov 20, 2026
3c21665
feat(app): space flow on Overview; wider layout
Finjineersdev Nov 20, 2026
86a3bd1
fix(engine): harden against hostile repositories and planted stores
Finjineersdev Nov 20, 2026
38aa68e
fix(app): no engine override in Release; no pasteable payloads
Finjineersdev Nov 20, 2026
1da64d5
refactor(engine): one copy of the date code; lsof never blocks on a s…
Finjineersdev Nov 20, 2026
631ba46
fix(app): non-blocking process runner, honest errors, dead code removed
Finjineersdev Nov 20, 2026
cd7899d
fix(guard): move and restore through open folder handles
Finjineersdev Nov 20, 2026
4123b0f
fix(caches): stop a timed-out tool together with its helpers
Finjineersdev Nov 20, 2026
a12ec4e
feat(engine): report folders macOS privacy protection refuses
Finjineersdev Nov 20, 2026
569e2d8
ci: audit engine dependencies on every change and weekly
Finjineersdev Nov 20, 2026
6c3171d
ci(release): run in an approved environment; protect v* tags
Finjineersdev Nov 20, 2026
de9933b
fix(app): label the free-older-runs menu for VoiceOver on macOS 15
Finjineersdev Nov 21, 2026
6c3a9d1
test(ui): a named menu passes the description audit on macOS 15
Finjineersdev Nov 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/engine-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ permissions:
contents: read

jobs:
audit:
# A new RustSec advisory fails here even when no code changed.
runs-on: ubuntu-latest
defaults:
run:
working-directory: engine
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install cargo-audit
run: cargo install --locked cargo-audit@0.23.0
- name: Audit
run: cargo audit --deny warnings

fuzz:
runs-on: ubuntu-latest
timeout-minutes: 45
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ concurrency:
cancel-in-progress: true

jobs:
audit:
# Known vulnerabilities in the engine's dependencies (RustSec). Also
# runs weekly from engine-nightly, so a new advisory is seen without a push.
runs-on: ubuntu-latest
defaults:
run:
working-directory: engine
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install cargo-audit
run: cargo install --locked cargo-audit@0.23.0
- name: Audit
run: cargo audit --deny warnings

check:
strategy:
fail-fast: false
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
dmg:
name: Build, sign, notarize and publish
runs-on: macos-26
# Waits for the owner's approval; the signing secrets live only in this
# environment, so no other workflow or branch can read them.
environment: release
env:
VERSION: ${{ github.ref_name }}
HAS_CERT: ${{ secrets.MACOS_CERT_P12 != '' }}
Expand Down Expand Up @@ -61,7 +64,7 @@ jobs:
security set-keychain-settings -lut 21600 "$KEYCHAIN"
security unlock-keychain -p "$PASS" "$KEYCHAIN"
echo "$P12" | base64 --decode > "$RUNNER_TEMP/cert.p12"
security import "$RUNNER_TEMP/cert.p12" -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN"
security import "$RUNNER_TEMP/cert.p12" -P "$P12_PASSWORD" -T /usr/bin/codesign -t cert -f pkcs12 -k "$KEYCHAIN"
rm "$RUNNER_TEMP/cert.p12"
security set-key-partition-list -S apple-tool:,apple: -s -k "$PASS" "$KEYCHAIN"
security list-keychain -d user -s "$KEYCHAIN" login.keychain-db
Expand Down Expand Up @@ -113,6 +116,12 @@ jobs:
codesign --sign "$SIGN_IDENTITY" --timestamp "dist/OpenSweep-$V.dmg"
fi

# Nothing after this signs, so the key leaves before any later step
# (notarization, the SBOM and release actions) runs.
- name: Remove the signing keychain
if: always() && env.HAS_CERT == 'true'
run: security delete-keychain "$RUNNER_TEMP/build.keychain-db" || true

- name: Notarize and staple
if: env.HAS_CERT == 'true'
env:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ xcodebuild -project OpenSweep.xcodeproj -scheme OpenSweep -configuration Debug \
```

Xcode 16 or later; macOS 14 or later to run. The app finds its engine at
`Contents/Helpers/opensweep`; set `OPENSWEEP_BIN` to use another binary
`Contents/Helpers/opensweep`; in Debug builds, set `OPENSWEEP_BIN` to use another binary
while developing.

## Layout
Expand Down
2 changes: 1 addition & 1 deletion CleanCore/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let package = Package(
),
.testTarget(
name: "AgentEngineTests",
dependencies: ["AgentEngine"],
dependencies: ["AgentEngine", "CleanCore"],
path: "Tests/AgentEngineTests",
swiftSettings: [.swiftLanguageMode(.v6)]
),
Expand Down
12 changes: 9 additions & 3 deletions CleanCore/Sources/AgentEngine/Engine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,16 @@ public struct Engine: Sendable {
return AsyncThrowingStream { continuation in
let process: Process
let exit: AsyncStream<Int32>
let out = Pipe()
let out = Pipe(), err = Pipe()
do {
(process, exit) = try launch(args, stdout: out)
(process, exit) = try launch(args, stdout: out, stderr: err)
} catch {
continuation.finish(throwing: error)
return
}
// Drained alongside stdout so a chatty engine cannot stall, and
// kept so a failed scan says why.
let errors = Task.detached { await Self.readAll(err) }
let reader = Task.detached {
do {
for try await line in out.fileHandleForReading.bytes.lines {
Expand All @@ -157,7 +160,9 @@ public struct Engine: Sendable {
}
let status = await Self.status(exit)
if status != 0 {
throw EngineError.badOutput("scan exited with \(status)")
let why = String(decoding: await errors.value, as: UTF8.self)
.trimmingCharacters(in: .whitespacesAndNewlines).suffix(500)
throw EngineError.badOutput("scan exited with \(status)" + (why.isEmpty ? "" : ": \(why)"))
}
continuation.finish()
} catch {
Expand All @@ -167,6 +172,7 @@ public struct Engine: Sendable {
continuation.onTermination = { _ in
if process.isRunning { process.terminate() }
reader.cancel()
errors.cancel()
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion CleanCore/Sources/AgentEngine/Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ public struct Item: Codable, Sendable, Hashable {
public let bytes: UInt64?
/// Why the guard refuses it, when it does.
public let refused: String?
/// Shares space with files elsewhere (pnpm or Bun store, hard links):
/// `bytes` is an upper estimate. Older engines leave it out.
public var shared: Bool? = nil

enum CodingKeys: String, CodingKey {
case path, rule, kind = "class", bytes, refused
case path, rule, kind = "class", bytes, refused, shared
}
}

Expand Down Expand Up @@ -55,6 +58,8 @@ public struct ScanSummary: Codable, Sendable, Hashable {

public enum SkipReason: String, Codable, Sendable {
case unreadable
/// Refused by macOS privacy protection; Full Disk Access fixes it.
case protected
case otherVolume = "other_volume"
case depthLimit = "depth_limit"
case entryLimit = "entry_limit"
Expand Down
143 changes: 4 additions & 139 deletions CleanCore/Sources/CleanCore/CMConstants.swift
Original file line number Diff line number Diff line change
@@ -1,154 +1,19 @@
import Foundation

/// Well-known paths and safety limits. Nothing in here is user-configurable;
/// anything the user can tune lives in `CleanSettings`.
/// Well-known paths. Nothing in here is user-configurable.
///
/// Path tables adapted from Mac Sai (BSD-3-Clause, © iliyami contributors).
public enum CMConstants {
public static let appName = "OpenSweep"
public static let bundleIdentifier = "com.finjineers.opensweep"

// MARK: - Safety limits

public static let maxFilesPerOperation = 10_000
public static let cleanChunkSize = 5_000
public static let maxTotalItemsPerCleanOperation = 500_000

/// Paths the engine refuses to delete under, after symlink resolution.
public static let protectedPaths: Set<String> = [
"/System", "/usr", "/bin", "/sbin", "/Library/Apple", "/private/var/db",
]

public static let protectedApps: Set<String> = [
"com.apple.finder", "com.apple.Safari", "com.apple.mail", "com.apple.Terminal",
"com.apple.systempreferences", "com.apple.ActivityMonitor", "com.apple.Console",
"com.apple.DiskUtility", "com.apple.dt.Xcode", "com.apple.AppStore",
"com.apple.iCal", "com.apple.AddressBook", "com.apple.Preview", "com.apple.TextEdit",
"com.apple.calculator", "com.apple.Dictionary", "com.apple.Maps", "com.apple.Notes",
"com.apple.reminders", "com.apple.Stickies", "com.apple.VoiceMemos", "com.apple.stocks",
"com.apple.weather", "com.apple.Passwords", "com.apple.FaceTime", "com.apple.MobileSMS",
"com.apple.Photos", "com.apple.Music",
]

// MARK: - Home / Library

public static let home = FileManager.default.homeDirectoryForCurrentUser
/// Home path without the trailing slash URL.path adds, for string prefix work.
public static let homePath: String = {
var p = FileManager.default.homeDirectoryForCurrentUser.path(percentEncoded: false)
while p.count > 1 && p.hasSuffix("/") { p.removeLast() }
return p
}()
public static let userLibrary = home.appending(path: "Library")
public static let userCaches = userLibrary.appending(path: "Caches")
public static let userLogs = userLibrary.appending(path: "Logs")
public static let userPreferences = userLibrary.appending(path: "Preferences")
public static let userAppSupport = userLibrary.appending(path: "Application Support")
public static let userContainers = userLibrary.appending(path: "Containers")
public static let userGroupContainers = userLibrary.appending(path: "Group Containers")
public static let userLaunchAgents = userLibrary.appending(path: "LaunchAgents")
public static let userSavedAppState = userLibrary.appending(path: "Saved Application State")
public static let userCookies = userLibrary.appending(path: "Cookies")
public static let userHTTPStorages = userLibrary.appending(path: "HTTPStorages")
public static let userWebKit = userLibrary.appending(path: "WebKit")
public static let userDiagnosticReports = userLogs.appending(path: "DiagnosticReports")

public static let systemLibrary = URL(filePath: "/Library")
public static let systemCaches = systemLibrary.appending(path: "Caches")
public static let systemLogs = systemLibrary.appending(path: "Logs")
public static let systemLaunchAgents = systemLibrary.appending(path: "LaunchAgents")
public static let systemLaunchDaemons = systemLibrary.appending(path: "LaunchDaemons")
public static let varLog = URL(filePath: "/var/log")

public static let userTrash = home.appending(path: ".Trash")
public static let downloads = home.appending(path: "Downloads")
public static let documentVersions = home.appending(path: ".DocumentRevisions-V100")
public static let mobileBackups = userAppSupport.appending(path: "MobileSync/Backup")

// MARK: - Xcode

public static let xcodeDerivedData = userLibrary.appending(path: "Developer/Xcode/DerivedData")
public static let xcodeArchives = userLibrary.appending(path: "Developer/Xcode/Archives")
public static let xcodeDeviceSupport = userLibrary.appending(path: "Developer/Xcode/iOS DeviceSupport")
public static let coreSimulatorDevices = userLibrary.appending(path: "Developer/CoreSimulator/Devices")
public static let coreSimulatorCaches = userLibrary.appending(path: "Developer/CoreSimulator/Caches")
public static let xcodePreviews = userLibrary.appending(path: "Developer/Xcode/UserData/Previews")

// MARK: - Browsers

public static let safariCache = userCaches.appending(path: "com.apple.Safari")
public static let chromeAppSupport = userAppSupport.appending(path: "Google/Chrome")
public static let chromeCache = userCaches.appending(path: "Google/Chrome")
public static let edgeAppSupport = userAppSupport.appending(path: "Microsoft Edge")
public static let edgeCache = userCaches.appending(path: "Microsoft Edge")
public static let braveAppSupport = userAppSupport.appending(path: "BraveSoftware/Brave-Browser")
public static let braveCache = userCaches.appending(path: "BraveSoftware/Brave-Browser")
public static let arcAppSupport = userAppSupport.appending(path: "Arc/User Data")
public static let arcCache = userCaches.appending(path: "company.thebrowser.Browser")
public static let firefoxProfiles = userAppSupport.appending(path: "Firefox/Profiles")
public static let firefoxCache = userCaches.appending(path: "Firefox/Profiles")

// MARK: - Package managers and dev tool caches (global, not per-project)

public static let npmCacache = home.appending(path: ".npm/_cacache")
public static let npxCache = home.appending(path: ".npm/_npx")
public static let pnpmStore = userLibrary.appending(path: "pnpm/store")
public static let pnpmCache = userCaches.appending(path: "pnpm")
public static let yarnCache = userCaches.appending(path: "Yarn")
public static let bunCache = home.appending(path: ".bun/install/cache")
public static let pipCache = userCaches.appending(path: "pip")
public static let uvCache = home.appending(path: ".cache/uv")
public static let poetryCache = userCaches.appending(path: "pypoetry")
public static let cargoRegistryCache = home.appending(path: ".cargo/registry/cache")
public static let cargoRegistrySrc = home.appending(path: ".cargo/registry/src")
public static let cargoGitCheckouts = home.appending(path: ".cargo/git/checkouts")
public static let goModCache = home.appending(path: "go/pkg/mod/cache")
public static let goBuildCache = userCaches.appending(path: "go-build")
public static let gradleCaches = home.appending(path: ".gradle/caches")
public static let gradleDaemon = home.appending(path: ".gradle/daemon")
public static let gradleWrapperDists = home.appending(path: ".gradle/wrapper/dists")
public static let mavenRepo = home.appending(path: ".m2/repository")
public static let cocoapodsCache = userCaches.appending(path: "CocoaPods")
public static let homebrewCache = userCaches.appending(path: "Homebrew")
public static let pubCache = home.appending(path: ".pub-cache")
public static let composerCache = userCaches.appending(path: "composer")
public static let playwrightBrowsers = userCaches.appending(path: "ms-playwright")
public static let puppeteerCache = userCaches.appending(path: "puppeteer")
public static let cypressCache = userCaches.appending(path: "Cypress")
public static let typescriptCache = userCaches.appending(path: "typescript")
public static let nodeGypCache = userCaches.appending(path: "node-gyp")
public static let colimaCache = userCaches.appending(path: "colima")
public static let huggingFaceCache = home.appending(path: ".cache/huggingface")
public static let torchCache = home.appending(path: ".cache/torch")

// MARK: - Editors and AI tools (cache dirs only, never settings/sessions)

public static func electronCaches(_ appSupportName: String) -> [URL] {
let base = userAppSupport.appending(path: appSupportName)
return ["Cache", "Code Cache", "GPUCache", "CachedData", "CachedProfilesData", "CachedExtensionVSIXs"]
.map { base.appending(path: $0) }
}
public static var vsCodeCaches: [URL] { electronCaches("Code") }
public static var cursorCaches: [URL] { electronCaches("Cursor") }
public static var antigravityCaches: [URL] { electronCaches("Antigravity") }
public static var slackCaches: [URL] { electronCaches("Slack") }
public static var notionCaches: [URL] { electronCaches("Notion") }
public static var discordCaches: [URL] { electronCaches("discord") }
public static var claudeDesktopCaches: [URL] { electronCaches("Claude") }

public static let claudeCache = home.appending(path: ".claude/cache")
public static let claudePasteCache = home.appending(path: ".claude/paste-cache")
public static let claudeShellSnapshots = home.appending(path: ".claude/shell-snapshots")
public static let claudeCliCache = userCaches.appending(path: "claude-cli-nodejs")
public static let codexCache = home.appending(path: ".codex/cache")
public static let codexTmp = home.appending(path: ".codex/.tmp")

// MARK: - App data directories

public static let appSupportDir = userAppSupport.appending(path: appName)
public static let quarantineDir = appSupportDir.appending(path: "Quarantine")
public static let settingsFile = appSupportDir.appending(path: "settings.json")
public static let projectRegistryFile = appSupportDir.appending(path: "projects.json")
public static let operationLogDir = userLogs.appending(path: appName)
public static let operationLogFile = operationLogDir.appending(path: "operations.log")
/// ~/Library/Application Support/OpenSweep: the app's own small caches.
public static let appSupportDir = FileManager.default.homeDirectoryForCurrentUser
.appending(path: "Library/Application Support").appending(path: appName)
}
Loading
Loading