reasoning: normalise graph relationship contract at proposal boundary
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user