Skip to content
UPG is in early alpha. The specification is still evolving and may change between versions.
Tools/Workspace & Portfolios/merge_canonical_entities

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`.

Workspace & Portfoliosatomic. Repoints, unions, and deletions land in one portfolio flush.

Arguments

keepstringrequired

The surviving canonical id (bare, or registry/{id}).

mergearrayrequired

1–20 canonical ids to fold into keep. Same type as keep.

dry_runbooleanoptional

Preview the merge plan (repoints, drops, property fills); nothing is written (default false).

Returns

Shape
{ 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.

See Also