huggy-pr-agent 1.8.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to `huggy-pr-agent` are documented in this file.
4
4
 
5
+ ## [1.10.0] - 2026-11-13
6
+
7
+ ### Added
8
+ - **Full-Lifecycle 16-Bit Pixel-Art Live Animations (`assets/huggy-{judging,fixing,testing,thinking,blocked}.svg` + `scripts/post_progress.py`)**: live animated status cards now cover every stage of Huggy's workflow — transitioning from `huggy-reviewing.svg` to `huggy-judging.svg` during the precision Judge pass, from `huggy-fixing.svg` to `huggy-testing.svg` when `@huggy` runs `verify_cmd`, showing `huggy-thinking.svg` on `/ask` & `/describe`, and displaying `huggy-blocked.svg` on guarded-boundary refusals — before replacing themselves cleanly in-place once finished.
9
+ - **Pi Marketplace Hero Card (`assets/pi-marketplace-card.png`)**: custom `1280x720` pixel-art gallery thumbnail for `pi.dev/packages/huggy-pr-agent`, plus animated pixel-art walkthroughs across `README.md`.
10
+ - **Two-Phase Split Execution (`--phase find` / `--phase judge`)**: updates the PR review banner to the Judge pass between bundle discovery and verification while keeping `GH_TOKEN` strictly isolated from every Pi invocation step.
11
+
12
+ ## [1.9.0] - 2026-11-12
13
+
14
+ ### Added
15
+ - **Lead + Wingmen Parallel Worker Pool & Blast-Radius Risk Router (`wingman_model` + `scripts/run_review.py`)**: computes best-effort reverse-import blast radius (`compute_blast_radius`) and domain criticality (`migrations/`, `auth`, `billing`, `security`, `contracts`, `api/v1`) before dispatching bundles so the highest-risk bundle and Judge pass run Lead-first on `model` (e.g. `google-vertex/gemini-4-carbon`) while parallel sibling bundles run concurrently on `wingman_model` (e.g. `google-vertex/gemini-4-argon`), falling back to `fallback_model` only on failure/timeout.
16
+ - **Line-Shift-Resilient Thread Fingerprints & Multi-Comment Auto-Resolve (`scripts/post_review.py`)**: embeds `<!-- pi id=<hash> -->` markers so open findings survive line shifts across pushes, auto-resolves fixed threads even after developer/agent replies (while preserving open human questions), and respects `👎` downvoted suggestions across re-runs.
17
+ - **`🤖 Prompt for AI Agents` Handoff Block**: automatically attaches a collapsible agent-ready fix prompt on `High`/`Medium` inline findings that span multiple lines/files and cannot be committed as a 1-click `suggestion`.
18
+ - **Direct Target Issue Extraction & `huggy:deep` Label Trigger (`scripts/fetch_pr_context.py`)**: extracts direct target issues from branch names (`feat/123-...`), PR titles, and `Closes/Fixes` lines, and automatically enables `deep` dual-lens review when a PR carries the `huggy:deep` or `review:deep` label.
19
+ - **Ponytail Senior-On-Call Discipline & Anti-Hedging Gate (`prompts/review.md`, `prompts/judge.md`)**: calibrates scale findings against expected load, prioritizes smallest fixes (preferring deletion/reusing existing repo helpers over new abstractions), respects documented `shortcut:` / `ponytail:` limits, and filters out speculative hedging and self-contradictory rambling.
20
+
5
21
  ## [1.8.0] - 2026-11-12
6
22
 
7
23
  ### Added
package/README.md CHANGED
@@ -146,7 +146,7 @@ jobs:
146
146
  - **Interactive comment commands (`issue_comment`, `pull_request_review_comment`)** activate as soon as `.github/workflows/huggy.yml` lands on your default branch.
147
147
  - **Staying in sync with upstream updates:**
148
148
  - **Zero-click automatic updates:** Referencing `tripplen23/huggy-pr-agent@v1` automatically picks up every engine, Judge, and prompt improvement as soon as a new `v1.x` release ships.
