Real IMAP connection via imapflow library: - Connects to IMAP server (IMAPFlow, TLS on port 993) - Fetches recent messages (configurable limit, default 20) - Extracts: from, fromEmail, subject, date, snippet (200 chars) - Thread-to-contact matching (PRD §6.1): 1. Match sender email against persons table 2. If no person match, extract domain and match against company.website 3. Returns matchedCompany + matchedPerson for each email - Audit-logged (action: crm.mailsync:imap) - Zod validated (host, port, user, password, folder, limit) - 502 on IMAP connection failure with detail - 400 on validation failure Tested: invalid creds → 502 'IMAP connection failed', missing host → 400
1.4 KiB
Executable File
1.4 KiB
Executable File
Figure QA For Experiment Packages
Use this before delivery or before passing figures to paper-writer.
Export bundle
The ideal bundle per figure is:
<basename>.pdffor paper reuse<basename>.svgfor editable vector text<basename>.tifffor journal upload when neededmake_<basename>.pyas the source of truth
If the environment cannot produce all three, keep PDF mandatory and note the limitation.
Editable-text rules
For matplotlib-based figures:
plt.rcParams["svg.fonttype"] = "none"
plt.rcParams["pdf.fonttype"] = 42
plt.rcParams["ps.fonttype"] = 42
This keeps SVG text editable and PDF text embedded.
Minimum QA checklist
- Figure title / axes / legend readable at final size
- No legend overlapping the data
- No default matplotlib color cycle
- Panel labels consistent across figures
- Simulated watermark present iff the run is simulated
- Figure caption can stand alone in the report
- Statistics in the caption or surrounding prose define mean/std/CI and seed count
For image-based experiment figures
If the figure contains microscopy, pathology, blots, or spatial overlays, also record:
- raw image source
- crop
- brightness/contrast handling
- scale-bar presence
- whether pseudo-coloring was applied
Anti-patterns
- 3-D bars
- pie charts for quantitative comparison
- saturated rainbow heatmaps without justification
- repeated legends in every panel
- simulated figures without visible disclosure