Skip to content

Commit 5ce5d9b

Browse files
committed
trace ace: launch V97 submission sprint
1 parent 7049288 commit 5ce5d9b

1 file changed

Lines changed: 143 additions & 0 deletions

File tree

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Trace the Ace V97 submission sprint
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: [agent/trace-ace-mastery-events]
6+
paths:
7+
- 'competitions/trace_the_ace/v97_support_gate.py'
8+
- 'competitions/trace_the_ace/train_v97_runtime_assets.py'
9+
- 'competitions/trace_the_ace/runtime_v97/**'
10+
- '.github/workflows/trace-ace-v97-submission-sprint.yml'
11+
12+
jobs:
13+
validate-and-build:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 360
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.12'
21+
cache: pip
22+
- uses: astral-sh/setup-uv@v6
23+
- uses: extractions/setup-just@v2
24+
- name: Install dependencies
25+
run: python -m pip install --disable-pip-version-check numpy pandas scipy scikit-learn gdown
26+
27+
- name: Download frozen training data
28+
run: |
29+
set -euo pipefail
30+
gdown 1nOjremWhpZ_QKSLvZfGcNkS_C3kMMBUI -O transcripts.zip
31+
gdown 1EpqoamY0vFI2qE57R6wdqU5HwuoVk3Zz -O metadata.zip
32+
mkdir -p data/transcripts data/meta
33+
unzip -q transcripts.zip -d data/transcripts
34+
unzip -q metadata.zip -d data/meta
35+
36+
- name: Resolve schemas
37+
shell: bash
38+
run: |
39+
set -euo pipefail
40+
FEATURES=$(find data/meta -type f -name 'train_features*.csv' -print -quit)
41+
LABELS=$(find data/meta -type f -name 'train_labels*.csv' -print -quit)
42+
FIRST=$(find data/transcripts -type f -name '*.csv' -print -quit)
43+
TRANSCRIPTS=$(dirname "$FIRST")
44+
test -n "$FEATURES" && test -n "$LABELS" && test -n "$FIRST"
45+
echo "FEATURES=$FEATURES" >> "$GITHUB_ENV"
46+
echo "LABELS=$LABELS" >> "$GITHUB_ENV"
47+
echo "TRANSCRIPTS=$TRANSCRIPTS" >> "$GITHUB_ENV"
48+
export FEATURES LABELS TRANSCRIPTS
49+
python - <<'PY'
50+
import pandas as pd, os
51+
print('features columns', list(pd.read_csv(os.environ['FEATURES'], nrows=0).columns))
52+
print('labels columns', list(pd.read_csv(os.environ['LABELS'], nrows=0).columns))
53+
PY
54+
55+
- name: Run frozen V97 four-world gate
56+
run: |
57+
set -euo pipefail
58+
cd competitions/trace_the_ace
59+
python v97_support_gate.py \
60+
--features "../../$FEATURES" --labels "../../$LABELS" --transcripts "../../$TRANSCRIPTS" \
61+
--out ../../v97_support_gate.json
62+
63+
- name: Decide submission promotion
64+
id: gate
65+
shell: bash
66+
run: |
67+
python - <<'PY'
68+
import json, os
69+
r=json.load(open('v97_support_gate.json'))
70+
verdict=r['decision']['verdict']
71+
print(json.dumps(r['decision'], indent=2))
72+
with open(os.environ['GITHUB_OUTPUT'],'a') as f:
73+
f.write('promote=' + ('true' if verdict=='BUILD_SUBMISSION_NOW' else 'false') + '\n')
74+
PY
75+
76+
- name: Train frozen V97 runtime assets
77+
if: steps.gate.outputs.promote == 'true'
78+
run: |
79+
set -euo pipefail
80+
cd competitions/trace_the_ace
81+
python train_v97_runtime_assets.py \
82+
--features "../../$FEATURES" --labels "../../$LABELS" --transcripts "../../$TRANSCRIPTS" \
83+
--out-dir ../../v97_assets
84+
85+
- name: Assemble official runtime
86+
if: steps.gate.outputs.promote == 'true'
87+
shell: bash
88+
run: |
89+
set -euo pipefail
90+
git clone --depth 1 https://github.com/drivendataorg/tutoring-outcomes-runtime.git /tmp/runtime
91+
rm -rf /tmp/runtime/submission_src/*
92+
cp competitions/trace_the_ace/runtime_v97/main.py /tmp/runtime/submission_src/main.py
93+
for F in v71_mastery_events.py v75_canonical_trajectory.py v81_target_segment_phase.py v85_evidence_state.py v89_relative_ability_composition.py v93_shift_robust_validation.py v94_related_control.py; do
94+
cp "competitions/trace_the_ace/$F" "/tmp/runtime/submission_src/$F"
95+
done
96+
mkdir -p /tmp/runtime/submission_src/assets
97+
cp v97_assets/v97_assets.npz v97_assets/manifest.json /tmp/runtime/submission_src/assets/
98+
find /tmp/runtime/submission_src -maxdepth 2 -type f -printf '%P %s bytes\n'
99+
100+
- name: Pack and check official submission
101+
if: steps.gate.outputs.promote == 'true'
102+
working-directory: /tmp/runtime
103+
run: |
104+
just pack-submission
105+
just check-submission
106+
just pull
107+
108+
- name: Test official submission offline
109+
if: steps.gate.outputs.promote == 'true'
110+
working-directory: /tmp/runtime
111+
env:
112+
BLOCK_INTERNET: 'true'
113+
GITHUB_ACTIONS_NO_TTY: 'true'
114+
SUBMISSION_IMAGE: tutoringoutcomeschallengeprodacr.azurecr.io/tutoring-outcomes-runtime:gpu-latest
115+
run: just test-submission
116+
117+
- name: Validate output contract
118+
if: steps.gate.outputs.promote == 'true'
119+
run: |
120+
python competitions/trace_the_ace/runtime_validate.py output \
121+
--format /tmp/runtime/data-demo/submission_format.csv \
122+
--predictions /tmp/runtime/submission/submission.csv
123+
124+
- name: Upload gate evidence
125+
if: always()
126+
uses: actions/upload-artifact@v4
127+
with:
128+
name: trace-ace-v97-gate-evidence
129+
path: v97_support_gate.json
130+
retention-days: 14
131+
132+
- name: Upload submission candidate
133+
if: steps.gate.outputs.promote == 'true'
134+
uses: actions/upload-artifact@v4
135+
with:
136+
name: trace-ace-v97-official-runtime-candidate
137+
path: |
138+
/tmp/runtime/submission/submission.zip
139+
/tmp/runtime/submission/submission.csv
140+
/tmp/runtime/submission/log.txt
141+
v97_assets/manifest.json
142+
v97_support_gate.json
143+
retention-days: 14

0 commit comments

Comments
 (0)