EVS_EE2_COMPLIANCE_ACTION_REPORT_NOV20 - TerrenceMcGuinness-NOAA/global-workflow GitHub Wiki

EE2 Compliance Action Report: EVS Repository (Corrected)

Scan Date: November 20, 2025 Repository: /mcp_rag_eib/eib-mcp-rag-server/supported_repos/EVS Total Files Scanned: 648 Files with Issues: 39 (Error Handling)

Executive Summary

This report has been corrected to align with the Phase 2 Semantic Annotations architecture. The previous recommendation to add set -e and set -u was identified as a false positive explicitly flagged as an anti-pattern in the EE2 Semantic Annotations (sdd_framework/phase2_annotations/ee2_error_handling_sme_corrections.rst).

The scan has identified actual violations of the EE2 standard regarding explicit exit statements in operational scripts.


Actionable Findings

1. Explicit Exit Statements (Critical Violation)

Issue: Operational scripts contain explicit exit 1 statements. EE2 Standard: "Finding 2: Exit Statement Misunderstanding". Explicit exit statements (e.g., exit 0, exit 1) are prohibited in operational jobs. Scripts must return naturally or use err_exit for fatal errors to allow proper workflow error propagation.

Violation Pattern:

# ❌ Non-Compliant (Anti-Pattern)
if [ condition ]; then
    echo "Error message"
    exit 1  # Prohibited
fi

Correct Pattern:

# ✅ Compliant
if [ condition ]; then
    err_exit "Error message"  # Uses EE2 utility
fi

Specific Violations:

  1. scripts/plots/global_chem/exevs_plots_global_chem_headline_grid2obs.sh

    • Lines 48, 54, 60: Uses exit 1 for validation failures.
    • Action: Replace echo "..." ; exit 1 with err_exit "...".
  2. scripts/plots/aqm/exevs_plots_aqm_headline.sh

    • Lines 47, 53, 59: Uses exit 1 for validation failures.
    • Action: Replace echo "..." ; exit 1 with err_exit "...".

2. False Positive Correction: set -e / set -u

Correction: The previous report incorrectly recommended adding set -e and set -u. Semantic Annotation: mcp:anti_pattern::adding_set_e_or_set_eu SME Guidance: "Do NOT recommend adding these to operational scripts. set -eu is NOT in EE2 standards. Only set -x is required."

Status:

  • Scripts using set -x and err_chk (like scripts/plots/global_det/exevs_plots_global_det_atmos_grid2grid.sh) are COMPLIANT regarding flags.
  • No action is needed to add set -e or set -u.

Implementation Plan

  1. Fix Explicit Exits:

    • Edit scripts/plots/global_chem/exevs_plots_global_chem_headline_grid2obs.sh and scripts/plots/aqm/exevs_plots_aqm_headline.sh.
    • Replace echo "MSG"; exit 1 with err_exit "MSG".
  2. Verify Compliance:

    • Ensure no other operational scripts (scripts/ex*, jobs/J*) contain explicit exit statements.
    • Ignore set -e warnings as they are false positives.