You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tree: heightOf walks children with no cycle guard, so a corrupted parent pair overflows the stack instead of refusing the move #677
with no cycle guard, while its neighbours in the same file both have one: depthOf walks parent with seen = new Set(), and traceOf stops at 64 hops. heightOf walks children, so a corrupted snapshot in which two Bots are each other's parent (A.parent = B and B.parent = A — what a half-applied move_bot or a hand-edited flybot-tree field leaves behind) recurses until the stack dies, so move_bot throws RangeError: Maximum call stack size exceeded instead of refusing the move.
Acceptance
heightOf takes and threads a seen set, exactly like depthOf: a node already on the current path ends the walk instead of being re-entered.
A test that builds a snapshot with a two-node parent cycle and calls the move path (move_bot) on a third Bot: it must return a refusal or a warn, not throw RangeError. The assertion is assert.doesNotReject plus the refusal text — a test that merely catches the stack overflow does not count.
The other invariants stay: cycles, duplicate names, maxChildren and maxDepth still refuse with their current errors.
plugins/tree suite green at the tip.
Red without the fix: the new test throws RangeError: Maximum call stack size exceeded.
Scope:plugins/tree/src/tree.js + one test; no docs change (the invariant is internal); if core/ is touched (it should not be), ds-bot-patches generate + check.
Scope is the issue's: heightOf gets a seen set threaded like depthOf, one test that builds a two-node parent cycle and takes the move_bot path on a third Bot (refusal or warn, never RangeError), the existing cycle/duplicate/overflow/depth refusals keep their errors, plugins/tree green at the tip. No docs, no core/.
Activity
Birfy commentedon Oct 22, 2026
Claimed. Branch
fix/677-heightof-seen.Scope is the issue's:
heightOfgets aseenset threaded likedepthOf, one test that builds a two-node parent cycle and takes themove_botpath on a third Bot (refusal or warn, neverRangeError), the existing cycle/duplicate/overflow/depth refusals keep their errors,plugins/treegreen at the tip. No docs, nocore/.Written-by: Dev
Guard heightOf against a parent cycle and count the whole subtree (Th…