Skip to content

Commit cfbbd33

Browse files
committed
Add CodeGraphContext ContextBench readiness rerun
1 parent 1e8f1a3 commit cfbbd33

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: ContextBench CodeGraphContext Readiness
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- .github/workflows/contextbench-codegraphcontext-readiness.yml
8+
- scripts/contextbench-codegraphcontext-content-pack.mjs
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
codegraphcontext-readiness:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 25
18+
env:
19+
ROOT: /tmp/contextbench-codegraphcontext-readiness
20+
TASK_PAYLOADS: /tmp/contextbench-codegraphcontext-readiness/task-payloads.json
21+
CHECKOUT_ROOT: /tmp/contextbench-checkouts-codegraphcontext-content
22+
TARGET_TASK_ID: SWE-Bench-Pro__go__maintenance__bugfix__4df06349
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: pnpm/action-setup@v2
26+
with:
27+
version: 10
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: '24'
31+
cache: pnpm
32+
- uses: actions/setup-python@v5
33+
with:
34+
python-version: '3.11'
35+
- name: Materialize selected task and install CodeGraphContext
36+
shell: bash
37+
run: |
38+
set -euo pipefail
39+
mkdir -p "$ROOT" "$CHECKOUT_ROOT" "$ROOT/logs"
40+
pnpm install --frozen-lockfile > "$ROOT/logs/pnpm-install.log" 2>&1
41+
python -m pip install "tree-sitter==0.20.4" "tree-sitter-languages==1.10.2" datasets pyarrow uv codegraphcontext kuzu > "$ROOT/logs/pip-install.log" 2>&1
42+
node scripts/contextbench-runner.mjs --validate-fixtures > "$ROOT/logs/validate-fixtures.log" 2>&1
43+
node scripts/contextbench-select-slice.mjs --write-task-payloads --out "$TASK_PAYLOADS.all" --checkout-root "$CHECKOUT_ROOT" > "$ROOT/logs/write-payloads.log" 2>&1
44+
node - <<'NODE'
45+
const fs = require('node:fs');
46+
const payloadPath = process.env.TASK_PAYLOADS;
47+
const target = process.env.TARGET_TASK_ID;
48+
const payload = JSON.parse(fs.readFileSync(`${payloadPath}.all`, 'utf8'));
49+
const task = payload.tasks.find((candidate) => candidate.instance_id === target);
50+
if (!task) throw new Error(`target task ${target} not found`);
51+
fs.writeFileSync(payloadPath, `${JSON.stringify({ ...payload, task_count: 1, tasks: [task] }, null, 2)}\n`);
52+
NODE
53+
node scripts/contextbench-select-slice.mjs --materialize-checkouts --payloads "$TASK_PAYLOADS" --max-tasks 1 > "$ROOT/logs/materialize.log" 2>&1
54+
- name: Generate CodeGraphContext readiness candidate pack
55+
shell: bash
56+
run: node scripts/contextbench-codegraphcontext-content-pack.mjs
57+
- name: Upload CodeGraphContext readiness artifacts
58+
if: always()
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: contextbench-codegraphcontext-readiness
62+
path: /tmp/contextbench-codegraphcontext-readiness
63+
retention-days: 14

0 commit comments

Comments
 (0)