# Validate a NIST 800-53 control-mapping Markdown table: every row has a
# control ID + impact-level + evidence column, and no row marked with an
# accepted-state word (Aligned/Met/Satisfied/Implemented/Compliant) has an
# empty or placeholder evidence cell. Pure text/table parsing (python3
# stdlib, no deps) — there is no external CLI for "does this compliance
# table have complete evidence", so this check is 100% custom, honestly
# lint_control_mapping.sh [control-mapping.md]
# scripts/lint_control_mapping.sh ./control-mapping.md
DOC = " ${1 :- . / control-mapping . md } "
warn () { printf ' ⚠️ %s\n ' " $1 " ; }
error () { printf ' ❌ %s\n ' " $1 " ; fail = 1 ; }
ok () { printf ' ✅ %s\n ' " $1 " ; }
if [[ ! -f " $DOC " ]]; then
echo " Usage: $0 [control-mapping.md] " >&2
echo " File not found: $DOC " >&2
echo " == control ID + impact-level + evidence columns; evidence required for every accepted-state row (python3 stdlib table parsing — no external CLI exists for this) == "
py_out = $( python3 " $( dirname " $0 " )/check_control_mapping.py " " $DOC " )
while IFS = read -r line ; do
OK:: * ) ok " ${ line # OK :: } " ;;
ERROR:: * ) error " ${ line # ERROR :: } " ;;
*) [[ -n " $line " ]] && echo " $line " ;;
if [[ " $py_status " -ne 0 ]]; then
if [[ " $fail " -eq 0 ]]; then
echo " All checks passed. "
echo " One or more checks failed — see ❌ lines above. "