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

Function checkCompletionClaims

src/agent/completion-gate.ts:110–136  ·  view source on GitHub ↗
(
  claims: CompletionClaims,
  evidence: SessionEvidence,
)

Source from the content-addressed store, hash-verified

108 * Conservative by design — only flags CLEAR contradictions to avoid nagging.
109 */
110export function checkCompletionClaims(
111 claims: CompletionClaims,
112 evidence: SessionEvidence,
113): string | null {
114 const problems: string[] = [];
115
116 if (claims.claimsTestsPass && !evidence.didRunTests) {
117 problems.push(
118 'You stated the tests pass, but no test command ran this session. Either run the ' +
119 'test suite now and show the actual output, or remove the claim that tests pass.',
120 );
121 }
122 if (claims.claimsFixOrChange && !evidence.didSuccessfulEdit) {
123 problems.push(
124 'You stated you fixed/changed/created something, but no file edit succeeded this ' +
125 'session. Either make the actual edit now, or correct your summary to say what you ' +
126 'really did (e.g. only analyzed, or were blocked).',
127 );
128 }
129
130 if (problems.length === 0) return null;
131 return (
132 '[COMPLETION_GATE] Before finishing, your claims must match what actually happened:\n' +
133 problems.map(p => ' • ' + p).join('\n') +
134 '\nDo the work or revise the claim — do not report success you cannot demonstrate.'
135 );
136}
137
138/** Convenience: one call from text + messages → corrective message or null. */
139export function evaluateCompletion(finalText: string, messages: MsgLike[]): string | null {

Callers 2

evaluateCompletionFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected