ci-queue-wait.sh guards main by default, not the branch being pushed #1177

Open
opened 2026-08-12 22:31:07 +00:00 by Mos · 0 comments
Contributor

ci-queue-wait.sh defaults -B to main. Constitution gate 6 requires the queue guard before any push or merge, and an agent pushing a feature branch runs it from a worktree on that branch — where it resolves main's head, reports state=unknown, and exits 0.

That reads as a pass. It is a pass about a different subject.

Observed while pushing PR #1174 from /src/mosaic-mono-v1-worktrees/feat-workspace-hygiene-tool-enforcement, HEAD on feat/workspace-hygiene-tool-enforcement:

[ci-queue-wait] platform=gitea purpose=push branch=main sha=ec260e678f15...
[ci-queue-wait] state=unknown purpose=push branch=main

Neither the branch nor the sha is the thing being pushed. A pipeline running on the feature branch — the collision the guard exists to prevent — is invisible to it.

Suggested fix: default -B to the current branch (git rev-parse --abbrev-ref HEAD), falling back to main only outside a work tree or on a detached HEAD. -B stays available to override. The existing __BRANCH_ABSENT__ path already handles a not-yet-pushed branch correctly, so the not-yet-pushed case does not regress.

The general shape is worth naming, because it is the third instance found this week: a control that does not vary the accused variable certifies nothing. A guard whose default subject is a fixed branch answers a question nobody asked, and answers it green.

Related: #1175 (the same wrapper cannot resolve a token under a named-principal credential layout, so it needs GITEA_TOKEN supplied by hand).

`ci-queue-wait.sh` defaults `-B` to `main`. Constitution gate 6 requires the queue guard before any push or merge, and an agent pushing a feature branch runs it from a worktree on that branch — where it resolves `main`'s head, reports `state=unknown`, and exits 0. That reads as a pass. It is a pass about a different subject. Observed while pushing PR #1174 from `/src/mosaic-mono-v1-worktrees/feat-workspace-hygiene-tool-enforcement`, HEAD on `feat/workspace-hygiene-tool-enforcement`: ``` [ci-queue-wait] platform=gitea purpose=push branch=main sha=ec260e678f15... [ci-queue-wait] state=unknown purpose=push branch=main ``` Neither the branch nor the sha is the thing being pushed. A pipeline running on the feature branch — the collision the guard exists to prevent — is invisible to it. **Suggested fix:** default `-B` to the current branch (`git rev-parse --abbrev-ref HEAD`), falling back to `main` only outside a work tree or on a detached HEAD. `-B` stays available to override. The existing `__BRANCH_ABSENT__` path already handles a not-yet-pushed branch correctly, so the not-yet-pushed case does not regress. The general shape is worth naming, because it is the third instance found this week: **a control that does not vary the accused variable certifies nothing.** A guard whose default subject is a fixed branch answers a question nobody asked, and answers it green. Related: #1175 (the same wrapper cannot resolve a token under a named-principal credential layout, so it needs `GITEA_TOKEN` supplied by hand).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1177