fix(reasoning): support uncertainty-over propositions
This commit is contained in:
@@ -102,6 +102,7 @@ function extractMeaning(node) {
|
|||||||
const strippedDescription = stripTrailingPunctuation(description)
|
const strippedDescription = stripTrailingPunctuation(description)
|
||||||
.replace(/^uncertainty regarding\s+/i, "")
|
.replace(/^uncertainty regarding\s+/i, "")
|
||||||
.replace(/^uncertainty about\s+/i, "")
|
.replace(/^uncertainty about\s+/i, "")
|
||||||
|
.replace(/^uncertainty over\s+/i, "")
|
||||||
.replace(/^unknown\s+/i, "")
|
.replace(/^unknown\s+/i, "")
|
||||||
.replace(/^uncertain\s+/i, "")
|
.replace(/^uncertain\s+/i, "")
|
||||||
.trim();
|
.trim();
|
||||||
|
|||||||
@@ -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", () => {
|
it("60B.27 regression: 'Unknown whether...' preserves full proposition", () => {
|
||||||
const unknown = makeNode({
|
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)", () => {
|
it("bare 'Whether...' remains unchanged (existing behaviour)", () => {
|
||||||
const unknown = makeNode({
|
const unknown = makeNode({
|
||||||
id: "unc-bare-whether",
|
id: "unc-bare-whether",
|
||||||
@@ -928,7 +975,9 @@ describe("formulateQuestion", () => {
|
|||||||
|
|
||||||
const result = formulateQuestion({ node: unknown, graph });
|
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", () => {
|
it("nominal label without explicit 'whether...' falls back to label-based extraction", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user