docs: Restructure infrastructure plan - remove Phase 1 dependencies

Problem:
- Phase 1 (Core Fixes Using Job Queue) conflicted with Phase 0.5
- Phase 1 added JobTypeSetFolders and processSetFoldersJob
- Phase 0.5 makes folder configuration automatic via database
- Phase 1's SetFolders() job queue approach is obsolete

Changes Made:
1. Removed Phase 1 entirely (636 lines deleted)
   - Removed JobTypeSetFolders job type
   - Removed processSetFoldersJob handler
   - Removed test isolation fixes (to be added elsewhere if needed)
   - Removed default value fixes (to be added elsewhere if needed)

2. Renumbered all subsequent phases:
   - Phase 2 (Job Queue Expansion) → Phase 1
   - Phase 3 (WebSocket Scan Progress) → Phase 2
   - Phase 4 (Caching and Monitoring) → Phase 3
   - Phase 5 (Job Queue Enhancements) → Phase 4

3. Updated all step numbers:
   - All steps renumbered to match new phase numbers
   - Step 2.x → Step 1.x, Step 3.x → Step 2.x, etc.

4. Updated job type counts:
   - Changed "8 async job types" to "7 async job types"
   - Removed setfolders from commit messages

5. Updated Summary section:
   - Removed Phase 1 time estimate
   - Added Phase 0.5 time estimate
   - Removed folder config from key design decisions
   - Updated Files Modified section

6. Updated references throughout:
   - All phase references updated to new numbers
   - All step references updated to match phase numbers

Rationale:
Phase 0.5's directory-based watching approach reads folder paths
directly from the library_folders table via GetLibraryFolders(),
making manual SetFolders() configuration unnecessary. The watcher
automatically discovers subdirectories, so job queue-based folder
configuration is no longer needed.

Phase 0.5 structure:
- Phase 0.5: Fix fsnotify Reliability (2-3 hours)
  - Directory-based watching replaces file-based event queue
  - File stability checks prevent processing incomplete files
  - Smart event merging consolidates parent/child/sibling events
  - 10-second batch processing for efficient bulk operations

- Phase 1: Job Queue Expansion (6-8 hours)
  - 7 async job types (import, convert, thumbnails, reindex, backup, analytics, sync)
  - Job management API for CRUD operations
  - Real-time job status tracking

- Phase 2: WebSocket Scan Progress (2-3 hours)
  - Real-time progress updates via WebSocket
  - Eliminates polling for job status

- Phase 3: Caching and Monitoring (2 hours)
  - Settings cache reduces database load
  - Enhanced /health endpoint

- Phase 4: Job Queue Enhancements (4-6 hours)
  - Job persistence across restarts
  - Job history and audit trail
  - Priority queue support

Total document size: 2,974 lines (reduced from 3,620 lines)

All dependencies on removed Phase 1 functionality have been eliminated.
Job queue for other tasks (import, convert, etc.) and WebSocket
integration remain unchanged and fully compatible.
This commit is contained in:
2026-03-05 12:21:54 -05:00
parent 9e5c6d4566
commit a1b6820dba
File diff suppressed because it is too large Load Diff