Operational Remediation Reports
Incident Owner Report
Assign Follow-Up
A Bash incident remediation report can count visible incidents and assign the next owner from that count.
Program
Play the script to choose minimum severity and inspect the owner assignment.
incident_owner_report.sh
Replay: real traced execution (multi-file project)
#!/usr/bin/env bash
min_severity=2
incidents="1 3 2 3"
visible=0
for severity in $incidents; do
if (( severity >= min_severity )); then
visible=$((visible + 1))
fi
done
if (( visible >= 3 )); then
owner="ops"
else
owner="lead"
fi
echo "min=$min_severity visible=$visible $owner"
#!/usr/bin/env bash
min_severity=1
incidents="1 3 2 3"
visible=0
for severity in $incidents; do
if (( severity >= min_severity )); then
visible=$((visible + 1))
fi
done
if (( visible >= 3 )); then
owner="ops"
else
owner="lead"
fi
echo "min=$min_severity visible=$visible $owner"
#!/usr/bin/env bash
min_severity=3
incidents="1 3 2 3"
visible=0
for severity in $incidents; do
if (( severity >= min_severity )); then
visible=$((visible + 1))
fi
done
if (( visible >= 3 )); then
owner="ops"
else
owner="lead"
fi
echo "min=$min_severity visible=$visible $owner"
min_severity ← 2
3min_severity=24incidents="1 3 2 3"values this step2min_severityincidents ← 1 3 2 3
3min_severity=24incidents="1 3 2 3"5visible=0values this step1 3 2 3incidentsvisible ← 0
4incidents="1 3 2 3"5visible=06for severity in $incidents; dovalues this step0visibleif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step1severity2min_severityif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step3severity2min_severityvisible ← 1
7if (( severity >= min_severity )); then8 visible=$((visible + 1))9fivalues this step0 → 1visibleif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step2severity2min_severityvisible ← 2
7if (( severity >= min_severity )); then8 visible=$((visible + 1))9fivalues this step1 → 2visibleif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step3severity2min_severityvisible ← 3
7if (( severity >= min_severity )); then8 visible=$((visible + 1))9fivalues this step2 → 3visibleif (( visible >= 3 )); then
10done11if (( visible >= 3 )); then12 owner="ops"values this step3visibleowner ← ops
11if (( visible >= 3 )); then12 owner="ops"13elsevalues this stepopsownerecho "min=$min_severity visible=$visible $owner"
15fi16echo "min=$min_severity visible=$visible $owner"outputmin=2 visible=3 opsvalues this step2min_severity3visibleopsowner
min_severity ← 1
3min_severity=14incidents="1 3 2 3"values this step1min_severityincidents ← 1 3 2 3
3min_severity=14incidents="1 3 2 3"5visible=0values this step1 3 2 3incidentsvisible ← 0
4incidents="1 3 2 3"5visible=06for severity in $incidents; dovalues this step0visibleif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step1severity1min_severityvisible ← 1
7if (( severity >= min_severity )); then8 visible=$((visible + 1))9fivalues this step0 → 1visibleif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step3severity1min_severityvisible ← 2
7if (( severity >= min_severity )); then8 visible=$((visible + 1))9fivalues this step1 → 2visibleif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step2severity1min_severityvisible ← 3
7if (( severity >= min_severity )); then8 visible=$((visible + 1))9fivalues this step2 → 3visibleif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step3severity1min_severityvisible ← 4
7if (( severity >= min_severity )); then8 visible=$((visible + 1))9fivalues this step3 → 4visibleif (( visible >= 3 )); then
10done11if (( visible >= 3 )); then12 owner="ops"values this step4visibleowner ← ops
11if (( visible >= 3 )); then12 owner="ops"13elsevalues this stepopsownerecho "min=$min_severity visible=$visible $owner"
15fi16echo "min=$min_severity visible=$visible $owner"outputmin=1 visible=4 opsvalues this step1min_severity4visibleopsowner
min_severity ← 3
3min_severity=34incidents="1 3 2 3"values this step3min_severityincidents ← 1 3 2 3
3min_severity=34incidents="1 3 2 3"5visible=0values this step1 3 2 3incidentsvisible ← 0
4incidents="1 3 2 3"5visible=06for severity in $incidents; dovalues this step0visibleif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step1severity3min_severityif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step3severity3min_severityvisible ← 1
7if (( severity >= min_severity )); then8 visible=$((visible + 1))9fivalues this step0 → 1visibleif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step2severity3min_severityif (( severity >= min_severity )); then
6for severity in $incidents; do7 if (( severity >= min_severity )); then8 visible=$((visible + 1))values this step3severity3min_severityvisible ← 2
7if (( severity >= min_severity )); then8 visible=$((visible + 1))9fivalues this step1 → 2visibleif (( visible >= 3 )); then
10done11if (( visible >= 3 )); then12 owner="ops"values this step2visibleowner ← lead
13else14 owner="lead"15fivalues this stepleadownerecho "min=$min_severity visible=$visible $owner"
15fi16echo "min=$min_severity visible=$visible $owner"outputmin=3 visible=2 leadvalues this step3min_severity2visibleleadowner
visible incidents
The severity threshold controls which fixed incidents stay visible.
owner assignment
At least three visible incidents stay with operations; fewer move to lead.
fixed fixture
The incident list is a fixed scalar string for deterministic replay.