mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-16 15:15:35 +02:00
Unify full and quick task search around PostgreSQL term coverage, explicit relevance bands, and conservative typo recovery. Preserve matching evidence and navigation, and add a judged corpus, regression tests, and documented performance measurements. Validation: local typecheck, build, focused PostgreSQL tests, and task-list tests pass. All final-head CI gates pass and Greptile is 5/5. Co-Authored-By: Paperclip <noreply@paperclip.ing>
20 lines
925 B
TypeScript
20 lines
925 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { parseTaskSearch } from "../services/task-search.js";
|
|
|
|
describe("task search query intent", () => {
|
|
it("keeps negation, short domain terms and quoted filler", () => {
|
|
expect(parseTaskSearch('the API is not "in the UI"').tokens).toEqual(["api", "is", "not", "in the ui"]);
|
|
expect(parseTaskSearch("the and").tokens).toEqual(["the", "and"]);
|
|
});
|
|
|
|
it("retains the strictest intent for repeated terms", () => {
|
|
expect(parseTaskSearch('callback "callback"').terms).toEqual([{ text: "callback", quoted: true }]);
|
|
});
|
|
|
|
it("normalizes task identifiers without guessing their numbers", () => {
|
|
for (const q of ["PAP-42", "pap42", "PAP 42"]) expect(parseTaskSearch(q).identifierQuery).toBe("pap-42");
|
|
expect(parseTaskSearch("T123-42").identifierQuery).toBe("t123-42");
|
|
expect(parseTaskSearch("PAP-420").identifierQuery).toBe("pap-420");
|
|
});
|
|
});
|