Skip to content

Preserve durable provenance for superseded PR reviews - #63496

Open
pelikhan with Copilot wants to merge 12 commits into
mainfrom
copilot/preserve-review-provenance-marker
Open

pelikhan with Copilot wants to merge 12 commits into
mainfrom
copilot/preserve-review-provenance-marker

Conversation

Copilot AI commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

GitHub strips HTML comment markers from submitted PR review bodies, preventing supersede-older-reviews from identifying prior blocking reviews created by the same workflow.

  • Durable provenance

    • Add a non-rendered Markdown reference marker alongside the legacy HTML marker.
    • Encode the caller workflow ID safely in the marker.
  • Safe supersession matching

    • Match complete legacy or durable marker lines only.
    • Decode durable marker IDs before comparison.
    • Keep caller-specific matching to avoid dismissing reviews from workflows sharing a reusable implementation.
[gh-aw-workflow-call-id]: # "owner%2Frepo%2Fcritic-review"
  • Regression coverage
    • Cover durable marker generation, encoding, exact matching, and cross-workflow isolation.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 47.4 AIC · ⌖ 8.85 AIC · ⊞ 9.6K · ◷
Comment /souschef to run again


pr-sous-chef branch refresh requested from run https://github.com/github/gh-aw/actions/runs/36221620757

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 29.7 AIC · ⌖ 8.89 AIC · ⊞ 9.5K · ◷
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 23.1 AIC · ⌖ 8.45 AIC · ⊞ 9.5K · ◷
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 22.7 AIC · ⌖ 8.62 AIC · ⊞ 9.7K · ◷
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 20.7 AIC · ⌖ 8.54 AIC · ⊞ 9.7K · ◷
Comment /souschef to run again


pr-sous-chef branch refresh requested by https://github.com/github/gh-aw/actions/runs/36255219324

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 19.1 AIC · ⌖ 8.58 AIC · ⊞ 9.7K · ◷
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 26.1 AIC · ⌖ 8.97 AIC · ⊞ 9.5K · ◷
Comment /souschef to run again


pr-sous-chef

Branch refresh requested by PR Sous Chef run: https://github.com/github/gh-aw/actions/runs/36260722205

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 19.5 AIC · ⌖ 9.41 AIC · ⊞ 9.3K · ◷
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 15.7 AIC · ⌖ 11.6 AIC · ⊞ 9.7K · ◷
Comment /souschef to run again

Copilot AI and others added 5 commits September 25, 2026 19:27
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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 missing review provenance marker for supersede-older-reviews Preserve durable provenance for superseded PR reviews Sep 25, 2026
Copilot AI requested a review from pelikhan September 25, 2026 19:33
@pelikhan
pelikhan marked this pull request as ready for review September 25, 2026 20:24
Copilot AI balanced review requested due to automatic review settings September 25, 2026 20:24
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Sep 25, 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.

No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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

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

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #63496

@github-actions

Copy link
Copy Markdown
Contributor

🔎 PR Code Quality Reviewer is reviewing code quality for this pull request...

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.

Copilot review overview

🟡 Changes recommended

Footer-disabled reviews still omit provenance, preventing subsequent supersession.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds durable workflow provenance to PR reviews so superseded blocking reviews can be identified after GitHub removes HTML markers.

Changes:

  • Adds encoded Markdown provenance markers and exact matching.
  • Uses durable markers when superseding reviews.
  • Adds regression coverage for encoding and workflow isolation.
