adk_event_filter (erlang_adk v0.7.0)

View Source

Deterministic include/exclude filters for canonical ADK event maps.

Complete tool exchanges are selection atoms. A filter either retains the call and all of its contiguous responses, or drops the whole exchange. It never re-adds an event that an exclusion rule removed. This is important at the model boundary: a lone function call or function response is not a valid provider history.

Summary

Functions

Return the multi-event exchanges present in a canonical history.

Partition chronological events into atomic context-selection units. Only complete, contiguous call/response exchanges are combined. An already-incomplete history is left unchanged rather than silently deleting data; the policy can still diagnose compressor-created partial exchanges by comparing complete source groups.

Types

normalized_filter/0

-type normalized_filter() :: map().

Functions

apply(Events, Filter)

-spec apply([map()], normalized_filter()) -> [map()].

complete_exchange_groups(Events)

-spec complete_exchange_groups([map()]) -> [[map()]].

Return the multi-event exchanges present in a canonical history.

content_type(Event)

-spec content_type(map()) -> binary().

exchange_units(Events)

-spec exchange_units([map()]) -> [[map()]].

Partition chronological events into atomic context-selection units. Only complete, contiguous call/response exchanges are combined. An already-incomplete history is left unchanged rather than silently deleting data; the policy can still diagnose compressor-created partial exchanges by comparing complete source groups.

matches(Event, Filter)

-spec matches(map(), normalized_filter()) -> boolean().

normalize(Opts)

-spec normalize(map()) -> {ok, normalized_filter()} | {error, term()}.