|
| 1 | +# Optional manual agent-eval on an in-repo indexed fixture (default: fixtures/minimal). |
| 2 | +# Clone external trees into the checkout first; pass repo-relative fixture_root + matching scenarios/probes. |
| 3 | +name: Agent eval (external) |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + fixture_root: |
| 9 | + description: "Indexed project root — repo-relative path under the checkout (default fixtures/minimal)" |
| 10 | + required: false |
| 11 | + default: fixtures/minimal |
| 12 | + mode: |
| 13 | + description: "Harness mode — probe (queryRows) or live (MCP handlers)" |
| 14 | + required: false |
| 15 | + default: probe |
| 16 | + type: choice |
| 17 | + options: |
| 18 | + - probe |
| 19 | + - live |
| 20 | + runs: |
| 21 | + description: "Repeat count per probe" |
| 22 | + required: false |
| 23 | + default: "1" |
| 24 | + scenarios: |
| 25 | + description: "Golden scenarios JSON — repo-relative; empty = fixtures/golden/scenarios.json" |
| 26 | + required: false |
| 27 | + default: "" |
| 28 | + probes: |
| 29 | + description: "Probe definitions JSON — repo-relative; empty = scripts/agent-eval/scenarios.json" |
| 30 | + required: false |
| 31 | + default: "" |
| 32 | + |
| 33 | +jobs: |
| 34 | + agent-eval-external: |
| 35 | + name: Agent eval (${{ inputs.mode }}) |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - name: Checkout |
| 39 | + uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Setup |
| 42 | + uses: ./.github/actions/setup |
| 43 | + |
| 44 | + - name: Resolve paths |
| 45 | + id: paths |
| 46 | + env: |
| 47 | + INPUT_RUNS: ${{ inputs.runs }} |
| 48 | + INPUT_FIXTURE_ROOT: ${{ inputs.fixture_root }} |
| 49 | + INPUT_SCENARIOS: ${{ inputs.scenarios }} |
| 50 | + INPUT_PROBES: ${{ inputs.probes }} |
| 51 | + run: | |
| 52 | + set -euo pipefail |
| 53 | + RUNS="$INPUT_RUNS" |
| 54 | + if ! [[ "$RUNS" =~ ^[1-9][0-9]*$ ]]; then |
| 55 | + echo "runs must be a positive integer (got: $RUNS)" >&2 |
| 56 | + exit 1 |
| 57 | + fi |
| 58 | + FIXTURE="$INPUT_FIXTURE_ROOT" |
| 59 | + if [[ "$FIXTURE" == *".."* ]]; then |
| 60 | + echo "fixture_root must not contain .." >&2 |
| 61 | + exit 1 |
| 62 | + fi |
| 63 | + FIXTURE_ABS="${{ github.workspace }}/$FIXTURE" |
| 64 | + if [[ ! -d "$FIXTURE_ABS" ]]; then |
| 65 | + echo "fixture_root not found: $FIXTURE_ABS" >&2 |
| 66 | + exit 1 |
| 67 | + fi |
| 68 | + echo "fixture=$FIXTURE_ABS" >> "$GITHUB_OUTPUT" |
| 69 | + SCEN="$INPUT_SCENARIOS" |
| 70 | + if [[ -n "$SCEN" ]]; then |
| 71 | + if [[ "$SCEN" == *".."* ]]; then |
| 72 | + echo "scenarios must not contain .." >&2 |
| 73 | + exit 1 |
| 74 | + fi |
| 75 | + SCEN_ABS="${{ github.workspace }}/$SCEN" |
| 76 | + if [[ ! -f "$SCEN_ABS" ]]; then |
| 77 | + echo "scenarios file not found: $SCEN_ABS" >&2 |
| 78 | + exit 1 |
| 79 | + fi |
| 80 | + echo "scenarios=$SCEN_ABS" >> "$GITHUB_OUTPUT" |
| 81 | + fi |
| 82 | + PROB="$INPUT_PROBES" |
| 83 | + if [[ -n "$PROB" ]]; then |
| 84 | + if [[ "$PROB" == *".."* ]]; then |
| 85 | + echo "probes must not contain .." >&2 |
| 86 | + exit 1 |
| 87 | + fi |
| 88 | + PROB_ABS="${{ github.workspace }}/$PROB" |
| 89 | + if [[ ! -f "$PROB_ABS" ]]; then |
| 90 | + echo "probes file not found: $PROB_ABS" >&2 |
| 91 | + exit 1 |
| 92 | + fi |
| 93 | + echo "probes=$PROB_ABS" >> "$GITHUB_OUTPUT" |
| 94 | + fi |
| 95 | +
|
| 96 | + - name: Golden index (fixtures/minimal only) |
| 97 | + if: inputs.fixture_root == 'fixtures/minimal' |
| 98 | + run: bun run test:golden |
| 99 | + |
| 100 | + - name: Run agent-eval harness |
| 101 | + env: |
| 102 | + AGENT_EVAL_MODE: ${{ inputs.mode }} |
| 103 | + AGENT_EVAL_FIXTURE_ROOT: ${{ steps.paths.outputs.fixture }} |
| 104 | + AGENT_EVAL_RUNS: ${{ inputs.runs }} |
| 105 | + AGENT_EVAL_PRINT_SUMMARY: "1" |
| 106 | + AGENT_EVAL_SCENARIOS: ${{ steps.paths.outputs.scenarios }} |
| 107 | + AGENT_EVAL_PROBES: ${{ steps.paths.outputs.probes }} |
| 108 | + CODEMAP_MCP_TOOLS: ${{ inputs.mode == 'live' && 'query,query_recipe' || '' }} |
| 109 | + run: bash scripts/agent-eval/run-arms.sh |
| 110 | + |
| 111 | + - name: Upload comparison artifact |
| 112 | + uses: actions/upload-artifact@v4 |
| 113 | + with: |
| 114 | + name: agent-eval-comparison |
| 115 | + path: .agent-eval/comparison.json |
| 116 | + if-no-files-found: error |
0 commit comments