beads/internal/storage/sqlbuild
Steve Yegge c38582b7e6 feat(reclaim): scope filters --label/--label-any/--exclude-label/--assignee/--id (wy-jpd3.3)
bd reclaim was global-only: on a federated deployment one machine's reaper
can revert a stale-looking unit that is alive on the machine that granted its
lease. Add scope filters mirroring the claim-side label surface
(bd ready --claim) so a supervisor can point its reaper at exactly the
partition it claims from.

- types.ReclaimFilter (IDs/Assignees/Labels/LabelsAny/ExcludeLabels) + IsEmpty.
- sqlbuild.BuildReclaimScopeClauses/ReclaimScopeSQL: same SQL shapes the
  claim/ready path emits, alias-qualified for the reclaim JOIN. Fails closed
  (1=0) on a degenerate all-empty field so a scoped sweep can never silently
  widen to global.
- issueops.ReclaimExpiredLeasesInTx threads the filter into the snapshot SELECT
  only; the per-row revert re-checks by id from the already-scoped snapshot.
- Threaded ReclaimExpiredLeases through the Store/domain interfaces and every
  backend (dolt, embedded dolt, sql repo, use case) and both CLI paths
  (direct + proxied server). A zero ReclaimFilter reproduces the exact prior
  global behavior.
- CLI hard-errors a scope flag supplied with no usable value (e.g. --label
  "$LANE" with LANE unset) instead of degrading to a global sweep; --json now
  reports a "scoped" boolean.
- Cross-backend conformance coverage (testReclaimScoped) + sqlbuild and
  flag-parsing unit tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 05:31:23 -07:00
..
counts.go feat(leases): move leases to ephemeral dolt_ignored leases table (bd-lrgn1) 2026-07-17 01:02:29 -07:00
filter.go fix(filters): Dolt label-filter regression fix — LabelPattern + LabelRegex + JSON truncation hint suppression (#3971) 2026-07-24 00:17:02 -07:00
filter_test.go fix(filters): Dolt label-filter regression fix — LabelPattern + LabelRegex + JSON truncation hint suppression (#3971) 2026-07-24 00:17:02 -07: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
keyset_test.go feat(storage): keyset reads — comments page, issue-list cursor, IsBlocked filter (#4922) 2026-07-21 22:29:09 -07: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 Merge remote-tracking branch 'upstream/main' into pr-4095-fix 2026-07-13 20:39:27 -07:00
reclaim.go feat(reclaim): scope filters --label/--label-any/--exclude-label/--assignee/--id (wy-jpd3.3) 2026-07-24 05:31:23 -07:00
reclaim_test.go feat(reclaim): scope filters --label/--label-any/--exclude-label/--assignee/--id (wy-jpd3.3) 2026-07-24 05:31:23 -07:00
sort.go Reapply "Simplify the supported backends: roll back the direct PostgreSQL and MySQL adapters" (#4857) 2026-07-18 02:43:56 +00:00
sqlbuild.go feat(engine): guarded write ops — atomic metadata merge, row-version CAS, typed dep errors + events, bd close delegation (#4911) 2026-07-21 18:13:03 -07:00
sqlbuild_test.go Merge remote-tracking branch 'upstream/main' into pr-4095-fix 2026-07-13 20:39:27 -07:00