Skip to content

feat(runner): add forge:runner-check adoption-readiness preflight (#245) - #250

Merged
dngioidev merged 1 commit into
mainfrom
feat/245-runner-check
Jul 23, 2026
Merged

feat(runner): add forge:runner-check adoption-readiness preflight (#245)#250
dngioidev merged 1 commit into
mainfrom
feat/245-runner-check

Conversation

@dngioidev

Copy link
Copy Markdown
Owner

What & why

Adds /forge:runner-check — a single go/no-go adoption-readiness preflight for the local self-hosted runner (ADR-0005). It resolves the runner block in forge.json (defaults applied) and checks the whole setup end-to-end, so someone adopting the runner on another project can confirm their setup in one shot — broader than the single runner-health line forge:doctor prints.

Closes #245. Refs #180.

The command

plugin/commands/runner-check.mdplugin/scripts/runner/check.mjs. Each check prints ok/warn/fail + a fix hint, ending in a single READY / NOT READY verdict (nonzero exit when NOT READY):

  1. private-repo guard — FAIL on a public repo (fork-PR RCE).
  2. runner block present + enabled; effective labels/sharing/windows echoed.
  3. host prerequisitesgit, gh, node (>=22.13) on PATH; docker reachable (docker info) for the Linux leg; native-runner note for windows:native.
  4. PAT-store safety~/.forge/runner.env gitignored + untracked, no committed PAT (never prints the token).
  5. runner registered + online for the configured labels (+ the windows label set when windows:native).
  6. scaffold presentrunner/ assets + a verify workflow targeting the label.
  7. version staleness — warn when the pinned actions-runner is behind latest.

Reuse, not copy-paste

Shared logic is extracted into plugin/scripts/lib/runner-checks.mjs, now imported by both doctor.mjs and check.mjs: the private-repo guard, the registration/online probe, the secret-store assertion, and the #233 version check. The probe gained an offlineLevel option so an offline/unregistered runner is a doctor warn but an adoption-gate fail, while a gh-api failure always degrades to a warn (graceful degradation, never a crash).

Verification

  • pnpm verify451/451 green (16 new in tests/runner-check.test.mjs; all existing doctor tests still pass against the refactor).
  • claude plugin validate ./plugin --strict — passed.
  • Real end-to-end smoke run against this repo → READY, exit 0.

Docs

Adoption guide step 5 + reference/runbook rows; runner/README.md + template README get a "Confirm readiness" section.

🤖 Generated with Claude Code

Add a single go/no-go command that resolves the runner config (defaults
applied) and reports an end-to-end READY / NOT READY verdict, so someone
adopting the local self-hosted runner on another project can confirm their
whole setup in one shot — broader than doctor's single runner-health line.

New command /forge:runner-check (plugin/commands/runner-check.md →
plugin/scripts/runner/check.mjs) checks, each ok/warn/fail + fix hint:
private-repo guard (FAIL on public — fork-PR RCE), runner block present +
enabled, host prerequisites (git/gh/node>=22.13 + docker reachable, native
note for windows:native), PAT-store safety, runner registered + online for
the configured labels (+ the windows label set when windows:native),
scaffold present + verify workflow targets the label, and version staleness.

Shared logic is extracted into plugin/scripts/lib/runner-checks.mjs and now
reused by BOTH doctor.mjs and check.mjs (private-repo guard, registration
probe, secret-store assertion, #233 version check) rather than copy-pasted.
The probe gains an offlineLevel option so an offline/unregistered runner is
a doctor warn but an adoption-gate FAIL, while a gh-api failure always
degrades to a warn. The PAT value is never read or printed.

Tests: tests/runner-check.test.mjs (16) — READY when green; NOT READY on
public repo / missing block / absent prereq / unsafe store / no online
runner; graceful-degrade when gh fails; windows:native two-leg probe. Docs:
adoption guide step 5 + reference, runner/README + template.

Closes #245
Refs #180

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SATRHKa6mDHDuirhP6QuwL
@dngioidev
dngioidev merged commit 0bd440e into main Jul 23, 2026
3 of 5 checks passed
@dngioidev
dngioidev deleted the feat/245-runner-check branch July 23, 2026 19:16
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.

Runner: add a runner check preflight command that resolves + validates the full config (adoption readiness)

1 participant