class

Sentinel::AntiEcho

Inherits Reference < Object

Anti-Echo Sentinel for filesystem watcher loop suppression.

Tracks impending internal file writes with path and checksum, allowing filesystem watchers to detect and suppress echo modification events within a configurable TTL window.

Constructors

new(ttl : Time::Span = 10.seconds)

Initializes the sentinel with a configurable time-to-live (default 10 seconds).

Source

Class methods

calculate_checksum(content : String) : String

Computes SHA-256 checksum after normalizing line endings from CRLF to LF.

Source

Instance methods

clear

Clears all entries from the registry (useful for test resets).

Source
evict_expired(ttl_seconds : Int32 = 10) : Nil

Explicitly evicts entries older than the specified TTL in seconds.

Source
register_write(path : String, checksum : String) : Nil

Registers an impending internal file write with path and checksum before disk commit. Evicts stale entries inline under mutex synchronization.

Source
size

Returns the current active entry count in the registry.

Source
suppressed?(path : String, current_checksum : String) : Bool

Evaluates whether a filesystem event matches an active registration. Returns true if suppressed (internal write echo), or false if external modification.

Source