Skip to content

Phase EJ Step 6: Budget-aware final-generation fit + SKILL.md flags documentation #287

Description

@aberson

Build step 6 of 8 — Phase EJ (umbrella #281)

Build doc: documentation/plans/evolve-judging-plan.md §7 Step EJ.6

What to build

A generation that starts with insufficient remaining budget dispatches the full pool and dies mid-fitness (_budget_exceeded break at scripts/evolve.py L3542-3549), stranding up to ~25 games of un-actionable results a night.

Behind --budget-fit: before the fitness phase, estimate per-eval wall-clock from this run's completed evals (no observed data on generation 1 → no trim), reserve budget for stack-apply (0 games) + one regression (games_per_eval games) + the gauntlet when --fitness-mode ∈ {baseline, both}, and trim active_idxs to the top-rank prefix that fits — never below 1. Log one phase: "budget_fit" row with the dropped count (no silent caps).

Also: document all six Phase EJ flags in .claude/skills/improve-bot-evolve/SKILL.md's Flags table (EJ.4's pairing warning included).

Existing context

  • Budget check _budget_exceeded (scripts/evolve.py L1274-1283); mid-fitness break L3542-3549 strands the generation when the budget dies mid-pool.
  • Budget fit trims before dispatch, never below 1. Per-eval cost is estimated from THIS run's own completed evals (self-calibrating — resolves the investigation's "3 min/game vs ~55 games/hour" throughput inconsistency by measuring, not assuming). Fit engages from generation 2.
  • This step is the docs roll-up AND serializes the shared-file edits (must run after EJ.1–EJ.5 land in scripts/evolve.py).

Files to modify/create

  • scripts/evolve.py (--budget-fit flag + trim logic; budget_fit rows)
  • .claude/skills/improve-bot-evolve/SKILL.md (Flags table: all six Phase EJ flags with defaults)
  • tests

Done when

Unit tests cover: trim to fitting prefix (rank order preserved); never trims below 1; generation-1 no-op; reserve accounts for regression + gauntlet; flag OFF → byte-identical dispatch. SKILL.md lists all six flags with defaults. uv run pytest / mypy src bots --strict / ruff check . clean; test count ≥ baseline.

Flags (recommended)

--reviewers code

Depends on

#282, #283, #284, #285, #286 (docs roll-up documents all six flags; also serializes the shared scripts/evolve.py edits — must land last)

Parallel-safe with

none — strictly sequential (edits scripts/evolve.py; hard Depends on all prior EJ code steps; plan §4 mandates serial execution)

Produces

--budget-fit flag + trim logic in scripts/evolve.py; budget_fit rows; SKILL.md Flags table update; tests

Operator workflow notes (autonomous + UI-bundle + parallel)

  • Runs end-to-end via /build-step; the Done when is the gate.
  • No --ui — backend + SKILL.md doc.
  • Serial + depends on EJ.1–EJ.5 (last code step).

Synced from documentation/plans/evolve-judging-plan.md by /repo-sync at c6099d9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions