infoxtractor/src/ix
Dirk Riemann 406a7ea2fd
All checks were successful
tests / test (push) Successful in 1m15s
tests / test (pull_request) Successful in 1m8s
feat(worker): async worker loop + one-shot callback delivery (spec §5)
Worker:
- Startup: sweep_orphans(now, max_running_seconds) rescues rows stuck
  in 'running' from a crashed prior process.
- Loop: claim_next_pending → build pipeline via injected factory → run
  → mark_done/mark_error → deliver callback if set → record outcome.
- Non-IX exceptions from the pipeline collapse to IX_002_000 so callers
  see a stable error code.
- Sleep loop uses a cancellable wait so the stop event reacts
  immediately; the wait_for_work hook is ready for Task 3.6 to plug in
  the LISTEN-driven event without the worker knowing about NOTIFY.

Callback:
- One-shot POST, 2xx → delivered, anything else (incl. connect/timeout
  exceptions) → failed. No retries.
- Callback record never reverts the job's terminal state — GET /jobs/{id}
  stays the authoritative fallback.

7 integration tests: happy path, pipeline-raise → error, callback 2xx,
callback 5xx, orphan sweep on startup, no-callback rows stay
callback_status=None (x2 via parametrize). Unit suite still 209.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 11:49:54 +02:00
..
adapters feat(rest): FastAPI adapter + /jobs, /healthz, /metrics routes (spec §5) 2026-04-18 11:47:04 +02:00
contracts feat(contracts): ResponseIX + Provenance + Job envelope (spec §3, §9.3) 2026-04-18 10:50:22 +02:00
genai feat(clients): OCRClient + GenAIClient protocols + fakes (spec §6.2, §6.3) 2026-04-18 11:08:24 +02:00
ingestion feat(ingestion): fetch_file + MIME sniff + DocumentIngestor (spec §6.1) 2026-04-18 11:12:00 +02:00
ocr feat(clients): OCRClient + GenAIClient protocols + fakes (spec §6.2, §6.3) 2026-04-18 11:08:24 +02:00
pipeline feat(pipeline): ResponseHandlerStep — shape-up final payload (spec §8) 2026-04-18 11:21:36 +02:00
provenance feat(provenance): mapper + verifier for ReliabilityStep (spec §9.4, §6) 2026-04-18 11:01:19 +02:00
segmentation feat(segmentation): SegmentIndex + prompt-text formatter (spec §9.1) 2026-04-18 10:53:46 +02:00
store feat(store): JobsRepo CRUD over ix_jobs + integration fixtures (spec §4) 2026-04-18 11:43:11 +02:00
use_cases feat(use_cases): registry + bank_statement_header (spec §7) 2026-04-18 10:51:43 +02:00
worker feat(worker): async worker loop + one-shot callback delivery (spec §5) 2026-04-18 11:49:54 +02:00
__init__.py feat(scaffold): project skeleton with uv + pytest + forgejo CI 2026-04-18 10:36:43 +02:00
app.py feat(rest): FastAPI adapter + /jobs, /healthz, /metrics routes (spec §5) 2026-04-18 11:47:04 +02:00
config.py feat(config): AppConfig + cached get_config() (spec §9) 2026-04-18 11:38:44 +02:00
errors.py feat(errors): add IXException + IXErrorCode per spec §8 2026-04-18 10:46:01 +02:00