(beforeHadErrors: boolean | null, afterHasErrors: boolean)
| 108 | |
| 109 | /** Pure: the gate decision. Reject only if the EDIT introduced the breakage. */ |
| 110 | export function shouldReject(beforeHadErrors: boolean | null, afterHasErrors: boolean): boolean { |
| 111 | if (!afterHasErrors) return false; // new content is clean → write |
| 112 | if (beforeHadErrors === true) return false; // file was already broken / grammar gap → step aside |
| 113 | return true; // clean (or new) file would become broken → refuse |
| 114 | } |
| 115 | |
| 116 | /** Pure: the observation the model receives on refusal. */ |
| 117 | export function buildSyntaxRejectMessage(filePath: string, language: string, issues: SyntaxIssue[]): string { |
no outgoing calls
no test coverage detected