Skip to content

ci(evals): manual-dispatch plugin-eval workflow with budget cap, docs page - #1017

Merged
admarble merged 2 commits into
mainfrom
feature/994-ci-evals-manual-dispatch-plugin-eval-workflow-with
Sep 8, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/994-ci-evals-manual-dispatch-plugin-eval-workflow-with

Conversation

@admarble

@admarble admarble commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

.github/workflows/plugin-eval.yml — a workflow_dispatch-only CI job that runs the full evals/ suite (qa-trust-boundary, spec-ac-parse, assess-dashboard, null-run-canary) in one claude plugin eval invocation, capped at --max-cost-usd 10 (OQ-7). Plus docs/reference/plugin-eval.md and one README link line.

CLAUDE_CODE_WALNUT_SPIRE=1 lives only in the workflow's own env: — never in .claude/settings.json / .claude/settings.local.json. The ANTHROPIC_API_KEY secret check fails loudly, naming the secret, rather than skipping silently or fabricating a green run.

How the job decides pass/fail

null-run-canary is red by construction, so a healthy suite always leaves exactly one case below the bar and the CLI always exits 1. The job maps that status explicitly instead of trusting or discarding it:

CLI exit Meaning Job result
0 Every case cleared the bar, canary included Fail — graders are vacuous
1 Something is below the bar Confirm from results.json that it is only the canary
2 Budget ceiling hit, results partial Fail, naming the budget
other Unexpected Fail

Before any of that, a truncated run is rejected: .partial == true, or a cases array shorter than 4, fails and names the budget — so a run aborted mid-suite can no longer report green on the subset it managed to evaluate. Because the case-count check runs first, an absent canary is named rather than compared against an empty string.

--threshold 0.8 and the per-case gate use the same number against the same field (.aggregates.score), so the flag and the gate cannot disagree. --runs 2 is the smallest number that can absorb one flaked run of qa-trust-boundary's known-flaky qa-gaps-marker grader: one flaked run of two scores (1 + 2/3)/2 = 0.833 (clears), two score 0.667 (does not). --scaffold is required for assess-dashboard, whose case.yaml declares a scaffold_script that writes the two issue fixtures its prompt reads by name.

Projected spend at these settings is ~$7.10 against the $10 ceiling, from #993's recorded per-case costs (both ablation arms included).

AC Verification

AC Verify command Result
AC-1 grep -c 'workflow_dispatch' .github/workflows/plugin-eval.yml → 1; grep -c 'pull_request|push:' … → 0 ✅ 1 / 0
AC-2 grep -E 'max-cost-usd [0-9]+' …; grep -c -- '--threshold' … → 1 ✅ --max-cost-usd 10; threshold count 1
AC-3 actions/upload-artifact step uploads the eval results dir; one green run URL in PR body ⚠️ PENDING — needs owner action. See below.
AC-4 grep -rn 'WALNUT' .claude/settings.json .claude/settings.local.json 2>/dev/null | wc -l → 0 ✅ 0
AC-5 test -f docs/reference/plugin-eval.md; content grep ≥ 3; grep -c 'plugin-eval' README.md ≥ 1 ✅ exists; content grep 5; README 1

AC-3 is blocked on two owner actions, not on this branch

  1. The secret. gh secret list returns empty — the repo has no secrets today.

    gh secret set ANTHROPIC_API_KEY
  2. The default branch. GitHub only exposes a workflow_dispatch workflow once its file is on the default branch. Until this merges, gh workflow list does not show Plugin Eval and gh run list --workflow=plugin-eval.yml returns HTTP 404 — so the green run cannot be produced from this branch even with the secret set. Verified: git cat-file -e origin/main:.github/workflows/plugin-eval.yml → absent.

    After merge:

    gh workflow run plugin-eval.yml
    gh run view <id> --json conclusion --jq .conclusion   # expect: success

Test plan

  • npm run lint — passes
  • npm run build — passes
  • YAML syntax validated (npx js-yaml .github/workflows/plugin-eval.yml)
  • AC-1/2/4/5 grep verifies run against the committed files (table above)
  • Gate logic exercised against nine scenarios built from feat(evals): first three claude plugin eval cases, null-run canary, fixture_commit gate (#987 P1) #993's recorded evals/results/*.json: healthy → pass; one flaked run (0.833) → pass; .partial=true → fail; 3 cases → fail naming those present; CLI exit 0 → fail (vacuous graders); CLI exit 2 → fail naming the budget; a case at 0.75 → fail naming it; canary at 0.5 → fail; canary absent → fail naming the cases present.
  • AC-3: owner adds the secret, merges, dispatches; green run URL to follow

Known unrelated failure

__tests__/evals-fixture-commit.test.ts fails locally (5 cases) on this branch and on its parent — it is not caused by this change, which touches no file the test reads. #993's PR was squash-merged, so the fixture_commit SHAs recorded in evals/results/*.json are pre-squash branch commits and are not ancestors of main. The test's shallow-clone guard hides this in CI (the objects are absent there, so ancestry is unevaluable and the assertion is skipped), which is why CI is green while a local checkout that still has the #993 objects is red. Belongs to #993/#830, not here.

Closes #994

Adds .github/workflows/plugin-eval.yml (workflow_dispatch only), the
docs/reference/plugin-eval.md reference page, and a README link. The
job caps spend at --max-cost-usd 10, uses --threshold 0.9 to absorb
the qa-gaps-marker flake from #993's QA, and gates on parsing
results.json directly so the null-run-canary's expected failure
doesn't fail the suite while a real regression does.

Entire-Checkpoint: db1f25e5702d
QA found the job's pass/fail logic contradicted the flags it passed. Five
fixes, per the runner's fix-round directive:

1/2. The gate and the flag now use one bar. `--threshold 0.8` is load-bearing
     again: `|| true` is gone, the CLI's exit status is captured and mapped
     explicitly (0 = canary cleared the bar, so the graders are vacuous;
     1 = expected, confirmed against results.json; 2 = budget abort), and the
     per-case check reads `.aggregates.score` against the same 0.8. The old
     `passRate >= 1` gate was stricter than the threshold it was supposed to
     relax, so qa-trust-boundary's known-flaky grader produced a false red on
     most dispatches.

3.   `--scaffold` added. assess-dashboard's case.yaml declares a
     scaffold_script that writes the two issue fixtures its prompt reads;
     scaffolding is off by default, so the case could never pass in CI.

4.   A truncated run now fails loudly. `.partial` and a short `cases` array
     are both checked before anything else is read, so a run aborted at the
     budget ceiling can no longer report green on the subset it evaluated.
     The case-count check also names an absent canary instead of comparing
     against an empty string.

5.   docs/reference/plugin-eval.md rewritten to describe the gate that ships,
     including the arithmetic behind the 0.8 bar and the ~$7.10 projected
     spend against the $10 ceiling.

`--runs 2` replaces the per-case defaults: two runs is the smallest number
that can absorb a single flaked run, and it cuts projected spend from ~$9.05
to ~$7.10.

Gate logic verified against nine scenarios built from #993's recorded
evals/results/*.json — healthy, flake-absorbed, partial, truncated, canary
green, canary partial, canary absent, budget abort, case regressed.

Adds the missing CHANGELOG [Unreleased] entry.

Entire-Checkpoint: 2e96d9e30322
@admarble
admarble merged commit 8a8c40d into main Sep 8, 2026
6 checks passed
@admarble
admarble deleted the feature/994-ci-evals-manual-dispatch-plugin-eval-workflow-with branch September 8, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(evals): manual-dispatch plugin-eval workflow with budget cap, docs page (#987 P2)

1 participant