Skip to content

fix(pr-sous-chef): deterministic nudge spam filter via hidden marker#32628

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-deterministic-spam-filter
May 16, 2026
Merged

fix(pr-sous-chef): deterministic nudge spam filter via hidden marker#32628
pelikhan merged 3 commits into
mainfrom
copilot/fix-deterministic-spam-filter

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

pr-sous-chef was suppressing repeat nudges using fuzzy text matching ("pr-sous-chef" in latest comment), which is non-deterministic and vulnerable to false positives/negatives. This change makes repeat-detection deterministic by requiring and checking a dedicated hidden marker in sous-chef-generated nudges.

  • Deterministic latest-comment filter

    • Replaced freeform string matching with exact marker detection in the candidate prefilter.
    • Added a single marker constant used by the filter:
      • <!-- gh-aw-pr-sous-chef-nudge -->
  • Prompt contract update for nudge generation

    • Updated workflow instructions so every sous-chef nudge comment includes the hidden marker.
    • Updated skip-rule wording to explicitly key off marker presence in the latest comment.
  • Compiled workflow parity

    • Applied the same logic change to both source and compiled workflow files:
      • .github/workflows/pr-sous-chef.md
      • .github/workflows/pr-sous-chef.lock.yml
sous_chef_nudge_marker='<!-- gh-aw-pr-sous-chef-nudge -->'

last_comment_is_sous_chef="$(
  gh api "repos/$GH_AW_GITHUB_REPOSITORY/issues/$pr_number/comments?per_page=1&sort=created&direction=desc" \
    --jq '
      if length == 0 then false
      else ((.[0].body // "" | contains($marker))) end
    ' --arg marker "$sous_chef_nudge_marker" 2>/dev/null || echo "false"
)"

Copilot AI and others added 2 commits May 16, 2026 14:50
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix non-deterministic spam filter in PR Sous Chef fix(pr-sous-chef): deterministic nudge spam filter via hidden marker May 16, 2026
@pelikhan pelikhan marked this pull request as ready for review May 16, 2026 14:56
Copilot AI review requested due to automatic review settings May 16, 2026 14:56
@pelikhan pelikhan merged commit 0453cc7 into main May 16, 2026
@pelikhan pelikhan deleted the copilot/fix-deterministic-spam-filter branch May 16, 2026 14:56
Copilot AI requested a review from pelikhan May 16, 2026 14:57
Copilot stopped work on behalf of pelikhan due to an error May 16, 2026 14:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces fuzzy pr-sous-chef repeat-nudge detection with a hidden marker-based check and updates the workflow prompt to require that marker in generated nudges.

Changes:

  • Adds a hidden nudge marker variable to the PR candidate prefilter.
  • Updates latest-comment filtering to look for the marker.
  • Updates sous-chef prompt instructions and compiled workflow parity.
Show a summary per file
File Description
.github/workflows/pr-sous-chef.md Adds marker-based filtering and prompt contract updates.
.github/workflows/pr-sous-chef.lock.yml Mirrors the compiled workflow changes for marker-based filtering.
pkg/workflow/safe_jobs_threat_detection_test.go Removes an extra blank line.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

' 2>/dev/null || echo "false"
((.[0].body // "" | contains($marker)))
) end
' --arg marker "$sous_chef_nudge_marker" 2>/dev/null || echo "false"
((.[0].body // "" | contains($marker)))
) end
' 2>/dev/null || echo "false"
' --arg marker "$sous_chef_nudge_marker" 2>/dev/null || echo "false"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[q] fix(pr-sous-chef): deterministic spam filter using marker

3 participants