Background
The README advertises extensibility and TextChunker.ChunkerBehaviour defines the contract for splitting strategies, but the option schema validates :strategy with {:in, [RecursiveChunk]} — so a third-party module implementing the behaviour is rejected by validation. Users cannot actually plug in their own strategy, which contradicts both the behaviour's existence and the README's "Extensibility" feature bullet.
The fix is confined to the option schema in TextChunker.split/2: replace the {:in, ...} validation with a custom NimbleOptions validator that accepts any module implementing the behaviour (e.g. checks function_exported?(mod, :split, 2) after ensuring it is loaded). The strategies themselves need no changes.
Acceptance Criteria
Scenario: Custom strategy module is accepted
Scenario: Invalid strategy is rejected with a clear error
Scenario: Documentation matches behavior
Background
The README advertises extensibility and
TextChunker.ChunkerBehaviourdefines the contract for splitting strategies, but the option schema validates:strategywith{:in, [RecursiveChunk]}— so a third-party module implementing the behaviour is rejected by validation. Users cannot actually plug in their own strategy, which contradicts both the behaviour's existence and the README's "Extensibility" feature bullet.The fix is confined to the option schema in
TextChunker.split/2: replace the{:in, ...}validation with a custom NimbleOptions validator that accepts any module implementing the behaviour (e.g. checksfunction_exported?(mod, :split, 2)after ensuring it is loaded). The strategies themselves need no changes.Acceptance Criteria
Scenario: Custom strategy module is accepted
TextChunker.ChunkerBehaviourstrategy:toTextChunker.split/2split/2is invoked with the validated optionsScenario: Invalid strategy is rejected with a clear error
{:error, message}explaining the module must implementTextChunker.ChunkerBehaviourScenario: Documentation matches behavior