Operational Remediation Reports
Once Value Remediation Report
Apply at most one idempotent write and turn the accepted and skipped counts into a commit, skip, or retry remediation action.
Once Value Remediation Report
once_value_remediation.js
const writes = 1;
function remediate(count) {
let accepted = 0;
let skipped = 0;
for (let i = 1; i <= count; i++) {
if (accepted === 0) {
accepted += 1;
} else {
skipped += 1;
}
}
let action = "retry";
if (accepted >= 1 && skipped >= 1) {
action = "skip";
} else if (accepted >= 1) {
action = "commit";
}
console.log(`writes=${count} accepted=${accepted} skipped=${skipped} ${action}`);
}
remediate(writes);
idempotent write
Only the first write is accepted and later writes are counted as skipped, so the remediation action is reproducible without a live one-shot value guard.