(ctx context.Context, dir, patchPath string)
| 209 | func patchApplyCheck(ctx context.Context, dir, patchPath string) bool { |
| 210 | data, err := os.ReadFile(patchPath) |
| 211 | if err != nil || strings.TrimSpace(string(data)) == "" { |
| 212 | return false |
| 213 | } |
| 214 | result := RunShellCommand(ctx, dir, "git apply --check "+shellQuote(patchPath), 30*time.Second) |
| 215 | return result.ExitCode == 0 |
| 216 | } |
| 217 | |
| 218 | func writeCaseArtifacts(dir string, c CaseSpec, agentResult AgentRunResult, result CaseResult) { |
| 219 | _ = os.MkdirAll(dir, 0o755) |
| 220 | setArtifactPaths(&result, dir) |
| 221 | _ = os.WriteFile(result.PromptPath, []byte(c.Prompt), 0o644) |
no test coverage detected