Add bidirectional first-word, token-subset, and prefix-token matching
Three new matching tiers in find_matching_entity and build_name_resolution_map
(between existing Tier 4 and Tier 5):
- Tier 4 enhanced: bidirectional first-word match — also checks detected
name's first word against entity first words (fixes order-dependence)
- Tier 4b: token-subset match — if all tokens of the shorter name appear
in the longer name (min 2 tokens, unambiguous)
- Tier 4c: prefix-token match — if sorted tokens are pairwise equal or
≥4-char prefixes of each other (handles Chris↔Christopher)
Also relaxes resolve_name_variants pattern check to use the same
token-subset/prefix logic via is_name_variant_match instead of strict
first-word equality.
Fixes three production duplicate pairs: Chris/Christopher DeWolfe,
Javier/Javier Garcia, Jones Dilworth/Josh Jones Dilworth.
Spec: cpo/specs/in-flight/entity-name-variant-matching.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>