Skip to content

The merge queue's bisect accepts a red judge case whose name holds a space (#3580) - #4724

Closed
Barack-zero-to-one wants to merge 1 commit into
garrytan:mainfrom
Barack-zero-to-one:fix/issue-3580-bisect-case-id-space
Closed

Barack-zero-to-one wants to merge 1 commit into
garrytan:mainfrom
Barack-zero-to-one:fix/issue-3580-bisect-case-id-space

Conversation

@Barack-zero-to-one

Copy link
Copy Markdown
Contributor

gstack-ship-queue train bisect now bisects a red judge case whose name holds a space, such as setup-browser-cookies/SKILL.md workflow.
Why: bisect refused that case as outside the gate's plan, though the gate's panels held it and the CI route accepts the same id.
Nothing to do; ids bisect accepted before are still accepted.

Root cause

bisectInputs() in crew/lib/ship-queue-train-verdict.ts checked each red case against ^[A-Za-z0-9_.:/-]{1,128}$, which has no space. A judge case id is <skill>/SKILL.md workflow, so the check failed before the panel lookup and bisect stopped with QUEUE_TRAIN_PREFIX_INVALID. The two other checks of the same ids already allowed the space: CASE_ID in crew/lib/release-gate.ts (release bisect) and in crew/scripts/train-gate.ts (the route evals.yml runs, which splits the cases input on commas only, so a space survives and the comma the pattern leaves out stays the separator).

Fix

CASE_ID is now defined once, in crew/lib/ship-queue-train-record.ts, which the verdict and the release gate already import and whose types the CI route already reads; the record module imports none of the three, so no cycle appears. The red case check moves into an exported pure function, redCasesOutsidePlan(), which uses CASE_ID and keeps the same message; bisectInputs() calls it. The release gate and the CI route drop their copies and import the shared one. No message, exit code or accepted id outside the space changes. changelog.d/fix-issue-3580-bisect-case-id-space.md carries the entry. Closes #3580.

Tests

Three pure tests in crew/test/ship-queue-train-logic.test.ts call redCasesOutsidePlan() directly. They accept a red judge panel whose id holds a space, refuse ids the dispatch input cannot pass even when a panel holds them (empty, a comma, a newline, 129 characters), and refuse a red id no panel holds. After the extraction and before the pattern changed, only the space test failed, with the refusal from the issue; the file now gives 26 pass.

On Windows 11 with bun 1.4.5, crew/test/train-gate.test.ts, crew/test/release-gate.test.ts and crew/test/ship-queue-train-bisect.test.ts fail 21 tests on this branch, all of them among the 23 that fail on untouched main; they come from the fixtures' #!/bin/sh fake gh and their git pushes, which do not run on Windows. The shell integration tests in those files therefore rely on the Linux CI in free-tests.yml. test/module-size-ratchet.test.ts, test/crew-move-layout.test.ts and test/evals-train-workflow.test.ts pass, bun run typecheck reports no error, bun run typecheck:test no new diagnostic, and the doc link check, the credential scan and prose lint pass.

Out of scope

The CI route trims each case it splits from the input, so an id that starts or ends with a space would not match its panel there; no gate case is named that way today. A bisect integration test with a judge case red would need a judge panel in the shared merge queue fixture, so this PR keeps the regression at the pure function.

…space (garrytan#3580)

bisectInputs checked red case ids against a pattern without the space a
judge case id holds (<skill>/SKILL.md workflow), so bisect refused
a case the gate's panels carried. The release bisect and the CI route
already allowed it. CASE_ID now lives once in ship-queue-train-record.ts
and all three import it, and the red case check is the pure exported
redCasesOutsidePlan, covered by tests in ship-queue-train-logic.test.ts.
@trunk-io

trunk-io Bot commented Nov 22, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@capy-ai

capy-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Thanks, and good catch that three copies of the same id rule had drifted apart. A read of current main (c4cfe6d) still shows the bug: crew/lib/ship-queue-train-verdict.ts:228 leaves the space out.

We're picking it up for our next batch of small fixes (tracking thread GSTA-36). Because this PR also edits crew/scripts/train-gate.ts, which our CI's eval workflow runs, we'll rebuild it on current main instead of taking the branch as is, with you credited as co-author. We'll link the change here and close this PR when it lands.

@capy-ai capy-ai Bot added the S3 Severity 3: everything else label Nov 23, 2026
@capy-ai

capy-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Owner: Capy thread GSTA-827 is fixing this as part of today's small-fix wave and will link the wave PR here when it lands.

capy-ai Bot added a commit that referenced this pull request Nov 23, 2026
… bisect case names (#4748)

/ship now tells you to fix your commit email when GitHub refuses a push
with GH007, instead of sending you into a pointless merge;
`gstack-approvals` says which `--owner-ref` check failed; and the merge
queue's bisect accepts a red judge case whose name has a space.

Why: three small, plainly correct fixes from outside reports (#4738,
#4718 with #4720, #4724 for #3580), taken as one batch.

Nothing to do.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: Barack-zero-to-one <[email protected]>
Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/outside-voice#2 reader=outside-voice
Review-Finding: p1/adversarial-native#1 reader=adversarial-native
Review-Finding: p1/adversarial-native#3 reader=adversarial-native
Review-Finding: p1/specialist-batched#1 reader=testing
@capy-ai

capy-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Thanks @Barack-zero-to-one. This landed in #4748 (merged as 100e109), rebuilt on our main with you credited as co-author, because it touches crew/scripts/train-gate.ts, which our CI runs. The shared CASE_ID rule and the redCasesOutsidePlan tests follow your design. Closing this PR in favor of #4748; it fixes #3580.

@capy-ai capy-ai Bot closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S3 Severity 3: everything else

Projects

None yet

Development

Successfully merging this pull request may close these issues.

train bisect refuses a red judge case as 'not in the gate's plan' (QUEUE_TRAIN_PREFIX_INVALID)

1 participant