Skip to content

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

Closed

Description

@admarble

Epic: M2 Blocked by: #993 Tier: mechanical Doc: docs/internal/graph-2026-09/PLAN.md §5 I-8, §9 OQ-7/OQ-14

Why

The suite is only useful if it runs somewhere other than one laptop. Node 07's
P0.5 decided per-PR vs. manual; this graph ships manual-dispatch only.

Scope

  • may touch: .github/workflows/plugin-eval.yml (new), docs/reference/plugin-eval.md (new), README.md (one link line)
  • not in scope: per-PR triggers; any case; repo .claude/settings.json (the env var must not live there — docs/internal/graph-2026-09/lab-notes-phase0.md §1 / memory).

Preconditions

  • CLAUDE_CODE_WALNUT_SPIRE=1 is set in the workflow's env, and the runner's account has the org early access (OQ-14). The API credential comes from a repository secret named in the workflow.

Acceptance criteria

  • AC-1: workflow exists, manual-dispatch only — Verify: grep -c 'workflow_dispatch' .github/workflows/plugin-eval.yml → 1 and grep -c 'pull_request\|push:' .github/workflows/plugin-eval.yml → 0.
  • AC-2: budget and threshold on the command line — Verify: grep -E 'max-cost-usd [0-9]+' .github/workflows/plugin-eval.yml prints the OQ-7 number and grep -c -- '--threshold' .github/workflows/plugin-eval.yml → 1.
  • AC-3: report uploaded — Verify: the workflow has an actions/upload-artifact step whose path is the eval results dir; one green run URL is in the PR body (gh run view <id> --json conclusion --jq .conclusion → success).
  • AC-4: env var not in repo settings — Verify: grep -rn 'WALNUT' .claude/settings.json .claude/settings.local.json 2>/dev/null | wc -l → 0.
  • AC-5: docs — Verify: test -f docs/reference/plugin-eval.md and grep -c 'fixture_commit\|ablation\|max-cost-usd' docs/reference/plugin-eval.md ≥ 3; grep -c 'plugin-eval' README.md ≥ 1.

Done when

A maintainer can dispatch the eval suite from the Actions tab, it stops at the agreed budget, and the report is downloadable from the run.


Part of #987. Planned by /graph-plan 2026-09-06; run with /graph-run. Plan: docs/internal/graph-2026-09/PLAN.md, graph: docs/internal/graph-2026-09/issue-graph.md, node file: docs/internal/graph-2026-09/issues/13-*.md.

