From afd7a2670d061448193689e000ff7bb3be848363 Mon Sep 17 00:00:00 2001 From: Wynne Pirini Date: Thu, 22 Oct 2026 07:44:10 +1300 Subject: [PATCH] fix(cla): stop locking merged PRs, and enforce an append-only signature ledger The CLA action's `lock-pullrequest-aftermerge` input defaults to true and cla.yml did not override it, so every merged PR had its conversation locked. That is not repo CI and not a manual lock, which is why it looked like a mystery: grepping the workflows finds nothing, because it is an action default. The cost showed up today. A pullfrog run on merged #142 went green and posted nothing, because `report_progress` and `create_pull_request_review` both fail on a locked conversation. A healthy run that produces no output reads as a broken integration, and an @mention on a merged PR can never be answered. The lock exists so a contributor cannot revoke their signing comment. That is not the record. Signatures are appended to signatures/version1/cla.json, committed to main, and the action only ever appends (persistence.ts calls push(), never a removal). An outside contributor has no write access here, so they cannot alter the ledger or rewrite main's history either. So: turn the lock off, and make the actual guarantee enforced rather than assumed. A new ci.yml step fails any pull request that drops a contributor who had already signed, comparing by id so a login rename is not a false positive. Verified locally: unchanged passes, a removed entry fails naming the person, an added entry passes. Set explicitly rather than left to the default, so an action bump cannot silently reintroduce the lock. --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ .github/workflows/cla.yml | 13 +++++++++++++ 2 files changed, 49 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a71427ba..491ffd90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,42 @@ jobs: steps: - uses: actions/checkout@v7 + # The CLA signature ledger may only grow. Signatures live in + # signatures/version1/cla.json, committed to main, and the contributor-assistant action + # only ever appends to it. This step makes that invariant enforced rather than assumed: + # no pull request may drop a contributor who had already signed. It matters because + # cla.yml no longer locks merged PRs (see the comment there), so the ledger is the + # guarantee rather than the locked conversation. + - name: CLA ledger is append-only + if: github.event_name == 'pull_request' + run: | + set -euo pipefail + ledger=signatures/version1/cla.json + git fetch --no-tags --depth=1 origin "${{ github.base_ref }}" + # Bootstrap case: if the base branch has no ledger yet, there is nothing to protect. + if ! git cat-file -e "FETCH_HEAD:${ledger}" 2>/dev/null; then + echo "No CLA ledger at base; nothing to protect yet." + exit 0 + fi + git show "FETCH_HEAD:${ledger}" > /tmp/cla-base.json + python3 - <<'PY' + import json, sys + + def load(path): + with open(path, encoding="utf-8") as handle: + return json.load(handle)["signedContributors"] + + base = load("/tmp/cla-base.json") + head = load("signatures/version1/cla.json") + # id is stable across a login rename; name is only for the message. + base_by_id = {entry["id"]: entry.get("name", "?") for entry in base} + head_ids = {entry["id"] for entry in head} + removed = [f"{name} (id {sid})" for sid, name in base_by_id.items() if sid not in head_ids] + if removed: + sys.exit("CLA signatures may not be revoked, but these were removed: " + ", ".join(removed)) + print(f"CLA ledger append-only: {len(base_by_id)} signed at base, {len(head_ids)} now, none removed") + PY + - uses: pnpm/action-setup@v6 with: version: 10.32.1 diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index db8096a2..97d99466 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -45,3 +45,16 @@ jobs: custom-allsigned-prcomment: 'All contributors have signed the CLA. ✅' # TODO: replace with your maintainers' GitHub usernames. allowlist: 'shockalotti,dependabot[bot]' + # The action's default is 'true', which locks every merged PR's conversation. That + # silently blocks all post-merge activity: a bot cannot post a review, and a mention + # on a merged PR can never be answered. It caused a green pullfrog run that produced + # nothing, which reads as a broken integration rather than a lock. + # + # Disabling it does NOT let contributors revoke their CLA, which is what the lock + # exists for. The record is not the signing comment: signatures are appended to + # signatures/version1/cla.json, committed to main, and the action only ever appends + # (src/persistence/persistence.ts does push(), never a removal). An outside + # contributor has no write access to this repository and cannot alter that ledger or + # rewrite main's history. The "CLA ledger is append-only" step in ci.yml enforces + # that no pull request ever removes a recorded signature. + lock-pullrequest-aftermerge: 'false'