Skip to content

EPIC: zeph-core God Crate Decomposition #1973

@bug-ops

Description

@bug-ops

Problem

zeph-core is 83,123 LOC (40.5% of workspace) — a classic god crate. It contains agent loop, config, context management, sanitization, orchestration, experiments, subagents, pipeline, instructions, cost tracking, metrics, vault, and more. Compilation serializes through it.

Goal

Extract 4-5 independent crates from zeph-core to reduce coupling, improve compilation parallelism, and enforce module boundaries at the crate level.

Audit Reference

.local/audit/001-zeph-core-architecture.md

Proposed Extractions

  1. zeph-orchestration (5,384 LOC) — TaskGraph, DagScheduler, LlmPlanner, LlmAggregator
  2. zeph-experiments (3,958 LOC) — already feature-gated, trivial extraction
  3. zeph-sanitizer (4,337 LOC) — ContentSanitizer, ExfiltrationGuard, PII, quarantine
  4. zeph-subagent (9,108 LOC) — SubAgentManager, grants, transcripts
  5. zeph-config (8,925 LOC) — Config types shared across crates

Acceptance Criteria

  • Each extracted crate compiles independently
  • zeph-core LOC reduced below 50,000
  • Build time for incremental changes to extracted crates does not trigger zeph-core recompilation
  • All 6,160 tests pass
  • No public API changes for downstream consumers

Dependencies

Blocks all other epics (reduced crate size makes refactoring safer).

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitecture improvementsepicMilestone-level tracking issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions