Fix partial overlap bug: higher score wins for all overlaps
authorStefan Gasser <redacted>
Fri, 16 Jan 2026 16:35:42 +0000 (17:35 +0100)
committerStefan Gasser <redacted>
Fri, 16 Jan 2026 16:35:42 +0000 (17:35 +0100)
commit2315371dc94950702db27d7d1bb248fccb08c73d
treefd23d6acf39d893ab33c4be5ab9f8097d049c5c4
parent057d636e6d65669da30a88b09da8b9237eb3fcc1
Fix partial overlap bug: higher score wins for all overlaps

Previous behavior kept both entities when they partially overlapped
but had different types, causing text corruption during masking.

Now: sort by score desc, then length desc, then position. Any overlap
removes the lower-scored entity.
src/utils/conflict-resolver.test.ts
src/utils/conflict-resolver.ts
git clone https://git.99rst.org/PROJECT