← Back to Pull requests

feat(ci): run Rust jobs on an idle trusted self-hosted runner when configured #972

Closed
unknown closed this pull request without merging on Nov 12, 2026 05:14 UTC
View on GitHub
unknown unknown commented on Nov 12, 2026 03:36 UTC
Author

  • The org's 20 concurrent hosted jobs keep saturating, and runs-on cannot express "either runner", so the selection job now picks per job between an idle self-hosted runner and ubuntu-latest.

  • Fork pull requests and unknown events never reach the self-hosted runner, since it keeps state between jobs and sits on a private network.

  • Any token or API problem falls back to hosted runners, so CI never fails because the self-hosted runner is missing or busy.

  • Nothing changes until SELF_HOSTED_RUNNER_LABELS and RUNNER_STATUS_TOKEN are configured.

  • Built locally first so it can move to TrogonStack/github-actions once proven.
  • <!-- CURSOR_SUMMARY -->
    ---

    [!NOTE]

    Medium Risk

    Changes CI job routing and introduces trust rules plus org runner-group API calls; misconfiguration or trust bugs could queue jobs incorrectly, though API and untrusted-event paths default to hosted runners.

    > Overview

    Adds a new local GitHub Action runs-on-fallback that picks per-job runs-on labels at runtime: idle self-hosted runners (when configured and trusted) vs ubuntu-latest, emitting a JSON runners map for downstream jobs.

    > The reusable ci-selection workflow now runs this action immediately after checkout, taking optional runner-jobs and runner-status-token, and exposes runners as an output. ci-rust passes prioritized job names (test build wasm-decider lint) and switches its heavy jobs from fixed hosted runners to fromJSON(needs.changes.outputs.runners).<job>.

    > Selection fails closed for fork PRs and other untrusted events (no self-hosted API calls), and fails open to hosted runners on missing config, token, timeouts, or GitHub API errors. Organization scope only counts runners in groups visible to the repo and skips workflow-restricted groups.

    > Coverage includes a large test_runs_on_fallback.mjs suite, workflow contract tests in test_ci_selection.mjs, and CI verify wiring for the new test file.

    > <sup>Reviewed by Cursor Bugbot for commit ed30f811557ee3ea70767135de08f03b46c0e002. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

    <!-- /CURSOR_SUMMARY -->

    Diff: 286 lines (+214 / -72) across 3 files Reviewer: yordis Review duration: 97m
    All Vouch review confidence checks passed
    Residual risk 0.29 = Change Risk (0.68) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.68 · 286 lines diff across 3 files
    0.68
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.339
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.068
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #972"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 68.0% (HIGH) · Higher = larger blast radius
    68.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.4% · Safe to merge
    29.4%