feat: auto-build training dataset from DB annotations before training

- Add build_dataset_from_db() that exports candles from DB, runs feature
  engineering, and ingests span annotations into labeled CSV
- Call it automatically in _run_training_background before training starts
- Add POST /training/build-dataset endpoint for standalone use
- Add Next.js proxy route /api/training/build-dataset
- Update TrainingPanel: remove dataset-missing block on Start Training,
  show informational message that dataset builds automatically
This commit is contained in:
Marko Djordjevic 2026-02-18 00:24:39 +01:00
parent b4956f3fb9
commit d3dcfcea7d
4 changed files with 148 additions and 5 deletions

View file

@ -228,8 +228,7 @@ export default function TrainingPanel() {
}
};
const datasetMissing = datasetInfo !== null && !datasetInfo.exists;
const canTrain = !isTraining && !datasetMissing && datasetInfo !== null;
const canTrain = !isTraining;
return (
<div>
@ -272,8 +271,8 @@ export default function TrainingPanel() {
)}
</>
) : (
<p className="text-orange-500">
No training dataset found. Export annotations first.
<p className="text-muted-foreground">
No cached dataset. It will be built automatically from your annotations when training starts.
</p>
)}
</div>