feat: added rule to prevent one belief being connected to both inferredBelief inputs

ref: N25B-433
This commit is contained in:
JGerla
2026-01-13 11:32:23 +01:00
parent f8f0f12128
commit 3d6e065dd5
7 changed files with 51 additions and 27 deletions

View File

@@ -12,7 +12,7 @@ import {allowOnlyConnectionsFromHandle, allowOnlyConnectionsFromType} from "../H
import useFlowStore from '../VisProgStores';
import { PlanReduce, type Plan } from '../components/Plan';
import PlanEditorDialog from '../components/PlanEditor';
import {BeliefReduce} from "./BeliefReduce.ts";
import {BeliefGlobals} from "./BeliefGlobals.ts";
/**
* The default data structure for a Trigger node
@@ -86,13 +86,13 @@ export default function TriggerNode(props: NodeProps<TriggerNode>) {
/**
* Reduces each Trigger, including its children down into its core data.
* @param node - The Trigger node to reduce.
* @param _nodes - The list of all nodes in the current flow graph.
* @param nodes - The list of all nodes in the current flow graph.
* @returns A simplified object containing the node label and its list of triggers.
*/
export function TriggerReduce(node: Node, nodes: Node[]) {
const data = node.data as TriggerNodeData;
const conditionNode = data.condition ? nodes.find((n)=>n.id===data.condition) : undefined
const conditionData = conditionNode ? BeliefReduce(conditionNode, nodes) : ""
const conditionData = conditionNode ? BeliefGlobals(conditionNode, nodes) : ""
return {
id: node.id,
condition: conditionData, // Make sure we have a condition before reducing, or default to ""