Activity

  1. added
    graph-2026-09
    on Sep 7, 2026
  2. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    Runner context — wave 3 launch (2026-09-08, main at f94be34). The blocker is merged: #993 (PR #1009) landed evals/{qa-trust-boundary,spec-ac-parse,assess-dashboard,null-run-canary}/, one recorded result per case under evals/results/, and __tests__/evals-fixture-commit.test.ts. Read the plan and your node file from main: docs/internal/graph-2026-09/PLAN.md (§5 I-8, §7 D15/D18/D22/D23, §9 OQ-7 = budget 10, OQ-14) and docs/internal/graph-2026-09/issues/13-987C-eval-ci.md.

    Facts that shape the workflow:

    • Budget: --max-cost-usd 10 on the command line (OQ-7, approved). --no-publish and --allow-tools Write on every invocation, same as feat(evals): first three claude plugin eval cases, null-run canary, fixture_commit gate (#987 P1) #993's cases; CLAUDE_CODE_WALNUT_SPIRE=1 goes in the workflow env, never in repo settings (AC-4).
    • Flaky grader: feat(evals): first three claude plugin eval cases, null-run canary, fixture_commit gate (#987 P1) #993's QA measured the qa-gaps-marker grader on qa-trust-boundary red in 2 of 6 runs at --runs 1. The workflow must absorb that — --runs 2 per case or a --threshold below 1.0 (pick one, state why in the docs page) — or the manual dispatch will report false reds one time in five.
    • Credential: the repository currently has no secrets. Name the secret the workflow expects (the standard Claude Code headless credential variable), and make its absence fail the job loudly at the first step with a message naming the secret — never skip silently or go green without running an eval. AC-3's "one green run URL" therefore depends on the owner adding the secret; if it is absent when you open the PR, record AC-3 as PENDING with the exact gh secret set command and the gh workflow run command the owner needs, and do not fabricate a run. Everything else in AC-1/2/4/5 is verifiable without it.
    • Skip the canary in CI? No — the null-run canary is what proves the graders are not vacuous; dispatch runs it and expects it red (exit 1 is the canary's success). Model that explicitly in the workflow so a red canary does not fail the suite and a green canary does.

    Launch discipline: commit within 5 minutes and every ~10 minutes; targeted commands in the foreground only; never the full suite inside the phase. Open the PR yourself with every AC's verify output and the gate-test Mutation-verified: records; do not file any issue (I-7). The owner merges after runner verification.

  3. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (5 ACs, 3 directories)

    AC Quality Check

    All 5 AC pass the linter clean — every AC pairs a claim with a concrete grep/gh verify command, no vague/unmeasurable language.

    Scope Assessment

    Non-Goals: Present, but under a ## Scope heading rather than a literal "Non-Goals" heading — not in scope: per-PR triggers; any case; repo .claude/settings.json. The linter's exact-heading match doesn't credit it; treating it as satisfied.

    Metric Value Status
    Feature count (heuristic) 2 ⚠️
    AC items 5 ✅
    Directory spread 3 (.github/workflows, docs/reference, repo root) ⚠️

    Automated verdict: SCOPE_WARNING. Overriding to SCOPE_OK on manual review — the heuristic's "2 features" and its directory list (plugin, settings, test, docs) are clustered off keywords inside the AC's own grep verify strings (e.g. "config", "test", "validation"), not real distinct workstreams or paths. The actual surface is one cohesive CI workflow + one companion doc + one README line, pre-labeled Tier: mechanical by the graph plan. Not auto-enabling quality loop (see Recommended Workflow).


    Acceptance Criteria

    AC-1: Workflow exists, manual-dispatch only

    Verification: Manual (static grep on the committed YAML)
    Scenario: Given .github/workflows/plugin-eval.yml → When greeped → Then exactly one workflow_dispatch trigger and zero pull_request/push: triggers.

    AC-2: Budget and threshold on the command line

    Verification: Manual (static grep)
    Scenario: Given the workflow file → When greeped → Then --max-cost-usd 10 appears (OQ-7's approved number) and --threshold appears exactly once.
    Assumption: the single --threshold occurrence is the flaky-grader mitigation the runner's comment asks for — see Open Question 1.

    AC-3: Report uploaded

    Verification: Manual (workflow inspection + one live run)
    Scenario: Given a dispatch → When it completes → Then an actions/upload-artifact step publishes the eval results dir, and one green run URL is in the PR body.
    Assumption: the repo currently has no secrets (confirmed via gh secret list). This AC cannot be closed with a real green run until the owner adds the credential secret — see Open Question 3.

    AC-4: Env var not in repo settings

    Verification: Manual (static grep)
    Scenario: Given .claude/settings.json and .claude/settings.local.json → When greeped for WALNUT → Then zero matches. CLAUDE_CODE_WALNUT_SPIRE=1 lives only in the workflow's own env:.

    AC-5: Docs

    Verification: Manual (file existence + content grep)
    Scenario: Given docs/reference/plugin-eval.md → When greeped for fixture_commit/ablation/max-cost-usd → Then ≥3 hits; and README.md mentions plugin-eval ≥1 time.


    Implementation Plan

    Phase 1: Workflow (.github/workflows/plugin-eval.yml, new)

    1. on: workflow_dispatch: only (no inputs needed to satisfy scope) — satisfies AC-1.
    2. Job: runs-on: ubuntu-latest, permissions: contents: read, timeout-minutes: 45 (headroom for up to 4 cases × up to 3 runs × 600s CLI-level timeouts, independent of the $10 cost cap).
    3. Steps: checkout → actions/setup-node@v7 (node 22) → npm ci → npm install -g @anthropic-ai/claude-code (mirrors plugin-install-test.yml's existing pattern) → a fail-loud secret check (if [ -z "$ANTHROPIC_API_KEY" ]; then echo "::error::ANTHROPIC_API_KEY secret is not set — add it under Settings > Secrets and variables > Actions"; exit 1; fi, never echoing the value).
    4. Single eval invocation covering all 4 cases (qa-trust-boundary, spec-ac-parse, assess-dashboard, null-run-canary):
      CLAUDE_CODE_WALNUT_SPIRE=1 claude plugin eval . --no-publish --allow-tools Write --max-cost-usd 10 --threshold 0.9 --output-dir evals/ci-report --json evals/ci-report/results.json || true
      (the trailing || true is deliberate — the CLI's own exit code can't distinguish "canary correctly failed" from "a real case regressed," so it's not the pass/fail signal; step 5 is.)
    5. Evaluate results step, jq-driven against evals/ci-report/results.json: assert cases[] | select(.name=="null-run-canary") | .aggregates.passRate == 0 (fail loudly, "grader is vacuous," if it's 1) and assert every other case's .aggregates.passRate >= 1 (fail loudly, naming the case, if not). This step is the real job gate, not step 4's exit code — directly implements the runner's "a red canary does not fail the suite, a green canary does." cases[].aggregates.passRate is a real field, confirmed against evals/results/null-run-canary.json (real #993 output, recorded passRate: 0) — no dependency on undocumented --case glob/exclude syntax.
    6. actions/upload-artifact@v4, if: always(), path: evals/ci-report, name: plugin-eval-report — satisfies AC-3's upload requirement even when step 5 fails, for debugging.

    Phase 2: Docs (docs/reference/plugin-eval.md, new)

    1. How to dispatch (Actions tab → Run workflow), the CLAUDE_CODE_WALNUT_SPIRE + secret prerequisites, the exact gh secret set / gh workflow run commands.
    2. What the 4 cases are and why null-run-canary must stay red (grader-vacuity proof, mirrors evals/null-run-canary/prompt.md).
    3. The $10 --max-cost-usd cap (OQ-7) and the --threshold 0.9 flaky-grader rationale (state the qa-trust-boundary 2-of-6 flake this absorbs, per the runner's comment) — this is where AC-5's fixture_commit/ablation/max-cost-usd content lives.

    Phase 3: README + verification

    1. One link line into README.md pointing at the new doc (satisfies AC-5's plugin-eval mention).
    2. Run all AC-1/2/4/5 grep verifies locally against the committed YAML/docs (no live dispatch needed for these four).
    3. AC-3: if the secret isn't present when the PR opens (current state), record it PENDING in the PR body with the exact commands the owner needs — do not fabricate a run URL.

    Design Review

    1. Where does this logic belong? CI infra (.github/workflows/) and reference docs (docs/reference/) — no src/ runtime code changes; this is orthogonal to the sequant CLI itself.
    2. Simplest correct approach? One eval invocation across all 4 cases, with pass/fail decided by parsing --json output rather than trusting the suite-level exit code — avoids splitting the $10 budget across multiple invocations and avoids depending on unconfirmed --case glob-exclude syntax.
    3. What existing pattern does this follow? upstream-assessment.yml's dispatch-only + secret-gated shape, and plugin-install-test.yml's npm install -g @anthropic-ai/claude-code bootstrap.
    4. What would a senior reviewer challenge? "Why not just --threshold 0.9 and trust the exit code?" — because the canary is designed to fail; a bare threshold step is permanently red. The JSON-parsed step 5 is the direct answer, and belongs in the PR description up front.

    Feature Quality Planning

    All standard checks pass. Notable items:

    • Never echo ANTHROPIC_API_KEY's value — presence-only check.
    • --output-dir evals/ci-report stays outside evals/results/ so CI scratch output never collides with the committed fixtures __tests__/evals-fixture-commit.test.ts gates on.
    • --threshold 0.9 is a judgment call, not empirically derived — document why in the docs page; revisit after the first live dispatch.
    • No new test file — pure YAML + docs, so testgen/mutation-verification doesn't apply.

    Open Questions

    1. Is --threshold 0.9 the right value to absorb the qa-trust-boundary flake (2-of-6 at --runs 1) without masking a real regression? Recommendation: ship 0.9, state the reasoning in the docs page, and revisit after the first live dispatch's actual score. Impact if wrong: too strict → false reds; too loose → a real regression could slip through un-flagged.
    2. Does claude plugin eval read ANTHROPIC_API_KEY, or a different headless-auth variable? docs/features/github-actions-integration.md names it as Claude Code's default, but predates plugin eval. Recommendation: verify with a cheap local probe before committing to the workflow. Impact if wrong: AC-3's live run fails on auth, not budget/threshold.
    3. AC-3's live green run is blocked on the owner adding the secret (repo has zero secrets today). Recommendation: record PENDING with exact commands per the runner's instruction; not a blocker for opening the PR.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Mechanical tier, all 5 AC are deterministic grep/CLI verifies with no remaining design ambiguity after this plan's canary-inversion design; SCOPE_WARNING overridden per the Scope Assessment above. No UI, no new test surface — testgen skipped.


    Label Review

    Current: graph-2026-09
    Recommended: no change — planned will be added automatically by this comment.
    Reason: single cohesive mechanical task; no ui/bug/complex signal.
    Quality Loop: Won't auto-enable — SCOPE_WARNING overridden above (heuristic false-positive on grep-keyword clustering, not a real multi-feature spread).

  4. added
    planned
    on Sep 8, 2026
  5. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/2 met

    Gaps:

    Suggestions:

    • The secret check sits at step 5, after npm ci and a global npm install (~2–3 min of runner time). The runner asked for it "at the first step." Moving it above checkout costs nothing.
    • Scenario C (canary absent from results) fails loudly — correct direction — but the message renders as passRate is , expected 0. Worth an explicit "case not found" branch.
  6. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    Runner: one fix round before merge (PR #1017 at 5a907ca2). QA's verdict was AC_MET_BUT_NOT_A_PLUS by the literal greps, but its own findings are functional defects in the workflow, and the runner treats those as blocking. Fix all five in one exec pass, then QA once more:

    1. Pass-rate gate inverts the flake mitigation (AC-2/AC-3). The Evaluate results step fails any non-canary case with aggregates.passRate < 1, so the qa-trust-boundary grader that is red ~1 run in 5 at --runs 1 produces a false red most dispatches. Either run each case with --runs 2 and gate on passRate >= 0.5, or gate on overallScore >= 0.9 (the threshold you already pass). Pick one and make the gate and the flag agree.
    2. --threshold 0.9 is inert (AC-2). The flag only matters if the job uses the CLI's own pass/fail; with || true and a hand-rolled gate it does nothing. Either drop || true and let the CLI's exit code and threshold decide (then map the canary's expected exit 1 explicitly), or remove the flag and document the hand gate. Not both.
    3. assess-dashboard cannot pass in CI (AC-3). Its case needs the scaffold to lay down the issue fixtures (evals/assess-dashboard/ scaffold script, per feat(evals): first three claude plugin eval cases, null-run canary, fixture_commit gate (#987 P1) #993). Run the suite with the scaffold, or exclude the case explicitly with a comment saying why — never let it fail silently.
    4. A budget-aborted run reports success (AC-2). results.json carries .partial; if it is true, or if .cases | length is below the expected count (4), the job must fail with a message naming the budget.
    5. Docs (AC-5). docs/reference/plugin-eval.md must describe the gate the workflow actually implements after items 1–4.

    AC-3's green run URL stays PENDING on the owner adding ANTHROPIC_API_KEY — keep the exact gh secret set and gh workflow run commands in the PR body. Commit within 5 minutes; do not file any issue.

  7. added a commit that references this issue on Sep 8, 2026
  8. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

  9. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    Runner verification — node 13 (PR #1017, QA verdict AC_MET_BUT_NOT_A_PLUS, iteration 2 at 4f09aba3)

    Verify commands from issues/13-987C-eval-ci.md, run verbatim in the worktree at 4f09aba3 (= PR head = origin; CI green, mergeable):

    AC Command Result
    AC-1 grep -c 'workflow_dispatch' / grep -c 'pull_request|push:' on plugin-eval.yml 1 / 0 — manual dispatch only
    AC-2 grep -E 'max-cost-usd [0-9]+'; grep -c -- '--threshold' max-cost-usd 10 (OQ-7); 1 (--threshold 0.8, now load-bearing: no || true, the CLI's exit code decides; --runs 2 absorbs the measured 1-in-5 grader flake)
    AC-3 actions/upload-artifact step; green run URL upload step present (evals/ci-report, if: always()). Green run PENDING on owner action: the repository has no secrets; the job fails loudly at step 1 without ANTHROPIC_API_KEY. PR body carries the exact gh secret set ANTHROPIC_API_KEY and gh workflow run plugin-eval.yml commands.
    AC-4 grep -rn 'WALNUT' .claude/settings*.json | wc -l 0 — the env var lives only in the workflow env
    AC-5 test -f docs/reference/plugin-eval.md; term grep ≥ 3; README link ≥ 1 file present; 5; 1

    Fix round (runner-requested, one pass): all five functional defects QA found on 5a907ca2 are closed at 4f09aba3 — pass-rate gate no longer demands a perfect score (--runs 2 + --threshold 0.8), || true removed so the threshold is real, --scaffold passed so assess-dashboard gets its fixtures, .partial and the case count are asserted so a budget-aborted run fails, and the docs page describes the gate that exists.

    Stop-at-PR: not merged — AC-3's green run needs the secret (same decision as OQ-26 for #996: one ANTHROPIC_API_KEY secret serves both workflows; #996's job reads it as OPENCODE_SMOKE_API_KEY, so set both names to the same key or align the names before dispatch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    graph-2026-09planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions