Skip to content

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

Merged
sydevs-bot merged 6 commits into
mainfrom
claude/fix-375-verify-merge-result
Nov 11, 2026
Merged

sydevs-bot merged 6 commits into
mainfrom
claude/fix-375-verify-merge-result

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Records the merge-queue requirement in docs/testing.md, the only place the repo can hold it, and pins ci.yml's on: keys so deleting merge_group goes red instead of stalling the queue.
  • Enables @typescript-eslint/no-redeclare, so a redeclaration written by hand fails the edit hook rather than pnpm typecheck.

⚠ Part 1 of the ticket is not in this PR and cannot be. Requiring the merge queue is a repository Settings edit: no mcp__github__* tool reads or writes a ruleset, and a cloud session may not reach the GitHub API another way. Acceptance criteria 1 and 2 stay open, and so does the observed half of criterion 4. So this PR says Refs #375, not Closes — merging it must not close the ticket. The ticket says so under § Notes.

Change outline

Behaviour — the rule, and what it can reach

 eslint.config.js  TypeScript block, rules
   'no-unused-vars': 'off'
+  '@typescript-eslint/no-redeclare': 'error'
+    fires on a hand-written redeclaration      # at the edit hook, not at typecheck
+    fires on a merge_group entry               # gate runs pnpm lint there too
+    could not have fired for #370              # that merge went past the queue
   '@typescript-eslint/no-unused-vars': [...]

Base no-redeclare needs no 'off': this config never extends js.configs.recommended, so it is already inert.

Contract — what docs/testing.md now holds

The ruleset is the contract here, and it lives somewhere the repo cannot read. Paraphrased, one rule per line, § "The merge queue is the only gate that reads the tree a merge will produce":

+ pull_request reads head merged into main — but the main of when the run fired
+ a base that moves afterwards fires nothing; #370's head was never re-pushed
+ the queue builds each entry against the main it will land on, and serialises them
+ main is protected by requiring the queue, not by a push trigger
+ why a push run routes nowhere → links § "A red run files its own ticket" above
+ ruleset target: require merge queue on, bypass empty, three required checks
+ beside it a blank `observed` column — nobody has read the dashboard back yet
+ costs: one queue run per merge (2m23s–2m50s), one -design build per queue branch

Flow — what each trigger reads, and where the window is

 pull_request                                     .github/workflows/ci.yml
   github.ref = refs/pull/<n>/merge
   actions/checkout@v7, no ref: override          # so the gate DOES read a merged tree
-    merged against main as it is now
+    merged against main as it was when this run fired
+      base moves → nothing re-fires              # ← the window #370 fell through
 merge_group
   github.ref = the queue entry
     merged against the main it will land on      # the window is closed, not narrowed
   gate / Dependency Review / Smoke all report    # Smoke exits 0 with an annotation

Preview

Nothing deployed changes. The diff is an eslint rule, a docs section and a spec case — no src/ file and no build output is touched, so neither the app nor the -design playground preview can show it. The three verification runs below are the observation instead.

Test results

Re-run on aed88d7, after the review round and a clean merge of origin/main (44781f6, a contracts re-sync that touches no file this branch does).

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh — lint, typecheck, test:run (165 files, 1998 tests)
  • Targeted specs: scripts/ci-workflows.test.ts 15 passed (14 before this branch)
  • Build: N/A — CI runs it
  • Comment lint: clean (comment-lint.mjs --base origin/main)
  • Security review: skipped, no path in securityReview.triggerPattern and no src/ change

Each new assertion was watched to fail at the site that causes it, per docs/testing.md § "A regression spec is not finished until it has FAILED":

The three failures, measured
defect reintroduced result
merge_group: deleted from ci.yml expected [ 'pull_request' ] to deeply equal [ 'merge_group', 'pull_request' ]
push: branches: [main] added to ci.yml expected [ 'merge_group', 'pull_request', …(1) ] to deeply equal [ 'merge_group', 'pull_request' ]
second const hasRealPointer = useHasRealPointer() at Map.tsx:405 405:9 error 'hasRealPointer' is already defined @typescript-eslint/no-redeclare, exit 1; pnpm typecheck reports TS2451 on lines 404 and 405

With the rule on and the tree as it stands, pnpm lint exits 0 — zero existing violations.

Manual verification

The first two are the ticket's Part 1, and nothing in this PR can do them.

  1. Settings → Rules → the ruleset covering main: turn Require merge queue on, leave the bypass list empty, and confirm the required checks are Lint, Typecheck & Build, Dependency Review / review and Smoke. The queue runs exactly the checks the ruleset requires, so requiring the queue with none required gates nothing.
  2. Then fill in the observed column of docs/testing.md's ruleset table with what the dashboard actually showed, and date it. Every cell in it is blank today. A scratch PR's merge control should offer "Merge when ready" instead of merging at once.

