fix: aplicar umbral de cobertura en publishGroupCoveragePrompt

Co-authored-by: aider (openrouter/openai/gpt-5) <aider@aider.chat>
main
brobert 1 month ago
parent 1b0d2ec91c
commit 0ce3ecbcd3

@ -223,6 +223,14 @@ export function publishGroupCoveragePrompt(db: Database, groupId: string, ratio:
return;
}
// Umbral de cobertura: publicar solo si ratio < threshold (por defecto 1.0)
const thrRaw = Number(process.env.ONBOARDING_COVERAGE_THRESHOLD);
const threshold = Number.isFinite(thrRaw) ? Math.min(1, Math.max(0, thrRaw)) : 1;
if (!(ratio < threshold)) {
try { Metrics.inc('onboarding_prompts_skipped_total', 1, { group_id: groupId, reason: 'coverage_100' }); } catch {}
return;
}
// Gating enforce
try {
const mode = String(process.env.GROUP_GATING_MODE || 'off').toLowerCase();

Loading…
Cancel
Save