Initial: branch-oriented eval framework
This commit is contained in:
47
scripts/start-eval.sh
Executable file
47
scripts/start-eval.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "Usage: $0 <eval-name>"
|
||||
echo "Example: $0 opencode-glm47"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
EVAL_NAME="eval/$1"
|
||||
EVAL_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
# Verify we're on main
|
||||
CURRENT_BRANCH=$(git branch --show-current)
|
||||
if [[ "${CURRENT_BRANCH}" != "main" ]]; then
|
||||
echo "Error: Must be on 'main' branch to start an evaluation."
|
||||
echo "Current branch: ${CURRENT_BRANCH}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if eval branch already exists
|
||||
if git show-ref --verify --quiet refs/heads/"${EVAL_NAME}"; then
|
||||
echo "Error: Evaluation branch '${EVAL_NAME}' already exists."
|
||||
echo "Use a different name or delete the existing branch first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Creating evaluation branch: ${EVAL_NAME}"
|
||||
|
||||
# Create orphan branch
|
||||
git switch --orphan "${EVAL_NAME}"
|
||||
|
||||
# Copy only flake files from main
|
||||
git checkout main -- flake.nix flake.lock .envrc SPEC.md
|
||||
|
||||
# Initial commit
|
||||
git add .
|
||||
git commit -m "Initial: setup evaluation environment"
|
||||
|
||||
# Set up direnv
|
||||
direnv allow
|
||||
|
||||
echo ""
|
||||
echo "Evaluation environment ready!"
|
||||
echo "Working on branch: ${EVAL_NAME}"
|
||||
echo ""
|
||||
echo "Run 'git checkout main' when you're done to return to main."
|
||||
Reference in New Issue
Block a user