* fix(http): gate create, add-waiter and discover through the library roles
bd gate create, bd gate add-waiter and bd gate discover wrote through the
legacy CreateIssue, AddDependency and map-based UpdateIssue, which the http
store does not implement, so over a connected HTTP workspace each failed
before any gate member reached the wire. They now run through the roles on
every route (direct, proxied server, http):
- gate create is ONE Lifecycle.Create carrying the gate members and a
reverse blocks edge from the blocked issue to the new gate: atomic on
every route, one createIssue over http behind issues.create.gates. The
proxied-server route's private unit of work is gone; it uses the same
role.
- gate add-waiter reads through Reader.Get, deduplicates, and writes the
whole waiter list through Lifecycle.Update guarded by the row version it
read, retrying up to three times on ErrVersionMismatch, so concurrent
adders cannot lose each other's waiter. Over http: issues.update.gates.
- gate discover lists through issueops.ListGates and records the run ID
through the same Lifecycle await_id patch gate check makes; bd close's
gh:run persist (updateGateAwaitID) takes the same path.
- Against a server without the token, each refuses before any write,
naming the token.
- gate discover skips template gates, as gate check already does, instead
of recording a run ID on a proto every later pour copies.
Tests: unit tests for the one-Create shape, the refusal, the add-waiter CAS
retry, and discover over ListGates with its template skip;
backend/http TestE2E_GatesOverHTTP (advertised and masked); four served
corpus shapes, pending until the reference server advertises the gate
tokens (verified to pass against a profile that does). CHANGELOG.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(gate): add-waiter backs off under contention; discover fails on a failed write
Review follow-ups to the gate CLI port.
- gate add-waiter's guarded write retried three times with no wait, so a
convoy of workers registering on one gate at once failed all but a few
(the proxied route's old unit of work had served them all). Each retry
now waits a jittered, doubling backoff (10 ms to 400 ms, drawn from
[d/2, d)), for at most 20 writes. The bound is attempts, not wall time:
under a loaded server one round takes seconds, and a wall-clock budget
failed the convoy after two or three rounds. A cancelled wait stops the
loop. TestProxiedServerGateAddWaiterConvoy (direct SQL and
proxied, real Dolt server) and TestE2E_GatesOverHTTP's concurrent case
run 11 simultaneous adders (one duplicate): all exit 0, every waiter
present once.
- gate discover counts only the gates whose run ID was recorded and exits
non-zero when any matched gate's write failed; it used to print the
refused gate as updated and exit 0. TestE2E_GatesOverHTTP covers
discover with and without issues.update.gates (fake gh).
- TestServedGateCheckOverAwaitTypedGates masks issues.update.gates itself,
so upgrading reference_server.json does not turn its gh:run case into a
different test.
- The discover listing test asserts closed gates are not listed.
- CHANGELOG: discover's template skip and add-waiter's template refusal
are behavior changes on the local routes; gate create refuses
a negative --timeout; gate create/add-waiter follow dolt.auto-commit and
use the role's commit messages; the proxied create no longer journals
dependency_added.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>