feat(engine+edge): live vehicles + screening endpoints, entity-resolution + job-queue + financials modules
Edge /api/vehicles (RDW NL, live now) + /api/screen (OpenSanctions, live now), both defer to engine when ENGINE_URL set. Engine: /vehicles/{plate} + /screen endpoints; workers/resolve (blocking+fuzzy entity resolution, now used by pipeline); workers/queue (in-process job queue); sources/financials (Companies House accounts + XBRL path). py_compile + tsc + next build green.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
@@ -7,7 +7,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from rapidfuzz import fuzz
|
||||
from workers.resolve import resolve
|
||||
|
||||
from sources.connectors import (
|
||||
CompanyResult,
|
||||
@@ -70,14 +70,8 @@ async def run_job(order_id: str, config: dict[str, Any]) -> dict[str, Any]:
|
||||
break # first compliant source that answers wins
|
||||
per_market[market] = got
|
||||
|
||||
# 3) structuring — dedup by fuzzy name within market
|
||||
deduped: list[dict[str, Any]] = []
|
||||
for r in records:
|
||||
dup = next((d for d in deduped if d["market"] == r["market"] and fuzz.ratio(d["name"], r["name"]) > 92), None)
|
||||
if dup:
|
||||
dup["confidence"] = min(0.99, dup["confidence"] + 0.1) # corroboration bump
|
||||
else:
|
||||
deduped.append(r)
|
||||
# 3) structuring — entity resolution (blocking + fuzzy match + corroboration)
|
||||
deduped = resolve(records)
|
||||
|
||||
# 4) enrichment/fusion already folded into confidence above.
|
||||
# 5) QA — drop rows below the order's confidence threshold.
|
||||
|
||||
Reference in New Issue
Block a user