Skip to content

ci(competition): register the engine gate on the default branch - #568

Merged
plind-junior merged 4 commits into
mainfrom
ci/register-engine-gate
Jul 28, 2026
Merged

ci(competition): register the engine gate on the default branch#568
plind-junior merged 4 commits into
mainfrom
ci/register-engine-gate

Conversation

@plind-junior

@plind-junior plind-junior commented Jul 28, 2026

Copy link
Copy Markdown
Member

pull_request_target workflows only trigger when the file exists on the default branch — engine-lane pr #567 got no scoring run while the kit gate (registered from main) ran fine. byte-identical to the ladder copy; runs still execute base-branch code per the gate's security model.

Summary by CodeRabbit

  • New Features

    • Added an automated evaluation gate for qualifying pull requests containing the expected single strategy submission.
    • Runs a side-by-side comparison against the current benchmark and posts a scorecard on the pull request.
    • Clearly reports whether the submission dethrones or holds the current benchmark.
    • Skips evaluation for pull requests that don’t match the required strategy format.
  • CI/Quality

    • Improved robustness of the gate result handling and added a security clarification to reduce ambiguity about what is executed.

pull_request_target workflows only trigger when the workflow file exists
on the default branch. the engine gate lived only on the ladder and
feature branches, so engine-lane pr #567 got no scoring run at all while
the kit gate (registered from main) ran fine. the file is byte-identical
to the ladder copy; the run itself still checks out and executes
base-branch code per its security model.
@plind-junior
plind-junior enabled auto-merge (squash) July 28, 2026 03:50
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@plind-junior, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 228d95a2-3e1d-4dda-b609-b8c2d8a42494

📥 Commits

Reviewing files that changed from the base of the PR and between 7bf513c and d1f73ae.

📒 Files selected for processing (2)
  • .github/workflows/koth-engine-gate.yml
  • .github/workflows/koth-gate.yml

Walkthrough

Changes

Strategy engine gate

Layer / File(s) Summary
Workflow entry and PR classification
.github/workflows/koth-engine-gate.yml, .github/workflows/koth-gate.yml
Adds pull request triggers, read-only security documentation, restricted permissions, concurrency, and classification for PRs containing exactly one strategy file, with pass-through handling for other PRs.
Challenger retrieval and scoring
.github/workflows/koth-engine-gate.yml
Fetches and validates the challenger source, installs the base project, and maps scorer exit codes to held or dethroned verdicts.
Verdict reporting and check completion
.github/workflows/koth-engine-gate.yml, .github/workflows/koth-gate.yml
Posts the JSON scorecard, documents shellcheck handling for literal backticks, and completes successfully for held or dethroned scoring results.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant GitHubActions
  participant GitHubAPI
  participant score_strategy.py
  participant Maintainer
  PullRequest->>GitHubActions: trigger qualifying pull request workflow
  GitHubActions->>GitHubAPI: list changed files and fetch challenger source
  GitHubAPI-->>GitHubActions: strategy file content
  GitHubActions->>score_strategy.py: score baseline against challenger
  score_strategy.py-->>GitHubActions: verdict and JSON scorecard
  GitHubActions->>PullRequest: post scorecard comment and check result
  Maintainer->>PullRequest: review and merge strategy manually
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: registering the engine gate workflow on the default branch.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/register-engine-gate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added ci github actions and automation size: S 50-199 changed non-doc lines labels Jul 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/koth-engine-gate.yml:
- Around line 49-57: Update the changed-file retrieval and engine eligibility
logic in the workflow so it preserves each file’s GitHub status, not just its
filename. Require the single strategy file’s status to be non-removed before
assigning engine mode, while preserving the existing filename and count checks.
- Line 41: The workflow uses mutable action tags in a privileged
pull_request_target job. In .github/workflows/koth-engine-gate.yml lines 41 and
91, update actions/checkout and actions/setup-python references to trusted full
40-character commit SHAs, respectively, while preserving their existing action
versions and configuration.
- Around line 21-23: Add a narrowly scoped zizmor suppression for the
dangerous-triggers finding on the koth-engine-gate pull_request_target workflow,
using the existing rationale that it checks out only the base and sandbox PR
strategy as data. Place the suppression in .github/zizmor.yml or inline in the
workflow, and apply it only to this engine gate trigger after action pins are
fixed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9869f827-e3a2-48b3-a37f-29140e92bcdc

📥 Commits

Reviewing files that changed from the base of the PR and between 683e0a3 and 888e334.

📒 Files selected for processing (1)
  • .github/workflows/koth-engine-gate.yml

Comment on lines +21 to +23
on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow file =="
cat -n .github/workflows/koth-engine-gate.yml | sed -n '1,120p'

echo
echo "== workflow lint config / references =="
for f in .github/worklint .github/gitleaks-ignore .zizmor.yml zizmor.toml zizmor.yaml .github/actions.yml .github/actionlint.yaml actionlint.yaml; do
  [ -f "$f" ] && { echo "--- $f"; cat -n "$f"; }
done

echo
echo "== zizmor references =="
rg -n "zizmor|dangerous-triggers|pull_request_target|workflow-lint|actionlint" .github . 2>/dev/null | sed -n '1,200p'

echo
echo "== files maybe relevant =="
git ls-files '.github/workflows/*' '.github/**/*.yml' '.github/**/*.yaml' | sed -n '1,120p'

Repository: vouchdev/vouch

Length of output: 9624


🌐 Web query:

zizmor 1.27.0 dangerous-triggers pull_request_target workflow run zizmor inline ignore

💡 Result:

In zizmor v1.27.0, the dangerous-triggers audit flags workflows using pull_request_target or workflow_run because these triggers are often used insecurely [1][2][3]. However, as of version 1.27, zizmor includes an explicit exception for workflows that use pull_request_target solely with the actions/labeler action [1][4]. Specifically, if a workflow has exactly one job containing only one step, and that step uses actions/labeler, zizmor will suppress the dangerous-triggers finding [2][5]. If you encounter a dangerous-triggers finding that you believe is secure or necessary for your use case, you can suppress it using inline ignore comments or a zizmor.yml configuration file [6][7]: 1. Inline Ignore: You can add an ignore comment to the relevant line in your workflow file [6][8]: # zizmor: ignore[dangerous-triggers] 2. Configuration File (zizmor.yml): You can add a rule to a zizmor.yml file to ignore the finding for a specific file or location [6][9][10]: rules: dangerous-triggers: ignore: - filename.yml Ensure the ignore comment is placed correctly—it must be a valid YAML comment and cannot be placed inside a string or block literal [6][8]. More granular ignores can be achieved in zizmor.yml by specifying line and column numbers (e.g., filename.yml:line:column) [9][10].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== zizmor.yml =="
cat -n .github/zizmor.yml | sed -n '1,160p'

echo
echo "== workflow-lint trigger/run =="
cat -n .github/workflows/workflow-lint.yml | sed -n '1,80p'

echo
echo "== nearby comparable pull_request_target inline suppressions =="
for f in .github/workflows/labeler.yml .github/workflows/coderabbit-gate.yml .github/workflows/ui-screenshot-gate.yml .github/workflows/auto-merge.yml; do
  [ -f "$f" ] && { echo "--- $f"; cat -n "$f" | sed -n '1,70p'; }
done

echo
echo "== full koth-engine-gate =="
cat -n .github/workflows/koth-engine-gate.yml

Repository: vouchdev/vouch

Length of output: 22852


Add a scoped zizmor suppression for the engine gate trigger.

.github/zizmor.yml only disables other rules globally; it does not suppress dangerous-triggers, so zizmor==1.27.0 --offline --persona regular still fails koth-engine-gate.yml. Add a narrowly scoped .github/zizmor.yml override or an inline suppression with the existing “checks out only base + sandbox PR strategy as data” rationale after the action pins are fixed.

🧰 Tools
🪛 GitHub Actions: workflow-lint / 0_zizmor (workflow security).txt

[error] 21-23: zizmor [dangerous-triggers]: use of fundamentally insecure workflow trigger. pull_request_target is almost always used insecurely.

🪛 GitHub Actions: workflow-lint / zizmor (workflow security)

[error] 21-23: zizmor error[dangerous-triggers]: use of fundamentally insecure workflow trigger. 'pull_request_target' is almost always used insecurely.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/koth-engine-gate.yml around lines 21 - 23, Add a narrowly
scoped zizmor suppression for the dangerous-triggers finding on the
koth-engine-gate pull_request_target workflow, using the existing rationale that
it checks out only the base and sandbox PR strategy as data. Place the
suppression in .github/zizmor.yml or inline in the workflow, and apply it only
to this engine gate trigger after action pins are fixed.

Source: Pipeline failures

Comment thread .github/workflows/koth-engine-gate.yml Outdated
Comment thread .github/workflows/koth-engine-gate.yml
workflow lint only runs on prs that touch workflows, so the koth gates'
pull_request_target findings never surfaced until the engine-gate
registration pr woke the linter. both gates now carry the ignore
annotation with the justification inline (base-branch code only, pr
content handled as data, read-only tokens), and the scorecard comment
script declares its literal backticks for shellcheck.
@github-actions github-actions Bot added the ci: passing ci is green label Jul 28, 2026
@github-actions
github-actions Bot disabled auto-merge July 28, 2026 03:53
a trailing comment on the directive line keeps shellcheck from parsing
it, and a top-of-script placement did not attach to the compound
command. the directive now sits bare, immediately above the comment
block it covers.
pin checkout and setup-python to immutable commit shas (mutable tags in
a pull_request_target workflow are a supply-chain surface), and classify
a delete-only strategy pr as normal instead of engine - the filename
shape matched but there is nothing to fetch at the head sha, so the
gate failed messy instead of passing through.
@plind-junior

Copy link
Copy Markdown
Member Author

@coderabbitai review — annotation was already in place, sha pins and the delete-only classification are addressed in the latest push.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

for file in .github/workflows/koth-engine-gate.yml .github/workflows/koth-gate.yml; do
  if [ -f "$file" ]; then
    echo "===== OUTLINE: $file ====="
    ast-grep outline "$file" --lang yaml --view expanded || true
    echo "===== RELEVANT LINES: $file ====="
    rg -n -C 3 '(pull_request_target|uses:|zizmor|ShellCheck|delete|deleted|scorecard|changed)' "$file" || true
  else
    echo "MISSING: $file"
  fi
done

echo "===== WORKFLOW FILE STATUS ====="
git status --short -- .github/workflows/koth-engine-gate.yml .github/workflows/koth-gate.yml
git diff --no-ext-diff -- .github/workflows/koth-engine-gate.yml .github/workflows/koth-gate.yml

echo "===== ENGINE VS LADDER CONTENT COMPARISON ====="
if [ -f .github/workflows/koth-engine-gate.yml ] && [ -f .github/workflows/koth-gate.yml ]; then
  diff -u .github/workflows/koth-gate.yml .github/workflows/koth-engine-gate.yml || true
fi

Length of output: 19514


@plind-junior Confirmed: the existing trigger annotation is present, the engine workflow actions are SHA-pinned, and removed-only strategy changes are classified as normal rather than engine submissions. I’ll review the latest revision now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@plind-junior
plind-junior merged commit cabdf5b into main Jul 28, 2026
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: passing ci is green ci github actions and automation size: S 50-199 changed non-doc lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant