* 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>