167bcc4ce5
$(cat f) inside a command redirected to f saw the already-truncated file, so every eval cycle wiped ma_history_*.txt back to one leading-space value and degraded the composite best-gate to last-cycle mean. Read is hoisted into its own statement; unquoted expansion + tail -n keeps exactly the last MA_WINDOW values. Verified: fresh/5+/6+ cycle edges reproduce sliding window.