Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
62a8bdc
docs: design BitMatch reliability and setup improvements
mikecerisano Jul 11, 2026
11340cf
docs: plan BitMatch reliability architecture and UX work
mikecerisano Jul 11, 2026
7630367
chore: ignore local agent workspaces
mikecerisano Jul 11, 2026
dd187d4
build: add explicit platform verification jobs
mikecerisano Jul 11, 2026
5e82a31
ci: verify macOS tests and iPad build
mikecerisano Jul 11, 2026
98cf65d
test: add safe deterministic transfer fixtures
mikecerisano Jul 11, 2026
53d5e6f
test: add transfer fault and soak verification
mikecerisano Jul 11, 2026
b2fa959
test: harden fault harness verification
mikecerisano Jul 11, 2026
b2bbbf3
refactor: remove orphaned operation architecture
mikecerisano Jul 12, 2026
441529a
refactor: make coordinator state bindings explicit
mikecerisano Jul 12, 2026
3f67ee3
fix: forward remaining coordinator display state
mikecerisano Jul 12, 2026
758f629
test: isolate coordinator state binding observation
mikecerisano Jul 12, 2026
fca1583
refactor: centralize iOS background task ownership
mikecerisano Jul 12, 2026
700d158
build: enable targeted concurrency diagnostics
mikecerisano Jul 12, 2026
b4c0947
feat: model transfer plan presentation states
mikecerisano Jul 12, 2026
fc65c9c
feat: simplify macOS transfer setup
mikecerisano Jul 12, 2026
1ccecb9
fix: restore transfer controls and reduce motion
mikecerisano Jul 12, 2026
43c0c6d
feat: simplify iPad transfer setup
mikecerisano Jul 12, 2026
0c70c96
docs: align hardening workflow
mikecerisano Jul 12, 2026
e188262
design: refresh BitMatch app icon
mikecerisano Jul 12, 2026
4b18602
chore: remove generated agent report
mikecerisano Jul 12, 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
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
pull_request:

env:
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer

jobs:
mac-tests:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- run: xcodebuild -version
- run: bash test.sh mac-test
env:
DERIVED_DATA_ROOT: ${{ runner.temp }}/bitmatch-derived-data

ipad-build:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- run: xcodebuild -version
- run: bash test.sh ipad-build
env:
DERIVED_DATA_ROOT: ${{ runner.temp }}/bitmatch-derived-data
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

.AppleDouble
.build/
.derived-data/
.DS_Store
.LSOverride
.swiftpm/
Expand All @@ -22,4 +23,6 @@ dist/
build/
DerivedData/
mac-build.log
.superpowers/
.worktrees/
Pods/
54 changes: 42 additions & 12 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

## Overview

BitMatch uses a shared core architecture that enables code reuse between macOS and iPad platforms while maintaining platform-specific optimizations.
BitMatch keeps one copy-and-verify operation path in the shared core. macOS and
iPad provide their own pickers, security/access integration, and SwiftUI views;
both platforms hand the resolved operation to the same executor and file
services. This keeps safety decisions and result semantics out of platform UI.

## Core Design Principles

Expand Down Expand Up @@ -48,6 +51,21 @@ class SharedAppCoordinator: ObservableObject {
}
```

### Shared Copy-and-Verify Path

`SharedAppCoordinator` prepares `CopyVerifyConfig` and delegates execution to
`CopyVerifyExecutor`. The executor owns operation timing, state, error
tracking, iPad background-task handling, result overflow, and report handoff.
It calls `PlatformManager.fileOperations.performFileOperation(...)`, which is
implemented by `SharedFileOperationsService` on both platforms.

The shared service acquires access scopes, checks source and destination access,
runs `SafetyValidator`, enumerates the source, copies with bounded concurrency,
and records one current result per source/destination pair. Verification can
run in a bounded pipeline. The executor maps progress and rows back to each
platform UI, then seals completion state and generates enabled reports. A view
can explain readiness, but it cannot bypass this shared preflight.

### Platform Managers

#### macOS: MacOSPlatformManager
Expand Down Expand Up @@ -145,6 +163,7 @@ protocol FileSystemService {
Features:
- Dynamic window sizing based on content
- Mode-specific layouts
- Transfer-plan cards show source, destinations, options, and preflight status before transfer
- Integrated report panel
- Professional desktop interactions

Expand All @@ -162,6 +181,7 @@ Features:
- Collapsible sections
- Professional card designs
- Native iOS interactions
- The same transfer-plan presentation shows setup, readiness, warnings, and blocked states before transfer

Key Components:
- `CopyAndVerifyView`: Enhanced touch interface with collapsible sections
Expand All @@ -172,25 +192,24 @@ Key Components:

## Flow Diagrams

### Copy & Verify (high level)
### Copy & Verify (shared operation path)

1. UI sets `sourceURL` and `destinationURLs` on `SharedAppCoordinator`
2. User taps Start → `startOperation()`
3. Coordinator runs readiness checks against the resolved final output roots
4. Coordinator starts services:
1. macOS or iPad selection UI sets source and destination URLs; its transfer-plan UI renders setup, readiness, warnings, or blockers.
2. User taps Start → the coordinator builds `CopyVerifyConfig` and runs readiness checks against the resolved final output roots.
3. `CopyVerifyExecutor` starts services:
- `OperationTimingService.startOperation(...)`
- `OperationStateService.startOperation(...)`
- `ErrorReportingService.startErrorTracking(...)`
5. `SharedFileOperationsService.performFileOperation(...)` performs core preflight:
4. `CopyVerifyExecutor` invokes `PlatformManager.fileOperations.performFileOperation(...)`; both platforms reach `SharedFileOperationsService`.
5. `SharedFileOperationsService` performs core preflight:
- source exists and is a directory
- destinations are unique and writable
- final destination roots are unique, non-nested, non-symlinked folders
- source tree has no unsafe relative paths or portable-name collisions
6. `FileCopyService.copyAllSafely(...)` copies each file with temp-then-promote semantics and per-file error reporting
7. Verification runs inline or pipelined depending on mode
8. Progress updates → coordinator updates `progress` + timing service → UI reacts
9. On completion: state services finalize; results mapped to `ResultRow` list
10. If reports enabled, `SharedReportGenerationService` is invoked
6. `FileCopyService.copyAllSafely(...)` copies each file with temp-then-promote semantics and per-file error reporting.
7. Verification runs inline or in a bounded pipeline, depending on mode.
8. Progress and per-file rows flow through the executor to timing, state, and platform UI.
9. On completion, the executor coalesces current result rows, finalizes state, and invokes `SharedReportGenerationService` when reports are enabled.

### Compare Folders (basic)

Expand Down Expand Up @@ -291,3 +310,14 @@ await withTaskGroup(of: Result.self) { group in /* cap concurrency */ }
- User interaction flows
- State management verification
- Platform-specific behavior validation

### Concurrency and Fault Diagnostics

`BitMatchTests/ConcurrencyTests.swift` targets the shared `AsyncSemaphore`:
basic permit behavior, bounded concurrent access, stress, and cancellation.
Transfer integration and soak tests exercise the shared operation path, rather
than duplicating platform-specific copy logic. The focused APFS image harness
(`Scripts/run_apfs_fault_tests.sh`) verifies that one inaccessible destination
reports failure while another can finish. `Scripts/run_soak_tests.sh` runs a
seeded, repeatable transfer soak test. Physical cable, power, hub, and exFAT
fault cases require the procedure in `docs/HARDWARE_TESTING.md`.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"images" : [
{
"filename" : "bitmatchicon-v2.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading