Repository navigation
π fix(ci): native-queue-policy skips the evidence wait on cosmetic label flips - #16952
Conversation
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: pushed 9687acd β π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from Intent-alignment (delta re-review at PR body says "Fail-closed unchanged"; the cosmetic path never reads PR state or evidence. Requested change: on a cosmetic flip, still run Review findings from Intent alignment (#16945) β read at head f373ec9. The diff does solve the issue's stated goal (cosmetic label flips no longer spend the 22.5βmin wait), but the replay path fails closed where the pre-PR behaviour would have re-evaluated and passed:
Review findings from Style/conventions review (head f373ec9) β two concrete in-scope fixes requested.
Advisory (no action required): Review findings from Security re-review @ Still present (in-scope, high): a cosmetic label flip records a green required The delta also adds a doc sentence that is false for this path: Requested change (unchanged from the previous head): never let the job conclude Fixed since Review findings from Style re-review at head cef5709 (delta since 37a060b; branch was squashed, so the delta is the full PR). Previous findings: the New from the style perspective:
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. Review findings from Code looks correct to me; routing because it changes how a required merge-admission check reaches What I verified at
Two things for the author/approver, neither a defect:
Decision for Review findings from Code looks correct to me; routing because it changes how a required merge-gate check turns green. What I verified at
Body matches the diff; no claimed behaviour is missing. The one thing I will not decide: this is a required check in the native merge queue, and after this PR it can conclude |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
37a060b
βΉοΈ Sentinel notice β informational; author is trusted (hive agent), merge is not blockedHive flagged this PR (author @hivecommons-hive[bot], head
Hive did not add the |
There was a problem hiding this comment.
Style review (head 37a060b) β two in-scope fixes requested.
-
changelog.d/changed-native-queue-policy-cosmetic-label-early-exit.md:1has no-bullet and is a duplicate fragment.changelog.d/README.md("Content: exactly the entry itself β one-bullet") andsrc/scripts/check-changelog-fragment.sh:74reject it; CIchangelog-fragment-guard(job 128050358889) fails with exactly that message, andnative-queue-policythen fails downstream (Error: changelog-fragment-guard: failure).changelog.d/fixed-16952.mdalready covers the same change, and.github/changes are auto-exempt anyway. Fix: delete thechanged-β¦file and fold its operator-facing wording (which labels skip, which still wait) into thefixed-16952.mdbullet β that one is currently just the PR title and says nothing an operator can act on. -
isCosmeticLabelFlipis tested by grepping its source text, not by calling it..github/scripts/test-native-queue-workflows.py:87-89readsnative-queue-policy.cjsand asserts the literal strings['labeled', 'unlabeled'].includes(payload.action)/!BLOCKED_LABEL.test(payload.label.name)β the only.cjssource read in that file. Any refactor (e.g. aSet, orpayload.label?.name ?? '') breaks the test without changing behaviour, and no test exercises the function itself:native-queue-policy.test.cjshas 0 references to it despite the export atnative-queue-policy.cjs:282. Repo idiom for policy behaviour is that node test file (lines 118-385). Fix: drop the twoassertInlines on the helper source and add atest(...)innative-queue-policy.test.cjscoveringsize/Lβ true,hold/do-not-merge/fooβ false,synchronize/merge_group/missinglabelβ false.
β hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88
β¦l flips Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
37a060b to
cef5709
Compare
There was a problem hiding this comment.
Not safe to land as written: the skip path records a passing native-queue-policy on a head whose evidence was never (re)checked, which can overwrite a prior failure or hold on the same commit.
Mechanism (read from pr16952, not the diff alone):
.github/workflows/native-queue-policy.yml:42-53β on a cosmeticlabeled/unlabeledevent the new step setscosmetic=true, and:55skipsValidate exact-head evidence. Nothing else in the job can fail, so the job β and therefore the check run namednative-queue-policyforpull_request.head.shaβ concludessuccess. The body says so itself: "A skipped step concludes success, so the check passes."native-queue-policyis the required check on v5/v6 PR heads (src/docs/native-merge-queue.md:260-262). Required-check status is the latest check run of that name on the commit β the same rule this script applies to the providers it reads (.github/scripts/native-queue-policy.cjs:98,sort((a, b) => b.id - a.id)[0]).- So the sequence push β run 1 fails (
DCO: failure,gate: failure, orassertEligiblethrows on aholdlabel,cjs:89-93) β any bot addssize/M/stage/*/dco-signoff: yesβ run 2 is cosmetic β success leaves the head with a green required check and no evidence behind it. Withcancel-in-progress: false(yml:16-22) run 2 simply queues behind run 1 and lands last. - The
holdcase is the sharpest:assertEligiblereads current labels on every run (cjs:91). Today aholdplaced after a green run is enforced by the next re-fire, including a cosmetic one. After this change the next cosmetic flip reports success whileholdis still on the PR. That contradicts "Fail-closed unchanged" in the body.
The merge-group path (merge_group: checks_requested) still re-validates member heads, so a queue-enabled branch would catch it at group time β but the PR-level check is what admits a PR to the queue and is the only gate on non-queue branches (native-merge-queue.md:277), and the doc's own rule is "Do not add fake success statuses to get past it."
What would keep the saving without the hole: instead of skipping, have the cosmetic step look up the latest completed native-queue-policy check run on pull_request.head.sha (same checks.listForRef filter the script already uses at cjs:116) and replay its conclusion β core.setFailed when it was not success or when none exists β and still run assertEligible against the live PR so a current hold/draft/head-move is honoured. That is one API call instead of the 22.5-min wait and leaves the verdict identical to what a full run would produce.
Also blocking CI (changelog-fragment-guard, run 42263772251): changelog.d/fixed-16952.md does not start with a - bullet, and there are two fragments for one change (changed-native-queue-policy-cosmetic-label-early-exit.md + fixed-16952.md); keep one, as a bullet.
Routing: this edits a required-check workflow on a trust surface, so even with the fix above @clubanderson should confirm the replay semantics before it lands. I have not changed or closed anything.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Review fix attempt 1/6 β needs a maintainer push (workflow file)The fix for the fail-open findings is ready as a single signed-off commit, but the App token cannot push it: What the commit changes (on top of
Verified locally: To apply: save the patch below and 16952-fix-attempt-1.patchFrom 6d615b79a61cbe8fc1280034a5de6f4865f47255 Mon Sep 17 00:00:00 2001
From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Fri, 6 Nov 2026 12:54:16 -0500
Subject: [PATCH] fix(ci): cosmetic label flips shorten the native-queue-policy
wait, never the verdict
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Review of #16952 found the `if:` gate concluded the required check as
success without calling evaluate(): a size/*, dco-signoff or stage-label
flip could overwrite a failing, held, missing-evidence or
provider-unavailable verdict on the same head (fail-open).
The gate step is gone. The validate step always runs evaluate(); a
cosmetic flip only asks waitAttempts() for a short budget (4 Γ 15 s,
still absorbing one transient 5xx), and only when the exact head already
has a completed native-queue-policy verdict from the Actions App. A head
whose synchronize run was collapsed behind an in-flight run keeps the
full 22.5-min wait, so a flip can never steal the first verdict.
Tests: node unit cases for isCosmeticLabelFlip (BLOCKED_LABEL is
case-insensitive, non-label actions/events and missing payload.label
are not cosmetic), for waitAttempts (prior-verdict, App, head, status
and filter=all), and redβcosmeticβstill-red for held/failing/missing/
UNKNOWN heads. The Python contract test asserts workflow shape instead
of grepping .cjs source. Docs updated; single `- ` changelog fragment.
Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
.github/scripts/native-queue-policy.cjs | 32 +++++-
.github/scripts/native-queue-policy.test.cjs | 104 +++++++++++++++++-
.../scripts/test-native-queue-workflows.py | 31 +++---
.github/workflows/native-queue-policy.yml | 23 ++--
...-queue-policy-cosmetic-label-early-exit.md | 1 -
changelog.d/fixed-16952.md | 1 +
src/docs/native-merge-queue.md | 11 +-
7 files changed, 169 insertions(+), 34 deletions(-)
delete mode 100644 changelog.d/changed-native-queue-policy-cosmetic-label-early-exit.md
create mode 100644 changelog.d/fixed-16952.md
diff --git a/.github/scripts/native-queue-policy.cjs b/.github/scripts/native-queue-policy.cjs
index 06df72e..dc95781 100644
--- a/.github/scripts/native-queue-policy.cjs
+++ b/.github/scripts/native-queue-policy.cjs
@@ -221,11 +221,38 @@ async function evaluate(args) {
// reads (BLOCKED_LABEL); every other flip cannot change the verdict.
function isCosmeticLabelFlip({ eventName, payload }) {
return eventName === 'pull_request_target' &&
- ['labeled', 'unlabeled'].includes(payload.action) &&
+ ['labeled', 'unlabeled'].includes(payload?.action) &&
typeof payload.label?.name === 'string' &&
!BLOCKED_LABEL.test(payload.label.name);
}
+// Bounded wait for PR providers: 90 Γ 15 s = 22.5 min. A cosmetic label flip
+// (#16945) shortens only this budget, never the verdict: evaluate() still
+// runs, so a failing, held or provider-unavailable head stays red. The short
+// budget still absorbs one transient 5xx (#16258). It applies only when this
+// exact head already carries a completed native-queue-policy verdict; a head
+// whose synchronize run was collapsed behind an in-flight run by the per-PR
+// concurrency group has never been judged and must get the full wait.
+const WAIT_ATTEMPTS = 90;
+const COSMETIC_FLIP_ATTEMPTS = 4;
+const POLICY_CHECK_NAME = 'native-queue-policy';
+
+async function hasCompletedVerdict(github, repo, head) {
+ // filter 'latest' would hide every prior verdict behind this in-progress run.
+ const runs = await github.paginate(github.rest.checks.listForRef, {
+ ...repo, ref: head, per_page: 100, filter: 'all', check_name: POLICY_CHECK_NAME,
+ });
+ return runs.some(run => run.name === POLICY_CHECK_NAME && run.app?.id === ACTIONS_APP_ID &&
+ run.head_sha === head && run.status === 'completed');
+}
+
+async function waitAttempts({ github, context }) {
+ if (!isCosmeticLabelFlip(context)) return WAIT_ATTEMPTS;
+ const head = context.payload.pull_request?.head?.sha;
+ if (!SHA.test(head)) return WAIT_ATTEMPTS;
+ return await hasCompletedVerdict(github, context.repo, head) ? COSMETIC_FLIP_ATTEMPTS : WAIT_ATTEMPTS;
+}
+
async function evaluateOnce({ github, context }) {
const repo = context.repo;
if (context.eventName === 'pull_request_target') {
@@ -279,7 +306,8 @@ async function evaluateOnce({ github, context }) {
module.exports = {
ACTIONS_APP_ID, DCO_APP_ID, POLICY_CHECKS, BUILD_CHECKS,
PendingEvidence, membersForGroup, assertEligible, evidenceForHead, closedNoop, evaluate,
- isTransientAPIError, isCosmeticLabelFlip, BLOCKED_LABEL,
+ isTransientAPIError, isCosmeticLabelFlip, waitAttempts, BLOCKED_LABEL,
+ WAIT_ATTEMPTS, COSMETIC_FLIP_ATTEMPTS, POLICY_CHECK_NAME,
ProviderUnavailable,
DCO_ENUMERATION_SUMMARY_PREFIX, DCO_ENUMERATION_SUMMARY_FALLBACK,
DCO_PROVIDER_UNAVAILABLE_TEXT, DCO_PROVIDER_RUNBOOK,
diff --git a/.github/scripts/native-queue-policy.test.cjs b/.github/scripts/native-queue-policy.test.cjs
index 07e5eeb..f752f71 100644
--- a/.github/scripts/native-queue-policy.test.cjs
+++ b/.github/scripts/native-queue-policy.test.cjs
@@ -4,7 +4,8 @@ const assert = require('node:assert/strict');
const {
ACTIONS_APP_ID, DCO_APP_ID, POLICY_CHECKS, BUILD_CHECKS,
PendingEvidence, membersForGroup, assertEligible, evidenceForHead, closedNoop, evaluate,
- isTransientAPIError,
+ isTransientAPIError, isCosmeticLabelFlip, waitAttempts,
+ WAIT_ATTEMPTS, COSMETIC_FLIP_ATTEMPTS, POLICY_CHECK_NAME,
ProviderUnavailable,
DCO_ENUMERATION_SUMMARY_PREFIX,
DCO_ENUMERATION_SUMMARY_FALLBACK,
@@ -387,3 +388,104 @@ test('API failure is never interpreted as an empty successful member list', asyn
f.github.graphql = async () => { throw new Error('403 queue read forbidden'); };
await assert.rejects(evaluate(f), /403/);
});
+
+const labelFlip = (name, action = 'labeled', eventName = 'pull_request_target') => ({
+ eventName, payload: { action, label: { name }, pull_request: eligible(1) },
+});
+
+test('only labeled/unlabeled PR-target events with a label the policy never reads are cosmetic', () => {
+ for (const name of ['size/L', 'dco-signoff: yes', 'hive/claimed-by-scanner', 'copilot', 'stage/070-fixing', 'holdout']) {
+ assert.equal(isCosmeticLabelFlip(labelFlip(name)), true, name);
+ assert.equal(isCosmeticLabelFlip(labelFlip(name, 'unlabeled')), true, name);
+ }
+ for (const name of ['hold', 'Hold', 'needs-human', 'release-in-progress', 'do-not-merge', 'do-not-merge/wip', 'DO-NOT-MERGE/x']) {
+ assert.equal(isCosmeticLabelFlip(labelFlip(name)), false, name);
+ assert.equal(isCosmeticLabelFlip(labelFlip(name, 'unlabeled')), false, name);
+ }
+ for (const action of ['opened', 'synchronize', 'reopened', 'ready_for_review', 'edited']) {
+ assert.equal(isCosmeticLabelFlip(labelFlip('size/L', action)), false, action);
+ }
+ assert.equal(isCosmeticLabelFlip(labelFlip('size/L', 'labeled', 'merge_group')), false);
+ assert.equal(isCosmeticLabelFlip(labelFlip('size/L', 'labeled', 'pull_request')), false);
+ assert.equal(isCosmeticLabelFlip({ eventName: 'pull_request_target', payload: { action: 'labeled' } }), false);
+ assert.equal(isCosmeticLabelFlip({ eventName: 'pull_request_target', payload: { action: 'labeled', label: {} } }), false);
+ assert.equal(isCosmeticLabelFlip({ eventName: 'pull_request_target' }), false);
+});
+
+const verdict = (head, overrides = {}) => ({
+ id: 500, name: POLICY_CHECK_NAME, head_sha: head, status: 'completed', conclusion: 'failure',
+ app: { id: ACTIONS_APP_ID }, ...overrides,
+});
+
+test('a cosmetic flip shortens the wait only for a head that already has a trusted completed verdict', async () => {
+ const flip = (name = 'size/L', action = 'labeled') => {
+ const f = fixture('pull_request_target');
+ Object.assign(f.context.payload, { action, label: { name } });
+ return f;
+ };
+ const head = sha(11);
+ assert.ok(COSMETIC_FLIP_ATTEMPTS < WAIT_ATTEMPTS && COSMETIC_FLIP_ATTEMPTS > 1);
+
+ // Never judged on this head (its synchronize run was collapsed behind an
+ // in-flight run): the flip must pay the full wait rather than steal the verdict.
+ assert.equal(await waitAttempts(flip()), WAIT_ATTEMPTS);
+ // Non-cosmetic events never consult prior verdicts at all.
+ for (const f of [flip('hold'), flip('do-not-merge/wip', 'unlabeled'), flip('size/L', 'synchronize'), fixture('merge_group')]) {
+ f.state.runs.get(head)?.push(verdict(head));
+ let lookups = 0;
+ const paginate = f.github.paginate;
+ f.github.paginate = async (...args) => { lookups++; return paginate(...args); };
+ assert.equal(await waitAttempts(f), WAIT_ATTEMPTS);
+ assert.equal(lookups, 0);
+ }
+ for (const conclusion of ['success', 'failure', 'cancelled']) {
+ const f = flip('size/L', 'unlabeled');
+ f.state.runs.get(head).push(verdict(head, { conclusion }));
+ assert.equal(await waitAttempts(f), COSMETIC_FLIP_ATTEMPTS, conclusion);
+ }
+ // The in-progress run itself, another App, another head or another check
+ // name is not a verdict for this head.
+ for (const overrides of [{ status: 'in_progress', conclusion: null }, { app: { id: DCO_APP_ID } },
+ { head_sha: sha(99) }, { name: 'DCO' }]) {
+ const f = flip();
+ f.state.runs.get(head).push(verdict(head, overrides));
+ assert.equal(await waitAttempts(f), WAIT_ATTEMPTS, JSON.stringify(overrides));
+ }
+ // The lookup must see every run, not only the latest per name (which is this run).
+ const f = flip();
+ f.state.runs.get(head).push(verdict(head));
+ let seen;
+ const paginate = f.github.paginate;
+ f.github.paginate = async (method, args) => { seen = args; return paginate(method, args); };
+ await waitAttempts(f);
+ assert.equal(seen.filter, 'all');
+ assert.equal(seen.ref, head);
+});
+
+test('a cosmetic flip after a red verdict still evaluates and stays red', async () => {
+ // The shortened budget is a wait budget only; evaluate() runs unchanged, so
+ // a flip of size/L cannot turn a held, failing, missing or UNKNOWN head green.
+ const red = (mutate) => {
+ const f = fixture('pull_request_target');
+ Object.assign(f.context.payload, { action: 'labeled', label: { name: 'size/L' } });
+ f.state.runs.get(sha(11)).push(verdict(sha(11)));
+ mutate(f);
+ return f;
+ };
+ const attempts = await waitAttempts(red(() => {}));
+ assert.equal(attempts, COSMETIC_FLIP_ATTEMPTS);
+
+ const held = red(f => { f.state.prs[0].labels = [{ name: 'hold' }]; });
+ await assert.rejects(evaluate(held), /held/);
+ const failing = red(f => { f.state.runs.get(sha(11)).find(r => r.name === 'DCO').conclusion = 'failure'; });
+ await assert.rejects(evaluate(failing), /DCO: failure/);
+ const missing = red(f => { f.state.runs.set(sha(11), f.state.runs.get(sha(11)).filter(r => r.name !== 'gate')); });
+ await assert.rejects(evaluate(missing), error => error instanceof PendingEvidence && /Missing gate/.test(error.message));
+ const unknown = red(f => {
+ Object.assign(f.state.runs.get(sha(11)).find(r => r.name === 'DCO'),
+ { conclusion: 'failure', output: { summary: unavailableSummary } });
+ });
+ await assert.rejects(evaluate(unknown), ProviderUnavailable);
+ // And once every provider has actually succeeded the same flip passes quickly.
+ assert.match(await evaluate(red(() => {})), /five existing policy providers/);
+});
diff --git a/.github/scripts/test-native-queue-workflows.py b/.github/scripts/test-native-queue-workflows.py
index cdb009d..f8a279a 100644
--- a/.github/scripts/test-native-queue-workflows.py
+++ b/.github/scripts/test-native-queue-workflows.py
@@ -74,22 +74,23 @@ class NativeQueueWorkflows(unittest.TestCase):
self.assertIn("github.event.pull_request.number", concurrency["group"])
self.assertIs(concurrency["cancel-in-progress"], False)
- def test_cosmetic_label_flips_skip_the_evidence_wait(self):
- # Only labels matching the policy's BLOCKED_LABEL are read; any other
- # labeled/unlabeled flip must skip the 22.5 min wait (#16945) while
- # the job still concludes successfully.
- steps = workflow("native-queue-policy.yml")["jobs"]["policy"]["steps"]
- gate = next(s for s in steps
- if s.get("name") == "Skip evidence wait for cosmetic label flips")
- self.assertEqual(gate["id"], "label-flip")
- self.assertIn("isCosmeticLabelFlip", gate["with"]["script"])
- self.assertNotIn("setFailed", gate["with"]["script"])
- helper = (ROOT / ".github/scripts/native-queue-policy.cjs").read_text()
- self.assertIn("['labeled', 'unlabeled'].includes(payload.action)", helper)
- self.assertIn("!BLOCKED_LABEL.test(payload.label.name)", helper)
+ def test_cosmetic_label_flips_shorten_the_wait_but_never_skip_the_verdict(self):
+ # A labeled/unlabeled flip the policy never reads must not queue another
+ # 22.5 min wait (#16945), but the verdict is still evaluate()'s: no step
+ # may be gated off, and no step may conclude success without evaluating.
+ policy = workflow("native-queue-policy.yml")
+ events = policy.get("on", policy.get(True))
+ for action in ("labeled", "unlabeled"):
+ self.assertIn(action, events["pull_request_target"]["types"])
+ steps = policy["jobs"]["policy"]["steps"]
+ for step in steps:
+ self.assertNotIn("if", step, step.get("name"))
wait = next(s for s in steps if s.get("name", "").startswith("Validate exact-head evidence"))
- self.assertIn("steps.label-flip.outputs.cosmetic != 'true'", wait["if"])
- self.assertLess(steps.index(gate), steps.index(wait))
+ script = wait["with"]["script"]
+ self.assertIn("await waitAttempts({github, context})", script)
+ self.assertIn("await evaluate({github, context})", script)
+ self.assertEqual(sum("evaluate(" in s.get("with", {}).get("script", "") for s in steps), 1)
+ self.assertEqual(steps[-1], wait)
def test_dependabot_runs_the_same_trusted_pr_verifier(self):
verifier = workflow("pr-verifier.yml")
diff --git a/.github/workflows/native-queue-policy.yml b/.github/workflows/native-queue-policy.yml
index aff1f8d..1034537 100644
--- a/.github/workflows/native-queue-policy.yml
+++ b/.github/workflows/native-queue-policy.yml
@@ -39,25 +39,20 @@ jobs:
persist-credentials: false
- name: Test policy behavior
run: node --test .github/scripts/native-queue-policy.test.cjs .github/scripts/diagnose-dco-provider.test.cjs
- - name: Skip evidence wait for cosmetic label flips
- id: label-flip
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
- with:
- script: |
- const { isCosmeticLabelFlip } = require('./.github/scripts/native-queue-policy.cjs');
- const cosmetic = isCosmeticLabelFlip(context);
- core.setOutput('cosmetic', String(cosmetic));
- if (cosmetic) {
- core.info('Label "' + context.payload.label.name + '" is not read by the policy; skipping the evidence wait.');
- }
- name: Validate exact-head evidence (bounded wait for PR providers)
- if: steps.label-flip.outputs.cosmetic != 'true'
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
- const { evaluate, PendingEvidence, ProviderUnavailable } = require('./.github/scripts/native-queue-policy.cjs');
- const attempts = 90;
+ const { evaluate, waitAttempts, WAIT_ATTEMPTS, PendingEvidence, ProviderUnavailable } = require('./.github/scripts/native-queue-policy.cjs');
+ // A cosmetic label flip (one the policy never reads) on an
+ // already-judged head shortens only the wait, never the verdict:
+ // evaluate() below still runs and fails closed (#16945).
+ const attempts = await waitAttempts({github, context});
const intervalMs = 15000;
+ if (attempts !== WAIT_ATTEMPTS) {
+ core.info('Label "' + context.payload.label.name + '" is not read by the policy and this head already has a ' +
+ 'native-queue-policy verdict; re-evaluating with a ' + attempts + '-attempt budget instead of the bounded wait.');
+ }
for (let attempt = 0; attempt < attempts; attempt++) {
try {
core.info(await evaluate({github, context}));
diff --git a/changelog.d/changed-native-queue-policy-cosmetic-label-early-exit.md b/changelog.d/changed-native-queue-policy-cosmetic-label-early-exit.md
deleted file mode 100644
index ae5b38d..0000000
--- a/changelog.d/changed-native-queue-policy-cosmetic-label-early-exit.md
+++ /dev/null
@@ -1 +0,0 @@
-- `native-queue-policy` no longer spends a ~22-minute evidence wait on label flips it never reads β `size/*`, `dco-signoff`, `hive/claimed-by-*`, `copilot`, stage labels ([#16945](https://github.com/hivecommons/hive/issues/16945)). Flips of `hold`, `needs-human`, `release-in-progress` and `do-not-merge` still run the full exact-head check, and draft/closed/head state is still read from the PR itself.
diff --git a/changelog.d/fixed-16952.md b/changelog.d/fixed-16952.md
new file mode 100644
index 0000000..048ffa4
--- /dev/null
+++ b/changelog.d/fixed-16952.md
@@ -0,0 +1 @@
+- `native-queue-policy` no longer spends a ~22-minute evidence wait on label flips it never reads β `size/*`, `dco-signoff`, `hive/claimed-by-*`, `copilot`, stage labels ([#16945](https://github.com/hivecommons/hive/issues/16945)). Such a flip on a head that already has a `native-queue-policy` verdict re-evaluates with a short budget instead of the bounded wait; the verdict is still computed, so a failing, held, missing-evidence or provider-unavailable head stays red, and a head that has never been judged still gets the full wait. Flips of `hold`, `needs-human`, `release-in-progress` and `do-not-merge` still run the full exact-head check, and draft/closed/head state is still read from the PR itself.
diff --git a/src/docs/native-merge-queue.md b/src/docs/native-merge-queue.md
index b21f83a..dfa3fc7 100644
--- a/src/docs/native-merge-queue.md
+++ b/src/docs/native-merge-queue.md
@@ -218,7 +218,16 @@ metadata, not a fabricated last-member PR event.
Label, edit, or unlabel events re-trigger this workflow and serialize behind
any in-flight run (the concurrency group is per-PR and never cancels
in-progress); the queued run re-reads mutable PR state after the prior run
- finishes, preserving fail-closed semantics.
+ finishes, preserving fail-closed semantics. A `labeled`/`unlabeled` event
+ whose label the policy never reads (anything but `hold`, `needs-human`,
+ `release-in-progress`, `do-not-merge[/*]` β e.g. `size/*`, `dco-signoff`,
+ `hive/claimed-by-*`, stage labels) shortens only that wait to a few
+ attempts, and only when the exact head already carries a completed
+ `native-queue-policy` verdict ([#16945](https://github.com/hivecommons/hive/issues/16945)).
+ The evaluation itself is never skipped: such a flip re-reads eligibility and
+ exact-head evidence and fails closed exactly like any other run, so it
+ cannot turn a red verdict green, and a head that was never judged (its
+ `synchronize` run collapsed behind an in-flight run) still gets the full wait.
- On a group it executes the event's trusted `base_sha` validator. It reads
the live queue prefix ending at the event's exact synthetic head,
verifies contiguous membership and the base/head commit chain, and checks
--
2.47.3
β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88 π Hive Agent: |
β¦el flips Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Security (delta re-review, head f373ec9) β prior finding "cosmetic flip records a green check without any evaluation" is fixed: replayLastVerdict now re-reads the PR, runs assertEligible, and fails closed when no completed success run exists (.github/scripts/native-queue-policy.cjs:233-251, wired with core.setFailed at .github/workflows/native-queue-policy.yml:52-56). One new in-scope issue in the delta:
Replayed run has no workflow provenance binding (name-squatting). replayLastVerdict accepts any check run with name === 'native-queue-policy', app.id === ACTIONS_APP_ID, status === 'completed' on the head, taking the highest id (native-queue-policy.cjs:240-245). Every Actions workflow shares app 15368, so a fork PR that adds a pull_request-triggered workflow whose job is named native-queue-policy and exits 0 produces a qualifying success run on the PR head (re-fired on each labeled event, so it reliably outranks the real prior run by id). The next cosmetic flip (e.g. the auto-applied size/* label) then replays that forged success and the required check goes green without the policy ever evaluating evidence. The repo already treats this as a threat: assertEvidence binds every Actions-sourced check run to workflow.path, workflow.event, workflow.head_sha, check_suite_id, and the job's check_run_url (native-queue-policy.cjs:112-150) precisely so same-named runs from other workflows are rejected β the replay path skips all of it.
Fix: factor the provenance block of assertEvidence (.cjs:112-150) into a helper and apply it to prior in replayLastVerdict with source = ['native-queue-policy.yml', ['pull_request_target']], so the replayed run must come from this workflow file on this event, with matching check_suite/job identity. Add a test with a same-named run whose details_url/workflow path point at a different workflow and assert it is rejected.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Review-fix attempt 3/6 β needs a human push (workflow file). The fix for the medium correctness finding (stale timeout/failure replayed forever on cosmetic label flips) is ready and tested locally ( Change: Apply with pr16952-fix-attempt3.patchFrom 12f7325ad2f7f4240b18633237a6337a055c3365 Mon Sep 17 00:00:00 2001
From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Sat, 7 Nov 2026 05:57:28 -0500
Subject: [PATCH] fix(ci): fall back to the evidence wait when there is no
prior success to replay
replayLastVerdict threw whenever the latest completed native-queue-policy
run on the head was not a success. A single bounded-wait timeout therefore
became permanent: every later cosmetic label flip replayed the stale failure,
and nothing else (synchronize/edited/reopened/ready_for_review/BLOCKED_LABEL)
re-fires the workflow on a hive-authored PR, so a green PR stayed blocked.
Only short-circuit on a replayed prior success. When no completed success
exists on the head (none yet, or the latest run failed/timed out) return
null so the workflow sets cosmetic=false and runs the existing full wait.
Update tests, workflow contract test, changelog and docs to match.
Hive-Fix-Attempt: 3/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
.github/scripts/native-queue-policy.cjs | 13 ++++-----
.github/scripts/native-queue-policy.test.cjs | 27 ++++++++++++-------
.../scripts/test-native-queue-workflows.py | 5 ++++
.github/workflows/native-queue-policy.yml | 16 +++++++----
changelog.d/fixed-16952.md | 2 +-
src/docs/native-merge-queue.md | 7 ++---
6 files changed, 45 insertions(+), 25 deletions(-)
diff --git a/.github/scripts/native-queue-policy.cjs b/.github/scripts/native-queue-policy.cjs
index 0e18d47..4b2bcde 100644
--- a/.github/scripts/native-queue-policy.cjs
+++ b/.github/scripts/native-queue-policy.cjs
@@ -235,8 +235,12 @@ function isCosmeticLabelFlip({ eventName, payload }) {
}
// A cosmetic flip skips the evidence wait but must not mint a fresh passing
-// required check: replay the latest completed run of this check on the head
-// (fail closed when none, not success, or not from this workflow) and still read live PR eligibility.
+// required check: replay the latest completed *success* of this check on the
+// head (rejecting one not from this workflow) and still read live PR
+// eligibility. Returns null when there is nothing to replay (no completed run,
+// or the latest one failed/timed out) so the caller falls back to the full
+// wait; replaying a stale failure would keep a green PR blocked forever, since
+// nothing but label flips re-fires this workflow on a hive-authored PR.
async function replayLastVerdict({ github, context, currentCheckRunId }) {
const repo = context.repo;
const event = context.payload.pull_request;
@@ -250,13 +254,10 @@ async function replayLastVerdict({ github, context, currentCheckRunId }) {
.filter(r => r.name === POLICY_CHECK_NAME && r.status === 'completed' &&
r.head_sha === pr.head.sha && r.app?.id === ACTIONS_APP_ID && r.id !== currentCheckRunId)
.sort((a, b) => b.id - a.id)[0];
- if (!prior) throw new Error(`No completed ${POLICY_CHECK_NAME} run on ${pr.head.sha} to replay`);
+ if (!prior || prior.conclusion !== 'success') return null;
// A same-named job from any other workflow shares the Actions App id; only
// a run of this workflow file on this event may be replayed.
await assertActionsProvenance(github, repo, pr.number, pr.head.sha, prior, POLICY_CHECK_SOURCE, new Map());
- if (prior.conclusion !== 'success') {
- throw new Error(`Replaying ${POLICY_CHECK_NAME} run ${prior.id} on ${pr.head.sha}: ${prior.conclusion}`);
- }
return `PR #${pr.number}: replayed ${POLICY_CHECK_NAME} run ${prior.id} (success) on ${pr.head.sha}`;
}
diff --git a/.github/scripts/native-queue-policy.test.cjs b/.github/scripts/native-queue-policy.test.cjs
index 3cdaca7..31f74f8 100644
--- a/.github/scripts/native-queue-policy.test.cjs
+++ b/.github/scripts/native-queue-policy.test.cjs
@@ -440,17 +440,24 @@ test('cosmetic flip replays the latest completed success on the same head', asyn
assert.equal(f.state.listed[0].ref, sha(11));
});
-test('cosmetic flip replays a prior failure and fails closed without a completed run', async () => {
- await assert.rejects(replayLastVerdict(replayFixture([
+test('cosmetic flip falls back to the full wait when the latest run is not a success', async () => {
+ // A stale timeout/failure must not be replayed: nothing but label flips
+ // re-fires this workflow on a hive-authored PR, so replaying it would keep
+ // a green PR blocked forever. null tells the workflow to run the wait.
+ assert.equal(await replayLastVerdict(replayFixture([
{ id: 5, status: 'completed', conclusion: 'success' },
{ id: 7, status: 'completed', conclusion: 'failure' },
- ])), /run 7.*failure/);
- await assert.rejects(replayLastVerdict(replayFixture([
+ ])), null);
+ assert.equal(await replayLastVerdict(replayFixture([
+ { id: 5, status: 'completed', conclusion: 'success' },
+ { id: 7, status: 'completed', conclusion: 'cancelled' },
+ ])), null);
+ assert.equal(await replayLastVerdict(replayFixture([
{ id: 9, status: 'in_progress', conclusion: null },
- ])), /No completed/);
- await assert.rejects(replayLastVerdict(replayFixture([])), /No completed/);
+ ])), null);
+ assert.equal(await replayLastVerdict(replayFixture([])), null);
const own = replayFixture([{ id: 8, status: 'completed', conclusion: 'success' }]);
- await assert.rejects(replayLastVerdict({ ...own, currentCheckRunId: 8 }), /No completed/);
+ assert.equal(await replayLastVerdict({ ...own, currentCheckRunId: 8 }), null);
});
test('cosmetic flip still honours a live hold even after a prior success', async () => {
@@ -462,9 +469,9 @@ test('replay ignores runs with a different name, head_sha or app id', async () =
for (const change of [
{ name: 'other-check' }, { head_sha: sha(99) }, { app: { id: DCO_APP_ID } }, { app: undefined },
]) {
- await assert.rejects(
- replayLastVerdict(replayFixture([{ id: 7, status: 'completed', conclusion: 'success', ...change }])),
- /No completed/);
+ assert.equal(
+ await replayLastVerdict(replayFixture([{ id: 7, status: 'completed', conclusion: 'success', ...change }])),
+ null);
}
});
diff --git a/.github/scripts/test-native-queue-workflows.py b/.github/scripts/test-native-queue-workflows.py
index c639fe4..8424c1e 100644
--- a/.github/scripts/test-native-queue-workflows.py
+++ b/.github/scripts/test-native-queue-workflows.py
@@ -84,6 +84,11 @@ class NativeQueueWorkflows(unittest.TestCase):
self.assertEqual(gate["id"], "label-flip")
self.assertIn("isCosmeticLabelFlip", gate["with"]["script"])
self.assertIn("replayLastVerdict", gate["with"]["script"])
+ # Only a replayed prior success may skip the wait; a missing or failed
+ # prior run must fall through so a green PR is never blocked by a
+ # stale verdict (nothing but label flips re-fires this on hive PRs).
+ self.assertIn("replayed = verdict !== null", gate["with"]["script"])
+ self.assertIn("core.setOutput('cosmetic', String(replayed))", gate["with"]["script"])
wait = next(s for s in steps if s.get("name", "").startswith("Validate exact-head evidence"))
self.assertIn("steps.label-flip.outputs.cosmetic != 'true'", wait["if"])
self.assertLess(steps.index(gate), steps.index(wait))
diff --git a/.github/workflows/native-queue-policy.yml b/.github/workflows/native-queue-policy.yml
index 65afbcb..3b7a097 100644
--- a/.github/workflows/native-queue-policy.yml
+++ b/.github/workflows/native-queue-policy.yml
@@ -45,16 +45,22 @@ jobs:
with:
script: |
const { isCosmeticLabelFlip, replayLastVerdict } = require('./.github/scripts/native-queue-policy.cjs');
- const cosmetic = isCosmeticLabelFlip(context);
- core.setOutput('cosmetic', String(cosmetic));
- if (cosmetic) {
- core.info('Label "' + context.payload.label.name + '" is not read by the policy; replaying the last completed verdict instead of waiting for evidence.');
+ // Only a replayed prior success short-circuits the wait; with no
+ // completed success on this head (none yet, or a stale timeout or
+ // failure) fall through to the full evidence wait instead of
+ // replaying a verdict that can never change on label flips alone.
+ let replayed = false;
+ if (isCosmeticLabelFlip(context)) {
+ core.info('Label "' + context.payload.label.name + '" is not read by the policy; replaying the last completed success instead of waiting for evidence.');
try {
- core.info(await replayLastVerdict({github, context}));
+ const verdict = await replayLastVerdict({github, context});
+ replayed = verdict !== null;
+ core.info(verdict ?? 'No completed success to replay on this head; running the full evidence wait.');
} catch (error) {
core.setFailed(error.message);
}
}
+ core.setOutput('cosmetic', String(replayed));
- name: Validate exact-head evidence (bounded wait for PR providers)
if: steps.label-flip.outputs.cosmetic != 'true'
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
diff --git a/changelog.d/fixed-16952.md b/changelog.d/fixed-16952.md
index 75bcdc6..c1dc4a8 100644
--- a/changelog.d/fixed-16952.md
+++ b/changelog.d/fixed-16952.md
@@ -1 +1 @@
-- `native-queue-policy` no longer spends its ~22-minute evidence wait on label flips it never reads (`size/*`, `dco-signoff`, `hive/claimed-by-*`, `copilot`, stage labels); instead it replays the conclusion of the latest completed `native-queue-policy` run on the same head (failing closed when that run was not `success` or none exists) rather than fabricating a pass, and still applies the live hold/draft/head-move check, while flips of `hold`, `needs-human`, `release-in-progress` and `do-not-merge` still run the full exact-head evidence wait ([#16945](https://github.com/hivecommons/hive/issues/16945)).
+- `native-queue-policy` no longer spends its ~22-minute evidence wait on label flips it never reads (`size/*`, `dco-signoff`, `hive/claimed-by-*`, `copilot`, stage labels); instead it replays the conclusion of the latest completed `native-queue-policy` run on the same head rather than fabricating a pass (when no completed `success` exists on that head it runs the full evidence wait instead of replaying a stale failure), and still applies the live hold/draft/head-move check, while flips of `hold`, `needs-human`, `release-in-progress` and `do-not-merge` still run the full exact-head evidence wait ([#16945](https://github.com/hivecommons/hive/issues/16945)).
diff --git a/src/docs/native-merge-queue.md b/src/docs/native-merge-queue.md
index 0b23264..92efa0e 100644
--- a/src/docs/native-merge-queue.md
+++ b/src/docs/native-merge-queue.md
@@ -220,9 +220,10 @@ metadata, not a fabricated last-member PR event.
in-progress); the queued run re-reads mutable PR state after the prior run
finishes, preserving fail-closed semantics. Labels the policy never reads
(`size/*`, `dco-signoff`, stage labels, ...) skip the wait: the job replays
- the latest completed `native-queue-policy` conclusion on the same head
- (failing when it was not `success` or none exists) and still checks the
- live PR for holds, draft and head moves. `hold`, `needs-human`,
+ latest completed `native-queue-policy` success on the same head and still
+ checks the live PR for holds, draft and head moves; when no completed
+ success exists (none yet, or the latest run failed or timed out) it runs
+ the full wait rather than replaying a stale verdict. `hold`, `needs-human`,
`release-in-progress` and `do-not-merge*` flips get the full wait.
- On a group it executes the event's trusted `base_sha` validator. It reads
the live queue prefix ending at the event's exact synthetic head,
--
2.47.3
π Hive Agent: β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
β¦e is no success to replay A cosmetic label flip used to replay whatever the latest completed native-queue-policy run concluded, so one failed or timed-out (cancelled) wait pinned the required check red on every later size/*, dco-signoff or stage-label flip until a push, edit or hold flip re-entered the full wait. replayLastVerdict now returns null when there is no prior success on the head, and the workflow step then runs the authoritative evidence wait (attempts/15s retry unchanged) instead of failing; a 5xx during the replay reads takes the same route, matching the transient-API handling the main path already has (#16258). Provenance mismatches still fail closed. Refs #16945 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the required native-queue-policy check may replay a prior same-head success on cosmetic label flips instead of re-reading the five policy providers (required-check semantics change in .github/workflows/, code-owned).
Conclusion: the code does what the body says and I found no defect; routing only because it changes what a required check on .github/workflows/ means, which CODEOWNERS (.github/CODEOWNERS:18) reserves for @clubanderson @hanthor @Danathar.
What I verified (read at 9687acd, tests run locally: 30/30 node --test, 7/7 test-native-queue-workflows.py):
isCosmeticLabelFlip(native-queue-policy.cjs:230-235) reuses the sameBLOCKED_LABELregexassertEligiblereads (:91-95), so no second label list can drift.hold/needs-human/release-in-progress/do-not-merge*flips in either direction take the full wait.replayLastVerdict(:244-262) re-reads the live PR and callsassertEligiblebefore looking for a prior run, so a live hold, draft, or moved head/base still fails closed. It only accepts acompletedrun withapp.id === ACTIONS_APP_IDon the exactpr.head.sha, then binds it tonative-queue-policy.yml/pull_request_target/suite/job via the existingassertActionsProvenance(hoisted unchanged fromassertEvidence,:116-149). A non-successlatest run returnsnullβ the workflow step falls through to the full wait (native-queue-policy.yml:52-58).- Workflow permissions are unchanged (all
read), checkout still pins the trusted base ref, and themerge_grouppath (:280-311) is untouched β the real merge still re-validates every member's evidence, reviews and build checks, so the replay only shortens the PR-event pre-check.
Two informational notes, not defects:
replayLastVerdictaccepts acurrentCheckRunId(:244,:253) but the workflow never passes one (native-queue-policy.yml:50); own-run exclusion in practice relies on the running job beingstatus != completed, which holds. Harmless; the parameter is effectively test-only.- A replayed success is the policy's verdict at the earlier run. If a provider check (e.g.
gate) is manually re-run on the same head and fails afterwards, a later cosmetic flip replays green where the full path would have read red. Today a check re-run doesn't re-fire this workflow either, and the merge-group path re-reads everything at merge time, so the exposure is bounded β but it is the semantic the owners are being asked to accept.
Body matches the diff; the "decision taken by hive" paragraph (fall through on no prior success rather than stay red) is what :258-260 implements. I have not approved or changed anything.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
/lgtm Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
@hivecommons-hive[bot]: you cannot LGTM your own PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/approve Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hivecommons-hive[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the native-queue-policy required check may replay its own prior same-head success on cosmetic label flips (size/, stage/, dco-signoff, copilot) instead of re-running the exact-head evidence wait.
Conclusion: the code is correct and fail-closed as far as I can verify; I'm routing it because it changes the merge-gate required check itself and .github/workflows/** (CODEOWNERS), which is a trust-policy decision, not a code-quality one.
What I checked at 758d393 (base v5):
isCosmeticLabelFlip(.github/scripts/native-queue-policy.cjs:230-235) keys off the sameBLOCKED_LABELregex thatassertEligiblereads (:91-95); I grepped the script and that regex is the only label read anywhere, so a non-matching label really cannot change the verdict.replayLastVerdict(:245-262) re-reads the PR live and callsassertEligible(pr, event.head.sha, event.base.ref)before replaying, so hold/draft/head-move/closed still fail closed. It selects the latest completed run by id on the exact head and returnsnullunless that one issuccessβ a later failure after an earlier success is never bypassed.assertActionsProvenance(:118-149) is a pure extraction of the existing inline block inassertEvidence; the main path's behaviour is unchanged. The replay binds the prior run tonative-queue-policy.yml/pull_request_target/ same head / suite / job.- Workflow (
.github/workflows/native-queue-policy.yml): checkout stays on the trusted base ref, permissions unchanged (all read). A non-transient error in the replay stepsetFaileds before the wait step is skipped, so it fails rather than skips. 5xx falls through to the full wait. node --test .github/scripts/native-queue-policy.test.cjsβ 30/30;python3 .github/scripts/test-native-queue-workflows.pyβ 7/7.
Info (not a defect): the workflow calls replayLastVerdict({github, context}) without currentCheckRunId, so the own-run exclusion at :256 is a no-op; exclusion of the running check relies on the status === 'completed' filter, which is sufficient today.
Question for the owner: a required check that replays its own prior verdict is a new precedent for this gate. If that's acceptable, this looks correct to me. I have not approved or merged anything.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #16945
Why
Every label flip re-fires
native-queue-policy, and withcancel-in-progress: false(#16943) a cosmetic flip (size/L,dco-signoff: yes,hive/claimed-by-*,copilot, stage labels) still costs one extra queued ~22.5-min evidence-wait run per quiet window. Skipping the step outright would mint a fresh green required check without reading anything, which contradicts the fail-closed contract set in #16942 β so the shortcut has to carry an existing verdict, not fabricate one.What
native-queue-policy.cjs:isCosmeticLabelFlipis true only forlabeled/unlabeledonpull_request_targetwhose label does NOT match the policy's existingBLOCKED_LABELregex (single source, no second list):hold,needs-human,release-in-progress,do-not-merge[/*]. Draft/closed/head state is read live from the PR, not labels.replayLastVerdict: on a cosmetic flip, re-read live eligibility (hold/draft/head-move still fail), then look up the latest completednative-queue-policyrun on the exact head, bound to this workflow file/event/head/check-suite/job (a same-named run from another workflow is rejected). A priorsuccessis replayed in seconds. When there is no prior success (head never evaluated, or the last wait failed / timed out) it returnsnulland the workflow step falls through to the full exact-head evidence wait β the authoritative path still runs, so a stale red verdict is never pinned onto later cosmetic flips. A 5xx during the replay reads takes the same fall-through, matching the transient-API handling the main path already has ([shared-ci] native-queue-policy failing across hivecommons/hiveΒ #16258).Replay last verdict for cosmetic label flips(id: label-flip) precedesValidate exact-head evidence ..., which keepsif: steps.label-flip.outputs.cosmetic != 'true'; the full wait's attempts/interval are unchanged.native-queue-policy.test.cjscovers replay of a prior success,nullfor failure/cancelled/in-progress/none/own-run, live hold after a success, and provenance rejections;test-native-queue-workflows.pypins the step wiring and the fall-through. Changelog fragment andsrc/docs/native-merge-queue.mdupdated.β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88