harb/tools/push3-evolution
johba 0c4cd23dfa fix: feat: Seed kindergarten — persistent top-100 candidate pool (#667) (#683)
Fixes #667

## Changes
## Summary

Implemented persistent top-100 candidate pool in `tools/push3-evolution/evolve.sh`:

### Changes

**`--run-id <N>` flag** (line 96)
- Optional integer; auto-increments from highest `run` field in `manifest.jsonl` when omitted
- Zero-padded to 3 digits (`001`, `002`, …)

**Seeds pool constants** (after path canonicalization)
- `SEEDS_DIR` → `$SCRIPT_DIR/seeds/`
- `POOL_MANIFEST` → `seeds/manifest.jsonl`
- `ADMISSION_THRESHOLD` → `6000000000000000000000` (6e21 wei)

**`--diverse-seeds` mode** now has two paths:
1. **Pool mode** (pool non-empty): random-shuffles the pool and takes up to `POPULATION` candidates — real evolved diversity, not parametric clones
2. **Fallback** (pool empty): original `seed-gen-cli` parametric variant behavior
- Both paths fall back to mutating `--seed` to fill any shortfall

**Step 5 — End-of-run admission** (after the diff step):
1. Scans all `generation_*.jsonl` in `OUTPUT_DIR` for candidates with `fitness ≥ 6e21`
2. Maps `candidate_id` (e.g. `gen2_c005`) back to `.push3` files in `WORK_DIR` (still exists since cleanup fires on EXIT)
3. Deduplicates by SHA-256 content hash against existing pool
4. Names new files `run{RUN_ID}_gen{N}_c{MMM}.push3`
5. Merges with existing pool, sorts by fitness descending, keeps top 100
6. Copies admitted files to `seeds/`, removes evicted evolved files (never hand-written), rewrites `manifest.jsonl`

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/683
Reviewed-by: review_bot <review_bot@noreply.codeberg.org>
2026-03-13 20:45:03 +01:00
..
revm-evaluator fix: address review findings for gas-limit fitness pressure (#637) 2026-03-13 01:05:37 +00:00
seeds fix: feat: LLM seed — Fee Maximizer optimizer (#673) (#696) 2026-03-13 19:56:39 +01:00
test fix: feat: Push3 evolution — crossover operator (#639) 2026-03-13 05:54:48 +00:00
evolve.sh fix: feat: Seed kindergarten — persistent top-100 candidate pool (#667) (#683) 2026-03-13 20:45:03 +01:00
fitness.sh fix: Evolution pipeline UUPS upgrade + Foundry PATH (#593) 2026-03-12 06:47:35 +00:00
mutate-cli.ts fix: Push3 evolution: selection loop orchestrator (#546) 2026-03-11 20:56:19 +00:00
mutate.ts fix: feat: Push3 evolution — crossover operator (#639) 2026-03-13 05:54:48 +00:00
package-lock.json fix: Push3 evolution: selection loop orchestrator (#546) 2026-03-11 20:56:19 +00:00
package.json fix: Push3 evolution: mutation operators for bytecode programs (#544) 2026-03-11 16:24:24 +00:00
seed-gen-cli.ts fix: address review findings for diverse seed population (#638) 2026-03-13 05:21:05 +00:00
seed-generator.ts fix: address review findings for diverse seed population (#638) 2026-03-13 05:21:05 +00:00
tsconfig.json fix: Push3 evolution: mutation operators for bytecode programs (#544) 2026-03-11 16:24:24 +00:00