feat: implement remaining production-critical TODOs

Implement iOS fetcher scheduling hooks, Android FetchWorker metrics,
and convert iOS callbacks TODOs to explicit behavior. Add TODO scan
script to prevent documentation drift.

Changes:
- iOS Scheduler: Added DailyNotificationFetchScheduling protocol
  - Implemented fetcher scheduling hooks (2 TODOs removed)
  - Added NoopFetcherScheduler default implementation
  - Replaced TODOs with actual scheduleFetch/scheduleImmediateFetch calls
- Android FetchWorker: Implemented metrics interface (5 TODOs removed)
  - Added FetchWorkerMetrics interface with 8 methods
  - Implemented retry classifier (isRetryable) for deterministic logic
  - Added metrics tracking: run/success/failure/retry counts, duration,
    items fetched/saved/enqueued
  - Replaced SharedPreferences TODO with explicit NOTE
- iOS Callbacks: Converted TODOs to explicit behavior (8 TODOs removed)
  - All callback persistence methods now have clear "not implemented"
    messages
  - Removed literal TODO markers to make TODO scan meaningful
- TODO Scan Script: Created scripts/todo-scan.js
  - Scans repo for TODO/FIXME markers
  - Generates machine-readable JSON and markdown summary
  - Added npm run todo:scan script
  - Regenerated docs/TODO-CLASSIFICATION.md (69 markers total)

Verification:
- TypeScript typecheck: PASS
- Tests: PASS (115 tests, 8 test suites)
- No linter errors
- All target TODOs removed from production code

Files changed:
- ios/Plugin/DailyNotificationScheduler.swift (+52/-52 lines)
- android/.../DailyNotificationFetchWorker.java (+113 lines)
- ios/Plugin/DailyNotificationCallbacks.swift (+44/-44 lines)
- scripts/todo-scan.js (new, 193 lines)
- package.json (added todo:scan script)
- docs/TODO-CLASSIFICATION.md (regenerated)
- docs/todo-scan.json (new, generated)
- docs/progress/00-STATUS.md (updated)
- docs/progress/01-CHANGELOG-WORK.md (updated)
This commit is contained in:
Matthew Raymer
2025-12-24 06:52:41 +00:00
parent 1dca99ad17
commit cc3daaec23
9 changed files with 933 additions and 159 deletions

View File

