diff --git a/lib/graph/question-formulator.js b/lib/graph/question-formulator.js index 21b7125..e09552c 100644 --- a/lib/graph/question-formulator.js +++ b/lib/graph/question-formulator.js @@ -102,6 +102,7 @@ function extractMeaning(node) { const strippedDescription = stripTrailingPunctuation(description) .replace(/^uncertainty regarding\s+/i, "") .replace(/^uncertainty about\s+/i, "") + .replace(/^uncertainty over\s+/i, "") .replace(/^unknown\s+/i, "") .replace(/^uncertain\s+/i, "") .trim(); diff --git a/tests/graph/question-formulator.test.js b/tests/graph/question-formulator.test.js index fbc90ac..aaebb98 100644 --- a/tests/graph/question-formulator.test.js +++ b/tests/graph/question-formulator.test.js @@ -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", () => {