File Description
actions/​setup/​js/​generate_footer.cjs Generates and matches durable markers.
actions/​setup/​js/​generate_footer.test.cjs Tests marker encoding and matching.
actions/​setup/​js/​pr_review_buffer.cjs Adds markers and uses them during supersession.
actions/​setup/​js/​pr_review_buffer.test.cjs Tests review submission and isolation.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread actions/setup/js/pr_review_buffer.cjs Outdated
const callerWorkflowId = process.env.GH_AW_CALLER_WORKFLOW_ID || "";
if (callerWorkflowId) {
body += "\n" + generateWorkflowCallIdMarker(callerWorkflowId);
body += "\n" + generateWorkflowCallIdMarker(callerWorkflowId) + "\n" + generateWorkflowCallIdReviewMarker(callerWorkflowId);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 0e9a9ec: caller provenance markers are now emitted whenever GH_AW_CALLER_WORKFLOW_ID is set, independent of shouldAddFooter/footerContext. Added a test for footer: none with an empty REQUEST_CHANGES body.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

test

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 40.8 AIC · ⌖ 6.99 AIC · ⊞ 20.3K · ◷
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.

Verdict

I didnt find a blocking regression in the changed lines.

What I checked
  • Durable marker generation and round-trip matching.
  • Exact-line matching to avoid accidental supersession.
  • Added tests covering encoding and cross-workflow isolation.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 40.8 AIC · ⌖ 6.99 AIC · ⊞ 20.3K
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.

Skills-Based Review 🧠

Applied /codebase-design and /tdd — solid regression coverage for the new durable marker, with a couple of maintainability/documentation nits.

📋 Key Themes & Highlights

Key Themes

  • Marker-matching duplication: matchesWorkflowCallId re-implements the line-split/trim/compare pattern that likely already exists for matchesWorkflowId. A shared primitive would reduce drift as more marker formats are added.
  • Dual-marker write is undocumented: The review body now always carries both the legacy HTML-comment marker and the new durable Markdown-reference marker. It's unclear from the code whether this is permanent (for older-review compatibility) or a migration step to be removed later — worth a comment or follow-up note.
  • No changeset: This repo uses .changeset/*.md for patch notes (confirmed via existing changesets like patch-add-workflow-call-id-marker.md), but this PR doesn't add one. Given this fixes a real bug (#63264) affecting supersede-older-reviews, a changeset entry would help release notes.

Positive Highlights

  • ✅ Good regression coverage: exact-match tests for legacy marker, durable marker, case-insensitive percent-encoding, non-standalone-line rejection, and cross-workflow isolation (CallerA vs CallerB).
  • ✅ Defensive decodeURIComponent wrapped in try/catch — malformed percent-encoding fails closed (returns false) rather than throwing, verified manually.
  • ✅ Root cause is correctly addressed at the source (encoding scheme that survives GitHub's HTML-comment stripping in review bodies) rather than patched around symptoms.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 68.6 AIC · ⌖ 15.7 AIC · ⊞ 10.1K
Comment /matt to run again

* @param {string} callerWorkflowId - Calling workflow identifier
* @returns {boolean} Whether the review belongs to the calling workflow
*/
function matchesWorkflowCallId(body, callerWorkflowId) {

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.

[/codebase-design] matchesWorkflowCallId duplicates the same body-scanning logic that matchesWorkflowId (below, unseen in this diff) already implements for the legacy marker. Consider factoring a shared matchesExactMarkerLine(body, marker) helper so both functions share one line-matching primitive instead of re-implementing split/trim/compare independently, reducing future drift when a third marker format is added.

💡 Suggested shape
function matchesExactMarkerLine(body, marker) {
  if (!body || !marker) return false;
  return body.split((r/redacted)?\n/).some(line => line.trim() === marker);
}

Then matchesWorkflowCallId could call this for the legacy check and layer the durable-marker regex check on top.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 0e9a9ec: added someMarkerLine/matchesExactMarkerLine helpers. matchesWorkflowCallId now uses them for both the legacy check and the durable regex check. I left matchesWorkflowId as it is because it uses substring matching on purpose for the combined XML marker format.

Comment thread actions/setup/js/pr_review_buffer.cjs Outdated
const callerWorkflowId = process.env.GH_AW_CALLER_WORKFLOW_ID || "";
if (callerWorkflowId) {
body += "\n" + generateWorkflowCallIdMarker(callerWorkflowId);
body += "\n" + generateWorkflowCallIdMarker(callerWorkflowId) + "\n" + generateWorkflowCallIdReviewMarker(callerWorkflowId);

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.

[/tdd] Both markers (legacy HTML comment + durable Markdown reference) are now always appended together, doubling provenance metadata in every review body going forward. Is the legacy <!-- gh-aw-workflow-call-id --> marker still needed once the durable one is in place, or is this only kept for a migration window? If it's a permanent dual-write, a comment explaining why (e.g. backward compatibility with older superseding logic reading old reviews) would help future readers; if temporary, consider tracking removal in a follow-up issue/changeset.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a permanent dual-write. Other safe outputs share the legacy HTML marker and it is still read from older reviews. The durable marker is needed because GitHub strips HTML comments from submitted review bodies. I added a code comment explaining this in 0e9a9ec.

@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.

Impeccable Skills Review — Selected modes: harden, audit (bug_fix: matcher/marker regression fix)

Reviewed the diff manually (line-by-line + a standalone Node harness replicating matchesWorkflowCallId's exact-line matching, percent-decoding, and error handling) since npm ci in this sandbox failed on a self-signed-cert network restriction and vitest could not be installed/run.

Findings: none blocking.

  • matchesWorkflowCallId correctly requires an exact trimmed-line match for both the legacy HTML marker and the new durable [gh-aw-workflow-call-id]: # "..." reference marker, so a marker embedded mid-sentence (e.g. "Quoted [...]") is correctly rejected — verified against the test's Quoted ... case.
  • Percent-decoding via decodeURIComponent is wrapped in try/catch, so a malformed encoded value degrades safely to no-match instead of throwing.
  • The old workflowCallMarker/body.includes(...) substring-matching logic (which could have false-matched a caller ID that is a prefix of another) was fully removed with no orphaned references left in pr_review_buffer.cjs.
  • Both markers are appended together in submitReview, preserving backward compatibility for any external tooling still scanning for the legacy HTML comment.
  • Test coverage added is good: durable marker generation/encoding, exact-line matching (including case-insensitive percent-encoding and cross-workflow isolation), and an integration-level supersede test using the new durable marker.

No inline comments needed — no actionable issues found.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 61.7 AIC · ⌖ 13.2 AIC · ⊞ 8.1K

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot There is still forward progress needed on this PR.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 47.4 AIC · ⌖ 8.85 AIC · ⊞ 9.6K · ◷
Comment /souschef to run again

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot There is still forward progress needed on this PR.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 29.7 AIC · ⌖ 8.89 AIC · ⊞ 9.5K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot There is still forward progress needed on this PR.

Generated by 👨🍳 PR Sous Chef

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 22.7 AIC · ⌖ 8.62 AIC · ⊞ 9.7K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot There is still forward progress needed on this PR.

Generated by 👨🍳 PR Sous Chef

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 35.9 AIC · ⌖ 8.65 AIC · ⊞ 9.2K · ◷
Comment /souschef to run again

@github-actions

Copy link
Copy Markdown
Contributor

Excellent work! 🎉 This PR looks great and is ready for review. You've successfully implemented durable provenance markers for PR review supersession that will survive GitHub's HTML comment stripping.

What stands out:

  • Clean implementation of the durable Markdown reference marker alongside the legacy HTML comment
  • Comprehensive test coverage including encoding/decoding edge cases and cross-workflow isolation scenarios
  • Clear separation of concerns with new helper functions (generateWorkflowCallIdReviewMarker, matchesWorkflowCallId)
  • Thorough regression coverage ensuring backwards compatibility with legacy markers

The PR is well-focused, includes all necessary tests, and the implementation is solid. This is ready for merge! 🚀

Generated by ✅ Contribution Check · copilot · auto · 40.8 AIC · ⌖ 5.69 AIC · ⊞ 9.1K · ◷

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot There is still forward progress needed on this PR.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 26.1 AIC · ⌖ 8.97 AIC · ⊞ 9.5K · ◷
Comment /souschef to run again

Copilot AI commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Ran pr-finisher. All open review threads were already addressed in 0e9a9ec; local make fmt, make lint, and the JS test suite pass (one unrelated pre-existing flaky test aside). No further code changes needed from my side — the PR just needs a human to re-trigger CI and merge.

@copilot There is still forward progress needed on this PR.

  • Please address the remaining open review feedback, newest first:...

All three threads were already resolved in 0e9a9ec (verified again this pass — matchesWorkflowCallId/matchesExactMarkerLine shared helper, the dual-write rationale comment, and the footer-independent provenance emission are all present in actions/setup/js/generate_footer.cjs and actions/setup/js/pr_review_buffer.cjs). make fmt, make lint, and the JS test suite (14361 tests) pass locally with no new changes needed; the single failing test in the full run (safe_outputs_mcp_large_content.test.cjs) is a pre-existing flake unrelated to this PR (passes in isolation). Ran pr-finisher — no further code changes required from my side; the PR's mergeable_state is blocked pending human review/CI re-trigger.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot There is still forward progress needed on this PR.

  • The latest reply says the code is complete, but the PR is still blocked pending human review/CI re-trigger.
  • Please summarize any maintainer-only next step in the PR and re-run the pr-finisher skill if there is still unresolved review state on the current head.
  • A branch refresh was requested from sous-chef for this run: https://github.com/github/gh-aw/actions/runs/36260722205

Generated by 👨🍳 PR Sous Chef

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 19.5 AIC · ⌖ 9.41 AIC · ⊞ 9.3K · ◷
Comment /souschef to run again

Copilot AI commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

pr-sous-chef
@copilot There is still forward progress needed on this PR.
...

I re-ran pr-finisher on head 594e652. I made no code changes this time.

Review threads: there are three open threads, and I replied to all of them in 0e9a9ec:

  • r4108375564: provenance is now written even when the footer is off.
  • r4108416780: I added the shared matchesExactMarkerLine helper.
  • r4108416785: I added a comment explaining why both markers are written.

They are still marked unresolved because I have no tool to resolve threads.

Checks: only copilot (still running) and github-advanced-security (passed) have run on the current head. The full CI suite, including the conclusion job that failed earlier, hasn't run yet.

What a maintainer needs to do:

  1. Approve or re-run CI on 594e652; agent pushes can't start it.
  2. Resolve the three threads after checking the fixes.
  3. Approve and merge. The PR shows as blocked only because it needs review, not because of conflicts.

This branch has not been deployed

No deployments
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.

Preserve review provenance marker for supersede-older-reviews

4 participants