debug: expose full inputs/outputs in Recalculer response for diagnosis

_run_auto_analysis now returns a rich dict {ok, inputs, node_values, actual_moves, error}
instead of bool. The refresh endpoint captures and forwards:
- inputs: what values were fed to evaluate_graph
- node_keys: which nodes were computed in prediction
- actual_moves: actual price pips fetched
- run_error: exception message if it failed

Frontend shows all of this after clicking Recalculer so the root cause is visible.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OpenSquared
2026-06-29 23:09:49 +02:00
parent af73b77cba
commit c73bedd7d0
2 changed files with 29 additions and 18 deletions

View File

@@ -1152,13 +1152,16 @@ function ExplanationScore({
: <span>Refresh: {debugInfo.refreshed} ok / {debugInfo.failed} err / {debugInfo.total} total</span>
}
{debugInfo.details?.map((d: any, i: number) => (
<div key={i} className="mt-0.5">
#{d.event_id} {(d.event_name ?? '').slice(0, 22)} <span className={d.result === 'ok' ? 'text-emerald-600' : 'text-red-500'}>{d.result}</span>
{d.surprise_pct != null
? <span className="text-cyan-700 ml-1">surp:{Number(d.surprise_pct).toFixed(1)}%</span>
: d.actual_value != null
? <span className="text-amber-700 ml-1">act:{d.actual_value} exp:{d.expected_value ?? '?'}</span>
: <span className="text-red-800 ml-1">surp=null</span>}
<div key={i} className="mt-1 border-t border-slate-800/40 pt-1">
<span className={d.result === 'ok' ? 'text-emerald-500' : 'text-red-500'}>{d.result}</span>
<span className="text-slate-500 ml-1">#{d.event_id} {(d.event_name ?? '').slice(0, 20)}</span>
{d.run_error && <span className="text-red-400 ml-1">err:{d.run_error.slice(0, 40)}</span>}
<div className="ml-2 text-slate-600">
surp:{d.surprise_pct != null ? Number(d.surprise_pct).toFixed(1)+'%' : `null (act=${d.actual_value} exp=${d.expected_value})`}
{' | '}inputs:{JSON.stringify(d.inputs ?? {})}
{' | '}pred_keys:[{(d.node_keys ?? []).join(',')}]
{' | '}actual:{JSON.stringify(d.actual_moves ?? {})}
</div>
</div>
))}
</div>