feat: block progress claims without execution evidence
This commit is contained in:
@@ -23,6 +23,7 @@ const EVIDENCE_FIELDS = Object.freeze({
|
||||
'statusSummary',
|
||||
]),
|
||||
executionEvidence: Object.freeze([
|
||||
'executionEvidence',
|
||||
'toolCallEvidence',
|
||||
'dispatchEvidence',
|
||||
'fileChangeEvidence',
|
||||
@@ -153,6 +154,16 @@ function usesButtonPath(input) {
|
||||
return hasAcceptedValue(input, EVIDENCE_FIELDS.buttonPathMode, 'button_path');
|
||||
}
|
||||
|
||||
function hasExecutionEvidence(input) {
|
||||
return EVIDENCE_FIELDS.executionEvidence.some((fieldPath) => {
|
||||
const value = getPathValue(input, fieldPath);
|
||||
if (hasNonEmptyString(value)) return true;
|
||||
if (Array.isArray(value)) return value.length > 0;
|
||||
if (value && typeof value === 'object') return Object.keys(value).length > 0;
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function claimsProgressionWithoutEvidence(input) {
|
||||
const progressionClaim = EVIDENCE_FIELDS.progressionClaim
|
||||
.map((fieldPath) => getPathValue(input, fieldPath))
|
||||
@@ -160,7 +171,7 @@ function claimsProgressionWithoutEvidence(input) {
|
||||
|
||||
if (!hasNonEmptyString(progressionClaim)) return false;
|
||||
|
||||
return !hasAnyNonEmptyString(input, EVIDENCE_FIELDS.executionEvidence);
|
||||
return !hasExecutionEvidence(input);
|
||||
}
|
||||
|
||||
function evaluateGate(input) {
|
||||
|
||||
Reference in New Issue
Block a user