Skip to content

Commit f2b25d2

Browse files
committed
Add parallel ContextBench tool rescue readiness workflow
1 parent 072f82b commit f2b25d2

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: ContextBench Tool Rescue Readiness
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- .github/workflows/contextbench-tool-rescue-readiness.yml
8+
- scripts/contextbench-rescue-lane-pack.mjs
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
tool-rescue-readiness:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 18
18+
strategy:
19+
fail-fast: false
20+
max-parallel: 2
21+
matrix:
22+
lane:
23+
- grepai
24+
- codegraphcontext
25+
env:
26+
ROOT: /tmp/contextbench-tool-rescue-readiness/${{ matrix.lane }}
27+
TASK_PAYLOADS: /tmp/contextbench-tool-rescue-readiness/${{ matrix.lane }}/task-payloads.json
28+
CHECKOUT_ROOT: /tmp/contextbench-tool-rescue-checkouts-${{ matrix.lane }}
29+
TARGET_TASK_ID: SWE-Bench-Pro__go__maintenance__bugfix__4df06349
30+
LANE_ID: ${{ matrix.lane }}
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: pnpm/action-setup@v2
34+
with:
35+
version: 10
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: '24'
39+
cache: pnpm
40+
- uses: actions/setup-python@v5
41+
with:
42+
python-version: '3.11'
43+
- name: Install shared setup and materialize selected Go task
44+
shell: bash
45+
run: |
46+
set -euo pipefail
47+
mkdir -p "$ROOT" "$CHECKOUT_ROOT" "$ROOT/tool" "$ROOT/logs"
48+
pnpm install --frozen-lockfile > "$ROOT/logs/pnpm-install.log" 2>&1
49+
python -m pip install "tree-sitter==0.20.4" "tree-sitter-languages==1.10.2" datasets pyarrow > "$ROOT/logs/pip-shared.log" 2>&1
50+
node scripts/contextbench-runner.mjs --validate-fixtures > "$ROOT/logs/validate-fixtures.log" 2>&1
51+
node scripts/contextbench-select-slice.mjs --write-task-payloads --out "$TASK_PAYLOADS.all" --checkout-root "$CHECKOUT_ROOT" > "$ROOT/logs/write-payloads.log" 2>&1
52+
node - <<'NODE'
53+
const fs = require('node:fs');
54+
const payloadPath = process.env.TASK_PAYLOADS;
55+
const target = process.env.TARGET_TASK_ID;
56+
const payload = JSON.parse(fs.readFileSync(`${payloadPath}.all`, 'utf8'));
57+
const task = payload.tasks.find((candidate) => candidate.instance_id === target);
58+
if (!task) throw new Error(`target task ${target} not found`);
59+
fs.writeFileSync(payloadPath, `${JSON.stringify({ ...payload, task_count: 1, tasks: [task] }, null, 2)}\n`);
60+
NODE
61+
node scripts/contextbench-select-slice.mjs --materialize-checkouts --payloads "$TASK_PAYLOADS" --max-tasks 1 > "$ROOT/logs/materialize.log" 2>&1
62+
- name: Install grepai lane
63+
if: matrix.lane == 'grepai'
64+
shell: bash
65+
run: |
66+
set -euo pipefail
67+
curl -sSL https://raw.githubusercontent.com/yoanbernabeu/grepai/main/install.sh | sh > "$ROOT/logs/grepai-install.log" 2>&1 || true
68+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
69+
echo "$HOME/bin" >> "$GITHUB_PATH"
70+
- name: Install CodeGraphContext lane
71+
if: matrix.lane == 'codegraphcontext'
72+
shell: bash
73+
run: |
74+
set -euo pipefail
75+
python -m pip install codegraphcontext kuzu real_ladybug > "$ROOT/logs/pip-codegraphcontext.log" 2>&1 || python -m pip install codegraphcontext kuzu > "$ROOT/logs/pip-codegraphcontext-fallback.log" 2>&1
76+
- name: Generate rescue lane readiness candidate pack
77+
shell: bash
78+
run: node scripts/contextbench-rescue-lane-pack.mjs
79+
- name: Upload tool rescue readiness artifacts
80+
if: always()
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: contextbench-tool-rescue-readiness-${{ matrix.lane }}
84+
path: /tmp/contextbench-tool-rescue-readiness/${{ matrix.lane }}
85+
retention-days: 14

0 commit comments

Comments
 (0)