A remediation report can convert failed checks into a concrete action without depending on live service state. The selector changes only the failed-check count.

Program

Play the program to choose the failed check count and inspect the remediation action.

failedChecks
rollback_action_report.dart
Replay: real traced execution (multi-file project)
void main() {
  var failedChecks = 2;
  var rollbackLimit = 1;
  var action = 'monitor';
  if (failedChecks == 0) {
    action = 'monitor';
  } else if (failedChecks <= rollbackLimit + 2) {
    action = 'rollback';
  } else {
    action = 'escalate';
  }
  var line = 'failed=$failedChecks $action';
  print(line);
}
void main() {
  var failedChecks = 0;
  var rollbackLimit = 1;
  var action = 'monitor';
  if (failedChecks == 0) {
    action = 'monitor';
  } else if (failedChecks <= rollbackLimit + 2) {
    action = 'rollback';
  } else {
    action = 'escalate';
  }
  var line = 'failed=$failedChecks $action';
  print(line);
}
void main() {
  var failedChecks = 4;
  var rollbackLimit = 1;
  var action = 'monitor';
  if (failedChecks == 0) {
    action = 'monitor';
  } else if (failedChecks <= rollbackLimit + 2) {
    action = 'rollback';
  } else {
    action = 'escalate';
  }
  var line = 'failed=$failedChecks $action';
  print(line);
}
  1. failedChecks ← 2

    1void main() {2  var failedChecks = 2;3  var rollbackLimit = 1;
    values this step2failedChecks
  2. rollbackLimit ← 1

    2var failedChecks = 2;3var rollbackLimit = 1;4var action = 'monitor';
    values this step1rollbackLimit
  3. action ← monitor

    3var rollbackLimit = 1;4var action = 'monitor';5if (failedChecks == 0) {
    values this stepmonitoraction
  4. condition ← false

    4var action = 'monitor';5if (failedChecks == 0) {6  action = 'monitor';
    values this stepfalsecondition2failedChecks
  5. condition ← true

    6  action = 'monitor';7} else if (failedChecks <= rollbackLimit + 2) {8  action = 'rollback';
    values this steptruecondition2failedChecks1rollbackLimit
  6. action ← rollback

    7} else if (failedChecks <= rollbackLimit + 2) {8  action = 'rollback';9} else {
    values this steprollbackaction
  7. line ← failed=2 rollback

    11}12var line = 'failed=$failedChecks $action';13print(line);
    values this stepfailed=2 rollbackline2failedChecksrollbackaction
  8. print(line);

    12  var line = 'failed=$failedChecks $action';13  print(line);14}
    outputfailed=2 rollback
    values this stepfailed=2 rollbackline
  1. failedChecks ← 0

    1void main() {2  var failedChecks = 0;3  var rollbackLimit = 1;
    values this step0failedChecks
  2. rollbackLimit ← 1

    2var failedChecks = 0;3var rollbackLimit = 1;4var action = 'monitor';
    values this step1rollbackLimit
  3. action ← monitor

    3var rollbackLimit = 1;4var action = 'monitor';5if (failedChecks == 0) {
    values this stepmonitoraction
  4. condition ← true

    4var action = 'monitor';5if (failedChecks == 0) {6  action = 'monitor';
    values this steptruecondition0failedChecks
  5. action ← monitor

    5if (failedChecks == 0) {6  action = 'monitor';7} else if (failedChecks <= rollbackLimit + 2) {
    values this stepmonitoraction
  6. line ← failed=0 monitor

    11}12var line = 'failed=$failedChecks $action';13print(line);
    values this stepfailed=0 monitorline0failedChecksmonitoraction
  7. print(line);

    12  var line = 'failed=$failedChecks $action';13  print(line);14}
    outputfailed=0 monitor
    values this stepfailed=0 monitorline
  1. failedChecks ← 4

    1void main() {2  var failedChecks = 4;3  var rollbackLimit = 1;
    values this step4failedChecks
  2. rollbackLimit ← 1

    2var failedChecks = 4;3var rollbackLimit = 1;4var action = 'monitor';
    values this step1rollbackLimit
  3. action ← monitor

    3var rollbackLimit = 1;4var action = 'monitor';5if (failedChecks == 0) {
    values this stepmonitoraction
  4. condition ← false

    4var action = 'monitor';5if (failedChecks == 0) {6  action = 'monitor';
    values this stepfalsecondition4failedChecks
  5. condition ← false

    6  action = 'monitor';7} else if (failedChecks <= rollbackLimit + 2) {8  action = 'rollback';
    values this stepfalsecondition4failedChecks1rollbackLimit
  6. action ← escalate

    9} else {10  action = 'escalate';11}
    values this stepescalateaction
  7. line ← failed=4 escalate

    11}12var line = 'failed=$failedChecks $action';13print(line);
    values this stepfailed=4 escalateline4failedChecksescalateaction
  8. print(line);

    12  var line = 'failed=$failedChecks $action';13  print(line);14}
    outputfailed=4 escalate
    values this stepfailed=4 escalateline
selector count `failedChecks` is the only input that changes between report variants.
rollback limit `rollbackLimit` keeps the action threshold visible and deterministic.
action row The printable row pairs the selected count with the chosen remediation.