Skip to content

fix(ci): gate the identical-tree fallback on the dedup signature - #404

Merged
entelecheia merged 1 commit into
mainfrom
fix/release-gate-fallback-absent-only
Sep 27, 2026
Merged

entelecheia merged 1 commit into
mainfrom
fix/release-gate-fallback-absent-only

Conversation

@entelecheia

Copy link
Copy Markdown
Member

Refs #402, fixes the P1 from the unresolved post-merge Codex review thread on #403 (.github/workflows/release.yml).

The bug

#403 added an identical-tree fallback to release.yml verify-ci and release-readiness.yml Gate ci-matrix: when the target commit's own five gate check runs were not all green, the gates accepted a merged PR head's green runs whenever the trees matched. The fallback was unconditional. So if ci.yml's decision job fell back to a full main run (e.g. after a transient API failure during decision) and any main job then completed with failure, the tagged commit had a failed own run — yet verify-ci would still pass it on the strength of the earlier green PR checks. A release could proceed on a tree whose own CI was red, and Gate ci-matrix could likewise turn that failure into a pass.

The rule change

The fallback now runs only when the commit shows the dedup signature: every one of the five gate check runs (lint, pdf-parity, test (ubuntu-latest), test (macos-latest), test (windows-latest)) is absent or completed/skipped (completed/neutral counts as skipped). That is the observed shape of a deduplicated main commit — verified on merge commit 4d23291c (main CI run 36315089713, only decision executed): lint and pdf-parity are completed/skipped, the unexpanded matrix parent test (${{ matrix.os }}) is completed/skipped, and the three per-OS test names are entirely absent.

Any real own result disables the fallback:

  • a failure, cancellation, or any other completed non-success conclusion;
  • a pending / queued / in-progress run;
  • a partial success (e.g. lint green with the rest absent) — a real own result exists, so the signature no longer holds.

In those cases the pre-#403 behavior applies unchanged: release.yml fails with its original message (Tagged commit $GITHUB_SHA has no green CI. Let the CI workflow pass on main, then re-run this workflow.), and Gate ci-matrix keeps its existing fail/pending outcome and evidence text byte-identical (no PR-head reference is added). When the dedup signature does hold and the fallback is attempted but the PR head is not green or the trees differ, the #403-era message naming the missing identical-tree green PR head still applies. The logic stays inline in both files (the readiness step is a controller step under the trust policy).

Verification

  • YAML parses (yaml.safe_load) and both edited run: blocks pass bash -n.
  • Scenario harness (the edited step scripts extracted verbatim, run against a fake gh API): 31/31 pass, including all 16 pre-ci: skip main re-verification of PR-verified trees; harden release workflow #403-follow-up scenarios and the new gating cases:
    • (a) own failed job + green identical-tree PR head -> fails with the original message, fallback not attempted (no PR-head evidence cited) — both verify-ci and Gate ci-matrix;
    • (b) absent/completed/skipped mix + green identical-tree head -> fallback passes;
    • (c) one name pending (in_progress) + green identical-tree head -> no fallback (verify-ci fails with the original message; readiness records pending with its own-run evidence) ;
    • (d) the real 4d23291c shape (lint + pdf-parity + unexpanded matrix parent skipped, decision green, per-OS names absent) + green identical-tree head -> fallback passes in both files;
    • partial own success + green identical-tree head -> no fallback in either file.
  • Full local gate: scripts/check.sh ends with
    == check: OK (fmt/clippy/test/crate-edges/pdf-runner/structured-corpus/claims/doc-surface/release-block/readiness-selfcheck/skip-accounting/public-parity=skipped) skipped-for-missing-fixtures=4 (optional=4) ==
    (public-parity=skipped is expected on a host without the pinned pdfinfo version 24.02.0.)

No gates weakened: any doubt still fails closed, and the fallback is now strictly narrower than in #403.

Post-merge review of #403 found a P1: if ci.yml's decision job fell back to
a full main run (e.g. after a transient API failure) and any main job then
failed, the unconditional identical-tree fallback in release.yml verify-ci
(and the equivalent in release-readiness.yml Gate ci-matrix) still accepted
the earlier green PR-head checks because the trees were identical — a
release could proceed despite the tagged commit's own failed CI.

The fallback now runs only when every one of the five gate check runs on
the evaluated commit is absent or completed/skipped (neutral counts as
skipped) — the observed dedup signature (merge commit 4d23291, run
36315089713: lint and pdf-parity completed/skipped, the three per-OS test
names absent). Any real own result — a failure, a cancellation, a pending
or in-progress run, or a partial success — disables the fallback and
restores the pre-#403 behavior: release.yml fails with its original
message, and readiness keeps its existing fail/pending evidence text
byte-identical. When the dedup signature holds and the fallback is
attempted but the PR head is not green or the trees differ, the #403
message naming the missing identical-tree green PR head still applies.

Refs #402
Copilot AI balanced review requested due to automatic review settings September 27, 2026 11:31

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped: your organization has reached its API usage limit, so Code Review can't run right now.

An organization admin can review the limit in your organization's usage and billing settings.

Once the limit resets or is raised, reopen this pull request to trigger a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T11:35:00.159649Z 79fb992 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@entelecheia
entelecheia merged commit 1989573 into main Sep 27, 2026
7 checks passed
@entelecheia
entelecheia deleted the fix/release-gate-fallback-absent-only branch September 27, 2026 11:43
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.

2 participants