Skip to content

refactor(api): unify EmbeddingRateEncoder with the primary Encoder API #64

Description

@rmems

Goal

Remove the split between the crate's primary Encoder / EncodedOutput interface and the separate EmbeddingRateEncoder::forward(&EncoderState) API before 1.0.

The embedding encoder currently introduces its own state and execution vocabulary, which makes the public surface less coherent and increases adapter complexity.

Scope

  • Decide whether EmbeddingRateEncoder should implement Encoder, a new explicit stateful-encoder trait, or move into a separate optional module/crate.
  • Replace panic-only construction with the crate's standard fallible constructor conventions.
  • Define state ownership and reset behavior consistently.
  • Validate input/state length mismatches through typed errors.
  • Preserve serialization support and migration guidance.
  • Update prelude exports and examples.

Design constraints

  • Do not weaken the simple Encoder API merely to accommodate one specialized encoder.
  • Avoid embedding-model or LLM-specific dependencies and terminology.
  • Keep the implementation domain-agnostic.
  • Maintain the Tier 2 encoding boundary.

Acceptance criteria

  • The embedding encoder follows one documented public trait model.
  • Construction and state validation return typed errors where appropriate.
  • Reset and streaming semantics are explicit.
  • Prelude exports are intentional and consistent.
  • Existing behavior has migration tests or documented compatibility notes.
  • README contains one end-to-end embedding encoding example.

Relationships


🤖 Authored with ChatGPT: GPT-5.6 (Medium)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestneuromorphicreadysize:MThis PR changes 30-99 lines, ignoring generated files

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions