Just an idea (@securityTaging – Figma), bad drawing, to give som insperation on what is possible to implement given proper code for tagInterval Tree, happly given here under MIT licence robelar555/claudeGeneratedEditorGivenAlgorithmDescription.
Feel free to use code, and @securityTaging – Figma design idea.
If such code, and such speread of ideas, can help acellerate focus on security focused design - I Am just happy.