Skip to content

infra: trigger Trace Ace cache seed and V123 #3

infra: trigger Trace Ace cache seed and V123

infra: trigger Trace Ace cache seed and V123 #3

name: Trace Ace Transcript Cache Seed and V123
# Explicit run trigger: 2026-08-19 execution requested.
on:
push:
branches: [main]
paths:
- '.github/workflows/trace-ace-transcript-cache-seed.yml'
workflow_dispatch:
permissions:
contents: write
actions: read
concurrency:
group: trace-ace-frozen-transcripts-v1
cancel-in-progress: false
jobs:
seed-and-v123:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Check out frozen V123 experiment branch
uses: actions/checkout@v4
with:
ref: agent/v123-cache-seeded-rerun
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- name: Install dependencies
run: python -m pip install --disable-pip-version-check numpy pandas scipy scikit-learn gdown
- name: Restore frozen transcript archive from GitHub cache
id: transcript-cache
uses: actions/cache/restore@v4
with:
path: transcripts.zip
key: trace-ace-transcripts-v1-603547640
- name: Download frozen transcript archive on cache miss
if: steps.transcript-cache.outputs.cache-hit != 'true'
shell: bash
run: |
set -euo pipefail
for id in \
1nOjremWhpZ_QKSLvZfGcNkS_C3kMMBUI \
1vkgFdcw-rnlueCgGsKKbUUXql8GyGmET
do
rm -f transcripts.zip
echo "Trying frozen transcript source $id"
if gdown "$id" -O transcripts.zip; then
bytes=$(stat -c%s transcripts.zip)
echo "Downloaded $bytes bytes"
if [ "$bytes" = "603547640" ]; then
echo "Frozen transcript archive size verified"
echo "TRANSCRIPT_SOURCE_ID=$id" >> "$GITHUB_ENV"
break
fi
echo "Unexpected transcript archive size: $bytes" >&2
fi
rm -f transcripts.zip
done
test -f transcripts.zip
test "$(stat -c%s transcripts.zip)" = "603547640"
unzip -tq transcripts.zip >/dev/null
echo "Frozen transcript archive ZIP integrity verified"
- name: Validate restored/downloaded archive and record digest
shell: bash
run: |
set -euo pipefail
test -f transcripts.zip
test "$(stat -c%s transcripts.zip)" = "603547640"
unzip -tq transcripts.zip >/dev/null
sha256sum transcripts.zip | tee transcript_sha256.txt
echo "TRANSCRIPT_SHA256=$(cut -d' ' -f1 transcript_sha256.txt)" >> "$GITHUB_ENV"
echo "TRANSCRIPT_BYTES=$(stat -c%s transcripts.zip)" >> "$GITHUB_ENV"
if [ "${{ steps.transcript-cache.outputs.cache-hit }}" = "true" ]; then
echo "TRANSCRIPT_SOURCE_ID=GITHUB_CACHE" >> "$GITHUB_ENV"
fi
- name: Save frozen transcript archive to GitHub cache
id: transcript-cache-save
if: steps.transcript-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: transcripts.zip
key: trace-ace-transcripts-v1-603547640
- name: Download metadata and extract frozen data
shell: bash
run: |
set -euo pipefail
gdown 1EpqoamY0vFI2qE57R6wdqU5HwuoVk3Zz -O metadata.zip
mkdir -p data/meta data/transcripts
unzip -q metadata.zip -d data/meta
unzip -q transcripts.zip -d data/transcripts
echo "FEATURES=$(find data/meta -type f -name 'train_features*.csv' -print -quit)" >> "$GITHUB_ENV"
echo "LABELS=$(find data/meta -type f -name 'train_labels*.csv' -print -quit)" >> "$GITHUB_ENV"
FIRST=$(find data/transcripts -type f -name '*.csv' -print -quit)
test -n "$FIRST"
echo "TRANSCRIPTS=$(dirname "$FIRST")" >> "$GITHUB_ENV"
- name: Preflight frozen V123
run: python -m py_compile competitions/trace_the_ace/v123_official_reference_scalars.py
- name: Run frozen V123
run: python competitions/trace_the_ace/v123_official_reference_scalars.py --features "$FEATURES" --labels "$LABELS" --transcripts "$TRANSCRIPTS" --rows 2500 --out v123_official_reference_scalars.json
- name: Show V123 decision
if: always()
run: test -f v123_official_reference_scalars.json && cat v123_official_reference_scalars.json || true
- name: Record authoritative run metadata
if: always()
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
set -euo pipefail
JOB_ID=$(python - <<'PY'
import json, os, urllib.request
req=urllib.request.Request(
f"https://api.github.com/repos/{os.environ['GITHUB_REPOSITORY']}/actions/runs/{os.environ['GITHUB_RUN_ID']}/jobs",
headers={"Authorization": f"Bearer {os.environ['GH_TOKEN']}", "Accept":"application/vnd.github+json"})
with urllib.request.urlopen(req) as r:
data=json.load(r)
print(data['jobs'][0]['id'])
PY
)
CACHE_HIT='${{ steps.transcript-cache.outputs.cache-hit }}'
CACHE_SAVE='${{ steps.transcript-cache-save.outcome }}'
python - <<PY
import json, os, pathlib
v={}
p=pathlib.Path('v123_official_reference_scalars.json')
if p.exists(): v=json.loads(p.read_text())
out={
'run_id': int(os.environ['GITHUB_RUN_ID']),
'job_id': int('$JOB_ID'),
'run_attempt': int(os.environ['GITHUB_RUN_ATTEMPT']),
'cache_key': 'trace-ace-transcripts-v1-603547640',
'cache_hit': '$CACHE_HIT',
'cache_save_outcome': '$CACHE_SAVE',
'source_id': os.environ.get('TRANSCRIPT_SOURCE_ID','UNKNOWN'),
'archive_bytes': int(os.environ.get('TRANSCRIPT_BYTES','0')),
'archive_sha256': os.environ.get('TRANSCRIPT_SHA256','UNKNOWN'),
'validation': 'exact size 603547640 + unzip integrity; SHA256 recorded, no historical expected digest precommitted',
'v123': v,
}
pathlib.Path('/tmp/trace_ace_v123_run_status.json').write_text(json.dumps(out,indent=2))
print(json.dumps(out,indent=2))
PY
git fetch origin main
git worktree add /tmp/status-main origin/main
cd /tmp/status-main
mkdir -p competitions/trace_the_ace/results
cp /tmp/trace_ace_v123_run_status.json competitions/trace_the_ace/results/V123_LATEST_RUN_STATUS.json
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add competitions/trace_the_ace/results/V123_LATEST_RUN_STATUS.json
git commit -m "results: record V123 run $GITHUB_RUN_ID" || true
git push origin HEAD:main