feat: Expand OCR with fuel receipt scanning and maintenance extraction (#129) #147

Merged
egullickson merged 26 commits from issue-129-expand-ocr-fuel-receipt-maintenance into main 2026-02-13 02:25:55 +00:00
2 changed files with 6 additions and 3 deletions
Showing only changes of commit 55a7bcc874 - Show all commits

View File

@@ -119,7 +119,11 @@ class ManualExtractor:
f"Extraction complete: {len(schedules)} schedules in {processing_time_ms}ms"
)
update_progress(100, "Complete")
# Note: do NOT send 100% progress here. The caller sets status=COMPLETED
# after this returns. Because this runs in a thread executor and the
# progress callback uses run_coroutine_threadsafe (fire-and-forget),
# a 100% update here races with complete_manual_job() and can overwrite
# COMPLETED back to PROCESSING.
return ManualExtractionResult(
success=True,

View File

@@ -108,12 +108,11 @@ class TestNormalExtraction:
extractor.extract(_make_pdf_bytes(), progress_callback=track_progress)
# Should have progress calls at 10, 50, 95, 100
# Should have progress calls at 10, 50, 95 (100% is set by complete_manual_job)
percents = [p for p, _ in progress_calls]
assert 10 in percents
assert 50 in percents
assert 95 in percents
assert 100 in percents
# Percents should be non-decreasing
assert percents == sorted(percents)