22 lines
1.3 KiB
TypeScript
22 lines
1.3 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { reconcileTruthCandidates } from "../src/services/projectKnowledge.js";
|
|
|
|
describe("project knowledge truth reconciliation", () => {
|
|
it("flags ambiguous disagreement as one actionable conflict", () => {
|
|
const conflicts = reconcileTruthCandidates([
|
|
{ key: "architecture", claim: "uses service a", source: "memory", authority: "memory", confidence: 90, entryId: "memory:1" },
|
|
{ key: "architecture", claim: "uses service b", source: "documentation", authority: "roadmap", confidence: 80, entryId: "documentation:1" },
|
|
]);
|
|
expect(conflicts).toHaveLength(1);
|
|
expect(conflicts[0]).toMatchObject({ status: "attention", entryIds: ["memory:1", "documentation:1"] });
|
|
});
|
|
|
|
it("lets verified repository truth supersede stale descriptive memory", () => {
|
|
const conflicts = reconcileTruthCandidates([
|
|
{ key: "architecture", claim: "uses service a", source: "memory", authority: "memory", confidence: 95, entryId: "memory:1" },
|
|
{ key: "architecture", claim: "uses service b", source: "repository", authority: "repository", confidence: 95, verifiedAt: "2026-09-12T10:00:00.000Z", entryId: "repo:1" },
|
|
]);
|
|
expect(conflicts[0]).toMatchObject({ status: "reconciled", winningEntryId: "repo:1" });
|
|
});
|
|
});
|