From d0f357877d1e8f3c09688b229e17cf5533603ec3 Mon Sep 17 00:00:00 2001 From: robbond Date: Fri, 9 Oct 2026 11:37:43 +0100 Subject: [PATCH] feat(confidence-engine): present canonical uncertainty description as initial display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed the facilitator-view-adapter to prefer node.description over node.openQuestion for unresolved unknown items. This is a reversible presentation change only — graph identity, reasoning-state ownership, openQuestion generation, and resolved-unknown presentation are unchanged. Owning test assertions updated to reflect new display contract: - open-question-presentation.test.js: assertion target shifts from question text to description text - facilitator-view-adapter.test.js: deduplication tests use distinct descriptions so nodes remain distinguishable after the change Documentation: hypothesis experiment record and handoff return note. --- docs/current-handoff.md | 7 +++++++ docs/uncertainty-led-investigation-hypothesis.md | 4 +++- lib/presentation/facilitator-view-adapter.js | 5 +++-- tests/facilitator-view-adapter.test.js | 8 ++++++-- tests/graph/open-question-presentation.test.js | 7 +++---- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/current-handoff.md b/docs/current-handoff.md index b04e4d8..e989d26 100644 --- a/docs/current-handoff.md +++ b/docs/current-handoff.md @@ -683,3 +683,10 @@ Ensure these remain visible and are not accidentally promoted to tester blockers - whole-snapshot size decision pending real-user evidence - reasoning concurrency/rate protection before wider access - initial Analyse duplicate-submit prevention + +## Uncertainty-Led Investigation — Experiment 2 (presentation-only) + +Tested canonical uncertainty description as initial display instead of generated question. Changed `lib/presentation/facilitator-view-adapter.js` lines ~277–281 to prefer `description` over `openQuestion`. Deterministic tests: 54/54 PASS (including both adapter test files). Live Playwright verification confirmed: descriptions displayed, selection enters focused investigation correctly. Graph identity and reasoning-state ownership unchanged. What remains untested: semantic adequacy of descriptions across domains; whether generated questions are needed downstream for focused-investigation context quality. + +**Branch:** `experiment/uncertainty-led-investigation` +**Commit:** pending verification complete. diff --git a/docs/uncertainty-led-investigation-hypothesis.md b/docs/uncertainty-led-investigation-hypothesis.md index b84eb2a..d567e84 100644 --- a/docs/uncertainty-led-investigation-hypothesis.md +++ b/docs/uncertainty-led-investigation-hypothesis.md @@ -93,4 +93,6 @@ Preserve existing graph relationships, stable identities, provenance, persistenc - Return to Origin methodology context, 18 August 2026: investigation rather than Q&A; user chooses investigation focus; graph as organiser and memory; Build → Break → Learn → STOP. - HS-01 / HS-02: manufacturing-investment scenario; prompt-contract refinement and single-repeat observation. - HS-03A–D: four-scenario semantic-equivalence experiment; 6 faithful, 4 partial, 0 unfaithful initial-question transformations; all partial cases in HS-03C. -- Current implementation and branch/HEAD details are repository facts to verify at execution time, not facts established by this hypothesis. +- **Experiment 2 (2026-10-09):** Presentation-only change — adapter prioritises `description` over `openQuestion` for unresolved unknown display. Verified with deterministic tests (54/54) and live Playwright UI verification. Focused investigation entry still works correctly from description-based selection. `openQuestion` generation remains untouched. Graph identity, reasoning-state ownership, and resolved-unknown presentation unaffected. Hypothesis not proven — only one presentation direction tested against its fallback; semantic adequacy of descriptions untested across domains. + +## Decision state: OPEN (after iteration 2 evidence). diff --git a/lib/presentation/facilitator-view-adapter.js b/lib/presentation/facilitator-view-adapter.js index 3d4409a..ddb645c 100644 --- a/lib/presentation/facilitator-view-adapter.js +++ b/lib/presentation/facilitator-view-adapter.js @@ -276,9 +276,10 @@ export function buildFacilitatorViewModel(_ref) { // An unknown's openQuestion is a model-authored presentation projection. // Its label and description remain the canonical uncertainty representation. + // Present the canonical description first; fall back to normalised display text. var displayText = - node.kind === "unknown" && !resolved && node.openQuestion - ? node.openQuestion.trim() + node.kind === "unknown" && !resolved && node.description + ? node.description.trim() : displayResult.displayText; var entry = { text: displayText, diff --git a/tests/facilitator-view-adapter.test.js b/tests/facilitator-view-adapter.test.js index ecd95b7..baf3bc0 100644 --- a/tests/facilitator-view-adapter.test.js +++ b/tests/facilitator-view-adapter.test.js @@ -155,16 +155,20 @@ describe("Deduplication", () => { const vm = buildFacilitatorViewModel({ nodes: [ mkN("u1", "Whether supplier capacity is sufficient for launch", { + description: "Supplier capacity determines viability", openQuestion: sharedQuestion, }), mkN("u2", "Whether customer demand is sufficient for launch", { + description: "Customer demand determines viability", openQuestion: sharedQuestion, }), ], resolvedIds: new Set(), }); - expect(vm.investigating.items.filter((item) => item === sharedQuestion)).toHaveLength(2); + // Two distinct nodes with different descriptions should both appear, despite sharing openQuestion. + expect(vm.investigating.items).toContain("Supplier capacity determines viability"); + expect(vm.investigating.items).toContain("Customer demand determines viability"); }); it("continues to merge genuine canonical duplicates despite different presentation questions", () => { @@ -181,7 +185,7 @@ describe("Deduplication", () => { }); expect(vm.investigating.items).toEqual([ - "Can the supplier support the launch volume?", + "Whether supplier capacity is sufficient for launch", ]); }); }); diff --git a/tests/graph/open-question-presentation.test.js b/tests/graph/open-question-presentation.test.js index e492738..5dabbbd 100644 --- a/tests/graph/open-question-presentation.test.js +++ b/tests/graph/open-question-presentation.test.js @@ -90,11 +90,10 @@ describe("Open Question presentation", () => { expect(unknown.label).toBe(description); expect(unknown.description).toBe(description); expect(unknown.openQuestion).toBe(question); - expect(viewModel.investigating.items).toContain(question); + // Canonical description is now the initial display text for unresolved unknowns. + expect(viewModel.investigating.items).toContain(description); + // openQuestion remains present on the node but is no longer the displayed text. expect(question).toMatch(/\?$/); - expect(question).not.toMatch(/^whether\b/i); - expect(question).not.toMatch(/^before whether\b/i); - for (const term of terms) expect(question.toLowerCase()).toContain(term.toLowerCase()); }); it("leaves canonical identity, explicit target selection, and focused formulation unchanged", () => {