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

    Function planCachePrune

    • Plan a cache prune: given the filenames present in enquire's cache directory and the 12-hex legacy routing key to KEEP, return the canonically spelled reserved-name subset under OTHER routing keys. Pure and side-effect-free, so the destructive prune CLI can preview before touching disk and the safety invariant (never selects outside the reserved namespace or the kept routing key) is unit-testable. A visible watcher-activation guard for any selected stem vetoes the whole plan; pruning around an in-progress derived generation would make the plan's commit truth unknowable. It does not prove who created a matching entry or distinguish roots that collide on the truncated key.

      Parameters

      • entries: readonly string[]

        Filenames (basenames) present in the cache directory.

      • keepHash: string

        The 12-hex legacy routing key to preserve (from defaultIndexFile).

      Returns string[]

      Recognized reserved basenames eligible for removal, never keepHash.

      If keepHash is not exactly 12 lowercase hexadecimal characters.

      If a selected stem has a visible watcher-activation guard.

      planCachePrune(["aaaaaaaaaaaa.fts5.db", "bbbbbbbbbbbb.fts5.db", "notes.md"], "aaaaaaaaaaaa")
      // → ["bbbbbbbbbbbb.fts5.db"] (keeps aaaa…, ignores notes.md)