| 1 |
name: Live Evaluations |
| 2 |
|
| 3 |
on: |
| 4 |
workflow_call: |
| 5 |
workflow_dispatch: |
| 6 |
|
| 7 |
jobs: |
| 8 |
evaluations-live-openai: |
| 9 |
runs-on: ubuntu-latest |
| 10 |
steps: |
| 11 |
- name: Check live evaluation configuration |
| 12 |
id: config |
| 13 |
run: | |
| 14 |
if [ -z "${CLNKR_EVALUATION_API_KEY}" ]; then |
| 15 |
echo "Live evaluation failed: OPENAI_API_KEY secret is not set." >&2 |
| 16 |
exit 1 |
| 17 |
fi |
| 18 |
echo "configured=true" >> "$GITHUB_OUTPUT" |
| 19 |
env: |
| 20 |
CLNKR_EVALUATION_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 21 |
|
| 22 |
- uses: actions/checkout@v5 |
| 23 |
if: steps.config.outputs.configured == 'true' |
| 24 |
|
| 25 |
- uses: actions/setup-go@v6 |
| 26 |
if: steps.config.outputs.configured == 'true' |
| 27 |
with: |
| 28 |
go-version-file: go.mod |
| 29 |
|
| 30 |
- name: Add local user bin to PATH |
| 31 |
if: steps.config.outputs.configured == 'true' |
| 32 |
run: echo "$HOME/.local/bin" >> "$GITHUB_PATH" |
| 33 |
|
| 34 |
- name: Install clankerval release package |
| 35 |
if: steps.config.outputs.configured == 'true' |
| 36 |
env: |
| 37 |
DEBIAN_FRONTEND: noninteractive |
| 38 |
GH_TOKEN: ${{ github.token }} |
| 39 |
run: | |
| 40 |
version="$(sed -n 's/^CLANKERVAL_PINNED_VERSION := //p' Makefile)" |
| 41 |
arch="$(dpkg --print-architecture)" |
| 42 |
pattern="clankerval_${version}-*_${arch}.deb" |
| 43 |
gh release download "v${version}" --repo clnkr-ai/clankerval --pattern "$pattern" |
| 44 |
deb="$(find . -maxdepth 1 -name "$pattern" -print -quit)" |
| 45 |
sudo apt-get update |
| 46 |
sudo apt-get install -y "$deb" |
| 47 |
rm -f "$deb" |
| 48 |
|
| 49 |
- name: Run live evaluations |
| 50 |
if: steps.config.outputs.configured == 'true' |
| 51 |
run: make evaluations-live-openai |
| 52 |
env: |
| 53 |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 54 |
CLNKR_EVALUATION_OPENAI_BASE_URL: ${{ vars.CLNKR_EVALUATION_BASE_URL }} |
| 55 |
CLNKR_EVALUATION_OPENAI_MODEL: ${{ vars.CLNKR_EVALUATION_MODEL }} |
| 56 |
|
| 57 |
- name: Show live evaluation bundles on failure |
| 58 |
if: failure() && steps.config.outputs.configured == 'true' |
| 59 |
run: | |
| 60 |
find evaluations/trials -maxdepth 5 -type f | sort || true |
| 61 |
echo |
| 62 |
find evaluations/reports -maxdepth 1 -type f | sort || true |
| 63 |
for trial_dir in $(find evaluations/trials -mindepth 1 -maxdepth 1 -type d | sort); do |
| 64 |
echo |
| 65 |
echo "== $(basename "$trial_dir") bundle ==" |
| 66 |
sed -n '1,200p' "$trial_dir/bundle.json" || true |
| 67 |
echo |
| 68 |
echo "== $(basename "$trial_dir") normalized graders ==" |
| 69 |
sed -n '1,200p' "$trial_dir/normalized/graders.jsonl" || true |
| 70 |
echo |
| 71 |
echo "== $(basename "$trial_dir") outcome diff ==" |
| 72 |
sed -n '1,200p' "$trial_dir/outcome/diff.patch" || true |
| 73 |
echo |
| 74 |
echo "== $(basename "$trial_dir") raw commands ==" |
| 75 |
sed -n '1,200p' "$trial_dir/raw/commands.jsonl" || true |
| 76 |
if [ -f "$trial_dir/raw/agent/events.jsonl" ]; then |
| 77 |
echo |
| 78 |
echo "== $(basename "$trial_dir") raw agent events ==" |
| 79 |
sed -n '1,200p' "$trial_dir/raw/agent/events.jsonl" || true |
| 80 |
fi |
| 81 |
if [ -f "$trial_dir/raw/provider-responses.jsonl" ]; then |
| 82 |
echo |
| 83 |
echo "== $(basename "$trial_dir") raw provider responses ==" |
| 84 |
sed -n '1,200p' "$trial_dir/raw/provider-responses.jsonl" || true |
| 85 |
fi |
| 86 |
done |
| 87 |
|
| 88 |
- name: Upload live evaluation artifacts |
| 89 |
if: always() && steps.config.outputs.configured == 'true' |
| 90 |
uses: actions/upload-artifact@v4 |
| 91 |
with: |
| 92 |
name: live-evaluations-openai-${{ github.run_id }} |
| 93 |
path: | |
| 94 |
evaluations/trials/ |
| 95 |
evaluations/reports/ |
| 96 |
if-no-files-found: warn |
| 97 |
retention-days: 14 |
| 98 |
|
| 99 |
evaluations-live-anthropic: |
| 100 |
runs-on: ubuntu-latest |
| 101 |
steps: |
| 102 |
- name: Check live evaluation configuration |
| 103 |
id: config |
| 104 |
run: | |
| 105 |
if [ -z "${CLNKR_EVALUATION_API_KEY}" ]; then |
| 106 |
echo "Live evaluation failed: ANTHROPIC_API_KEY secret is not set." >&2 |
| 107 |
exit 1 |
| 108 |
fi |
| 109 |
echo "configured=true" >> "$GITHUB_OUTPUT" |
| 110 |
env: |
| 111 |
CLNKR_EVALUATION_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
| 112 |
|
| 113 |
- uses: actions/checkout@v5 |
| 114 |
if: steps.config.outputs.configured == 'true' |
| 115 |
|
| 116 |
- uses: actions/setup-go@v6 |
| 117 |
if: steps.config.outputs.configured == 'true' |
| 118 |
with: |
| 119 |
go-version-file: go.mod |
| 120 |
|
| 121 |
- name: Add local user bin to PATH |
| 122 |
if: steps.config.outputs.configured == 'true' |
| 123 |
run: echo "$HOME/.local/bin" >> "$GITHUB_PATH" |
| 124 |
|
| 125 |
- name: Install clankerval release package |
| 126 |
if: steps.config.outputs.configured == 'true' |
| 127 |
env: |
| 128 |
DEBIAN_FRONTEND: noninteractive |
| 129 |
GH_TOKEN: ${{ github.token }} |
| 130 |
run: | |
| 131 |
version="$(sed -n 's/^CLANKERVAL_PINNED_VERSION := //p' Makefile)" |
| 132 |
arch="$(dpkg --print-architecture)" |
| 133 |
pattern="clankerval_${version}-*_${arch}.deb" |
| 134 |
gh release download "v${version}" --repo clnkr-ai/clankerval --pattern "$pattern" |
| 135 |
deb="$(find . -maxdepth 1 -name "$pattern" -print -quit)" |
| 136 |
sudo apt-get update |
| 137 |
sudo apt-get install -y "$deb" |
| 138 |
rm -f "$deb" |
| 139 |
|
| 140 |
- name: Run live evaluations |
| 141 |
if: steps.config.outputs.configured == 'true' |
| 142 |
run: make evaluations-live-anthropic |
| 143 |
env: |
| 144 |
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
| 145 |
CLNKR_EVALUATION_ANTHROPIC_BASE_URL: ${{ vars.CLNKR_EVALUATION_ANTHROPIC_BASE_URL }} |
| 146 |
CLNKR_EVALUATION_ANTHROPIC_MODEL: ${{ vars.CLNKR_EVALUATION_ANTHROPIC_MODEL }} |
| 147 |
|
| 148 |
- name: Show live evaluation bundles on failure |
| 149 |
if: failure() && steps.config.outputs.configured == 'true' |
| 150 |
run: | |
| 151 |
find evaluations/trials -maxdepth 5 -type f | sort || true |
| 152 |
echo |
| 153 |
find evaluations/reports -maxdepth 1 -type f | sort || true |
| 154 |
for trial_dir in $(find evaluations/trials -mindepth 1 -maxdepth 1 -type d | sort); do |
| 155 |
echo |
| 156 |
echo "== $(basename "$trial_dir") bundle ==" |
| 157 |
sed -n '1,200p' "$trial_dir/bundle.json" || true |
| 158 |
echo |
| 159 |
echo "== $(basename "$trial_dir") normalized graders ==" |
| 160 |
sed -n '1,200p' "$trial_dir/normalized/graders.jsonl" || true |
| 161 |
echo |
| 162 |
echo "== $(basename "$trial_dir") outcome diff ==" |
| 163 |
sed -n '1,200p' "$trial_dir/outcome/diff.patch" || true |
| 164 |
echo |
| 165 |
echo "== $(basename "$trial_dir") raw commands ==" |
| 166 |
sed -n '1,200p' "$trial_dir/raw/commands.jsonl" || true |
| 167 |
if [ -f "$trial_dir/raw/agent/events.jsonl" ]; then |
| 168 |
echo |
| 169 |
echo "== $(basename "$trial_dir") raw agent events ==" |
| 170 |
sed -n '1,200p' "$trial_dir/raw/agent/events.jsonl" || true |
| 171 |
fi |
| 172 |
if [ -f "$trial_dir/raw/provider-responses.jsonl" ]; then |
| 173 |
echo |
| 174 |
echo "== $(basename "$trial_dir") raw provider responses ==" |
| 175 |
sed -n '1,200p' "$trial_dir/raw/provider-responses.jsonl" || true |
| 176 |
fi |
| 177 |
done |
| 178 |
|
| 179 |
- name: Upload live evaluation artifacts |
| 180 |
if: always() && steps.config.outputs.configured == 'true' |
| 181 |
uses: actions/upload-artifact@v4 |
| 182 |
with: |
| 183 |
name: live-evaluations-anthropic-${{ github.run_id }} |
| 184 |
path: | |
| 185 |
evaluations/trials/ |
| 186 |
evaluations/reports/ |
| 187 |
if-no-files-found: warn |
| 188 |
retention-days: 14 |