Skip to content

refactor: simplify feature gates, make lightweight features always-on #436

@bug-ops

Description

@bug-ops

Problem

Feature gate proliferation causes combinatorial cfg complexity in main.rs (3 separate tool_executor blocks for mcp/tui/neither) and throughout crate code. Default features that add minimal dep weight create unnecessary cfg noise.

Features to Remove (Make Always-On)

Tier 1: Zero-dep code-only flags

Feature Rationale
openai Zero new deps, just a code module
compatible Depends on openai, zero extra deps
self-learning Zero deps, one module (evolution)
orchestrator Zero deps, code-only
router Zero deps, code-only

Tier 2: Already-paid deps or minimal weight

Feature Rationale
qdrant qdrant-client already compiled via zeph-memory unconditionally
vault-age age crate is small, secret management should always be available
mcp rmcp is lightweight, eliminates worst cfg complexity in main.rs

Features to Keep Gated

tui, candle, metal/cuda, discord, slack, a2a, index, gateway, daemon, scheduler, otel, mock

Implementation Phases

  1. Remove code-only gates from zeph-llm (openai, compatible, orchestrator, router)
  2. Remove self-learning gate from zeph-skills
  3. Remove qdrant gate from zeph-skills and zeph-mcp
  4. Remove vault-age gate from zeph-core
  5. Make MCP always-on, collapse 3-way tool_executor in main.rs
  6. Update root Cargo.toml features
  7. Simplify main.rs (~40 lines removed)
  8. Clean up zeph-core forwarding features

Phases 1-4 are independent. Phase 5 depends on 3. Phases 6-8 depend on all prior.

Impact

  • ~50+ cfg annotations removed across the workspace
  • main.rs shrinks by ~40 lines
  • default = [] (everything meaningful is always-on)
  • Negligible compile time impact
  • Breaking change acceptable pre-1.0

References

  • Full plan: .local/plan/feature-gate-simplification.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions