Skip to content

Comments

refactor: remove P generic from Agent, SemanticMemory, CodeRetriever (M24)#423

Merged
bug-ops merged 2 commits intomainfrom
feat/m24/remaining
Feb 17, 2026
Merged

refactor: remove P generic from Agent, SemanticMemory, CodeRetriever (M24)#423
bug-ops merged 2 commits intomainfrom
feat/m24/remaining

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 17, 2026

Summary

Removes the P: LlmProvider generic parameter from core types, completing the M24 architecture improvements epic.

Architecture (#398, #407)

  • Agent<P, C, T> -> Agent<C, T> — stores AnyProvider directly
  • SemanticMemory<P> -> SemanticMemory — stores AnyProvider directly
  • CodeRetriever<P> -> CodeRetriever, CodeIndexer<P> -> CodeIndexer
  • MemoryState, IndexState lose P parameter
  • Eliminates N monomorphizations, reduces binary size and compile time

Performance (#400, #402)

Security (#414)

  • Safetensors header validation (file size, header bounds, JSON parse) before unsafe mmap

Developer experience (#406)

  • sccache setup guide added to mdBook docs

Testing

  • Centralized MockProvider in zeph-llm under mock feature flag
  • Replaces 3 ad-hoc test providers across crates

Stats

  • 21 files changed, 407 insertions, 345 deletions (-net reduction)
  • 1533 tests pass, 0 failures
  • Clippy clean, fmt clean

Breaking changes

  • Agent<P, C, T> -> Agent<C, T>
  • SemanticMemory<P> -> SemanticMemory
  • CodeRetriever<P>, CodeIndexer<P>, IndexWatcher<P> lose P
  • Test code must use mock feature for MockProvider

Test plan

  • cargo nextest run --workspace --lib --bins --features full,mock
  • cargo clippy --workspace --features full -- -D warnings
  • Code review approved
  • CI gate passes

Resolves #398, #400, #402, #406, #407, #414
Completes epic #391

…(M24)

Remove LlmProvider generic parameter from Agent<P,C,T> -> Agent<C,T>,
SemanticMemory<P> -> SemanticMemory, CodeRetriever<P> -> CodeRetriever.
All now store AnyProvider directly, eliminating monomorphization bloat.

Add cached_prompt_tokens for incremental token counting instead of
rescanning full message list on every LLM call.

Add safetensors header validation before unsafe mmap in candle loader.
Add sccache setup guide for macOS developers.
Centralize MockProvider in zeph-llm under mock feature flag.

Resolves #398, #400, #402, #406, #407, #414
Remove local MockProvider/StreamingMockProvider/FailingProvider structs
from integration tests. Use centralized zeph-llm mock module with
AnyProvider::Mock wrapper. Add mock feature flag to root Cargo.toml.
Extend MockProvider with delay_ms for timeout simulation.
@github-actions github-actions bot added the tests label Feb 17, 2026
@bug-ops bug-ops merged commit 0cd145e into main Feb 17, 2026
20 checks passed
@bug-ops bug-ops deleted the feat/m24/remaining branch February 17, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment