A remediation report can map a failed-check count to a concrete action without touching files, packages, or host state.

Program

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

failed_checks
rollback_action_report.R
Replay: real traced execution (multi-file project)
failed_checks <- 2
action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"
line <- paste0('failed=', failed_checks, ' ', action)
cat(line, "\n", sep = "")
failed_checks <- 0
action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"
line <- paste0('failed=', failed_checks, ' ', action)
cat(line, "\n", sep = "")
failed_checks <- 4
action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"
line <- paste0('failed=', failed_checks, ' ', action)
cat(line, "\n", sep = "")
  1. failed_checks ← 2

    1failed_checks <- 22action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"
    values this step2failed_checks
  2. action ← rollback

    1failed_checks <- 22action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"3line <- paste0('failed=', failed_checks, ' ', action)
    values this steprollbackaction2failed_checks
  3. line ← failed=2 rollback

    2action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"3line <- paste0('failed=', failed_checks, ' ', action)4cat(line, "\n", sep = "")
    values this stepfailed=2 rollbackline2failed_checksrollbackaction
  4. cat(line, " ", sep = "")

    3line <- paste0('failed=', failed_checks, ' ', action)4cat(line, "\n", sep = "")
    outputfailed=2 rollback
    values this stepfailed=2 rollbackline
  1. failed_checks ← 0

    1failed_checks <- 02action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"
    values this step0failed_checks
  2. action ← monitor

    1failed_checks <- 02action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"3line <- paste0('failed=', failed_checks, ' ', action)
    values this stepmonitoraction0failed_checks
  3. line ← failed=0 monitor

    2action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"3line <- paste0('failed=', failed_checks, ' ', action)4cat(line, "\n", sep = "")
    values this stepfailed=0 monitorline0failed_checksmonitoraction
  4. cat(line, " ", sep = "")

    3line <- paste0('failed=', failed_checks, ' ', action)4cat(line, "\n", sep = "")
    outputfailed=0 monitor
    values this stepfailed=0 monitorline
  1. failed_checks ← 4

    1failed_checks <- 42action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"
    values this step4failed_checks
  2. action ← escalate

    1failed_checks <- 42action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"3line <- paste0('failed=', failed_checks, ' ', action)
    values this stepescalateaction4failed_checks
  3. line ← failed=4 escalate

    2action <- if (failed_checks == 0) "monitor" else if (failed_checks <= 2) "rollback" else "escalate"3line <- paste0('failed=', failed_checks, ' ', action)4cat(line, "\n", sep = "")
    values this stepfailed=4 escalateline4failed_checksescalateaction
  4. cat(line, " ", sep = "")

    3line <- paste0('failed=', failed_checks, ' ', action)4cat(line, "\n", sep = "")
    outputfailed=4 escalate
    values this stepfailed=4 escalateline
action label The `action` string carries the remediation decision as ordinary data.
tiered decision The nested `if` expression separates monitor, rollback, and escalation cases.
report row `paste0` keeps the raw failure count beside the selected action.