* fix(wiki): reuse cross-type page for same-title items instead of creating twins
Re-ingesting the same document can flip the model's page-type judgment for
the same real-world thing (first extracted as concept/X, later as entity/X).
The exact-identity fast path only matched same-type pages, and the slug
carries the type prefix, so every reparse materialized another concept/X +
entity/X twin pair that then cross-link to each other (fixes#3526).
- exactIdentityTarget: same-type exact match still wins; with no same-type
page, a cross-type candidate with the same normalized title is reused so
the write path updates the existing page instead of creating a twin
- attachExactIdentityPages: cross-type safety-net lookup (batched and
cached like the same-type pass) covers same-title pages the trigram probe
missed
- regression tests for the fallback, the same-type preference, and the
no-leak guarantee for unrelated titles
* docs(wiki): update identity-title comment; assert cross-type binding in tests
Review feedback on #3547:
- normalizeWikiIdentityTitle's comment no longer claims same-type-only
scope: it now drives cross-type entity/concept reuse as well
- stubNormalizedTitleWiki filters fixtures by pageType and the batching
test asserts the cross-type safety net binds concept/mencius onto the
entity item and registers it in candidatePages
- rename TestExactIdentityTargetSameTypeOnly to
TestExactIdentityTargetPrefersSameType to reflect what it now pins
---------
Co-authored-by: LuckVd <LuckVd@users.noreply.github.com>