Notes for reviewer

The review pass changed what this PR claims, and the correction is worth your eye. The ticket states that pull_request "reads the PR head", and that the rule "would not have caught #370" because "no PR lint run ever sees" the merged tree. Both are wrong, and I verified it rather than shipping the ticket's wording:

  • github.ref is refs/pull/<n>/merge on a pull_request event and ci.yml's actions/checkout@v7 carries no ref:, so the gate already reads a merged tree.
  • The gate job has no if:, so pnpm lint runs on a merge_group entry too — the rule does fire against a merged tree there.

So the real gap is a stale base, not an absent merge, and the ticket's own evidence is that case exactly: #370's head was never re-pushed after #369 landed six minutes earlier. The docs section says that; the ticket's § Approach does not, and is superseded by this PR.

That reading makes "Require branches to be up to date before merging" a cheaper-looking alternative. It is not equivalent — it leaves the race between the green check and the merge open, which the queue closes by serialising — and the choice is settled anyway (Ardnived, 2026-11-10). Raised here only because the corrected mechanism is what makes the question askable at all.

Detail

Why the rule is one line and not js.configs.recommended. Turning the whole recommended set on across this repo is its own change with its own fallout; the ticket rules it out and ⚠ marks it. Measured on this tree with eslint 9.39.5 and @typescript-eslint/eslint-plugin 8.11.0.

Why the ruleset table is in docs/testing.md, and why its observed column is empty. Writing a value I cannot read back would make the table the thing it is there to prevent. The to be set to column states the target; the observed column stays blank until a person reads the dashboard, so neither can be mistaken for the other.

Prettier was not run over the two changed non-spec files. pnpm lint passes, but prettier --check fails on docs/testing.md and eslint.config.js on main already, and --write mangles an existing paragraph in docs/testing.md (the scripts/**/*.mjs line collapses into backtick soup). Neither file is covered by a formatting gate. Left alone deliberately — reformatting them is a separate change.

Not in scope, per the ticket: whether js.configs.recommended should be on at all, and whether the three-PR sweep should have been one PR.

Refs #375


Generated by Claude Code

#369 and #370 each added one `const hasRealPointer = useHasRealPointer()`
to Map.tsx. Neither branch held a duplicate, both were green alone, and
the two squash merges landed both copies — TS2451, twice, for 34 minutes
on main.

What this rule buys is the redeclaration written by hand, which now fails
the PostToolUse `eslint --fix` hook instead of waiting for `pnpm typecheck`
in the lean gate. It is not blind to a merged tree — the gate job runs
`pnpm lint` on a `merge_group` entry too — but it did not catch #370,
because that merge went past the queue entirely.

Measured on this tree, eslint 9.39.5 with @typescript-eslint 8.11.0: the
rule on, `pnpm lint` exits 0 — zero existing violations, so enabling it
needs no other change. With the duplicate put back at Map.tsx:405, lint
exits 1 naming `@typescript-eslint/no-redeclare` and typecheck reports
TS2451 on both lines.

The base `no-redeclare` needs no `'off'` entry: this config never extends
`js.configs.recommended`, so the base rule set is already inert. The whole
recommended set stays off — that is its own change with its own fallout.

Refs #375

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXaYsVN3SZo9GicDh1
…riggers

The requirement lives in Settings → Rules, which no `mcp__github__*` tool
reads and no cloud session can reach another way, so the repo had no
record of it at all.

docs/testing.md gains that section. ⚠ It states the mechanism more
narrowly than #375 did: `pull_request` does NOT read the pull request's
bare head — `github.ref` is `refs/pull/<n>/merge` and ci.yml's bare
`actions/checkout@v7` takes it — so the gate already reads a merged tree.
The trap is that the base it merged against is whatever `main` was when
the run fired, and a base that moves afterwards fires nothing. #370 is
exactly that: its head was never re-pushed after #369 landed six minutes
earlier. The queue closes the window rather than narrowing it, by building
each entry against the `main` it will land on and serialising them.

The section also records why main is protected by requiring the queue
rather than by a `push` trigger (a run on main resolves to no pull
request, so a red one reaches no handler), what the ruleset is to be set
to including its empty bypass list, and the two measured costs — one
queue run per merge, and a `sahajatlas-design` preview build per
`gh-readonly-queue/` branch.

⚠ The ruleset table is marked as not yet confirmed. Setting it is an
attended browser step; whoever makes it records the date and the values
they observed.

