repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

Give the merge gate something that compiles the code (#134)

56064c8b2bf501880e290d1edb4a20802d608aab

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

## What forced this

`merge-gate` reads labels and nothing else, and the ruleset requires
only `merge-gate`. A PR carrying `reviewed` + `security-cleared` merges
whether or not the workspace builds — both labels are LLM judgements on
a diff. #17 calls this critical and has been unfixable since it was
filed, because there was no CI check to require. #131 landing real
product code makes it live rather than theoretical.

## The call

Publish the stable check-run context #17 needs. The job holds no build
logic: PROJECT-INVARIANTS §1 makes cargo the sole build system and xtask
its only extension point, so CI installs toolchains and calls `cargo run
-p xtask -- check` — the same command a developer runs. Whatever that
command gates, CI gates, and the two cannot drift because there is one
definition.

## What we deliberately didn't do

Did not touch `.github/rulesets/main.json`. Requiring the new context is
#17's step and the ruleset is applied from repository settings, so a
file edit here would look like the fix without being it.

Did not skip `pup` to save the pinned-nightly install. A job that
quietly dropped it would report the §2.2 architecture rules as enforced
while they were not — the same class of failure as the label-only gate
this PR exists to close, one level up. Did not add a `cargo deny` gate
either: §2.3 names it, but there is no `deny.toml`, and writing one
means deciding acceptable licences and advisories, which is a policy
call rather than CI wiring. Its absence is recorded in the workflow
header rather than left silent.

## Evidence

`cargo run -p xtask -- check` is six gates — fmt, clippy, arch, pup,
test, doc (`xtask/src/main.rs`, `CHECK_GATES`). Five pass locally on the
current tree; `pup` fails here only because `cargo-pup` is not installed
in this container, which is exactly what the workflow's pinned-nightly
step provides. The cargo-pup recipe — `nightly-2026-01-22` with
`rust-src`, `rustc-dev`, `llvm-tools-preview` — is the combination p34
established in `.github/workflows/ci-prototype.yml`, not a guess. YAML
parses; the workflow itself is unexercised until this merges, since a
workflow only runs from the default branch.

## Surface touched

`.github/workflows/ci.yml`, new — one job, six steps. Nothing else.

## If this ages badly

Delete the file; nothing references it and the gate returns to
labels-only. If the cold-run cost proves too high, the tool cache is
keyed on the lockfile and the pinned-nightly date, so loosening that key
is the first lever — dropping a gate is not.

Closes #91

Changed files (1)

+92 / −0 text lines

Diff layout

.github/workflows/ci.yml

Added
new file mode 100644

+92 / −0 text lines

1# Workspace CI — the one gate that compiles and tests the product. `merge-gate`
2# reads labels only (#17), so until this check is in the ruleset's required set
3# a PR can carry two LLM verdicts and still not build. This workflow publishes
4# the stable context that closes that hole; adding it to
5# `.github/rulesets/main.json` is the owner's step, not this file's.
6#
7# It holds no build logic. PROJECT-INVARIANTS §1 makes cargo the sole build
8# system and xtask its only extension point, so CI installs toolchains and calls
9# `cargo run -p xtask -- check` — the same command a developer runs. Whatever
10# that command gates, CI gates; the two cannot drift because there is only one
11# definition (xtask/src/main.rs, CHECK_GATES).
12#
13# The pinned nightly and cargo-pup exist for one of those six gates. §2.2's
14# source-level architecture rules run under cargo-pup, which needs rustc-dev
15# components that only a pinned nightly carries. Installing them is the cost of
16# not dropping a gate: a check job that silently skipped `pup` would report the
17# architecture as enforced while it was not.
18#
19# One named gate is absent and is recorded here rather than quietly omitted.
20# SPEC §2.3 lists `cargo deny` among the gates a dependency change rides, but
21# the repository has no `deny.toml` and `xtask check` has no `deny` gate, so
22# there is no policy for this workflow to run. Adding one means deciding which
23# licences and advisories are acceptable — a policy call, not a CI wiring
24# detail. Until that exists, dependency review here is what the reviewers do by
25# reading the §2.3 registry, and this comment is the marker that a specified
26# gate is not yet enforced.
27name: ci
29on:
30 pull_request:
31 push:
32 branches: [main]
34permissions:
35 contents: read
37concurrency:
38 group: ci-${{ github.event.pull_request.number || github.ref }}
39 cancel-in-progress: true
41env:
42 CARGO_TERM_COLOR: always
43 # A failed gate should report the failure, not a backtrace-less panic.
44 RUST_BACKTRACE: 1
46jobs:
47 # The job name is the check-run context #17 adds to the ruleset. Renaming it
48 # silently un-requires the check, so it is deliberately plain and stable.
49 check:
50 name: check
51 runs-on: ubuntu-latest
52 steps:
53 - uses: actions/checkout@v7
55 - name: stable toolchain
56 run: |
57 rustup default stable
58 rustup component add rustfmt clippy
59 rustc -V && cargo -V
61 - name: pinned nightly for the cargo-pup gate
62 run: |
63 rustup toolchain install nightly-2026-01-22 --profile minimal
64 rustup component add --toolchain nightly-2026-01-22 \
65 rust-src rustc-dev llvm-tools-preview
67 # cargo-pup and nextest are built from source, which dominates a cold run.
68 # Keyed on the lockfile and the pinned nightly date so a toolchain bump
69 # rebuilds them rather than restoring binaries built against the old
70 # rustc-dev — a stale cargo-pup fails in ways that read as a code fault.
71 - name: cache gate tools
72 uses: actions/cache@v4
73 with:
74 path: |
75 ~/.cargo/bin
76 ~/.cargo/registry/index
77 ~/.cargo/registry/cache
78 ~/.cargo/git/db
79 key: gate-tools-${{ runner.os }}-nightly-2026-01-22-${{ hashFiles('**/Cargo.lock') }}
80 restore-keys: |
81 gate-tools-${{ runner.os }}-nightly-2026-01-22-
83 - name: install gate tools
84 run: |
85 # `cargo install` re-installs unconditionally; --locked keeps the
86 # tools' own dependency trees pinned, and the guards keep a warm cache
87 # from paying the build cost again on every run.
88 command -v cargo-nextest >/dev/null || cargo install cargo-nextest --locked
89 command -v cargo-pup >/dev/null || cargo +nightly-2026-01-22 install cargo_pup --locked
91 - name: cargo run -p xtask -- check
92 run: cargo run -p xtask -- check