core / journal_challenges.py
Mine production failures from the journal into standalone self-contained challenges.
Data shape
| Type | Fields |
|---|---|
MinedChallenge (line 37) | challenge · setup_script · validation_script · source_task · journal_hash · domains |
API
| Function | Purpose |
|---|---|
mine_challenges(journal_entries, max_out=3) -> List[MinedChallenge] | Extract up to 3 deduplicated challenges from journal post-mortems / failures (line 201). |
_synthesize_challenge(entry) -> Optional[MinedChallenge] | Convert a single failure entry into a standalone challenge (line 108). |
_guess_domains(text) -> List[str] | Tag by keywords: csv → data_analysis, regex → regex_parse, sql → sql, … |
pick_journal_challenge(journal) -> Optional[MinedChallenge] | Convenience wrapper used as a self-play entry point (line 228). |
Source filter
Only journal entries of type post_mortem or failure are considered. The miner scans for failure markers (error · failed · traceback · assertionerror · timeout · unresolved) and synthesises a tiny deterministic input.txt (typically 4 lines). The validator is intentionally lenient — it accepts any exit-0 output that references the expected file tokens.