replace_relation
Replace an exact relation by changing its target and/or type in one atomic write, preserving or replacing its rationale. Dry-run by default; confirm:true applies the change.
Instructions
Atomically replace one exact relation with a new target and/or type, moving or replacing its rationale in the same frontmatter write. Defaults to dry-run; pass confirm:true to write. Supports expected_mtime.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| why | No | ||
| from | Yes | Source slug. | |
| newTo | Yes | Replacement target slug. | |
| oldTo | Yes | Current target slug. | |
| confirm | No | ||
| newType | Yes | ||
| oldType | Yes | ||
| expected_mtime | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| from | Yes | ||
| dryRun | Yes | ||
| changed | Yes | ||
| canConfirm | Yes | True only when repeating the call with confirm:true can perform the previewed change without another explicit safety opt-in. | |
| newRelation | Yes | ||
| oldRelation | Yes | ||
| wouldChange | Yes | True only when the dry-run predicts a disk or Git change. | |
| 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. | |
| postWriteMaintenance | No | Compact maintenance_plan summary for post-write follow-up. Bucket maps describe the remaining queue after the write. |