sortParentsBeforeChildren: stable-order fix — visit true roots (parentId
undefined) before orphans (parentId references missing node). Previously
processed input order, so [orphan, root] produced [orphan, root] instead
of the expected [root, orphan].
TIER_CONFIG: use string keys ("1"…"4") in toHaveProperty calls.
Vitest's toHaveProperty is string-keyed; TypeScript strict mode with
noPropertyAccessFromIndexSignature rejects numeric literal keys on
Record<number, TIER_CONFIG_LEVEL>.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>