From c988092f313c851eac9d5fa576f865d8caad7114 Mon Sep 17 00:00:00 2001 From: Dalton Cherry Date: Sun, 7 Jun 2026 15:57:28 -0500 Subject: [PATCH 1/2] ci: keep Crush reviews visible and lightweight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use CI status instead of rerunning verification during automated reviews and leave a fallback PR comment when GitHub blocks own-PR approvals. 💘 Generated with Crush Assisted-by: Crush:gpt-5.5 Co-Authored-By: gpt-5.5 --- .agents/skills/pr-comments/SKILL.md | 6 ++++-- .agents/skills/pr-review/SKILL.md | 23 +++++++++-------------- .github/workflows/crush-pr-review.yml | 1 + 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.agents/skills/pr-comments/SKILL.md b/.agents/skills/pr-comments/SKILL.md index 55ab7d8..4417831 100644 --- a/.agents/skills/pr-comments/SKILL.md +++ b/.agents/skills/pr-comments/SKILL.md @@ -16,8 +16,10 @@ Post review findings as inline comments on specific diff lines via the GitHub Pu **Before doing anything else**, check the pr-review output: -- If the review found **zero Must Fix and zero Should Fix items**, submit an `APPROVE` review with a short body like "Clean PR — builds, tests pass, lint clean. LGTM." and **no inline comments**. Then stop. -- If only "Consider" items exist and they're truly optional, approve without inline comments. +- Before submitting any review, fetch PR status checks with `gh pr view --repo daltoniam/switchboard_plugins --json statusCheckRollup` and include a short status summary in the review body or fallback comment. +- If the review found **zero Must Fix and zero Should Fix items**, submit an `APPROVE` review with a short body like "Clean PR — CI/status checks are passing and I didn't find any blocking issues. LGTM." and **no inline comments**. Then stop. +- If GitHub rejects the approval because the token belongs to the PR author, post a regular PR comment with the same short positive summary, include the CI/status check summary, and mention that approval was blocked by GitHub's own-PR restriction. Then stop. +- If only "Consider" items exist and they're truly optional, approve without inline comments. If approval is blocked by GitHub's own-PR restriction, post a regular PR comment summarizing that the review found no blocking issues and include the CI/status check summary. - Only proceed to Step 1 if there are **concrete, actionable findings** worth commenting on. **Never post test/placeholder comments.** Every comment submitted to the PR must contain real, substantive feedback. diff --git a/.agents/skills/pr-review/SKILL.md b/.agents/skills/pr-review/SKILL.md index 40cd553..d92ba9f 100644 --- a/.agents/skills/pr-review/SKILL.md +++ b/.agents/skills/pr-review/SKILL.md @@ -49,29 +49,24 @@ git fetch origin && git checkout Note the PR size (files changed, additions, deletions) — large PRs deserve extra scrutiny. -### Step 2: Build Verification +### Step 2: CI Status Verification -Read `AGENTS.md` first, then verify the changed code builds: +CI has already run before this review workflow starts. Do not rerun `cargo build`, `cargo fmt`, `cargo clippy`, `cargo test`, or the full CI matrix during automated review. + +Use GitHub status and run metadata to verify CI instead: ```bash -cargo build --release --target wasm32-wasip1 +gh pr view --repo daltoniam/switchboard_plugins --json statusCheckRollup ``` -If the build fails, report it as a **Must Fix** item unless it is clearly unrelated to the PR and already known. Include the failing crate and linker/compiler error. - -### Step 3: Test and Format Verification - -Run the configured checks: +Report the existing CI result in the review. If CI failed or is missing, report that as a **Must Fix** item. If CI passed, proceed directly to diff review. -```bash -cargo fmt --check -cargo clippy --target wasm32-wasip1 -- -D warnings -``` +### Step 3: Test and Validation Coverage Review -If the repo contains tests for touched crates, run the relevant `cargo test` commands too. If tests are not available because the plugin only targets WASM, state that and rely on build/clippy plus code review. +Review whether the diff includes appropriate tests or validation for the changed behavior. Do not run cargo checks unless needed to validate a specific finding that cannot be assessed from the diff and existing CI status. -- If checks fail due to code issues, report each failure with the file and error output. - If there are no tests or validation for new behavior, flag it when the behavior is non-trivial. +- If a targeted command is truly necessary, keep it narrow and avoid broad workspace builds. ### Step 4: Manifest and Artifact Verification diff --git a/.github/workflows/crush-pr-review.yml b/.github/workflows/crush-pr-review.yml index 5719388..c8f00b7 100644 --- a/.github/workflows/crush-pr-review.yml +++ b/.github/workflows/crush-pr-review.yml @@ -43,5 +43,6 @@ jobs: run: > crush run -c "${{ github.workspace }}" "Review PR #${{ github.event.pull_request.number }} in ${{ github.repository }}. + CI has already passed for this PR. Do not rerun cargo build, cargo fmt, cargo clippy, cargo test, or the full CI matrix. Inspect existing CI/status checks and focus on code review of the diff. Use the pr-review skill to do a full code review, then use the pr-comments skill to post your findings as inline comments on the PR. The repo is already checked out locally. Use gh CLI for all GitHub API interactions." From 20316a29117e1ad5d5807329d789d9e7f965fbe7 Mon Sep 17 00:00:00 2001 From: Dalton Cherry Date: Sun, 7 Jun 2026 16:07:05 -0500 Subject: [PATCH 2/2] ci: trim Cloudflare gateway metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep the required developer metadata while avoiding repo, tool, and task type values in Cloudflare AI Gateway logs. 💘 Generated with Crush Assisted-by: Crush:gpt-5.5 Co-Authored-By: gpt-5.5 --- .ci/crush/crush.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/crush/crush.json b/.ci/crush/crush.json index 66808c2..b93b394 100644 --- a/.ci/crush/crush.json +++ b/.ci/crush/crush.json @@ -18,7 +18,7 @@ "base_url": "https://gateway.ai.cloudflare.com/v1/${CF_AIG_ACCOUNT_ID:?set CF_AIG_ACCOUNT_ID}/${CF_AIG_GATEWAY_ID:?set CF_AIG_GATEWAY_ID}/grok", "api_key": "${CF_AIG_TOKEN:?set CF_AIG_TOKEN to your Cloudflare AI Gateway token}", "extra_headers": { - "cf-aig-metadata": "{\"developer_id\": \"austin.cherry\", \"task_type\": \"ci_pr_review\", \"tool\": \"crush\", \"repo\": \"daltoniam/switchboard_plugins\"}", + "cf-aig-metadata": "{\"developer_id\": \"austin.cherry\"}", "cf-aig-collect-log-payload": "false" }, "models": [