Skip to content

refactor(epic-1973): Extract experiments logic into zeph-experiments crate (Phase 1d)#2008

Merged
bug-ops merged 3 commits intomainfrom
phase-1d-experiments
Mar 19, 2026
Merged

refactor(epic-1973): Extract experiments logic into zeph-experiments crate (Phase 1d)#2008
bug-ops merged 3 commits intomainfrom
phase-1d-experiments

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 19, 2026

Summary

Completes Phase 1d of god-crate decomposition: extract ExperimentEngine and all experiment-related logic from zeph-core into new zeph-experiments Layer 2 crate.

Changes

  • New crate: crates/zeph-experiments/ (3,958 LOC extracted from zeph-core/src/experiments/)

    • ExperimentEngine, Evaluator, BenchmarkSet, GridStep, Random, Neighborhood, ParameterRange, SearchSpace, ConfigSnapshot, GenerationOverrides, and all related types
    • All experiment-related helper functions and constants
    • Comprehensive test suite preserved
  • Modified files:

    • zeph-core/Cargo.toml: added zeph-experiments dep, propagated experiments feature flag
    • zeph-core/src/lib.rs: thin re-export shim (pub mod experiments { pub use zeph_experiments::* }) + integration test
    • Workspace Cargo.toml: added zeph-experiments to members + workspace dependencies
    • src/scheduler.rs: updated import paths to use re-exported symbols
    • CHANGELOG.md: documented extraction

Architecture

Layering (verified):

  • Layer 0: zeph-common (utility functions)
  • Layer 1: zeph-config, zeph-vault (pure data + simple traits)
  • Layer 2: zeph-experiments, zeph-llm, zeph-memory, zeph-channels, zeph-tools, zeph-core
  • zeph-experiments depends only on: zeph-config, zeph-llm, zeph-memory, and standard crates

API Preservation: zeph-core re-exports all experiments symbols via public use, preserving 20+ import paths (crate::experiments::ExperimentEngine, etc.)

Validation

Tester: 5,917/5,917 tests pass (no regressions)
Code quality: cargo +nightly fmt --check ✓ | cargo clippy --workspace --features full -- -D warnings
Standalone build: zeph-experiments compiles independently
Feature flags: experiments feature properly gated, mock features working

Quality Checks

  • cargo +nightly fmt --check
  • cargo clippy --workspace --features full -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins: 5,917/5,917 ✓
  • Standalone zeph-experiments build: ✓

Test Plan

  • All 5,917 tests pass with experiments crate extracted
  • No import path changes for downstream code using crate::experiments::*
  • Feature flag propagation verified (experiments enabled/disabled)
  • Compilation with full feature matrix passes
  • Code review checks passed (formatting, clippy, test coverage)

Related

…crate (Phase 1d)

- New `zeph-experiments` crate at Layer 2 with ExperimentEngine, Evaluator, and all experiment-related types
- Extracted: engine.rs, evaluator.rs, benchmark.rs, grid.rs, neighborhood.rs, random.rs, search_space.rs, snapshot.rs, types.rs, generator.rs, error.rs (3,958 LOC)
- `zeph-core/src/experiments` replaced with thin re-export shim preserving all import paths (crate::experiments::*)
- Feature flag `experiments` propagated to zeph-experiments; all public API preserved
- Updated workspace Cargo.toml to include zeph-experiments
- All 5,917 tests pass
- CI checks pass: cargo +nightly fmt, cargo clippy, cargo nextest
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate dependencies Dependency updates refactor Code refactoring without functional changes size/M Medium PR (51-200 lines) labels Mar 19, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 19, 2026 00:46
@bug-ops bug-ops merged commit ac2c1ce into main Mar 19, 2026
20 checks passed
@bug-ops bug-ops deleted the phase-1d-experiments branch March 19, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation refactor Code refactoring without functional changes rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant