Skip to content

[Bug]: update_frontier raises IndexError when frontier has no scored programs #60

Description

@blrain3

Summary

ProgramManager.update_frontier() raises IndexError: list index out of range when get_frontier_with_scores() returns an empty list (all frontier programs have score=None).

Reproduction

from src.registry import ProgramManager

manager = ProgramManager("/path/to/repo")

# Manually mark a program as frontier without a score
manager.create_program("base", config_without_score)
manager.mark_frontier("base")

# Later, try to update frontier with a scored program
manager.update_frontier("iter-1", 0.85)

Expected: The unscored program is either included with a default score or the comparison is skipped.

Actual: get_frontier_with_scores() filters out all programs with score=None, returning an empty list. Then scored[-1] raises IndexError: list index out of range.

Root Cause

In src/registry/manager.py:

  • get_frontier_with_scores() (line 325-344): if score is not None filters out unscored programs
  • update_frontier() (line 423): worst_name, worst_score = scored[-1] — if all frontier programs are unscored, scored is empty and scored[-1] raises IndexError

Trigger Conditions

This happens when:

  1. A program is added to frontier via mark_frontier() without being evaluated, OR
  2. Config read fails for all frontier programs (the except Exception: continue on line 341 silently skips them), OR
  3. ProgramConfig.get_score() returns None for all frontier members

Impact

  • The self-improving loop crashes mid-run, losing all progress
  • The error is silent until it happens; no validation prevents unscored programs from entering the frontier

Suggested Fix

Handle empty scored list in update_frontier:

scored = self.get_frontier_with_scores()
if not scored:
    # No scored programs yet; add unconditionally
    self.mark_frontier(name)
    return True

Or default score to 0.0 in ProgramConfig.get_score() instead of returning None.

Environment

  • EvoSkill version: latest (2026-09-16)
  • Python: 3.11

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions