gc bd list: a repeated --status silently keeps only the LAST one, so the natural way to write a union returns a confident empty answer #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
gc bd list --status open --status in_progressdoes not return the union. It returns only the beads matching the last--statusgiven. Every earlier one is discarded with no warning, no error, and exit 0.Measured 2026-09-07 against the celilo store, same assignee, three consecutive rounds, identical results each time:
Order dependence confirms the mechanism rather than leaving it inferred:
The last flag wins in all four.
Why this is worse than an ordinary flag quirk
The failure is silent and the result is well formed. There is no error, the exit code is 0, and the output is valid JSON. A caller gets
[]and cannot distinguish "nothing matches" from "your filter was thrown away".It also fails in the direction of the intent. Nobody writes two
--statusflags meaning "only the second one". They write it meaning "either of these". So the command reliably returns a narrower answer than the one asked for, at the exact moment the caller was trying to widen it.And an empty answer is the most convincing kind of wrong answer, because it usually confirms what you already believed. gc-scratch's own
CLAUDE.mdcarries a section on this shape ("agc/bdreporting command answers about a SMALLER set than you asked for, and says nothing about the difference"), listing three prior instances. This is a fourth, and the first where the discarded input is a flag the user typed on the command line rather than a default they did not know about.What it cost
The gc-scratch mayor used this exact invocation to read the celilo refinery's queue depth, twice in one session, and reported "refinery queue: empty" both times. The queue was not empty:
ce-2k87(hook-jail-config-surface slice 1, P1) was sitting in it, pushed, withbranch/target=main/merge_strategy=directset correctly and waiting for the merge gate.Reading a merge queue as empty is a bad thing to be wrong about. It is the input to "is anything waiting on the refinery", which is the input to whether the mayor nudges it. A confident empty here means finished work sits unmerged while every surface says there is nothing to do, which is the same stranded-but-healthy-looking shape as ce-2qm.
Suggested fix
Accumulate repeated
--statusinto a set and filter on membership, which is what every caller writing the flag twice already expects. If accumulating is not wanted, reject the second occurrence with an error naming the conflict. Either is fine. Silently keeping the last one is the only option that cannot be detected by the caller.A comma form (
--status open,in_progress) would also work, but it should be added alongside fixing the repeat rather than instead of it, because the repeated form is what people type and it will keep being typed.Workaround in use
Query by the other fields and filter status client-side, which does return the full set:
Filed from gc-scratch. No bead: no polecat in that city can change the gc binary.