Compare joined tasks against the needed quorum and turn the pending count into a release, wait, or escalate remediation action.

Promise All Remediation Report

promise_all_remediation.js
const taskCount = 3;
const needed = 3;

function remediate(count) {
    let joined = count;
    if (joined > needed) {
        joined = needed;
    }
    const pending = needed - joined;
    let action = "release";
    if (pending === 1) {
        action = "wait";
    } else if (pending >= 2) {
        action = "escalate";
    }
    console.log(`tasks=${count} joined=${joined} pending=${pending} ${action}`);
}

remediate(taskCount);
join quorum The needed quorum and joined count are scalars, so the pending work that drives the remediation action stays deterministic without awaiting live promises.