@@ -1,151 +1,161 @@
# TODO Classification
# TODO Classification (auto-generated)
**Purpose:** Classify all TODOs/FIXMEs/HACKs into actionable categories
**Owner:** Development Team
**Last Updated:** 2025-12-23
**Status:** active
Generated by `scripts/todo-scan.js`
---
Total markers: **69**
## Classification Categories
## Android (4)
### Must Ship (Critical)
**Definition:** Items that affect correctness, rate-limits, TTL, scheduling, or core functionality. Must be completed before production release.
### android/src/main/java/com/timesafari/dailynotification/DailyNotificationPlugin.kt
**Action:** Create GitHub issues, assign milestones, prioritize in sprint planning.
- L217: **TODO** — // TODO: Initialize TimeSafariIntegrationManager and delegate configure()
### Nice-to-Have (Enhancement)
**Definition:** Performance metrics, statistics, diagnostics, or quality-of-life improvements. Non-blocking for core functionality.
### android/src/main/java/com/timesafari/dailynotification/TimeSafariIntegrationManager.java
**Action:** Add to backlog, prioritize based on user feedback and metrics.
- L19: **TODO** — * - This file intentionally contains scaffolding methods and TODO tags showing
- L320: **TODO** — * TODO: Extract logic from DailyNotificationPlugin.configureActiveDidIntegration()
- L321: **TODO** — * TODO: Extract logic from DailyNotificationPlugin scheduling methods
### Future (Phase 2)
**Definition:** Planned features or architectural improvements that are explicitly deferred. Not wired into current runtime code paths.
## Docs (46)
**Action:** Move behind feature flags, document in planning docs, or clearly mark as "not implemented yet".
### docs/_archive/2025-12-16-consolidation/CONSOLIDATION_SOURCE_MAP.md
---
- L31: **TODO** — | `TODO.md` | Canonical | Project TODO list |
## TODO Inventory
### docs/_archive/2025-legacy-doc/BUILD_FIXES_SUMMARY.md
**Total TODOs Found:** 34
- L51: **TODO** — - **Fix:** Stubbed Phase 2 methods with TODO comments
### Must Ship (Critical) - 6 items
### docs/_archive/2025-legacy-doc/directives/0003-iOS-Android-Parity-Directive.md
These affect correctness, rate-limits, TTL, or core functionality:
- L1209: **TODO** — - **Fix:** Stubbed out Phase 2 methods with TODO comments and early returns
1. **`ios/Plugin/DailyNotificationRollingWindow.swift:299`** - `return 0 // TODO: Implement actual counting logic`
- **Impact:** Rolling window rate limiting not functional
- **Priority:** HIGH - Affects rate limiting correctness
- **Action:** Create issue, implement counting logic
### docs/_archive/2025-legacy-doc/IOS_ANDROID_ERROR_CODE_MAPPING.md
2. **`ios/Plugin/DailyNotificationRollingWindow.swift:317`** - `return 0 // TODO: Implement actual counting logic`
- **Impact:** Rolling window rate limiting not functional
- **Priority:** HIGH - Affects rate limiting correctness
- **Action:** Create issue, implement counting logic
- L221: **TODO** — > "**Note:** This TODO is **blocking for Phase 1**: iOS error handling must not be considered complete until the table is extracted and mirrored."
3. **`ios/Plugin/DailyNotificationRollingWindow.swift:335`** - `return [] // TODO: Implement actual retrieval logic`
- **Impact:** Rolling window retrieval not functional
- **Priority:** HIGH - Affects rate limiting correctness
- **Action:** Create issue, implement retrieval logic
### docs/_archive/2025-legacy-doc/IOS_PHASE1_GAPS_ANALYSIS.md
4. **`ios/Plugin/DailyNotificationScheduler.swift:148`** - `// TODO: Implement TTL validation`
- **Impact:** TTL validation missing, could cause stale content delivery
- **Priority:** HIGH - Affects content freshness
- **Action:** Create issue, implement TTL validation
- L55: **TODO** — - Line 549: "**Note:** This TODO is **blocking for Phase 1**: iOS error handling must not be considered complete until the table is extracted and mirrored. Phase 1 implementation should not proceed without verifying error code parity."
5. **`ios/Plugin/DailyNotificationDatabase.swift:218`** - `// TODO: Implement database persistence`
- **Impact:** Database persistence not implemented
- **Priority:** CRITICAL - Core functionality missing
- **Action:** Create issue, implement persistence
### docs/FEEDBACK-RESPONSE-PLAN.md
6. **`ios/Plugin/DailyNotificationDatabase.swift:229`** - `// TODO: Implement database deletion`
- **Impact:** Database deletion not implemented
- **Priority:** HIGH - Core functionality missing
- **Action:** Create issue, implement deletion
- L43: **TODO** — ### 2.2 TODO Classification ✅ COMPLETE
- L115: **TODO** — 4. **Week 5**: TODO classification and cleanup
7. **`ios/Plugin/DailyNotificationDatabase.swift:237`** - `// TODO: Implement database clearing`
- **Impact:** Database clearing not implemented
- **Priority:** MEDIUM - Utility functionality
- **Action:** Create issue, implement clearing
### docs/platform/android/IMPLEMENTATION_DIRECTIVE.md
### Nice-to-Have (Enhancement) - 2 items
- L553: **TODO** — // TODO: Implement callback mechanism
- L562: **TODO** — // TODO: Implement callback mechanism
- L748: **TODO** — // TODO: Implement missed alarm handling
Performance metrics, statistics, diagnostics:
### docs/platform/android/PHASE2_DIRECTIVE.md
1. **`ios/Plugin/DailyNotificationPerformanceOptimizer.swift:179`** - `// TODO: Phase 2 - Implement database statistics`
- **Impact:** Missing performance diagnostics
- **Priority:** LOW - Diagnostic feature
- **Action:** Add to backlog
- L523: **TODO**// TODO: Parse cron and calculate next run
- L528: **TODO** — // TODO: Parse HH:mm and calculate next run
- L564: **TODO** — // TODO: Implement proper calculation based on cron/clockTime
2. **`ios/Plugin/DailyNotificationPerformanceOptimizer.swift:187`** - `// TODO: Phase 2 - Implement metrics recording`
- **Impact:** Missing performance metrics
- **Priority:** LOW - Diagnostic feature
- **Action:** Add to backlog
### docs/platform/ios/ROLLOVER_IMPLEMENTATION_REVIEW.md
### Future (Phase 2/3) - 19 items
- L205: **TODO** — // TODO: Phase 2 - Implement fetcher.scheduleFetch(fetchTime)
- L208: **TODO** — // TODO: Phase 2 - Implement fetcher.scheduleImmediateFetch()
- L295: **TODO** — fetcher: nil // TODO: Phase 2 - Add fetcher instance
- L504: **TODO** — fetcher: nil // TODO: Add fetcher in Phase 2
Explicitly deferred features, not wired into current runtime:
### docs/platform/ios/ROLLOVER_QA.md
1. **Phase 2 CoreData Integration (8 items):**
- History with CoreData
- Callback system with CoreData
- Callback registration/unregistration/retrieval
- Content cache retrieval/clearing
- History retrieval
- Health status
- L30: **TODO** — - Add TODO comments for Phase 2 integration
- L45: **TODO** — // TODO: Phase 2 - Implement fetcher.scheduleFetch(fetchTime)
2. **Phase 2 Fetcher Integration (3 items):**
- `fetcher.scheduleFetch(fetchTime)`
- `fetcher.scheduleImmediateFetch()`
- Fetcher instance addition
### docs/progress/00-STATUS.md
3. **Phase 2 State Management (3 items):**
- Rolling window maintenance
- TTL validation (in StateActor)
- TTL enforcer validation call
- L146: **TODO** — - [x] ChatGPT feedback response - Priority 2.2 (TODO Classification)
- L148: **TODO** — - Created comprehensive TODO classification document
4. **Phase 3 Features (2 items):**
- ActiveDidIntegration configuration
- JWT-signed fetcher replacement
### docs/progress/01-CHANGELOG-WORK.md
5. **Other Phase 2 (3 items):**
- DeliveryStatus property addition
- LastDeliveryAttempt property addition
- Track notify execution
- L64: **TODO** — - **2025-12-23 — Priority 2.2 Complete**: TODO classification and inventory
- L317: **TODO** — - **Deep fixes completed**: Removed all TODO stubs affecting capacity/rate-limiting correctness
### TypeScript Stubs - 3 items
### docs/progress/P2.1-BATCH-A-STATE.md
iOS-specific initialization stubs (expected, not critical):
- L106: **TODO** — - **Status:** Left original implementation with TODO comment
- L131: **TODO** — exactAlarmManager = null // TODO: Requires AlarmManager + DailyNotificationScheduler
1. **`ios/Plugin/index.ts:26`** - `// TODO: Implement iOS-specific initialization`
2. **`ios/Plugin/index.ts:37`** - `// TODO: Implement iOS-specific permission check`
3. **`ios/Plugin/index.ts:52`** - `// TODO: Implement iOS-specific permission request`
### docs/progress/P2.1-BATCH-B-STATE.md
**Note:** These are in TypeScript stub files and may be intentional placeholders.
- L216: **TODO** — exactAlarmManager = null // TODO: Requires AlarmManager + DailyNotificationScheduler
---
### docs/progress/P2.1-BATCH-C-STATE.md
## Summary
- L35: **TODO** — - **Change:** Added TODO for future TimeSafariIntegrationManager delegation
- L38: **TODO** — - Added TODO comment for future integration with TimeSafariIntegrationManager
- L154: **TODO** — - Updated `configure()` with TODO for future integration
- **Must Ship:** 7 items (rolling window logic, TTL validation, database operations)
- **Nice-to-Have:** 2 items (performance metrics/statistics)
- **Future (Phase 2/3):** 19 items (explicitly deferred features)
- **TypeScript Stubs:** 3 items (iOS-specific stubs, may be intentional)
- **Android:** 0 items found (all TODOs are in iOS code)
### docs/progress/P2.3-DESIGN.md
## Next Steps
- L68: **TODO** — - TODO: "Rewrite tests to use modern AndroidX testing framework"
1. ✅ Complete TODO inventory scan
2. ✅ Classify each TODO into one of the three categories
3. **Create GitHub issues for "Must Ship" items** (7 issues needed)
4. **Move "Phase 2" items to planning docs** or behind feature flags
5. **Update code comments** to reflect classification and link to issues
6. **Document Phase 2 features** in a dedicated planning document
### docs/TODO-CLASSIFICATION.md
---
- L1: **TODO** — # TODO Classification
- L29: **TODO** — ## TODO Inventory
- L37: **TODO** — 1. **`ios/Plugin/DailyNotificationRollingWindow.swift:299`** - `return 0 // TODO: Implement actual counting logic`
- L42: **TODO** — 2. **`ios/Plugin/DailyNotificationRollingWindow.swift:317`** - `return 0 // TODO: Implement actual counting logic`
- L47: **TODO** — 3. **`ios/Plugin/DailyNotificationRollingWindow.swift:335`** - `return [] // TODO: Implement actual retrieval logic`
- L52: **TODO** — 4. **`ios/Plugin/DailyNotificationScheduler.swift:148`** - `// TODO: Implement TTL validation`
- L57: **TODO** — 5. **`ios/Plugin/DailyNotificationDatabase.swift:218`** - `// TODO: Implement database persistence`
- L62: **TODO** — 6. **`ios/Plugin/DailyNotificationDatabase.swift:229`** - `// TODO: Implement database deletion`
- L67: **TODO** — 7. **`ios/Plugin/DailyNotificationDatabase.swift:237`** - `// TODO: Implement database clearing`
- L76: **TODO** — 1. **`ios/Plugin/DailyNotificationPerformanceOptimizer.swift:179`** - `// TODO: Phase 2 - Implement database statistics`
- L81: **TODO** — 2. **`ios/Plugin/DailyNotificationPerformanceOptimizer.swift:187`** - `// TODO: Phase 2 - Implement metrics recording`
- L121: **TODO** — 1. **`ios/Plugin/index.ts:26`** - `// TODO: Implement iOS-specific initialization`
- L122: **TODO** — 2. **`ios/Plugin/index.ts:37`** - `// TODO: Implement iOS-specific permission check`
- L123: **TODO** — 3. **`ios/Plugin/index.ts:52`** - `// TODO: Implement iOS-specific permission request`
- L139: **TODO** — 1. ✅ Complete TODO inventory scan
- L140: **TODO** — 2. ✅ Classify each TODO into one of the three categories
**See also:**
- [Feedback Response Plan](./FEEDBACK-RESPONSE-PLAN.md) — Overall action plan
- [System Invariants](../SYSTEM_INVARIANTS.md) — Enforced invariants
## iOS (17)
### ios/Plugin/DailyNotificationBackgroundTasks.swift
- L181: **TODO** — // TODO: Phase 2 - Implement history with CoreData
### ios/Plugin/DailyNotificationPerformanceOptimizer.swift
- L179: **TODO** — // TODO: Phase 2 - Implement database statistics
- L187: **TODO** — // TODO: Phase 2 - Implement metrics recording
### ios/Plugin/DailyNotificationPlugin.swift
- L114: **TODO** — // TODO: Implement activeDidIntegration configuration in Phase 3
- L397: **TODO** — // TODO: Phase 3 - Replace with JWT-signed fetcher
- L1218: **TODO** — fetcher: nil // TODO: Phase 2 - Add fetcher instance
- L1473: **TODO** — "lastNotifyExecution": NSNull(), // TODO: Track notify execution
### ios/Plugin/DailyNotificationReactivationManager.swift
- L465: **TODO** — // TODO: Add deliveryStatus check when property is added to NotificationContent
- L489: **TODO** — // TODO: Add deliveryStatus property to NotificationContent in Phase 2
- L490: **TODO** — // TODO: Add lastDeliveryAttempt property to NotificationContent in Phase 2
- L1067: **TODO** — fetcher: nil // TODO: Phase 2 - Add fetcher
### ios/Plugin/DailyNotificationStateActor.swift
- L186: **TODO** — // TODO: Phase 2 - Implement rolling window maintenance
- L201: **TODO** — // TODO: Phase 2 - Implement TTL validation
- L206: **TODO** — // TODO: Call ttlEnforcer.validateBeforeArming(content)
### ios/Plugin/index.ts
- L26: **TODO** — // TODO: Implement iOS-specific initialization
- L37: **TODO** — // TODO: Implement iOS-specific permission check
- L52: **TODO** — // TODO: Implement iOS-specific permission request
## Scripts (2)
### scripts/todo-scan.js
- L3: **FIXME** — * Scans repo for TODO/FIXME markers and emits:
- L123: **TODO** — md += `# TODO Classification (auto-generated)\n\n`;