#!/usr/bin/env bash # Generated by `atlas autoresearch` — this file is YOURS, edit it freely. # # Contract: write {"score": , "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"