mirror of
https://github.com/allaunthefox/SilverSight.git
synced 2026-07-31 01:25:21 +00:00
- Add .atlas/ with benchmark.sh, score.py, gate.sh for GEPA campaigns - Add atlas.json project config (auto.capture=suggest, reflection_lm=openai/auto) - Fix test_search.py receipt path from /mnt/agents/ to /tmp/ Metric targets: dna_qubo_sort.py: avg |Rank corr| (higher=better, baseline=0.8547) dna_qubo_nn.py: NN Tm correlation (higher=better, baseline=0.4649) dna_lut.py: avg |Rank corr| (higher=better, baseline=0.5808) test_search.py: pass count (ceiling=43, for stability verification)
31 lines
985 B
Bash
Executable file
31 lines
985 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Goodhart guard: reject candidates that lower quality while improving timing
|
|
set -uo pipefail
|
|
|
|
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
TARGET="${ATLAS_OPTIMIZE_TARGET:-$2}"
|
|
REF_SCORE="${ATLAS_REF_SCORE:-$1}"
|
|
|
|
NEW_OUT="$(mktemp)"
|
|
NEW_START=$(date +%s.%N)
|
|
( python3 "$TARGET" ) >"$NEW_OUT" 2>&1
|
|
NEW_RC=$?
|
|
NEW_END=$(date +%s.%N)
|
|
NEW_ELAPSED=$(awk "BEGIN { print $NEW_END - $NEW_START }")
|
|
|
|
if [ "$NEW_RC" -ne 0 ]; then
|
|
echo "[gate] candidate failed — rejecting"
|
|
exit 1
|
|
fi
|
|
|
|
NEW_SCORE=$(python3 "$HERE/score.py" --stdout "$NEW_OUT" --elapsed "$NEW_ELAPSED" 2>/dev/null | python3 -c "import json,sys; print(json.load(sys.stdin)['score'])")
|
|
|
|
# Accept if score >= reference (higher is better)
|
|
ACCEPT=$(python3 -c "print('yes' if $NEW_SCORE >= $REF_SCORE - 0.01 else 'no')")
|
|
if [ "$ACCEPT" = "yes" ]; then
|
|
echo "[gate] accepted (score=$NEW_SCORE >= ref=$REF_SCORE)"
|
|
exit 0
|
|
else
|
|
echo "[gate] rejected (score=$NEW_SCORE < ref=$REF_SCORE)"
|
|
exit 1
|
|
fi
|