- Implemented `compute_oof_error_envelope` to calculate absolute prediction-error envelopes and safety margins for adaptive surrogate validation. - Added `build_local_oof_error_table` to create a one-row-per-sample OOF residual table for local safety margins. - Updated `run_nested_cv_rbf_for_target` to utilize the new functions and return validation envelopes and local OOF error data. - Enhanced `main` function to save validation envelopes and local OOF errors to CSV files. - Modified shell scripts to adjust parameters for training and optimization. - Introduced unit tests for new optimization logic, including safety margin calculations and local OOF error table construction.