adk_event_filter (erlang_adk v0.7.0)
View SourceDeterministic 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
-type normalized_filter() :: map().
Functions
-spec apply([map()], normalized_filter()) -> [map()].
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.
-spec matches(map(), normalized_filter()) -> boolean().
-spec normalize(map()) -> {ok, normalized_filter()} | {error, term()}.