reasoning: preserve evidence versus clarification distinction

This commit is contained in:
2026-08-09 16:20:06 +01:00
parent e884b02e7c
commit f861e2cac0
2 changed files with 103 additions and 6 deletions
+29 -4
View File
@@ -280,12 +280,12 @@ describe("formulateQuestion", () => {
expect(result.pattern).toBe("comparison");
});
it("constraint unknown uses evidence-gathering within the fixed strategy set", () => {
it("user-owned constraint ambiguity produces a clarification question rather than an evidence request", () => {
const unknown = makeNode({
id: "n-constraint",
label: "Budget constraint",
label: "Whether avoiding additional risk is a hard constraint",
description:
"Need the main budget constraint because it limits the available options.",
"Need to know whether avoiding additional risk is a hard constraint or a preference/trade-off.",
kind: "unknown",
status: "unknown",
confidence: "medium",
@@ -296,8 +296,33 @@ describe("formulateQuestion", () => {
graph: makeGraphFor(unknown),
});
expect(result.strategy).toBe("evidence_gathering");
expect(result.strategy).toBeNull();
expect(result.question).toBe(
"Is avoiding additional risk a hard constraint or a preference/trade-off?",
);
});
it("evidence-resolvable competing-cause unknown stays on an evidence route rather than neutral clarification", () => {
const unknown = makeNode({
id: "n-delivery-cause",
label: "Possible causes of the delivery delay",
description:
"Need to determine whether staff capacity or supplier lead times are responsible for the delivery delay.",
kind: "unknown",
status: "unknown",
confidence: "medium",
});
const result = formulateQuestion({
node: unknown,
graph: makeGraphFor(unknown, {
centralStatement: "Delivery is delayed and the cause is still unknown.",
}),
});
expect(result.reasoningPattern).toBe("diagnosis");
expect(result.question).toContain("What evidence");
expect(result.question).not.toContain("What would clarify");
});
it("the same unknown can produce different questions when paired with different strategies", () => {