Skip to content

Dispatch a dedicated PR Finisher from PR Sous Chef - #74166

Merged
pelikhan merged 3 commits into
mainfrom
copilot/update-pr-sous-chef-workflow
Nov 2, 2026
Merged

pelikhan merged 3 commits into
mainfrom
copilot/update-pr-sous-chef-workflow

Conversation

Copilot AI commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Replace Sous Chef’s Copilot mention/assignment delegation with a dedicated pr-finisher workflow that applies PR feedback and pushes fixes to the existing branch, excluding compiled workflow YAML.

  • Dispatch: Allowlist pr-finisher on main; pass the PR number and work summary explicitly rather than inheriting the caller’s PR context.
  • Trust and publication: Require approved integrity, validate PR eligibility, and attach the PR branch at its pinned head SHA. Publish through scoped safe outputs with workflow YAML excluded and replacement-PR fallback disabled.
  • Deduplication and review safety: Track active finishers by PR number, preserve legacy fingerprints, and allow retries after failed publication. Defer implementation-dependent thread resolution until fixes are confirmed in the published PR head.

Copilot AI changed the title Dispatch dedicated PR Finisher from PR Sous Chef Dispatch a dedicated PR Finisher from PR Sous Chef Nov 2, 2026
Copilot AI requested a review from pelikhan November 2, 2026 15:26
engine: copilot
timeout-minutes: 45
env:
PR_FINISHER_WORK_SUMMARY: ${{ inputs.work_summary }}
`ACTION_REQUIRED` checks outside the approval allowlist to Copilot: those need
a human, not another implementation pass.
Run `node scripts/pr-sous-chef.mjs <N> --simulate` for the final refresh and
copy its `nudges[0].body` exactly into the safe-output comment. An empty `nudges`
means no implementation nudge is needed. This command is read-only: it generates
use its `nudges[0].pr_number` as `inputs.pr_number` and its `nudges[0].body`
Comment thread scripts/pr-sous-chef.mjs
@@ -427,11 +437,11 @@ export function formatNudge(pr) {
if (pr.zero_diff_stalled) tasks.push("Implement the requested change, or close this zero-diff PR with a reason.");
return [
marker,
"@copilot address the following outstanding work in one pass:",
"PR finisher dispatch requested for the following outstanding work:",
@pelikhan

pelikhan commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

@pelikhan
pelikhan marked this pull request as ready for review November 2, 2026 15:49
Copilot AI adaptive review requested due to automatic review settings November 2, 2026 15:49
path: /tmp/gh-aw/agent
safe-outputs:
needs: [prefilter]
dispatch-workflow:
Comment thread scripts/pr-sous-chef.mjs
...tasks.map((task, index) => `${index + 1}. ${task}`),
"",
"Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.",
"The dedicated pr-finisher workflow will apply the necessary fixes, 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 trigger CI.",
engine: copilot
timeout-minutes: 45
env:
PR_FINISHER_WORK_SUMMARY: ${{ inputs.work_summary }}
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated from Ponytail Reviewer · gpt56 · ~11 AIC · ⌖ ~6 AIC · ⊞ 15.1K · ◷

Generated by Ponytail Reviewer for #74166

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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: reported_no_action

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.

Generated from Design Decision Gate 🏗️ · routed: opus55 medium · ~12 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Request changes

The changed workflows still expose two merge-blocking risks already captured by the existing review threads: attacker-controlled review/comment text is passed through work_summary into the Finisher prompt, and Sous Chef can dispatch an arbitrary eligible PR number rather than a deterministically prefiltered target. These can turn untrusted PR content into agent instructions and allow unintended branch writes. Please resolve those existing findings before merging.

The specialist pass was unavailable because its file-read tool invocation was rejected; this review is based on the prefetched diff and existing review comments.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⊞ 1.7K
Comment /review to run again

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🧪 Test Quality Sentinel Report

Summary

✅ Score: 88/100 | Status: APPROVED

Metric Result
Test Count 80 behavioral tests
Total Assertions 229
Error Coverage 14 error assertions
Async Tests 28
Implementation Tests 0% (all behavioral)
Test Inflation Ratio 6.93x (exceeds 2:1)

Test Classification

Test Quality Analysis

All 80 tests are behavioral tests validating design invariants:

High-Value Patterns:

  • ✅ Table-driven error case testing (e.g., invalid PR states, bot logins)
  • ✅ State machine verification (fingerprint unchanged/changed logic)
  • ✅ Workflow YAML contract validation
  • ✅ API rate limiting and budget boundaries
  • ✅ Comprehensive edge cases (7+ invalid PR state variations per test)

Error Assertions:

  • Error rejection cases for invalid PR numbers
  • Workflow dispatch precondition validation
  • API failure handling with retry semantics

Mock Strategy:

  • Uses Node.js built-in t.mock (no forbidden mock libraries)
  • External I/O mocking is appropriate and paired with output verification

Inflation Context

The 6.93x test-to-production ratio (104 lines added to test, 15 to production) exceeds the 2:1 guideline, but is justified: The new finisher dispatch feature requires extensive YAML workflow validation and state machine verification that naturally produces verbose test code. No duplication detected across test cases.

Quality Signals

✅ No implementation-focused tests
✅ No mock library violations
✅ No build-tag violations
✅ Comprehensive error case coverage
✅ All assertions have descriptive context
✅ Edge cases systematically tested


Verdict: Tests demonstrate strong behavioral coverage of the PR Finisher dispatch logic. Inflation is justified by workflow complexity.

🧪 Test quality analysis by Test Quality Sentinel · copilot · haiku45 · ~34 AIC · ⊞ 9.2K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

✅ Test Quality Sentinel: 88/100. 0% implementation tests (threshold: 30%). All 80 tests are behavioral with comprehensive edge-case coverage. Test inflation (6.93x) is justified by YAML workflow validation complexity.

🧪 Test quality analysis by Test Quality Sentinel · copilot · haiku45 · ~34 AIC · ⊞ 9.2K
Comment /review to run again

@pelikhan
pelikhan merged commit eaa06c9 into main Nov 2, 2026
108 checks passed
@pelikhan
pelikhan deleted the copilot/update-pr-sous-chef-workflow branch November 2, 2026 16:01

Copilot AI commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Ran the PR Finisher pass. Local formatting, lint, and impacted unit-test checks passed; no files changed. No in-scope review threads were found. CI checks are still running on the current head, and GitHub reports mergeability as unstable until they finish.

Copilot AI restored the copilot/update-pr-sous-chef-workflow branch November 2, 2026 16:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The finisher dispatch uses an unsupported safe-output command, while unresolved publication and deduplication flaws can trigger CI, leave PRs unchanged, or repeatedly requeue the same work.

8 open issues
What changed in this PR

Moves PR Sous Chef’s implementation delegation to a dedicated gh-aw PR Finisher workflow for updating existing pull requests.

Changes:

  • Replaces Copilot mentions with main-branch dispatches carrying explicit PR numbers and work summaries.
  • Adds PR eligibility checks, pinned checkouts, scoped publication excluding workflow YAML, and deferred review-thread resolution.
  • Extends active-run detection, state deduplication, and regression coverage.
File Description
scripts/​pr-sous-chef.test.mjs Adds dispatch, deduplication, and finisher eligibility tests.
scripts/​pr-sous-chef.mjs Updates delegation summaries and finisher run/state detection.
.github/​workflows/​pr-sous-chef.md Configures finisher dispatch and approved-integrity access.
.github/​workflows/​pr-sous-chef.lock.yml Compiles the updated dispatcher configuration.
.github/​workflows/​pr-finisher.md Defines PR validation, implementation, publication, and review handling.
.github/​workflows/​pr-finisher.lock.yml Provides the executable compiled finisher workflow.

Review effort: Max (auto)

Comment on lines +235 to +237
dispatch of the dedicated `pr-finisher` workflow with `inputs.pr_number` set
to this eligible PR number. Use only `safeoutputs dispatch_workflow`, never
`assign_to_agent`, a direct API write, or an `@copilot` mention.
throw new Error("pr_number must be a positive integer");
}
const { data: pr } = await github.rest.pulls.get({ ...context.repo, pull_number: number });
if (pr.state !== "open" || pr.draft || pr.head.repo?.full_name !== process.env.GITHUB_REPOSITORY ||
Comment on lines +105 to +106
safe-outputs:
needs: [preflight]
Comment on lines +107 to +108
push-to-pull-request-branch:
target: ${{ needs.preflight.outputs.pr_number }}
Comment on lines +110 to +111
exclude-lock-yml: true
excluded-files: [".github/workflows/*.yml", ".github/workflows/*.yaml"]
exclude-lock-yml: true
excluded-files: [".github/workflows/*.yml", ".github/workflows/*.yaml"]
protected-files: fallback-to-issue
fallback-as-pull-request: false
## One bounded implementation pass

1. Read the PR state, review threads and latest checks once and reuse that snapshot.
Stop with `noop` if it is closed, draft, opted out, or no actionable work remains.
Comment thread scripts/pr-sous-chef.mjs
function isNudge(comment) {
return isSousChefComment(comment) && (comment.body ?? "").includes("@copilot");
const body = comment.body ?? "";
if (/The code changes were not applied\.|a fallback review issue was created instead due to protected file changes:|Direct push to the original pull request branch was not possible/.test(body)) return false;
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.0

@github-actions
github-actions Bot deleted the copilot/update-pr-sous-chef-workflow branch November 10, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants