import { describe, it, expect, vi, beforeEach } from "vitest";
// Ephemeral (Task 635): proves the chat surface applies the shared 0.82 floor
// by default and that an explicit caller value still wins. hybrid() is mocked
// so we assert only what memorySearch forwards to it.
vi.mock("../../lib/neo4j.js", () => ({
    getSession: () => ({ run: vi.fn(async () => ({ records: [] })), close: vi.fn(async () => { }) }),
}));
vi.mock("../../lib/embeddings.js", () => ({ embed: vi.fn(async () => [0, 0, 0]) }));
const hybridMock = vi.fn();
vi.mock("../../../../../../lib/graph-search/dist/index.js", () => ({
    hybrid: (...args) => hybridMock(...args),
    isPublicOnlyScope: () => false,
    DEFAULT_VECTOR_THRESHOLD: 0.82,
}));
import { memorySearch } from "../memory-search.js";
describe("memorySearch — default vector threshold (Task 635)", () => {
    beforeEach(() => {
        hybridMock.mockReset();
        hybridMock.mockResolvedValue({
            mode: "hybrid", results: [], expandMs: 0, rawMerged: 0, suppressed: 0,
            bm25Bypass: 0, threshold: 0.82,
            stageCounts: { expansions: 1, vector: 0, bm25: 0, fused: 0, boosted: 0, deduped: 0, final: 0 },
        });
    });
    it("forwards the 0.82 default floor when caller passes none", async () => {
        await memorySearch({ query: "alice", accountId: "acc-1" });
        expect(hybridMock.mock.calls[0][2]).toMatchObject({ vectorThreshold: 0.82 });
    });
    it("an explicit vectorThreshold overrides the default", async () => {
        await memorySearch({ query: "alice", accountId: "acc-1", vectorThreshold: 0 });
        expect(hybridMock.mock.calls[0][2]).toMatchObject({ vectorThreshold: 0 });
    });
});
//# sourceMappingURL=memory-search-threshold.test.js.map