Skip to content

fix(ci): verify the merge result, not only each pull request #375

Closed

Description

@sydevs-bot

Summary

main stopped compiling for 34 minutes on 7 Nov, and the first thing to notice was an unrelated pull request. #369 and #370 each added one const hasRealPointer = useHasRealPointer() to src/components/organisms/Mapbox/Map.tsx: neither branch held a duplicate, so both were green on their own, and the two squash merges landed both copies — TS2451, twice. The merge queue is what found it, and it is also what would have stopped it: both merges went past the queue.

Approach

Both decisions are settled below. The work splits in three parts, and the first is not a commit.

What actually failed, measured

All times UTC, 2026-11-07.

Time Event Evidence
17:13 #371 merged by hand aaa9818, merged_by: Ardnived, no merge_group run
21:12 #369 merged by hand, adding the declaration 70990fd, merged_by: Ardnived, no merge_group run
21:18 #370 merged by hand on top of it, adding it again — main no longer compiles c2d5351, base 70990fd, head never updated
21:45 #372's queue entry fails pnpm typecheck CI run 42417331658, merge_group, gh-readonly-queue/main/pr-372-c2d5351…, failure
21:52 #372 lands the one-line deletion beside its re-sync 805f675

So main was broken for 34 minutes, unnoticed for 27 of them, and the finder was a contract re-sync that had nothing to do with it.

The only gate that reads a merge result is the queue

Each trigger reads a tree somebody chose. pull_request reads the PR head. merge_group reads the PR merged onto main as it will be — the only one of the two that could have seen two hasRealPointer declarations, because neither branch contained both.

merge_group is configured (.github/workflows/ci.yml:7) and it works: it caught this defect on #372's entry. The hole is which merges reach it. #366, #369, #370 and #371 — the four merged by hand in that window — have no merge_group run at all, while #364, #372, #373 and #376 around them each have one.

Part 1 — require the merge queue for every merge (repository Settings, attended)

No loop run can do this part. Settings → Rules is not in the repo, no mcp__github__* tool reads or writes a ruleset, and a cloud session may not reach the GitHub API any other way. A repo admin makes the change by hand; @sydevs-bot implement does Parts 2 and 3 only.

In the ruleset covering main:

  • turn Require merge queue on;
  • leave no actor bypassing the ruleset, since a bypass is the hole this ticket is about;
  • confirm the required status checks are the three ci.yml posts — Lint, Typecheck & Build, Dependency Review / review, Smoke. The queue runs exactly the checks the ruleset requires, so requiring the queue with no checks required gates nothing.

Nothing in .github/ changes, and nothing stalls. All three jobs already handle a queue entry: the gate runs in full, Dependency Review compares github.event.merge_group.base_sha, and Smoke skips itself with exit 0 and an annotation, because a queue entry has no pull-request number to key a preview on (.github/workflows/ci.yml:108, docs/testing.md). The dispatcher is built for it too — it arms auto-merge and keeps no merge verdict of its own, the ruleset and the merge queue decide that now (sydevs/claude-workflow, dispatcher/gather.mjs:330) — so an approved bot pull request enqueues instead of merging.

Two costs. A merge waits one queue run, measured 2m23s–2m50s across runs 42417964616, 42528479577 and 42534049552. And every merge then creates a gh-readonly-queue/main/pr-<n>-<sha> branch, which starts a sahajatlas-design preview build: that site's Workers Builds branch rules take only a literal branch name or a lone * and cannot exclude the prefix (docs/rules/deployment.md). About half of merges do that today; after this, all of them.

Part 2 — enable @typescript-eslint/no-redeclare

One line in the TypeScript block's rules, beside 'no-unused-vars': 'off' (eslint.config.js:85):

'@typescript-eslint/no-redeclare': 'error',

Re-measured on 4f804c1, eslint 9.39.5 and @typescript-eslint/eslint-plugin 8.11.0:

  • rule on, main as it stands: pnpm lint exits 0. Zero existing violations, so enabling it needs no other change.
  • rule on, a second const hasRealPointer = useHasRealPointer() put back into Map.tsx: Map.tsx 406:9 error 'hasRealPointer' is already defined @typescript-eslint/no-redeclare, exit 1. pnpm typecheck reports TS2451 twice on the same tree.

