|
|
|
@ -223,6 +223,14 @@ export function publishGroupCoveragePrompt(db: Database, groupId: string, ratio:
|
|
|
|
return;
|
|
|
|
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
|
|
|
|
// Gating enforce
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const mode = String(process.env.GROUP_GATING_MODE || 'off').toLowerCase();
|
|
|
|
const mode = String(process.env.GROUP_GATING_MODE || 'off').toLowerCase();
|
|
|
|
|