fix(reasoning): support uncertainty-over propositions

This commit is contained in:
2026-08-14 06:31:33 +01:00
parent 35a5efa804
commit d26bbfebdf
2 changed files with 52 additions and 2 deletions
+51 -2
View File
@@ -796,7 +796,7 @@ describe("formulateQuestion", () => {
);
});
// ── 60B.28: uncertainty-prefix coverage ────────────────────────────
// ── 60B.28 / 60B.30: uncertainty-prefix coverage ───────────────────
it("60B.27 regression: 'Unknown whether...' preserves full proposition", () => {
const unknown = makeNode({
@@ -846,6 +846,53 @@ describe("formulateQuestion", () => {
);
});
it("60B.29 regression: 'Uncertainty over whether...' preserves full proposition", () => {
const unknown = makeNode({
id: "unc-60b29",
label: "Prospective enterprise customer signing status",
description:
"Uncertainty over whether the prospective enterprise customer will sign if we launch this year, because their contract accounts for approximately £700,000 of the expected first-year revenue and could materially flip the net-value comparison.",
kind: "unknown",
status: "unknown",
confidence: "medium",
});
const graph = makeGraphFor(unknown, {
centralStatement:
"We need to decide which launch timing option provides superior net value.",
});
const result = formulateQuestion({ node: unknown, graph });
expect(result.question).toBe(
"What evidence would clarify whether the prospective enterprise customer will sign if we launch this year?",
);
expect(result.question).not.toContain("£700,000");
expect(result.question).not.toContain("expected first-year revenue");
expect(result.question).not.toContain("materially flip");
expect(result.question).not.toContain("because their contract");
});
it("'Uncertainty over whether...' without rationale uses evidence framing", () => {
const unknown = makeNode({
id: "unc-over",
label: "Supplier renewal status",
description: "Uncertainty over whether the supplier will renew.",
kind: "unknown",
status: "unknown",
confidence: "medium",
});
const result = formulateQuestion({
node: unknown,
graph: makeGraphFor(unknown),
});
expect(result.question).toBe(
"What evidence would clarify whether the supplier will renew?",
);
});
it("bare 'Whether...' remains unchanged (existing behaviour)", () => {
const unknown = makeNode({
id: "unc-bare-whether",
@@ -928,7 +975,9 @@ describe("formulateQuestion", () => {
const result = formulateQuestion({ node: unknown, graph });
expect(result.question).toBe("Will our largest client leave if we relocate?");
expect(result.question).toBe(
"Will our largest client leave if we relocate?",
);
});
it("nominal label without explicit 'whether...' falls back to label-based extraction", () => {