Research-Stack/.atlas/benchmark.sh
allaun 180bf43cce
Some checks failed
Wolfram Alpha Verification Check / wolfram-verification (push) Has been cancelled
fix(optimize): add TARGET fallback + enrich score feedback for GEPA
benchmark.sh: fall back to  when ATLAS_OPTIMIZE_TARGET unset
score.py: track find_optimal_crossing and SA direct as separate
  scorecard examples with diagnostic context for reflector
gate.sh: add positional-arg fallback for ATLAS_OPTIMIZE_TARGET

Build: N/A (config & Python shims only)
2026-07-07 00:49:07 -05:00

30 lines
1.3 KiB
Bash
Executable file

#!/usr/bin/env bash
# Generated by `atlas autoresearch` — this file is YOURS, edit it freely.
#
# Contract: write {"score": <float>, "examples": [...]} to $ATLAS_OPTIMIZE_RESULT.
# The candidate artifact has already been written into this worktree at
# ${ATLAS_OPTIMIZE_TARGET} (the repo-relative path: 4-Infrastructure/shim/braid_search.py)
# so the only thing a candidate can change is that file — the optimizer runs
# every candidate in its own throwaway git worktree, which keeps the evaluator
# and data pinned. score.py turns the run's output into the score; .atlas/gate.sh
# is the Goodhart guard.
set -uo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OUT="$(mktemp)"
# --- the repo's run command (auto-detected) --------------------------------
# Edit this line if the campaign should run something different.
TARGET="${ATLAS_OPTIMIZE_TARGET:-$1}"
( python3 "$TARGET" ) >"$OUT" 2>&1
RC=$?
# ---------------------------------------------------------------------------
if [ "$RC" -ne 0 ]; then
echo "[benchmark] run command exited $RC — candidate failed" >&2
tail -n 40 "$OUT" >&2
exit "$RC"
fi
# Parse the optimized metric out of the run output (edit .atlas/score.py to
# change which number is read, or to emit richer per-example feedback).
python3 "$HERE/score.py" --stdout "$OUT"