fix: avoid false positives in progress-evidence gate
This commit is contained in:
@@ -190,13 +190,16 @@ function hasProgressEvidence(input) {
|
||||
});
|
||||
}
|
||||
|
||||
function claimsProgressionWithoutEvidence(input) {
|
||||
function claimsProgression(input) {
|
||||
const progressionClaim = EVIDENCE_FIELDS.progressionClaim
|
||||
.map((fieldPath) => getPathValue(input, fieldPath))
|
||||
.find((value) => hasNonEmptyString(value));
|
||||
|
||||
if (!hasNonEmptyString(progressionClaim)) return false;
|
||||
return hasNonEmptyString(progressionClaim);
|
||||
}
|
||||
|
||||
function claimsProgressionWithoutEvidence(input) {
|
||||
if (!claimsProgression(input)) return false;
|
||||
return !hasProgressEvidence(input);
|
||||
}
|
||||
|
||||
@@ -269,8 +272,14 @@ function main() {
|
||||
process.stdout.write(JSON.stringify(output, null, args.pretty ? 2 : 0) + '\n');
|
||||
}
|
||||
|
||||
try {
|
||||
main();
|
||||
} catch (error) {
|
||||
fail('CLI_ERROR', error && error.message ? error.message : 'unexpected error');
|
||||
export { evaluateGate };
|
||||
|
||||
const isDirectRun = process.argv[1] && fs.realpathSync(process.argv[1]) === fs.realpathSync(new URL(import.meta.url));
|
||||
|
||||
if (isDirectRun) {
|
||||
try {
|
||||
main();
|
||||
} catch (error) {
|
||||
fail('CLI_ERROR', error && error.message ? error.message : 'unexpected error');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user