Skip to content

ci: bring signed-landing to its final revision - #855

Merged
kiwidream merged 1 commit into
mainfrom
kiwidream/signed-landing-final
Nov 12, 2026
Merged

kiwidream merged 1 commit into
mainfrom
kiwidream/signed-landing-final

Conversation

@kiwidream

@kiwidream kiwidream commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

What and why

The signed-landing check on main is its first revision. This brings it to the revision that landed in Qbit-Org/qbit-white-paper#13 after a pilot there; the file is the same in every Qbit-Org repository apart from the branches that merge as they are.

What was wrong with the first revision: the check's result sits on the head commit, and one commit can head two pull requests. Into one branch it is a single signed commit and passes; into another it is several commits and fails. Whichever run finished last decided for both, and the run that decided relied on GitHub's answers, which can lag an event by a moment.

What the check does now:

  • It judges every pull request that could merge the same head commit, from any branch or fork and drafts aside, and passes only if all of them may land. Its message names the one that can't. Runs are grouped by head commit, and the newest cancels the older ones, so one run decides for a commit.
  • It keeps its own record of events. Each run's title holds the pull request's number, its updated_at, its state, whether it is a draft, its base branch and its head commit. So a pull request that was just opened on the commit or pushed to it is found even when GitHub's list of open pull requests doesn't show it yet, and an answer stamped earlier than a recorded event is asked for again.
  • A pull request's count of its commits has to equal what git says its head has and its base branch lacks.
  • Closing a second pull request on the commit, or turning it into a draft, clears the commit from that pull request's own run, with no re-run.
  • Only the workflow's pull_request_target runs count as its record, and a burst of runs doesn't push a run out of it.

The workflow's permissions gain actions: read (its own runs) and contents: read (git's comparison of a base branch with the head commit). It still checks out nothing and uses no action.

The README states what the workflow can't change: a run starts a few seconds after its event and the commit keeps its last result until then, a change made with a workflow's own token starts no run, a run that stays queued leaves the last result in place, and every run draws on the workflow token's hourly allowance of requests.

No ruleset file changes.

Checks

  • The check's script has 93 unit tests against real GitHub answers, and each of its rules fails a test when it is removed or weakened.
  • The same file was run from main in qbit-white-paper on two throwaway pull requests: one signed commit passed, a second pull request on the same commit into another base failed both, and closing it turned the first green from the closed pull request's own run.
  • This pull request is judged by main's current copy of the check, the first revision, and shows a red signed-landing until it is squashed into one signed commit at landing.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T16:40:22.578583Z 9be2c5a New commits
ℹ️ 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.

@qbit-reviewer qbit-reviewer 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.

Incomplete review: only the available changes were reviewed.

No bugs or security points in the reviewed changes.

Not posted: 1 lead. Reviews post bugs and security points only; the rest stay in Sixth Man's ledger.

Reviewed by Claude Opus 5.5.

## What and why

The `signed-landing` check on `main` is its first revision. This brings it to the revision that landed in Qbit-Org/qbit-white-paper#13 after a pilot there; the file is the same in every Qbit-Org repository apart from the branches that merge as they are.

What was wrong with the first revision: the check's result sits on the head commit, and one commit can head two pull requests. Into one branch it is a single signed commit and passes; into another it is several commits and fails. Whichever run finished last decided for both, and the run that decided relied on GitHub's answers, which can lag an event by a moment.

What the check does now:

- It judges every pull request that could merge the same head commit, from any branch or fork and drafts aside, and passes only if all of them may land. Its message names the one that can't. Runs are grouped by head commit, and the newest cancels the older ones, so one run decides for a commit.
- It keeps its own record of events. Each run's title holds the pull request's number, its `updated_at`, its state, whether it is a draft, its base branch and its head commit. So a pull request that was just opened on the commit or pushed to it is found even when GitHub's list of open pull requests doesn't show it yet, and an answer stamped earlier than a recorded event is asked for again.
- A pull request's count of its commits has to equal what git says its head has and its base branch lacks.
- Closing a second pull request on the commit, or turning it into a draft, clears the commit from that pull request's own run, with no re-run.
- Only the workflow's `pull_request_target` runs count as its record, and a burst of runs doesn't push a run out of it.

