What happened
PR #26 in konflux-ci/refinement added a judge-score gate to AGENTS.md and docs/agents/retro-filing.md (merged 15:52 UTC). When the retro dispatched on PR #26's merge (run 30467986234, ~16:10 UTC), the checkout resolved to 3fa40d5 — the base branch HEAD before the merge commit bf2445e landed. The retro agent ran against the pre-merge repo state: AGENTS.md still had the old pirate-voice instructions (from PR #23), docs/agents/retro-filing.md did not exist in the working tree, and the judge-score gate was invisible. The retro filed agents#528 without applying the scoring rubric. This prompted a follow-up PR #27 to add the gate as a harness skill override — but even that approach is subject to the same checkout-ref issue for the retro analyzing PR #27 itself (.fullsend/skills/retro-filing-policy/ and .fullsend/harness/retro.yaml are also read from the checked-out tree).
What could go better
Judge score: 3/5 — Actionable process gap. The retro dispatch resolves its checkout ref from github.sha, which for pull_request_target events GitHub defines as the base branch HEAD at event creation time — not the merge commit. This is the same class of bug as #5378 (which fixes action.yml reconcile-status) but affects a different code path: the checkout step in the retro stage of reusable-dispatch.yml. For the retro stage specifically, checking out the pre-merge ref means the agent cannot see AGENTS.md changes, .fullsend/ config modifications, or skill additions introduced by the merged PR. The retro needs the latest governance config to guide its own filing behavior, even though it analyzes a workflow that ran under the old config. Evidence: workflow logs show HEAD is now at 3fa40d5 in all jobs of run 30467986234, 18 minutes after the merge commit bf2445e landed. Confidence is moderate — the stale checkout is clearly evidenced in logs, but there is some possibility this is intentional design (retro should see the as-was state). The functional impact argues against that interpretation: the retro's own behavioral guidance (AGENTS.md instructions, filing skills) should reflect the current repo state.
Proposed change
In the retro dispatch path of reusable-dispatch.yml, when the trigger event is pull_request_target with action closed and github.event.pull_request.merged == true, use github.event.pull_request.merge_commit_sha as the checkout ref instead of github.sha. This ensures the retro agent sees the post-merge repo state including AGENTS.md, .fullsend/ config, and skill files. Other agent stages (review, code, fix) should continue using the PR head SHA (github.event.pull_request.head.sha) as they operate on pre-merge state. Related to #5378 (same github.sha root cause, different fix location and different impacted code path).
Validation criteria
The next 3 retro runs triggered by PR merges in repos with per-repo install mode should check out a ref that includes the merged PR's changes. Verify by checking the HEAD is now at log line in the retro job — the commit should be the merge commit or a descendant, not a pre-merge ancestor. Additionally, a retro on a PR that modifies AGENTS.md should show evidence of reading the updated AGENTS.md (not the pre-merge version) in its reasoning trace.
Generated by retro agent from https://github.com/konflux-ci/refinement/pull/27
What happened
PR #26 in konflux-ci/refinement added a judge-score gate to AGENTS.md and docs/agents/retro-filing.md (merged 15:52 UTC). When the retro dispatched on PR #26's merge (run 30467986234, ~16:10 UTC), the checkout resolved to
3fa40d5— the base branch HEAD before the merge commitbf2445elanded. The retro agent ran against the pre-merge repo state: AGENTS.md still had the old pirate-voice instructions (from PR #23),docs/agents/retro-filing.mddid not exist in the working tree, and the judge-score gate was invisible. The retro filed agents#528 without applying the scoring rubric. This prompted a follow-up PR #27 to add the gate as a harness skill override — but even that approach is subject to the same checkout-ref issue for the retro analyzing PR #27 itself (.fullsend/skills/retro-filing-policy/and.fullsend/harness/retro.yamlare also read from the checked-out tree).What could go better
Judge score: 3/5 — Actionable process gap. The retro dispatch resolves its checkout ref from
github.sha, which forpull_request_targetevents GitHub defines as the base branch HEAD at event creation time — not the merge commit. This is the same class of bug as #5378 (which fixesaction.ymlreconcile-status) but affects a different code path: the checkout step in the retro stage ofreusable-dispatch.yml. For the retro stage specifically, checking out the pre-merge ref means the agent cannot see AGENTS.md changes,.fullsend/config modifications, or skill additions introduced by the merged PR. The retro needs the latest governance config to guide its own filing behavior, even though it analyzes a workflow that ran under the old config. Evidence: workflow logs showHEAD is now at 3fa40d5in all jobs of run 30467986234, 18 minutes after the merge commitbf2445elanded. Confidence is moderate — the stale checkout is clearly evidenced in logs, but there is some possibility this is intentional design (retro should see the as-was state). The functional impact argues against that interpretation: the retro's own behavioral guidance (AGENTS.md instructions, filing skills) should reflect the current repo state.Proposed change
In the retro dispatch path of
reusable-dispatch.yml, when the trigger event ispull_request_targetwith actionclosedandgithub.event.pull_request.merged == true, usegithub.event.pull_request.merge_commit_shaas the checkout ref instead ofgithub.sha. This ensures the retro agent sees the post-merge repo state including AGENTS.md,.fullsend/config, and skill files. Other agent stages (review, code, fix) should continue using the PR head SHA (github.event.pull_request.head.sha) as they operate on pre-merge state. Related to #5378 (samegithub.sharoot cause, different fix location and different impacted code path).Validation criteria
The next 3 retro runs triggered by PR merges in repos with per-repo install mode should check out a ref that includes the merged PR's changes. Verify by checking the
HEAD is now atlog line in the retro job — the commit should be the merge commit or a descendant, not a pre-merge ancestor. Additionally, a retro on a PR that modifies AGENTS.md should show evidence of reading the updated AGENTS.md (not the pre-merge version) in its reasoning trace.Generated by retro agent from https://github.com/konflux-ci/refinement/pull/27