Repository navigation
merge-compile-guard: only a compile that finished red refuses; a slow read or a pending compile warns and merges - #24265
Conversation
…red) The guard's GitHub reads timed out under load on cosmic-gray and refused #23660 and #23371 for hours with a SHIP receipt at the head and a green compile. These tests expect a pending compile, an unreadable GitHub, a merge the guard can't name and guards it can't load to warn and let the merge through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1602e-bc09-7990-8c75-5c412a66b114&host=Air-Blue
…st warns and merges Under load on cosmic-gray (2026-10-21) the guard's GitHub reads timed out and refused #23660 and #23371 for hours with a SHIP receipt at the head and a green compile. Leo: "IF THE MERGE HOOK IS WRONG THEN JUST FUCKING MERGE". HQ's landing gate (require-cmux-guards.py, cmuxterm-hq#2976) already refuses only a missing SHIP, a failed compile, --admin and an unpinned --auto; this repo hook now agrees with it. - A compile still waiting, a GitHub read that failed or ran out of time, a merge the guard can't name and a checkout it can't read are a Hold: a systemMessage plus additionalContext, no permissionDecision, and the merge goes ahead. - A red compile still refuses, and a Hold earlier in the command never hides a red later in it. - guards-from-base.sh and the settings hook warn instead of refusing when they can't load the guards from the base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1602e-bc09-7990-8c75-5c412a66b114&host=Air-Blue
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: |
|
Found 10 test failures on Blacksmith runners: Failures
|
|
Bead |
…a hidden update-branch warning (red) From the Codex review of #24265: a failed build-fleet compile next to a queued Release compile read as a wait; a guard exiting 2 blocks the tool call; a merge warning short-circuited the update-branch warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1602e-bc09-7990-8c75-5c412a66b114&host=Air-Blue
…ase compile; a guard's failure and a merge warning never block or hide From the Codex review of #24265: - fleet_red(): a build-fleet compile that finished red with no passing attempt (of it or of the Release compile) refuses before any pending state, and compile_wait() no longer reads it as a wait, so neither a queued Release compile nor a fleet pass turns it into a warning. - guards-from-base.sh runs both guards. A refusal is the answer at once; otherwise every warning is joined into one answer, so a merge's warning never hides the update-branch warning of the same command. A guard that exits non-zero is a warning, never the exit 2 that blocks a tool call. - The settings hook exits 1 (a non-blocking error) when the launcher itself fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1602e-bc09-7990-8c75-5c412a66b114&host=Air-Blue
…red) Codex review of #24265, round 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1602e-bc09-7990-8c75-5c412a66b114&host=Air-Blue
The loop matched "permissionDecision": "deny" literally, so a valid refusal written with other spacing was merged into a warning and lost (Codex review of #24265, round 2). The merger now parses each answer and passes a refusal through as it is before joining warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1602e-bc09-7990-8c75-5c412a66b114&host=Air-Blue
Codex review of #24265, round 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1602e-bc09-7990-8c75-5c412a66b114&host=Air-Blue
Both guards ran before any refusal was read, so a slow update-branch warning could run the hook past its 120 s timeout with the refusal unprinted, and the merge went through (Codex review of #24265, round 3). Each answer is read as JSON right after its guard; a refusal is printed and the loop ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1602e-bc09-7990-8c75-5c412a66b114&host=Air-Blue
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Review (codex xhigh, correctness first): SHIP at beeca0b An independent Codex reviewer (xhigh, on cmux16) reviewed four rounds. Each block got a failing test and then a fix:
Suites, by the reviewer and on cmux16: |
Conflicts with #24265 (merge-compile-guard: only a compile that finished red refuses) resolved toward both: the repository still keeps no merge guard, and guards-from-base.sh takes #24265's rules. A gate that is not installed, crashes or can't be read is a warning and the merge goes ahead; a refusal still wins and is printed before the update-branch warning runs; every warning is joined into one answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-707fe4a5f156f632733f
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Leo-ask: ask-99c1b0ed16
Leo-ask: ask-265dff2c7c
Leo-ask: ask-bdaebcd48a
Leo-ask: ask-daa4b85426
Leo-ask: ask-4c8d8efef8
Leo, 2026-10-21: "IF THE MERGE HOOK IS WRONG THEN JUST FUCKING MEREG", "WTF ARE YOU DOING WITH FUCKING MERGE HOOKS JUST MERGE!?", "DUDE I FUCJKING HATE YOUR MERGE HOOKS".
This repo's PreToolUse merge hook (
.claude/settings.json→scripts/ci/guards-from-base.sh→scripts/ci/merge_compile_guard.py) refused merges it couldn't judge. On cosmic-gray at load ~200, its GitHub reads timed out and refused #23660 and #23371 for hours. Both had a SHIP receipt at the head, green fast gates and a green compile. It also refused every merge whose compile was still queued or running.HQ's landing gate (
require-cmux-guards.py, cmuxterm-hq#2960 and #2976) already refuses only four things:--admin;--autowithout a pinned head.A pending compile or a slow read is only a warning there. This PR makes the repo hook agree.
What changes
Still refused: a Swift PR whose
cmux-next Release compile (Xcode 26)orcmux-next app compile (build fleet)finished red with no passing attempt. A red fleet compile refuses even while a Release compile is queued beside it, and a fleet compile-check pass doesn't clear it.Now a warning (a "Hold"), not a refusal:
The hook prints a
systemMessageplusadditionalContext, with nopermissionDecision. The merge goes ahead, and both the person and the agent see why.A warning never hides a refusal. Every merge in the command is judged, and any red refuses.
guards-from-base.shruns both guards.Guards that can't be loaded: when
guards-from-base.shor the settings hook can't load the guards from origin/feat-cmux-next, it now warns instead of refusing.Launcher failure: if the launcher itself fails, the settings hook exits 1, which doesn't block.
Overlap: #23858 (lane-host) replaces this guard with the installed HQ gate and deletes these files. It conflicts with feat-cmux-next and has been idle since 2026-10-21 23:50Z. Whichever PR lands second takes the other's side; nothing here blocks it.
Review
A Codex reviewer (gpt, xhigh, on cmux16) blocked three rounds. Each finding got a failing test first, then a fix:
Round 4: SHIP at the head.
Tests
python3 tests/test_merge_compile_guard.py: 54 OK.python3 tests/test_guard_hooks_from_base.py: 17 OK.Every behaviour change has a failing test committed before its fix (d8d6e2a, 3b19f09 and the two later
(red)commits). The new cases:ghsleeps pastCMUX_MERGE_GUARD_GH_TIMEOUT=1) and an unreadable GitHub let the merge through with a warning;gh pr merge "$PR" ...; gh pr merge 5 ..., the warning on the first merge doesn't hide the red on the second;indent=2and odd separators still refuses.Observed / Not run
timeout, which the settings hook uses for its fetch, so a stand-in that runs the command went first on PATH.scripts/cmux-next/prepush-gate.py: no new violations.Changelog
none
Agent session: Air-Blue
🤖 Generated with Claude Code