Commit bf29437
committed
Complete the ZCQL tool registry port; fix unhandled backend-bootstrap crash
ZCQL_TOOL_REGISTRY was missing query_crimes, find_person_by_name,
crime_forecast, sociological_insights, money_trail, legal_rag,
officer_caseload, and court_caseload -- meaning ZCQL mode couldn't answer
most questions at all, silently, regardless of what tool the agent tried
to call. All eight are now ported, reusing the exact same *_PARAMS
schemas from engine/tools.py rather than redefining them, and preserving
every jurisdiction-scoping guarantee from the SQL versions (verified via
parity tests: district-scoped users see nothing outside their district,
COMMAND/ADMIN see everything). money_trail avoids ZCQL's unconfirmed OR
support by doing two IN-filtered fetches merged in Python instead of a
single OR'd query. sociological_insights keeps the same caste/religion
exclusion regression test as the SQL path.
Also fixes the crash chat.py's get_data_backend() call was exposed to:
any Catalyst SDK bootstrap hiccup (bad credentials, a transient error --
confirmed live once already this session, via a bad ZCQL column name)
took down the entire chat pipeline with a bare 500, for every request,
with zero graceful degradation. get_data_backend() now catches that and
falls back to the sql backend, logging a warning instead of crashing.
360 tests pass (23 new); ruff check and ruff format --check both clean.1 parent 82aa968 commit bf29437
4 files changed
Lines changed: 1043 additions & 17 deletions
File tree
- backend
- app
- catalyst
- tests
0 commit comments