Location: internal/repository/recipe_tree.go:114-131
Ancestor traversal performs one DB query per ancestor (N+1 pattern) and has no cycle detection. If data has a cycle (node A parent is B, B parent is A), the loop runs forever. Additionally, append([]models.RecipeNode{node}, ancestors...) is O(n) per iteration making it O(n^2) overall.
Fix: use a recursive CTE query, add a max depth limit, and append-then-reverse.