Implement a unified-diff patch applier that applies a diff file to a target file, producing a patched…
Implement a unified-diff patch applier that applies a diff file to a target file, producing a patched…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Exact I/O contract: - If the diff applies cleanly, write the patched content to the output path and exit with…
The task
Exact I/O contract: - If the diff applies cleanly, write the patched content to the output path and exit with code 0. - If ANY hunk fails to apply (context mismatch within fuzz=0, line-number mismatch on the target), do NOT produce a partial output file. Instead, write nothing to the output path (or remove it if…
Part of ai-and/termgrade-environments.