Skip to content

feat: outer loop Phase 1 — population, mutations, similarity, serialization #1257

Description

@akashgit

Summary

Phase 1 of the outer loop evolutionary swarm search system. Implements the foundational layer: Pydantic models, graph mutation operators, population/archive management, novelty filtering, and workflow serialization.

Components

  • factory/outer_loop/models.py — Strict Pydantic v2 models: MutationType, MutationRecord, Individual, HyperparameterRecord, SwarmConfig, OuterLoopState, GenerationSummary
  • factory/outer_loop/mutations.py — 6 structured graph mutation operators (insert_node, remove_node, redirect_edge, parallelize, serialize, mutate_params) with MutationStrategy protocol and WeightedRandomStrategy default implementation. Includes validate_and_repair for post-mutation graph integrity.
  • factory/outer_loop/population.pyPopulation (collection management, tournament selection) and MAPElitesArchive (4D quality-diversity grid with Pareto front computation)
  • factory/outer_loop/similarity.pystructural_hash (SHA-256 canonical form), graph_edit_distance, compute_features (depth/fork_degree/agent_count/gate_count), NoveltyFilter
  • factory/workflow/primitives.py — Added Workflow.to_dict() and Workflow.from_dict() for round-trip serialization with _type discriminators

Tests

85 tests across 5 test files covering all components with round-trip serialization, edge cases, and integration with all builtin workflows.

Target Branch

feat/outer-loop-evolution

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions