Skip to content

Part H — CI action: run the corpus against one backend without cloning - #10

Merged
DeviousCardi merged 3 commits into
mainfrom
ci-action
Sep 9, 2026
Merged

DeviousCardi merged 3 commits into
mainfrom
ci-action

Conversation

@DeviousCardi

Copy link
Copy Markdown
Owner

Summary

Part H of PLAN-1.0.md: a composite GitHub Action a backend maintainer can add
to their own CI, plus the release and dogfood workflows around it.

  • action.yml — takes backend (a name from this repository's own
    backends/, or path/to/adapter.yaml for one not carried here), suite,
    url, and version (release tag, default latest). Fetches the corpus at
    that tag, downloads the matching binary, runs the suite, writes a job
    summary. Fails the job only on a harness error — a verdict never does.
  • .github/workflows/release.yml — on a v* tag, builds and attaches
    specmatrix for x86_64-unknown-linux-gnu and aarch64-unknown-linux-gnu.
  • allow: on an adapter (src/backend.rs) — case ids a maintainer has
    read and accepted, each with a reason. Never changes a verdict (the runner
    decides that from the wire, unchanged); CheckResult now carries the
    reason alongside it, and tools/summarize.py's job summary moves those
    rows to their own section instead of reading as unreviewed failures.
  • .github/workflows/dogfood.yml — runs the action against every
    (backend, suite) pair this repository declares, on a pull request touching
    cases/ or backends/, using that pull request's own binary and corpus
    (ref/binary-path, two inputs that exist only for this workflow) rather
    than the last published release — so a wrong case goes red before it ships.
    Scoped to same-repository pull requests, since the corpus-fetch step needs
    the PR's SHA to already exist in this repository.

Verified by hand against a real Loki container: both backend input forms
(bare name and path), the binary-path override, and the summary script's
output — matched byte for byte against a real specmatrix run --json.

168 tests, 0 clippy warnings, corpus gate passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_018k65nFSzuwsHwYnpSHNaeK

DeviousCardi and others added 3 commits September 9, 2026 14:07
`action.yml` — a composite GitHub Action a backend maintainer adds to their
own CI, taking `backend` (a name from this repository's own `backends/`, or
a path to an adapter already checked out in the caller's repository),
`suite`, `url` of the already-running backend, and `version` (a release tag,
default `latest`). It fetches the corpus (cases/, built-in backends/) at that
same tag, downloads the matching runner binary, runs the suite, and writes a
job summary — never failing the job on a verdict, only on a harness error.

`.github/workflows/release.yml`: on a `v*` tag, builds and attaches
`specmatrix` for `x86_64-unknown-linux-gnu` and `aarch64-unknown-linux-gnu`
via `taiki-e/upload-rust-binary-action`, matching this repository's existing
convention of pinning every action to a commit, not a tag.

`allow:` on `Backend` (`src/backend.rs`): case ids a maintainer has read and
accepted, each with a one-line reason. It never changes a verdict —
`CheckResult` now carries an `allowed_reason` alongside the verdict the
runner already decided from the wire, so a badly behaved backend cannot turn
its own `ALTER` into a `PASS` by adding an entry. What it changes is only
`tools/summarize.py`'s job-summary output: allowed rows move to their own
section instead of reading as unreviewed failures.

`.github/workflows/dogfood.yml`: runs the action against every (backend,
suite) pair this repository declares (`tools/list_backend_protocols.py`
reads them from the adapters themselves, so a new one is picked up without
editing a workflow), on a pull request touching `cases/` or `backends/` —
using two inputs that exist only for this workflow, `ref` and `binary-path`,
to run the pull request's own corpus and binary rather than the last
published release, so a wrong case goes red before it ships. Scoped to
same-repository pull requests: the corpus-fetch step asks this repository for
the pull request's SHA, which a fork's commits do not exist here until pushed
to it.

Verified: the action's core logic (bare-name and path-form `backend` inputs,
binary-path override, summary generation) run by hand against a real Loki
container, matching a `specmatrix run --json` output byte for byte with what
`tools/summarize.py` expects. 168 tests, 0 clippy warnings, corpus gate
passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018k65nFSzuwsHwYnpSHNaeK
Two bugs, both only visible once the dogfood workflow actually ran:

- "resolve version" always called the GitHub releases API, even when
  `ref`/`binary-path` (the two inputs that exist only for the dogfood
  workflow) make that lookup unneeded. This repository has never pushed a
  release tag yet, so `releases/latest` 404'd and every dogfood job failed
  before it reached the suite. Guarded the step to skip entirely when both
  overrides are given.
- The "run the suite" step referenced
  `.specmatrix-corpus-${{ github.action_ref || 'action' }}`, left over from
  an earlier revision; the checkout step writes to the plain
  `.specmatrix-corpus` an earlier edit renamed it to, but a replace_all at
  the time matched only the checkout step's own `path:` line, not this
  second occurrence — so the two never agreed and `--cases` would have
  pointed at a directory that does not exist. Never caught because the CLI
  logic was dry-run by hand against a hardcoded path rather than through the
  action script itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018k65nFSzuwsHwYnpSHNaeK
…el legs

One leg hit the 20-minute limit purely from queueing behind the same shared
Rust build cache as the other 19; nothing was actually hung. Measured: the
slowest legitimate leg took 17m3s in the same run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018k65nFSzuwsHwYnpSHNaeK
@DeviousCardi
DeviousCardi merged commit 0a5b683 into main Sep 9, 2026
28 checks passed
@DeviousCardi
DeviousCardi deleted the ci-action branch September 9, 2026 15:22
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.

1 participant