beads/issueops
Harry Miller 0e317c4fc0
fix(query): apply bd list's piped-output limit policy to bd query (#6229) (#6744)
* fix(query): apply bd list's piped-output limit policy to bd query (#6229)

Root cause: bd list resolves an unflagged --limit through a policy that
treats piped stdout as unlimited (GH#4094), but bd query read its --limit
flag straight through, so its default of workapi.DefaultQueryLimit (50)
applied to piped output too. `bd query '...' | consumer` silently dropped
every row past 50; the truncation hint did not fire either, because it only
prints when stderr is a terminal.

Fix: factor the unflagged tail of bd list's policy into unflaggedLimit /
resolveUnflaggedLimit in list_input.go and call it from both commands, so
they cannot drift. bd list's switch is unchanged in behavior; bd query's
change is a single localized branch in gatherQueryInput.

Precedence for bd query, mirroring bd list:
  1. explicit --limit (including 0) wins
  2. piped stdout -> 0 (unlimited)
  3. agent mode on a terminal -> 20
  4. otherwise the 50 default
bd list keeps its own --all and list.limit branches ahead of step 2; bd
query has neither (its --all means "include closed", and there is no
query.limit config key), so none was invented.

Agent-Signature: claude-code-opus-5-5-unknown-reasoning on behalf of Harry Miller
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* review: document the query path's absent defensive cap; unstale a reachability comment

Maintainer review fixes for PR #6744 (GH#6229). Both are comment-only; no
behavior changes.

issueops.QueryRequest.Limit now states that nothing backstops it. ListRequest
pairs its Limit with MaxRows, a circuit breaker for an oversized answer, and
neither knob that sets that one (--max-rows, BEADS_MAX_ROWS) is read anywhere
on the query path, so an unlimited query is unbounded in the plain sense. That
was already reachable via `--limit 0`; this PR makes a piped `bd query` reach
it without asking, which is what makes it worth writing down. Recording the
absence is the documented half of the reviewers' choice — threading a MaxRows
twin onto QueryRequest stays available as a follow-up.

unionCountsGoSideSortKeepsTheRightSubset's comment justified its case with
"DefaultQueryLimit means a limit is always set", which this PR falsified for
the CLI half: an unflagged piped `bd query '<expr>' --sort id` now arrives on
the IsGoSideSort path with Limit 0 and no bound. The HTTP surface still brings
a bound, because an absent `limit` parameter resolves to DefaultQueryLimit, so
the clause is requalified rather than dropped. The assertions were never
affected — they pass an explicit Limit: 5.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
2026-09-26 02:50:09 -07:00
..
batchapplier.go Add issueops.BatchApplier: one plan, one transaction (#5480) 2026-08-09 06:59:34 -07:00
batchcloser.go Pin the is_blocked invariant as a postcondition of the roles that maintain it (#5436) 2026-08-08 11:23:34 -07:00
batchcreator.go feat(create): put bd create --file behind the BatchCreator role (bd-lu170) 2026-08-05 16:43:11 +00:00
blockedstate.go Pin the is_blocked invariant as a postcondition of the roles that maintain it (#5436) 2026-08-08 11:23:34 -07:00
blockingannotator.go feat(list): put bd list behind Reader.List and the new BlockingAnnotator role (bd-5k21g) 2026-08-06 02:56:57 +00:00
bootstrapper.go feat(init): put bd init's identity seam behind Bootstrapper and InitVerifier (bd-zl3u8) 2026-08-06 03:01:33 +00:00
claimer.go chore: retire a zombie test, drop a dead field, true up two leaf docs (#5492) 2026-08-09 10:42:34 -07:00
claimer_external_test.go Add issueops.Claimer and route the HTTP claim through it (#5334) 2026-08-04 08:40:18 -07:00
commenter.go chore: retire a zombie test, drop a dead field, true up two leaf docs (#5492) 2026-08-09 10:42:34 -07:00
counter.go feat(count): support --metadata-field filtering (#6024) 2026-09-02 17:25:57 -07:00
cycledetector.go feat(issueops): put bd dep cycles behind the CycleDetector role (bd-wfkbv) 2026-08-05 09:36:14 +00:00
deleter.go Add DeleteRequest.ExpectedVersion: a compare-and-delete on the named row (#5481) 2026-08-09 07:17:54 -07:00
dependencyeditor.go Pin the is_blocked invariant as a postcondition of the roles that maintain it (#5436) 2026-08-08 11:23:34 -07:00
edgereader.go feat(issueops): put multi-id bd dep list behind the EdgeReader role (bd-nhsno) 2026-08-05 09:42:06 +00:00
errors.go Add issueops.Releaser: give a claim back, optionally only a named holder's (#5482) 2026-08-09 07:48:56 -07:00
graphcounter.go docs: the ext-api-store documentation tranche — post-#5516 auth sweep, wave doc coherence, role checklist refresh (#5545) 2026-08-10 08:05:07 -07:00
importer.go feat(import): port bd import to proxied-server mode (bd-o58fz) (#5355) 2026-08-05 09:05:22 -07:00
initverifier.go feat(init): put bd init's identity seam behind Bootstrapper and InitVerifier (bd-zl3u8) 2026-08-06 03:01:33 +00:00
issueops.go chore(api): mark new exported packages experimental before v1.3.0 (#6036) 2026-08-29 16:01:30 -07:00
issueops_external_test.go feat(issueops): name the two dependency-endpoint refusals (bd-yby99.9) 2026-08-07 19:45:54 +00:00
metadatacas.go docs: the ext-api-store documentation tranche — post-#5516 auth sweep, wave doc coherence, role checklist refresh (#5545) 2026-08-10 08:05:07 -07:00
querier.go fix(query): apply bd list's piped-output limit policy to bd query (#6229) (#6744) 2026-09-26 02:50:09 -07:00
reader.go fix(list): honor --status when combined with --ready (#5924) 2026-09-02 18:12:07 -07:00
reader_ready_scope.go fix(list): honor --status when combined with --ready (#5924) 2026-09-02 18:12:07 -07:00
readyclaimer.go feat(workapi,storage): opt-in Brief projection for the list and ready pages (#5554) 2026-08-10 10:45:23 -07:00
readycounter.go feat(ready): put bd ready's published total behind the ReadyCounter role (bd-s10oa) 2026-08-05 09:47:24 +00:00
relations.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
releaser.go fix: canonicalActor collapses the --/__ axes correctly; claim-verify uses ActorMatches (be-p7dzx, bundled be-vc51) (#5856) 2026-08-19 13:23:35 -07:00
statsreporter.go Wave 2 review fixes: dep list shape, stats 400, and the blocked-count promise 2026-08-06 21:18:26 +00:00
sweeper.go Version embedded role deletes and sweeps, and replace the range that hid it (#5458) 2026-08-08 23:53:57 -07:00
treewalker.go Converge Offset and MaxRows on all three legs, and fix the panic and the breaker hole under them (#5435) 2026-08-08 11:37:09 -07:00
versionreconciler.go feat(issueops): put the startup version reconciler behind the VersionReconciler role (bd-gkmft) 2026-08-05 16:35:01 +00:00
workspaceconfig.go Refuse kv.* point reads on the settings role and stop printing them (#5493) 2026-08-09 11:06:51 -07:00