fix(reasoning): reconcile closure selection state
This commit is contained in:
@@ -356,6 +356,31 @@ function reconcileResolutionSemantics(graph, proposal) {
|
||||
}
|
||||
}
|
||||
|
||||
for (const update of nextProposal.updatedNodes) {
|
||||
const existingNode = graphNodeById.get(update.nodeId);
|
||||
if (
|
||||
existingNode?.kind === "unknown" &&
|
||||
update.newStatus === "resolved" &&
|
||||
!nextProposal.resolvedUnknownNodeIds.includes(update.nodeId)
|
||||
) {
|
||||
nextProposal.resolvedUnknownNodeIds.push(update.nodeId);
|
||||
}
|
||||
}
|
||||
|
||||
if (nextProposal.selectedQuestion?.nodeId) {
|
||||
const selectedQuestionNodeId = nextProposal.selectedQuestion.nodeId;
|
||||
const selectedQuestionUpdate = updatedNodeById.get(selectedQuestionNodeId);
|
||||
const selectedQuestionResolvedByStatus =
|
||||
selectedQuestionUpdate?.newStatus === "resolved";
|
||||
const selectedQuestionResolvedById = nextProposal.resolvedUnknownNodeIds.includes(
|
||||
selectedQuestionNodeId,
|
||||
);
|
||||
|
||||
if (selectedQuestionResolvedByStatus || selectedQuestionResolvedById) {
|
||||
nextProposal.selectedQuestion = null;
|
||||
}
|
||||
}
|
||||
|
||||
for (const update of nextProposal.updatedNodes) {
|
||||
const existingNode = graphNodeById.get(update.nodeId);
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user