| 168 | # ── Internal helpers ────────────────────────────────────── |
| 169 | |
| 170 | def _append_history( |
| 171 | self, evolution_dir: Path, cycle: int, score: float, mutated: bool |
| 172 | ) -> None: |
| 173 | history_file = evolution_dir / "history.jsonl" |
| 174 | entry = { |
| 175 | "cycle": cycle, |
| 176 | "score": score, |
| 177 | "mutated": mutated, |
| 178 | "timestamp": datetime.now().isoformat(), |
| 179 | } |
| 180 | with open(history_file, "a") as f: |
| 181 | f.write(json.dumps(entry) + "\n") |
| 182 | |
| 183 | def _write_metrics(self, evolution_dir: Path, scores: list[float]) -> None: |
| 184 | metrics_file = evolution_dir / "metrics.json" |