13 Commits

Author SHA1 Message Date
8b57eeb108 Updated code 2026-03-05 20:27:35 -05:00
13753359b3 fix: Resolve all audit issues from project readiness review
Blockers:
- IYmtgTests: replace ScannerViewModel() (no-arg init removed) with CollectionViewModel() in testViewModelFiltering and testPortfolioCalculation
- IYmtgTests: fix property access — scannedList, librarySearchText, filteredList, portfolioValue all live on CollectionViewModel, not ScannerViewModel; inject test data after async init settles

Major:
- ContentView: update .onChange(of:) to two-parameter closure syntax (iOS 17 deprecation)
- ModelManager: add missing import FirebaseCore so FirebaseApp.app() resolves explicitly
- CollectionViewModel.deleteCard: call CloudEngine.delete(card:) to remove Firebase entry when a card is deleted (prevents data accumulation)
- CloudEngine: remove never-called batchUpdatePrices() — full backup already handled by backupAllToFirebase()

Minor:
- CardDetailView: move to Features/CardDetail/CardDetailView.swift; remove from ContentView.swift
- Delete PersistenceActor.swift placeholder (superseded by PersistenceController.swift)
- AppConfig.validate(): broaden placeholder-email guard to catch empty strings and common fake domains
- ModelManager: document OTA restart requirement in code comment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 20:22:45 -05:00
e18a1080de feat: Complete project readiness audit
- Full static analysis of all 33 Swift source files
- Identified 2 Blockers in IYmtgTests.swift (ScannerViewModel init mismatch, missing property forwards)
- Identified 1 Critical issue: IYmtg_Builder_Mac is empty, cards.json cannot be generated
- Documented 4 Major issues: deprecated onChange API, missing FirebaseCore import, Firebase delete data leak, dead batchUpdatePrices function
- Updated claude_review_summary.md with complete findings by severity
- Added Project Audit section to README.md with link to summary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 16:03:00 -05:00
5da5614a10 feat: Create dynamic in-app training status guide
Implements a new UI to show recommended image counts for ML training.
Uses color-coded indicators (orange/green/blue) for Functional, Solid,
and High-Accuracy thresholds across all 28 training categories
(Foil, Stamp, and Condition models). Critical damage types (Inking,
Rips, Water Damage) carry higher recommended counts to minimise false
positives on NM grades. Accessible via a "?" toolbar button in Library.
Bumps app version to 1.1.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 13:21:45 -05:00
bb4ad9eb7e docs: Rewrite Step 3 - Damage Simulation Lab
Critical fixes:
- Explained that Condition_Data uses Object Detection (bounding box
  annotations required in Create ML), not Image Classification
- Documented the grading formula from ConditionEngine: Inking/Rips/
  WaterDamage = Damaged; 0 = NM; 1-2 = EX; 3+ = PL
- Added materials list with all supplies needed
- Added card sourcing guide (bulk eBay lots, pre-damaged cards)
- Added raking light setup instructions
- Added folder name column to technique table (exact label names)
- Added clean card baseline requirement per damage type
- Expanded annotation guidance for Create ML

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 13:07:30 -05:00
b848a7b169 docs: Add Step 0 - Training image creation without the app
- Clarifies no app/Mac/Xcode needed for training data collection
- Documents photography setup for foils (angles, black bg, raking light)
- Documents photography setup for damage and non-foil cards
- Explains the cropping rule and why it matters for model accuracy
- Lists free cropping tools for Windows and cross-platform
- Image quantity guide (min vs recommended per class)
- Explains Scryfall image downloads as a NonFoil supplement

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 13:04:31 -05:00
15abf823be docs: Add Part 6 - Community Feedback and Model Retraining
Documents the full ML feedback loop:
- How user corrections trigger uploads (by label: Foil_, Condition_, Identity_)
- User opt-in requirement and AppConfig.isTrainingOptIn
- Firebase Storage rules (training write-only, models read-only)
- How to download collected data via Firebase CLI
- Image review and sorting process before retraining
- Create ML retraining workflow
- OTA model push via Firebase Storage models/ folder
- Recommended retraining schedule

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 13:01:27 -05:00
d6498d7c14 docs: Rewrite README with full step-by-step development guide
- Added Development Roadmap table showing all steps and Mac requirements
- Added Part 3: Card Database explaining IYmtg_Builder_Mac and cards.json
- Added Part 4: Xcode Project Setup from source (create, add files, SPM, capabilities)
- Added privacy plist keys and PrivacyInfo.xcprivacy guidance
- Added OTA model update restart requirement note
- Expanded Release Checklist with database and ML model checks
- Renumbered all parts consistently (Part 1-10)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 12:56:11 -05:00
a186101cb8 chore: Remove legacy migration stub files
CardLogic.swift, Engines.swift, and root ScannerViewModel.swift
were empty migration notices pointing to the new modular structure.
All actual code lives in Services/, Data/, and Features/ already.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 12:49:26 -05:00
e1c2935093 feat: Conducted full project readiness and foil detection audit.
- Created claude_review_summary.md with findings across all 4 phases
- Fixed README workspace setup (removed Desktop/Google Drive specifics)
- Fixed duplicate Step 4 numbering in Section 3 (now Step 6: Create ML)
- Updated Foil Shopping List: added StepAndCompleat, flagged Gilded/Silver Screen as low priority
- Added Stamp Classifier to the Create ML step
- Incremented AppConfig buildNumber to 2
- Stamp_Data/Stamped and Stamp_Data/Clean directories created locally (gitignored)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 12:46:29 -05:00
52afbd56af feat: Implement app versioning and update gitignore
- Adds appVersion and buildNumber to AppConfig.swift for centralized version management.
- Updates scryfallUserAgent to use the dynamic appVersion.
- Updates .gitignore to exclude AI asset and training directories.
- Adds a version check step to the README release checklist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 12:19:35 -05:00
24dcb44af4 Implement storage architecture from ai_blueprint.md
Primary sync: replace PersistenceActor JSON file with SwiftData + CloudKit
- Add SavedCardModel (@Model class) and PersistenceController (ModelContainer
  with .automatic CloudKit, fallback to local). BackgroundPersistenceActor
  (@ModelActor) handles all DB I/O off the main thread.
- One-time migration imports user_collection.json into SwiftData and renames
  the original file to prevent re-import.
- Inject modelContainer into SwiftUI environment in IYmtgApp.

Image storage: Documents/UserContent/ subfolder (blueprint requirement)
- ImageManager.dir now targets iCloud Documents/UserContent/ (or local equiv).
- migrateImagesToUserContent() moves existing JPGs to the new subfolder on
  first launch; called during the SwiftData migration.

Firebase: demoted to optional manual backup (metadata only, no images)
- Remove all automatic CloudEngine.save/delete/batchUpdatePrices calls from
  CollectionViewModel mutations.
- Add backupAllToFirebase() for user-triggered metadata sync.
- Add isFirebaseBackupEnabled to AppConfig (default false).
- Add Cloud Backup section in Library settings with iCloud vs Firebase
  explanation and "Backup Metadata to Firebase Now" button.

Also: full modular refactor (Data/, Features/, Services/ directories) and
README updated with CloudKit setup steps and revised release checklist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 12:13:17 -05:00
b993ef4020 Initial commit: IYmtg Master project
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 09:12:46 -05:00