You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 27428d8
Browse filesBrowse the repository at this point in the historyBrowse files
fix(drift): the suppression ack is a receipt, so it follows the delivery instead of preceding it
`rejected_ack` is the state that silences the human-rejection notice for ever, and it was
written inside the persist step — several steps BEFORE the notice POSTs. So on the first run
after a closure the marker landed, the POST then failed, and every run after it read
`rejected_ack=true`, stood the notice down and exited GREEN and silent: the suppression
permanently un-narrated. Reached with certainty rather than by chance when the webhook has
been rotated, which also kills the catch-all's POST that day, leaving nothing behind but a
red cron run.
The write now lives in its own step placed after the notice and gated on
`steps.alert_rejected.outputs.posted == 'true'` — the same positive proof of delivery the
catch-all stands down for — so the receipt cannot exist without the telling. Every failure
path in it warns and exits 0, so an unrecordable ack costs one repeated ping and never a
red run on a day the telling landed. The persist steps now only READ the marker.
That step also scopes the write the way the marker self-healer is scoped (bot author AND a
drift branch): rejection detection is body-keyed and state-blind, so a human PR that quotes
or inherits the changeset marker was a full-body-rewrite target. It re-reads the PR live for
the branch and author, which also stops a rewrite from the stale `--search` copy.
Guards: the writer is located from the artifact, its position compared with the notice's, and
its unreachability without a delivered POST settled by simulating the job with that POST
failing. Mutation-tested: reverting the move, dropping the gate, defeating the gate with an
extra || clause, dropping always(), rewriting instead of appending, flipping the closure
precedence, deleting the idempotency check, deleting either half of the ownership test, and
reddening the write-failure path all fail the suite.
if [ -z "$CLOSED_PR" ] || [ -z "${CHANGESET_KEY:-}" ]; then
1478
+
echo "::warning::the suppression notice was delivered, but the closing PR (#${CLOSED_PR:-none}) or the changeset key (${CHANGESET_KEY:-none}) is missing here, so no ack can be recorded — the notice reports the suppression again next run"
1479
+
exit 0
1480
+
fi
1481
+
# Read the closed PR live rather than reusing the persist step's copy: the
1482
+
# branch and author the scoping below needs are not in that payload, and
1483
+
# that payload came from the index-backed `--search` listing this file
1484
+
# elsewhere treats as lagging a body edit by minutes — so rewriting the
1485
+
# body from it could silently revert a human's recent edit.
1486
+
if ! PR_JSON="$(gh pr view "$CLOSED_PR" --json body,headRefName,author 2>&1)"; then
1487
+
echo "::warning::could not read PR #${CLOSED_PR} to record the suppression ack (${PR_JSON}) — the notice reports the suppression again next run"
1488
+
exit 0
1489
+
fi
1490
+
# SCOPED like the marker self-healer, because this is a WRITE into a body
1491
+
# a human may own: rejection detection is body-keyed and state-blind, so a
1492
+
# human PR that quotes or inherits the changeset marker is a candidate —
1493
+
# and DRIFT.md asks humans to do drift work on `fix/drift-<slug>` branches.
1494
+
# Bot author AND a drift branch, the same conjunction `bot_managed` uses.
1495
+
# Its other arm (branch ends in a changeset key) is deliberately not
1496
+
# reproduced: for a WRITE the fail-open direction is to decline any PR this
1497
+
# workflow cannot prove it opened, and declining costs a repeated ping.
case "$BRANCH" in fix/drift-*|drift-needs-human/*) DRIFT_BRANCH=yes ;; esac
1502
+
if [ "$DRIFT_BRANCH" != yes ] || [ "$AUTHOR" != "app/copilotkit-devops-bot" ]; then
1503
+
echo "::warning::PR #${CLOSED_PR} is not a PR this workflow opened (branch '${BRANCH}', author '${AUTHOR}'), so its body is not machine state to append to — no ack recorded, and the notice reports the suppression again next run"
if ! ACK_ERR="$(gh pr edit "$CLOSED_PR" --body-file "$ACK_FILE" 2>&1)"; then
1523
+
echo "::warning::could not record the suppression ack on PR #${CLOSED_PR} (${ACK_ERR}) — the notice reports the suppression again next run and tries again"
1524
+
exit 0
1525
+
fi
1526
+
echo "recorded the suppression ack on PR #${CLOSED_PR} — the delivered notice is not re-posted"
1527
+
1454
1528
# Alert: the sync found a genuinely-new family or a still-referenced
1455
1529
# deprecation — the two irreducible human decisions (see
1456
1530
# self-healing-drift-plan.md "Bucket B"). The needs-human note was
0 commit comments