Spaces:
Sleeping
Sleeping
Commit History
-
Deploy d12ef1c: Return 503 from key verification when the key store is unreachable
github-actions[bot]Synced from Octavio-Loffaro/frig-scoring@d12ef1ca313b1b87eb85c20f63ef903376567532546d4ad -
Deploy 193667e: Accept RFC-3339 timestamps, merge merchant_name, return 503 on datastore outage
github-actions[bot]Synced from Octavio-Loffaro/frig-scoring@193667e949405e5237093f50a452911b9aa980be7eddf0d
-
Deploy 820ac93: Hash stored API keys; migrate existing ones in place
github-actions[bot]Synced from Octavio-Loffaro/frig-scoring@820ac93f0036ba7be9c800b0a2ead74ccaa071d6f38e611
-
Deploy 145e7d4: Run without a database when only scoring is needed
github-actions[bot]Synced from Octavio-Loffaro/frig-scoring@145e7d4bea25c90e12f27eb24099c9913b15239efa24328 -
Production hardening: real calibration, request limits, logging, unified policy
F15 - Calibration measured against observed outcomes, not coin flips. /continuous-update and /autonomous-cycle computed ECE against np.random.choice([0,1], p=[0.8,0.2]). The verdict was written to calibration_memory and /shadow-learning-status reported it back as the safety gate status, so random numbers became a governance judgement and were then presented as evidence the model was behaving. fetch_matured_calibration_pairs() joins model_predictions to risk_outcomes on (user_id, snapshot_date), keeps only rows whose target_date has passed, and refuses to report anything below 30 matched pairs or on a single class. Verified end to end: 29 real pairs -> ECE 0.1931, recalibration correctly flagged; 0 pairs -> "not enough matured data", nothing invented. F11 - /shadow-learning-status stops reporting literals as telemetry. fgi, both AUCs and transfer_auc were hardcoded and the gate was computed from them. Unmeasured quantities are now null with a stated reason and t…ff54386
-
Add stateless payload scoring: POST /score
The service was a system of record, not a scoring API: /risk-score took only a user_id and issued nine reads against users, accounts, transactions and feature_snapshots. Scoring anyone required their financial data to already live in our database, which is the wrong custody model for a tool an application calls with its own users' data. POST /score accepts {profile, accounts, transactions} and returns the full risk profile. Verified to open zero database connections. Incomplete input is treated as the normal case, not an error: - Every field is optional. The engine falls back through the calibrated model, the thin-file path and the cold-start heuristic on what is usable, and reports the outcome in `coverage` (signals present, history days, sufficiency tier). - Malformed input is separated from missing input. Unrecognised category labels, an inverted amount sign, an unknown market and out-of-range values are returned as `warnings` and the affected signal is treated as absent r…096fb77 -
Fix scoring engine: restore ML path, remove synthetic ensemble, secure key issuance
Brings the Space up to date with the audit fixes. Availability: - sqlite3 shim re-exports the real Row/Connection/Cursor. The stub Row broke the SQLite path outright and the missing Connection broke pandas.read_sql_query at 17 call sites, which silently dropped every request to the baseline heuristic. - init_db() no longer aborts module import, so a database outage returns 503 DEGRADED from /health instead of crash-looping uvicorn. - Unknown user_id returns 404 rather than scoring default features and leaking a foreign-key error; all scoring connections are wrapped in try/finally with rollback, so one failed request no longer leaves a write lock behind. Scoring correctness: - Snapshot date defaults to the user's own latest transaction rather than the global maximum, which had left 98% of users on the cold-start heuristic. Adds a data_freshness block reporting snapshot age. - Removes the synthetic ensemble that added np.random.normal() noise to the XGBoost output four …992fce0
-
Remove temporary diagnostic endpoint
c6b4670 -
Add temporary diagnostic endpoint to api.py
42797ed
-
Update health endpoint to test database connection directly
ffd2cc6 -
Deploy financial risk API to Hugging Face
bc308f6