Operational Remediation Reports
Promise Join Remediation Report
Compare joined tasks against the needed quorum and turn the pending count into a release, wait, or escalate remediation action.
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.
Promise Join Remediation Report
promise_join.ts
Replay: real traced execution (multi-file project)
const tasks: number = 3;
const needed: number = 3;
let joined: number = tasks;
if (joined > needed) {
joined = needed;
}
const pending: number = needed - joined;
let action: string = "release";
if (pending === 1) {
action = "wait";
}
if (pending >= 2) {
action = "escalate";
}
console.log(`tasks=${tasks} joined=${joined} pending=${pending} ${action}`);
const tasks: number = 0;
const needed: number = 3;
let joined: number = tasks;
if (joined > needed) {
joined = needed;
}
const pending: number = needed - joined;
let action: string = "release";
if (pending === 1) {
action = "wait";
}
if (pending >= 2) {
action = "escalate";
}
console.log(`tasks=${tasks} joined=${joined} pending=${pending} ${action}`);
const tasks: number = 2;
const needed: number = 3;
let joined: number = tasks;
if (joined > needed) {
joined = needed;
}
const pending: number = needed - joined;
let action: string = "release";
if (pending === 1) {
action = "wait";
}
if (pending >= 2) {
action = "escalate";
}
console.log(`tasks=${tasks} joined=${joined} pending=${pending} ${action}`);
tasks ← 3, needed ← 3, joined ← 3, pending ← 0, action ← release
1const tasks→ 3: number = 3; //@tasks=2, 02const needed→ 3: number = 3;3let joined→ 3: number = tasks→ 3;4if (joined > needed) {5 joined = needed;6}7const pending→ 0: number = needed→ 3 - joined3;89let action→ release: string = "release";10if (pending === 1) {11 action = "wait";12}13if (pending >= 2) {14 action = "escalate";15}1617console.log(`tasks=${tasks3} joined=${joined3} pending=${pending0} ${actionrelease}`);outputtasks=3 joined=3 pending=0 release
tasks ← 0, needed ← 3, joined ← 0, pending ← 3, action ← release
1const tasks→ 0: number = 0;2const needed→ 3: number = 3;3let joined→ 0: number = tasks→ 0;4if (joined > needed) {5 joined = needed;6}7const pending→ 3: number = needed→ 3 - joined0;89let action→ release: string = "release";10if (pending === 1) {if (pending >= 2)
11 action = "wait";12}13if (pending3 >= 2) {14 action = "escalate";15}console.log(`tasks=${tasks} joined=${joined} pending=${pending} ${acti…
14 action = "escalate";15}1617console.log(`tasks=${tasks0} joined=${joined0} pending=${pending3} ${actionescalate}`);outputtasks=0 joined=0 pending=3 escalate
tasks ← 2, needed ← 3, joined ← 2, pending ← 1, action ← release
1const tasks→ 2: number = 2;2const needed→ 3: number = 3;3let joined→ 2: number = tasks→ 2;4if (joined > needed) {5 joined = needed;6}7const pending→ 1: number = needed→ 3 - joined2;89let action→ release: string = "release";10if (pending === 1) {if (pending === 1)
9let action: string = "release";10if (pending1 === 1) {11 action = "wait";12}console.log(`tasks=${tasks} joined=${joined} pending=${pending} ${acti…
14 action = "escalate";15}1617console.log(`tasks=${tasks2} joined=${joined2} pending=${pending1} ${actionwait}`);outputtasks=2 joined=2 pending=1 wait