merge_canonical_entities
Merge two or more canonical registry entities into one surviving canonical: the fix for twin canonicals created across separate canonicalization passes (e.g. `persona_editor` + `persona_editor_2` with every instance registered under both). In one atomic flush: repoints every cross-edge from `registry/{loser}` to `registry/{keep}` (a repoint that would duplicate an existing edge, the double-parented instance case, drops the redundant edge instead, preserving any `alias` sanction), repoints registry-internal edges (self-loops and duplicates drop), unions each loser's description/tags/properties into the keeper's GAPS (the keeper always wins where both define a value), then deletes the losers. All canonicals must share one entity type. Preview the full plan with `dry_run: true`.
Arguments
keepstringrequiredThe surviving canonical id (bare, or registry/{id}).
mergearrayrequired1–20 canonical ids to fold into keep. Same type as keep.
dry_runbooleanoptionalPreview the merge plan (repoints, drops, property fills); nothing is written (default false).
Returns
{ kept, merged, repointed_cross_edges, dropped_duplicate_edges, repointed_registry_edges, dropped_registry_edges, properties_added, portfolio_file }— or the same shape under dry_run: true.