-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
- Version regex allows invalid formats:
- DataSourcePipeline.swift:504: Pattern allows 4-part versions
- macOS versions are max 3 parts (e.g., "14.2.1" not "14.2.1.1")
- May cause incorrect reference resolution
Current:
let versionPattern = #/(\d+\.\d+(?:\.\d+)?(?:\.\d+)?)/#Should be:
let versionPattern = #/(\d+\.\d+(?:\.\d+)?)/#- File size unit ambiguity:
- RestoreImageRecord.swift:128 and XcodeVersionRecord.swift:132
- Uses 1,000,000,000 (SI decimal GB)
- Not explicitly documented as Apple convention
Proposed Solution
- Fix regex: Remove optional 4th version component
- Document units: Add comment clarifying GB = 1,000,000,000 bytes (SI decimal, Apple convention)
// Apple uses decimal GB (1,000,000,000 bytes), not binary GiB (1,073,741,824)
let gb = Double(bytes) / 1_000_000_000Impact
- Correctness: Prevents incorrect version matching
- Clarity: Explicit unit documentation
- Consistency: Matches Apple's conventions
Files Affected
- Examples/Bushel/Sources/BushelImages/DataSources/DataSourcePipeline.swift:504
- Examples/Bushel/Sources/BushelImages/Models/RestoreImageRecord.swift:128
- Examples/Bushel/Sources/BushelImages/Models/XcodeVersionRecord.swift:132
References
- PR update from writing blog post and examples MistKit#129 Review: update from writing blog post and examples MistKit#129 (comment)
- Section: Potential Bugs
- Related: Add comprehensive test suite for Bushel demo MistKit#136
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working