|
| 1 | +name: ContextBench CodeGraphContext Relevant Readiness |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + paths: |
| 7 | + - .github/workflows/contextbench-cgc-relevant-readiness.yml |
| 8 | + - scripts/contextbench-cgc-relevant-candidate-pack.mjs |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + |
| 14 | +jobs: |
| 15 | + cgc-relevant-readiness: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + timeout-minutes: 25 |
| 18 | + env: |
| 19 | + ROOT: /tmp/contextbench-cgc-relevant |
| 20 | + TASK_PAYLOADS: /tmp/contextbench-cgc-relevant/task-payloads.json |
| 21 | + CHECKOUT_ROOT: /tmp/contextbench-cgc-relevant-checkouts |
| 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 Go task |
| 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 > "$ROOT/logs/pip-shared.log" 2>&1 |
| 42 | + node scripts/contextbench-runner.mjs --validate-fixtures > "$ROOT/logs/validate-fixtures.log" 2>&1 |
| 43 | + for attempt in 1 2 3; do |
| 44 | + node scripts/contextbench-select-slice.mjs --write-task-payloads --out "$TASK_PAYLOADS.all" --checkout-root "$CHECKOUT_ROOT" > "$ROOT/logs/write-payloads-$attempt.log" 2>&1 && break |
| 45 | + if [ "$attempt" = 3 ]; then exit 1; fi |
| 46 | + sleep 5 |
| 47 | + done |
| 48 | + node - <<'NODE' |
| 49 | + const fs = require('node:fs'); |
| 50 | + const payloadPath = process.env.TASK_PAYLOADS; |
| 51 | + const target = process.env.TARGET_TASK_ID; |
| 52 | + const payload = JSON.parse(fs.readFileSync(`${payloadPath}.all`, 'utf8')); |
| 53 | + const task = payload.tasks.find((candidate) => candidate.instance_id === target); |
| 54 | + if (!task) throw new Error(`target task ${target} not found`); |
| 55 | + fs.writeFileSync(payloadPath, `${JSON.stringify({ ...payload, task_count: 1, tasks: [task] }, null, 2)}\n`); |
| 56 | + NODE |
| 57 | + for attempt in 1 2 3; do |
| 58 | + node scripts/contextbench-select-slice.mjs --materialize-checkouts --payloads "$TASK_PAYLOADS" --max-tasks 1 > "$ROOT/logs/materialize-$attempt.log" 2>&1 && break |
| 59 | + if [ "$attempt" = 3 ]; then exit 1; fi |
| 60 | + sleep 5 |
| 61 | + done |
| 62 | + - name: Install CodeGraphContext |
| 63 | + shell: bash |
| 64 | + run: python -m pip install codegraphcontext kuzu real_ladybug > "$ROOT/logs/pip-codegraphcontext.log" 2>&1 |
| 65 | + - name: Generate relevant readiness pack |
| 66 | + shell: bash |
| 67 | + run: node scripts/contextbench-cgc-relevant-candidate-pack.mjs |
| 68 | + - name: Upload relevant CGC readiness artifacts |
| 69 | + if: always() |
| 70 | + uses: actions/upload-artifact@v4 |
| 71 | + with: |
| 72 | + name: contextbench-cgc-relevant-readiness |
| 73 | + path: /tmp/contextbench-cgc-relevant |
| 74 | + retention-days: 14 |
0 commit comments