Credibility & Acceptance API
R&D uses this API to assess whether a backtest strategy meets deployability criteria and to perform acceptance calibration. The credibility harness runs verdict gates against a corpus of historical backtests (outcome snapshots) to compute per-dimension scores (Spearman correlation, win rates, tier stability, regime concentration). The operator triggers a full run against a known window and corpus, then reads back dimensions + a high-level verdict (deployable/marginal/insufficient_data/reject) for gating strategy launches. Base path:/api/internal/ (requires X-Internal-Secret header for service-principal auth).Note: All acceptance/calibration endpoints are internal-only (no Supabase JWT path today). The credibility run trigger also routes under
/api/internal/credibility/v1/.... No timeframe parameter — verdicts are daily-only.
Credibility Runs (Trigger & History)
POST /credibility/v1/runs
Trigger a single data-backed credibility run (reserves the single-flight slot, spawns the heavy tail detached, returns 202 immediately). Only one run can be in progress at a time; concurrent attempts return 409. Parameters:x-internal-caller(header, optional): caller identifier stamped on the run row (defaults to “admin”)
GET /credibility/v1/runs/latest
Fetch the most-recent run for a mode, with dimensions + presentation + engine-staleness flag. Parameters:run_mode(query, optional):"data_backed"|"ci_hermetic"(default:"data_backed")
GET /credibility/v1/runs/
Fetch a single run by ID with dimensions + presentation (404 if unknown). Parameters:run_id(path, required): integer
Same as
/runs/latest response above.
GET /credibility/v1/runs
List run history for one lens (mode, corpus, read-mode, window). Includes failed runs. Dimensions are batched in a single query. Parameters:run_mode(query, optional):"data_backed"|"ci_hermetic"(default:"data_backed")corpus_id(query, optional):"behavioral-v1"|"integrity-v1"(default:"behavioral-v1")ch_read_mode(query, optional):"final"|"no_final"(default:"final")window_id(query, optional):"W1"|"W2"|"W3"|"W4"|"W4_control"(default:"W1")limit(query, optional): integer (default: 20)
Acceptance Metrics (Phase 4 Learning Loop)
Read-only endpoints that compute acceptance gate metrics over a date range. These feed calibration analysis and deployability verdicts.GET /acceptance/report
Generate full acceptance report across all score families (composite of quality, directional, stability, regime checks + gate results). Parameters:start_date(query, required): YYYY-MM-DDend_date(query, required): YYYY-MM-DD
GET /acceptance/score-quality/
Compute score quality (Spearman correlation + tier win rates + monotonicity) for a single score family. Parameters:score_family(path, required): string (e.g.,"confluence_net_v5")start_date(query, required): YYYY-MM-DDend_date(query, required): YYYY-MM-DD
GET /acceptance/stability
Compute tier stability and churn analysis (tier transitions between consecutive snapshots, percentile drift). Parameters:start_date(query, required): YYYY-MM-DDend_date(query, required): YYYY-MM-DD
GET /acceptance/regime-concentration
Check concentration of “EXCELLENT” tier outcomes within each market regime to detect single-regime overfitting. Parameters:start_date(query, required): YYYY-MM-DDend_date(query, required): YYYY-MM-DD
GET /acceptance/tier-monotonicity/
Compute mean return by tier (EXCELLENT → GOOD → MODERATE → POOR) to verify monotonic score quality. Parameters:score_family(path, required): stringstart_date(query, required): YYYY-MM-DDend_date(query, required): YYYY-MM-DD
GET /acceptance/snapshot-status
Get status of the snapshot collection system (total collected, unique symbols/days, pending evaluations). Parameters: none Response 200:GET /acceptance/gate-status
Quick pass/fail check for all acceptance gates over the last 14 days (no date-range param). Computes Spearman (overall, bullish, bearish), EXCELLENT tier win rate, and tier churn in a single query. Parameters: none Response 200:Calibration (Weight & Confidence Tuning)
Phase 4 endpoints for fine-tuning confluencence component weights and confidence curve buckets post-acceptance.POST /calibration/weight-analysis
Compute Spearman correlations per component (institutional levels, patterns, trends) within each regime and propose renormalized weight adjustments. Parameters:regime(query, optional): regime name or null for all-regime analysis
POST /calibration/confidence-curve
Compute confidence calibration curve (buckets: 0-10, 10-20, …, 90-100) with expected vs. actual accuracy and calibration factors. Parameters:regime(query, optional): regime name or null for overall curve
GET /calibration/data-readiness
Check whether sufficient snapshot outcome data exists for calibration analysis (min trading days, min snapshots with outcomes). Parameters: none Response 200:Key Schemas
TriggerRunBody — Input to kick off a credibility run.presentation in run responses):
- deployable — All acceptance gates passed, can launch live.
- marginal — Some gates marginal but not rejected; suitable for paper-trading or limited-size live.
- insufficient_data — Not enough outcome snapshots to gate on.
- reject — One or more critical gates failed; does not meet acceptance bar.
_assign_tier logic in gate-status endpoint):
- EXCELLENT —
|score| >= 70 - GOOD —
|score| >= 55 - MODERATE —
|score| >= 40 - POOR —
|score| < 40or null
daily_regime_labels):
- BULL_HIGH_VOL, BULL_LOW_VOL
- NEUTRAL_HIGH_VOL, NEUTRAL_LOW_VOL
- BEAR_HIGH_VOL, BEAR_LOW_VOL