{"version":3,"file":"confidence.test.d.ts","sourceRoot":"","sources":["../../../src/core/web-research/confidence.test.ts"],"names":[],"mappings":"","sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { deriveSourceConfidence } from \"./confidence.js\";\n\nfunction record(overrides: Record<string, unknown> = {}) {\n\treturn {\n\t\tpublishedAt: undefined as string | undefined,\n\t\tauthor: undefined as string | undefined,\n\t\ttitle: \"\",\n\t\tcanonicalUrl: \"https://example.com/page\",\n\t\ttruncated: false,\n\t\trelevantPassages: [] as Array<{ id: string; text: string; startLine?: number; endLine?: number; page?: number }>,\n\t\tcontentSha256: \"abc\",\n\t\t...overrides,\n\t};\n}\n\ndescribe(\"source confidence\", () => {\n\tit(\"marks an unfetched source (search snippet only) as low, never high\", () => {\n\t\texpect(deriveSourceConfidence({ fetched: false })).toBe(\"low\");\n\t});\n\n\tit(\"does not treat a successfully loaded wiki as high without dates/authority\", () => {\n\t\texpect(\n\t\t\tderiveSourceConfidence({ fetched: true, record: record({ canonicalUrl: \"https://wiki.example/x\" }) }),\n\t\t).not.toBe(\"high\");\n\t});\n\n\tit(\"treats a securely fetched dated official source as high\", () => {\n\t\tconst level = deriveSourceConfidence({\n\t\t\tfetched: true,\n\t\t\trecord: record({\n\t\t\t\tpublishedAt: \"2026-01-01\",\n\t\t\t\tcanonicalUrl: \"https://docs.example.com/a\",\n\t\t\t\ttitle: \"Guide\",\n\t\t\t\tauthor: \"Vendor\",\n\t\t\t\trelevantPassages: [{ id: \"p1\", text: \"guide\" }],\n\t\t\t}),\n\t\t});\n\t\texpect(level).toBe(\"high\");\n\t});\n});\n"]}