FindMyFiles

FindMyFiles.Engine Namespace

Classes
CountersDataDegradation counters of the stats JSON (snake_case keys — deserialize with SnakeCaseLower). Generated from the contract's counter-name registry; nonzero values surface in the F12 panel.
EngineClientFactoryEngine transport selection, in priority order: CLI flags (--fake-engine / --engine=pipe|inproc / --pipe-name=…) > settings.json "engine" > auto. Auto probes the service pipe for 250ms (through Hello) and falls back to the in-proc FFI engine when no service answers.
EngineEventMarshalerThe single crossing point from engine threads to the UI thread. IEngineClient events fire on engine / pipe read-loop threads; this class subscribes to all four, marshals each through TryEnqueue(Action) and re-raises it as its own event on the UI thread. Consumers (ViewModels, the orchestrator) attach plain handlers and never marshal themselves — the per-subscriber inline `dispatcher.TryEnqueue` lambdas this replaces were the audit's "scattered crossing" finding. The upstream delegates are held in fields for the subscription lifetime (the GC-rooting rule for callback delegates, satisfied structurally).
EngineExceptionThe engine rejected an operation with a structured error code (the transport is alive but the engine returned a failure). The code maps to the `FMF_E_*` table in docs/ARCHITECTURE.md.
EngineStatsDataThe whole observability snapshot behind the F12 perf panel — what GetStatsAsync(CancellationToken) returns (the UI subset of fmf-core's MetricsSnapshot).
EngineUnavailableExceptionThe engine transport is down (pipe disconnected, request timed out, service not running). Pending requests fail fast with this; the supervisor keeps reconnecting in the background.
ErrorEventDataOne entry from the engine's diagnostic ring (WARN+ events and panics; mirrors fmf-core's ErrorEvent). Pulled on demand after an EngineErrorOccurred signal and listed in the F12 panel.
FakeEngineClientDeterministic in-memory engine for UI tests and unelevated development (`--fake-engine`). 100k entries from a fixed seed; substring search only. Contract-conforming (EngineClientContractTests): query-syntax verdicts come from the shared golden fixture (contract/golden/invalid_queries.json, pinned by the real Rust parser — verdict drift is caught on the Rust side), cancellation is honored, and BumpEpoch() lets tests drive the Stale→requery recovery path without a real engine.
FfiEngineClientIn-proc engine client over fmf_engine.dll. Events arrive on engine threads; consumers marshal to the UI thread themselves.
IndexStatsDataMemory accounting and generation state for one volume index (subset of fmf-core's IndexStats the UI surfaces). Feeds the bytes/entry gate in the F12 panel.
PipeEngineClientEngine client over the fmf-service named pipe (docs/ARCHITECTURE.md "Pipe protocol"). This class is the connection *supervisor* plus the request multiplexing table; the established connection itself (stream, read loop, serialized writer, epoch) is one FindMyFiles.Engine.PipeConnection object, replaced wholesale on every (re)connect. The supervisor loop: connect → server-is-SYSTEM check (default pipe name only; SECURITY.md Threat 4) → Hello (version check; a mismatch is fatal) → Subscribe → IndexStatus (synthesized VolumeUpdated + IndexChanged) → Connected. On disconnect every pending request fails fast with EngineUnavailableException, live results turn stale because their connection's epoch can never be current again, and reconnection retries forever with 250ms→5s backoff. Events fire on the read-loop thread — consumers marshal (see EngineEventMarshaler), same contract as the FFI client. No DispatcherQueue dependency.
QuerySyntaxExceptionThe query string is syntactically malformed and SearchAsync(string, SearchOptions, CancellationToken) failed to parse it.
QueryTraceDataStage breakdown of one query (mirrors fmf-core metrics.rs).
RowDataOne result row decoded from a page (the C# face of fmf-core's 48-byte FmfRow plus its WTF-8 name/path strings). Immutable; the UI's ResultRow view-model is filled from it.
SearchOptionsThe knobs that shape a search, passed to SearchAsync(string, SearchOptions, CancellationToken) (the C# face of fmf-core's FmfQueryOptions).
SearchOutcomeWhat SearchAsync(string, SearchOptions, CancellationToken) returns: the materialized ISearchResult the UI pages through, paired with the per-query QueryTraceData the engine attached (null when tracing was unavailable, e.g. a serialization failure — the result is still valid).
StaleResultExceptionThe index was structurally rebuilt and the row IDs of a held result handle are now invalid (thrown from GetRangeAsync(long, int, CancellationToken)). Recovery is to re-run the query.
TransportStatsDataClient-side pipe transport metrics. Null for in-proc clients; the pipe client fills it on every GetStatsAsync(CancellationToken).
UsnTraceDataOne applied USN journal batch — how a burst of filesystem changes landed in the index (mirrors fmf-core's UsnTrace). Drives the change-reflection latency shown in the perf panel.
VolumeStatusA volume's current index status — the payload of an VolumeUpdated event and of GetStatusAsync(CancellationToken).
Interfaces
IEngineClientThe single boundary the app uses to talk to the engine (docs/ARCHITECTURE.md). Implementations: PipeEngineClient (named pipe to fmf-service), FfiEngineClient (in-proc DLL, --engine=inproc) and FakeEngineClient (deterministic data for UI tests via --fake-engine). The shared observable behavior is executable: Tests/Contract/EngineClientContractTests runs the same suite against all implementations. Cancellation is cooperative and fully plumbed (ADR-0018): a cancelled ct surfaces as System.OperationCanceledException (or a subclass) from every async member. Data shapes live in EngineTypes.cs.
ISearchResultMaterialized, sort-ordered result; pages are O(1) reads.
Enums
EngineConnectionStateTransport state of the engine boundary. In-proc clients are always InProc; the pipe client reports its supervisor state.
FmfCaseCase-matching mode (wire values of fmf-core's CaseMode).
FmfSortResult sort key (wire values of fmf-core's SortKey).
RegexScopeWhich haystack a whole-query regex runs against (wire values of fmf-core's RegexScope; the regex_mode bit1).
VolumeStateLifecycle of a volume's index (wire values of fmf-core's VolumeState), reported via VolumeUpdated.