MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / shouldReject

Function shouldReject

src/tools/ast/syntax-check.ts:110–114  ·  view source on GitHub ↗
(beforeHadErrors: boolean | null, afterHasErrors: boolean)

Source from the content-addressed store, hash-verified

108
109/** Pure: the gate decision. Reject only if the EDIT introduced the breakage. */
110export 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. */
117export function buildSyntaxRejectMessage(filePath: string, language: string, issues: SyntaxIssue[]): string {

Callers 2

checkSyntaxForWriteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected