86aacbe1a88d845881666f568d84362ff3219d9f
Review found that a cluster of orphan nodes referencing only each other (no member's parent points outside the orphan set) made the reattach loop find zero tops and silently no-op, leaving the cluster unreachable while reporting repaired: []. Replaced the single-pass reattach with a loop that re-derives the unreachable set each round and force-reattaches one representative when no ordinary top exists, guaranteeing findUnreachableNodeIds is empty after repair. Adds 2-node/3-node cycle and mixed ordinary-subtree-plus-cycle tests; the original 11 tests are unchanged and still pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Languages
TypeScript
75.9%
JavaScript
12.3%
HTML
8.6%
CSS
2.6%
PHP
0.4%
Other
0.2%