#!/usr/bin/env bash
# Run the harness-ON then naive-OFF tuning loops sequentially (use_harness ablation),
# then drop a DONE marker. Run from the repo root on the GPU host.
set -u
export OPENAI_API_KEY=$(python3 -c 'import json,pathlib;print(json.load(open(pathlib.Path.home()/".codex/auth.json"))["OPENAI_API_KEY"])')
mkdir -p .aituner
rm -rf .aituner/abl-harness .aituner/abl-naive .aituner/ABLATION_DONE

echo "=== harness ON  start $(date -Is) ==="
PYTHONPATH=src python3 -m aituner.cli study tune \
  --spec configs/examples/dash0_qwen27b_ablation_harness_on.json \
  --store-root .aituner/abl-harness --max-trials 6 --skip-baseline > .aituner/abl-harness.log 2>&1
echo "=== harness ON  done  $(date -Is) ==="

echo "=== naive OFF   start $(date -Is) ==="
PYTHONPATH=src python3 -m aituner.cli study tune \
  --spec configs/examples/dash0_qwen27b_ablation_naive_off.json \
  --store-root .aituner/abl-naive --max-trials 6 --skip-baseline > .aituner/abl-naive.log 2>&1
echo "=== naive OFF   done  $(date -Is) ==="

touch .aituner/ABLATION_DONE
