- Add _repair_tree() post-build pass that fixes structural issues caused by placed-set race conditions: demotes decisions with <2 children to actions, hoists orphaned children as siblings, converts dead-end actions to solutions - Add validation gate at commit endpoint — rejects trees that fail validation with a 422 and descriptive error messages instead of saving invalid trees - Update test fixtures to create valid multi-node tree structures - Frontend: initialize currentNodeId from tree's actual root ID instead of hardcoded 'root', fixing "Invalid tree structure" for KB-generated trees Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
13 KiB
13 KiB