149
- - **1-click PR approval updates:** Prefer explicit version review before upgrading? Pin `uses: tripplen23/huggy-pr-agent@v1.8.0` and drop [`examples/dependabot.yml`](examples/dependabot.yml) into `.github/dependabot.yml` (or use Renovate) — GitHub opens a 1-click Merge PR with full release notes whenever a new version is published.
149
+ - **1-click PR approval updates:** Prefer explicit version review before upgrading? Pin `uses: tripplen23/huggy-pr-agent@v1.10.0` and drop [`examples/dependabot.yml`](https://github.com/tripplen23/huggy-pr-agent/blob/main/examples/dependabot.yml) into `.github/dependabot.yml` (or use Renovate) — GitHub opens a 1-click Merge PR with full release notes whenever a new version is published.
150
150
  - **Local Pi package updates:** Run `pi update --extensions` (and `/huggy sync` inside any repo to refresh workflow templates).
151
151
 
152
152
  ---
@@ -211,14 +211,41 @@ Generic AI reviewers fail in two predictable ways: **single-call diff wrappers**
211
211
  - Small/medium PRs run in a single fast pass; massive PRs (10k+ lines / dozens of files) are deterministically grouped into semantic counterpart bundles (`foo.ts` + `contracts/foo.ts` + `foo.test.ts`) and reviewed concurrently (`review_timeout_minutes: auto`), with an optional `review_depth: deep` (`/review deep`) dual-lens pass (Logic/Callers + Security/Spec).
212
212
  - Uses review-shaped tool discipline (`--tools read,grep,find,ls --thinking high`): forms hypotheses from the diff first, batches `grep`/`find` caller discovery, then reads narrow `offset`/`limit` ranges.
213
213
  3. **Confidence-Scored (`≥ 80`) Judge Pass & Two-Channel Output (`prompts/judge.md`, `scripts/post_review.py`)**
214
- - An independent tool-free **Judge pass** scores every candidate `0–100` against ground-truth file lines and the `AGENTS.md` rubric, enforcing hard exclusions (no pre-existing code, no ungrounded speculation, no hallucinated rules) so only `confidence ≥ 80` defects reach inline diff threads.
214
+ - Once the Lead + Wingmen workers finish scanning their risk-ranked bundles, the live banner transitions to the **Judge pass** while an independent tool-free Judge scores every candidate `0–100` against ground-truth file lines and the `AGENTS.md` rubric, enforcing hard exclusions (no pre-existing code, no hedged speculation, no hallucinated rules) so only `confidence ≥ 80` defects reach inline diff threads.
215
215
  - Under `review_profile: chill` (default), `High` and `Medium` defects are posted inline while `Low` nitpicks are collapsed inside `<details><summary>🧹 Nitpicks</summary>` in the sticky summary.
216
- - Content-anchored sliding-window relocation repairs minor `1–5` line drift on `suggestion` blocks, disarms unsafe/unbalanced blocks, auto-resolves fixed threads, and replaces the live reviewing sprite with the static `Review by Huggy` summary.
216
+ - Content-anchored sliding-window relocation repairs minor `1–5` line drift on `suggestion` blocks, disarms unsafe/unbalanced blocks, auto-resolves fixed threads, and replaces the live animation with the static `Review by Huggy` summary.
217
+
218
+ <div align="center">
219
+ <img src="https://raw.githubusercontent.com/tripplen23/huggy-pr-agent/main/assets/huggy-judging.svg" alt="Huggy precision Judge pass" width="196" />
220
+ <br />
221
+ <sub><em>Live precision Judge indicator — verifies candidate findings against ground-truth code before anything is posted.</em></sub>
222
+ </div>
217
223
 
218
224
  ---
219
225
 
220
226
  ## Commands & Capabilities
221
227
 
228
+ Every interactive command posts an in-place pixel-art status reply while running — transitioning automatically from **code patching** to **verification test gating** — and replaces itself cleanly with the final answer or commit SHA once finished:
229
+
230
+ <div align="center">
231
+ <table>
232
+ <tr>
233
+ <td align="center" width="240">
234
+ <img src="https://raw.githubusercontent.com/tripplen23/huggy-pr-agent/main/assets/huggy-fixing.svg" alt="Huggy applying a fix" width="176" /><br />
235
+ <sub><strong><code>@huggy &lt;fix&gt;</code></strong> · Patching code</sub>
236
+ </td>
237
+ <td align="center" width="240">
238
+ <img src="https://raw.githubusercontent.com/tripplen23/huggy-pr-agent/main/assets/huggy-testing.svg" alt="Huggy running verify_cmd tests" width="176" /><br />
239
+ <sub><strong><code>verify_cmd</code></strong> · Running test gate</sub>
240
+ </td>
241
+ <td align="center" width="240">
242
+ <img src="https://raw.githubusercontent.com/tripplen23/huggy-pr-agent/main/assets/huggy-thinking.svg" alt="Huggy tracing callers for /ask" width="176" /><br />
243
+ <sub><strong><code>/ask</code> · <code>/describe</code></strong> · Deep trace</sub>
244
+ </td>
245
+ </tr>
246
+ </table>
247
+ </div>
248
+
222
249
  Comment any of these in the **PR conversation**, inside an **inline diff review thread**, or at the bottom of a **Quote reply** (`@pi` and `/pi` aliases work identically to `@huggy` and `/huggy`):
223
250
 
224
251
  | Trigger / Command | Mode | What it does |
@@ -241,8 +268,9 @@ Comment any of these in the **PR conversation**, inside an **inline diff review
241
268
  | `gcp_project` | `""` | Google Cloud project ID when using `google-vertex/*` models (auto-detected from `gcp_credentials_json` if omitted). |
242
269
  | `gcp_location` | `global` | Google Cloud region or `global` when using `google-vertex/*` models. |
243
270
  | `gcp_credentials_json` | `""` | Google Cloud Service Account JSON key for `google-vertex/*` models (omit when using Workload Identity Federation). |
244
- | `model` | `opencode-go/deepseek-v4.1-flash` | Primary model ID passed to `pi --model`. |
245
- | `fallback_model` | `opencode-go/glm-5.3-flash` | Fallback model tried automatically when `model` is overloaded (`429`/`5xx`/timeout) — supports cross-provider failover. |
271
+ | `model` | `opencode-go/deepseek-v4.1-flash` | Primary / Lead model ID passed to `pi --model` (reviews the highest-risk bundle and runs the Judge pass). |
272
+ | `wingman_model` | `""` | Optional Wingman model ID for parallel non-lead bundles (e.g. `google-vertex/gemini-4-argon`). Defaults to `model` when empty. |
273
+ | `fallback_model` | `opencode-go/glm-5.3-flash` | Emergency fallback model tried only after `model` or `wingman_model` fails (error, non-zero exit, missing verdict, or timeout) — supports cross-provider failover. |
246
274
  | `thinking` | `high` | Thinking depth (`off`, `minimal`, `low`, `medium`, `high`). |
247
275
  | `review_tools` | `read,grep,find,ls` | Built-in Pi tools enabled during read-only PR reviews. |
248
276
  | `review_timeout_minutes` | `auto` | Review timeout budget in minutes, or `auto` to scale dynamically with PR size (24m on small PRs up to 50m on massive multi-bundle PRs). |
@@ -270,7 +298,15 @@ Comment any of these in the **PR conversation**, inside an **inline diff review
270
298
 
271
299
  ## Security Model
272
300
 
273
- See [SECURITY.md](SECURITY.md) for the full threat model. Key invariants:
301
+ <div align="center">
302
+ <img src="https://raw.githubusercontent.com/tripplen23/huggy-pr-agent/main/assets/huggy-blocked.svg" alt="Huggy guarded boundary alert" width="184" />
303
+ <br />
304
+ <sub><em>Guarded boundary alert — shown when a fix attempts to modify protected workflows, lockfiles, or migrations.</em></sub>
305
+ </div>
306
+
307
+ <br />
308
+
309
+ See [SECURITY.md](https://github.com/tripplen23/huggy-pr-agent/blob/main/SECURITY.md) for the full threat model. Key invariants:
274
310
 
275
311
  - **Write-permission verification** — interactive `@huggy` / `@pi` commands verify true repository `write`/`maintain`/`admin` access via `/repos/{owner}/{repo}/collaborators/{username}/permission` before checking out code or running `setup_cmd` (working seamlessly even when organization memberships are Private).
276
312
  - **Base-branch rubric isolation** — `AGENTS.md` / `CLAUDE.md` and custom prompt files are read from `base` via `git show`, and Pi runs with `--no-context-files --no-approve`. A PR cannot poison its own review checklist or auto-load `.pi/` extensions.
@@ -281,6 +317,6 @@ See [SECURITY.md](SECURITY.md) for the full threat model. Key invariants:
281
317
 
282
318
  ## Contributing & License
283
319
 
284
- Contributions, bug reports, and prompt improvements are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for local development and testing instructions.
320
+ Contributions, bug reports, and prompt improvements are welcome! See [CONTRIBUTING.md](https://github.com/tripplen23/huggy-pr-agent/blob/main/CONTRIBUTING.md) for local development and testing instructions.
285
321
 
286
322
  Licensed under the [MIT License](LICENSE).
package/action.yml CHANGED
@@ -31,11 +31,15 @@ inputs:
31
31
  required: false
32
32
  default: ""
33
33
  model:
34
- description: "Pi model identifier (`provider/model`)."
34
+ description: "Primary / Lead Pi model identifier (`provider/model`). Reviews the highest-risk bundle and runs the Judge pass."
35
35
  required: false
36
36
  default: "opencode-go/deepseek-v4.1-flash"
37
+ wingman_model:
38
+ description: "Optional Wingman Pi model identifier (`provider/model`) for parallel non-lead bundles (e.g. `google-vertex/gemini-4-argon`). Defaults to `model` when empty."
39
+ required: false
40
+ default: ""
37
41
  fallback_model:
38
- description: "Fallback model identifier tried when the primary model is overloaded (429/5xx)."
42
+ description: "Emergency fallback model identifier tried only after `model` or `wingman_model` fails (error, non-zero exit, missing verdict, or timeout)."
39
43
  required: false
40
44
  default: "opencode-go/glm-5.3-flash"
41
45
  thinking:
@@ -217,7 +221,7 @@ runs:
217
221
  python3 "$RUNNER_TEMP/pi-action/scripts/fetch_pr_context.py" "$RUNNER_TEMP/pr-context.md" "$RUNNER_TEMP/diff.patch"
218
222
  python3 "$RUNNER_TEMP/pi-action/scripts/post_progress.py"
219
223
 
220
- - name: Run Pi (review + judge)
224
+ - name: Run Pi (bundle finders)
221
225
  if: steps.gate_review.outputs.go == 'true'
222
226
  shell: bash
223
227
  env:
@@ -227,6 +231,7 @@ runs:
227
231
  PI_GCP_LOCATION: ${{ inputs.gcp_location }}
228
232
  PI_GCP_CREDENTIALS_JSON: ${{ inputs.gcp_credentials_json }}
229
233
  PI_MODEL: ${{ inputs.model }}
234
+ PI_WINGMAN_MODEL: ${{ inputs.wingman_model }}
230
235
  PI_FALLBACK_MODEL: ${{ inputs.fallback_model }}
231
236
  PI_THINKING: ${{ inputs.thinking }}
232
237
  PI_VERSION: ${{ inputs.pi_version }}
@@ -239,7 +244,39 @@ runs:
239
244
  set -euo pipefail
240
245
  # shellcheck disable=SC1091
241
246
  source "$RUNNER_TEMP/pi-action/scripts/ensure_tools.sh"
242
- python3 "$RUNNER_TEMP/pi-action/scripts/run_review.py"
247
+ python3 "$RUNNER_TEMP/pi-action/scripts/run_review.py" --phase find
248
+
249
+ - name: Update progress banner to Judge pass
250
+ if: steps.gate_review.outputs.go == 'true'
251
+ shell: bash
252
+ env:
253
+ GH_TOKEN: ${{ inputs.github_token }}
254
+ REPO: ${{ github.repository }}
255
+ PR: ${{ github.event.pull_request.number }}
256
+ run: |
257
+ set -euo pipefail
258
+ python3 "$RUNNER_TEMP/pi-action/scripts/post_progress.py" judge
259
+
260
+ - name: Run Pi (precision judge)
261
+ if: steps.gate_review.outputs.go == 'true'
262
+ shell: bash
263
+ env:
264
+ PI_API_KEY: ${{ inputs.api_key }}
265
+ PI_API_KEY_ENV: ${{ inputs.api_key_env }}
266
+ PI_GCP_PROJECT: ${{ inputs.gcp_project }}
267
+ PI_GCP_LOCATION: ${{ inputs.gcp_location }}
268
+ PI_GCP_CREDENTIALS_JSON: ${{ inputs.gcp_credentials_json }}
269
+ PI_MODEL: ${{ inputs.model }}
270
+ PI_WINGMAN_MODEL: ${{ inputs.wingman_model }}
271
+ PI_FALLBACK_MODEL: ${{ inputs.fallback_model }}
272
+ PI_THINKING: ${{ inputs.thinking }}
273
+ PI_VERSION: ${{ inputs.pi_version }}
274
+ PI_JUDGE_PASS: ${{ inputs.judge_pass }}
275
+ run: |
276
+ set -euo pipefail
277
+ # shellcheck disable=SC1091
278
+ source "$RUNNER_TEMP/pi-action/scripts/ensure_tools.sh"
279
+ python3 "$RUNNER_TEMP/pi-action/scripts/run_review.py" --phase judge
243
280
 
244
281
  - name: Publish inline review and sticky summary
245
282
  if: steps.gate_review.outputs.go == 'true'
@@ -325,16 +362,17 @@ runs:
325
362
  read -r branch base cross < <(curl -fsSL -H "$auth" "$api/pulls/$PR" \
326
363
  | jq -r '"\(.head.ref) \(.base.ref) \(.head.repo.full_name != .base.repo.full_name)"')
327
364
  : "${branch:?could not read the PR branch}"
365
+ blocked_img='<img src="https://raw.githubusercontent.com/tripplen23/huggy-pr-agent/v1/assets/huggy-blocked.svg" width="160" alt="Huggy stopped on a guarded boundary" />'
328
366
  if [ "$cross" = "true" ] && [ "$cmd" = "fix" ]; then
329
367
  curl -fsSL -X POST -H "$auth" -H "Content-Type: application/json" \
330
- "$api/issues/$PR/comments" -d '{"body":"I cannot push to a fork branch with this token. Run `pi` on the branch locally, or open the PR from a branch in this repo."}' > /dev/null
368
+ "$api/issues/$PR/comments" -d "$(jq -n --arg b "$blocked_img"$'\n\n'"I cannot push to a fork branch with this token. Run \`pi\` on the branch locally, or open the PR from a branch in this repo." '{body: $b}')" > /dev/null
331
369
  echo "go=false" >> "$GITHUB_OUTPUT"
332
370
  exit 0
333
371
  fi
334
372
  if [ "$cmd" = "fix" ] && ! git ls-remote --exit-code "https://x-access-token:$GH_TOKEN@github.com/$REPO.git" "refs/heads/$branch" > /dev/null 2>&1; then
335
373
  if [ -n "$THREAD" ]; then reply_url="$api/pulls/$PR/comments/$COMMENT_ID/replies"; else reply_url="$api/issues/$PR/comments"; fi
336
374
  curl -fsSL -X POST -H "$auth" -H "Content-Type: application/json" \
337
- "$reply_url" -d "$(jq -n --arg b "Branch \`$branch\` has been deleted on GitHub, so new commits cannot be pushed to this PR yet. Click **Restore branch** on the PR (or push \`$branch\` again), then re-run \`@huggy\`." '{body: $b}')" > /dev/null
375
+ "$reply_url" -d "$(jq -n --arg b "$blocked_img"$'\n\n'"Branch \`$branch\` has been deleted on GitHub, so new commits cannot be pushed to this PR yet. Click **Restore branch** on the PR (or push \`$branch\` again), then re-run \`@huggy\`." '{body: $b}')" > /dev/null
338
376
  echo "go=false" >> "$GITHUB_OUTPUT"
339
377
  exit 0
340
378
  fi
@@ -351,6 +389,8 @@ runs:
351
389
  python3 "$RUNNER_TEMP/pi-action/scripts/prepare_command.py" build-request "$RUNNER_TEMP/fix-request.md"
352
390
  if [ "$cmd" = "review" ]; then
353
391
  python3 "$RUNNER_TEMP/pi-action/scripts/post_progress.py"
392
+ else
393
+ CMD="$cmd" python3 "$RUNNER_TEMP/pi-action/scripts/post_progress.py" command-start
354
394
  fi
355
395
 
356
396
  # Runs in its own step with neither GH_TOKEN nor PI_API_KEY in env, so
@@ -376,6 +416,7 @@ runs:
376
416
  PI_GCP_LOCATION: ${{ inputs.gcp_location }}
377
417
  PI_GCP_CREDENTIALS_JSON: ${{ inputs.gcp_credentials_json }}
378
418
  PI_MODEL: ${{ inputs.model }}
419
+ PI_WINGMAN_MODEL: ${{ inputs.wingman_model }}
379
420
  PI_FALLBACK_MODEL: ${{ inputs.fallback_model }}
380
421
  PI_THINKING: ${{ inputs.thinking }}
381
422
  PI_VERSION: ${{ inputs.pi_version }}
@@ -491,6 +532,19 @@ runs:
491
532
  echo "changed=false" >> "$GITHUB_OUTPUT"
492
533
  fi
493
534
 
535
+ - name: Update progress banner to verification test gate
536
+ if: steps.fix.outputs.changed == 'true' && inputs.verify_cmd != '' && steps.prepare.outputs.progress_comment_id != ''
537
+ shell: bash
538
+ env:
539
+ GH_TOKEN: ${{ inputs.github_token }}
540
+ REPO: ${{ github.repository }}
541
+ PR: ${{ github.event.issue.number || github.event.pull_request.number }}
542
+ PROGRESS_COMMENT_ID: ${{ steps.prepare.outputs.progress_comment_id }}
543
+ PROGRESS_COMMENT_KIND: ${{ steps.prepare.outputs.progress_comment_kind }}
544
+ run: |
545
+ set -euo pipefail
546
+ python3 "$RUNNER_TEMP/pi-action/scripts/post_progress.py" command-testing
547
+
494
548
  - name: Verify fix
495
549
  if: steps.fix.outputs.changed == 'true' && inputs.verify_cmd != ''
496
550
  shell: bash
@@ -510,6 +564,8 @@ runs:
510
564
  COMMENT_ID: ${{ github.event.comment.id }}
511
565
  THREAD: ${{ github.event_name == 'pull_request_review_comment' && 'yes' || '' }}
512
566
  CMD: ${{ steps.prepare.outputs.cmd }}
567
+ PROGRESS_COMMENT_ID: ${{ steps.prepare.outputs.progress_comment_id }}
568
+ PROGRESS_COMMENT_KIND: ${{ steps.prepare.outputs.progress_comment_kind }}
513
569
  PI_REVIEW_PROFILE: ${{ inputs.review_profile }}
514
570
  GUARDED_PATHS: ${{ inputs.guarded_paths }}
515
571
  run: |
@@ -517,6 +573,7 @@ runs:
517
573
  api="https://api.github.com/repos/$REPO"
518
574
  auth="Authorization: Bearer $GH_TOKEN"
519
575
  reply=$(cat "$RUNNER_TEMP/reply.md")
576
+ blocked_img='<img src="https://raw.githubusercontent.com/tripplen23/huggy-pr-agent/v1/assets/huggy-blocked.svg" width="160" alt="Huggy stopped on a guarded boundary" />'
520
577
 
521
578
  if [ -n "$THREAD" ]; then
522
579
  post="$api/pulls/$PR/comments/$COMMENT_ID/replies"
@@ -524,11 +581,27 @@ runs:
524
581
  post="$api/issues/$PR/comments"
525
582
  fi
526
583
  answer() {
527
- curl -fsSL -X POST -H "$auth" -H "Content-Type: application/json" \
528
- "$post" -d "$(jq -n --arg b "$1" '{body: $b}')" > /dev/null
584
+ local payload
585
+ payload=$(jq -n --arg b "$1" '{body: $b}')
586
+ if [ -n "${PROGRESS_COMMENT_ID:-}" ]; then
587
+ local patch_url="$api/issues/comments/$PROGRESS_COMMENT_ID"
588
+ [ "${PROGRESS_COMMENT_KIND:-}" = "pull" ] && patch_url="$api/pulls/comments/$PROGRESS_COMMENT_ID"
589
+ if curl -fsSL -X PATCH -H "$auth" -H "Content-Type: application/json" "$patch_url" -d "$payload" > /dev/null 2>&1; then
590
+ return 0
591
+ fi
592
+ fi
593
+ curl -fsSL -X POST -H "$auth" -H "Content-Type: application/json" "$post" -d "$payload" > /dev/null
594
+ }
595
+ cleanup_progress_comment() {
596
+ if [ -n "${PROGRESS_COMMENT_ID:-}" ]; then
597
+ local del_url="$api/issues/comments/$PROGRESS_COMMENT_ID"
598
+ [ "${PROGRESS_COMMENT_KIND:-}" = "pull" ] && del_url="$api/pulls/comments/$PROGRESS_COMMENT_ID"
599
+ curl -fsSL -X DELETE -H "$auth" "$del_url" > /dev/null 2>&1 || true
600
+ fi
529
601
  }
530
602
 
531
603
  if [ "$CMD" = "review" ] || [ "$CMD" = "improve" ]; then
604
+ cleanup_progress_comment
532
605
  export HEAD_SHA="$(git rev-parse HEAD)"
533
606
  git -c core.quotePath=false diff base HEAD > "$RUNNER_TEMP/diff.patch"
534
607
  python3 "$RUNNER_TEMP/pi-action/scripts/post_review.py"
@@ -575,7 +648,7 @@ runs:
575
648
  master|main|HEAD|refs/*|*/master|*/main) branch="" ;;
576
649
  esac
577
650
  if [ -z "$branch" ] || [ "$branch" = "$default" ]; then
578
- answer "Refusing to push: that is the default branch. Nothing was pushed."
651
+ answer "$(printf '%s\n\nRefusing to push: that is the default branch. Nothing was pushed.' "$blocked_img")"
579
652
  exit 1
580
653
  fi
581
654
 
@@ -586,7 +659,7 @@ runs:
586
659
  if [ -n "$touched" ]; then
587
660
  # shellcheck disable=SC2086
588
661
  git reset -q -- $GUARDED_PATHS
589
- answer "That fix wanted to change guarded build, dependency or migration files, which I do not touch ($(printf '%s' "$touched" | tr '\n' ' ')). Nothing was pushed; do it by hand."
662
+ answer "$(printf '%s\n\nThat fix wanted to change guarded build, dependency or migration files, which I do not touch (`%s`). Nothing was pushed; do it by hand.' "$blocked_img" "$(printf '%s' "$touched" | tr '\n' ' ')")"
590
663
  exit 1
591
664
  fi
592
665
  fi
@@ -637,7 +710,7 @@ runs:
637
710
  fi
638
711
 
639
712
  - name: Report when command fails
640
- if: failure() && steps.prepare.outputs.go == 'true'
713
+ if: (failure() || cancelled()) && steps.prepare.outputs.go == 'true'
641
714
  shell: bash
642
715
  env:
643
716
  GH_TOKEN: ${{ inputs.github_token }}
@@ -646,6 +719,8 @@ runs:
646
719
  COMMENT_ID: ${{ github.event.comment.id }}
647
720
  THREAD: ${{ github.event_name == 'pull_request_review_comment' && 'yes' || '' }}
648
721
  CMD: ${{ steps.prepare.outputs.cmd }}
722
+ PROGRESS_COMMENT_ID: ${{ steps.prepare.outputs.progress_comment_id }}
723
+ PROGRESS_COMMENT_KIND: ${{ steps.prepare.outputs.progress_comment_kind }}
649
724
  RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
650
725
  run: |
651
726
  set -euo pipefail
@@ -663,10 +738,27 @@ runs:
663
738
  "$api/issues/comments/$existing" -d "$payload" > /dev/null || true
664
739
  fi
665
740
  fi
741
+ fail_payload=$(jq -n --arg b "Huggy did not finish this one: a step failed, so nothing was pushed past the checks. The log says which: $RUN" '{body: $b}')
742
+ if [ -n "${PROGRESS_COMMENT_ID:-}" ]; then
743
+ patch_url="$api/issues/comments/$PROGRESS_COMMENT_ID"
744
+ [ "${PROGRESS_COMMENT_KIND:-}" = "pull" ] && patch_url="$api/pulls/comments/$PROGRESS_COMMENT_ID"
745
+ prog_body=$(curl -fsSL -H "$auth" "$patch_url" | jq -r '.body // ""' 2>/dev/null || true)
746
+ case "$prog_body" in
747
+ "<!-- huggy-cmd-progress -->"*)
748
+ if curl -fsSL -X PATCH -H "$auth" -H "Content-Type: application/json" "$patch_url" -d "$fail_payload" > /dev/null 2>&1; then
749
+ exit 0
750
+ fi
751
+ ;;
752
+ ?*)
753
+ # Progress comment was already replaced with a specific refusal message; preserve it!
754
+ exit 0
755
+ ;;
756
+ esac
757
+ fi
666
758
  if [ -n "$THREAD" ]; then
667
759
  post="$api/pulls/$PR/comments/$COMMENT_ID/replies"
668
760
  else
669
761
  post="$api/issues/$PR/comments"
670
762
  fi
671
763
  curl -fsSL -X POST -H "$auth" -H "Content-Type: application/json" \
672
- "$post" -d "$(jq -n --arg b "Huggy did not finish this one: a step failed, so nothing was pushed past the checks. The log says which: $RUN" '{body: $b}')" > /dev/null
764
+ "$post" -d "$fail_payload" > /dev/null
@@ -0,0 +1,165 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 208 112" width="208" height="112" shape-rendering="crispEdges" role="img" aria-label="Huggy stopped on a guarded boundary">
2
+ <rect x="36" y="76" width="40" height="4" fill="#0B0D12"/>
3
+ <rect x="28" y="80" width="8" height="4" fill="#0B0D12"/>
4
+ <rect x="36" y="80" width="40" height="4" fill="#232836"/>
5
+ <rect x="76" y="80" width="8" height="4" fill="#0B0D12"/>
6
+ <rect x="24" y="84" width="4" height="4" fill="#0B0D12"/>
7
+ <rect x="28" y="84" width="52" height="4" fill="#232836"/>
8
+ <rect x="80" y="84" width="4" height="4" fill="#161922"/>
9
+ <rect x="84" y="84" width="4" height="4" fill="#0B0D12"/>
10
+ <rect x="24" y="88" width="4" height="4" fill="#0B0D12"/>
11
+ <rect x="28" y="88" width="8" height="4" fill="#232836"/>
12
+ <rect x="36" y="88" width="4" height="4" fill="#0B0D12"/>
13
+ <rect x="40" y="88" width="32" height="4" fill="#232836"/>
14
+ <rect x="72" y="88" width="4" height="4" fill="#0B0D12"/>
15
+ <rect x="76" y="88" width="4" height="4" fill="#232836"/>
16
+ <rect x="80" y="88" width="4" height="4" fill="#161922"/>
17
+ <rect x="84" y="88" width="4" height="4" fill="#0B0D12"/>
18
+ <rect x="24" y="92" width="4" height="4" fill="#0B0D12"/>
19
+ <rect x="28" y="92" width="8" height="4" fill="#232836"/>
20
+ <rect x="36" y="92" width="4" height="4" fill="#0B0D12"/>
21
+ <rect x="40" y="92" width="32" height="4" fill="#232836"/>
22
+ <rect x="72" y="92" width="4" height="4" fill="#0B0D12"/>
23
+ <rect x="76" y="92" width="4" height="4" fill="#232836"/>
24
+ <rect x="80" y="92" width="4" height="4" fill="#161922"/>
25
+ <rect x="84" y="92" width="4" height="4" fill="#0B0D12"/>
26
+ <rect x="24" y="96" width="4" height="4" fill="#0B0D12"/>
27
+ <rect x="28" y="96" width="56" height="4" fill="#161922"/>
28
+ <rect x="84" y="96" width="4" height="4" fill="#0B0D12"/>
29
+ <g>
30
+ <rect x="40" y="8" width="32" height="4" fill="#0B0D12"/>
31
+ <rect x="32" y="12" width="8" height="4" fill="#0B0D12"/>
32
+ <rect x="40" y="12" width="12" height="4" fill="#FFDC62"/>
33
+ <rect x="52" y="12" width="20" height="4" fill="#FFCC4D"/>
34
+ <rect x="72" y="12" width="8" height="4" fill="#0B0D12"/>
35
+ <rect x="28" y="16" width="4" height="4" fill="#0B0D12"/>
36
+ <rect x="32" y="16" width="8" height="4" fill="#FFDC62"/>
37
+ <rect x="40" y="16" width="12" height="4" fill="#FFF2A6"/>
38
+ <rect x="52" y="16" width="8" height="4" fill="#FFDC62"/>
39
+ <rect x="60" y="16" width="20" height="4" fill="#FFCC4D"/>
40
+ <rect x="80" y="16" width="4" height="4" fill="#0B0D12"/>
41
+ <rect x="24" y="20" width="4" height="4" fill="#0B0D12"/>
42
+ <rect x="28" y="20" width="8" height="4" fill="#FFDC62"/>
43
+ <rect x="36" y="20" width="12" height="4" fill="#FFF2A6"/>
44
+ <rect x="48" y="20" width="16" height="4" fill="#FFDC62"/>
45
+ <rect x="64" y="20" width="16" height="4" fill="#FFCC4D"/>
46
+ <rect x="80" y="20" width="4" height="4" fill="#D99200"/>
47
+ <rect x="84" y="20" width="4" height="4" fill="#0B0D12"/>
48
+ <rect x="24" y="24" width="4" height="4" fill="#0B0D12"/>
49
+ <rect x="28" y="24" width="28" height="4" fill="#FFDC62"/>
50
+ <rect x="56" y="24" width="24" height="4" fill="#FFCC4D"/>
51
+ <rect x="80" y="24" width="4" height="4" fill="#D99200"/>
52
+ <rect x="84" y="24" width="4" height="4" fill="#0B0D12"/>
53
+ <rect x="20" y="28" width="4" height="4" fill="#0B0D12"/>
54
+ <rect x="24" y="28" width="64" height="4" fill="#3B4358"/>
55
+ <rect x="88" y="28" width="4" height="4" fill="#0B0D12"/>
56
+ <rect x="20" y="32" width="72" height="4" fill="#0B0D12"/>
57
+ <rect x="20" y="36" width="4" height="4" fill="#0B0D12"/>
58
+ <rect x="24" y="36" width="4" height="4" fill="#FFCC4D"/>
59
+ <rect x="28" y="36" width="8" height="4" fill="#0B0D12"/>
60
+ <rect x="36" y="36" width="16" height="4" fill="#161922"/>
61
+ <rect x="52" y="36" width="8" height="4" fill="#0B0D12"/>
62
+ <rect x="60" y="36" width="16" height="4" fill="#161922"/>
63
+ <rect x="76" y="36" width="8" height="4" fill="#0B0D12"/>
64
+ <rect x="84" y="36" width="4" height="4" fill="#FFCC4D"/>
65
+ <rect x="88" y="36" width="4" height="4" fill="#0B0D12"/>
66
+ <rect x="20" y="40" width="4" height="4" fill="#0B0D12"/>
67
+ <rect x="24" y="40" width="4" height="4" fill="#FFCC4D"/>
68
+ <rect x="28" y="40" width="8" height="4" fill="#0B0D12"/>
69
+ <rect x="36" y="40" width="16" height="4" fill="#161922"/>
70
+ <rect x="52" y="40" width="8" height="4" fill="#0B0D12"/>
71
+ <rect x="60" y="40" width="16" height="4" fill="#161922"/>
72
+ <rect x="76" y="40" width="8" height="4" fill="#0B0D12"/>
73
+ <rect x="84" y="40" width="4" height="4" fill="#FFCC4D"/>
74
+ <rect x="88" y="40" width="4" height="4" fill="#0B0D12"/>
75
+ <rect x="20" y="44" width="4" height="4" fill="#0B0D12"/>
76
+ <rect x="24" y="44" width="4" height="4" fill="#FFCC4D"/>
77
+ <rect x="28" y="44" width="8" height="4" fill="#0B0D12"/>
78
+ <rect x="36" y="44" width="16" height="4" fill="#161922"/>
79
+ <rect x="52" y="44" width="8" height="4" fill="#FFCC4D"/>
80
+ <rect x="60" y="44" width="16" height="4" fill="#161922"/>
81
+ <rect x="76" y="44" width="8" height="4" fill="#0B0D12"/>
82
+ <rect x="84" y="44" width="4" height="4" fill="#D99200"/>
83
+ <rect x="88" y="44" width="4" height="4" fill="#0B0D12"/>
84
+ <rect x="20" y="48" width="4" height="4" fill="#0B0D12"/>
85
+ <rect x="24" y="48" width="8" height="4" fill="#FFCC4D"/>
86
+ <rect x="32" y="48" width="20" height="4" fill="#0B0D12"/>
87
+ <rect x="52" y="48" width="8" height="4" fill="#FFCC4D"/>
88
+ <rect x="60" y="48" width="20" height="4" fill="#0B0D12"/>
89
+ <rect x="80" y="48" width="4" height="4" fill="#FFCC4D"/>
90
+ <rect x="84" y="48" width="4" height="4" fill="#D99200"/>
91
+ <rect x="88" y="48" width="4" height="4" fill="#0B0D12"/>
92
+ <rect x="20" y="52" width="4" height="4" fill="#0B0D12"/>
93
+ <rect x="24" y="52" width="60" height="4" fill="#FFCC4D"/>
94
+ <rect x="84" y="52" width="4" height="4" fill="#D99200"/>
95
+ <rect x="88" y="52" width="4" height="4" fill="#0B0D12"/>
96
+ <rect x="20" y="56" width="4" height="4" fill="#0B0D12"/>
97
+ <rect x="24" y="56" width="60" height="4" fill="#FFCC4D"/>
98
+ <rect x="84" y="56" width="4" height="4" fill="#D99200"/>
99
+ <rect x="88" y="56" width="4" height="4" fill="#0B0D12"/>
100
+ <rect x="24" y="60" width="4" height="4" fill="#0B0D12"/>
101
+ <rect x="28" y="60" width="16" height="4" fill="#FFCC4D"/>
102
+ <rect x="44" y="60" width="24" height="4" fill="#0B0D12"/>
103
+ <rect x="68" y="60" width="12" height="4" fill="#FFCC4D"/>
104
+ <rect x="80" y="60" width="4" height="4" fill="#D99200"/>
105
+ <rect x="84" y="60" width="4" height="4" fill="#0B0D12"/>
106
+ <rect x="24" y="64" width="4" height="4" fill="#0B0D12"/>
107
+ <rect x="28" y="64" width="52" height="4" fill="#FFCC4D"/>
108
+ <rect x="80" y="64" width="4" height="4" fill="#D99200"/>
109
+ <rect x="84" y="64" width="4" height="4" fill="#0B0D12"/>
110
+ <rect x="28" y="68" width="4" height="4" fill="#0B0D12"/>
111
+ <rect x="32" y="68" width="44" height="4" fill="#FFCC4D"/>
112
+ <rect x="76" y="68" width="4" height="4" fill="#D99200"/>
113
+ <rect x="80" y="68" width="4" height="4" fill="#0B0D12"/>
114
+ <rect x="32" y="72" width="8" height="4" fill="#0B0D12"/>
115
+ <rect x="40" y="72" width="28" height="4" fill="#FFCC4D"/>
116
+ <rect x="68" y="72" width="4" height="4" fill="#D99200"/>
117
+ <rect x="72" y="72" width="8" height="4" fill="#0B0D12"/>
118
+ <rect x="40" y="76" width="32" height="4" fill="#0B0D12"/>
119
+ <g>
120
+ <animate attributeName="opacity" values="1;0;1;1" dur="2.8s" calcMode="discrete" repeatCount="indefinite"/>
121
+ <rect x="36" y="36" width="4" height="4" fill="#FFFFFF"/>
122
+ <rect x="60" y="36" width="4" height="4" fill="#FFFFFF"/>
123
+ <rect x="40" y="40" width="4" height="4" fill="#FFFFFF"/>
124
+ <rect x="64" y="40" width="4" height="4" fill="#FFFFFF"/>
125
+ </g>
126
+ <g>
127
+ <animate attributeName="opacity" values="0;1;0;0" dur="2.8s" calcMode="discrete" repeatCount="indefinite"/>
128
+ <rect x="40" y="36" width="4" height="4" fill="#FFFFFF"/>
129
+ <rect x="64" y="36" width="4" height="4" fill="#FFFFFF"/>
130
+ <rect x="44" y="40" width="4" height="4" fill="#FFFFFF"/>
131
+ <rect x="68" y="40" width="4" height="4" fill="#FFFFFF"/>
132
+ </g>
133
+ </g>
134
+ <rect x="84" y="76" width="8" height="8" fill="#232836"/>
135
+ <rect x="84" y="72" width="8" height="4" fill="#0B0D12"/>
136
+ <rect x="84" y="84" width="8" height="4" fill="#0B0D12"/>
137
+ <rect x="92" y="60" width="12" height="4" fill="#0B0D12"/>
138
+ <rect x="88" y="64" width="4" height="16" fill="#0B0D12"/>
139
+ <rect x="92" y="64" width="8" height="16" fill="#FFCC4D"/>
140
+ <rect x="100" y="64" width="4" height="16" fill="#D99200"/>
141
+ <rect x="104" y="64" width="4" height="16" fill="#0B0D12"/>
142
+ <rect x="92" y="80" width="12" height="4" fill="#0B0D12"/>
143
+ <rect x="132" y="36" width="32" height="4" fill="#0B0D12"/>
144
+ <rect x="128" y="40" width="4" height="4" fill="#0B0D12"/>
145
+ <rect x="132" y="40" width="32" height="4" fill="#FFCC4D"/>
146
+ <rect x="164" y="40" width="4" height="4" fill="#0B0D12"/>
147
+ <rect x="124" y="44" width="4" height="40" fill="#0B0D12"/>
148
+ <rect x="128" y="44" width="4" height="40" fill="#FFCC4D"/>
149
+ <rect x="132" y="44" width="32" height="40" fill="#161922"/>
150
+ <rect x="164" y="44" width="4" height="40" fill="#D99200"/>
151
+ <rect x="168" y="44" width="4" height="40" fill="#0B0D12"/>
152
+ <rect x="128" y="84" width="4" height="4" fill="#0B0D12"/>
153
+ <rect x="132" y="84" width="32" height="4" fill="#D99200"/>
154
+ <rect x="164" y="84" width="4" height="4" fill="#0B0D12"/>
155
+ <rect x="132" y="88" width="32" height="4" fill="#0B0D12"/>
156
+ <g>
157
+ <animate attributeName="opacity" values="1;0.45" dur="1.4s" calcMode="discrete" repeatCount="indefinite"/>
158
+ <rect x="144" y="52" width="8" height="16" fill="#FFCC4D"/>
159
+ <rect x="144" y="72" width="8" height="8" fill="#FFCC4D"/>
160
+ </g>
161
+ <rect x="8" y="100" width="192" height="4" fill="#3B4358"/>
162
+ <rect x="8" y="104" width="4" height="4" fill="#0B0D12"/>
163
+ <rect x="12" y="104" width="184" height="4" fill="#161922"/>
164
+ <rect x="196" y="104" width="4" height="4" fill="#0B0D12"/>
165
+ </svg>