beads/backend
Julian Knutsen cd2507735e
test(cli): close mc-zndi7.76's --if-revision single-winner test gaps (#7233)
* test(cli): close mc-zndi7.76's --if-revision single-winner test gaps

T4.4 exercised the Update guard against the library only; embedded CLI
tests never catch a CLI wiring bypass because bd's local exclusive
flock serializes every mutation regardless of whether --if-revision is
actually threaded through. This closes the remaining mc-zndi7.76 gaps:

- gap 1 (mutant MA): new Lifecycle contract cases
  (RunLifecycleUpdateExpectedVersionSingleWinnerWithDisjointColumnsUnderConcurrency,
  RunLifecycleCloseExpectedVersionSingleWinnerUnderConcurrency,
  RunLifecycleUpdateExpectedVersionSingleWinnerAcrossUpdateAndCloseUnderConcurrency),
  wired into all three backends (dolt, embeddeddolt, uow).
- gap 2 (mutant MC): a new dolt-server-tier CLI concurrency test,
  TestSharedServerIfRevisionSingleWinner, spawning N real bd
  subprocesses that race update/close/assign --if-revision against one
  shared, unlocked Dolt server. Delete is deliberately excluded --
  its production guard is independently known-broken under real
  concurrency and is tracked as its own schema-touching fix,
  mc-zndi7.73.
- gap 4 (mutants ML/MO/MD1/MD2): close's --if-revision bypass now has
  CLI-level coverage for --continue/--suggest-next/--claim-next
  rejection, cascade-delete fencing, and a proxied-route stale-guard
  refusal.

TDD: hand-applying mutant MC (dropping update.go's ExpectedVersion
wiring) reproduces the bug report's symptom exactly -- 10/10
concurrent racers exit 0 instead of 1 winner + 9 guard refusals.
Restoring the real code returns to exactly 1 winner, confirmed across
4 repeated real-container runs plus -race.

Gates: gofmt, go vet, go build (both tags), golangci-lint (native,
0 issues), bazel go_srcs.py --check, and targeted go test runs
(embeddeddolt/dolt/uow lifecycle contract suites and the full set of
cmd/bd if-revision tests) all green, with and without -race, against a
real dolthub/dolt-sql-server:2.2.0 container.

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

* build(bazel): sync cmd/bd BUILD.bazel srcs for the new if-revision test files

make bazel-sync-check only validates the go_srcs.py-managed filegroups,
not gazelle's own go_test srcs list, so the two new test files from the
previous commit were invisible to Bazel. CI's BUILD-sync and go-test
equivalence gates caught it; this is gazelle's own generated diff,
applied via the CI job's uploaded bazel-sync-patch artifact.

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

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-05 01:57:10 -07:00
..
conformance test(cli): close mc-zndi7.76's --if-revision single-winner test gaps (#7233) 2026-10-05 01:57:10 -07:00
backend.go feat(backends): registry Remote + OpenWith options; beads.OpenBestAvailableWith for embedders (#7188) 2026-10-04 09:34:36 -07:00
BUILD.bazel test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
completeness_test.go test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
errors.go fix(dolt): preserve transaction outcome boundaries (#5341) 2026-08-06 04:34:46 -07:00
errors_test.go fix(dolt): preserve transaction outcome boundaries (#5341) 2026-08-06 04:34:46 -07:00
types.go perf(storage): SearchIssueSummaries narrow-projection foundation (be-nu4.3) (#3458) 2026-10-01 01:19:24 -07:00