Skip to content

feat(cli): --init-from — seed a run from a previous run's best program (#28)#30

Merged
aktasbatuhan merged 1 commit into
mainfrom
feat/cli-init-from
Jun 11, 2026
Merged

feat(cli): --init-from — seed a run from a previous run's best program (#28)#30
aktasbatuhan merged 1 commit into
mainfrom
feat/cli-init-from

Conversation

@aktasbatuhan

Copy link
Copy Markdown
Member

Implements the top missing item from #28: --init-from.

Chaining cycles (evolve → reseed from best → evolve) currently means manually locating run_0/best/best_program.py and copying it over initial_program.py. This flag makes it a one-liner.

What it does

  • --init-from <run_dir> resolves that run's best program: best/best_program.py, falling back to the latest checkpoints/checkpoint_*/best_program.py (numeric, not lexicographic).
  • Positional-shift convenience: with --init-from set, a single positional is treated as the evaluator, so kai run --init-from <run_dir> evaluator.py -c config.yaml works as written.
  • cli.py only — no changes to the evolution core.

Tests

4 unit tests (tests/test_cli_init_from.py): resolver prefers best/, falls back to the latest checkpoint by number, returns None when absent, and the flag parses.

On the rest of #28

While here I checked the other items — several already exist: kai compare (item 4 ✓), kai monitor (covers much of item 1's status/watch), and --target-score (partial item 3). Remaining nice-to-haves: a lightweight one-shot kai status <run_dir> and kai eval (item 5). Leaving #28 open for those.

🤖 Generated with Claude Code

Addresses #28 (item 2, the clearest missing one). `--init-from <run_dir>`
resolves a previous run's best program (best/best_program.py, falling back to the
latest checkpoint) and uses it as the initial program, so chaining cycles
(evolve -> reseed from best -> evolve) is a one-liner instead of manual file
copying. Includes a positional-shift convenience so you can pass just the
evaluator: `kai run --init-from <run_dir> evaluator.py -c config.yaml`.

4 unit tests (resolver: best/ dir, checkpoint fallback, absent; arg wiring).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@aktasbatuhan aktasbatuhan merged commit 0a0f977 into main Jun 11, 2026
1 check passed
@aktasbatuhan aktasbatuhan deleted the feat/cli-init-from branch June 11, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI ergonomics for iterative exploration (status/watch, --init-from, stop-on-target, compare, eval)

1 participant