enquire-mcp API reference - v4.0.0-rc.7
    Preparing search index...

    Function filterLiveVaultHits

    • Re-admit persisted search rows against the live vault before their stored snippets or previews can leave the process. A row may have been public when it was indexed but now resolve through an in-vault symlink to a hidden or reserved path. String-only filtering cannot detect that identity change.

      Admission is bounded to 16 concurrent stats, preserves ranking order, caches duplicate-path verdicts, and stops once limit admitted rows are collected. Missing, unstatable, excluded, physically hidden, or non-regular-file paths fail closed. Persisted callers additionally supply receiptOf and one synchronous currentReceiptMask; those rows are admitted only when their mtime matches the live file and the store still validates the same monotonic source revision after every awaited stat has completed.

      Type Parameters

      • T

      Parameters

      • vault: Vault

        Vault whose current lexical and physical policy is authoritative.

      • hits: readonly T[]

        Ranked persisted-index rows to validate.

      • pathOf: (hit: T) => string

        Extracts a bare vault-relative path from one row.

      • limit: number = hits.length

        Maximum admitted rows to return.

      • OptionalreceiptOf: (hit: T) => PersistedSourceReceipt | undefined

        Optional persisted-generation receipt extractor.

      • OptionalcurrentReceiptMask: CurrentSourceReceiptMask

        Mandatory terminal batch validator when receipts are supplied.

      Returns Promise<T[]>

      Admitted rows in their original ranking order.

      const publicHits = await filterLiveVaultHits(vault, rows, (row) => row.rel_path, 10);