feat(jobs): add background job support for benchmarks and processing

Why:
- Long benchmark and process runs block HTTP clients; task #20 required async execution.

Changes:
- SQLite jobs table + GET /jobs and GET /jobs/{id}
- POST /benchmarks?background=true and POST /documents/{id}/process?background=true return 202 + job_id
- FastAPI BackgroundTasks execute work in-process; sync paths unchanged

Impact:
- Jobs are lost on server restart (Option A, no external queue)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-22 15:32:33 +03:30
parent 47e4846270
commit 3f9677f6aa
11 changed files with 473 additions and 40 deletions

View File

@@ -43,7 +43,7 @@ Status legend: `DONE` `IN_PROGRESS` `TODO`
| 17 | Create question-answer evaluation dataset from insurance regulation document | DONE | 12 |
| 18 | Implement HTML benchmark report generation system | DONE | 14 |
| 19 | Design HTML report structure for experiment comparison and visualization | DONE | 14 |
| 20 | Create background processing jobs for document ingestion and benchmarking | TODO | 12 |
| 20 | Create background processing jobs for document ingestion and benchmarking | DONE | 12 |
## Phase 5 — Wiring + Verification