enquire-mcp API reference - v3.11.6-rc.2
    Preparing search index...

    Function filterExcludedEmbedHits

    • v3.10.0-rc.22 (audit M8) — pure privacy filter for embed-search hits; the embeddingsSearch sibling of pruneExcludedHits. Drops rows whose rel_path is excluded by the injected predicate (vault.isExcluded). Embed hits carry a bare rel_path (no #chunk suffix), so — unlike pruneExcludedHits — there's no id-splitting.

      Extracted so the actual filter embeddingsSearch applies (it ran inline at two sites: the HNSW refill path + the brute-force path) is unit-testable WITHOUT loading the ML embedder the function needs to encode a query. Before rc.22 the security test "reimplemented" this filter inline and never exercised the real code path — a vacuous (theater) test that would have passed even if embeddingsSearch had dropped its guard.

      Type Parameters

      • T extends { rel_path: string }

      Parameters

      • hits: T[]

        embed-search rows (each carries a vault-relative rel_path).

      • isExcluded: (relPath: string) => boolean

        true if a vault-relative path is excluded.

      Returns T[]

      a new array with excluded-path rows removed (order preserved).