verbose live UI + tool-level SSE events + Groq default + regression tests

This commit is contained in:
2026-06-03 05:04:29 -03:00
parent 131f4d9b86
commit e124a8a7d9
69 changed files with 3030 additions and 137 deletions

View File

@@ -0,0 +1,50 @@
# Domain metrics for the financial schema. The planner reads this so it can
# resolve a business term ("default rate", "loan volume") to a canonical SQL
# expression instead of guessing.
schema: financial
metrics:
loan_default_rate:
description: Fraction of finished loans that ended in default (status 'B'). Excludes still-running loans.
sql: "AVG(CASE WHEN status = 'B' THEN 1.0 WHEN status = 'A' THEN 0.0 END)"
from_table: loan
filter: "status IN ('A','B')"
unit: ratio
at_risk_loan_share:
description: Of currently running loans, the share that are in debt (status 'D').
sql: "AVG(CASE WHEN status = 'D' THEN 1.0 WHEN status = 'C' THEN 0.0 END)"
from_table: loan
filter: "status IN ('C','D')"
unit: ratio
loan_volume:
description: Total CZK lent.
sql: "SUM(amount)"
from_table: loan
unit: CZK
average_loan_amount:
description: Mean loan size in CZK.
sql: "AVG(amount)"
from_table: loan
unit: CZK
transaction_volume:
description: Total CZK moved through transactions (credits + debits, absolute).
sql: "SUM(amount)"
from_table: trans
unit: CZK
active_accounts:
description: Distinct accounts with at least one transaction in the period.
sql: "COUNT(DISTINCT account_id)"
from_table: trans
unit: count
unemployment_rate_96:
description: District unemployment rate in 1996 (already a percentage).
sql: "A13"
from_table: district
unit: percent