HF RL Explorer

Implement a command-line tool /app/diffapply that applies a unified diff (patch) to a target file.

Implement a command-line tool /app/diffapply that applies a unified diff (patch) to a target file.: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input contract: - The tool reads exactly three arguments: 1. Path to the original file (UTF-8 text). 2. Path to the…

The task

**Input contract:** - The tool reads exactly three arguments: 1. Path to the original file (UTF-8 text). 2. Path to the unified diff file (UTF-8 text). 3. Path to write the patched result (must not exist beforehand). - Exit code 0 on success. Exit code non-zero on any failure (including patch conflicts, malformed…

Part of ai-and/termgrade-environments.