feat: classify observation relationships after comparability

This commit is contained in:
2026-08-02 16:40:24 +01:00
parent 0c7558d31f
commit c97f5f7303
5 changed files with 316 additions and 50 deletions
+19 -2
View File
@@ -323,17 +323,34 @@ describe("formulateQuestion", () => {
status: "supported",
confidence: "medium",
});
const revenueObservation = makeNode({
id: "n-revenue-observation",
label: "Revenue increased by 18%.",
description: "Revenue increased by 18%.",
kind: "observation",
status: "supported",
confidence: "high",
});
const cashObservation = makeNode({
id: "n-cash-observation",
label: "Cash in the bank decreased over the same period.",
description: "Cash in the bank decreased over the same period.",
kind: "observation",
status: "supported",
confidence: "high",
});
const graph = makeGraphFor(unknown, {
centralStatement:
"Revenue increased by 18%, but cash in the bank fell over the same period.",
nodes: [contradiction],
nodes: [contradiction, revenueObservation, cashObservation],
});
const result = formulateTieResolutionQuestion({ graph });
expect(result.question).toBe(
"What changed during the period that could explain why Revenue increased by 18%, but cash in the bank fell over the same period?",
"Were these figures measured on the same basis and at the same scale?",
);
expect(result.comparabilityStatus).toBe("uncertain");
expect(result.question.toLowerCase()).not.toMatch(
/accounts receivable|capex|debt repayments|working capital/,
);