Commit Graph

9 Commits

Author SHA1 Message Date
root 8b3a2cbf7e B2: tolerant JSON extraction from Claude responses + graceful fallback
_extract_json_payload handles a json/JSON/bare fence, raw JSON and JSON
embedded in prose; any unparseable response or contract violation now
degrades to the deterministic scoring_service instead of raising.
Also guards the response envelope itself (content[0].text).

B3: single home for recommendation scoring

services/recommendation_service.py holds the rules; routers/stats.py and
backend/services/stats_service.py both delegate to it. Unified rules are the
union of the two old copies: same weights/threshold, substring matching
(superset of the old exact match), tolerant key aliases, health_flags rule
kept. Endpoint response contract unchanged.

Plus: Overpass circuit breaker and concurrent zone queries in geo_service -
128 sequential calls per analysis no longer each burn a connect timeout when
the host has no outbound network.

Tests: 152 -> 194 passed.
2026-07-25 13:01:02 +00:00
root cd65116a2a A2-A6: logging instead of print, claude-sonnet-5 model id, timezone-aware datetime, FastAPI lifespan, .docx parse errors -> HTTP 400 2026-07-25 11:57:03 +00:00
root 6ca59a04d0 A8: remove dead backend code (old api/ copy, models_* duplicates, .bak files) 2026-07-25 11:48:30 +00:00
Sadmin 5490f3c5f2 A1: guard None/empty args in distance_service coefficients 2026-07-23 21:41:40 +00:00
root 14b3f1af45 P3 auth cors and distance fixes 2026-06-08 16:38:01 +00:00
root 36123d784f P1 auth, CORS, and SQL filtering 2026-06-08 16:21:23 +00:00
root 4e80a0bdfe Make backend start on PostgreSQL 2026-06-08 11:50:29 +00:00
root 3548733019 Fix admin import chain and tests 2026-06-06 20:59:23 +00:00
root fcc22063ed Import Vector lab project 2026-06-06 18:31:55 +00:00