rig/docs/templates
cluade-reviewer-andresmgsl 1933b07fd4 fix: honour --version, scope .rig-labels, close the checksum gate
Three defects from review !110, all the same family — a stated contract the
code did not keep.

--version was swallowed on the path this command exists for. The download
block skipped on mere presence, copying runner-install.sh's shape without its
justification: actions/runner SELF-UPDATES, so freezing it would only make
GitHub refuse its jobs. forgejo-runner does not self-update, so nothing else
ever moves the version — and a ci-box's template preinstalls the binary at
mint, which meant the documented deterministic-pin lever could never fire on a
ci-box. It now converges toward the pin, downward included, because a pin is
an instruction and not a floor; absent a pin an existing binary is left alone,
since chasing latest would make a re-run an unrequested upgrade. The decision
moved to runner_download_decision in the lib as a pure function: the first
attempt at a test here grepped for a log string and survived the logic being
disabled, which is exactly the weak test the review warned about. The binary
is now renamed into place rather than written over — the converge path runs
while the daemon is live, and in-place is ETXTBSY.

.rig-labels outlived the registration it described. The write had escaped the
registration branch, where runner-install.sh correctly keeps its copy, so a
plain re-run stamped this invocation's labels over a registration made with
different ones and status then reported confidently wrong labels while Forgejo
still held the originals. Scoped again, and an EXPLICIT --labels on a re-run
now warns that Forgejo owns labels from registration time rather than letting
the request evaporate silently.

The checksum gate failed open. A missing .sha256 warned and installed anyway,
contradicting both the README and the template's own comment about unverified
root downloads. The original reasoning — do not let an upstream layout change
break installs — reasons about the wrong failure: a layout change breaks the
BINARY url too, so "binary yes, checksum no" is the shape of an interfered
fetch, which is precisely what the checksum exists to catch. Both paths refuse
now, with no bypass flag; if upstream really moves its assets that is a rig PR
editing the URL, not an operator improvising past a security gate.

Tests: the checksum paths are now DRIVEN against a stub curl through the real
template install.sh — matching, missing, mismatched and empty — instead of
grepped, and all three fixes were mutation-checked by reverting each and
confirming the suite goes red.

739/31/43 pass, shellcheck clean.

forgejo#109

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 21:08:15 +00:00
..
ci-box fix: honour --version, scope .rig-labels, close the checksum gate 2026-07-27 21:08:15 +00:00
README.md feat: Forgejo-native CI — a ci-box tenant and a forgejo-runner family 2026-07-27 20:40:54 +00:00

Staged template definitions

Definitions here are not the registry. They are role definitions destined for heavy-duty/rig-templates, staged in rig's tree only while the registry repo does not yet exist on the forge that will serve them (#109).

This is deliberately a waiting room, not a second registry:

  • bootstrap-tenant.sh does not look here. Nothing in this directory is reachable by a mint, and adding a lookup would recreate exactly the coupling the registry split was written to remove — where adding a tenant meant editing rig.
  • test/cli.sh lints each one with rig template-lint, the same parser a mint runs. A definition that cannot pass the schema never reaches the registry.
  • When the registry repo exists, a definition moves there verbatim and is deleted from here in the same PR.

To try one before it is anywhere, point a mint at it directly:

RIG_TEMPLATES_DIR=docs/templates rig bootstrap ci-box

That is RIG_TEMPLATES_DIR's stated purpose — "try a template before it exists anywhere" — and it is the supported path, not a workaround.