feat(library/rewriter): implement depth RW
refactor(library/rewriter): rename lc => ti
test(library/rewriter): add test for depth RW