node_patch_file
Atomically replace a target block in a remote UTF-8 file with new content, optionally enforcing a SHA-256 precondition to prevent concurrent overwrite.
Instructions
Atomically replace a target block inside a remote UTF-8 file on '@appliance', '@bastion', or a TargetNode with optional SHA-256 precondition check.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node | Yes | Target node identifier ('@appliance', '@bastion', or TargetNode name). | |
| tx_id | No | Optional stable transaction id. Reuse retrieves the original operation and never replays ambiguous work. | |
| target | Yes | Exact substring/block to replace. | |
| as_root | No | Write with elevated sudo privileges on a Linux TargetNode. | |
| remote_path | Yes | Path to the file on the remote node. | |
| replacement | Yes | Replacement content. | |
| expected_sha256 | No | Optional SHA-256 precondition from node_read_file to prevent concurrent overwrite. |