| 3247 | if not normalized_user: |
| 3248 | raise ValueError("user_id is required") |
| 3249 | |
| 3250 | daily_note_paths = [str(path) for path in _all_daily_note_paths()] |
| 3251 | refresh_daily_notes = getattr(reading_agent, "refresh_daily_note_files", None) |
| 3252 | daily_note_result = ( |
| 3253 | refresh_daily_notes(user_id=normalized_user, daily_note_paths=daily_note_paths) |
| 3254 | if callable(refresh_daily_notes) |
| 3255 | else {"scanned": len(daily_note_paths), "refreshed": 0, "daily_notes": daily_note_paths, "errors": []} |
| 3256 | ) |
| 3257 | return { |
| 3258 | "daily_notes": daily_note_result, |
| 3259 | "wiki_backfilled": 0, |
| 3260 | "reports_scanned": 0, |
| 3261 | "reports_indexed": 0, |
| 3262 | "stats": wiki_stats(normalized_user), |
| 3263 | } |
| 3264 | |
| 3265 | |
| 3266 | def submit_and_read( |
| 3267 | *, |
| 3268 | user_id: str, |
| 3269 | push_id: str, |
| 3270 | selected_numbers: Iterable[Any], |
| 3271 | skipped_numbers: Iterable[Any], |