POST /api/v1/jobs accepts the whole list, validates the JWT + job ownership,
and finalizes the run server-side: per-chunk verifier_checks upserts,
processed_count/valid/risky/bad heartbeats on verifier_jobs, completed/error
finalization and risky+unprocessed refunds via the service-role ledger.
This removes the 'submitting client is gone' failure class (10 of the last 15
failed CSV runs on 2026-10-20/21): the browser no longer orchestrates chunking,
so a closed/throttled tab can no longer orphan a run holding thousands of
credits. classify_engine_result mirrors src/lib/verifier.ts classify() exactly
(NXDOMAIN -> Invalid/bad, dns_timeout/a_fallback_only -> Unknown/risky).
Frontend counterpart: runBulk v2 posts /jobs and polls the DB row only, with a
legacy chunk-loop fallback for engines predating this route (404/405).
Tests: tests/test_verifier_jobs.py (12 cases: classification edges, auth,
ownership, lifecycle finalization, chunk-failure refund path).
2 days ago
v3.1.0: Part B architecture migration — eliminate Hugging Face inference credit dependency
Z User
6c516b6
- Change 1+2: new app/ml/local_scorer.py — in-process transformers
zero-shot pipeline (DistilBERT-class default
typeform/distilbert-base-uncased-mnli), device=-1, lazy load, fail-open
- Change 3: app/ml/hf_scorer.py -> app/ml/risk_scorer.py; the remote
router.huggingface.co HTTP path is REMOVED; AIRiskScorer now scores via
LocalRiskScorer with circuit breaker (model-load failure opens it
permanently) + PII-free feature-string TTL score cache (spec §2.2)
- Change 4: Dockerfile bakes model weights at build (HF_HOME=/app/models);
a running container makes zero network calls for scoring
- Change 5: HF_INFERENCE_TOKEN / ML_HF_TOKEN removed from config, .env,
.env.example, runtime.py and health status — no HF token exists in the
deployment surface
- runtime.py: EmailRiskModel drops token param (public Hub download only)
- tests: test_hf_scorer.py -> test_risk_scorer.py with local-only
architecture pins (no httpx, no remote endpoints, no token attr);
332 tests pass
- Part …