Check each operation's exact scope. Forest links cannot form cycles, suffix membership does not give match positions, and this piece table uses Python lists and strings with their real copying costs.
Lessons
- Link-cut forests: change tree edges and sum a path
- Suffix automata: index substrings as text arrives
- Piece tables: edit text through source spans
