sidebar-pages-tree.spec tested a LOCAL COPY of the tree-shaping (so a regression in the real getSidebarPagesTree was invisible) and justified it with a false jest-config claim (the ^src mapping exists). Extract the pure shaping into shapeSidebarPagesTree(); the service now calls it and the spec imports the REAL helper. Behavior unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>