Repository navigation
Normalize blocked labels and cover run-step sanitization - #75793
Conversation
Co-authored-by: gh-aw-bot <[email protected]>
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully!
|
|
❌ PR Specification Reviewer failed to deliver outputs. Please review the logs for details.
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
What this change does: It normalizes blocked-label matching and adds regression coverage for run-step expressions in comments and expanding heredocs. It also keeps quoted-heredoc expressions for the existing validator.
Should fix
-
The new sanitizer case duplicates comment coverage (
pkg/workflow/run_step_sanitizer_test.go:L237-260)- What this is: The table already has
expression in bash comment extractedat L153-166, which covers the same comment expression and replacement. - Problem: The added case repeats that behavior while testing expanding-heredoc extraction, so four assertions are unrelated to the new regression and make the test less focused.
- Fix: Remove the comment expression and its matching expected run, env key, and env value entries; leave the expanding-heredoc expression as the sole case here.
- If we skip it: Comment handling has two overlapping tests, while a future failure in either test gives less focused feedback about what changed.
- What this is: The table already has
Verdict: fix 1 first.
Lean: -4 lines possible.
Generated by ✂️ Ponytail Reviewer for #75793 · codex · routed: gpt56 max · ~3 AIC · ⌖ ~1 AIC · ⊞ 118
Comment /ponytail to run again
| name: "expressions in comments and expanding heredocs are extracted", | ||
| step: map[string]any{ | ||
| "run": strings.Join([]string{ | ||
| `# docs: ${{ github.event.issue.title }}`, |
There was a problem hiding this comment.
Lean: The comment expression is already covered by expression in bash comment extracted above; remove this duplicate line and its matching expectations so this new case tests only expanding-heredoc extraction.
There was a problem hiding this comment.
Removed the duplicate comment expression and its expectations in 8ecbdff.
There was a problem hiding this comment.
Found one correctness concern: normalizing blocked glob patterns can convert compatibility/entity-encoded characters into active glob syntax and broaden existing policies. The inline comment describes the case and requested mitigation. No tests or builds were run (static review).
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
| const normalizedLabelName = hardenUnicodeText(labelName); | ||
| if (blockedPatterns.length > 0) { | ||
| const isBlocked = blockedPatterns.some(pattern => matchesSimpleGlob(labelName, pattern)); | ||
| const isBlocked = blockedPatterns.some(pattern => matchesSimpleGlob(normalizedLabelName, hardenUnicodeText(pattern))); |
There was a problem hiding this comment.
hardenUnicodeText applies NFKC/entity decoding to the glob pattern itself, so compatibility characters that were previously literal can become glob syntax. For example, a configured blocked pattern containing a full-width * (or *) is converted to * and begins matching every label, broadening an existing policy unexpectedly. Please preserve glob metacharacter semantics while normalizing pattern text (or document/test this intentional behavior).
There was a problem hiding this comment.
Preserved original wildcard operators and escaped normalized literal fragments in 8ecbdff, with regression tests.
There was a problem hiding this comment.
Reviewed PR head 3d5ebad4edb2e104d8d3d9a440366707dec0e49c against specs/replace-label-spec.md v1.0.3 (RL-001, RL-003, RL-007) and specs/compiler-threat-detection-spec.md v1.0.97 (CTR-006).
The run-step sanitizer test updates are aligned regression evidence for the existing CTR-006 contract; no compiler specification change is needed. The intentional blocklist normalization changes the observable RL-003 matching contract, so I synchronized specs/replace-label-spec.md to v1.0.4 (2026-11-08), clarifying normalization of candidate labels and blocked patterns before glob matching. Commit fbca885 is queued for publication to the PR branch.
No blocking conformance findings. This was a static review; tests were not run per review policy.
Generated by PR Specification Reviewer for #75793 · copilot · gpt50 · ~5 AIC · ⌖ ~2 AIC · ⊞ 1.7K
Comment /review-specs to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /codebase-design. The Go run-step change is sound and its test passes. The label normalization blocks the reported bypasses, with one fail-open risk to address.
📋 Key Themes & Highlights
Key Themes
- Blocklist fail-open: a non-string
blockedentry now silently matches nothing (see inline comment onreplace_label.cjs). - Allowlist asymmetry: the blocklist uses normalized labels, while the allowlist still uses raw labels.
- Test gaps: the
case variationrow was already passing before this change, and the pattern-side normalization andlabel_to_removepaths are not covered.
Positive Highlights
- ✅ The Go change correctly scans comments and expanding heredocs while leaving quoted heredocs for the validator. The new test covers this and passes.
- ✅ Normalization keeps glob metacharacters such as
~*and*[bot]intact, so existing patterns still match. - ✅ The heredoc comment is clearer about why quoted heredocs are not rewritten.
@copilot please address the review comments above.
Comments that could not be inline-anchored
actions/setup/js/replace_label.test.cjs:264
**[/tdd]** The `case variation` row already passed before this change, since `matchesSimpleGlob` is case-insensitive. It doesn't guard the fix. The code also normalizes the *pattern* side with `hardenUnicodeText(pattern)`, and no test covers that path or `label_to_remove`. <details> <summary>💡 Suggested tests</summary> ```js it("should reject a label matching a Unicode-variant blocked pattern", async () => { const handler = await main({ blocked: ["blocked"] }); const result = await handle...
actions/setup/js/replace_label.cjs:63
**[/tdd]** A non-string entry in `blocked` now fails open silently. `hardenUnicodeText` returns `""` for non-strings, and `matchesSimpleGlob` treats an empty pattern as no match, so that rule stops blocking. The old code threw a `TypeError` on `pattern.toLowerCase()` for the same value. <details> <summary>💡 Suggested fix</summary> Reject non-string entries explicitly rather than skipping them: ```js const isBlocked = blockedPatterns.some(pattern => { if (typeof pattern !== "string") throw ...
actions/setup/js/replace_label.cjs:69
**[/codebase-design]** The blocklist compares the normalized label, but the allowlist compares the raw label. The two checks disagree on what a label is. A full-width allowlist entry like `bug` can never match, and a raw `bug` label is rejected even though it normalizes to `bug`. Both results fail closed, so this is not a bypass, but it is surprising. <details> <summary>💡 Suggested fix</summary> Decide whether the asymmetry is intended. If it is, document why exact matching is required for th...
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 5.4K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
Unicode normalization can turn existing blocklist matches into non-matches, allowing previously rejected non-Latin text through and weakening restrictions.
1 open issue
What changed in this PR
This PR addresses #74777 by updating label-policy enforcement in gh-aw’s safe-output handler and expanding run-step sanitizer regression coverage.
Changes:
- Normalize candidate labels and blocked patterns in
replace_label, with tests for case and Unicode variants. - Add sanitizer coverage for expressions in comments and expanding heredocs, and clarify the existing quoted-heredoc test wording.
| File | Description |
|---|---|
pkg/workflow/run_step_sanitizer_test.go |
Covers comment and expanding-heredoc expressions; clarifies quoted-heredoc handling. |
actions/setup/js/replace_label.test.cjs |
Adds blocked-label case and Unicode regression tests. |
actions/setup/js/replace_label.cjs |
Normalizes labels and patterns before blocklist matching. |
Review effort: Max (auto)
| const normalizedLabelName = hardenUnicodeText(labelName); | ||
| if (blockedPatterns.length > 0) { | ||
| const isBlocked = blockedPatterns.some(pattern => matchesSimpleGlob(labelName, pattern)); | ||
| const isBlocked = blockedPatterns.some(pattern => matchesSimpleGlob(normalizedLabelName, hardenUnicodeText(pattern))); |
There was a problem hiding this comment.
Added original-pattern matching before the normalized comparison, with Greek case-pair and wildcard regression coverage in 8ecbdff.
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 3d5ebad
|
Copilot assignment requested for the following outstanding work:
Sous-chef requested-head: 3d5ebad |
…ormalize-labels Co-authored-by: gh-aw-bot <[email protected]>
Triage
|
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 8ecbdff
|
Investigating the requested branch updates, review feedback, and failing checks. Sous-chef requested-head: 8ecbdff |
…ormalize-labels Co-authored-by: gh-aw-bot <[email protected]>
Co-authored-by: gh-aw-bot <[email protected]>
|
@copilot resolve the merge conflicts on this branch. |
Investigating the requested branch sync and CI failure. Sous-chef requested-head: 8ecbdff |
|
@copilot resolve the merge conflicts on this branch. |
…ormalize-labels # Conflicts: # actions/setup/js/replace_label.test.cjs Co-authored-by: pelikhan <[email protected]>
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: c23e97d
|
I’m investigating the requested merge and failing check. Sous-chef requested-head: c23e97d |
|
PR triage: category=bug | risk=low | total=42 | breakdown=impact 20, urgency 8, quality 14 | action=auto_merge | batch=pr-batch:quality-copilot
|
|
🎉 This pull request is included in a new release. Release: |

Blocked-label checks could miss case or Unicode variants, while run-step sanitization needed explicit coverage for expressions in comments and expanding heredocs.
replace_label.