The workflow's permissions gain `actions: read` (its own runs) and `contents: read` (git's comparison of a base branch with the head commit). It still checks out nothing and uses no action.

The README states what the workflow can't change: a run starts a few seconds after its event and the commit keeps its last result until then, a change made with a workflow's own token starts no run, a run that stays queued leaves the last result in place, and every run draws on the workflow token's hourly allowance of requests.

No ruleset file changes.

## Checks

- The check's script has 93 unit tests against real GitHub answers, and each of its rules fails a test when it is removed or weakened.
- The same file was run from `main` in qbit-white-paper on two throwaway pull requests: one signed commit passed, a second pull request on the same commit into another base failed both, and closing it turned the first green from the closed pull request's own run.
- This pull request is judged by `main`'s current copy of the check, the first revision, and shows a red `signed-landing` until it is squashed into one signed commit at landing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Squashed commits:
7b344a6 ci: bring signed-landing to the revision that landed in qbit-white-paper

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@kiwidream
kiwidream force-pushed the kiwidream/signed-landing-final branch from 7b344a6 to 9be2c5a Compare November 12, 2026 16:38

@qbit-reviewer qbit-reviewer 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.

Worth a look

1. [low · security] judge_all skips judging this PR on a head mismatch alone, no longer requiring the event to agree

.github/workflows/signed-landing.yml:285

The old judge_all skipped a PR only when its event and GitHub's answer agreed it was closed or a draft. Otherwise judge() raised Behind on head lag (line ~234). Now, whenever there are others, standing() == "gone" skips judge(). That includes the case where the answer's head.sha differs from the event's head (line 462). The only guard is outrun() (lines 478-488), which accepts any answer stamped strictly later than every recorded event. Scenario: PR A (several commits, head X) shares X with PR B (one signed commit). A's synchronize run reads an answer whose updated_at has moved past the push, for example because of a comment, while head.sha still shows the old head. A is then skipped, B passes, and X turns green. Unproven: this depends on whether GitHub can return updated_at newer than an event while head.sha still lags. A human should check that. A safer form is to skip judge() only when the answer is closed or a draft, and let a head mismatch reach judge() and raise Behind.

Not posted: 2 nits and 2 leads. Reviews post bugs and security points only; the rest stay in Sixth Man's ledger.

Reviewed by Claude Opus 5.5.

@kiwidream

Copy link
Copy Markdown
Member Author

On the point from the review of 9be2c5ab (low, "judge_all skips judging this PR on a head mismatch alone"): kept, with the guard the review names.

The run's own pull request steps aside for a head mismatch only when GitHub's answer is stamped strictly later than every event the check has recorded for it, which includes the event this run is for. The scenario needs an answer whose updated_at has moved past the push while its head.sha has not, that is, one answer that is new in one field and old in another. updated_at and the head are both read from the pull request itself in one answer; in the probes on Qbit-Org/qbit-white-paper (a push and four changes of base) the answer carried the event's stamp and the new head or base together on the first read. I can't prove that from outside GitHub.

Skipping only for closed or draft, as suggested, brings back what the earlier revision did: a leftover run for a commit its pull request has moved off fails that commit for another pull request that still heads it, which reviewers raised on three of these pull requests. The daily audit of merged pull requests is the backstop for the case described.

@kiwidream
kiwidream merged commit 30dc9b6 into main Nov 12, 2026
42 checks passed
kiwidream added a commit that referenced this pull request Nov 13, 2026
Since 3.x.x last took main at v3.1.1 (6046726), main gained the later
revisions of the ruleset files, the signed-landing workflow and its two
required-check rulesets (#837, #840, #855).

.github/rulesets/README.md conflicted because both branches added it.
3.x.x's copy was main's first revision (aed3bd6) unchanged, so main's
current text is taken.

Two edits are not from main:

- docs/releasing.md: a synchronization lands with the merge button. The
  version lines take changes only through a pull request that passes
  signed-landing, so the fast-forward push this guide described is
  refused.
- docs/ci-same-tree-skip.md: renamed branches, as a limit of the skip
  (the note promised on #839).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.

1 participant