Goal
Expose the experiment results validation pipeline via API and display results on experiment detail pages. The core pipeline (record_result, compare_to_prediction, update_hypothesis_from_result) already exists in experiment_validator.py. Missing: (1) API endpoint to record results, (2) results display on experiment detail page.
Acceptance Criteria
☑ POST /api/experiments/{id}/results endpoint records experiment results and triggers hypothesis score updates
☑ Experiment detail page displays all results for that experiment
☑ Results show outcome, confidence, summary, and linked predictions
☑ Price history is logged when hypothesis scores update (handled by experiment_validator.record_result())
Approach
Add Pydantic models for experiment result input
Add POST /api/experiment/{id}/results endpoint in api.py that calls experiment_validator.record_result()
Add results section to experiment_detail() HTML page (around line 29607, after Debate History)
Test the API endpoint and page displayDependencies
- experiment_validator.py (already implemented)
- experiment_results table (already exists)
- hypothesis_predictions table (already exists)
Dependents
- Quest work on experiment tracking and hypothesis validation
Work Log
2026-04-13 — Slot minimax:51
- Investigated current state: experiment_results table exists, experiment_validator.py has core pipeline
- Core functions present: record_result(), compare_to_prediction(), update_hypothesis_from_result(), get_experiment_results()
- Gap identified: No API endpoint to record results, experiment_detail page doesn't display results
- Implemented:
- Added ExperimentResultCreate Pydantic model
- Added POST /api/experiments/{experiment_id}/results endpoint that calls experiment_validator.record_result()
- Added exp_results query to experiment_detail() function
- Added results HTML section showing outcome, confidence, score impact, predictions, and evidence sources
- Committed and pushed: 3d4260ea9 [task:5f27f904-d33b-4f57-9c05-110d93f20ad9]
- Result: Done — API endpoint and experiment detail display implemented