fix: defer relationship classification until comparability is established
This commit is contained in:
@@ -39,6 +39,7 @@ describe("comparability assessment", () => {
|
||||
scenario: fixture.scenario,
|
||||
comparabilityStatus: assessment.comparabilityStatus,
|
||||
relationshipStatus: relationship.relationshipStatus,
|
||||
relationshipAssessed: relationship.relationshipAssessed,
|
||||
contradictionReasoningAllowed: question.contradictionReasoningAllowed,
|
||||
question: question.question,
|
||||
};
|
||||
@@ -49,7 +50,8 @@ describe("comparability assessment", () => {
|
||||
scenario:
|
||||
"Revenue increased by 18%, but cash in the bank fell over the same period.",
|
||||
comparabilityStatus: "uncertain",
|
||||
relationshipStatus: "compatible",
|
||||
relationshipStatus: "insufficient_information",
|
||||
relationshipAssessed: false,
|
||||
contradictionReasoningAllowed: false,
|
||||
question:
|
||||
"Were these figures measured on the same basis and at the same scale?",
|
||||
@@ -57,7 +59,8 @@ describe("comparability assessment", () => {
|
||||
{
|
||||
scenario: "Complaints increased. Production increased.",
|
||||
comparabilityStatus: "uncertain",
|
||||
relationshipStatus: "compatible",
|
||||
relationshipStatus: "insufficient_information",
|
||||
relationshipAssessed: false,
|
||||
contradictionReasoningAllowed: false,
|
||||
question:
|
||||
"Were these figures measured over the same period and at the same scale?",
|
||||
@@ -66,7 +69,8 @@ describe("comparability assessment", () => {
|
||||
scenario:
|
||||
"Average delivery time decreased by 25%, but order cancellations increased.",
|
||||
comparabilityStatus: "uncertain",
|
||||
relationshipStatus: "compatible",
|
||||
relationshipStatus: "insufficient_information",
|
||||
relationshipAssessed: false,
|
||||
contradictionReasoningAllowed: false,
|
||||
question:
|
||||
"Were these figures measured over the same period and at the same scale?",
|
||||
@@ -74,7 +78,8 @@ describe("comparability assessment", () => {
|
||||
{
|
||||
scenario: "Customer satisfaction increased, but complaints increased.",
|
||||
comparabilityStatus: "uncertain",
|
||||
relationshipStatus: "compatible",
|
||||
relationshipStatus: "insufficient_information",
|
||||
relationshipAssessed: false,
|
||||
contradictionReasoningAllowed: false,
|
||||
question:
|
||||
"Were these figures measured over the same period and at the same scale?",
|
||||
@@ -83,6 +88,7 @@ describe("comparability assessment", () => {
|
||||
scenario: "Temperature increased. Ice melted.",
|
||||
comparabilityStatus: "confirmed",
|
||||
relationshipStatus: "compatible",
|
||||
relationshipAssessed: true,
|
||||
contradictionReasoningAllowed: false,
|
||||
question: null,
|
||||
},
|
||||
@@ -90,12 +96,38 @@ describe("comparability assessment", () => {
|
||||
scenario: "Sales doubled. Sales doubled.",
|
||||
comparabilityStatus: "confirmed",
|
||||
relationshipStatus: "duplicate",
|
||||
relationshipAssessed: true,
|
||||
contradictionReasoningAllowed: false,
|
||||
question: null,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("defers relationship classification while comparability is uncertain", () => {
|
||||
const fixture = comparabilityAssessmentFixtures[0];
|
||||
const relationship = classifyObservationRelationship(fixture.graph);
|
||||
|
||||
expect(relationship).toMatchObject({
|
||||
relationshipStatus: "insufficient_information",
|
||||
relationshipAssessed: false,
|
||||
contradictionReasoningAllowed: false,
|
||||
questionRequired: true,
|
||||
});
|
||||
expect(relationship.reasoningStages).toEqual([
|
||||
{
|
||||
stage: "comparability",
|
||||
status: "uncertain",
|
||||
outcome:
|
||||
"Comparability between the observations is not yet established across period, scale, or measurement basis.",
|
||||
},
|
||||
{
|
||||
stage: "relationship",
|
||||
status: "insufficient_information",
|
||||
outcome: "not assessed until comparability is established",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("allows contradiction reasoning only for genuine contradictions", () => {
|
||||
const serviceGraph = {
|
||||
centralStatement:
|
||||
|
||||
@@ -256,6 +256,8 @@ describe("lib/graph/orchestrator startCase", () => {
|
||||
"Were these figures measured on the same basis and at the same scale?",
|
||||
tiedCandidateIds: expect.arrayContaining([expect.any(String)]),
|
||||
comparabilityStatus: "uncertain",
|
||||
relationshipStatus: "insufficient_information",
|
||||
relationshipAssessed: false,
|
||||
contradictionReasoningAllowed: false,
|
||||
});
|
||||
expect(result.diagnostics.unknownSelectionExplanation).toMatchObject({
|
||||
|
||||
Reference in New Issue
Block a user