apply_transactional_patch
Apply a candidate patch in a snapshot-backed workspace transaction, verify anti-reward-hacking rules, run an optional test command, and roll back byte-exact via SHA-256 if validation fails.
Instructions
Apply a candidate patch inside a snapshot-backed workspace transaction, verifying RH001–RH008 and running an optional test command with automatic byte-exact SHA-256 rollback on failure.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace_root": "<workspace_root>"
},
"name": "apply_transactional_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test_command | No | Optional command list (e.g. ['pytest', '-q']) to verify the patch. | |
| unified_diff | No | Optional unified diff string. | |
| patched_files | No | Mapping of {rel_path: new_source_code}. | |
| workspace_root | Yes | Workspace directory path. | |
| suspects_considered | No |