Capture Rule Engine
Evaluates capture exclusions on the network capture hot path.
Matching reads a volatile snapshot so a recorded request never blocks on CRUD or storage, while every mutation writes through bindPersistence's store before the active snapshot changes -- a rule the caller was told was saved is always durable.
Functions
Hot-path gate. Every CaptureRule.host is validated at construction time to be recoverable by java.net.URI, but the request url itself is not -- callers (the Ktor client plugin, manual NetworkTransactionRecorder.record use) may pass an unencoded URL that makes URI's constructor throw even though its host and path are perfectly ordinary. extractRequestHost/extractRequestPath fall back to manual scheme/authority splitting in that case, so a rule for a well-formed host is never defeated by an unrelated encoding problem elsewhere in the URL. Returns true (capture) only when no host at all can be recovered from url.
Restores durable rules and makes subsequent CRUD write through store. Persistence is unbound while restoring so replaying stored rules never rewrites them.
Replays stored rules into memory; rows that no longer validate are skipped, not fatal.
Enable/disable without losing the rule; returns false when id is unknown.