Skip to content

fix(publish-verify): sweep only push heads; stack-merge intermediates never publish (#975) - #978

Merged
bpalermo merged 2 commits into
mainfrom
fix/publish-verify-stack-merges
Sep 27, 2026
Merged

bpalermo merged 2 commits into
mainfrom
fix/publish-verify-stack-merges

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Cause

publish runs once per push to main, for the push's head commit. gh-stack #963 merged #959, #962, #964, #965 and #966 atomically: five squash commits in one push whose head was 4930733. publish ran for 4930733 and published it completely. d74d77a, 690dbb5, 937a8fd and ef44437 were never the tree of any publish run, so they have no artifacts by construction, and nobody can pin a deploy to them. The --recent sweep in scripts/verify-published-artifacts.sh checked every commit on main, so it filed #975 about all four.

Fix

The sweep now checks only the push heads in its window. Every other commit is printed by name as skip <sha> (not a push head: publish never ran for it — <subject>), so the narrowing always shows up in the log.

  • Source of push heads: GitHub's repository activity log for refs/heads/main (GET /repos/{repo}/activity), in scripts/push-heads-lib.sh. I chose it over gh run list --workflow publish.yaml on purpose. The run list would narrow the gate to "commits a publish run exists for", and "a run that never existed" is one of the three failures publish: a commit merged to main can silently publish nothing (queued run superseded) #880 built this verifier to catch. The activity log records the push itself. A superseded publish (publish: a commit merged to main can silently publish nothing (queued run superseded) #880's cancelled case) or a missing run still leaves a push head, and the sweep still goes red for it.
  • Quiet-window fallback (No shell script in the root workspace is linted: the shellcheck aspect has no sh_* target to visit #853): the fallback is now "the newest push head older than the grace period", so a scheduled run always checks something real.
  • Fail-closed inputs: an empty head list, an unreadable one, or one holding an abbreviated sha exits 2 (inconclusive). It is never treated as "nothing to check".
  • Unchanged: the workflow_run path, which verifies a publish run's own head sha (a push head by definition), and explicit commits (make check-published COMMIT=…, workflow_dispatch). An explicit stack intermediate still reports MISSING, which is the true answer.
  • Testability: select_push_heads is pure (candidates on stdin, head-list file). scripts/check-push-head-selection.sh pins it and runs in the ci workflow next to the signature-layout check, with no network access.

Proof the gate still goes red

  • Real activity log, --recent: exit 0. The output reads 16 push head(s) … (4 non-head commit(s) skipped), the four skips are exactly the publish: artifacts missing for a commit on main #975 intermediates, and it ends PASS: 320 artifact(s) present across 16 commit(s).
  • Fabricated head list (PUSH_HEADS_FILE = the real heads plus ef44437, which was never published): exit 1, 20 MISSING lines for ef44437, FAIL: 20 of 340 artifact(s) missing across 17 commit(s). A push head with missing artifacts still fails.
  • Empty PUSH_HEADS_FILE: exit 2, push-head list is empty; refusing to skip every commit.
  • Mutation of select_push_heads (every candidate becomes check): check-push-head-selection.sh reports 3 FAILs and exits 1.
  • Shellcheck: bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //scripts/... is clean, and aquery confirms both new files are inputs to the shellcheck action. make format-check and check-shell-lint.sh are clean, and the edited workflows parse as YAML.

Not run

  • The workflow itself was not run in Actions. In particular, I have not observed GH_TOKEN: github.token reading /activity from a runner; I only called the endpoint with my local gh auth. GitHub documents it as needing only metadata read, which every GITHUB_TOKEN has.
  • The failure-issue step was not exercised.

Closes #975

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

… never publish (#975)

publish runs once per push to main, for the push's head. gh-stack #963
landed #959/#962/#964/#965/#966 as five squash commits in ONE push
headed by 4930733: publish ran for 4930733 and published it fully, and
d74d77a, 690dbb5, 937a8fd and ef44437 were never the tree of any publish
run. The --recent sweep checked every commit on main and filed #975 for
all four.

The sweep now checks the push heads in its window and prints every other
commit as `skip <sha> (not a push head ...)`. Heads come from GitHub's
activity log for refs/heads/main (scripts/push-heads-lib.sh), not from
the list of publish runs: the log records the push itself, so a push
whose publish run was cancelled (#880) or never created is still a head
and still goes red. The quiet-window fallback now picks the newest push
head older than the grace period, and an empty/unreadable/abbreviated
head list is inconclusive (exit 2), never "nothing to check". Explicit
commits (make check-published COMMIT=..., workflow_run) are unchanged.

scripts/check-push-head-selection.sh pins the selection in CI (no
network), including the fail-closed inputs.

Closes #975

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 1ad4b6a into main Sep 27, 2026
24 checks passed
@bpalermo
bpalermo deleted the fix/publish-verify-stack-merges branch September 27, 2026 10:25
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.

publish: artifacts missing for a commit on main

1 participant