rig/docs/templates
cluade-reviewer-andresmgsl cf5858bb60 fix: one checksum policy, labeler coverage, orphaned-unit removal
Net-new review findings from grok and kimi on !110. Their items 1-3 were
codex's, already fixed in 1933b07; these are the ones only they raised.

grok #4 — the two downloaders would drift. docs/templates/ci-box/install.sh
and the download block in forgejo-runner-install.sh were near-copies, and grok
named the exact consequence with the exact evidence: fail-open survived in BOTH
while a grep for "checksum mismatch" passed against both, because the string it
looked for sat right beside the branch it could not see. The whole policy —
fetch, unreadable, mismatch — is now fetch_and_verify_sha256, byte-identical in
both files and diffed by test/cli.sh. They cannot share a lib: the command
sources commands/lib/, and the template is a registry definition that runs
standalone inside a mint with rig's tree nowhere in reach, which is the same
situation valid_version faces between bin/rig and install.sh. Mutation-checked
by drifting one copy's message and confirming the diff goes red.

kimi #2 — the labeler could not see this family. scope:runner matched
commands/runner-*.sh only, so forgejo-runner-*.sh and the staged ci-box
definition scored no scope at all. Globs extended and the label's description
now says either forge rather than GitHub.

kimi #4 — remove stranded a unit whose user was gone. The missing-user check
exited 0 before the unit was ever looked at, so a deleted account with a
leftover forgejo-runner.service reported "nothing to remove" while the
absence-assert that never ran implied the opposite. The unit is now checked
independently. Auditing that fix surfaced a hazard kimi did not mention: with
the user gone RUNNER_DIR is "", and the later unguarded "$RUNNER_DIR/.rig-labels"
would have expanded to "/.rig-labels" — an rm at the filesystem root, as root.
Every RUNNER_DIR path is now gated, and a test pins that none is unguarded.

kimi #1 — the README handed out a config that breaks rig's own gates.
DEFAULT_ACTIONS_URL is a single fallback and rig's workflows need two origins;
measured: code.forgejo.org serves actions/checkout (200) but not
heavy-duty/ceremony (404), which lives on the Forgejo instance. With the value
the README recommended, all eight ceremony references fail to resolve. The
section now states the conflict with the counts, says which references would
break, and explicitly does NOT pick a side — that is an infra decision, and
rig's CI running on Forgejo is not something rig forgejo-runner depends on.
Asked the maintainer for direction.

746/31/43 pass, shellcheck clean, labeler.yml parses.

forgejo#109

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 21:19:33 +00:00
..
ci-box fix: one checksum policy, labeler coverage, orphaned-unit removal 2026-07-27 21:19:33 +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.