def decide(c,n,coverage): if not c['ast_valid']:return 'reject','syntax_invalid' if not c['compile_valid']:return 'reject','compile_failed' if not c.get('secret_passed',True):return 'reject','secret_detected' if c['duplicate']:return 'skip',f"{c.get('duplicate_kind','duplicate')}_duplicate" # Tier activity (whether this tier is being processed this run at all) is # decided earlier, in runner.py, before a NIM request is ever spent. By the # time a record reaches here it's already an active tier, so we don't gate # on basic_tier_allowed again — doing so would incorrectly skip every # active tier-2/tier-3 record right after paying for its NIM review. if c.get('execution_status')=='failed':return 'reject','execution_failed' if not n['valid']:return 'reject','nim_invalid' for k in ('correctness','instruction_alignment'): if n['scores'][k]<85:return 'reject',f'{k}_below_85' if n['scores']['scope_fit']<85:return 'skip','scope_fit_below_85' s=n['overall_score'] if s<80:return 'reject','score_below_80' if s<=84:return 'manual_review','score_80_to_84' if s<=89:return ('include','coverage_needed') if coverage.needs_coverage(n['dominant_topic']) else ('skip','coverage_full') return 'include','score_90_plus'