## 1. Admin CLI Foundation - [x] 1.1 Extend `backend/cli.py` parser with an admin maintenance command group and subcommands. - [x] 1.2 Add argument validation for subcommands including `fetch --count n`. - [x] 1.3 Keep existing `force-fetch` command behavior intact. ## 2. Queue-Based Image Refetch - [x] 2.1 Implement latest-30 article selection query for refetch queue. - [x] 2.2 Implement in-process sequential queue worker for refetch-images. - [x] 2.3 Add exponential backoff retry logic for transient/rate-limit provider failures. - [x] 2.4 Add per-item progress logging and final queue summary output. ## 3. Context-Aware Image Recovery - [x] 3.1 Add context-aware query generation using article keywords plus mood/sentiment cues. - [x] 3.2 Add AI-domain fallback keyword set when extracted context is weak. - [x] 3.3 Add explicit generic AI fallback image assignment for terminal provider failure. - [x] 3.4 Ensure refetched images are optimized and persisted using existing image pipeline contracts. ## 4. Maintenance Operations - [x] 4.1 Implement clean-archive command using existing archival repository helpers. - [x] 4.2 Implement clear-cache command for configured cache layers in scope. - [x] 4.3 Implement clear-news command for non-archived and/or configured scope items. - [x] 4.4 Implement rebuild-site command to execute defined rebuild sequence. - [x] 4.5 Implement regenerate-translations command across supported languages. - [x] 4.6 Implement fetch command with configurable article count. ## 5. Safety and Operator UX - [x] 5.1 Add explicit confirmation requirement for destructive commands. - [x] 5.2 Add dry-run support for commands where preview is feasible. - [x] 5.3 Standardize command output format for success/failure totals and next-step hints. ## 6. Documentation and Validation - [x] 6.1 Update README command documentation with examples for each new subcommand. - [x] 6.2 Add operational guardrail notes (confirmation, dry-run, backoff behavior). - [x] 6.3 Validate command help output and argument handling. - [x] 6.4 Run end-to-end manual checks for refetch-images queue behavior and failure recovery output.