beads/internal/storage/sqlbuild
Steve Yegge 67ccdbfd44 fix(ready): honor --label-any on the ready/claim path (wy-jpd3.2)
BuildReadyWorkWhere emitted clauses for --label (AND-set) and
--exclude-label but none at all for --label-any, so the OR-set filter was
silently dropped by `bd ready` and `bd ready --claim` on every backend
(with or without --parent), while `bd list`/`bd search` honored it.

On an atomic claim the silent drop is dangerous rather than merely wrong:
a worker fencing itself to its own lane
(`bd ready --claim --label-any lane-a --parent epic-1`) would claim
another lane's issue and believe it was fenced. Reproduced on current
main: the new conformance case claims a lane-b issue when lane-a was
requested.

Emit an OR-set membership clause (same shape as the list path in
sqlbuild/filter.go) that AND-combines with Labels, ExcludeLabels and the
parent filter. All claim paths (Dolt, embedded-Dolt, sqlkit SQL family)
funnel through ClaimReadyIssueInTx -> GetReadyWorkInTx ->
BuildReadyWorkWhere, so the single seam fixes every backend.

Tests: a SQL-shape unit test in sqlbuild, plus a behavioral conformance
case (ClaimReadyIssueLabelFilters) asserting the claim is fenced by the
OR-set alone, AND-combined with --label and --parent, and — the safety
property — that an exhausted lane claims NOTHING rather than falling back
to unfenced ready work.
2026-07-12 07:58:22 -07:00
..
counts.go perf(ready): page-push ready-work counts and size the total with cheap COUNT(*)s (#4679) 2026-07-08 18:07:41 -07:00
filter.go refactor(storage): extract shared SQL builders into internal/storage/sqlbuild (bd-6dnrw.46) 2026-06-12 15:56:23 -04:00
imports_boundary_test.go refactor(storage): extract shared SQL builders into internal/storage/sqlbuild (bd-6dnrw.46) 2026-06-12 15:56:23 -04:00
labels.go refactor(storage): extract shared SQL builders into internal/storage/sqlbuild (bd-6dnrw.46) 2026-06-12 15:56:23 -04:00
ready.go fix(ready): honor --label-any on the ready/claim path (wy-jpd3.2) 2026-07-12 07:58:22 -07:00
sort.go feat: choose your own storage backend (Postgres / MySQL / SQLite) — rebased on main 2026-07-10 17:44:37 +00:00
sqlbuild.go feat(lease): land the leasing stack + schema v54 (claim-TTL, heartbeat, reclaim) (#4537) 2026-07-03 23:28:55 -07:00
sqlbuild_test.go fix(ready): honor --label-any on the ready/claim path (wy-jpd3.2) 2026-07-12 07:58:22 -07:00