Projects the latest admitted file edit for each path in an agent session.
Durable event ids define recency. Replaying the same event or an older event cannot replace a newer touch for the same path.
Summary
Types
How the latest admitted edit changed a file.
Why a file-edit event cannot enter the projection.
Extension-facing summary of one touched file.
Functions
Lists one session's latest file touches, most recent first.
Creates an empty touched-file projection.
Rebuilds the projection from persisted events in durable order.
Applies one durably identified event to the projection.
Validates fields required to project a file-edit event.
Types
@type action() :: :created | :modified | :deleted
How the latest admitted edit changed a file.
@type rejection() ::
{:invalid_file_edit, :event_id | :path | :before_content | :after_content}
Why a file-edit event cannot enter the projection.
@type t() :: %MingaAgent.EventLog.TouchedFiles{ by_session: %{required(String.t()) => session_entries()} }
Extension-facing summary of one touched file.
Functions
Lists one session's latest file touches, most recent first.
@spec new() :: t()
Creates an empty touched-file projection.
@spec rebuild([MingaAgent.EventLog.EventRecord.t()]) :: {:ok, t()} | {:error, rejection()}
Rebuilds the projection from persisted events in durable order.
@spec record(t(), MingaAgent.EventLog.EventRecord.t(), pos_integer()) :: {:ok, t()} | {:error, rejection()}
Applies one durably identified event to the projection.
@spec validate(MingaAgent.EventLog.EventRecord.t()) :: :ok | {:error, rejection()}
Validates fields required to project a file-edit event.