Skip to content

Commit 072f82b

Browse files
committed
Add bounded ContextBench rescue readiness workflow
1 parent 831bfb1 commit 072f82b

1 file changed

Lines changed: 91 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)