Draft
Conversation
…ayer The orders API route handlers contained all business logic inline — direct ORM operations, query building, and order merging logic — bypassing the service layer. This moves all domain logic into order_service.py, making routes thin HTTP wrappers that only handle request parsing and error translation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace 43 duplicated unsafe error-handling blocks (using TypeScript `as` casts) across 19 files with type-safe getApiErrorMessage/getApiErrorStatus utilities that use axios.isAxiosError(). Extract 5 duplicated formatDate, 3 formatAmount, and formatTimeAgo/formatTimeUntil functions into shared utils/format.ts module. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…dlers The IMAP test_connection and list_folders endpoints used synchronous imaplib, which blocked the entire asyncio event loop during network I/O. Extract shared async IMAP utilities (connect, test, list folders, parse) into _shared/email/imap_utils.py using aioimaplib, eliminating both the event loop blocking bug and the duplicated IMAP logic between email-user and email-global routers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Eliminate ~350 lines of duplicated IMAP watching logic between email_user and email_global services by extracting generic watch/idle/poll/fetch functions that accept provider-specific behavior via a callbacks dataclass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move EmailAnalysis/EmailItem to shared schemas so the core service layer no longer depends on a specific plugin module. Analysis is now routed through the module registry via a new `analyze` hook on ModuleInfo, consistent with how `notify` already works for notifiers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…fallback - Rename EmailAnalysis→AnalysisResult, EmailItem→ExtractedItem, email_type→document_type across all files - Rename email_analysis.py→analysis.py (shared schema) - Change get_active_analyser() to get_active_analysers() returning all enabled analysers in priority order (ordered by ModuleConfig.priority) - Queue worker now tries each analyser in priority order, falling back to the next on failure - Update SYSTEM_PROMPT to use generic "data" language instead of "email" - Clean up email_item_names→extracted_item_names variable naming Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prompt:
This project has been vibe coded with AI and also has been heavily refactored and restructured in the meantime. Analyze the code of this project and find areas that can be improved. I mainly want to address the overall architecture and for things to follow best practices and good conventions. Also make use of official documentations by fetching them with context7. You MUST do that if using new libraries or change functions of those. Only analyze the backend. Exclude tests from analyzing. I want you to find the most severe issue and then only work on that, nothing else. Also feel free to suggest adding new libraries if appropriate. The prompt will be looped multiple times until the code is in good shape. This is run X.
To replace:
backend,Exclude tests from analyzing.X