The base no-redeclare needs no 'off' entry: eslint.config.js never extends js.configs.recommended, so the base rule set is already inert.

⚠ It would not have caught #370. The duplicate existed only in the merged tree; no per-edit hook and no PR lint run ever sees that. The rule's whole gain is that a redeclaration written by hand fails the PostToolUse eslint --fix hook instead of waiting for pnpm typecheck in the lean gate.

⚠ Enable the one rule, not the whole recommended set. Turning on js.configs.recommended across this repo is its own change with its own fallout, and the two should not be confused.

Part 3 — write down what the repo cannot hold

  • docs/testing.md gains a short section: the merge queue is the only gate that reads the merged tree, main is protected by requiring it rather than by a push trigger, and ci.yml's merge_group trigger is what lets a queue entry complete. Record what the ruleset was set to, including its bypass list. Nothing in the repo records the requirement today, so the ruleset is the only place it exists.
  • scripts/ci-workflows.test.ts, in its describe('ci.yml') block (scripts/ci-workflows.test.ts:75), gains one case pinning ci.yml's on: keys as exactly pull_request and merge_group, with no push. Acceptance criterion 3 has no mechanism today, deleting merge_group stalls the queue silently, and this spec already reads workflow text through readRepoSource.

Decisions

  • Should CI run the gate on main itself? → No. There is no clear way to handle or respond to a red run on main, so the breakage is to be stopped before it lands (Ardnived, 2026-11-08)
  • How should a merge result be verified before it lands? → A — require the merge queue for every merge, bypass included (Ardnived, 2026-11-10)
  • Enable @typescript-eslint/no-redeclare as well? → A — yes, one line in eslint.config.js (Ardnived, 2026-11-10)

Acceptance criteria

  • The ruleset covering main requires the merge queue, no actor bypasses the ruleset, and the required checks are the three ci.yml posts.
  • A pull request that compiles alone but not when merged with main cannot reach main without a red check on the merge result.
  • .github/workflows/ci.yml still triggers on pull_request and merge_group, and on no push — and a spec goes red if that changes.
  • docs/testing.md records the merge-queue requirement and the bypass list it was set to, since no other file in the repo does.
  • A duplicate const in one scope fails pnpm lint, naming @typescript-eslint/no-redeclare.

Verification checklist

  • Open Settings → Rules → the ruleset covering main. Record in this ticket whether "Require merge queue" is on, which actors may bypass the ruleset, and which status checks it requires. No mcp__github__* tool reads a ruleset, so this is a browser step for a person.
  • Open a scratch pull request and confirm the merge control offers "Merge when ready" instead of merging at once.
  • Add a second const hasRealPointer = useHasRealPointer() at src/components/organisms/Mapbox/Map.tsx:404. pnpm lint exits non-zero naming @typescript-eslint/no-redeclare at that line. Remove it, and .claude/skills/pr-prep/check.sh is green.
  • pnpm test:run scripts/ci-workflows.test.ts passes, and goes red when merge_group is deleted from .github/workflows/ci.yml or a push: trigger is added.
  • grep -A6 '^on:' .github/workflows/ci.yml lists pull_request and merge_group only.

Notes

🤖 Written by the sydevs autonomous loop — see what this is

