From cb36b7886b41a07e323f6bc64b0c34719b1d5652 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Sat, 21 Feb 2026 14:29:33 -0500 Subject: [PATCH] fix: correct publish validation to check title instead of action/solution fields The publish validator was checking for an 'action' field on action nodes and a 'solution' field on solution nodes, but the actual node schema (confirmed from seed data and frontend types) uses 'title'/'description'. This caused all AI-generated trees to fail publish validation. Co-Authored-By: Claude Sonnet 4.6 --- backend/app/core/tree_validation.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/app/core/tree_validation.py b/backend/app/core/tree_validation.py index a0c8652d..68918570 100644 --- a/backend/app/core/tree_validation.py +++ b/backend/app/core/tree_validation.py @@ -83,17 +83,17 @@ def _validate_node(node: dict[str, Any], path: str, errors: list[dict[str, str]] }) elif node_type == "action": - if "action" not in node or not node["action"]: + if "title" not in node or not node["title"]: errors.append({ - "field": f"{path}.action", - "message": "Action nodes must have a non-empty action" + "field": f"{path}.title", + "message": "Action nodes must have a non-empty title" }) elif node_type == "solution": - if "solution" not in node or not node["solution"]: + if "title" not in node or not node["title"]: errors.append({ - "field": f"{path}.solution", - "message": "Solution nodes must have a non-empty solution" + "field": f"{path}.title", + "message": "Solution nodes must have a non-empty title" }) elif node_type == "answer":