fix: address review findings for evaluate-seeds.sh (#724)

- Replace unquoted heredoc (shell-injection path) with a temp file: the
  shell loop now appends tab-separated filename/score lines to a temp
  file, which is passed as a plain path argument to the Python manifest-
  rewrite block.  Python reads only file contents, never executes shell-
  expanded strings.
- Add early abort on fitness.sh exit code 2 (infra error: Anvil down,
  missing tool).  Iterating past an infra failure produces no useful
  results; aborting immediately surfaces the real problem.
- Remove unused `os` import from the manifest-rewrite Python block.
- Fix inaccurate comment in evolve.sh --diverse-seeds sampling: the pool
  sampler does a flat random shuffle with no fitness weighting; null-
  fitness seeds are not "treated as 0" — they are sampled with equal
  probability to any other seed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-15 03:29:47 +00:00
parent cb6e6708b6
commit c508efa31f
2 changed files with 33 additions and 19 deletions

View file

@ -344,9 +344,10 @@ if [ "$DIVERSE_SEEDS" = "true" ]; then
# the pool has any usable entries, avoiding a second manifest parse).
#
# NOTE: seeds with fitness: null (e.g. llm-origin entries not yet evaluated)
# are included in the sample with no filtering — their effective_fitness is
# treated as 0 by the pool-admission logic. Run evaluate-seeds.sh to score
# them and write real fitness values back to manifest.jsonl.
# are included in the sample with equal probability to any other seed — the
# pool sampler does a flat random shuffle and does not read or weight by
# fitness at all. Run evaluate-seeds.sh to score them and write real fitness
# values back to manifest.jsonl.
POOL_SAMPLE_LIST="$WORK_DIR/pool_sample.txt"
POOL_COUNT=0
if [ -f "$POOL_MANIFEST" ]; then