Activity

  1. added theissue type on Nov 7, 2026
  2. added
    proposal
    on Nov 7, 2026
  3. Ardnived commented on Nov 8, 2026

    @Ardnived
    Contributor

    @sydevs-bot Revise. We don't want to run the gate on main itself because we don't have a clear way to handle and respond to that. We want to avoid the problem before that. Give me options.

  4. added
    bot:working
    and removed
    proposal
    on Nov 8, 2026
  5. sydevs-bot commented on Nov 8, 2026

    @sydevs-bot
    ContributorAuthor

    🤖 no session running

    recent dispatches
    • 17:16Z implement · attempt 1 · session · done
    • 17:16Z implement · attempt 1 · session
    • 16:44Z implement · attempt 1 · session · done
    • 16:44Z implement · attempt 1 · session
    • 17:58Z revise · attempt 1 · session · done

    Written by the sydevs dispatcher. Sessions never edit this comment.

  6. moved this from Awaiting to Working in SYDevelopers Technical Roadmapon Nov 8, 2026
  7. changed the title [-]fix(build): typecheck main itself, not only pull requests[/-] [+]fix(ci): verify the merge result, not only each pull request[/+] on Nov 8, 2026
  8. sydevs-bot commented on Nov 8, 2026

    @sydevs-bot
    ContributorAuthor

    Reshaped, and the push: branches: [main] trigger is gone.

    The merge queue would have prevented this. It reads each PR merged onto main — the only tree that ever held two hasRealPointer declarations, since neither branch held both. It proved that by failing #372's queue entry at 21:45Z, 27 minutes after #370 landed.

    The hole is which merges reach it. #366, #369, #370 and #371 were merged by hand and have no merge_group run; #364, #372, #373 and #376 each have one. Whether the rule is off or bypassed is in Settings → Rules, which no MCP tool reads.

    Two questions in the body:

    1. Require the queue for every merge (recommended), require branches up to date, or change no setting.
    2. Enable @typescript-eslint/no-redeclare (recommended: one line, zero existing violations). It would not have caught fix(ui): dark-theme and display fixes from the 6 Nov bug sweep #370 — no branch held the duplicate.

    Also corrected: #372 fixed main, not #373. Retitled to fix(ci):. Type stays Bug.

    @sydevs-bot implement starts the work once 1 is answered.

    🤖 Written by the sydevs autonomous loop — see what this is


    Generated by Claude Code

  9. removed
    bot:working
    on Nov 8, 2026
  10. moved this from Working to Awaiting in SYDevelopers Technical Roadmapon Nov 8, 2026
  11. Ardnived commented on Nov 10, 2026

    @Ardnived
    Contributor

    @sydevs-bot revise 1A 2A

  12. 3 remaining items

  13. removed
    bot:working
    on Nov 10, 2026
  14. moved this from Working to Awaiting in SYDevelopers Technical Roadmapon Nov 10, 2026
  15. Ardnived commented on Nov 11, 2026

    @Ardnived
    Contributor

    @sydevs-bot implement

  16. added
    bot:working
    on Nov 11, 2026
  17. moved this from Awaiting to Working in SYDevelopers Technical Roadmapon Nov 11, 2026
  18. removed
    bot:working
    on Nov 11, 2026
  19. added
    bot:working
    on Nov 11, 2026
  20. sydevs-bot commented on Nov 11, 2026

    @sydevs-bot
    ContributorAuthor

    Nothing left to build. #390 carries Parts 2 and 3, pushed at aed88d7 and already through a critic round.

    • @typescript-eslint/no-redeclare enabled — criterion 5.
    • docs/testing.md records the merge-queue requirement, observed column blank — criterion 4, half met.
    • scripts/ci-workflows.test.ts pins ci.yml's on: keys — criterion 3.

    Part 1 is yours. Criteria 1 and 2, and the observed half of 4, need Settings → Rules. No run reaches a ruleset, so #390 says Refs #375 and merging it leaves this ticket open.

    This run was a reconcile re-fire. The 16:44Z implement session opened #390 but left no comment here, so the verb read as unanswered and the approval stayed live — dispatcher/decide.mjs:1124 counts an implement verb answered only when a PR closes the issue. Journalled as friction.

    The approval is spent. Say @sydevs-bot implement again only if something here needs rebuilding.

    🤖 Written by the sydevs autonomous loop — see what this is


    Generated by Claude Code

  21. removed
    bot:working
    on Nov 11, 2026
  22. moved this from Working to Awaiting in SYDevelopers Technical Roadmapon Nov 11, 2026
  23. Ardnived commented on Nov 11, 2026

    @Ardnived
    Contributor

    Implemented by #390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    Medium

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions