feat: decompose composite unknowns before questioning

This commit is contained in:
2026-08-02 19:24:38 +01:00
parent b1c633ba5c
commit 0723c2f49a
9 changed files with 768 additions and 25 deletions
+56 -13
View File
@@ -80,7 +80,7 @@ function makeUpdateSuccess(overrides = {}) {
updatedSituationGraph: {
centralStatement: "Complaints increased while production increased.",
currentSummary: "Updated summary",
activeUnknownNodeId: "n-next-unknown",
activeUnknownNodeId: "n-child-1",
resolvedNodeIds: ["n-unknown"],
nodes: [
{
@@ -125,6 +125,18 @@ function makeUpdateSuccess(overrides = {}) {
value: null,
unit: null,
},
{
id: "n-child-1",
label: "Timing or measurement basis",
description:
"Need evidence about whether a timing or measurement-basis difference could explain revenue increased by 18%, but cash in the bank fell over the same period, because that would change how the observations should be interpreted.",
kind: "unknown",
status: "unknown",
confidence: "medium",
value: null,
unit: null,
parentId: "n-next-unknown",
},
],
edges: [
{
@@ -136,6 +148,15 @@ function makeUpdateSuccess(overrides = {}) {
description:
"This unresolved explanation arises from the now-assessed relationship between the observations.",
},
{
id: "e-child-next",
fromNodeId: "n-child-1",
toNodeId: "n-next-unknown",
relationship: "depends_on",
confidence: "medium",
description:
"This child unknown must be investigated before the broader parent explanation can be resolved.",
},
],
},
proposal: {
@@ -157,6 +178,22 @@ function makeUpdateSuccess(overrides = {}) {
parentId: "n-conclusion",
childIds: [],
},
{
id: "n-child-1",
label: "Timing or measurement basis",
description:
"Need evidence about whether a timing or measurement-basis difference could explain revenue increased by 18%, but cash in the bank fell over the same period, because that would change how the observations should be interpreted.",
kind: "unknown",
status: "unknown",
confidence: "medium",
value: null,
unit: null,
evidenceIds: [],
dependsOn: [],
affects: [],
parentId: "n-next-unknown",
childIds: [],
},
],
updatedNodes: [
{ nodeId: "n-unknown", newStatus: "resolved", reason: "answered" },
@@ -166,28 +203,34 @@ function makeUpdateSuccess(overrides = {}) {
resolvedUnknownNodeIds: ["n-unknown"],
affectedNodeIds: ["n-conclusion"],
selectedQuestion: {
nodeId: "n-next-unknown",
nodeId: "n-child-1",
question:
"What changed during that period that could help explain why revenue increased by 18%, but cash in the bank fell over the same period?",
"What evidence would clarify timing or measurement basis?",
reason:
"Formulated as a neutral clarification question because no narrower investigation strategy clearly applied.",
"Formulated from graph context using the evidence_gathering investigation strategy.",
},
},
selectedQuestion: {
nodeId: "n-next-unknown",
nodeId: "n-child-1",
question:
"What changed during that period that could help explain why revenue increased by 18%, but cash in the bank fell over the same period?",
"What evidence would clarify timing or measurement basis?",
reason:
"Formulated as a neutral clarification question because no narrower investigation strategy clearly applied.",
"Formulated from graph context using the evidence_gathering investigation strategy.",
},
affectedNodeIds: ["n-conclusion"],
resolvedUnknownNodeIds: ["n-unknown"],
previousActiveUnknownNodeId: "n-unknown",
newActiveUnknownNodeId: "n-next-unknown",
newActiveUnknownNodeId: "n-child-1",
emergentReasoningNodeCreated: true,
emergentReasoningNodeId: "n-next-unknown",
emergentReasoningNodeReason:
"Created a new unresolved reasoning unknown so the next justified question is backed by the graph.",
atomicityAssessment: "composite",
decompositionPerformed: true,
childUnknownCount: 1,
childNodeIds: ["n-child-1"],
atomicityReason:
"Decomposed a composite unknown into smaller broad candidate dimensions before asking the next question.",
previousReasoningState: {
comparabilityStatus: "uncertain",
reasoningStages: [
@@ -456,7 +499,7 @@ describe("graph-backed UI rendering", () => {
);
expect(html).toContain(
"What changed during that period that could help explain why revenue increased by 18%, but cash in the bank fell over the same period?",
"What evidence would clarify timing or measurement basis?",
);
});
@@ -514,7 +557,7 @@ describe("graph-backed UI rendering", () => {
expect(html).toContain("New active unknown");
expect(html).toContain("Next question");
expect(html).toContain(
"What changed during that period that could help explain why revenue increased by 18%, but cash in the bank fell over the same period?",
"What evidence would clarify timing or measurement basis?",
);
});
@@ -526,7 +569,7 @@ describe("graph-backed UI rendering", () => {
selectedQuestion: {
nodeId: "n-next-unknown",
question:
"What changed during that period that could help explain why revenue increased by 18%, but cash in the bank fell over the same period?",
"What evidence would clarify timing or measurement basis?",
reason: "A broad follow-up is now justified.",
},
}),
@@ -543,7 +586,7 @@ describe("graph-backed UI rendering", () => {
expect(html).toContain("comparability: confirmed");
expect(html).toContain("relationship: insufficient_information");
expect(html).toContain(
"What changed during that period that could help explain why revenue increased by 18%, but cash in the bank fell over the same period?",
"What evidence would clarify timing or measurement basis?",
);
expect(html).not.toContain("reasoning:comparability");
});
@@ -570,7 +613,7 @@ describe("graph-backed UI rendering", () => {
);
expect(html).toContain(
"What changed during that period that could help explain why revenue increased by 18%, but cash in the bank fell over the same period?",
"What evidence would clarify timing or measurement basis?",
);
});