reasoning: normalise graph relationship contract at proposal boundary

This commit is contained in:
2026-08-10 06:16:47 +01:00
parent cf6c5cb57f
commit 46503b4507
3 changed files with 163 additions and 0 deletions
+29
View File
@@ -401,6 +401,35 @@ describe("applyValidatedProposal", () => {
expect(result.stage).toBe("proposal_compatibility");
});
it("accepts a proposal edge normalised from affects to canonical other before application", () => {
const { graph, proposal } = makeApplicationFixture();
const result = applyValidatedProposal({
situationGraph: graph,
proposal: {
...proposal,
addedEdges: [
makeEdge({
id: "e-other-edge",
fromNodeId: "n-complaint-count",
toNodeId: "n-quality-deterioration",
relationship: "other",
confidence: "medium",
description:
"Canonical generic relationship after proposal-boundary normalisation.",
}),
],
},
});
expect(result.success).toBe(true);
expect(
result.updatedSituationGraph.edges.some(
(edge) => edge.id === "e-other-edge" && edge.relationship === "other",
),
).toBe(true);
});
it("rejects duplicate IDs", () => {
const { graph, proposal, ids } = makeApplicationFixture();