Repository navigation
Run add-auth evals on stable Clerk CLI release dispatches - #78
SarahSoutoul wants to merge 3 commits into
Conversation
| if [[ -z "$CLI_INPUT" || "$CLI_INPUT" == "$cli" || "$CLI_RELEASE" != 'true' ]]; then break; fi | ||
| remaining=$((deadline - SECONDS)) | ||
| if (( remaining <= 0 )); then break; fi | ||
| echo "Waiting for released Clerk CLI $CLI_INPUT to become npm latest (currently $cli)" | ||
| sleep "$((remaining < 15 ? remaining : 15))" | ||
| done | ||
| if [[ -n "$CLI_INPUT" && "$CLI_INPUT" != "$cli" ]]; then | ||
| echo "Requested Clerk CLI $CLI_INPUT is not npm latest ($cli); the canonical prompt uses clerk@latest" >&2 | ||
| exit 1 |
There was a problem hiding this comment.
If a newer release lands before this run leaves the queue, this fails prepare and alerts #team-docs. Say 1.1.0 and 1.1.1 ship close together, and 1.1.0's run waits behind a 90-minute eval. When it starts, clerk@latest is 1.1.1, so the loop waits the full 10 minutes for a version that won't come back, then exits 1. The pre/post npm view clerk version checks in evaluate hit the same thing if a release lands mid-eval.
The 1.1.1 run covers it, so the alert is noise, not a real automation failure.
Could this skip cleanly when latest is already ahead of CLI_INPUT (sort -V would do it)? At minimum, breaking out of the wait loop early saves the 10 minutes.
| return { skip: true, reason: `${sha} / ${cli} is already evaluated; use manual force to rerun` } | ||
| } | ||
|
|
||
| if (input.cliRelease) return both(`Stable Clerk CLI ${cli} was released`) |
There was a problem hiding this comment.
This flag only changes the outcome when this CLI version was already evaluated at another Skills SHA. For a version that hasn't run yet, the lastCli !== cli check below already runs both columns.
When it has run (say a queued skills run picked up the new latest first), this forces a second baseline and Skills pass that the existing logic would skip or cover with a reused baseline. The new test shows it: evaluated(old) uses the same 1.0.0, so it tests an already-evaluated CLI, not a new one.
I know #73's comment planned for CLI releases to always run both. Is that still the intent, or could the planner drop cliRelease and let the CLI-change check handle it?
| `src/index.ts` wires providers, runners, reporters, and every folder under `src/evals`. Keep each evaluation in its own directory with `PROMPT.md`, `graders.ts`, and any fixtures it needs. Use descriptive, numeric-free slugs like `src/evals/new-eval`. Runner logic lives in `src/runners`, shared provider clients in `src/providers`, scoring helpers in `src/scorers`, and reusable utilities in `src/utils`. Diagrams intended for contributor onboarding belong in `docs/`, while transient artifacts like `scores.json` stay gitignored at the root. | ||
|
|
||
| `src/evals/add-auth` is an intentional exception: its prompt comes from the immutable `clerk/skills` commit set by `CLERK_SKILLS_SHA` (or `clerk/skills` `main`, resolved once per run when it's unset), not a local `PROMPT.md`. `.github/workflows/add-auth-automation.yml` compares agent baseline and exact-SHA Skills runs; do not treat a lower completed score as a workflow failure. | ||
| `src/evals/add-auth` is an intentional exception: its prompt comes from the immutable `clerk/skills` commit set by `CLERK_SKILLS_SHA` (or `clerk/skills` `main`, resolved once per run when it's unset), not a local `PROMPT.md`. `.github/workflows/add-auth-automation.yml` compares agent baseline and exact-SHA Skills runs on skills dispatch, stable CLI release dispatch, or a manual run. CLI release events must match the npm `clerk@latest` version; repeated source versions skip unless a manual run is forced. Do not treat a lower completed score as a workflow failure. |
There was a problem hiding this comment.
The README still says CLI releases don't trigger the workflow (README.md lines 197–202), which stops being true once this merges. Maybe update that paragraph alongside this one? Something like:
`.github/workflows/add-auth-automation.yml` accepts `clerk_skills_updated` dispatches with
`client_payload.sha`, `clerk_cli_released` dispatches with `client_payload.version`, and manual
runs. Manual runs can select a full Skills SHA and the current latest CLI version. The canonical
prompt runs `npx -y clerk@latest init`, so a requested CLI version that isn't `clerk@latest` fails
instead of mislabeling the result. A CLI release waits up to 10 minutes for its version to become
`clerk@latest` first.| if [[ "$CLI_RELEASE" == 'true' && -z "$CLI_INPUT" ]]; then | ||
| echo 'CLI release dispatch must include a version' >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
The Skills SHA gets a format check above, but CLI_INPUT goes straight into echo and the comparisons. The sender in clerk/cli#539 already enforces X.Y.Z, so this mostly catches bad manual input early. Worth mirroring here?
| if [[ "$CLI_RELEASE" == 'true' && -z "$CLI_INPUT" ]]; then | |
| echo 'CLI release dispatch must include a version' >&2 | |
| exit 1 | |
| fi | |
| if [[ "$CLI_RELEASE" == 'true' && -z "$CLI_INPUT" ]]; then | |
| echo 'CLI release dispatch must include a version' >&2 | |
| exit 1 | |
| fi | |
| if [[ -n "$CLI_INPUT" && ! "$CLI_INPUT" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo 'Expected a stable Clerk CLI version like 1.2.3' >&2 | |
| exit 1 | |
| fi |
What does this solve? What changed?
DOCS-12297 adds the receiver half of stable CLI release evaluation. This is paired with the CLI sender PR, which dispatches after successful stable npm publish without waiting for npm's
latesttag.This is the CLI-release follow-up to DOCS-12112 and clerk-evals#73, which added evals for
clerk/skillsupdates but did not add the stable CLI-release trigger.clerk_cli_releasedalongside skills dispatches and manual runs.clerk@latest, retrying npm lookup failures as well as an olderlatestresult. Other events fail immediately on an npm lookup failure. Never evaluate against a different version.Deadline
No fixed deadline. Merge this receiver before clerk/cli#539. It can safely wait for release messages; a dispatch sent before the receiver is live would not be replayed.
Other resources
Pre-merge checklist
clerk@latestbefore evaluating.clerk/clihas the dedicatedCLERK_EVALS_DISPATCH_TOKENActions secret, scoped to send repository dispatches to onlyclerk/clerk-evals. This receiver does not need that secret.Post-merge checklist