* Helper to create the user prompt for diff comparison. * Uses the same prompt creation functions as production.
( diffPair: DiffPair, scoreType: "logic-equivalence" | "api-signature", )
| 63 | * Uses the same prompt creation functions as production. |
| 64 | */ |
| 65 | function createDiffComparisonPrompt( |
| 66 | diffPair: DiffPair, |
| 67 | scoreType: "logic-equivalence" | "api-signature", |
| 68 | ): string { |
| 69 | const { reference, candidate } = diffPair; |
| 70 | |
| 71 | if (scoreType === "logic-equivalence") { |
| 72 | return createLogicEquivalencePrompt(reference, candidate); |
| 73 | } else { |
| 74 | return createApiSignaturePrompt(reference, candidate); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Run consistency test: evaluate the same diff pair N times and check results. |