Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

fix(ok): stop the bug lane re-paging one standing refusal (PRD-7820) (#3251)

Andrew Mikofalvyc06d847ec403
diff --git a/.github/scripts/point-release-plan.mjs b/.github/scripts/point-release-plan.mjs
index fb8e500a5..6aadd6844 100644
--- a/.github/scripts/point-release-plan.mjs
+++ b/.github/scripts/point-release-plan.mjs
@@ -1078,7 +1078,11 @@ export function formatReleaseNotes(plan) {
`commit(s), isolated from the changes still soaking on main.`,
'',
`Mode: ${plan.mode}`,
- `Applied: ${plan.fixRefs.map((r) => `${r.ref} (${r.sha})`).join(', ')}`,
+ // `ref (sha)` is only worth printing when the ref is a NAME — a tag or
+ // branch the reader cannot resolve themselves. The bug lane dispatches
+ // full SHAs, where `ref` and `sha` are the same 40 characters and the
+ // parenthetical renders as the same hash twice.
+ `Applied: ${plan.fixRefs.map((r) => (r.ref === r.sha ? r.sha : `${r.ref} (${r.sha})`)).join(', ')}`,
];
// Quote each added changeset's prose under the same level heading a stable's
// aggregated notes use, so the announcement channels render both release
diff --git a/.github/scripts/point-release-plan.test.mjs b/.github/scripts/point-release-plan.test.mjs
index b44da7189..fe887548a 100644
--- a/.github/scripts/point-release-plan.test.mjs
+++ b/.github/scripts/point-release-plan.test.mjs
@@ -2,6 +2,7 @@ import { readFileSync } from 'node:fs';
import { describe, expect, test } from 'vitest';
import {
deriveEntryLevelResolution,
+ formatReleaseNotes,
guardAnchor,
guardDeltaMatchesFix,
guardMainResetDeltaIds,
@@ -1401,3 +1402,41 @@ describe('point-release.yml contract with this script', () => {
expect(source).toContain("process.env.DRY_RUN !== 'false'");
});
});
+
+describe('formatReleaseNotes "Applied" line', () => {
+ const SHA = '896d38001a123ce9cf05808249d2f12894402850';
+ const appliedLine = (fixRefs) =>
+ formatReleaseNotes({
+ latestStableTag: 'v0.48.2',
+ mode: 'cherry-pick',
+ fixRefs,
+ changesetEntries: [],
+ addedIds: [],
+ removedIds: [],
+ })
+ .split('\n')
+ .find((l) => l.startsWith('Applied:'));
+
+ test('a ref that IS its sha prints the hash once, not twice', () => {
+ // The bug lane dispatches full SHAs, so ref === sha and the old
+ // `ref (sha)` shape rendered the same 40 characters twice in every
+ // point-release announcement that lane produced.
+ expect(appliedLine([{ ref: SHA, sha: SHA }])).toBe(`Applied: ${SHA}`);
+ });
+
+ test('a NAMED ref still shows what it resolved to', () => {
+ // The parenthetical earns its place when the reader cannot resolve the
+ // ref themselves; dropping it there would lose real information.
+ expect(appliedLine([{ ref: 'v0.47.1', sha: SHA }])).toBe(`Applied: v0.47.1 (${SHA})`);
+ });
+
+ test('a mixed batch keeps each form', () => {
+ const other = 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeef';
+ expect(
+ appliedLine([
+ { ref: SHA, sha: SHA },
+ { ref: 'hotfix-tag', sha: other },
+ ]),
+ ).toBe(`Applied: ${SHA}, hotfix-tag (${other})`);
+ });
+});
diff --git a/.github/scripts/release-cascade-shape.test.mjs b/.github/scripts/release-cascade-shape.test.mjs
index adbc6e829..a2f31b065 100644
--- a/.github/scripts/release-cascade-shape.test.mjs
+++ b/.github/scripts/release-cascade-shape.test.mjs
@@ -506,6 +506,71 @@ describe('the bug lane verifies the synthetic tree at the same bar as main', ()
expect(failAt).toBeGreaterThan(-1);
});
+ test('an unchanged refusal is paged once, not once per tick', () => {
+ // The refused ref stays in the pending pile and re-conflicts on every
+ // tick, so a page-per-tick emits the same message every 20 minutes until
+ // the cycle consumes it — five identical pages in two hours on 2026-08-05.
+ // The gate is the cache lookup; losing it restores the flood silently,
+ // because every individual page is still "correct".
+ const page = bugLane.slice(
+ bugLane.indexOf('- name: Page on a refusal'),
+ bugLane.indexOf('- name: Record that this refusal was paged'),
+ );
+ expect(page).toContain("steps.paged_before.outputs.cache-hit != 'true'");
+ expect(bugLane).toContain('actions/cache/save@');
+ expect(bugLane).toContain('actions/cache/restore@');
+ });
+
+ test('the marker is gated on DELIVERY, not on the page step succeeding', () => {
+ // The page step cannot fail: a dead webhook is downgraded to a warning
+ // (losing a notification must never fail a release job) and an unset
+ // secret returns early, so its conclusion is `success` in both cases while
+ // nothing reached anyone. Keying the marker on the step would cache the
+ // signature anyway and silence that refusal permanently — strictly worse
+ // than the per-tick flood it replaced, which self-healed next tick.
+ //
+ // Step ORDER is not the property: `Record` sits after `Page` either way,
+ // so an ordering assertion stays green while the guarantee is gone.
+ expect(bugLane).toContain('echo "delivered=${delivered}" >> "$GITHUB_OUTPUT"');
+ expect(bugLane).toContain('delivered=true');
+ for (const step of ['Record that this refusal was paged', 'Remember the refusal across ticks']) {
+ const body = bugLane.slice(
+ bugLane.indexOf(`- name: ${step}`),
+ bugLane.indexOf(`- name: ${step}`) + 400,
+ );
+ expect(body, `${step} must gate on delivery`).toContain(
+ "if: steps.page.outputs.delivered == 'true'",
+ );
+ }
+ });
+
+ test('the one page it does send says the following silence is deliberate', () => {
+ // Paging once and then going quiet is indistinguishable from resolved
+ // unless the message says so.
+ // Bounded to the Page step: an open-ended slice would also match the
+ // phrase in a later step or comment and pass while the message itself
+ // had lost it.
+ const page = bugLane.slice(
+ bugLane.indexOf('- name: Page on a refusal'),
+ bugLane.indexOf('- name: Record that this refusal was paged'),
+ );
+ expect(page).toContain('Further identical refusals stay silent');
+ });
+
+ test('a suppressed refusal still leaves a trace in the run', () => {
+ // The suppressing tick is the one with nothing else to show: no page, no
+ // marker write, green check. Its condition is the COMPLEMENT of the page
+ // step's, which is the regression worth pinning — swapping it to
+ // `!= 'true'` makes it fire alongside the page and never on the tick it
+ // exists for, and every other test here stays green.
+ const suppress = bugLane.slice(
+ bugLane.indexOf('- name: Note a suppressed refusal'),
+ bugLane.indexOf('- name: Page on a refusal'),
+ );
+ expect(suppress).toContain("if: steps.paged_before.outputs.cache-hit == 'true'");
+ expect(suppress).toContain('>> "$GITHUB_STEP_SUMMARY"');
+ });
+
test('the refusal page does not claim a cause it has not established', () => {
// The prior text asserted "the fix passes on main but not on the stable it
// would ship against" off a single red run, sending operators hunting for
diff --git a/.github/workflows/bug-lane.yml b/.github/workflows/bug-lane.yml
index afc640fdb..079981456 100644
--- a/.github/workflows/bug-lane.yml
+++ b/.github/workflows/bug-lane.yml
@@ -265,8 +265,74 @@ jobs:
curl -sS --fail -X POST -H 'Content-type: application/json' --data "$payload" "$WEBHOOK_URL" \
|| echo "::warning::bug-lane drop notification failed to POST — the dispatch itself is unaffected."
- - name: Page on a refusal (armed only)
+ # A refusal is a STANDING ANSWER, not an event. The refused ref stays in
+ # the pending pile and re-qualifies and re-conflicts on every tick, so a
+ # page-per-tick turns one durable fact into a message every 20 minutes
+ # until the cycle's stable consumes it — ~70 identical pages, which is
+ # how a channel gets muted. Observed 2026-08-05: five identical pages for
+ # one deterministically-conflicting ref inside two hours.
+ #
+ # Page once per DISTINCT refusal instead. The signature is the verdict
+ # plus the refs it is about, so a genuinely new refusal — a different
+ # ref, or the same ref failing a different way — still pages at once.
+ # The cache is only a "have I said this already" marker; if it misses
+ # (eviction, or a tick cancelled between paging and saving) the lane
+ # re-pages, which is the safe direction to fail.
+ #
+ # The stable tag is DELIBERATELY not in the signature, so a refusal that
+ # survives a stable roll stays quiet rather than re-paging against the
+ # new stable. Two reasons. The operator's move does not change when the
+ # stable does — it is still "wait for the cycle, or point-release by
+ # hand" — and stables currently roll several times a day, so including it
+ # would restore a good fraction of the flood for a fact already reported.
+ # The suppression is bounded either way: a refused ref keeps its
+ # changeset pending only until a cut that DOES contain it ships, which
+ # the ordinary beta-to-stable cadence guarantees within a cycle. If that
+ # ever stops being true, put "$STABLE" back in the printf below.
+ - name: Refusal signature
+ id: refusal
if: env.BUG_LANE_ARMED == 'true' && (steps.verify.outputs.verdict == 'conflict' || steps.verify.outputs.verdict == 'fail')
+ env:
+ VERDICT: ${{ steps.verify.outputs.verdict }}
+ FIX_REFS: ${{ steps.evaluate.outputs.fix_refs }}
+ SURVIVING_REFS: ${{ steps.verify.outputs.surviving_refs }}
+ run: |
+ set -euo pipefail
+ sig="$(printf '%s|%s|%s' "$VERDICT" "$FIX_REFS" "$SURVIVING_REFS" | sha256sum | cut -c1-32)"
+ echo "sig=${sig}" >> "$GITHUB_OUTPUT"
+ echo "marker=${RUNNER_TEMP}/bug-lane-refusal-marker" >> "$GITHUB_OUTPUT"
+
+ - name: Has this refusal already been paged?
+ id: paged_before
+ if: steps.refusal.outputs.sig != ''
+ uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
+ with:
+ path: ${{ steps.refusal.outputs.marker }}
+ key: bug-lane-refusal-${{ steps.refusal.outputs.sig }}
+ lookup-only: true
+
+ # Suppression has to be visible SOMEWHERE. Silencing the channel is the
+ # point, but a tick that suppresses otherwise finishes green with no
+ # trace, so an operator asking "is that conflict still standing?" has
+ # only an invisible cache hit to infer it from. The run summary costs no
+ # notification and answers that question in place.
+ - name: Note a suppressed refusal
+ if: steps.paged_before.outputs.cache-hit == 'true'
+ env:
+ SIG: ${{ steps.refusal.outputs.sig }}
+ VERDICT: ${{ steps.verify.outputs.verdict }}
+ run: |
+ set -euo pipefail
+ {
+ echo "### Bug lane — refusal still standing, page suppressed"
+ echo "Verdict \`${VERDICT}\`, signature \`${SIG}\`, already paged on an earlier tick."
+ echo "The channel stays quiet by design; this refusal re-pages only if it changes."
+ } >> "$GITHUB_STEP_SUMMARY"
+ echo "::notice::bug-lane: refusal ${SIG} already paged; suppressing the duplicate page."
+
+ - name: Page on a refusal (armed only)
+ id: page
+ if: steps.refusal.outputs.sig != '' && steps.paged_before.outputs.cache-hit != 'true'
env:
SLACK_RELEASES_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
@@ -276,24 +342,54 @@ jobs:
VERDICT: ${{ steps.verify.outputs.verdict }}
run: |
set -uo pipefail
+ # `delivered` is the ONLY thing the marker may key on. The step's own
+ # conclusion cannot stand in for it: a dead webhook is downgraded to
+ # a warning (losing a notification must never fail a release job), and
+ # an unset secret exits early, so this step reports success in both
+ # cases while nothing reached anyone.
+ delivered=false
WEBHOOK_URL="${SLACK_RELEASES_WEBHOOK_URL:-${SLACK_WEBHOOK_URL:-}}"
if [[ -z "$WEBHOOK_URL" ]]; then
echo "::notice::No Slack webhook secret set — refusal page skipped."
- exit 0
- fi
- RUN_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
- # Name only the refs each verdict is actually about: on conflict the
- # whole qualifying set conflicted; on fail only the survivors reached
- # the verification stage.
- if [[ "$VERDICT" == "conflict" ]]; then
- TEXT="⛔ Bug lane: no qualifying fix is self-contained over the stable — all of ${FIX_REFS} conflict. They ride their cycle's 24h path; investigate whether any needs a manual point release. ${RUN_URL}"
else
- TEXT="⛔ Bug lane: verification failed on the synthetic tree for ${SURVIVING_REFS} — the fast tiers went red on BOTH attempts, or the install failed. Either way this is past flake-class: treat it as a real conflict with the stable, not a retryable blip."
- if [[ -n "${DROPPED_REFS}" ]]; then
- TEXT="${TEXT} Also dropped for conflict: ${DROPPED_REFS}."
+ RUN_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
+ # Name only the refs each verdict is actually about: on conflict the
+ # whole qualifying set conflicted; on fail only the survivors reached
+ # the verification stage.
+ if [[ "$VERDICT" == "conflict" ]]; then
+ TEXT="⛔ Bug lane: no qualifying fix is self-contained over the stable — all of ${FIX_REFS} conflict. They ride their cycle's 24h path; investigate whether any needs a manual point release. ${RUN_URL}"
+ else
+ TEXT="⛔ Bug lane: verification failed on the synthetic tree for ${SURVIVING_REFS} — the fast tiers went red on BOTH attempts, or the install failed. Either way this is past flake-class: treat it as a real conflict with the stable, not a retryable blip."
+ if [[ -n "${DROPPED_REFS}" ]]; then
+ TEXT="${TEXT} Also dropped for conflict: ${DROPPED_REFS}."
+ fi
+ TEXT="${TEXT} The fixes ride their cycle's 24h path. ${RUN_URL}"
+ fi
+ # Say that the silence which follows is deliberate. Without this a
+ # reader cannot tell "paged once, still refusing every tick" from
+ # "resolved", and would read the quiet channel as good news.
+ TEXT="${TEXT} Further identical refusals stay silent; the lane pages again only if the refusal changes."
+ payload="$(jq -nc --arg t "$TEXT" '{text: $t}')"
+ if curl -sS --fail -X POST -H 'Content-type: application/json' --data "$payload" "$WEBHOOK_URL"; then
+ delivered=true
+ else
+ echo "::warning::bug-lane refusal page failed to POST — the refusal still holds and stays un-marked, so the next tick pages it again."
fi
- TEXT="${TEXT} The fixes ride their cycle's 24h path. ${RUN_URL}"
fi
- payload="$(jq -nc --arg t "$TEXT" '{text: $t}')"
- curl -sS --fail -X POST -H 'Content-type: application/json' --data "$payload" "$WEBHOOK_URL" \
- || echo "::warning::bug-lane refusal page failed to POST — the refusal itself still holds."
+ echo "delivered=${delivered}" >> "$GITHUB_OUTPUT"
+
+ # Gated on DELIVERY, not on the page step's conclusion. The marker means
+ # "the operator has been told"; writing it after a failed POST would
+ # convert a transient Slack outage into permanent silence for that
+ # refusal — strictly worse than the per-tick flood this replaced, which
+ # at least self-healed on the next tick.
+ - name: Record that this refusal was paged
+ if: steps.page.outputs.delivered == 'true'
+ run: printf '%s\n' "${{ steps.refusal.outputs.sig }}" > "${{ steps.refusal.outputs.marker }}"
+
+ - name: Remember the refusal across ticks
+ if: steps.page.outputs.delivered == 'true'
+ uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
+ with:
+ path: ${{ steps.refusal.outputs.marker }}
+ key: bug-lane-refusal-${{ steps.refusal.outputs.sig }}