The spec covers acceptance criterion 3, which had no mechanism: deleting
`merge_group` stalls every merge in the queue with no red anywhere.
Watched to fail at both sites before keeping it — `merge_group` deleted
gives ['pull_request'], and a `push: branches: [main]` trigger added
gives three keys. Both red; restored, green.

Refs #375

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXaYsVN3SZo9GicDh1
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 11, 2026
@sydevs-bot

sydevs-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 17:09Z address-review · attempt 1 · session · done
  • 17:09Z address-review · attempt 1 · session
  • 17:03Z review-pr · attempt 1 · session · done
  • 17:03Z review-pr · attempt 1 · session

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

@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 11, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🧐 Adversarial review

The diff matches the ticket: Parts 2 and 3, nothing smuggled in. The ladder found nothing the repo already had. The correction in § Notes for reviewer is right and worth your eye — pull_request does check out refs/pull/<n>/merge, so the gap is a stale base, not an absent merge.

Two things to settle. Closes #375 closes the ticket while criteria 1 and 2 are unmet, and the ruleset is the actual gate. Separately, this PR writes the push-vs-queue rationale four times over.

Findings

  • should-fix — Closes #375 in the body. The PR says itself that criteria 1 and 2 stay open. Merging closes the ticket and drops Part 1. Use Refs #375 and tick only what shipped.
  • should-fix — docs/testing.md:342 repeats docs/testing.md:277-281 almost word for word, same dispatcher/resolve.mjs citation.
  • consider — docs/testing.md:359 records the ruleset as set. Criterion 4 asks for the values it was set to.
  • consider — scripts/ci-workflows.test.ts:190 restates ci.yml:5-7, three lines above the trigger it describes.

What was checked

  • Ticket #375 against the diff — 3 files, 77 lines, all additions.
  • eslint.config.js:29-95 — no @eslint/js import and no js.configs.recommended, so base no-redeclare is inert, as claimed.
  • The new spec, traced against ci.yml:1-10. It passes, and reddens on a deleted merge_group or an added push. Flow style or a quoted "on": throws loudly rather than passing by vacuum.
  • claude-workflow dispatcher/resolve.mjs:136-155 — pr.head.sha !== sha skips, so the no-handler claim holds.
  • ci.yml:22,94-95,109 — the three check names in the table are right, Dependency Review / review included.
  • docs/rules/deployment.md — the gh-readonly-queue preview-build cost checks out.

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


Generated by Claude Code

Comment thread docs/testing.md Resolved
Comment thread docs/testing.md Resolved
Comment thread scripts/ci-workflows.test.ts Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 11, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 11, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 11, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 11, 2026
The new merge-queue section repeated the paragraph above it almost word
for word — the same dispatcher/resolve.mjs citation, the same conclusion
that a red run on main reaches no handler. Two copies drift.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWtRd5ZrvnJSpVYdAk
Criterion 4 asks for the values the ruleset was set to, which is a
record. The table held only targets, with nothing to tell a reader that
nobody had read the dashboard back yet.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWtRd5ZrvnJSpVYdAk
The first half restated ci.yml's own comment three lines above the
trigger it describes, and the rest restated the docs/testing.md section
it already points at.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWtRd5ZrvnJSpVYdAk
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

All four review points are adopted. Pushed at aed88d7.

  • Closes #375 (review body, should-fix) → Refs #375. The ⚠ paragraph now names criteria 1, 2 and the observed half of 4 as the ones that stay open, so merging drops nothing.
  • docs/testing.md:342 — clause cut; it links § "A red run files its own ticket, because no handler is reachable from here" instead. thread · 826d56f
  • docs/testing.md:359 — table split into to be set to and a blank observed column. thread · cbd3378
  • scripts/ci-workflows.test.ts:190 — comment cut to its pointer. thread · aed88d7

origin/main (44781f6) merged in cleanly, no conflict. Lean gate green on the merged tree: lint, typecheck, 165 files, 1998 tests.

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


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 11, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review November 11, 2026 17:17
@sydevs-bot
sydevs-bot requested a review from Ardnived November 11, 2026 17:17
@sydevs-bot
sydevs-bot enabled auto-merge November 11, 2026 17:17
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 11, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design aed88d7 Nov 11 2026, 05:15 PM

@sydevs-bot
sydevs-bot added this pull request to the merge queue Nov 11, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 11, 2026
Merged via the queue into main with commit 61c2a33 Nov 11, 2026
64 of 71 checks passed
@sydevs-bot
sydevs-bot deleted the claude/fix-375-verify-merge-result branch November 11, 2026 18:16
@sydevs-bot sydevs-bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants