feat: decompose composite unknowns before questioning

This commit is contained in:
2026-08-03 06:32:12 +01:00
parent 0723c2f49a
commit d52690cf2b
8 changed files with 874 additions and 131 deletions
+17 -4
View File
@@ -44,10 +44,10 @@ When a selected unknown is composite:
For the current relationship-explanation experiment, the broad child dimensions are:
- Timing or measurement basis
- Whether the two observations reflect different timing
- How the two observations were measured
- Change affecting signal A more than signal B
- Change affecting signal B more than signal A
- Mix or segment shift
- One-off event during the period
These are intentionally non-jargon and broad enough to generalise across scenarios like:
@@ -63,6 +63,16 @@ These are intentionally non-jargon and broad enough to generalise across scenari
The orchestrator now reports:
- `atomicityAssessment`
- `atomicityDecisionReason`
- `decompositionDepth`
- `decompositionAttempted`
- `decompositionAccepted`
- `decompositionStoppedReason`
- `proposedChildCount`
- `acceptedChildCount`
- `rejectedChildren`
- `selectedChildNodeId`
- `childQualitySummary`
- `decompositionPerformed`
- `childUnknownCount`
- `childNodeIds`
@@ -82,10 +92,12 @@ After this change:
- the engine decomposes it into child unknowns first
- the next asked question is backed by a more focused child unknown
- repeated updates reuse the same decomposition children deterministically
- child-quality checks reject compound or duplicate children before they enter the graph
- decomposition stops deterministically once a selected child is directly answerable
In the revenue-versus-cash case, the selected next question becomes:
> What evidence would clarify timing or measurement basis?
> What evidence would clarify how the two observations were measured?
rather than asking the full broad explanation node directly.
@@ -93,13 +105,14 @@ rather than asking the full broad explanation node directly.
This supports the idea that recursive decomposition is a fundamental part of graph-backed questioning, not just a prompt refinement.
The main remaining limitation is that the new child set can still produce ties among equally broad dimensions. In the current implementation, that is acceptable because the graph now makes the ambiguity explicit rather than hiding it in a single broad parent question.
The main remaining limitation is that some decompositions can still produce equally justified child candidates. The current implementation handles that deterministically by exposing the ambiguity in diagnostics and, when possible, reusing the existing selector to pick a specific atomic child. That is still preferable to hiding the ambiguity inside one broad parent question.
## Validation run
Covered by:
- `tests/graph/atomicity-assessment.test.js`
- `tests/graph/decomposition-quality.test.js`
- `tests/graph/apply-proposal.test.js`
- `tests/graph/orchestrator.test.js`
- `tests/graph/question-formulator.test.js`