merge_concepts
Merge one concept into another by redirecting every backlink to the survivor and deleting the source, preserving identity history. Use dry-run to preview before confirming.
Instructions
⚠ DESTRUCTIVE MULTI-FILE WRITE — fold one node into another. Every backlink to fromSlug is redirected to intoSlug (frontmatter array entries + body links), then fromSlug is deleted. The survivor keeps its UID while the source UID/history is recorded in canonical merged_uids. The intoSlug prose and non-identity frontmatter are preserved as-is — they are not merged automatically (use patch_concept after if you want to combine descriptions). Tail-only references are also redirected. Two-stage safety:
Without confirm: true the call is a dry-run — returns the redirect plan + list of deletions without writing.
With confirm: true the rewrites and the delete happen in one pass. Throws if either slug is missing. Confirmed writes return compact
postWriteMaintenance(maintenance_plan) with count-safebyPhase/bySeverity/byKindqueue buckets, actionscore, executableproposedAction, and current-pagenextExecutableAction/nextReviewActionpointers for the final graph.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Actually perform the merge when true. Omit or false for a dry-run. | |
| fromSlug | Yes | Slug to dissolve. Its file is deleted after backlinks redirect. | |
| intoSlug | Yes | Slug to keep. Receives every redirected backlink. | |
| expected_mtime | No | Optional conflict guard for fromSlug. Throws if the source has been modified externally. | |
| expected_into_mtime | No | Optional conflict guard for intoSlug. Pass the survivor mtime from get_concept so a concurrent edit or identity-history change is never overwritten. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| dryRun | Yes | ||
| changed | No | ||
| deleted | Yes | ||
| fromUid | Yes | ||
| intoUid | Yes | ||
| message | No | ||
| fromPath | Yes | ||
| fromSlug | Yes | ||
| intoSlug | Yes | ||
| canConfirm | Yes | True only when repeating the call with confirm:true can perform the previewed change without another explicit safety opt-in. | |
| wouldChange | Yes | True only when the dry-run predicts a disk or Git change. | |
| absorbedUids | Yes | ||
| capturedFrom | Yes | ||
| previewReady | Yes | True only when this response is a complete dry-run preview that an agent can review. | |
| blockedReasons | Yes | Machine-readable human explanations for every condition currently blocking confirmation. | |
| backlinkUpdates | Yes | ||
| postWriteMaintenance | No | Compact maintenance_plan summary for post-write follow-up. Bucket maps describe the remaining queue after the write. |