wip(confidence-engine): checkpoint open-question presentation work

This commit is contained in:
2026-10-09 07:46:19 +01:00
parent f74fe6de10
commit 6bc8be6edb
19 changed files with 812 additions and 22 deletions
+38 -1
View File
@@ -7,11 +7,13 @@ function mkN(id, label, opts) {
var k = (opts && opts.kind) || "unknown";
var s = (opts && opts.status) || (k === "unknown" ? "unknown" : "known");
var c = (opts && opts.confidence) || "low";
return {
var node = {
id, label, description: (opts && opts.description) || label, kind: k, status: s, confidence: c,
confidenceAssessment: { evidenceConfidence: c, completenessStatus: "partial", conclusionConfidence: c },
value: null, unit: null, evidenceIds: [], dependsOn: [], affects: [], childIds: []
};
if (opts && opts.openQuestion) node.openQuestion = opts.openQuestion;
return node;
}
/* ── Filtering tests ─────────────────────────────────────────────── */
@@ -147,6 +149,41 @@ describe("Deduplication", () => {
});
// The unresolved one (if any) or the cross-dedup should prevent duplication
});
it("keeps canonically distinct uncertainties with identical presentation questions", () => {
const sharedQuestion = "What evidence would resolve this uncertainty?";
const vm = buildFacilitatorViewModel({
nodes: [
mkN("u1", "Whether supplier capacity is sufficient for launch", {
openQuestion: sharedQuestion,
}),
mkN("u2", "Whether customer demand is sufficient for launch", {
openQuestion: sharedQuestion,
}),
],
resolvedIds: new Set(),
});
expect(vm.investigating.items.filter((item) => item === sharedQuestion)).toHaveLength(2);
});
it("continues to merge genuine canonical duplicates despite different presentation questions", () => {
const vm = buildFacilitatorViewModel({
nodes: [
mkN("u1", "Whether supplier capacity is sufficient for launch", {
openQuestion: "Can the supplier support the launch volume?",
}),
mkN("u2", "whether supplier capacity is sufficient for launch!", {
openQuestion: "Is enough supplier capacity available?",
}),
],
resolvedIds: new Set(),
});
expect(vm.investigating.items).toEqual([
"Can the supplier support the launch volume?",
]);
});
});
/* ── Ranking tests ───────────────────────────────────────────────── */