* docs(agents): bazel test is authoritative; agents never run go test
Agents run tests only with `bazel test`, also while iterating on one
behavior: AGENTS.md shows the focused form
(`bazel test //cmd/bd:bd_test --config=ci --test_filter='^TestName$'`), the
target naming, that one --test_filter covers every target, that a cached
result for unchanged inputs is the same evidence, and that a new test file
needs `make bazel-sync` before Bazel runs it. `go test` (`./scripts/test.sh`,
`make test-go`) stays a convenience for humans working offline. TESTING.md's
focused red/green row and its plain-go-test section say the same.
Why: on the maintainer-city factory host, seats' own uncached `go test`
reruns of the same packages are the largest tool cost in adopt-pr, while
`bazel test` there executes on rbe-west and returns an unchanged target's
cached result in seconds.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(agents): check that a focused test ran; exempt golden regeneration
Review fixes for #7695 (iterations 1 and 2).
The focused form exits 0 with "1 test passes" when the test never ran: a
filter that matches nothing, an integration-tagged file --config=ci does not
compile, the TestEmbedded* name skip, a -short skip, and a parent test whose
every subtest skipped (Go still prints "--- PASS" for the parent). It now
adds --test_output=all, and a run counts only when its log shows
"--- PASS: <TestName>" and no "--- SKIP" for the test or a <TestName>/...
subtest; a subtest that skips by design is left out with a subtest filter.
engdocs/TESTING.md gains "Check That the Test Ran"; AGENTS.md links there
instead of restating it. The section names the tests --config=ci does not
run and the way into each:
- Dolt-backed: the three --test_env flags, or the test's Dolt lane.
- -short-gated: --test_arg=-test.short=false.
- integration-tagged: --config=integration; the Dolt-backed ones of cmd/bd,
tests/regression and internal/storage/dolt run in their Dolt-server lane
target, whose env the suite needs. No lane runs those of other packages
with Dolt, so a failure there is compared with the base commit first.
- TestEmbedded*: --test_arg=-test.skip= lifts the name skip; a test that
then still skips for BEADS_TEST_EMBEDDED_DOLT=1 runs in its package's
embedded-tagged target under --config=embedded (the cmd/bd and
internal/storage/embeddeddolt targets are named).
- files BUILD.bazel does not list: make bazel-sync.
A lane's sh_test can hand the test binary its own -test.run, which
overrides --test_filter, so a trailing --test_arg=-test.run with sharding
disabled selects the test there. In a sharded target the other shards print
"testing: warning: no tests to run". The section also gives the
target-naming rule.
Golden regeneration (make corpus-regen, make githooks-regen,
BD_UPDATE_GOLDEN=1 ... go test, -update-ledger-doc) writes the source tree,
which a Bazel test cannot do: it runs from its runfiles tree, and on
rbe-west update mode fails with "permission denied". AGENTS.md and the new
"Regenerating Golden Files" section exempt these go test runs; where a host
refuses go test even for them, a maintainer regenerates. The factory seat
shim (gastownhall/workflows#102, scripts/seat-bin/go) still refuses update
mode and needs the same carve-out there.
Also: the plain-go-test opener scopes "humans working offline" to the
runner and its go test targets, so the Dolt-backend, fixture and
testing.Short() rules still bind agents; make ci-pr-core is marked plain go
test; the beads-docs skill's docsync gate is the Bazel target; RELEASING.md
and engdocs/RELEASE-STABILITY-GATE.md name the regression suite's Bazel
target (//tests/regression:regression_test under --config=doltserver-cmd)
in place of make test-regression, which is plain go test.
Measured on rbe-west (exit 0 unless noted). Iteration 1, at c4d5409895:
- a mistyped filter, and //internal/compact TestNew (integration-tagged)
under --config=ci: "testing: warning: no tests to run"
- TestNew under --config=integration: "--- SKIP" (BEADS_TEST_SKIP=dolt);
with the Dolt flags added it runs (and fails, exit 3, on the local
backend: its store finds no "beads" database; outside this PR)
- TestConcurrentHeartbeatReclaimClose with the Dolt flags: "--- SKIP"
(short mode); plus --test_arg=-test.short=false: "--- PASS"
- //cmd/bd:bd_embedded_test, sharding disabled: --test_filter alone ran
TestEmbeddedUpdateConcurrent (manifest shard 1's test); the trailing
-test.run ran "--- PASS: TestEmbeddedShowBasicsAndJSON"
- //scripts:go_test_sources_test
TestEmbeddedCmdShardManifestBareWriteIsIdempotent: --config=ci "no tests
to run"; plus --test_arg=-test.skip=: "--- PASS"
Iteration 2, at b1d25543aa (the same Go inputs):
- //internal/storage/dolt:dolt_test TestMoveIssuePersistenceInTxTransitions
under --config=ci: "--- PASS" for the parent and "--- SKIP" for all 6
subtests (BEADS_TEST_SKIP=dolt), "1 test passes"; with the Dolt flags and
--test_filter='^TestMoveIssuePersistenceInTxTransitions$/^persistent-to-ephemeral$'
"--- PASS" for the parent and that subtest only, no "--- SKIP"
- //internal/storage/embeddeddolt:embeddeddolt_test
TestEmbeddedRemoteMigrateGate_BlocksReopen under --config=ci plus
--test_arg=-test.skip=: "--- SKIP" (BEADS_TEST_EMBEDDED_DOLT unset);
//internal/storage/embeddeddolt:embeddeddolt_embedded_test under
--config=embedded, sharding disabled, trailing -test.run: "--- PASS"
(the shard script listed 433 tests; only the named one ran)
- --config=ci plus --test_arg=-test.skip=: "--- PASS" for //tools/nogo
TestEmbeddedConfigIsTheRepositoryConfig and //internal/tracker
TestEmbeddedDoltExternalRefChangedAfterUsesHistoryFastPath
- sharding disabled, trailing -test.run: "--- PASS" for
//internal/storage/dolt:dolt_server_full_test
TestWispDeleteCascade_TransactionDeleteIssue under
--config=doltserver-integration, and for //cmd/bd:bd_dolt_server_test
TestCLI_ReopenClearsDeferUntil under --config=doltserver-cmd
- make check-docs: exit 0 (docsync: 10 test cases ran, none skipped)
Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Eddie the Engineer <338826946+gascity-eddie[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(http): bd blocked over bd serve (blocked.list) through issueops.BlockedLister
`bd blocked` refused against an HTTP workspace: it called the legacy
GetBlockedIssues, which the HTTP backend stubs as unsupported. It now runs
one role on every route, and bd serve publishes that role.
- Role: issueops.BlockedLister.ListBlocked(BlockedRequest{ParentID, Labels,
LabelsAny, ExcludeLabels}) -> BlockedResult{Items}. One body,
internal/storage/issueops.ExecuteListBlockedInTx over the unchanged
GetBlockedIssuesInTx; labels normalized in the role (BlockedFilter);
Items never nil and in a total order (priority, created_at desc, id).
- Legs: DoltStore (read tx), EmbeddedDoltStore (read conn), uow (read unit
of work through the use case's GetBlockedIssues, so the
external-dependency uow decorator applies). Census: storage.DoltStorage
gains BlockedLister(); HookFiringStore passes it through (a read),
telemetry wraps it, uow.notifyingProvider, externaldeps.uowProvider and
httpapi.timedProvider build it.
- externaldeps.Store.BlockedLister is built over its own GetBlockedIssues,
so local `bd blocked` output is unchanged. Over a remote store it takes
the server's listing when the server advertises
policy.external_dependencies, else decorates the server's listing here
through EdgeReader and BatchGetter (decorateBlocked, factored out of
GetBlockedIssues).
- Wire: GET /v0/beads/blocked (listBlockedIssues; parent, label,
label_any, exclude_label) answering BlockedPage {items, has_more} with
the new x-go-type-pinned BlockedIssue schema, behind the new
blocked.list token. apigen and the wire-shape golden regenerated; the
golden diff is additive only, so wire_revision stays 2.
Config.BlockedLister is a required role, wired in bd serve.
- Client: httpclient.Store.BlockedLister dials through Store.dispatch, so
an older server is refused BEFORE the dial with *wire.CapabilityError
naming blocked.list. The legacy Store.GetBlockedIssues rides the role
(page and row cap applied to its answer) and leaves the unsupported
shell. Divergence ledger row F-blocked retired.
- CLI: `bd blocked` takes BlockedLister() from the store on the direct
routes and from the provider's BlockedListerSource on the proxied route;
runBlockedProxiedServer is deleted. --json output is the same rows in
the same order, [] when empty.
Tests: backend/conformance RunBlockedLister (10 cases: direct blocker,
child attributed to its blocked parent, closed blocker, wisp plane, pinned
status, parent filter, label filters with normalization, order, empty
slice, request not mutated) on dolt, embedded, uow and the served HTTP
client; httpapi handler tests (mapping, unknown/repeated params,
projection, capability); httpclient stub tests (pre-dial refusal naming
the token, encoding, projection, legacy door paging); skew and vocabulary
counts; TestE2E_BlockedOverHTTP (served `bd blocked --json` equals the
local command's after mapping ids and timestamps, member order included,
external blocker named, older-server refusal with no dial); corpus
gc-blocked re-marked and gc-blocked-parent added, both pending until the
reference server advertises blocked.list.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(blocked): pin server-side external decoration, refuse has_more, serve the legacy door over http
Review fixes for the blocked.list slice.
- Server-side external decoration is now pinned on the compositions bd
serve answers from. TestWrapUOWProviderBlockedListerNamesExternalBlockers
lists through the wrapped unit-of-work provider's own BlockedLister
accessor (the bd serve provider path) and requires an external-only row
and a mixed row to carry their external: refs; building that lister over
the inner provider fails it. TestServedBlockedListerCarriesExternalRefs-
WhenTheServerEnforces serves the store-shaped composition
(externaldeps.Store.BlockedLister, policy advertised) and requires the
operation's own answer, through the undecorated client role, to carry the
refs, and the client's decorated chain to return it unchanged; serving
the inner store's lister fails it.
- The client refuses an answer reporting has_more with the new typed
httpclient.TruncatedListingError instead of returning a short listing:
the operation has no cursor, and a caller reads a missing row as
unblocked. The legacy door inherits it.
- externaldeps.Store.GetBlockedIssues over an http store reads the extra
sources through the served roles (EdgeReader, BatchGetter) instead of the
raw GetIssuesByIDs / GetDependencyRecordsForIssues the http backend
refuses, and the decoration skips the source read when there is nothing
to load. The legacy door on the CLI chain (bd mol stale, the wisp
commands) now answers over http in both policy modes;
TestServedLegacyGetBlockedIssuesThroughTheDecorator pins it, paging
included. bd ready --explain still refuses on its other raw reads; the
CHANGELOG says so.
- Docs: the spec and the retired F-blocked ledger row state that the
listing is unpaged, bounded by the client's 32 MiB response limit
(refused, never read in part), and that has_more is refused.
- Contract: new cases for waits-for and conditional-blocks blockers, no
type exclusions (gate, epic), and a stale flag with no nameable blocker
(on the legs that can write the column: dolt, embedded; skipped
elsewhere with the reason). Order seeds explicit created_at values with
five rows tied on priority and created_at, two of them wisps, so only the
id tiebreak orders them; dropping the tiebreak now fails every run.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(blocked): bd blocked --flags, the blocked flag per id from stdin
`bd blocked --flags [--json]` reads ids from stdin, one per line (blank
lines and repeats ignored), and prints the blocked flag bd holds for each:
with --json, [{"id","is_blocked"}] in the order the ids were first given,
omitting an id that names no row on either plane, [] for no input. It is
the readiness column a consumer otherwise had to read with `bd sql`, so no
such consumer needs a local-only command.
It is the FLAG, not the listing: `bd blocked` narrows the stored flag to
rows it can name a blocker for, and --flags does not, so a row whose flag
is set with no nameable blocker reads true here and is absent from the
listing. Where the external-dependency policy applies, an unsatisfied
external: blocker sets the flag, as it keeps the row out of `bd ready`.
One library entry on every route: issueops.BlockedFlags over the route's
BlockingAnnotator (the store's accessor on dolt, embedded and HTTP, the
provider's on the proxied route). Over HTTP that is listBlockingAnnotations
with is_blocked behind dependencies.blocking.isBlocked; a server without
that token is refused before the dial, naming it. No wire change. The
listing's filter flags are refused with --flags rather than ignored.
Tests: TestE2E_BlockedFlagsOverHTTP (served JSON equals the local command's
after mapping ids to titles, unknown id omitted, repeat collapsed, [] on
empty stdin, filters refused; a stale-flagged row with no blocker reads
true and is absent from `bd blocked --json`, which fails if --flags is
derived from the listing; an older server's handshake refused naming the
token with no dial); TestProxiedServerBlocked/flags_reads_ids_from_stdin on
the proxied route; corpus gc-blocked-flags, pending until the reference
server advertises the token. CHANGELOG entry.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(blocked): bd blocked --flags --raw, the stored is_blocked column
`bd blocked --flags --raw [--json]` answers the stored is_blocked column
for each id read from stdin, exactly what reading is_blocked from the issues
and wisps tables returns, without the external-dependency policy: a row
blocked only by an unsatisfied external: ref reads false (the policy-aware
--flags reads true), and a stale flag reads true either way. Same output
shape as --flags. This lets a consumer move off a `bd sql` read of the
column with no change in what it reads. The default --flags is unchanged.
The role is taken from beneath every decorator: storage.UnwrapStore on the
direct routes, uow.UnwrapProvider on the proxied route. Over HTTP the
innermost store is the http client, whose annotation read is the server's
answer: against a server that does not advertise
policy.external_dependencies that answer is the column, and --raw is
served. A server that advertises it decorates the flag it answers, the v0
wire has no member asking it for the column, and the decorated flag cannot
be turned back into the column client-side, so --raw against such a server
is refused before the annotation read, naming the token, rather than
answered with the decorated flag. --raw without --flags is refused.
Tests: TestE2E_BlockedFlagsOverHTTP/raw_is_the_stored_column (served --raw
equals local --raw; the externally-blocked-only row reads true with --flags
and false with --raw on both; locally blocked rows agree; a stale-flagged
row reads true in both modes; --raw without --flags exits 1; a server
advertising the policy refuses --raw with no annotation request);
TestProxiedServerBlocked/flags_raw_is_the_stored_column; corpus
gc-blocked-flags-raw (pending until the reference server advertises
dependencies.blocking.isBlocked). Routing --raw through the decorated
annotator fails the e2e. CHANGELOG entry.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(changelog): bd blocked --flags --raw is for the local and proxied routes
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(blocked): give the e2e gate-kid its own priority; document --flags answers closed ids
TestE2E_BlockedOverHTTP seeded gate-parent and gate-kid at one priority, so
when both landed in the same second their order fell to the generated ids,
which differ between the local and the served workspace: the comparison
failed intermittently. gate-kid now has its own priority. Ten runs on the
embedded lane pass.
bd blocked --flags answers a closed id too, with its stored flag; a SQL read
of the column filtered on status <> 'closed' leaves it out. Said in the
command's doc and the CHANGELOG.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(blocked): apply label filters to external-only blocked rows
The external-dependency policy appends a row blocked only by an
unsatisfied external: ref after the label query has run, so --label,
--label-any and --exclude-label never judged it: bd blocked and
GET /v0/beads/blocked listed it whatever its labels, on every route.
Both decorators now filter those rows by the request's labels. The uow
decorator reads them through GetMany, chunked at MaxGetManyIDs, so their
labels are hydrated; GetIssuesByIDs left them empty, which also printed
them unlabelled on the proxied route.
Review fixes (adopt-pr apply-fixes, iteration 1):
- major #1: label filters on external-only rows in the store and uow
decorators, with absence-asserting arms in the unit, served httpclient
(server- and client-enforced policy), e2e and proxied tiers; the spec
and the role doc say such rows are narrowed like every other row.
- minor #2: the policy.external_dependencies token prose names the
blocked listing (spec, routes.go, regenerated types.gen.go).
- minor #6: SERVE_RUNBOOK and the allowUnlimited comment record the
blocked listing's unbounded whole-set answer and why.
- minor #10: BlockedLister telemetry-outermost and typed-unsupported pins
beside the ReadyCounter pair, plus the externaldeps wrap pin.
- nit #9: F-blocked names --flags --raw's refusal against a server that
applies the policy (ledger.go and the regenerated ledger doc).
- nit #11: the remote BlockedLister no longer builds a local lister it
then discards.
Review fixes (adopt-pr apply-fixes, iteration 2; the review approved at
940 with one minor and two nits, none gating):
- minor (the --flags refusal list was unpinned): the new
TestBlockedFlagsRefusesEveryListingFilter pins blockedFlagFilterFlags
to the flags blockedCmd registers, in both directions. Every
registered flag except --flags and --raw must be refused, and every
entry must name a registered flag. The test walks Flags() rather than
LocalFlags(), so it does not merge the root's persistent flags into
blockedCmd, and it skips inherited root flags and cobra's --help.
Mutants:
- four fail it: a new filter flag left off the list, a dropped
entry, a misspelled entry, and --raw added to the list;
- a simulated earlier in-process run (merged root flags plus --help)
stays green, and fails once either skip is removed.
- nit (the remote branch's span): the remote BlockedLister comment now
says why that lister is not wrapped again. The inner lister already
carries telemetry's span, so wrapping would nest a second span of the
same name. The comment also says what runs outside that span.
- nit (duplicated order comparator): left as is. finishBlockedIssues
predates this PR, so merging the two sorts would refactor existing
code with no review pass left after this one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Gas City Adopt-PR
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Eddie the Engineer <338826946+gascity-eddie[bot]@users.noreply.github.com>
* feat(list): bd list's remaining filters over http behind issues.list.filters
Over http every `bd list` filter beyond the created bounds and the title,
id and no-assignee scope refused (time bounds, priority range, text and external-ref
matches, spec, label pattern/regex, exclude-type, no-parent, no-labels,
empty-description, pinned/no-pinned, deferred, overdue, mol/wisp type).
The library entry already applied all of them: issueops.Reader.List via
workapi.BuildListFilter, shared by the CLI and the handler. This adds
only the wire.
- Server: GET /v0/beads/issues decodes 29 new optional parameters
(listFilterParams, decode only; countIssues' names where it already
spells the filter) into the existing ListRequest, behind one new
behavior token, issues.list.filters. mol_type/wisp_type are closed
enums refused by name (an empty value too). wire_revision stays 2;
apigen and the wireshape golden are regenerated (additive only).
- Every RFC 3339 bound the listing and count decode is normalized to UTC,
so an offset-bearing bound selects what its Z twin does on a zone-less
timestamp column.
- workapi.BuildListFilter refuses PinnedFlag with NoPinnedFlag
(ErrValidation, the CLI's own sentence) instead of letting PinnedFlag
win; over http that is a 400 on no_pinned.
- Client: the encoder sends the members (encode.ListFiltersMembers, one
list read by the encoder, the pre-dial gate and a spec-parity test).
Against a server not advertising the token, httpReader.List refuses
before dialing with ErrUnsupported naming issues.list.filters. The 29
E-ListRequest ledger refusal rows retire; the ledger doc is updated;
skew flag mappings added.
- Tests: handler decode/parity/enum/UTC/malformed/pinned-pair tests;
encode member/gate/spec parity and bound encoding; per-member
ride-behind-token and pre-dial skew refusal; two new Reader contract
cases on every leg (dolt, embedded, uow, served): the eight time
bounds at exact boundaries (strict, whole-second truncation, NULL never
matches, +02:00 equals UTC) and one in/out row per remaining family;
three served Reader cases unparked; TestE2E_ListFilterParityOverHTTP
(served == embedded, masked server refuses naming the token, no dial);
five corpus shapes marked pending until the reference server profile
advertises the token.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(list): exclude_status on listIssues, the 30th issues.list.filters member
issueops.ListRequest gains ExcludeStatus: statuses to leave out of a
listing, appended to the default exclusions (never re-admitting what they
hide), comma-separated or repeated, and validated against the workspace's
statuses by the same rule CountRequest.ExcludeStatus uses (an unknown name
is ErrValidation). The rule moves into one shared function,
workapi.ParseExcludeStatus, called by both builders. With AllFlag it reads
the active set without enumerating every status, so an http-backed caller
can list O(active) rows instead of the whole history.
- Server: listIssues decodes a repeatable `exclude_status` under the same
issues.list.filters token (no new token); an unknown name is a 400 on
exclude_status. apigen and the wireshape golden are regenerated
(additive).
- Client: the encoder sends it and it joins encode.ListFiltersMembers, so
the pre-dial gate asks for the token.
- It is refused together with ReadyFlag, like the other members the ready
query cannot carry.
- No `bd list --exclude-status` flag yet (it would need the CLI docs
regenerated); the member is reachable through the library and the wire.
Tests: builder unit test (append, AllFlag, comma split, unknown name);
handler decode and 400; encoder, round-trip and gate; Reader contract
cases on every leg (active set under AllFlag, repeated and comma values,
adds to the defaults, narrows an explicit Status, unknown name refused).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(list): label_regex compile errors are 400s; review polish for list filters
- An invalid `label_regex` on GET /v0/beads/issues, /v0/beads/ready and
/v0/beads/ready:count is now `400 invalid_argument` (`invalid_value` on
`label_regex`) instead of `500 internal`. The database still compiles
the pattern in its own dialect; a request that sent a regex and earned
the engine's "regular expression is invalid" refusal is attributed to
the parameter (failRegexReadErr). The same text on a request with no
regex stays a server fault.
- mol_type and wisp_type refuse each other's vocabulary (tests pin
`mol_type=heartbeat` and `wisp_type=swarm`), so the call-site
allowlist, not just the spec enum, is covered.
- exclude_status with a workspace custom status: leg tests on the
embedded store and over the served wire (accepted and applied; a name in
no vocabulary refused). ReaderFixture cannot configure custom statuses,
so these sit beside the count's twin rather than in the contract.
- The search e2e gains a positive arm: --desc-contains returns exactly the
row whose description carries the token.
- Docs: `all` plus `exclude_status` keeps every status not named (pinned,
hooked and custom done/frozen included unless named), not "the active
set"; label_regex documents its 400. A corpus source line is made
neutral; a test message says 30.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(list): compose issues.list.filters with the --title-contains fold
#7631, now on main, folds `bd list --title-contains` onto listIssues
`title` and refuses the TitleContains left over from a --title and
--title-contains pair that differs, because the listing then had one
title parameter. This branch publishes `title_contains` behind
issues.list.filters, so that leftover now rides it beside `title` and
the server applies both. Neither half is dropped, and against a server
without the token the pre-dial gate refuses, naming issues.list.filters.
- encode.FoldTitleContains still runs first; its doc now says where a
differing pair goes.
- Tests: the fold table expects `title` plus `title_contains` for a
differing pair, including the ſ/s pair strings.EqualFold would match;
the differing-pair refusal names issues.list.filters; the
list_filters_test sweep pairs its TitleContains probe with a differing
TitleSearch, since a lone one asks only for issues.list.title; the e2e
differing-pair refusal becomes a listFilterShapes row that answers
exactly child-a over http and embedded, and refuses before dialing
without the token.
- The gc-polecat-closed-after corpus shape's pending reason also names
issues.list.title. The CHANGELOG --title-contains entry no longer
lists the differing pair and --closed-after as refused.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* build(bazel): auto-sync BUILD files
Applied from the bazel-sync-patch artifact of https://github.com/gastownhall/beads/actions/runs/39013611268
(`make bazel-sync`: gazelle, tools/bazel/go_srcs.py, bazel mod tidy).
Only BUILD.bazel, MODULE.bazel and MODULE.bazel.lock are ever pushed; see
scripts/bazel-autofix-push.sh.
* fix(list): serve --priority-max in search parity, refuse the parent pair
The proxied tier's search parity table still expected a remote
`bd search --priority-max 1` to refuse, because listIssues could not
carry it. This branch serves priority_max behind issues.list.filters,
so the remote route answered and the dolt-race shard went red in
TestProxiedServerSearchRoutesAgree. The row now expects the answer on
every route. It was the last wireCan=false row; the branch stays, with
a comment, for the next flag listIssues cannot carry.
- ParentID with NoParent: a served listing now carries no_parent beside
parent, and ANDing the two answered only the edge-less rows under the
parent's dotted id. BuildListFilter refuses the pair with
ErrValidation, in the sentence bd list and BuildCountFilter already
use, so issueops.Reader.List refuses it on every backend and the
listing answers 400 on no_parent. Pinned by a builder test, a reader
conformance case (dolt, embedded, uow, served http) and two httpapi
tests.
- POST /v0/beads/issues:claimNext shares the ready listing's
label_regex but answered a pattern the database cannot compile with
500. It now gives the listing's 400 invalid_value on label_regex,
through the helper the listing's mapping is split into.
- The descendant walk's ledger rows said listIssues publishes no
parameter for members it now serves behind issues.list.filters. They
now say the walk does not send them yet, and that --flat or --json
asks listIssues directly. The ExcludeStatus, Pinned and ExcludeTypes
rows, the parentwalk.go header, the walk table's doc and two walk test
comments are corrected the same way, and the ledger doc is
regenerated. parentWalkRefusals notes that a member moved off the list
must check issues.list.filters itself, because the walk dials past
the listing's pre-dial gate.
- Spec: the listing's no_parent documents the pair's 400, the count's
exclude_status no longer says it has no listing counterpart, and
claimNext's label_regex documents its 400. types.gen.go is
regenerated. Comment-only: countFilters, and readyScopeFields'
ExcludeStatus entry.
- CHANGELOG and README say the default `bd list --parent` tree view
does not carry the new filters yet; the label_regex entry names
claimNext, and a Changed entry records the parent-pair refusal.
Second review pass: docs and comments only, no behavior change.
- The prose copies of the issues.list.filters member set now match
ListFiltersMembers: CapIssuesListFilters and wire.CapListFilters name
the status exclusion, and the spec's capabilities text names
label-regex.
- Every time bound on the listing and the count goes through
q.timestamp, which normalizes it to UTC, and sqlbuild compares it
strictly at whole-second precision. listIssues' created_before and
created_after, and countIssues' created, updated and closed bounds,
now say so in the words the new listing bounds use. The count's
updated bounds also say what they filter, and its closed bounds say
that a NULL closed_at never matches. types.gen.go is regenerated.
- README and CHANGELOG: `--flat` or `--json` applies the filters to the
parent's direct children, not its whole subtree.
- The 29 listRefusal rows this branch serves stay deleted rather than
kept as retired rows, as #7550 deleted its TitleSearch, IDFilter and
NoAssignee rows when it served them. The CHANGELOG now says the rows
are removed, not retired.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Eddie the Engineer <338826946+gascity-eddie[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix(http): serve bd list --title-contains by folding it onto title
`bd list --title-contains X` refused against an HTTP workspace because
listIssues publishes no title_contains parameter. The store compiles
TitleContains and TitleSearch to the same predicate (LOWER(title) LIKE
'%v%'), so the client now folds TitleContains onto TitleSearch before the
pre-dial gate (encode.FoldTitleContains) when TitleSearch is empty or equal.
The request then rides the existing `title` parameter behind
issues.list.title, and against a server without that token it refuses before
dialing, naming the token. A --title and --title-contains that differ still
refuse: the listing has one title parameter and dropping either value would
widen the answer.
No wire change. The ledger row E-ListRequest.TitleContains narrows to the
differing pair.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(http): fold case-only title pairs and qualify the CHANGELOG
Review fixups for #7631.
- FoldTitleContains also folds a pair that differs only in letter case.
The store binds each value as '%' + strings.ToLower(v) + '%', so a pair
equal under strings.ToLower is one predicate. It does not use
strings.EqualFold, which matches pairs such as "ſ" and "s" that lower to
different patterns. Unit cases pin both directions, and the served test
answers a case-only pair like the single flags.
- CHANGELOG: name what still refuses over HTTP: a pair that differs other
than in case, either flag with --parent in the default tree view, and
--closed-after, which gascity's polecat pre-flight lookup of recently
closed beads (step 3d) uses.
- Corpus: add gc-polecat-title-contains-closed-after, the 3d lookup,
pending until the reference server advertises issues.list.title and
listIssues carries closed_after (E-ListRequest.ClosedAfter).
- Drop two assertions that could not fail (a request passed by value
cannot be mutated), and bring the e2e shape header, the
tokenedListFilters comment, the encoder table comment and the
E-ListRequest.TitleContains ledger row (doc regenerated) up to date.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Eddie the Engineer <338826946+gascity-eddie[bot]@users.noreply.github.com>
* feat(issueops): gate members on create and update, one bounds validator
The library half of serving gate await fields. Every local leg already
stores await_type, await_id, timeout and waiters on create, and await_id
on update; this adds the two missing pieces.
- IssuePatch.Waiters: a whole-value replacement of the waiter list (nil
or empty clears, stored as []), mapped by UpdateFields and by the
unit-of-work updateSpec, deep-copied by CloneUpdateRequest, and
classified as a non-coordination signal on the dolt leg. Duplicates are
stored as given; dedup stays the CLI's.
- ValidateGateFields / ValidateGatePatch with *issueops.GateFieldError
{Field, Detail} wrapping ErrValidation, mirroring ReclaimFieldError so a
front door can name the member. The rules are the columns' only:
await_type <= 32 characters, await_id <= 255 characters, the JSON
waiter list <= one TEXT column (65535 bytes), and timeout >= 0. No
await_type allowlist, no gate-type-only rule, no timer-needs-timeout
rule. Run from ValidatePublicCreateRequest (every create shape on every
backend) and ValidateUpdateRequest (await_id, waiters).
- Conformance: LifecycleCreate WritesTheGateMembers / BoundsTheGateMembers,
LifecycleUpdate PatchesTheGateMembers / BoundsTheGateMembers and
BatchApply CarriesTheGateMembers, each bound asserted from both sides,
wired on the dolt, embedded and uow legs and parked on the http leg on
the live refusal rows until the wire slices land.
- httpclient: IssuePatch.Waiters is refused before the dial on both patch
documents under a new W-IssuePatch.Waiters row (refuse-not-drop), until
the wire publishes it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(httpapi): publish the gate members on create and update
The wire half of serving gate await fields, over the library slice.
- createIssue and the issues:batchApply create item publish await_type,
await_id, timeout (nanoseconds, the encoding Issue.timeout reads back)
and waiters, behind the new behavior token issues.create.gates (one token
for both create shapes, the issues.create.defaultPriority precedent).
- updateIssue's patch and the batchApply update item's patch publish
await_id and waiters (whole-value replacement; [] clears), behind
issues.update.gates. await_type and timeout are not patch members: no
local update route changes them. Neither is nullable; null is refused
naming the member, as on title.
- The handlers only decode and project (createGateMembers,
patchGateMembers). The wire is no stricter than the library: every bound
is the role's *issueops.GateFieldError (await_type <= 32, await_id <=
255, the JSON waiter list <= one TEXT column, timeout >= 0), mapped to the
existing 400 invalid_argument with param naming the member at its level
(await_type, patch.waiters, items[i].create.timeout,
items[i].update.patch.await_id). The spec mirrors exactly that:
maxLength 32/255 and minimum 0, and no minLength/maxLength/maxItems on
waiters. Blank and duplicate waiters and any await_type reach the role
untouched.
- Spec: the four schemas, the capability prose, and the stale sentences
(createIssue's "await_* publishes on no operation, read or write" and the
patch's "spec_id and await_id publish nowhere yet"). apigen regenerated
(from the remote drift test's diff), wireshape golden regenerated:
additive entries and sides only, wire_revision stays 2.
- Client: the two tokens are mirrored in wire.behaviorCapabilities so the
vocabulary stays set-equal with the server's. The client still refuses
every gate member before the dial (the client slice flips that); the write-ledger
pending sets name the newly published members under their live refusal
rows, and the W-CreateRequest.Issue / W-IssuePatch.AwaitID /
W-IssuePatch.Waiters reasons, the served-leg park reasons and the S4b
waiver now say the server publishes them and this client does not send
them yet.
Tests: internal/httpapi/gate_fields_test.go pins member mapping on all four
bodies, clear-by-empty on both patches, null and unpublished-member refusal,
GateFieldError -> param at every nesting level, and both tokens advertised.
Mutating the handlers (dropping the mapping, the GateFieldError arms or the
tokens) turns them red.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(httpclient): send the gate members behind their tokens
The client half of serving gate await fields, over the wire slice.
- Create: await_type, await_id, timeout (nanoseconds) and waiters join the
create vocabulary on createIssue and batchApply create items (now
twenty-four members), sent verbatim when populated. Patch: await_id (by
presence; "" clears) and waiters (whole-value; nil/empty travels as [])
are encoded on both updateIssue's and the batchApply update item's patch.
- Token gate before the dial: a create naming any gate member needs
issues.create.gates, a patch naming one needs issues.update.gates. Without
the token the request refuses with wire.NewCapabilityError naming it
(typed ErrUnsupported{Capability}), never a dropped member. batchApply
checks the whole plan once, so no partial plan is sent. A request naming
no gate member never reads either token. Store.requireCapabilityBeforeDial
is the shared helper; requirePersistenceMove now uses it.
- Bounds read back typed: the server's 400 invalid_argument/invalid_value
whose param names a gate member at any level (await_type, patch.waiters,
items[i].create.timeout, items[i].update.patch.await_id) is rebuilt as the
role's *issueops.GateFieldError, the problem kept in the chain (and a batch
refusal still becomes its *ItemError). Without this the served bounds
contracts could not pass.
- Ledger: W-IssuePatch.AwaitID RETIRED; the library slice's W-IssuePatch.Waiters row
deleted (it never shipped outside this branch); W-CreateRequest.Issue and
W-CreateItem.Issue no longer cover the gate members; new
W-CreateRequest.Gates (refuse, Capability issues.create.gates) records the
token-gated late refusal for both create shapes. engdocs ledger
regenerated from Ledger() (262 rows: 201 refuse, 34 degrade, 27 retired).
- Write-ledger table: the wire slice's pending sets are flipped into carried.
- Served leg: the five gate cases (LifecycleCreate Writes/Bounds,
LifecycleUpdate Patches/Bounds, BatchApply Carries) are un-parked and run;
the S4b waiver and served comments now say await_id is sent.
Tests: internal/httpclient/gate_fields_test.go (encode on all four bodies,
clears, old-server refusal per member naming the token with no dial, no
partial batchApply plan, plain requests unaffected on old and new servers,
GateFieldError rebuilt from the problem). Disabling the three pre-dial
checks turns the refusal tests red.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* build(bazel): auto-sync BUILD files
Applied from the bazel-sync-patch artifact of https://github.com/gastownhall/beads/actions/runs/38841144413
(`make bazel-sync`: gazelle, tools/bazel/go_srcs.py, bazel mod tidy).
Only BUILD.bazel, MODULE.bazel and MODULE.bazel.lock are ever pushed; see
scripts/bazel-autofix-push.sh.
* docs(issueops): say the gate timeout rule is no column's
The gate validator's doc said its rules were the stored columns' and that
no command line can produce a negative timeout. The widths are the
columns' (VARCHAR(32), VARCHAR(255), TEXT), but timeout_ns is a BIGINT,
so a non-negative timeout is a rule no column enforces; the wire
publishes it as minimum 0. The raw store creates (CreateIssue,
CreateIssues) and import do not run the validator, so bd gate create
--timeout=-5m, a formula step's gate.timeout and a template clone still
store a negative timeout until they move onto the role.
Also say that GateFieldError.Detail is prose whose HTTP copy ends with
the server's own clause, so a caller dispatches on Field, and why a
create omits an empty waiter list while a patch sends [] to clear it.
Comments only; no behaviour change.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(corpus): gh:run await_id persist refuses by the missing gate token
#7604 (now on main) made bd gate check persist a gh:run gate's discovered
run ID through Lifecycle.Update. Its served test expected the HTTP
client's W-IssuePatch.AwaitID refusal, which persistGateCheckAwaitID
rewords to name await_id. This PR retires that row: the patch carries
await_id behind issues.update.gates. Through the reference proxy, whose
server advertises no gate token, the persist is now refused before the
dial by the capability error ("bd serve at ... does not advertise
capability "issues.update.gates", which updateIssue requires"), so the
merged tree failed the subtest's await_id and updateIssue assertions.
The subtest now expects that refusal: no writes, the error names the
gate, the missing token and the server, no role or store method leaks,
and await_id is untouched. persistGateCheckAwaitID already returns a
capability error as the role raised it (#7604 pins that), so no code
changes. Against a server that advertises the token the persist goes
through: a scratch probe against the in-process server recorded
await_id=4242 and closed the gate.
Also correct the gate.go comment and the CHANGELOG entry that still said
the HTTP client refuses every await_id patch.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eddie the Engineer <adopt-pr@gascity.com>
* fix(init): refuse to initialize directly in the home directory
`bd init` in a directory that isn't a git repo (and has no explicit
BEADS_DIR) unconditionally `git init`s the directory, writes agent
scaffolding (CLAUDE.md, AGENTS.md, .gitignore, .agents/, .codex/,
.claude/settings.json), and commits — with no confirmation. Run in the
home directory this silently turns $HOME into a git repository and can
clobber an existing ~/CLAUDE.md. It's worse under --non-interactive
(auto-engaged whenever stdin isn't a TTY, i.e. whenever an agent runs
`bd init`): all of it happens with zero prompt (GH#4635).
Refuse the init when the current directory is the user's home directory
and it isn't already a git repo (and no explicit BEADS_DIR was given),
with a clear error pointing at the alternatives (cd into a project, or
set BEADS_DIR). The common fresh-project flow (mkdir proj && cd proj &&
bd init) and already-git-tracked homes are unaffected.
The guard runs as the first statement in init's RunE, ahead of every
path that has an effect. Position is the whole fix: --reinit-local /
--force reach countExistingIssues, which opens a real store (creating
the data directory, able to run migrations), and --proxied-server
dispatches to runInitProxiedServer -> EnsureGitRepo, i.e. a `git init`
in the current directory. Both run long before the point where a guard
placed with the rest of the path validation would fire.
Home is resolved from the OS account database (user.Current) in
preference to $HOME, so the guard keys off the real account home even
when $HOME is repointed — which this repo's own tests do constantly.
Both sources are best-effort: a CGO-free build's user.Current() falls
back to os.UserHomeDir() (i.e. $HOME on Unix) when the account is absent
from the passwd database, so this is a preference, not a guarantee of
$HOME-independence. Mirrors the home resolution in internal/beads'
isPathInSafeBoundary.
Tests: TestIsUserHomeDir and TestGuardInitInHomeDir cover the decision
(resolver stubbed, so the real home is never touched);
TestInitCommand_RefusesInHomeDirBeforeAnySideEffect runs the actual
command for plain / --reinit-local / --force / --proxied-server and
asserts not just the refusal but that nothing — .git, .beads, CLAUDE.md,
AGENTS.md, .gitignore, .agents, .codex, .claude — exists afterwards.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(init): key the home guard on caller intent, and give it a named exit code
Three blocking items, two reviewers converging on the first.
1. The guard read os.Getenv("BEADS_DIR") as "the user explicitly opted in".
It is not. Cobra's root PersistentPreRunE runs before RunE and, for a
no-DB command like init, resolves a beads dir and exports it
(selectedNoDBBeadsDir -> prepareSelectedNoDBContext ->
prepareSelectedCommandContext). That resolution bottoms out in
beads.FindBeadsDir(), which accepts any ancestor .beads/ for which
hasBeadsProjectFiles is true - and a config.yaml alone is enough. That is
the shape of this project's own legacy user-level ~/.beads/config.yaml,
so anyone carrying it got BEADS_DIR set for them and the guard failed
open. `bd -C <dir> init` opened the same hole, and that one does not even
move the working directory the scaffolding lands in.
The damage is not self-cancelling. The `git init` half is separately
gated on the same env so it stayed skipped, but the agent scaffolding is
not gated at all: addAgentsInstructions, InstallClaudeProject,
InstallCodexProject and InstallCursorProject all write relative to CWD.
So the bypass still clobbered ~/CLAUDE.md, ~/AGENTS.md and
~/.claude/settings.json - the files the guard exists to protect.
beadsDirFromCaller captures BEADS_DIR as the process INHERITED it, at
package initialization, which the language guarantees runs before main
and therefore before any bd code exports one of its own. The guard
consults that snapshot, so the question it asks is "did the caller name a
beads dir", not "does the process env happen to have one".
2. The refusal skipped all three of init's refusal conventions.
ExitHomeDirRefused = 13 joins 10/11/12, the message is printed and the
error carries only the code (the ExitLocalExistsRefused pattern), and
docs/recovery/init-safety.md gains an init-home-refused anchor - TOC
entry, symptom, why, three recovery paths, and the script-branching
snippet - which the message points at. `bd help init-safety` lists it.
NOT added: a cmd/bd/protocol case. That corpus states that §E3 freezes
10/11/12/130 and that a new stable code requires a spec revision, so
asserting 13 there would be claiming wire status the spec has not
granted. The constant plus the docs anchor give the refusal the same
in-repo scriptability without that claim; say the word if the spec should
be revised and I will add the corpus case too.
3. CHANGELOG [Unreleased] entry, citing #4635 and stating the scope limits.
Also from review: the message's BEADS_DIR escape hatch said "set BEADS_DIR
if you really mean to initialize here", which is not what happens - an
explicit BEADS_DIR makes hasExplicitBeadsDir true, skipping the git init and
the CWD-local .beads. It now says so.
Test coverage answers the point both reviewers made about the RunE-only
tests. TestInitThroughRootCmd_RefusesInHomeDirWithDiscoveredBeadsDir runs
through rootCmd.Execute, in a home carrying only .beads/config.yaml, and
asserts the precondition (pre-run really does discover it) before asserting
the refusal and that no scaffolding landed. --backend names a backend that
cannot exist as a circuit breaker, so a future fail-open stops there instead
of building a store in someone's home directory. Against the old code it
reproduces maphew's observation verbatim:
init ran past the home guard and got as far as backend selection:
unknown backend "review4795-home-guard-sentinel"
plus a unit case pinning that a bd-exported BEADS_DIR is not caller opt-in.
Reported-by: maphew, bee-ghosttrack
Agent-Signature: claude-code-opus-5-unknown-reasoning on behalf of Harry Miller
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(init): harden the home-dir guard (opt-out, git probe, exit 15)
Maintainer fixup on top of #4795 by harry-miller-trimble, for the three
majors and three of the minors from the adopt-pr review, the major, the
minor and the nit from its second round, and two of the minors from its
third. The contributor's commits are unchanged.
The BEADS_DIR opt-out still set up $HOME (major). The refusal said
`BEADS_DIR=<path>/.beads bd init` writes nothing in the home directory,
but an explicit BEADS_DIR only skips the git init. The agent files
(CLAUDE.md, AGENTS.md, .claude/, .codex/, .cursor/, .agents/) are
written relative to the working directory whatever BEADS_DIR says, and a
BEADS_DIR under $HOME counts as local, so ~/.gitignore was appended to
as well. guardInitInHomeDir now returns keepHomeClean for that case.
RunE forces skipAgents, which the proxied route also reads from its
input, and both routes gate the project .gitignore on keepHomeClean.
Init prints a note saying so, with a `bd setup <recipe> --global`
pointer for anyone who wanted an integration everywhere.
The refusal text, the CHANGELOG entry and the recovery playbook now say
what the opt-out does: it sets up only the named workspace, after a
`mkdir -p`, because init refuses a BEADS_DIR whose parent does not
exist. They no longer say nothing else is written, because Dolt and
metrics keep their own state under $HOME. The refusal's Why also stops
saying init overwrites existing files: it installs into them, and in
$HOME those are user-wide agent settings.
TestInitInUntrackedHomeWithCallerBeadsDir_SetsUpOnlyTheWorkspace runs
the direct route end to end against a Dolt server, once with the
workspace outside the home and once under it. Every seeded file must
come out unchanged, with nothing added. The proxied route's agent-file
and .gitignore gates are not covered by a test: there is no in-process
proxied init fixture to drive them.
The tracked-home probe trusted git's routing environment (major).
isGitRepo() is a plain `git rev-parse --git-dir`, so an inherited
GIT_DIR, or a home that only sits inside an enclosing work tree, stood
the guard down. Init's own git-init decision scrubs that environment,
then runs git init in the home and installs agent files into it. The
guard now asks isGitWorkTreeRoot(cwd), which runs
`rev-parse --show-toplevel` through initArtifactGitCommand and matches
the result against the home itself. Two new subtests pin both false
positives. Each asserts that isGitRepo() still reports true, so the
subtests keep reproducing the old probe.
Exit 13 was already taken (major). It is ExitGuardMismatch, "racer won,
skip gracefully", and 14 is ExitMigrationFrozen, so a wrapper branching
on exit codes would read this refusal as a benign skip. The refusal now
exits 15. The change is in init_safety.go, `bd help init-safety`,
ADR 0002, the playbook and the CHANGELOG. ADR 0002 also notes that 15
sits outside the protocol v0 §E3 freeze pinned in
cmd/bd/protocol/exit_codes_init_test.go.
The opt-out still set up a repository around the home (second round,
major). The tracked-home probe sends a home that only sits inside an
enclosing work tree, such as a dotfiles or monorepo checkout above it,
to the BEADS_DIR opt-out. Git finds that repository from the home, so
init set it up as the project: core.hooksPath, beads.role, fork routing
and the fork exclude, its origin as the workspace's Dolt remote, and a
bootstrap commit. That commit staged the home's legacy ~/.beads and then
whatever agent files the home holds, ~/.codex/auth.json among them, and
committed them with --no-verify. The proxied route did the same from its
tail.
keepHomeClean now also means "outside every repository". It is only
true when the home is not a work-tree root, so no repository git finds
from there is the home's own. On the direct route, RunE forces skipHooks
beside skipAgents; projectRoleRepo holds the six isInitRoleGitRepo
gates (the role prompt and pins, the GH#2950 safety net, fork routing,
the fork exclude) to keepHomeClean; and both origin-as-remote gates, the
bootstrap commit and the upstream advice are gated on it. On the proxied
route, the tail's isRepo probe, which gates the role, the fork exclude,
the commit and the upstream advice, and resolveProxiedInitRemoteURL are
gated on it; skipHooks reaches the tail through its input. What a flag
asks for still happens: --stealth and --setup-exclude write their
exclude, and an explicit --remote or a configured sync remote is still
used. The note, the refusal text, the CHANGELOG entry and the playbook
say what the opt-out leaves alone. Gating the commit also drops the
"skipped bootstrap commit" note the opt-out printed from an untracked
home.
Tests for it:
- The end-to-end test gains home_inside_a_repository. The home sits in
a repository with one commit and an origin, and holds a legacy
~/.beads; init runs without --quiet. The repository must keep its one
commit, nothing staged and its .git/config byte for byte (so no
core.hooksPath or beads.role). The workspace must not take its origin
as its Dolt remote, and init must print the note and no upstream
advice. The repository has no upstream remote, because fork routing
would create ~/.beads-planning under the suite's real HOME.
- TestProxiedInitTailKeepHomeCleanLeavesEnclosingRepoAlone runs the
proxied tail from a home inside a repository with an origin and an
upstream, so the fork exclude would fire. It requires no fork
exclude, no commit, nothing staged and the same .git/config.
- TestProxiedInitRemoteURLUsesSelectedProject gains a keep_home_clean
row (the origin is not used) and a configured_keep_home_clean row (a
configured remote still is).
- The guard's enclosing-repository subtest also checks that a caller
BEADS_DIR there returns keepHomeClean.
Second-round minor and nit:
- beadsDirFromCaller's comment and the playbook say why a BEADS_DIR read
from a .beads/.env does not count as the caller's, although
beadsDirProvidedAtStartup counts it for role detection. From the home
that file is the legacy ~/.beads/.env, so counting it would let the
same discovered ~/.beads opt out of the guard.
- The guard tests use t.Chdir, and the hand-rolled chdir helper is gone.
Validation: the init, home-guard and proxied-init tests pass against
the Dolt test container, as do the embedded init lane and the
proxied-server init integration tests. Mutation checks:
- Dropping the forced skipAgents fails both workspace subtests.
- Dropping the .gitignore gate fails the under-home subtest.
- Restoring the plain isGitRepo() probe fails both new false-positive
subtests.
- Disabling the guard fails every refusal test at the sentinel backend.
- Second round: dropping the forced skipHooks, the projectRoleRepo
gate, the commit gate, the late origin gate, the upstream advice gate
or the note each fails home_inside_a_repository on its own check.
Dropping the proxied tail's gate fails the tail test, and dropping the
proxied remote gate fails the keep_home_clean row. The third round
pins the early origin gate (below).
Third-round minors:
- The early origin gate picks the remote the early remote-safety check
probes, and a failed probe counts as Dolt history. The end-to-end
test gains unreachable_origin_reinit_local and
unreachable_origin_force: the home sits in a repository whose origin
path holds nothing, and init runs with --reinit-local or with --force.
Both must succeed and leave the repository as it was. Dropping the
early gate makes init probe that origin and refuse both rows with
exit 10.
- The playbook, the CHANGELOG entry and guardInitInHomeDir's comment
name the flags that still change the repository around the home:
--stealth and --setup-exclude write its .git/info/exclude, and the
interactive --contributor and --team wizards work in it (beads.role,
and possibly a sync branch). The opt-out's note is unchanged: none of
those writes is on its list.
Left for a follow-up:
- The proxied route's .gitignore gate is still unpinned. It needs an
in-process proxied init fixture, or the
`useLocalBeads && beadsDirIsLocal && !keepHomeClean` predicate pulled
out into a table-tested helper.
- Both routes still record the enclosing repository's origin-derived
repo_id, and its clone_id, on an opt-out workspace. That predates this
PR for every explicit-BEADS_DIR init and writes nothing to the
repository; skipping it is a behavior change of its own.
Third-round validation: the home-guard, init-tail and proxied-remote
tests pass in a hermetic env -i run against the Dolt 2.2.0 CI pin (41
tests and subtests, none skipped). Dropping !keepHomeClean from the
early origin gate fails both new rows with exit 10 and leaves the other
three rows passing. go vet, gofmt, the docsync test and the doc
freshness check pass.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Harry Miller <harry_miller@trimble.com>
---------
Co-authored-by: Harry Miller <harry_miller@trimble.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Eddie the Engineer <adopt-pr@gascity.com>
Co-authored-by: Eddie the Engineer <julianknutsen@users.noreply.github.com>
* perf(http): answer a command's repeated reads from one response (port of bd-enterprise e626072b8)
Over an http workspace, bd show <id> --json made three identical
GET /v0/beads/issues/<id> requests: the id resolver's exact probe,
routed.go's GetIssue and show's detail read all build the same URL. Text
show made six. Over a gateway each one is a sequential round trip, so the
request count is the command's latency floor (mc-5dkzp).
This ports bd-enterprise e626072b8 (bts-xpw.3.14.6, #217) verbatim, except
cmd/bd/main.go, where OSS still opens the identity preview inline, and
bd-enterprise's httpgw dialer test, which has no OSS counterpart:
- httpclient.WithSharedConnections: the identity-gate preview and the real
open share one transport, so a write makes one handshake.
- httpclient.WithReadMemo and a wire.Client read memo, for one-shot
commands only (not bd serve, --watch or --follow): identical getIssue,
getSetting and listSettings reads are answered from the response already
received. An entry ages from the server's answer (5 s), any write clears
the memo, a read that overlapped a write is not stored, and expired
entries are swept.
- bd list's three vocabulary reads come from one memoized listSettings.
- bd update --status / --if-status skips the custom-status read for a
built-in status.
- The hook decorator skips its post-write re-reads when no executable hook
exists for the event.
- bd dep add reads its confirmation titles before the write, from the memo.
Against a loopback bd serve: show --json goes from 3 requests to 1, text
show 6 to 3, update 5 to 3, close 6 to 4. Dolt and the other registered
backends receive the same ctx and ignore it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(http): BD_HTTP_READ_MEMO=0 turns the per-command read memo off
An operator who suspects a stale read can rule the memo out without a
rebuild. Any other value, or none, leaves the default.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(http): pin bd show to one fetch per issue (mc-5dkzp)
TestE2E_PerCommandRequestBudget allowed show two requests, and a read
that drifts to a URL of its own (a mutant whose reader spells
brief_deps=false) fits that ceiling on both handshake shapes. These guards
pin the single fetch instead:
- TestE2E_ShowFetchesTheIssueOnce: the exact requests, path and query, of
show --json, show --json --id, show --short, show of two ids and text
show, against both handshake shapes, plus a BD_HTTP_READ_MEMO=0 step
that must read the row more than once.
- TestDefaultIssueReadsShareOneMemoKey: the resolver's exact probe,
GetIssue, GetDependenciesWithMetadata, GetLabels and IssueReader().Get
build one URL, checked without a server.
- TestE2E_CloseRereadsItsOwnWrite: against the MC handshake, closing a
lone molecule re-reads its own closed row from the server after the
write, and prints no false "completed molecule" note.
- Corpus shapes can pin `requests:`, counted on the served run alone (not
setup, verify or {rev:ID} reads). The seven gc and mc show shapes pin
1, 4, 1, 1, 3, 1 and 3.
Also: TestReadMemoOptInReadsTheRealPollingFlags holds the opt-in to the
real show/list --watch and -w, events tail --follow and bd serve; the
show budget drops from 2 to 1; requestCounter records each request's
query; and ledger row L-read-memo records the memo's bounded difference
from local reads.
Mutation runs against this tree: brief_deps=true on GetIssue and
brief_deps=false on the reader's Get each fail the e2e list and the unit
test; show opting out of the memo fails the e2e list; writes that leave
the memo standing fail the read-your-own-write e2e; a memo keyed by path
alone fails the e2e list; dropping the kill switch fails its unit test
and the e2e step.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(config): list BD_HTTP_READ_MEMO
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(http): memoize a read's answer only once it has decoded
wire.Client.Do stored a memoable read's 2xx before it checked the body,
so an empty or undecodable 200 would have answered every identical read
in the command for the memo's whole TTL with the same failure, instead
of asking the server again. The answer is now stored only after it
decodes; a read that decodes nothing (out == nil) is not stored, and
every memoable read in this package decodes its answer.
TestReadMemoKeepsOnlyAnswersThatDecoded pins it (empty body, truncated
body, undecoded answer). Ledger row L-read-memo says so.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(http): pin the read memo's 5xx, write-method, per-client, in-flight-write and hook-gate behavior
Review follow-ups for the per-command read memo (mc-5dkzp):
- TestReadMemoNeverKeepsA5xx: a 503, 500 or 502 is not memoized and the
2xx after it is. TestDispatchRetryOfABusyMemoizedReadAsksTheServer
holds the same through dispatch's retry loop over a real wire.Client:
the retry reaches the server instead of replaying the 503.
- TestReadMemoIsDroppedByAnyWrite covers POST, PUT and DELETE, not just
PATCH.
- TestReadMemoIsPerClient: in either order, one client's read is never
answered from another's memo, and opting one client in opts in no
other. (A shared memo was otherwise caught only by test-order
pollution.)
- TestReadMemoDropsAnAnswerReadWhileAWriteWasInFlight pins the clear on
the write's way back: a read that starts and ends while the write is
on the wire is not answered again once the write has returned.
- TestHookFiringStoreReReadsOnlyForAnEventWithAHook pins hookConfigured's
probe: the decorator asks the runner about the event it fires, and
re-reads the row to build a payload only when a hook for that event
exists, through a probing double and through a real hooks.Runner.
Each was run against a mutant of the code it pins and fails there:
5xx stored before the status check; only PATCH clearing; one memo
shared by every client; no clear after the write returns;
hookConfigured answering true, false, or about the wrong event.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(changelog): note the per-command http read memo
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(httpclient): dial a large batchApply under the server's extended budget
bd serve runs an issues:batchApply over largeApplyItemThreshold (100) items
under DefaultLargeApplyCeiling (5m) on a context detached from the client,
but the wire client capped every request at DefaultTimeout (60s). A large
apply on a slow or loaded server therefore failed client-side with
"Client.Timeout exceeded while awaiting headers" while the server went on
to commit it: an error for an apply that landed.
wire.Request.Timeout now raises (never lowers) a bounded client's
per-request ceiling for one request, through a shallow copy of the
*http.Client that shares its Transport and forced CheckRedirect. ApplyBatch
sets it to LargeApplyTimeout (6m) once the plan exceeds
LargeApplyItemThreshold. The stall-retry deadline uses the same per-request
ceiling.
Tests:
- wire: a slow fake server times out an at-threshold apply under a short
ceiling and completes an over-threshold one; httpClientFor only raises a
bounded client and keeps its Transport and CheckRedirect.
- httpapi: TestTheClientLargeApplyBudgetCoversTheServer pins the redeclared
threshold to the server's and holds LargeApplyTimeout above request read
+ large-slot wait + ceiling + drain grace (5m45s).
- httpclient (served tier): a 101-item apply against a BatchApplier delayed
DefaultTimeout+5s, dialed through DialWith + DialOptionsForTarget like
the product, commits and returns success (71s). With the raise disabled
it fails at 60.03s with Client.Timeout.
Ported from bd-enterprise (gascity/bd-enterprise#195).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(httpclient): pin the raised stall-retry deadline; document the 6m large-apply ceiling
Review fixups for #7582.
- wire: TestARaisedRequestTimeoutAlsoBoundsTheStallRetry pins the one
OSS-only hunk of the port, the stall-retry deadline read through
httpClientFor(r). Reverting that line to c.hc.Timeout left the whole wire
package green; the new case fails on it, because the retry then runs out
at the client's own ceiling instead of the request's raised one.
- backend/http: Options.HTTPClient said the client is used as given except
for redirect handling. A batch apply over 100 items now raises a Timeout
shorter than 6 minutes for that request, so the public doc says so.
- README and CHANGELOG: the HTTP backend's write bound is no longer 60s for
every request. A batch apply over 100 items gets 6 minutes, and a server
whose --large-apply-ceiling is raised past about 5m15s can still outlast
it.
- engdocs/SERVE_RUNBOOK.md: the same limit, next to the stop-grace sizing
an operator reads before raising --large-apply-ceiling.
- served_batch_apply_test: the race-build comment blamed the client's 60s
timeout for shrinking the 1000-item apply. A plan that size now gets
wire.LargeApplyTimeout; it stays shrunk because the embedded tier measured
it at 903-945s under -race.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
#7478 deleted the frozen 15-shard proxied and 20-shard embedded manifest
blocks and refreshed most comments that described pr-risk.yml's retired
fork/push jobs as still running. Finish the #7382 adoption follow-ups on
what survived: the Close3/Close4 split is cited as #7173 (bd-ojckcg), and
the remaining present-tense references to the legacy jobs (bazel.yml's
embedded-lane rationale and cmd-dolt lane note, BUILD.bazel's socat note,
TESTING.md's socat paragraph) now say the jobs are retired (bd-g2w5rp).
bd-3lht (the hand-held 15-shard header round-trip) is moot: the block no
longer exists.
Comments and docs only; no shard assignment, workflow step or BUILD
setting changes.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* feat(http): advertise issues.update.claim and route claims by it (S24a/b)
updateIssue has served `claim` (upstream #6890), resolved on both planes so
a wisp is claimable, with no capability token: a client could only find it
by eating the skew 400, and gc's wire_compat preflight (which lists
issues.update.claim as an optional token) never saw it, so gc claimed every
wisp through claimIssue, whose Claimer role excludes the wisp plane.
Server: CapIssuesUpdateClaim ("issues.update.claim") joins
behaviorCapabilities. The spec names it on UpdateIssueRequest.claim and in
the context capabilities prose (apigen regenerated, descriptions only). No
request or response member changes; wire_revision stays 2.
Client: Lifecycle.Update reads the token from the cached handshake before
the dial. With it, every claim is one updateIssue call and its answer is
final (no fallback on any error). Without it, a claim alone goes straight to
claimIssue (no doomed 400 first; a wisp still refuses by name,
W-ClaimRequest.Wisp, whose Why now names the token), and a claim beside a
patch, a guard or a force override is refused before the dial with
ErrUnsupported{Capability: issues.update.claim}. serverPredatesUpdateClaim
(the error-sniffing fallback) is gone.
Tests: the four capability lists (routes.go, wire/handshake.go,
server_test, wire vocabulary_test) move together; unit tests for both
routes (pre-dial refusal dials nothing; with the token nothing falls back);
served tests claim a wisp through updateIssue with the token (zero claimIssue
dials, post-claim revision stitched), refuse it by name without it (zero
updateIssue claims, one claimIssue), and refuse a claim beside a patch
without the token while the same request claims and patches the wisp with
it. Live-mutated: ignoring the token fails the unit test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(http): count only ready --claim's requests in the claim-next check
TestE2E_AdvertisedExternalPolicyIsPassedThrough counted every request
since counter.reset(), so its "no by-id claim" check also saw the earlier
`update <other> --claim` step. The MC handshake mask does not advertise
issues.update.claim, so this PR routes that claim to claimIssue
(POST /v0/beads/issues/<id>:claim) by design, and the check failed in
Bazel / embedded Dolt tier (//backend/http:http_served_test shard 6 of
7), turning CI Gate / Required red.
Count from the snapshot length taken just before `ready --claim`, so the
check covers only the requests that command issues. The counter is not
reset: the close-policy check below scans the same history.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(http): refuse a token-less template claim on the client's pre-read
Against a server without issues.update.claim, Lifecycle.Update sends a
claim alone to claimIssue (claimWithoutUpdateClaim) and returns before
applyTemplateGuardForServer runs. claimIssue's role has no template check
(bd-jkp9v3), so `bd update <template> --claim` against every server
without the token claimed the template. The base refused it before any
write: on the client's pre-read against a server without
issues.update.allowTemplate, and in updateIssue's own guard against one
with it.
claimWithoutUpdateClaim now pre-reads the row and returns
AuthorizeTemplateUpdate's refusal before the claimIssue dial, whatever the
handshake says about allowTemplate: that token means updateIssue guards
templates, and this route never dials updateIssue. Any other row goes on
to claimIssue as before (a wisp to its refusal by name), and so does an id
the pre-read cannot find, so claimIssue's not-found stays the one reported.
TestUpdateClaimRefusesATemplateWithoutTheToken (stub wire) and
TestServedUpdateClaimRefusesATemplateWithoutTheToken (served tier) pin it
under an allowTemplate-only and a neither-token handshake. Both go red
without the pre-read; the allowTemplate-only legs also go red if the
existing guard is only moved above the claim branch.
TestUpdateClaimFailsClosedWhenThePreReadFails pins the pre-read's third
arm under the same two handshakes: a read that fails other than as
not-found returns that failure and never dials claimIssue, since the
row's template bit is unknown then. A best-effort pre-read (that failure
falling through to the claim) passed go test ./internal/httpclient/ and
its served Claim|Template tier before this test, and goes red on both
legs with it.
A claim beside AllowTemplate is refused before the dial with
ErrUnsupported naming the token, like a claim beside a patch, a guard or
a force override (isClaimOnlyUpdate already excluded it), but no prose
said so: claimWithoutUpdateClaim's doc, CapIssuesUpdateClaim's doc, the
test doc and the CHANGELOG entry now list it, and a
TestUpdateClaimAgainstAServerWithoutTheToken row pins it. Dropping
!req.AllowTemplate from isClaimOnlyUpdate passed the same unit and served
runs without that row and goes red with it.
The prose now follows the handshake rule too: the W-UpdateRequest.Claim
ledger row (and its re-rendered md) no longer calls claimIssue the
fallback for a server that 400s the member, Update's doc names
claimWithoutUpdateClaim instead of the nonexistent claimRouteForServer,
wire.UpdateFlags.Claim drops the "safe to read as skew" rationale no
caller relies on anymore, and the CHANGELOG entry says a template is still
refused on the token-less route.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Gas City Adopt-PR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(http): bd promote over http through issueops.Promote and issues.update.persistence (S21b)
`bd promote` refused over a connected HTTP workspace: it called the raw
PromoteFromEphemeral, which the http backend stubs, and updateIssue's patch
did not publish persistence. MC's PR-intake formula
(mol-normalized-issue-pr-v1) runs `gc bd promote <id> --reason ...`, so this
blocked the HTTP cutover.
- One library entry, issueops.Promote(ctx, PromoteRoles{Reader, Lifecycle,
Commenter}, PromoteRequest{Actor, IssueID, Reason, Provenance}): read the
row, refuse a non-wisp (*NotAWispError, the sentence bd promote always
printed), move it with ONE Lifecycle.Update whose patch is Persistence =
persistent (the role's atomic plane move: same id, labels, deps, events and
comments carried), then write the promotion comment (a comment failure is
reported, the promotion stands). A no-op move is a lost race and reports
NotAWispError without a second comment.
- cmd/bd: the direct route runs it over the store's own role accessors, so a
connected http workspace and a local one take the same entry. The history
label is "bd: promote <id>" where the store carries caller labels.
- bd serve: IssuePatchBody.persistence (persistent|ephemeral|no_history,
anything else a 400 naming patch.persistence) on PATCH
/v0/beads/issues/{id}, behind the new additive behavior token
issues.update.persistence. wire_revision unchanged. Spec, apigen and the
wire-shape golden regenerated; the handler only decodes and passes it to
the role.
- httpclient: Lifecycle.Update sends patch.persistence only to a server
advertising the token, and otherwise refuses BEFORE the dial with
*wire.CapabilityError naming it (unwraps to *storage.ErrUnsupported with
Capability set). The batchApply item still refuses it
(W-IssuePatch.Persistence now reads "ON issues:batchApply").
- Conformance: RunLifecycleUpdatePersistentPromotesAWisp on dolt, embedded,
uow and the served http leg; the served
PersistentPreservesUnversionedClass case is unparked.
- Served e2e TestE2E_PromoteOverHTTP: the mc-promote shape end to end
(label kept, comment written, one PATCH, re-promote refused), and under
the MC server mask a pre-dial refusal naming the token with no write.
- Corpus: mc-promote stays pending, relabelled SRV-1 with the reference
profile's exact refusal (the 1.3.0 server lacks issues.update.persistence).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(promote): run the proxied-server route through issueops.Promote (bd-4y73m9)
The adoption review found (major) that the proxied-server route still
promoted through the old engine, IssueUseCase.PromoteWisp in one
transaction with the comment, while the PR's docs said every route runs
issueops.Promote. Converge rather than reword: runPromoteProxiedServer
resolves the id, then runs issueops.Promote over the provider's own
notifying role accessors (proxiedIssueReader, proxiedIssueLifecycle,
proxiedCommenter), the entry the direct route runs. Both routes now share
promoteFailure (the error mapping) and reportPromotion (the comment
warning and the output), so neither contract can drift.
What a script sees change on the proxied-server route:
- the move is the persistence branch of Lifecycle.Update, so the child
counter moves with the row: a promoted parent's next
`bd create --parent` mints .3 after .1/.2 instead of failing with
"issue already exists";
- on_update fires twice, for the move and for the comment, as on the
direct route (it fired once, for the comment);
- a promotion is two Dolt commits, "bd: promote <id>" and
"bd: comment <id>" (it was one);
- a comment that cannot be written leaves the promotion standing behind
a warning, as on every other route, instead of rolling it back;
- a dual-plane id is refused rather than merged, the update role's
template guard applies, and a lost race reads "<id> is not a wisp
(already persistent)".
The PromoteWisp exemption in TestRecordingIssueUseCaseCoversItsSurface
stays, with its reason corrected: no route calls PromoteWisp now, and
its DoltStorage twin fires no hook either. The doc comments on the old
engine (PromoteFromEphemeral on DoltStore and the db layer, PromoteWisp)
no longer say bd promote uses it.
CHANGELOG: the promote entry now names what a script can see on the
direct and proxied-server routes: the hook firings, the comment row
`bd comments` lists, the child-counter carry, the two-commit shape, and
a comment failure that warns instead of rolling back.
Tests:
- TestEmbeddedPromoteMovesAWispParent promotes a wisp parent with .1/.2
children, a dependency and a comment under a counting on_update hook:
the hook fires twice, the dependency and the children's parent edge
survive, `bd comments` lists the old comment and the promotion reason,
and the next child is .3. At the pre-PR base it fails (the hook fired
0 times).
- The proxied journey pins the two commits, and new subtests pin the
child counter (the child_counters row, next child .3) and the two hook
firings. Against the contributor head each fails: one commit, no
counter row and a failing create, one firing.
Review iteration 2:
- TestEmbeddedPromoteMovesAWispParent gets its row in the embedded cmd
shard manifest (shard 64 of 100, from the generator's incremental
--write). Without it //scripts:go_test_sources_test fails both the
NotStale and the bare-write guard, and the generator's --check fails.
- notifying.go no longer lists the promotion comment as a divergence.
The direct route now writes that comment through st.Commenter(),
which HookFiringStore wraps, so an embedded promote fires on_update
for it (TestEmbeddedPromoteMovesAWispParent counts both firings). The
list counts four, and the empty-commit note becomes the fifth item.
- batchapplier.go no longer says persistence is absent from both patch
bodies: the update body publishes it behind issues.update.persistence,
and only batchApply refuses it (W-IssuePatch.Persistence).
- Three comments still tied promotion to the old engine: the
conformance fixture's PromoteWisp no longer claims to do what
`bd promote` does, the CLI differential's promote scenario names
issueops.Promote, and export_source's wisp-relations note names
issueops.MoveIssuePersistenceInTx.
- The Promote unit test compares the whole update patch with
reflect.DeepEqual. The helper it replaces checked 9 of the patch's 22
members, so a Promote that also set Description passed it.
Review iteration 3:
- A refused persistence move answered 500 `internal` over http and
emitted request_error, though the caller could fix the request. The
role now returns two refusals as ErrValidation, so bd serve answers
400 invalid_argument and the client maps that back to ErrValidation:
an unversioned row asked for ephemeral or no_history (the role wraps
types.ErrUnversionedWispMove, a new sentinel NormalizePersistenceMode
returns for that case alone, with its message unchanged), and a
demotion of a row with retained snapshots. A row that breaks its own
persistence invariants still answers 500.
- RunLifecycleUpdateWispModesRefuseAnUnversionedRow pins the refusal on
every leg (dolt, embedded dolt, the unit of work, served http): both
wisp modes match ErrValidation and leave the row durable, unversioned
and off the wisp plane. Without the wrap the dolt leg fails, and the
served leg fails on "answered 500 internal".
- TestMoveIssuePersistenceInTxRefusesDemotionWithRetainedSnapshots is
the first test of the snapshot refusal, and fails without its wrap.
The unversioned unit test now requires both sentinels. The types tests
pin the sentinel, its unchanged message, and that no row-invariant
error matches it: checking the unversioned class ahead of the
invariant checks fails them.
- CHANGELOG: the promote entry counts five script-visible changes, the
fifth being the lost-race refusal sentence, and says the two refusals
now answer 400 over bd serve and gain a `validation failed: ` prefix
locally.
- NotAWispError's doc comment records that a no-history wisp is refused
too: the gate reads the Ephemeral flag, as bd promote always has, and
`bd update --persistent` is the move for that row.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(list): bd list --no-assignee, --title and --id over http behind per-parameter tokens (S15b)
Over http `bd list --no-assignee`, `--title` and `--id` refused: the list
encoder had no listIssues parameter for ListRequest.NoAssignee,
TitleSearch or IDFilter (B3 #11). All three are maintainer-city cutover
blockers: gc's default on_boot hook runs
`bd list --no-assignee --status=in_progress ...` on every agent boot, the
PR-intake formula lists by `--title "$SUBJECT"`, and the pr-review skill
by `--id <ids>`.
The library entry is unchanged: issueops.Reader.List, whose bodies
already apply all three through workapi.BuildListFilter, the same entry
the local route reads through.
- Server: GET /v0/beads/issues decodes `no_assignee`, `title` and `id`
into those ListRequest members (`id` handed over as written; the role
splits, trims and de-duplicates, as countIssues already does). Each is
behind its own new behavior token, issues.list.noAssignee,
issues.list.title and issues.list.id (additive, wire_revision stays 2):
each is a separate caller's dependency, and a refusal names exactly the
one it needed. The spec parameters cite their tokens; apigen and the
wire-shape golden are regenerated.
- Client: the encoder maps the three members to their parameters, and
httpReader.List refuses a request carrying one BEFORE dialing, with
ErrUnsupported{Capability: <token>}, unless the handshake advertises
that token (refuseUnservedSearch generalised to one table,
tokenedListFilters, with bd search's `q`). Never a round trip an older
server answers unknown_parameter, never a wider listing.
- ErrHTTPUnsupported's text names the capability when it has one, as the
portable sentinel does, so `bd list` says which token the server lacks.
- The three E-ListRequest ledger rows retire; the ledger is re-rendered.
The id scope unparks the served Reader contract: the sixteen cases parked
on E-ListRequest.IDFilter now run against the in-process server. Twelve
pass as written; four still park, each now on the member it actually
needs (Offset twice, PinnedFlag, ExcludeTypes). The served refusal sweep
asserts SpecPrefix where it asserted IDFilter.
Tests (failing first): handler test that each parameter reaches the
storage filter; client tests that each member rides its parameter behind
its token and refuses pre-dial, zero dials, naming its token, against a
server lacking it; round-trip and vocabulary gates; capability lists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend/http): the four maintainer-city list shapes end to end; corpus marks relabelled SRV-1 (S15b)
TestE2E_ListScopeFiltersOverHTTP runs the corpus shapes gc-list-on-boot,
gc-list-on-boot-workflow, mc-list-title and mc-list-id through the real
bd against the in-process server (which advertises the three new tokens)
and requires each to answer an embedded workspace's rows and exactly the
rows it names: --no-assignee leaves out an assigned in-progress row on
the same lane, --title is case-insensitive, --id lists a closed id under
--all. Against the MC production server's handshake shape each shape
exits non-zero naming its token and never dials listIssues.
The corpus suite masks the served side to reference_server.json, the
deployed bd 1.3.0 surface, which advertises none of the tokens, so the
four shapes now get the named pre-dial refusal there. Their marks move
from S6c+S15b to SRV-1 with that reason, like mc-search. With a scratch
profile that adds the three tokens and parameters (not committed) exactly
these four shapes report "now passes; remove the pending mark" and
nothing else changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(list): adopt bd-enterprise's listIssues `id` contract: repeatable, issues.list.ids (S15b)
bd-enterprise already publishes listIssues `id` (E9-S2): a REPEATABLE
parameter, one id per value, behind `issues.list.ids`, with its client
sending IDFilter split into one value per member. The first cut of S15b
took ONE comma-separated `id` behind `issues.list.id`, so the same
parameter name had two incompatible meanings: an OSS client's "a,b" is a
400 on an enterprise server, and the enterprise rebase onto main would
collide. OSS now publishes enterprise's contract unchanged:
- Server: listIDFilter (ported verbatim) decodes the repeated `id` into
ListRequest.IDFilter's comma set; more than 200 values, an empty value,
a comma, leading or trailing whitespace, a control character or an
over-long id is a 400 `invalid_argument` on `id`. The spec parameter is
enterprise's (array, maxItems 200); apigen and the wireshape golden are
regenerated.
- Token: CapListIDs = "issues.list.ids", the enterprise spelling and name
on both sides.
- Client: the encoder splits the set the way the role does (splitIDSet)
and sends one `id` per member; the pre-dial gate fires only when the set
names an id.
- Tests: list_ids_test.go is enterprise's id cases (the exact set reaches
storage, the 200 bound is served, every refusal beside its control, the
spec bound matches the constant); the handler, client, round-trip and
e2e cases move to the repeated shape and the new token.
`no_assignee` and `title` are unchanged. Served tier, http e2e (including
TestE2E_ListScopeFiltersOverHTTP) and corpus_served_test pass; with a
scratch reference profile advertising the three tokens exactly the four
S15b shapes report "now passes".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* test(bazel): shard http_served_test and corpus_served_test (embedded lane critical path)
Both served targets ran as one shard each (235-597s) and were the embedded
lane's longest action in most executing runs; every other embedded shard
ends by ~90-155s.
- http_served_test runs through go_test_pinned_shard.sh like
httpclient_served_test: the 19 TestE2E_* cases >= 3s are pinned onto 6
shards (pin_shards.py from three lane runs' test.xml plus one local run,
<= ~88 measured seconds each), the ~28 fast tests round-robin in a 7th.
- corpus_served_test: TestServedCorpus becomes TestServedCorpusPart1..4.
Shapes are dealt round robin in corpus order; each part starts its own
server and seeds its own pair of workspaces. The shapes are independent:
every check is served-vs-embedded parity after the same commands, each
write owns its target ids, and order preservation keeps each part's reads
ahead of its writes. TestCorpusPartsDealEveryShapeOnce checks the deal
(every shape once, in order, no empty part); the manifest pins part k to
shard k, with a 5th round-robin shard for the engine-free tests, and
scripts TestCorpusPartsArePinnedOnePerShard ties corpusParts, the
manifest and shard_count together. BEADS_CORPUS_REPORT now accumulates
every part the process ran.
- pinnedShardTargets and the retired-lane args pins list both targets;
go_test_sources_test gets the two packages' manifests as data.
Embedded goes from 172 to 182 test actions; the dolt-race/dolt-int union
budgets do not include the embedded tag and are unchanged.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(corpus): guard part wiring; seed metadata on e2e-t-ifa (review of #7537)
- testServedCorpus fails (before the engine gate, so in every lane) unless
the test's name is TestServedCorpusPart<part>: a TestServedCorpusPart3
calling testServedCorpus(t, 2) would run part 2 twice and silently drop
part 3's shapes. TestCorpusPartNameMustMatchItsPart covers the check and
that servedCorpusParts lists Part1..N in order. Mutation (Part3 -> 2)
fails //backend/http/corpus:corpus_test with "TestServedCorpusPart3 runs
corpus part 2; only TestServedCorpusPart2 may".
- e2e-t-ifa is seeded with metadata seeded=keep. The parts seed separately,
so the two refused (exit 13) conditional updates no longer always follow
gc-update-if-assignment's k=v; their verify show again holds that a
refusal keeps existing metadata. Mutation (served verify output's
seeded=keep rewritten) fails both stale shapes at
$[0].metadata.seeded.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): dolt-int gates the server-storage and cmd-dolt tiers in mode remote (item 5 A2)
In mode remote, folds bazel-server-storage (--config=doltserver-integration)
and bazel-cmd-dolt (--config=doltserver-cmd) into one bazel-dolt-int job
(--config=dolt-int), following the dolt-race pattern from #7514. The
members have different gating categories (server-storage plain-gated,
cmd-dolt flag-gated/advisory), so the union carries continue-on-error: true
and a bespoke --label-scoped Shard balance step. All other modes keep the
two lanes running unchanged. Action keys are byte-identical between the
member configs and the union (17 + 46 = 63 TestRunner actions), so cached
results carry over either direction and a revert is a safe rollback.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(bazel): dolt-int per-tier results, integration gating, key-parity wording (review)
Coordinator review of #7535 found three must-fixes: integration:"off" was
ignored in remote mode (the union's members already honor it); job-level
continue-on-error made a server-storage-only failure read success on
push/nightly/dispatch, where main stays red; and the PR's key-parity claim
overstated byte-identical actionKeys when only the remote action digest
(not the local actionKey) is unaffected by moving --test_env/--test_arg
onto the targets' own env/args.
Fixes:
- bazel-dolt-int's if now adds `&& inputs.integration != 'off'`, matching
the members (#7491's review); bazelLaneRunModes and
TestBazelDoltIntArmsExactlyOnePerMode cover the "off" case.
- Job-level continue-on-error removed; only the `bazel test` step carries
it, and a new always() "Classify tier results" step
(tools/bazel/classify_tier_results.py, with its own unit tests and a Go
wrapper) computes server_storage_result/cmd_dolt_result from the BEP and
decides job.status per-tier. Confirmed with bazel-gate.sh/ci-gate.sh on
synthetic empty-output inputs that a dead job still fails the gate.
- Corrected the local-actionKey-vs-remote-digest wording in .bazelrc,
bazel.yml's job comment and CI_REQUIRED_CHECK_TOPOLOGY.md.
- Should-fix: test step 23->25 / job 58 minutes with reasoning; --label
coverage added to shard_budget_test.py; stale lane comment fixed in
tests/regression/BUILD.bazel:46; TestBazelDoltIntSoleRunIsInTheUnion's
docstring corrected (members bake sole-run's line in directly, never via
--config=sole-run).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(bazel): fail-closed classify, per-tier check_testcases, pinned argv (review)
Final review round for PR #7535 (maintainer-city-c3, bee-ghosttrack,
julianknutsen):
- classify_tier_results.py now fails every tier shut (exit 1) on a
non-PASSED label outside every --tier list, so a newly tagged target
added without updating the step's --tier args cannot silently read as
success (must-fix 1). Its --tier/--check label sets are policy-tied to
the BUILD files' own tag sets by a new
TestBazelDoltIntTierLabelsMatchTheTags.
- A missing or non-integer --rc (a timed-out or cancelled test step)
takes the same fail-everything-shut branch instead of crashing argparse
with no outputs written (bee-ghosttrack's should-fix 2).
- check_testcases.py gained a repeatable --label flag, and bazel.yml's
shared "Every target and shard ran tests" step is split into check-ss
and check-cd, each continue-on-error and folded into its own tier via
classify's new --check NAME=OUTCOME, so a zero-testcase cmd-dolt shard
no longer reddens the job on push/nightly (must-fix 2).
- classify's run: argv is now pinned by exact equality
(bazelDoltIntClassifyRun), and every flag except --tier/--check is
--StoreOnce; a repeated --tier/--check name or an unrecognized flag is
now a hard parser error (must-fix 3).
- "Upload test logs" now also fires on steps.test.outcome == 'failure',
not just failure() (must-fix 4).
- shard_budget.py --label now fails closed (::error, exit 1) on a label
with no executed shard in the BEP at all, instead of silently reporting
"no sharded test target executed two or more shards" (should-fix 3,
carried across both review rounds).
- Updated engdocs/TESTING.md, CI_REQUIRED_CHECK_TOPOLOGY.md, .bazelrc and
scripts/bazel_dolt_int_test.go/ci_workflow_test.go comments for the
nits: stale "Advisory (continue-on-error: true)" wording, the
bazelUnionHasFlagGatedMember comment's stale claim about bazel-dolt-int,
"byte-identical" without specifying remote action digest vs. local
actionKey, and "is unset" vs. ci-gate.sh's actual "was skipped" branch
for an empty union output.
Verified: python3 -I on all four tools/bazel/*_test.py (classify 29,
check_testcases 7, shard_budget 19) green; GOTOOLCHAIN=go1.26.7 go test
./scripts/... green; bazel --nohome_rc test //scripts:scripts_test
--config=ci green.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(bazel): shard_budget --label fail-closed only on a truly unknown label
The previous commit's fail-closed --label check compared against
read_shard_durations, which only records executed (non-cached) shards, so
a target whose every shard was a cache hit this run had zero entries and
was wrongly treated the same as a --label typo. This was not caught by
the new tests (none exercised an all-cached target) and broke this PR's
own dolt-int CI run: bazel-dolt-int's Shard balance step went red on
//internal/storage/dolt:dolt_server_full_test with "no executed shard for
it", even though that target was correctly, fully cache-hit.
Fix: a new read_tested_labels() reads every label with any testResult
event (cached or executed), and --label's fail-closed check now tests
against that set instead of read_shard_durations. A fully-cached target
still legitimately reports "nothing to judge" through evaluate(); only a
label absent from the BEP altogether is now an error. Added the missing
test row (every shard cached) that would have caught this before push.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(bazel): pin bazel-dolt-int's Upload test logs if-condition
A full 42-mutation re-run for PR #7535's second review round found that
nothing pinned this job's own "Upload test logs" if-condition (must-fix 4):
the other lanes' upload-logs steps are each pinned, but bazel-dolt-int's
(unlike dolt-race, a brand-new job) had no equivalent assertion, so a future
accidental revert to the old failure()-only condition would go uncaught.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* ci(bazel): dolt-race gates the dolt-server and proxied tiers in mode remote (item 5 A1b)
In mode remote, bazel-dolt-race (`bazel test //... --config=dolt-race`, the
union of --config=doltserver and --config=doltserver-proxied) runs both tiers
in place of bazel-doltserver and bazel-proxied, and is no longer advisory:
its job.status is both the bazel-doltserver and the bazel-proxied
workflow_call output (union result first, member's otherwise). In the fork
modes, cache and local, the two member jobs run exactly as before: there one
client does both tiers' work without in-flight deduplication, so a union
would cost the sum of the tiers rather than the max. Exactly one arm runs in
any mode, so gate ids, pr.yml, ci-gate.sh and bazel-gate.sh are unchanged.
- bazel.yml: dolt-race if: mode == 'remote' (every event that reaches it);
no continue-on-error; result output and always() recorder; test step
timeout 25 -> 20 (job 55 >= step sum 46 + 5, < 60). Members' if: their old
rule && mode != 'remote'.
- scripts/bazel_dolt_race_test.go (was bazel_dolt_race_shadow_test.go):
union-of-members config, sole-run lines in the union, gating shape, step
and job timeouts, exactly one arm per mode x event with the call outputs
evaluated as GitHub does, and the union's 62 test actions within
--config=remote-exec's --jobs=64.
- Gate simulations evaluate the workflow_call output expressions, and a
gated lane's reporter is the lane or its union lane.
- aquery: all 62 TestRunner actions under --config=dolt-race are
byte-identical (key, argv, env, outputs) to --config=doltserver (with and
without sole-run) and --config=doltserver-proxied on origin/main.
- Docs: CI_REQUIRED_CHECK_TOPOLOGY.md "dolt-race Union Lane", TESTING.md.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): dolt-race test step 23 min so Bazel logs a 1200 s TIMEOUT first
The proxied tier caps each test at 1200 s; a 20-minute step let GitHub
kill a hung shard before Bazel wrote its TIMEOUT test.log and goroutine
dump. Step 23, job 56 (step sum + 5, under the merge queue's 60).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): say the dolt-race job timeout bounds the job, not the run
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(backend/http/corpus): served command corpus against the reference server profile
Add the S23 suite: every distinct bd command shape gc and its packs and
formulas issue against a work store (124 shapes in testdata/corpus.yaml),
run by the real bd binary against an in-process bd serve and compared
with the same command on an embedded workspace.
The server is bound in non-loopback mode with bearer auth. A reference
proxy masks it to a deployed bd 1.3.0 server's wire surface
(testdata/reference_server.json): exactly that server's capabilities and
handshake members (no wire_revision), a 404 for operations it does not
publish, and a 400 unknown_parameter for query parameters and request
members it does not declare. Every bd run sets BEADS_ACTOR and
CLAUDE_SESSION_ID.
A shape passes when the served run exits like the embedded run, carries
no refusal, and matches its output (json/ids/count/text) and its verify
reads. Known gaps are marked `pending` with the slice that fixes them.
A pending shape still runs, and it fails once it passes, so removing the
mark is how a slice proves itself. Permanent refusals are listed in
testdata/allowlist.yaml with reasons.
A limited listing that cuts through a tie set (same priority, created_at in
one second) lands on different rows on two workspaces seeded seconds apart;
such a shape names its unlimited form in `prefix_of`, and each side's
limited rows must be an ordered prefix of that side's own unlimited listing.
//backend/http/corpus:corpus_test takes //cmd/bd:bd_for_tests (size large,
timeout long), so under bazel the suite runs instead of skipping on a
missing BEADS_TEST_BD_BINARY.
Stacked on S6b/c/d, whose marks this file no longer carries: besides the
S6b/S6c/S6d marks, seven list shapes once marked S6c+S15 (their --limit 0
list walks the keyset cursor without S15) and the S6c+S16 last-step close
(an ordinary epic root never auto-closes) already pass on it.
On S6b/c/d (bazel, BEADS_TEST_EMBEDDED_DOLT=1): 97 pass, 25 pending,
3 allowlisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend/http/corpus): hand the corpus server the LeaseReclaimer role
main gained the LeaseReclaimer role (issues.reclaim) after S23 was written,
and httpapi.Config needs it when built from roles rather than a Provider, so on the restacked
S6bcd TestServedCorpus could not bind its in-process server ("no database
source"). The harness now passes s.LeaseReclaimer() with the rest, as
backend/http's e2e harness does. The reference proxy still masks the
issues.reclaim token, so gc-reclaim stays pending.
On the restacked S6bcd (bazel, BEADS_TEST_EMBEDDED_DOLT=1): 97 pass,
25 pending, 3 allowed, unchanged from before the restack.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend/http/corpus): run the corpus in CI, hold allowlisted shapes
Review fixes for #7483 (review attempt 1): both majors, and four of the
seven minors and nits.
No CI lane ran TestServedCorpus. corpus_test sets neither
BEADS_TEST_EMBEDDED_DOLT nor BEADS_HTTP_TEST_REQUIRED, so the suite
skipped everywhere. corpus_served_test, an embedded-tagged sh_test over
go_test_variant.sh like http_served_test, runs it with both set and with
Bazel's prebuilt bd, and pr_risk_bazel_coverage_test pins its args and
env. Every other file in the package builds only under cgo, so a new
cgo-free test fails a BEADS_HTTP_TEST_REQUIRED=1 run that would otherwise
pass having run nothing. README.md and engdocs/TESTING.md say which lane
runs the suite.
The allowlist branch returned before the embedded exit check, so an
allowlisted shape was never held to what it says on the embedded
backend. The embedded run is now checked against the shape's expect_exit
and expect_stderr before the allowlist branch, and an embedded mismatch
fails as a corpus bug whatever the shape's pending mark or allowlist
entry. TestCorpusFileIsWellFormed requires an allowlisted shape to state
expect_exit and to carry nothing the allowlist would skip (compare: exit,
no verify). The three allowlisted shapes now pin their embedded refusals,
and the bd sql reasons say the command needs a sql-server workspace
instead of calling it local-only.
Minors and nits taken:
- two stale-guard shapes (--if-assignee nobody, --if-status open) expect
exit 13 on both sides; each kills a client that drops that guard;
- defer_until and due_at are compared as given instead of scrubbed to
<ts>, which kills a client that shifts --defer;
- gc-reclaim's pending mark names SRV-1 alone: the reference profile
does not advertise issues.reclaim, so the client refuses at its
capability preflight;
- refusalMarkers matches "does not advertise capability" unquoted, which
also catches the JSON-escaped preflight error.
Declined:
- a failure on empty-vs-empty comparisons, which needs an allow_empty
opt-in. Review attempt 2 seeded rows for two of the three ready shapes
that compared two empty lists (below); gc-ready-graph-anchor still
does;
- the context route's query check in the reference proxy: the server
already answers an unknown query parameter there with a 400
unknown_parameter, which the proxy passes through, so the served run
still fails; only the proxy's own refusal note is missing;
- a shared server constructor for the two e2e harnesses, which the review
marks optional.
Review attempt 2: four of its six minors and nits.
- gc-ready-ephemeral-assignee-unlimited and gc-ready-assigned-tier
compared two empty lists, so a client that sent the wrong assignee or
dropped --include-ephemeral passed both. Two seed rows assigned to the
worker, an open task (P2) and an open wisp (P1), give them
[e2e-wisp-wr e2e-wr] and [e2e-wisp-wr]. The priorities differ, so
--limit=1 cuts no tie. A client that rewrites the assignee, or drops
include_ephemeral, now fails both shapes; without the rows it passed
them.
- templatePattern looped forever on a profile path with an unclosed "{",
growing its pattern without bound. It now returns an error, which
loadReferenceProfile reports with the operation and path, and
TestCorpusFileIsWellFormed loads the profile, so corpus_test catches a
bad edit without the embedded engine.
- TestCorpusFileIsWellFormed compiles every expect_stderr and every
allowlist refusal, and runShape compiles expect_stderr once and fails
the shape as a corpus bug instead of panicking on a bad pattern.
- README.md documents the stdin, setup, ordered and ignore_fields
fields.
Not in this commit:
- the PR description (shape counts, allowlist reasons, gc-reclaim's
SRV-1 mark, the Bazel run line) is brought up to date when this commit
is pushed;
- hoisting runBD, minimalBDEnv, buildBD and the skip gate into
internal/testutil, or cross-reference comments in their three copies,
which the review marks optional and which reaches outside this
package.
The full corpus gives 127 shapes: 99 pass, 25 pending, 3 allowed, with
no shape changing status from the attempt 1 fixup, on this tree and
merged with main at 0a163ca285.
Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(build): use native Darwin linker (wy-6fric6)
Keep pinned LLVM Clang and Linux toolchain inputs; pair Darwin SDKs with the native Apple linker to support macOS 27 TAPI targets.
Agent-Signature: codex-unknown-model-unknown-reasoning on behalf of Steve Yegge
* fix(build): canonicalize LLVM attributes (wy-6fric6)
Apply bazel mod tidy ordering; linker/compiler settings are unchanged.
Agent-Signature: codex-unknown-model-unknown-reasoning on behalf of Steve Yegge
* ci: F5 S2 Variant A nogo ownership for the integration configuration group
No full Bazel lane validates the integration / doltserver-integration /
doltserver-cmd configurations anymore (all three now pass
--norun_validations). Instead bazel-integration gains a narrow "Nogo:
integration library files" step that keeps full nogo (vet + golangci-lint)
on the configuration's one non-test library package,
//internal/testutil/integration, via
`bazel build --config=integration --@rules_go//go/config:race --keep_going
--output_groups=nogo_fix -- //internal/testutil/integration:integration`.
This accepts a scoped coverage loss (f5-spec.md §3/§5 S2, Variant A): the 56
integration-tagged _test.go files (listed in
tools/nogo/unvalidated_integration_tests.txt, derived from source by the new
T4 test) no longer get a vet pass in any lane, since golangci-lint already
skips all _test.go files repo-wide (.golangci.yml's run.tests: false) and no
lane builds those test binaries with validations on. Verified directly with
real `bazel build` runs: a planted vet finding in the library package still
fails the new step; the same finding in an integration-tagged _test.go file
no longer fails anything; a planted finding in a plain race-configuration
library still fails bazel-test; and GoCompilePkg action keys for the
integration configuration are identical with and without
--norun_validations (it is a build-request option, not a configuration
flag, so no farm cache invalidation).
scripts/nogo_lint_policy_test.go: the nogoConfigurations table gains a
"integ" row with an ownerIsNogoOnlyStep flag and a dedicated
checkNogoOnlyStepRow, generalizing T1/T2/T5/T6 to cover an owner that is a
narrow build step rather than a full lane; adds T4
(TestNogoIntegrationStepCoversItsConfiguration), which derives the step's
expected target set from source via go/build's own tag matching instead of
a hardcoded list.
Also fixes four should-fix items from julianknutsen's review of #7482:
1. expandBazelrcConfig now follows `common:` lines and --config= tokens
anywhere on a line, not just a first-position `build:`/`test:` one.
2. TestNogoRaceOwnerBuildsEverything now expands every config the owner job
can reach (including shell-variable-gated ones like sole-run), not just
the statically-named "ci".
3. The package-gate check now compares full key-flag fingerprints instead
of substring-matching --@rules_go//go/config:race / --norun_validations.
4. tools/bazel/nogo_ownership.py now fails loudly (exit 2) when both the
owner's and non-owners' action-key sets are empty, instead of reporting
a vacuous pass.
Each fix has new mutation-test coverage in TestNogoPolicyRejectsMutations
(should-fixes 1-3) or nogo_ownership_test.py (should-fix 4).
engdocs/LINTING.md and engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md updated to
remove the stale "integration still validates in all three lanes" claim and
document the Variant A trade-off.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci): make T4's source scan work under Bazel, not just plain go test
scripts:scripts_test only declares //:repo_other_files as data (every
tracked file but Go and Markdown source, by design: a Go-only change
should not re-run the CI/workflow policy tests). TestNogoIntegrationStep
CoversItsConfiguration's source scan needs every non-test .go file, so
under `bazel test //scripts:scripts_test` its runfiles tree had none and
the scan always came back empty.
Fixes:
- scripts/BUILD.bazel: add //:repo_go_srcs to scripts_test's data, with a
comment explaining why (this is the one test in the target that needs it).
- integrationOnlyLibraryPackages: use bazelPolicyRoot(t) + repoFiles(t, ...)
(the existing Bazel-safe, runfiles-aware file listing other policy tests
in this package already use) instead of sourceRepoRoot(t) +
filepath.WalkDir, which only sees what //scripts's own go_test target
declares.
Verified with real `bazel test --config=integration --@rules_go//go/config:race`
and `--config=ci --@rules_go//go/config:race` runs of //scripts:scripts_test
(both pass); CI caught the original gap (PR #7486's first push failed
Bazel / integration and Bazel / test with exactly this).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(bazel): address independent review + bee-ghosttrack findings on F5 S2 Variant A
Independent review of #7486, must-fixes 1-7: pipefail on the nogo-only
step's tee pipeline; exact source-scan equality check for
tools/nogo/unvalidated_integration_tests.txt; expandBazelrcConfig
follows common:-lines and non-first-position --config= tokens in both
the Go policy test and nogo_ownership.py; mirrored
nogo_ownership.py should-fix guarding against a non-owner action-key
query silently matching nothing.
Cost fix: split T4/T6's whole-repo .go source scan into its own
go_test target (//scripts:nogo_integration_scan_test) so a Go-only
change no longer re-runs all of scripts_test; extracted the shared
bazelInvocations and ciWorkflow helpers into helper-only files so
both targets can depend on them without violating the
one-target-per-test-file partition rule.
bee-ghosttrack review: checkNogoOnlyStepRow's own fingerprint now
excludes test:-sourced .bazelrc lines pulled in via --config=X
(buildOrCommonLines), since the nogo-only step is a `bazel build`
invocation that never reads a test: line; added mutation s2i
reproducing the gap this closes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(nogo): pin integration nogo-only step's target, fingerprint its lane, add behavioral test
Addresses the remaining should-fixes from the independent review of #7486:
1. TestNogoIntegrationStepScriptFailsWithoutMaskingBazelsExitCode
(scripts/nogo_integration_step_script_test.go) extracts the real
"Nogo: integration library files" step script from bazel.yml and runs it
under plain `bash -e` (GitHub's actual run: semantics, no pipefail added)
against a stub bazel, closing the gap a text-only pin can't: it catches
rc=0 before `exit "$rc"`, `|| :`/`|| true` on the tee pipeline, or a
missing/negated `set -o pipefail`, regardless of how the mutation is
spelled.
2. The nogo-only step's target set is now pinned by exact go_library
label, not just package: nogo_integration_scan_test.go derives the
label(s) from source + BUILD.bazel and nogo_lint_policy_test.go pins
them literally (its own go_test target has no //:repo_go_srcs). Both
reject a `-//` exclusion pattern outright.
3. checkNonOwnerCommandLineAddsNoKeyFlag is now also applied to the
integ row's owner's own full lane: under Variant A that lane validates
nothing, so it is effectively a non-owner for this check's purpose, and
must not override a key-affecting flag on its command line either.
4. Latent items: TestNoUnconditionalValidationOff now also scans
.github/actions/setup-bazel/write-bazelrc.sh for run_validations (every
line it emits lacks a :config suffix, so any occurrence would turn
validation off everywhere with no owner lane to catch it).
tools/bazel/nogo_ownership.py's docstring is corrected: it had said S2
was simply "out of scope," which is now stale since S2 has its own
validating lane (the nogo-only step, checked statically); the script's
dynamic aquery-based cross-check remains S1-only because S2's owner has
no non-owner test lane building the same configuration to compare
actions against.
Skipped (not cheap / not reachable):
- bazel-server-storage's `if:` not modeling an "integration" input: no such
input exists to model; the gate is RBE-enabled-only by design, and
resolving this requires understanding pr.yml's broader gating semantics,
not a textual fix.
- defaults.run.shell parsing: bazel.yml has no `defaults:` block today
(confirmed by grep), so there is nothing to parse; the gap is latent only
for a future change, not a live bug.
- race-off scan's future-wrong-fix edge case: the review itself
characterizes this as not reachable with today's file set.
New mutation cases s2j/s2k/s2l in TestNogoPolicyRejectsMutations cover
items 2 and 3. All mutation-verifications performed by hand-editing the
real files, confirming FAIL, and reverting via Edit (never git
stash/checkout).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* test(nogo): reject F5 S1 ownership mutations the policy tests missed
Follow-up to #7479's independent review.
- nogoKeyFlags parses whole tokens instead of a prefix regex, so
--@rules_go//go/config:race=false on a non-owner no longer fingerprints
as the owner's race build (1f).
- The owner's run_validations check expands every --config its bazel
commands select (including BAZEL_SOLE_RUN/BAZEL_FRESH) recursively, so
e.g. `test:sole-run --config=doltserver` is caught (1e).
- T3 scans every argument of the owner's `bazel test`, including
backslash-continued lines, for negative target patterns (1g).
- T1 pairs each non-owner job with the --config its own bazel command
selects instead of by list index (2).
- TestNogoPolicyRejectsMutations feeds T1/T3/T5/T6 each mutation 1a-1g
and 2 and requires a rejection.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): nogo_ownership.py compares nogo actions by action key
Owner and non-owner nogo coverage was compared by target label, which
treats one label compiled in two configurations as covered. Compare
RunNogo and ValidateNogo actions by Bazel action key instead. Non-owner
universes drop manual-tagged tests (bazel test //... never builds them)
and add //cmd/bd:bd_for_tests, the package gates' target. The
fingerprint mirrors nogoKeyFlags' whole-token parsing.
nogo_ownership_test.py covers this with a fake bazel.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(ci): correct nogo lane-sharing and one-required-lane claims
- CI_REQUIRED_CHECK_TOPOLOGY.md: only the nogoConfigurations rows
(race, pure, js/wasm) validate in exactly one required lane; the
integration configuration still validates in its three required lanes
until F5 S2.
- .bazelrc: --norun_validations lanes share compile, link and nogo
actions with `test`, not test PASS results (each lane's test actions
have their own env and args). Comment only.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): remove host-go dep from compact GC test; drop frozen shard blocks
Replace the ungated `go build` in compact_gc_target_test.go's dolt-stand-in
fixture with a Bazel-built go_binary (cmd/bd:compact_gc_fixture) wired via
rlocationpath env + data, mirroring the existing preflight_go_fixture
pattern. Falls back to `go build` only when not running under Bazel
(bazeltest.IsBazel()). Also gate test_repo_beads_guard_test.go's `go env
GOCACHE`/`GOMODCACHE` probes on !bazeltest.IsBazel(), since they previously
ran unconditionally in every cmd/bd TestMain.
Separately, delete the legacy 20-shard embedded-cmd and 15-shard
proxied-cmd "frozen" manifest blocks in .github/scripts/*-test-shards.txt:
their only consumers were pr-risk.yml fork/push jobs that have since
migrated to bazel.yml. Update gen_embedded_cmd_shard_manifest.py and
gen_proxied_shard_manifest.py to drop the frozen-block rendering/guard
logic and default to the live Bazel-only shard counts (100 and 34),
and refresh stale comments/docs (cmd/bd/BUILD.bazel,
scripts/shard_manifest_test.go, engdocs/TESTING.md,
engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md) that still described the deleted
blocks. Verified no other BUILD/.github/scripts references read them.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* build(bazel): auto-sync BUILD files
Applied from the bazel-sync-patch artifact of https://github.com/gastownhall/beads/actions/runs/38069936930
(`make bazel-sync`: gazelle, tools/bazel/go_srcs.py, bazel mod tidy).
Only BUILD.bazel, MODULE.bazel and MODULE.bazel.lock are ever pushed; see
scripts/bazel-autofix-push.sh.
* fix(bazel): gate remaining host-go calls; fix shard-manifest --weights footgun
Address PR #7478 review findings (bee-ghosttrack):
- scripts/ci/lib/test-env.sh: skip the GOCACHE/GOMODCACHE `go env` probes
when TEST_SRCDIR is set, so scripts/test.sh's beads_test_env_enter never
shells out to a bare `go` when reached from a Bazel-run go_test (e.g.
//scripts:shell_scripts_test's TestTestScriptPrebuiltTestBinaryContract),
where a farm masks host go/dolt to exit 127. Nothing on that path needs a
cache directory.
- scripts/ci/fmt-check.sh: describe_gofmt() no longer calls a PATH `go`
under Bazel. It now resolves BEADS_TEST_GO (the hermetic SDK go already
wired into scripts/prlintmake:prlintmake_test's env) via TEST_SRCDIR, and
skips the version-reporting arm entirely when that isn't set (e.g.
scripts/repochecks:fmt_test), rather than ever touching a possibly-masked
PATH `go`.
- Verified with a PATH stub (go/dolt scripts that log and exit 127) via
`bazel --nohome_rc test --config=prcore //scripts/... //cmd/bd:bd_test
--test_env=PATH=<stubdir>:/usr/bin:/bin:/usr/local/bin`: 26/26 targets
pass, zero stub invocations logged.
- gen_proxied_shard_manifest.py / gen_embedded_cmd_shard_manifest.py:
default --weights to duration now that the manifests' only remaining
blocks are duration-packed (the legacy inits-packed blocks were deleted
alongside the PR Risk fork/push jobs that read them). Previously the bare
`--write` default (inits) silently clobbered the live block's duration
header and repacked with the wrong cost model; --check couldn't see it.
Added TestProxiedShardManifestBareWriteIsIdempotent and
TestEmbeddedCmdShardManifestBareWriteIsIdempotent to pin a bare --write
as a no-op against the committed files.
- cmd/bd/compact_gc_target_test.go: resolve the non-Bazel fallback fixture
path from this file's own directory (runtime.Caller) instead of the test
binary's working directory.
- Refresh stale comments in .github/workflows/bazel.yml,
scripts/shard_manifest_test.go, scripts/pr_risk_bazel_coverage_test.go,
and scripts/embedded_shard_count_test.go that still described the deleted
legacy 20/15-shard blocks and their retired fork/push jobs in the present
tense.
- Confirmed cmd/bd/BUILD.bazel's compact_gc_fixture go_binary (implicit
pure/race defaults) still passes TestRunCompactDoltTargetsOnlyAuthorizedActiveDatabase
under `bazel test //cmd/bd:bd_test`.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* feat(http): serve list/show counts/dep tree/ping, close+reopen under a session, one-lookup not-found (S6b/S6c/S6d)
S6c. The external-dependency decorator rebuilt its role views from the
legacy DoltStorage seam (storereader over itself, IsBlocked,
GetDependencyTree, ClaimReadyIssue), which a remote store only partly
serves: `bd list`/`bd children` refused on the SearchIssuesWithCounts stub,
`bd show --json` printed zero counts, the default `bd dep tree` refused,
`bd ready --claim` and `bd close` of an externally blocked issue reached
unsupported paths. For a storage.RemoteBackendStore each view now passes the
inner role through and lays the policy over it in role terms
(externaldeps/remote_roles.go): ready reads and the ready claim exclude the
workspace-wide blocked set over a widened window; per-issue checks (claim,
close, batch close, list annotations, tree leaves) read only the named
issues' edges through EdgeReader instead of every edge in the workspace. A
server advertising policy.external_dependencies (MC's does) gets a plain
passthrough. `bd ping` uses a new storage.Pinger, which the http store
answers with its authenticated context read.
S6d. A store reporting storage.CallerAttributionLimitedStore (http) cannot
carry a Provenance label or a patch's closed_by_session. The library still
refuses both; the CLI omits them where nothing is lost: `bd reopen`'s fixed
"bd: reopen <id>" label (the server labels the same entry), and the
closed_by_session of `bd update -s closed` (attribution only, usually the
ambient CLAUDE_SESSION_ID; an explicit --session prints a notice; `bd close`
still records it). See cmd/bd/remote_backend.go.
S6b. utils.ExactIDLookupStore: the resolver stops at exact lookups for a
store with no substring search, so a missing prefixed id is a not-found
(beadserrors.ErrNotFound, "no issue found matching") after one getIssue.
The general resolver no longer repeats an identical normalized probe. The
http SearchIssueIDs answers D11's partial-id refusal, which now unwraps to
ErrNotFound. Contributor auto-routing for a remote workspace reads local
config only, so the not-found fallback pays no settings round trip.
`bd update <absent> --claim` (gc's hook claim) answers a gc-classifiable
not-found in at most two requests.
Served e2e (backend/http/e2e_remote_roles_test.go): every gc list shape and
`bd children` against embedded, `show --json` count parity, default dep
tree parity, external blocking still enforced, close/reopen under
CLAUDE_SESSION_ID, missing-id request counts, absent-id claim against the
current server and the MC handshake mask, policy passthrough under the MC
mask, ping.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(externaldeps): role-level remote reader and claimer cases
bd ready and bd update --claim reach the policy through the legacy seam and
the lifecycle guard, so the remote Reader.Ready exclusion and the remote
Claimer guard (what bd serve and library callers reach) are pinned at the
role level with a fake remote store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(http): bd serve advertises policy.external_dependencies; clients pass through
bd serve composes every ready, claim, claim-next, close, blocking and tree
role through the external-dependency policy, but never said so. Every
client therefore ran the policy a second time, with the CLIENT machine's
external-project config, and claim-next became a non-atomic read-then-claim
loop on the client.
The server now advertises the token exactly when the roles it serves were
composed through the policy: httpapi.Config.ExternalDependencyPolicy, which
bd serve derives from its actual chain (externaldeps.Applied for the store
arm, externaldeps.AppliedToProvider for the provider arm). A server handed
raw roles still withholds it, so the token stays truthful.
Against a server that advertises it, every remote role view hands the
request to the server's own role untouched: no client validation, no edge
reads, claim-next is the server's one atomic call, and the ready count is
the server's countReadyWork (new remoteReadyCounter). The client-side
policy remains only for servers that do not advertise the token.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(create): default created_by to the request's actor in the create role
created_by was stamped in two front doors and never in the library: the
CLI (creationActorStamp, with a remote-workspace special case) and the
three httpapi create handlers. A library caller of Lifecycle.Create or
BatchCreator with an empty CreatedBy stored "" locally and the actor over
http.
PreparePublicCreateRequest, which every create shape prepares through
(Lifecycle.Create, BatchCreator items, batch-apply create items), now
defaults an empty CreatedBy to request.Actor; an explicit value is kept.
The handlers no longer stamp, `bd create` and the state event create pass
only the actor, and creationActorStamp/isRemoteBackendWorkspace are gone.
The CLI sites that still create through the raw CreateIssue seam (swarm,
todo, gate, the create form) keep stamping currentActor(): that seam is
shared with import, where defaulting would re-attribute imported rows, and
the http store refuses it anyway, so the remote special case was never
reachable there.
Conformance: the lifecycle-create, batch-creator and batch-apply contracts
now pin created_by == actor for an item that names none, on every leg.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(httpclient): GetIssue answers a miss with storage.ErrNotFound, like the local stores
The http store's raw GetIssue answered a missing id with (nil, nil), where
DoltStore and the embedded store return a wrapped storage.ErrNotFound. A
caller written against the backend contract read the http miss as a hit:
`bd create --graph` refused every explicit-id plan over http (patched in
cmd/bd on feat/http-mc-corpus; that workaround is reverted there).
GetIssue now returns the miss (and the empty id) as storage.ErrNotFound,
spelled as issueops.GetIssueInTx spells it. GetLabels, which reads through
GetIssue, keeps the local read's "no labels" answer for a missing id; the
`bd list --parent` walk reads the typed miss as "parent issue not found".
The served bridge test now holds the local reference store and the http
store to the same miss: ErrNotFound with the same text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(createbatchequiv): re-record the apply golden for the created_by default
c2866ea7fe made the create role default an empty CreatedBy to the
request's actor, so every create item of the apply scenario's batch
(actor "apply-writer") now stores created_by "apply-writer" instead of "".
TestCreateBatchFastPathsMatchPerRow_*/apply compared the stored rows to a
digest recorded before that change and failed on exactly the three tables
the column reaches: issues and wisps (the row) and events (the update
event's old-value snapshot). Fast and per-row bodies still agree; the
batch-apply conformance contract pins the same value.
Bisected with bazel: passes at be92efe40f's integ twin 696f7acc8e, fails
from the created_by commit on. Only apply.json's three digests move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* style: gofmt ledger.go and the externaldeps remote-roles test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cmd/bd): bd create reads routing settings local-only on a remote backend too
determineAutoRoutedRepoPath skipped a remote backend's settings document
(routing targets are local paths that one shared document cannot name for
every client), but getRoutingConfigValue, which `bd create` and
migrate-personal read routing.* and contributor.* through, still asked it.
The same workspace could route a create one way and a lookup another, and
every create paid a settings round trip per key.
Both now go through routingSettingsStore: nil for a remote backend, so
routing comes from config.yaml / the environment only there, and a local
store is still consulted. A unit test holds both reads to the rule with a
store that counts settings reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cmd/bd): say so when update -s closed drops an ambient CLAUDE_SESSION_ID
Over http `bd update -s closed` cannot carry closed_by_session, so the CLI
drops it rather than refusing the close. An explicit --session printed a
notice; the ambient CLAUDE_SESSION_ID every agent under Claude Code exports
was dropped without a word, a silent data difference from a local backend
(the served corpus's mc-update-meta-status-closed). The drop is now named
on stderr in both cases, once per command, pointing at `bd close`, whose
wire operation records the session. The served e2e asserts the notice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend/http): hold bd list --limit 2 to each side's own unlimited order
TestE2E_ListWithGCFiltersMatchesEmbedded compared the --limit 2 rows of
the served and embedded workspaces as sets. The seed has four P2 rows, so
the limit cuts a priority tie whose created_at order differs between two
workspaces seeded seconds apart: a test-only flake, the order itself being
total. Each side's two rows must now be, in order, the first two of that
same side's --limit 0 listing; the unlimited listings are still compared
across sides by the shape loop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: unit-tier pins for the created_by default, the policy token and the GetIssue miss
Three review mutations were caught only by a heavier tier (the uow
conformance legs, the served httpclient tier) or by one package's test
alone. Each now has a unit test where its rule lives:
- issueops: PreparePublicCreateRequest defaults an empty CreatedBy to the
actor and keeps an explicit one, without mutating the caller's request.
- externaldeps: the policy layer AppliedToProvider finds becomes the
handshake's policy.external_dependencies through httpapi.Listen, the
composition bd serve performs, and a raw provider's handshake lacks it.
- httpclient (no embedded engine): GetIssue over the real wire client
against a stub server answers a 404 not_found, and the empty id without
dialing, as storage.ErrNotFound spelled like the local stores.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(changelog): S6b/c/d entries match the code
The S6 entry still said `bd create` suppresses created_by on a remote
workspace and that the external-dependency policy runs client-side. Since
S6b/c/d, created_by defaults to the actor in the library on every backend,
and every bd serve composed through the policy advertises
policy.external_dependencies, so clients pass those operations through;
the client-side policy (now in role terms) runs only against a server that
does not advertise it.
New entries: the advertised policy token, bd ping over http, the created_by
library default, closed_by_session dropped by an http `bd update -s closed`
(with a notice, typed or ambient), reopen without a Provenance label over
http, local-only routing.* / contributor.* on a remote backend, GetIssue's
miss as storage.ErrNotFound, and list/children/show counts/dep tree over
http.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(externaldeps): keep S6's list --ready, --claim-next refusal and lost-race error on the S6c composition
The re-adopted S6 head (#7288) carries the review fixup's remote role
composition; S6c replaces it with its own (rolesAreRemote, the widened
ready window, the policy passthrough). Two behaviours S6 shipped and its
reviews pinned would otherwise go:
- bd close --claim-next against a server that does not apply the policy
is refused whole, before anything is read or closed, with "the served
batch close cannot carry a next claim, so nothing was closed; close
without --claim-next, then run `bd ready --claim`". S6c passed the batch
to the http closer, whose W-CloseBatchRequest.ClaimNext refusal drops the
remedy, so TestE2E_BDOverHTTP's two refuseClaimNext steps went red. A
request invalid on every backend is still ErrValidation first, and a
server that applies the policy still gets the request untouched.
- remoteReadyClaimer.ClaimNext reports a page on which every candidate was
lost to another actor as "claim ready: lost N races ...", not as the
empty answer that means there is no work.
- `bd list --ready` (List with ReadyFlag) is answered by the policy
store's own reader over the served ready reads, as S6 does. S6c passed
it to the served listing, which cannot carry ReadyFlag (httpclient
ledger row E-ListRequest.ReadyFlag), so it exited 1 over http with or
without external refs; TestE2E_BDOverHTTP and
TestServedRolesKeepTheExternalDependencyPolicy were red on it.
TestRemoteReaderAnswersAReadyListingWithoutTheWireFlag pins it, with the
fake's served List refusing ReadyFlag as the wire does.
S6's composition tests now run against S6c as remote_roles_composition_test.go.
Their fake serves Ready the way a server does (the S6 composition read
ready work through the legacy policy reader instead), and two call logs
gain that Ready. TestRemoteBatchCloserRefusesANextClaim,
TestRemoteBatchCloserValidatesANextClaimFirst and
TestRemoteReadyClaimerReportsLostRaces were red on S6c before this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(externaldeps): unassigned claim-next and fail-closed close reads
Review fixes for the S6c composition against a server that does not
advertise policy.external_dependencies: the two majors of review
attempt 1, plus the minors on the same code.
- ReadyClaimer: the composed claim-next reads only open, unassigned
ready rows (Unassigned=true, Assignee cleared), the candidates the
local ClaimReadyIssueInTx selects. A row another actor holds, or one
already assigned to the caller, is no longer taken or counted as a
lost race. Each pass reads 25 candidates past the blocked rows, as
httpclient's composed claim does, and a full window lost end to end
is read once more: claimed rows leave the unassigned set. Only a
claim that tried candidates and won none is an error.
- BatchCloser: an externally blocked item travels to the server only
when its status read finds it closed or not found (liveRefusal). Any
other read error is that item's outcome, so a transient or auth
failure no longer forwards a refused close to a server that will not
refuse it.
- TreeWalker: a failed capability probe renders the external leaves
over the walked tree instead of failing a walk the server already
answered. appendTreeExternalReferences skips an id the tree holds,
so an enforcing server's own leaves are not doubled.
- remoteEdges names each anchor once and skips an empty one, which the
http EdgeReader refuses with ErrValidation.
The composition fakes now honor Unassigned/Assignee as
workapi.BuildReadyFilter does, model a rival claim landing first and a
failing GetIssue, and refuse an empty edge anchor as httpclient does.
New: TestRemoteReadyClaimerTakesOnlyUnassignedWork,
TestRemoteReadyClaimerWalksAContendedFront,
TestRemoteBatchCloserAnswersAFailedReadWithIt,
TestRemoteEdgesNamesEachAnchorOnce, and the probe-failure cases of
TestRemoteTreeWalkerAddsExternalLeaves. Each is red with its fix
reverted.
From review attempt 2, three nearby cleanups:
- TestServedRolesKeepTheExternalDependencyPolicy seeds open rows held
by another actor and by the claimant ahead of the free work, then
claims with and without an assignee filter. The unassigned-only claim
is now pinned over a real served server, not only through the fakes:
red with the pre-fixup remote_roles.go, with filter.Unassigned
dropped, and (the filtered claim) with an explicit assignee honored.
- The capabilities description in openapi.v0.yaml (and the regenerated
types.gen.go comment) no longer calls the whole list build-level:
policy.external_dependencies depends on how the server composed its
roles, as the paragraph above it says.
- createbatchequiv's golden note names
issueops.PreparePublicCreateRequest instead of a commit id that is
not on this branch.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend/http): count a not_found read as reaching the remote in #7469's credential doors
main's #7469 added TestExplicitCredentialIgnoresTheEnvPlaintextGrant. Its
OpenWith and Open doors read bd-1 from plaintextRemote, which answers
every issue read not_found, and the granted leg needs that read to return
a nil error. That held while the http client answered a miss with
(nil, nil). This branch's "fix(httpclient): GetIssue answers a miss with
storage.ErrNotFound, like the local stores" makes the same read return
storage.ErrNotFound. So on main plus this branch both doors fail at
per_open_credential_test.go:392 ("with Target.AllowInsecureCredential:
not found: issue bd-1") under plain go test. The merge is textually
clean, so only a build of the merge shows it.
The two store doors now count storage.ErrNotFound as success, since that
answer came off the wire. The assertions are unchanged. The refused leg
still needs the "refusing to send a credential" error and no request on
the transport. The granted leg still needs exactly one request carrying
"Bearer explicit-token": a granted read that never reaches the wire still
fails at :408.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(bazel): one nogo-validating lane per race configuration (F5 S1)
The race configuration (--@rules_go//go/config:race) is built by five
lanes that duplicate the same RunNogo/ValidateNogo work: bazel-test
(--config=ci), bazel-embedded, bazel-doltserver, bazel-proxied, and
the advisory bazel-dolt-race shadow, plus the package-mcp/package-npm
gates' explicit race build. --norun_validations is a build-request
option, not a configuration flag (proven here by aquery: GoCompilePkg/
GoLink/RunNogo/ValidateNogo action keys are byte-identical with and
without it), so passing it on every lane but bazel-test removes the
duplicate work without touching a single action key or dropping any
lint coverage: bazel-test's --config=ci already validates every file
any of the others compiles.
scripts/nogo_lint_policy_test.go replaces the old blanket
"--norun_validations never appears in .bazelrc" check with
TestNogoConfigurationsHaveOneValidatingLane (T1: one owner per
configuration fingerprint), TestNogoOwnersAreRequired (T2: the owner
is a required CI Gate check whose `if:` covers every non-owner's),
TestNogoRaceOwnerBuildsEverything (T3: the owner builds //... whole,
no exclusions) and TestNoUnconditionalValidationOff (T5: nothing else
may disable validation). tools/bazel/nogo_ownership.py (make
nogo-ownership) is a dynamic, advisory aquery cross-check of the same
property, run on demand rather than from inside a Bazel action.
Verified locally: aquery shows identical action keys for the affected
lanes with/without --norun_validations; a planted printf-format vet
finding in internal/idgen/hash.go failed the owner build and passed
the non-owner build (then reverted, never committed);
scripts/bazel_dolt_race_shadow_test.go and the full //scripts suite
stay green.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(bazel): close S1 nogo-ownership review gaps (allowlist, owner pin, real aquery)
Addresses maintainer-city-c3's review of #7479:
1. T6 TestRunValidationsOnlyOnAllowlistedLines replaces the coverage gap
left when main's blanket run_validations ban was dropped: only the four
race-group non-owners' "test:<cfg> --norun_validations" lines in
.bazelrc, and the two package-gate bazel-build steps in bazel.yml, are
permitted. A later test:integration/doltserver-cmd --norun_validations
(out of T1's table, S2) now fails here instead of landing silently.
Verified by mutation: adding test:integration --norun_validations fails
the new test; reverting passes.
3. TestNogoRaceOwnerBuildsEverything (T3) now also pins that the race
owner's "bazel test //... --config=ci" step has no step-level if: or
continue-on-error, and that its job has none either. Verified by
mutation: adding if: ${{ always() }} to that step fails; reverting
passes.
2. tools/bazel/nogo_ownership.py's aquery comparison was querying the
identical mnemonic("RunNogo", //...) for the owner and every non-owner,
so `missing` could never be non-empty. It now derives each non-owner's
actual built target set the way --build_tests_only + --test_tag_filters
does: the deps closure of tests(//...) filtered to targets carrying one
of the lane's tags, read exactly from `query --output=xml` (not attr()'s
substring regex match, which would wrongly fold "dolt-server-proxied"
and "dolt-server-cmd" into a "dolt-server" filter). Confirmed against a
real (offline, --nohome_rc) bazel run: reports OK at head, and reports
100+ missing targets when the owner's query is artificially narrowed to
a subpackage -- it can now actually fail.
Also: refreshed a stale .bazelrc comment claiming nogo runs beside every
lane's compile, which S1 made untrue for race-group non-owners.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* ci(bazel): mode cache reads the remote repo contents cache through rbe-cache
Mode cache (fork and Dependabot PRs while rbe-fork is closed, rbe=cache
dispatches) now reads Bazel's remote repo contents cache: the trees rrc-seed
writes on main pushes, served by rbe-cache's anonymous GetActionResult and
ByteStream.Read (Caddy :8443 -> nativelink-anon -> AC_OSS, read only).
setup-bazel's write-bazelrc.sh adds the trusted readers' two lines to its
fork-cache rc (passed with --bazelrc, so the startup line applies):
startup --experimental_remote_repo_contents_cache
common --loading_phase_threads=64
The committed .bazelrc stays untouched (design R2): the flag is a startup
option and cannot live in build:fork-cache, and developer and macOS
machines never read.
Gated on the new .github/actions/setup-bazel/cache-rrc-probe.sh (a copy of
gascity's tools/rbe/cache-rrc-probe.sh): one GetCapabilities to rbe-cache
(connect 3s, total 5s). Only an answer (gRPC 0, cache_capabilities present)
writes the lines; anything else writes none and logs a ::notice:: with the
reason, and the script never fails on it. Kill switch: fork_rrc_read=on in
that script; set it to off in a one-line PR to stop mode cache reading.
Measured (scratch origin/main, no credentials, 8 CPUs, cold output base,
`build --nobuild //...`): repository rules 665-672 -> 38-41 (the rest are
bd_releases/dolt_release and local or toolchain repos, not reproducible),
analysis 26.5-26.7s -> 12.1-14.8s, wall about 36s -> 25-32s.
Tests: TestSetupBazelRCWriter runs the writer against a stand-in rbe-cache
(answers, answers with zstd, PERMISSION_DENIED, refused): exactly the
reader's lines after --config=fork-cache and any zstd line only when it
answers, a notice otherwise; remote-exec and rbe-fork never get them nor
probe. TestBazelCacheModeReachesTheRC checks no simulated mode carries them
with the probe refused. TestCacheRRCProbe runs the real probe (errors,
malformed, timeout, refused, untrusted cert, kill switch off without a
request).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): mode cache rrc review fixes: reader opt-in, containment, AC probe
Scope. write-bazelrc.sh enabled the remote repo contents cache for every
mode cache job, bazel-release-cross included, whose configs
rrc-lane-commands.txt does not seed. setup-bazel now takes BAZEL_RRC_READ
("true" or empty, anything else fails): only with it does mode cache probe
rbe-cache and add the reader's lines. The 8 trusted reader jobs pass it,
and nothing else. TestBazelRRCOptInMirrorsTheTrustedReaders pins that set
to bazelRRCReadLanes; TestBazelRRCLaneCommandsCoverEveryReader now checks
every job that enables the flag either way (reader step or opt-in) is a
reading lane whose bazel configs are all seeded. TestSetupBazelRCWriter
covers a job without the opt-in (no probe, no lines) and bad values.
Runner. The 5 readers that run in mode cache (test, pure, integration,
doltserver, cmd-dolt) fall back to ubuntu-24.04 instead of ubuntu-latest:
one runs-on line each; mode remote stays Blacksmith, and the remote-only
readers and every other job are unchanged.
Visibility. write-bazelrc.sh writes one step-summary line in mode cache:
whether the job reads, and why (the probe's reason, with rbe-cache's
GetCapabilities TCP connect time, DNS excluded).
Probe. cache-rrc-probe.sh is re-copied from gascity: it also asks
GetActionResult for a fixed key no action has and a ByteStream Read of
that digest as a blob, and passes only if both answer NOT_FOUND (gRPC 5),
proving Caddy, nativelink-anon, the action cache and the CAS answer; it
reports the TCP connect time minus the DNS lookup. serveCapabilities
answers both; TestCacheRRCProbe adds their failure answers.
Containment and limits. The rrc-verify issue body and
CI_REQUIRED_CHECK_TOPOLOGY.md no longer say to set RBE_REPO_CONTENTS_CACHE
off (mode cache never sees it, and off also stops rrc-verify): commit
fork_rrc_read=off in both probe scripts (beads has no fresh-merge, so an
open fork PR keeps its old switch until it is pushed again); for immediate
server-side containment, rbe-cache-gate close on core; and, because the
mode remote readers read the same oss action cache entries, set the
variable to seed on a mismatch (no lane reads, rrc-seed and
rrc-verify keep running), off only to stop seeding too, and leave it as
it is when the run only could not check. The doc also says a
closed or down cache only falls back at probe time (after loading, files
are fetched lazily and losing rbe-cache fails the command, bazel#30218),
and notes the 512 MiB anonymous CAS limit under gascity's R4.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): bazel-dolt-race opts in to the rrc read like the other trusted readers
#7464 added bazel-dolt-race as a trusted reader after this branch was cut, so
TestBazelRRCOptInMirrorsTheTrustedReaders now covers it: pass BAZEL_RRC_READ
(it runs only in mode remote, so this changes nothing today). It never runs in
mode cache, so it keeps the lanes' ubuntu-latest fallback: the cache-reader
runner rule (ubuntu-24.04) excludes it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): add advisory dolt-race shadow lane (item 5 phase 1)
Add --config=dolt-race, the union of --config=doltserver and
--config=doltserver-proxied with one tag filter for both tiers, and an
advisory bazel-dolt-race job that runs it beside bazel-doltserver and
bazel-proxied. The shadow measures one client per group of lanes against
the two lanes it would replace before any cutover (item 5 slice A1a).
The job runs in mode remote on pull_request and merge_group events only.
It has job-level continue-on-error, no job or workflow_call output, and no
gate names it, so it cannot change CI Gate or PR Risk Gate. Its
ci-analytics step is copied verbatim with LANE=dolt-race, and rrc seeds
the new config.
Policy tests pin the config as the exact union of its members' lines (tag
filter aside), the job's run modes and events, its advisory shape, the
analytics lane map and the rrc command list. aquery shows every member
target's TestRunner action (actionKey, argv, env, inputs, outputs) is
unchanged under the union config.
Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): give the dolt-race shadow timeout headroom; fix gate-wait wording
Review follow-up on the advisory bazel-dolt-race job (maintainer-city-c3,
findings 1, 2 and 5):
- Raise the job's timeout-minutes from 30 to 35. continue-on-error covers
a failed or timed-out step, but not a job GitHub cancels at its own
timeout, which could make the bazel call non-success and turn CI Gate
red. TestBazelDoltRaceShadowIsAdvisory now reads both timeouts from the
workflow and requires job >= test step + 10 (and a step timeout at all).
- Correct the docs and comments: the shadow cannot fail the gate, but
CI Gate still waits for it, because its needs on the bazel call
completes only when every job in it has finished.
- Correct the checks comment: check_testcases covers every target in the
union, including the dolt-server tier its own lane never checked.
Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): bound every dolt-race shadow step; job timeout covers their sum
Review follow-up (S1): a hang in any bazel-dolt-race step without a
timeout would run into the job's own timeout, and a job GitHub cancels
there is not covered by continue-on-error. Every step now has a
timeout-minutes, and the job's timeout covers their sum:
- checkout 5, rrc read 1, setup-bazel 10, flaky query 5, checks 3 each,
test-log upload 3. The test step (25) and the analytics steps (3, 2)
keep bazel-proxied's values; bazel-proxied sets no timeout on the
others, so these bound them.
- The step timeouts sum to 60 minutes, so the job timeout goes from 35 to
65.
- TestBazelDoltRaceShadowIsAdvisory now requires a timeout on every step
and job >= sum(step timeouts) + 5, read from the workflow, alongside the
existing job >= test step + 10.
Also cite the farm maintainer's confirmation of NativeLink 1.7.1's
in-flight Execute dedupe in the job comment.
Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): keep dolt-race shadow timeout under the merge queue's
Tighten the shadow's non-test step budgets so the job timeout (step sum
+ 5) is 55 minutes, and pin that it stays below the 60-minute merge
queue check timeout: CI Gate waits for the shadow, so a hung shadow
must not drop a group from the queue.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(backend/http): add the public HTTP backend door, cmd/bd registration, and bd connect
internal/httpclient (S1-S5) had no production caller for the per-open
backends.OpenOptions.Credential seam and no way for a workspace to actually
select it. This slice (S6) closes both gaps in OSS's own idiom, without
carrying over anything from bd-enterprise's gateway/box-login/storage-profile
machinery:
- backend/http (bdhttp) is the public, out-of-tree extension door: Register
adds "http" to the backend registry and installs its transport, Open/
Handshake dial a server directly with no workspace on disk, and the
registered OpenWith hook threads a per-call credential through
beads.OpenBestAvailableWith for a multi-tenant embedder.
- internal/httpclient/open_with.go is the backends.Backend.OpenWith hook
itself: a fresh dial per open (opts.Credential/HTTPClient/UserAgent),
distinct from the process-wide registered dialer Open/OpenReadOnly use.
- cmd/bd/http_backend.go registers the backend for the OSS binary, so a
workspace whose metadata.json names "http" opens through the ordinary
OpenBestAvailable path; any other unregistered backend name still refuses.
- cmd/bd/connect.go adds the minimal `bd connect <url>` command: a handshake
that must succeed before anything is written, a per-user activation
sidecar (.beads/http_target.json, never git-tracked), a plaintext-to-
non-loopback refusal without --allow-plaintext, and a backend-switch
refusal without --force. No credential is ever accepted on the command
line or written to disk.
- cmd/bd/doctor/gitignore.go requires the new http_target.json /
http_local_metadata.json sidecars be git-ignored, the same way the
proxied-server client info already is.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(storage): keep external-dependency blocking over http unless the server enforces it
bd ready / bd close / claim hard-failed against the new http backend with
"GetAllDependencyRecords not supported by the http backend": cmd/bd's
storage chain wraps every opened store in the externaldeps policy
decorator, which needs either the narrow ExternalDependencyQueryStore
interface or the broad GetAllDependencyRecords fallback to resolve
blocking state, and the http client implemented neither.
The decorator now stays on for a remote store. It is skipped only when the
server's handshake advertises policy.external_dependencies (the server
enforces the policy before answering). Without that capability the client
resolves blocking itself from the listing and chunked dependency reads, so
an issue with an unresolvable external: dependency stays out of bd ready
exactly as it does on a local backend; it is never silently skipped
(DESIGN 3.6). Server-side enforcement is slice S10.
storage.RemoteBackendStore marks a DoltStorage that is a pure network
client of a remote bd serve; the http backend's Store satisfies it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(cmd/bd): suppress the CreatedBy stamp on create against a remote backend
bd create failed against the http backend with "Issue.CreatedBy: ... is not
expressible on the v0 wire": the http client's create role deliberately
refuses any POPULATED CreatedBy/CreatedAt (the creation stamp belongs to the
server's own journal entry, not a value the caller supplies), but
cmd/bd/create.go unconditionally stamped getActorWithGit() onto every
created issue regardless of backend. The refusal only fires on a non-zero
field, so suppressing the stamp for a registered remote backend is wire-
compatible by construction, not a workaround.
Add isRemoteBackendWorkspace()/creationActorStamp() to backend_support.go,
reusing the existing resolveCommandBeadsDir(dbPath) +
backendNameForErrorFraming(beadsDir) + backends.IsRemote(name) pattern
already used elsewhere in that file, and use creationActorStamp() at both
create.go call sites (the dry-run preview and the real create).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(backend/http): add an embedder linkage test over public packages only
Prove the one promise S6 makes to an out-of-tree embedder (gc is the
motivating case): importing nothing but github.com/steveyegge/beads,
.../backend, and .../backend/http is enough to register the http backend,
open a workspace through it with a per-call credential
(beads.OpenBestAvailableWith), and read through the role-accessor surface
(IssueReader().Ready) against a stand-in server — with no internal/...
import in the test file, which is itself the thing under test.
Written fresh for OSS beads S6; no bd-enterprise source copied.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs: document the HTTP backend, bd connect, and the public backend/http door
Add a README section with bd connect usage, the credential ladder, and the
plaintext/force refusals, plus a CHANGELOG entry for the new cmd/bd
registration, bd connect command, and the public backend/http package.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): address bee-ghosttrack review on #7288 (connect --clear restore, persisted --allow-plaintext)
Closes the CHANGES_REQUESTED items on the HTTP backend door PR:
- Must-fix: `bd connect --force` over a workspace with its own local
(dolt) identity now has writes succeed instead of tripping "workspace
identity mismatch detected" — validateWorkspaceIdentity (cmd/bd/main.go)
and the sidecar (internal/httpclient/metadata.go) now compare against
the http backend's own pinned project id. New e2e regression test
TestE2E_ForceConnectWritesSucceedDespiteDifferingLocalProjectID
(backend/http/e2e_cli_test.go), confirmed to fail without the fix.
- Should-fix 1: `bd connect --clear` now restores metadata.json's
backend selection to whatever it was before this workspace connected,
instead of leaving it pinned to "http" with no sidecar to dial.
Target.PreviousBackend (internal/httpclient/target.go) is recorded by
Attach (backend/http/attach.go) and round-tripped through the sidecar;
connect.go reads it back on --clear. New tests in
backend/http/attach_test.go and internal/httpclient/target_test.go.
- Should-fix 2: `bd connect --allow-plaintext` is now remembered in the
sidecar (Target.AllowInsecureCredential), scoped to the target it was
granted for, so every later ordinary command's dial honors the grant
without also needing BEADS_HTTP_ALLOW_INSECURE=1 set
(internal/httpclient/dial.go). Fixed BearerProvider.warnInsecure's
wording (internal/httpclient/credential.go), which used to assert a
token was being sent immediately above a refusal saying the opposite.
New test TestDialWithWiresTargetAllowInsecureCredentialThroughToTheGuard.
- Should-fix 3: README no longer claims HTTP mode works "exactly as
with a local database" — it lists what round-trips and points at the
divergence ledger (engdocs/design/http-divergence-ledger.md) for what
differs.
- Verified, no code change needed: Attach already handles an existing
metadata.json project_id coherently (only cfg.Backend is touched); bd
show's isNotFoundErr already matches a http 404 (issueops.ErrNotFound
is storage.ErrNotFound, the same sentinel a local miss uses), so it
reads as "not found" rather than an unsupported-operation error.
- Doc fix: guardInsecureCredential's doc comment and refusal message
were stale against should-fix 2's own change — they named only
DialOptions.AllowInsecureCredential and the env var as ways to get
past the guard, not the newly-persisted target.AllowInsecureCredential
or `bd connect --allow-plaintext` itself.
Gates run clean on this branch: go build/vet, go test over
internal/httpclient, backend/http (including the full e2e suite under
BEADS_TEST_EMBEDDED_DOLT=1) and cmd/bd, make api-check, make
ci-pr-lint, make bazel-sync-check, bazel run //:gazelle -- -mode=diff,
and internal/storage's TestEveryLegWiresEveryRoleContract.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(backend/http): give the e2e server the BatchGetter role #7248 added to the required set
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix: exact http ready totals, connect capability row, doc corrections
Ready totals over http (review major). externaldeps drops externally
blocked rows client-side for a store that cannot express ExcludeIDs
(today httpclient.Store). dropBlockedIssuesWithCounts compacted the
fetched rows in place (`kept := rows[:0]`), and
readyWorkWithCountsAndTotal then re-scanned `rows` to count the blocked
rows it had dropped. By then the compaction had overwritten them, so
whenever a blocked row came back ahead of a kept one the re-scan
undercounted the drops: `bd ready --json`'s total and text-mode `bd
ready`'s count (CountReadyWork) overstated ready work against any server
that does not advertise policy.external_dependencies. Both drop helpers
now copy into a fresh slice, and dropBlockedIssuesWithCounts reports how
many rows it dropped, so nothing re-scans `rows`.
fakeStore gains an excludeIDsUnsupported switch that, like
httpclient.Store, refuses any ExcludeIDs. The new
TestReadyTotalsWhenStoreCannotExpressExcludeIDs puts the blocked issue
first and checks the page and total for an unlimited filter, a Limit
whose bumped window holds the whole set, and one the set outgrows, then
CountReadyWork. TestServedReadyExcludesUnsatisfiedExternalDependencyWithoutServerCapability
now also checks the total and count against a real in-process bd serve.
Against the previous decorator the unit test's unlimited case reports
total and count 3 beside a 2-row page, and the served test 2 beside a
1-row page.
Review minors, all wording:
- `bd connect --clear` pointed at `bd config set backend dolt`, which
writes the database's config table rather than metadata.json and, in
the state that prints the advice (metadata.json says http, sidecar
gone), fails the pre-open identity check. It now says to reconnect, or
to set "backend" in metadata.json.
- CHANGELOG described the superseded skip-at-wrap design; it now
describes the always-wrap decorator with its capability probe and
client-side drop.
- RemoteBackendStore's docs no longer name a consumer; nothing in-tree
checks it.
- creationActorStamp's comment pointed at backend/http/lifecycle.go; the
refusal lives in internal/httpclient/lifecycle.go.
Capability row. TestProxyCapabilityRegistryCoversCommandTree fails at
60b7128204: the command tree walk finds `connect`, which this PR adds,
with no row in cmd/bd/capability_registry.go ("1 command(s) have no
proxied-server capability row: connect"). The test predates the PR
(#6582 is an ancestor of its base) and passes at the base dabf20ef07.
connect opts out of store init (skipStoreAnnotation) and never reaches
the store factory, so it belongs in proxyPermittedPaths beside init and
setup. The row is runtime-neutral: validateProxyRegistryBeforeProvider
returns nil both for a permitted row and for a path with no row, so
this only records the policy decision the coverage test asks for.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Gas City Adopt-PR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(httpclient): regenerate the divergence ledger doc after the S5 rebase
The rebase onto feat/http-client-batch-apply's rebased head (S3/S4 merged to
main) left the ledger doc's summary line at a conflict-resolution placeholder
count. Regenerate it from internal/httpclient/encode.Ledger() so
TestDivergenceLedgerDocMatchesLedger passes against the merged ledger.go.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(backend/http): host-scope S6's test BEADS_HTTP_TOKEN values
Rebasing onto feat/http-client-batch-apply's rebased head pulled in main's
#7247 review-fix round, which made BEADS_HTTP_TOKEN/BEADS_HTTP_TOKEN_COMMAND
host-scoped (host[:port]=value, scopedEnvValue/parseScopedEnv in
internal/httpclient/credential.go) after S6's own tests were written against
the unscoped form. Five S6 tests across backend/http/open_test.go,
backend/http/register_test.go and
internal/httpclient/insecure_credential_guard_test.go set a bare token and
now hit the new ladder's "an unscoped token would be used for whatever
server..." refusal. Scope each to the test server's actual host
(127.0.0.1 for the httptest.Server-backed recording servers,
nonLoopbackTestHost for the insecure-credential-guard integration tests)
so they exercise the same ladder rung as before.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* build(bazel): resync go_srcs/repo_files for the new backend/http and test/embedder packages
make bazel-sync-check failed after the rebase: tools/bazel/go_srcs.py's
managed repo_files filegroups for backend/http and test/embedder (new in
this slice) hadn't been generated, and the root BUILD.bazel / tools/bazel's
release_cross_build target list hadn't picked up the new package either.
Regenerate with `python3 tools/bazel/go_srcs.py`; `bazel run //:gazelle --
-mode=diff` reports no further drift.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(cmd/bd): route swarm's create paths through creationActorStamp after main's currentActor change
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix: police http's served roles, refuse close --claim-next, exact totals
External-dependency policy over http (review blocker). cmd/bd wraps
every store, http included, in the externaldeps decorator, and its role
accessors rebuilt each role over legacy methods httpclient.Store refuses
(SearchIssuesWithCounts, GetDependencyTree, ClaimReadyIssue, IsBlocked,
GetDependencyRecordsForIssues, BatchCloserWithPolicy). Over http `bd
list`, `bd dep tree`, `bd ready --claim` and a policed `bd close`
therefore exited 1, even in a workspace with no external dependency.
Over a store that reports storage.RemoteBackendStore, each accessor now
starts from the inner store's served role and layers the policy around
it (remote_roles.go):
- IssueReader serves List and Get from the served reader; Ready and a
ready-flagged List go through the policy reader.
- IssueClaimer refuses an externally blocked claim before the served
one.
- ReadyClaimer uses the served claim-next while no issue, closed ones
included, holds an unsatisfied external ref. Otherwise it claims down
the policy's filtered ready page through the served Claimer, because
claimNext cannot exclude ids.
- BlockingAnnotator and TreeWalker merge external blockers into, or add
external leaves to, the served answer. They read only the named
issues' edges through the served EdgeReader, 100 anchors per call.
- BatchCloser refuses externally blocked open items and sends the rest
to the served closer as one request. --force keeps the base path, and
a next claim is refused whole (below).
RemoteBackendStore now only chooses this composition. Whether the policy
runs is still ServerEnforcesExternalDependencyPolicy's answer (design
3.6), and the storage and httpclient docs say so. remote_roles_test.go
drives each role over a store that refuses the legacy methods.
TestServedRolesKeepTheExternalDependencyPolicy runs every role over a
real http server. TestE2E_BDOverHTTP adds `bd list` (JSON, text and
--deps), `bd dep tree`, `bd ready`, `bd list --ready`, `bd ready
--claim`, a refused `bd close --claim-next`, and a refused then forced
close of an externally blocked issue. At the fixup before the
composition, the role tests then written (bar one pin of the next-claim
refusal, since replaced) and the e2e's list, dep tree, claim and close
steps of that round were red.
Close with a next claim over http (review major). batchCloseIssues has
no member for a next claim, so httpclient refuses any ClaimNext before
the dial (ledger W-CloseBatchRequest.ClaimNext). Over http `bd close
--claim-next` therefore always exited 1 and closed nothing. With an
external ref anywhere in the workspace (a closed holder or --force
included) the decorator's base path failed first, with an opaque
`BatchCloserWithPolicy` unsupported. remoteBatchCloser now refuses a
next claim whole, before it reads or closes anything, and the error
says nothing closed: close without --claim-next, then run `bd ready
--claim`. A request that is invalid on every backend is still
ErrValidation first, and a server that enforces the policy itself gets
the request unchanged.
Composing close-then-claim was not taken. The role closes and claims in
one transaction and answers with an error or with outcomes, never both,
so a claim that failed after the closes committed could not report
them; httpclient refuses the same request for that reason. A CLI-level
close then claim that can report a partial result is the follow-up.
The review also suggested leaving closed holders out of the blocking
state. They stay in, as on every backend: a closed issue is never a
claim candidate, so they change no claim, and leaving them out would
cost a status read per holder because the wire has no batch read.
TestRemoteBatchCloserRefusesANextClaim covers an open holder, a closed
one, none, --force, and a server that enforces the policy; with the
previous remote_roles.go the first four are red.
TestRemoteBatchCloserValidatesANextClaimFirst keeps ErrValidation ahead
of the refusal. Dropping the filter check, or loading the blocking
state before refusing, is each caught. TestE2E_BDOverHTTP runs `bd
close --claim-next` while the holder is open and again after it is
closed; with the previous remote_roles.go both steps are red and print
`operation "BatchCloserWithPolicy" not supported`. Ledger F-close no
longer says --claim-next is served, and no longer names a
renderEscapedHTTPRefusal that does not exist. L14 says the decorator's
claim leg applies while any issue, closed or not, holds an unsatisfied
ref. The README and CHANGELOG mention the refusal, and the decorator's
IsBlocked, IsBlockedBatch and CloseIssueChecked say they refuse over a
store that serves its roles.
Ready totals with external blockers (review majors, both rounds).
CountReadyWork asks for Limit=0, and readyWorkWithCountsAndTotal took
any Limit<=0 to mean "the window held the whole ready set". Over http a
zero limit never reaches the wire: the server answers with its default
page (workapi.DefaultReadyLimit, 100 rows) while the bridge reports the
full total, so past 100 ready issues text-mode `bd ready` kept counting
externally blocked issues beyond the first page. Exactness is now judged
from the rows that came back (total <= len(rows)). A window that holds
only part of the set no longer subtracts every externally blocked id in
the workspace either: that set includes closed issues and ones the
filter excludes, none of them in the total, so the count came out low.
It refetches the filtered ready set, ids only, and subtracts the blocked
rows in it; the old bound is left as the fallback for a refetch that
comes back truncated too.
fakeStore gains the bridge's shape: a defaultPage for a zero Limit,
with GetReadyWorkWithCountsAndTotal still totalling the whole set.
TestReadyTotalsWhenAnUnlimitedFetchComesBackAsOnePage (a blocked issue
past the first page) and
TestReadyTotalsIgnoreExternallyBlockedIssuesOutsideTheReadySet (a
blocked issue outside the ready set) have served counterparts,
TestServedReadyCountExcludesAnExternallyBlockedIssuePastTheDefaultPage
and TestServedReadyTotalIgnoresAnExternallyBlockedIssueOutsideTheFilter
(an assignee filter). The first pair is red on the Limit<=0
condition, the second on the subtract-every-blocked-id branch.
Docs: ledger L8 now says which decorator paths take the chunked
GetAllDependencyRecords scan and which read only named edges, and L14
records the decorator's composed claim leg; http-divergence-ledger.md
is regenerated. The README names the verified commands, and the README
and CHANGELOG say how cross-repo dependencies behave over http.
Minors from the reviews:
- Drop creationActorStamp/isRemoteBackendWorkspace and restore the base
stamps at all 11 sites. The arm guarded a refusal the http create
role does not make: since #7247 (actorStampedCreateMember) it accepts
a CreatedBy naming the actor. Because the arm keyed on the CWD
workspace, a create routed from an http workspace into a local one
(--repo) stored an empty created_by. TestE2E_BDOverHTTP checks
created_by for a direct and a routed create; the routed check is red
with the arm restored. The CHANGELOG sentence describing the arm goes
with it.
- bdhttp.Attach decides a reconnect from the raw metadata.json backend.
GetBackend() reads an unregistered "http" as the dolt default, so in
an embedder that never called Register a reconnect recorded dolt as
the backend --clear restores. The reconnect test now seeds postgres
(TestAttachOnAReconnectKeepsTheEarlierPreviousBackend) and is red
with the old check.
- README, CHANGELOG and `bd connect --help` document the host-scoped
BEADS_HTTP_TOKEN=host[:port]=<token> form (and _COMMAND), and say why
a bare value is refused.
- bdhttp.Attach also gitignores http_local_metadata.json, the per-user
file the store writes on first use, so an embedder activating through
Attach alone gets the coverage `bd connect` already had.
TestAttachGitignoresBothPerUserFiles pins it.
- ServerSnapshot.WireRevision's doc names the handshake's actual check
instead of a comparison `bd connect` never makes.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Gas City Adopt-PR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend/http): give the e2e server the LeaseReclaimer role #7412 added to the required set
main's #7412 made LeaseReclaimer part of httpapi's required role set and
updated main's own binders, but backend/http's e2eServeConfig predates it,
so every TestE2E_* that binds the in-process server failed with
"httpapi: no database source". Same shape as e63f7da36a for BatchGetter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(externaldeps): lead the --claim-next refusal with the wire fact; pin the L14 leg and connect --clear
Review i4 minors/nits on the stranded fixup, carried as a separate commit:
- remoteBatchCloser's --claim-next refusal now says the served batch close
cannot carry a next claim (the real cause), rather than blaming
externally blocked work a workspace may not have. The test asserts the
reason, that nothing closed, and the remedy.
- GetDependencyTree's doc says a served store refuses its reads and that
bd dep tree goes through remoteTreeWalker.
- README no longer gives `bd ready --claim` local semantics everywhere; it
names when ledger row L14's two-step claim applies.
- TestE2E_BDOverHTTP claims once more after the external-ref holder is
closed, pinning L14's composed leg (a mutant whose composed leg claims
nothing turns only that step red).
- New TestE2E_ConnectClearRestoresThePreviousBackend: --clear restores
the prior dolt backend with its identity intact, removes the sidecar,
and a second --clear changes nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend/http): run the served e2e under bazel
//backend/http:http_test declared no bd binary, so under bazel the e2e
files (bazeltest.PrebuiltBD) failed on BEADS_TEST_BD_BINARY with
BEADS_HTTP_TEST_REQUIRED=1 and only "passed" by skipping otherwise. It now
takes //cmd/bd:bd_for_tests (visibility added), size large / timeout long:
the served cases run 4-5 minutes on the farm under BEADS_TEST_EMBEDDED_DOLT=1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend/http): run the e2e tier in the embedded lane as http_served_test
The previous commit gives //backend/http:http_test the bd binary, but no
lane sets BEADS_TEST_EMBEDDED_DOLT for it, so its TestE2E_* cases still
skipped in CI. http_served_test runs the same test binary through
//tools/bazel:go_test_variant.sh with BEADS_TEST_EMBEDDED_DOLT=1 and
BEADS_HTTP_TEST_REQUIRED=1 (a skip fails it). It is tagged embedded, so
the --config=embedded lane runs it and prcore/ci keep their current
shape, the same split as //internal/httpclient:httpclient_served_test.
Under plain --config=embedded all 8 TestE2E_* cases run, none skipped.
TestBazelRetiredLanesCannotBeNarrowed pins every embedded-lane target's
args and env; the new target is added to that pin list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(externaldeps): cap the ready rows kept, not the bumped http window
An http store cannot carry ExcludeIDs on listReadyWork, so readyExclusion
fetches the unfiltered ready set, widened by len(blocked) under a limit,
and drops the externally blocked rows client-side. The http ready bridge
enforced MaxRows on the rows it fetched rather than the rows kept. So
`bd ready --limit N --max-rows N` exited 2 whenever more than N issues
were ready and any workspace issue held an unsatisfied external blocker
(a closed one counts), even with no blocked row in the window, and a
blocked row in the page counted against the cap although the caller
never sees it. Locally neither can happen: issueops enforces the cap on
the filtered page it delivers, after the Limit trim
(finishReadyWorkWithCounts).
The client-side path now takes MaxRows off the inner query and enforces
the caller's cap on the rows it keeps, after the trim, in all three
listings. The inner query keeps the cap whenever nothing is dropped
client-side. MaxRows never rode the wire, so the fetch is the size it
was; refetchedReadyTotal already clears the cap on its own over-fetch.
TestServedReadyMaxRowsCountsTheRowsKept runs the decorator over a served
http store holding three free issues and one externally blocked one: a
cap equal to the limit, a cap under a wider limit, an unlimited listing,
and a kept page wider than the cap, which must still return
ErrTooManyRows with the caller's cap and source. Each case runs through
GetReadyWork, GetReadyWorkWithCounts and GetReadyWorkWithCountsAndTotal.
Leaving the cap on the inner query fails the first three cases in all
three methods, dropping the re-applied cap fails the fourth, and
enforcing it before the Limit trim fails the first.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Eddie the Engineer <adopt-pr@gascity.com>
Port gascity's remote repo contents cache wiring (gascity #7467, #7478) to
bazel.yml, gated on the repository variable RBE_REPO_CONTENTS_CACHE
(unset/off: nothing; seed: rrc-seed on push to main; canary: + bazel-test
reads; on: + every test lane reads). Mode remote only.
- rbe job: an rrc step turns the variable into the rrc output.
- Readers: the eight test lanes append startup
--experimental_remote_repo_contents_cache and common
--loading_phase_threads=64 to .bazelrc.local before Set up Bazel.
- rrc-seed (push to main, id-token: write): a 30-minute
rbe-rrc-writer-beads certificate from rbe-west's mint
(.github/scripts/rrc-writer-credential.sh), then every lane's command
(.github/scripts/rrc-lane-commands.txt) with --nobuild, --remote_cache
only and --remote_upload_local_results (.github/scripts/rrc-run-lanes.sh).
- rrc-verify (schedule/dispatch, issues: write): cold fetch of every lane
and tools/bazel/rrc_verify.py against the cache; a mismatch opens an
rrc-verify issue.
- pr.yml, nightly.yml and bazel-farm.yml grant id-token: write and
issues: write on their bazel.yml call (startup_failure otherwise);
TestBazelWorkflowCallersGrantEveryRequestedPermission guards it.
rrc-writer-credential.sh, rrc_verify.py and rrc_verify_test.py are byte
copies of gascity's, pinned by sha256.
Refs ga-vnycm2.29.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
//internal/storage/embeddeddolt:embeddeddolt_embedded_test became the
embedded lane's floor once the cmd tier was split (CI on #7438: 20 shards,
220s max, 162s median). Its tests are serial, so a shard's wall time is the
sum of its tests; measured on rbe-west with the whole lane running (as CI
runs it), its 20 shards took 110-161s.
- TestCreateBatchFastPathsMatchPerRow_Embedded (111s) runs
createbatchequiv's scenarios as two top-level tests (small+depadd,
apply+waitsfor) through a new createbatchequiv.RunNamed; the same
scenarios and checks. TestCreateBatchEquivalencePartsCoverEveryScenario
fails unless the parts name every createbatchequiv.Run scenario exactly
once.
- TestWithPeerAuth_WarnsWhenStoredPeerSuppressesAmbientPassword (81s, eight
cases each opening its own store) runs its table as two top-level tests,
cases 1-4 and 5-8; cases and assertions unchanged.
- Durations re-measured on rbe-west under the whole lane's load; the
Bazel-only block is now 40 shards (LPT heaviest = the heaviest single
test, TestLifecycleCloseReopenContract ~71s). One target: 40 is under
Bazel's 50-shard cap, so no offset split.
rbe-west, `bazel test //... --config=embedded --nocache_test_results`:
storage shards max 161s -> 89s, median ~118s -> 63s.
Bead: ga-vnycm2.28
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
//cmd/bd:bd_embedded_test was the embedded lane's floor: at Bazel's 50-shard
cap per rule, each shard's wall time was its slowest top-level test, and
~40 tests ran 65-130s on rbe-west.
- 34 slow TestEmbedded* functions are split into 89 smaller top-level
functions. Subtests and table cases are moved verbatim: no assertion,
flag or data changes, the same t.Run set per file, the same skip guard and
t.Parallel. Subtests that read state earlier ones left stay together, in
order; each new function repeats the shared setup it needs.
- The manifest's cmd/bd block is now 100 shards, run by two targets:
bd_embedded_test (shards 1-50) and the new bd_embedded_part2_test
(51-100), through go_test_manifest_shard.sh --shard-offset/--shard-total.
check_shard_coverage.py takes SHARDS@OFFSET/TOTAL and fails unless the
targets' ranges tile the block exactly once, so every test runs in exactly
one shard of one target; the policy tests read both rules' ranges from
cmd/bd/BUILD.bazel.
- Durations re-measured on rbe-west with the split tests and repacked. The
frozen legacy 20-shard block drops the renamed names (no workflow reads
it; new names hash-distribute as before).
Not split: the *Concurrent stress tests (their bd subprocesses queue on the
workspace's single writer lock: TestEmbeddedUpdateConcurrent is ~100
serialized bd commands), TestEmbeddedPurgeWispsPlaneRetention (one stateful
sequence), and the MaxRowsList* tests (setup is 21 sequential creates every
subtest reads).
rbe-west, both targets, --nocache_test_results: slowest shard 138-163s ->
109s (TestEmbeddedUpdateConcurrent alone; every other shard <=86s), median
80-84s -> 40s, shard-seconds 4.1-4.4k -> 4.2k, critical path 213-306s ->
113s.
Bead: ga-vnycm2.17
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): scope the proxied lane's shared-server projects to their own database (44 -> 28 shards)
//cmd/bd:bd_proxied_test spends nearly all its time in `bd init
--proxied-server` against the shard's shared dolt sql-server. Measured
where that goes (dolt query log): of ~2,031 statements per init, the ~220
INFORMATION_SCHEMA queries (migration guards and pre-repair probes) are
~80% of server time at a handful of databases, the 81 DOLT_COMMITs only
~0.5s. Dolt evaluates INFORMATION_SCHEMA by walking every database the
session can see, so as root each init cost the server ~1.2 CPU-seconds
more per database already on it (locally 6.7 CPU-s with 1 database, 21
with 11): a shard's k-th init paid for the k-1 projects before it.
- proxied_shared_harness_test.go: newSharedProxiedProject now provisions
the database server-side (root creates it plus a passwordless user of
the same name with ALL on it and nothing else) and inits with
--proxied-server-external-user, so each project's sessions see one
database. newSharedProxiedRootProject keeps the old root/bd-creates-it
shape for the four tests that need a server-wide privilege (DOLT_REMOTE
remove, CREATE DATABASE, one compact statement); a run with the server
log in test outputs showed no other denied statement.
- Dropping finished databases instead was tried and rejected: a DROP
DATABASE fails other sessions' in-flight INFORMATION_SCHEMA queries
("no root value found in session"), ~35 init failures per run.
- No assertion changed. The bd-creates-the-database path stays covered
by the root variant, the managed-local and non-shared init tests.
- proxied_test_durations.json re-measured (two rbe-west runs): 19,618 ->
6,345 cost-seconds. 44 -> 28 shards, LPT-packed to ~227 per shard.
rbe-west, --nocache_test_results (BEP attempt durations): before 44
shards, sum 6,063s, max 186s; scoped users at 44 shards, sum 2,337s, max
68s; at 20 shards, sum 1,950s, max 136s.
Bead: ga-vnycm2.16
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): proxied lane 28 -> 34 shards for a <=100s slowest shard
PR CI at 28 shards (~227 packed cost each): 2,285 shard-seconds, median
78s, but max 113s; equally packed shards spread up to 1.45x the median.
34 shards (~187 each) targets a slowest shard under 100s.
Bead: ga-vnycm2.16
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
//cmd/bd:bd_proxied_test's 30-shard block was packed from a local capture
of each test's <testsuite time>, which for a t.Parallel test spans the time
it sat paused behind its shard's other tests. Cheap tests that waited
looked as heavy as the shard, so the "balanced" block ran 38-286s per shard
in CI (356s on rbe-west).
- scripts/ci/proxied_test_durations.json: re-measured on rbe-west (two
--nocache_test_results runs), each test's cost the sum of its leaf
tests' <testcase time>, averaged over both runs.
- Measured where a test's time goes: nearly all of it is
`bd init --proxied-server` against the shard's dolt sql-server (~2,000
statements, 81 DOLT_COMMITs, ~6-12 server CPU-seconds per init), one per
subtest. Top-level tests with ~20 such subtests ran up to ~350s alone,
above any shard budget, so the fifteen heaviest are split into two or
three top-level functions (TestProxiedServerUpdate/-UpdateB/-UpdateC,
...). Each subtest is moved verbatim; the split functions repeat the
original's preamble.
- 30 -> 44 shards, LPT-packed to <=430 cost-seconds per shard.
rbe-west, --nocache_test_results: before 30 shards, max 356s, 5,671
shard-seconds; after 44 shards, max 159s (median 138s), 5,883
shard-seconds.
Bead: ga-vnycm2.3
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): cut embedded/test lane long shards (served template, bulk seed, rebalance)
Embedded lane (bazel-embedded):
- RunBatchGetterAcceptsExactlyTheCap seeds its 1000 issues through a new
optional BatchGetterFixture.CreateIssues hook (one write) instead of 1000
single-row commits. Wired for the embedded, served and dolt-server legs;
the UOW leg keeps the per-row fallback. Same rows, same GetMany
assertions. TestBatchGetterContract 199s -> ~7s and
TestServedBatchGetterContract 204s -> ~7s on rbe-west.
- The served-surface harness (newServedEnv) copies one per-process,
freshly initialized reference workspace instead of initializing an
embedded Dolt schema per case, the same pristine-template pattern
internal/storage/embeddeddolt's tests already use (bd-7q32v).
//internal/httpclient:httpclient_served_test: 3,713 -> ~1,200
shard-seconds; 24 -> 16 shards; heaviest shard 390s -> ~108s.
- //internal/storage/embeddeddolt:embeddeddolt_embedded_test: re-measured
every test on rbe-west (scripts/ci/embedded_storage_test_durations.json)
and repacked 15 -> 20 shards (packed heaviest ~110s; was 352s in CI).
Test lane (bazel-test):
- //internal/httpclient:httpclient_test: unsharded (137-228s) -> 2 shards
(76s / 97s measured).
Bead: ga-vnycm2.3
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(dolt): seed the BatchGetter cap case without prefix validation
The dolt-server leg's shared test store is configured with prefix "test",
so the batch CreateIssues path's prefix validation refused the fixture's
bge-* ids (the per-row CreateIssue the other seeds use does not validate).
Bead: ga-vnycm2.3
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): shard //internal/storage/embeddeddolt:embeddeddolt_test 9 ways
At 8 round-robin shards one shard drew the package's three heaviest tests
(153s on rbe-west in this PR's test lane); 9 spreads them.
Bead: ga-vnycm2.3
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): pin the slowest cmd/bd Dolt-server tests to their own shards
The cmd-dolt lane's wall time when its tests re-run is the bd_test race
compile plus its slowest shard. rules_go shards round-robin by test index,
so whichever shard drew TestSharedServerConcurrent and the TestInit*
family ran 117-170s while the median shard ran ~55s.
tools/bazel/go_test_pinned_shard.sh runs a go_test binary with the tests a
committed manifest pins (measured >= 5s, bin-packed longest-first by
tools/bazel/pin_shards.py) in shards of their own, and every other test in
the binary's own round-robin shards with the pinned set skipped, so each
test still runs exactly once and new tests need no manifest edit.
bd_dolt_server_test goes from 16 to 32 shards (16 pinned + 16 round-robin),
regression_test from 8 to 16 (10 + 6; its go_test becomes the manual
regression_suite binary behind an sh_test of the old name).
Pinning exposed a pre-existing order dependence: TestCLI_Import failed
whenever it was the binary's first test, because runBDInProcess reused the
workspace discovery an earlier in-process execution cached and `bd init` in
a fresh directory resolved the previous one's .beads. The in-process
runners now reset beads/git discovery caches per execution.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): pin cmd/bd Dolt-server shards from two measured runs; regression in 14 shards
The bd manifest now takes each test's slowest of the 16- and 32-shard runs
(pin_shards.py over both), and regression_test drops to 10 pinned + 4
round-robin shards: its unpinned tests total ~128s, so 6 round-robin
shards were mostly fixed cost.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(scripts): place the pinned-shard tests by what they read (#7414 split)
The manifest-name scan reads every cmd/bd and tests/regression _test.go
file, so it moves to go_test_sources_test (with tests/regression's
manifest); the wrapper, generator and wiring checks stay in scripts_test.
Shared helpers live in a helpers-only file both targets compile, and
repoFiles takes #7414's minimum-file count.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files
//scripts:scripts_test declared //:repo_files (the whole checkout), so every
PR re-ran it, and it took ~181s on rbe-west. Most of that (60-79s) was
TestBazelGatedLanesNeverRetryFlakyTests line-regexping the --run_under
wrapper's pinned dolt binary (tools/bazel/hermetic_bin/dolt, in every
test's runfiles); it now skips binary files, as git grep -I does.
tools/bazel/go_srcs.py's per-package repo_files block now partitions each
package's files into repo_go_srcs, repo_go_test_srcs, repo_doc_files and
repo_other_files, aggregated at the root; //:repo_files is their union
(same 4679 files). The //scripts tests are split into go_test targets by
what they read (traced per test with strace over a runfiles-shaped tree):
scripts_test CI/Bazel policy: //:repo_other_files (+1 Go file)
shell_scripts_test script fixtures: //scripts files, a few root files
go_test_sources_test _test.go scans: //:repo_go_test_srcs + shard files
go_sources_test check-testing-short.sh: every .go file
tracked_files_test every tracked file: //:repo_files
Shared helpers move to helpers-only files; TestScriptsTestTargetsPartition-
TheTests fails on a test file in no target or in two. //test/docsync and
the //scripts/repochecks slices declare partitions or single files instead
of //:repo_files where they can.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): skip only the non-checkout hermetic_bin dir in the flaky-retry walk
Skipping every binary file also stopped scanning tracked binaries (images,
.binpb fixtures). Skip just tools/bazel/hermetic_bin, the --run_under
wrapper's runfiles directory, which is not in the checkout, so the walk's
coverage of tracked files is unchanged.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(httpclient): carry DepAddItem.HasSpawner/ThreadID over the wire
The http leg's batchApply wire shape dropped a dep_add item's HasSpawner
and ThreadID fields -- an edit the caller believed landed. Extend the
wire body (ApplyDepAddItem.has_spawner/thread_id), gate sending either
field on a new additive behavior capability
(issues.batchApply.depAddLineage / CapBatchApplyDepAddLineage) so a
client refuses locally before dialing an older server instead of
silently dropping graph lineage, and wire the storage-layer spawner-id
stamping (StampWaitsForSpawnerID) through both the dolt and uow legs
that already had the fields but never stamped them. wire_revision and
min_client are unchanged; the golden digest and openapi spec are
regenerated.
Also fixes three generic bijection/vocabulary gates this change was
missing: write_ledger_test.go's applyBatch/item/dep_add carriage table,
and the literal behaviorCapabilities lists in
internal/httpapi/server_test.go and
internal/httpclient/wire/vocabulary_test.go.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(httpclient/wire): pin the item-count gate at 356 items
Add TestApplyBatchAt356ItemsWithoutTheCapabilityRefusesBeforeDialing,
exercising internal/storage/batchfixtures.Shape356's exact item count
-- the design's primary measured large-batch-apply shape -- rather than
only the floor+1/ceiling+1 boundaries the existing cases pin. The gate
is content-agnostic (it never looks past len(body.Items)), so a
synthetic plan here is behaviorally identical to a real Shape356 plan
for this one check; realistic-content coverage follows in the next
commit.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(httpclient): prove a 356-item Shape356 plan commits atomically or leaves zero rows
Add two tests against the real served stack using
batchfixtures.Shape356's realistic, heterogeneous content (102 creates,
136 blocks edges, 102 tracks-to-root edges, 16 assign updates):
- TestServedBatchApplyShape356CommitsAtomically applies the full plan
once and verifies every create landed with a bound key, matching the
issues table row-for-row.
- TestServedBatchApplyShape356PlusAStaleGuardLeavesZeroRows appends a
357th item guarding the pre-existing root issue with a deliberately
stale ExpectedVersion. Because the root is untouched by the other 356
items, this exercises the real server-side precondition_failed round
trip (rather than the static same-request-row ErrValidation rule),
asserting errors.Is(err, issueops.ErrVersionMismatch) and that none of
the 356 creates landed -- the "never chunk" ceiling: an all-or-nothing
request that fails on its last item must leave nothing behind.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(httpclient): close S5 review HIGH findings (lineage gate, thread_id, gc mappings)
2026-10 Opus review on the S5 batch-apply slice found the wire change
correct but coverage missing:
- HIGH-1: refuseUnservedDepAddLineage (batchapplier.go) had no coverage
at all -- deleting it passed every existing test. Add a test pinning
that HasSpawner or ThreadID on a server without
issues.batchApply.depAddLineage refuses *storage.ErrUnsupported
before dialing, and that a plan touching neither field still dials.
- HIGH-2: thread_id was never asserted end to end. Add
RunBatchApplyCarriesThreadIDOntoTheStoredEdge to the shared
conformance package, wire it onto the dolt, embeddeddolt and uow
legs, and add the http leg's own case
(TestServedBatchApplyCarriesThreadIDOntoTheStoredEdge), which is the
one case that proves the field survives both the client's encode and
the server's decode at once.
- HIGH-3: DESIGN Sec 3.8 ("Guarded writes: no new roles") documents two
gc mappings onto BatchApplier that had no coverage: an update carrying
a metadata patch plus ExpectedVersion followed by a close in one
request (CloseWithMetadataIfMatch, atomic -- a stale version leaves
zero changes), and a keyed create/MetadataRefs/dep_add
(parent-child included)/trailing-update plan (ApplyGraphPlan). Document
both compositions on the BatchApplier interface and add http-leg tests
for each.
Mutation-verified: removing the lineage gate call, dropping thread_id on
the client's encode, and dropping it on the server's decode each now
fail a test that previously passed unconditionally.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): nil-guard snapshot consumers, fix spec wording, sync Bazel
2026-10 Opus review MED/LOW findings on the S5 batch-apply slice:
- LOW-6: Store.snapshot returns (nil, nil) when a Store has neither a
wire nor a cached handshake. Store.Counter() does not call roleWire
first (unlike Sweeper/BatchApplier), so this is reachable through the
ordinary public accessor and a scoped count would panic on
snap.Capabilities. Nil-guard every snapshot() consumer
(batchapplier.go, counter.go, sweeper.go) so a nil snapshot is treated
as "nothing advertised" and falls through to the capability refusal.
Add TestCounterRefusesScopeGracefullyWithNoTransportAndNoSnapshot,
mutation-verified to panic without the guard.
- LOW-7: the ApplyDepAddItem spec comment said an old server would
"silently ignore" has_spawner/thread_id; it answers its own 400 for
an unknown member. Fix the wording and regenerate apigen/types.gen.go.
- MED-4: internal/httpclient/BUILD.bazel was missing
served_batch_apply_large_test.go, expected_revision_contract_test.go,
served_dualwrite_history_test.go and the
//internal/storage/batchfixtures dep. Sync with gazelle (confirmed
idempotent) and go_srcs.py --check.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(storage): carry thread_id on a same-type dep re-add; bound batch thread_id
A same-type re-add of an existing dependency compared and rewrote only
metadata, so on both write legs (issueops.addDependencyInTx and the uow
dependency repository) a re-add naming a new ThreadID was read as
change-free and the thread was dropped, and a metadata-plus-thread re-add
stored the metadata without the thread. Both arms now read the stored
thread_id through one shared rule, issueops.ReAddedDependencyThread: a
named thread the row does not carry is a change (UPDATE, replacement-edge
journal entry, exactly one version, #5898 leg 2), and a re-add naming no
thread keeps the stored one, so callers that never carry a thread cannot
erase it. The journal's EventDep has no thread member, so a thread-only
re-add journals the same payload as the original add; the source's version
snapshot is what records the new thread, and the comments on both arms now
say so instead of promising a complete replacement edge.
planApplyBatchDepAdd bounds DepAddItem.ThreadID with CheckFieldLen, so an
over-long thread id is ErrValidation before any database work on every
leg, as the http leg's decode already refuses it, instead of an opaque
mid-transaction "string too long" on the local legs. Only the length bound
is shared: the http leg's control-character refusal stays http-only.
The HasSpawner/ThreadID docs now name the producer that actually sets
HasSpawner (an embedder lowering a graph plan, e.g. gc's ApplyGraphPlan
mapping) instead of bd create --graph, and drop the CHANGELOG reference
that had no entry behind it.
New conformance cases, wired on dolt, embeddeddolt, uow and served:
RunBatchApplyCarriesThreadIDOntoAnExistingEdge,
RunBatchApplyRefusesAThreadIDLongerThanItsColumn and
RunDependencyEditorSameTypeReAddWithChangedThreadMintsOneVersion.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Gas City Adopt-PR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(shards): add the re-add thread test to the embedded storage shard manifest
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: trigger the first PR CI run now that the base is main
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(httpclient): gate has_spawner to waits-for edges; refuse empty thread_id
Review iteration 1 fix-up for #7265 (synthesis F1, F2, F4, F5, F6, F7).
F2: the client's CapBatchApplyDepAddLineage gate refused HasSpawner on
every edge type, but the role reads the flag on a waits-for edge only
(StampWaitsForSpawnerID is a no-op off one). An embedder plan setting it
on, say, a blocks edge works against every existing server, yet this
client refused it during a mixed-version rollout. depAddNamesSpawner now
holds the role's own rule: the flag is gated and encoded on a waits-for
edge only, and dropped elsewhere, which loses nothing the role would
store. ThreadID stays gated on every edge type, since a thread is stored
on all of them. The "spawner flag on any other edge type" subtest is
restored to an unadvertising server and now also asserts the flag is
dropped from the body, and
TestApplyBatchRefusesUnservedDepAddLineageBeforeDialing gains a
ThreadID-on-blocks case. The W-DepAddItem.HasSpawner ledger row and the
regenerated engdocs/design/http-divergence-ledger.md say the same.
F5: the document gives thread_id minLength: 1, but the decoder read an
empty string as no thread. applyDepAddItem now refuses a present, empty
thread_id with 400 invalid_value naming items[i].dep_add.thread_id, as
it does an empty type; an absent one still names no thread. New
TestApplyBatchRefusesAnEmptyThreadID; the documented-body test now
forwards has_spawner and thread_id as well.
F1: bd create --graph does set HasSpawner (buildGraphApplyBatchRequest,
on the embedded and proxied legs, since #7209), so the DepAddItem doc
names both producers again and the conformance doc's CHANGELOG pointer
is restored; the [Unreleased] entry behind it is on the base.
F4: the CapBatchApplyDepAddLineage comment said an older server would
silently drop the members; it answers either one with
400 invalid_argument/unknown_parameter.
F6: the create-edge ledger comment said no operation publishes a thread
member; batch apply's dep_add item now does.
F7: TestServedBatchApplyGcApplyGraphPlan adds a waits-for item carrying
HasSpawner and ThreadID and reads the stored row back, pinning
metadata.spawner_id to the resolved spawner and the thread on the
served leg.
F3 (the journal's EventDep carries no thread member) is not addressed
here.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Gas City Adopt-PR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Eddie the Engineer <adopt-pr@gascity.com>
* feat(httpclient): wire the S4 Sweeper extension (wisps-plane, live-dependent protection, limit)
Publish SweepRequest.ProtectLiveDependents and .Limit (plus a
wisps-plane tier and SweepResult.Remaining/.LiveDependent) on the v0
wire behind three new behavior-capability tokens
(issues.sweep.wispsPlane, issues.sweep.liveDependents,
issues.sweep.limit), and wire the client to send them once the
handshake advertises the tokens (refuseUnservedSweep otherwise).
Retire the two W-SweepRequest ledger rows that previously refused
these fields for lack of a wire member.
CurrentWireRevision stays at 2. A new wisps-plane SweepRequest.Tier
value is a request-only enum widening: it cannot cause an older
client to misdecode a response, and it is already gated by its own
capability token, so it is additive rather than a wire break. Teach
wireshape's drift gate that distinction directly: a Digest.Sides side
channel records whether each schema member is request-only,
response-only or both, and widensAdditively now treats a request-only
enum's new value as additive while still treating any response-side
widening as breaking, with tests pinning both directions and a
regenerated golden.json. min_client_wire_revision stays 0.
internal/httpapi/apigen/types.gen.go and openapi.v0.yaml's comments are
regenerated/updated to match (make api-gen).
Six served Sweeper contracts that were parked now run for real against
the in-process HTTP server; TestSweepSendsTheS4MembersOnceTheServerAdvertisesThem
pins the capability-gated encode.
Re-review fix: walk()'s side classification short-circuited on a
name-only visited set, so a node already walked from one side never
had its CHILDREN walked again when a later path promoted the parent
to "both" — children stayed classified under whichever side reached
them first, order-dependent on Go's map iteration. Side recursion is
now guarded per (schema, side) pair (sideWalked, keyed on
name+"\x00"+side) instead of per schema name alone, so a child
reachable from both sides is always walked, and therefore recorded,
from both. Added TestSidePropagatesToNestedChildren (a named grandchild
and an inline nested child both reachable from a request body and,
via a wrapper, a response, assert "both" on every level and that
widening either enum breaks instead of being classed additive),
TestEnumWideningOnSharedNestedChildIsNotAdditive, and
TestComputeFromSideAssignmentIsDeterministic (200 runs, asserts
identical Sides/Entries every time). golden.json is confirmed
unchanged by the fix (regenerated and diffed byte-for-byte). Also
removes a bd-enterprise mention introduced in this slice's own
write_ledger_test.go comment (not a provenance header) in favor of
neutral wording.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(storage): ratchet the http leg's role-contract ceiling to zero
Classify all 42 previously-ceilinged http-leg entrypoints and clear
the ceiling:
- ExpectedRevision + Refusal (10): wire a Phase-0 all-nil fixture,
matching every other backend's current (unbuilt-CAS-feature) state.
Said honestly: these ten entrypoints are counted here, the hook is
unbuilt on every leg (not just this one), and every case runs zero
assertions until a CompareAndSetVersion wire operation exists for
this client to bind.
- Lifecycle ExpectedVersion concurrency (4): wire the two races that
land on Priority/Notes and on Close for real over the served HTTP
harness (precondition_failed decodes to storage.ErrVersionMismatch
via errors.Is, same as the local legs). The other two, which race
IssuePatch.SpecID/.AwaitID/.Owner edits against updateIssue, stay
waived, but PENDING rather than permanent: IssuePatchBody refuses
those three fields outright (W-IssuePatch.SpecID/.AwaitID/.Owner,
D8 refuse-not-drop) rather than ever sending them, so the race never
reaches the wire today. Closing the gap means publishing those
fields on the wire, tracked as a follow-up slice, S4b: publish
owner/spec_id/await_id on the wire.
- DualWrite (6): wired for real instead of waived. Mutate and
MutateAsNoOp drive the client's Lifecycle role (Create/Update)
against an in-process served harness with its own reference store,
so VersionedHistoryConfigurer can be toggled per fixture;
CurrentRevision, VersionRowCount and LatestVersionAttribution read
the reference store's raw columns the same way every other served
fixture's postcondition hooks do. All six FR-1/FR-2/FR-3/FR-5/FR-7
cases (one version row per accepted mutation, no-op skip, atomic
attribution, current_revision parity, and flag-off producing no
rows) now run and pass.
- VersionReconciler + InitVerifier (13), and the raw
IssueOperationsUpdate seam (3): waived — unservable over a typed
HTTP role boundary, not a wiring gap.
adoptionCeiling: 42 -> 0 for the http leg; the "adopting" field is
removed (a zero ceiling with a reason is a registry error) since every
remaining gap is now a named waiver, PENDING or permanent as stated
above, instead of a budgeted unnamed one. Also deletes the scratch
zzz_dump_missing_test.go used to enumerate the ceiling during triage.
Re-review fix: the shared conformance attribution case only asserts
change_actor is non-empty (it runs across every leg, each with a
different literal Mutate actor). The http fixture's own Mutate always
sends Actor: "writer", so this leg's AttributionIsRecordedWithTheMutation
subtest now also mutates a second, independent issue and asserts the
recorded actor equals exactly "writer", in addition to the shared
non-empty check.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(types): make ParseRevisionToken the exact inverse of FormatInt
ParseRevisionToken's doc comment already promised it accepts exactly
what RevisionToken emits, but strconv.ParseInt alone is looser than
that: besides a leading "+" that FormatInt never produces, it also
accepts a leading zero on a digit string longer than one character
("007") and the literal "-0" — none of which FormatInt ever emits
(FormatInt(0, 10) is always "0", never "-0", and it never pads a
digit run). A caller is only ever supposed to echo a token a response
carried, so any of these is a client that invented a value rather
than a server this client should follow; reject them explicitly
instead of accepting them silently.
Pins the string<->int64 boundary with
TestParseRevisionTokenRejectsMalformedTokens, covering empty strings,
fractional/exponent spellings, leading "+", surrounding whitespace,
non-decimal bases, one-past-int64-boundary values, non-ASCII digits,
and now "007", "-007" and "-0".
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fixup(wireshape): guard widensAdditively against "no enum before"
bee-ghosttrack / CHANGES_REQUESTED on #7251: widensAdditively required
len(new.Enum) > len(old.Enum), which holds vacuously when the old side
has no enum at all (a free `type: string`). That let a request-only
member go from unconstrained to a fixed enum at the same wire_revision
-- the opposite of widening, since the server now 400s a value an old
client could send yesterday.
Add the guard `len(old.Enum) == 0 || len(new.Enum) <= len(old.Enum) ->
false` so the no-enum-before case falls through to the ordinary
non-additive Changed path, same as a strict narrowing. Add a pinning
case to TestEnumWideningAdditivity and extend the doc comment.
Also reword the ExpectedRevision contract file comment from "runs ZERO
assertions" to "SKIPS", per the reviewer's note that the Run* helpers
t.Skip when CompareAndSetVersion is nil -- it's a skip, not an
assertion-free run.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(httpclient): regenerate the divergence ledger after rebasing onto #7247's review fixes
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(httpclient): Sweep Limit now refuses on the missing issues.sweep.limit capability
#7247's review round pinned Sweep{Limit} as an encoder refusal. With S4 the
wire carries limit behind issues.sweep.limit, so against a server without
the token the refusal is a pre-dial capability refusal: still
*storage.ErrUnsupported for this backend, now naming the capability.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(httpapi,httpclient): name the invalid_value refusal; add tests to Bazel
Maintainer fixup for the review of #7251 (iteration 1). There are no blocker or
major findings. This applies the three optional findings that both reviewers
reported.
- Eight comment and description sites added by this PR say that an older
server refuses an unpublished `tier` (or S4) member with `unknown_value`.
No such reason exists. The server refuses with ReasonInvalidValue =
"invalid_value" (internal/httpapi/problem.go), and sweep.go uses it for a
bad tier. The sites are in openapi.v0.yaml, apigen/types.gen.go (regenerated
by `make api-gen`), routes.go, sweeper.go and wire/handshake.go. The base has
none of them, so this only corrects the PR's own text. A client author now
matches the token the server actually sends.
- wire/handshake.go said the tier member carries no ledger row because it
"narrows" an existing enum. Adding a value widens the accepted set, so the
word is now "widens".
- internal/httpclient/BUILD.bazel: add expected_revision_contract_test.go and
served_dualwrite_history_test.go to the httpclient_test srcs. Both files are
new in this PR. Without the entries, `go test` runs them but no Bazel lane
compiles them. The srcs list now matches the package's files, and the
existing deps already cover their imports.
Provenance: this is the residue of the stranded fixup cad1cf02a2 from the
previous adoption of this PR, replayed onto the current head. Its patch-id
(b62e7d6d5562) is identical to that reviewed residue. That fixup's
widensAdditively guard and SKIP-message nit are not repeated here. The author
already landed both in b3f1516e55 (d41f317e0a after the rebase).
Validation: git diff --check; make api-gen (no-op) and make api-check;
go build, go vet and gofmt on internal/httpapi/... and internal/httpclient/...;
go test for internal/httpclient/wire, internal/httpclient/encode and
test/docsync; the httpclient Sweep* and TestExpectedRevisionContract tests; the
served dual-write tests with BEADS_TEST_EMBEDDED_DOLT=1; and
tools/bazel/go_srcs.py --check.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(httpclient): regenerate the divergence ledger on main after #7247 merged
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(httpclient): give encode_test the httpclient tests its pin check reads
Maintainer fixup for the pre-review CI of #7251. Bazel / test and
Bazel / integration (PR run 37781419956) each fail one target,
//internal/httpclient/encode:encode_test, which also fails CI Gate / Required.
TestLedgerRowsAreWellFormed reports that rows W-SweepRequest.ProtectLiveDependents
and W-SweepRequest.Limit are pinned by
TestSweepSendsTheS4MembersOnceTheServerAdvertisesThem, which is "neither a test
in this package nor a TODO(<bead>)".
The pin is right. The test lives in internal/httpclient/bulk_roles_test.go.
testFunctionsInThisPackage collects test names from ".", ".." and
../../../cmd/bd, but the data of encode_test declares only its own sources,
//cmd/bd:go_srcs, the ledger doc and the OpenAPI spec. Under Bazel, ".."
exists in the runfiles but holds no _test.go files, so the walk silently finds
nothing there. go test reads the real directory and passes. This PR changes
neither the walk nor the BUILD file. Every pin on main resolves from this
package or cmd/bd, which is why main is green. These two rows are the only ones
pinned to a test that exists only in internal/httpclient. The red stayed hidden
until now because the PR sat on a stacked base. PR CI, including the Bazel
lanes, runs only for PRs against main, release/** and hotfix/**.
Declare //internal/httpclient:go_srcs as data, so Bazel sees the files that
go test reads. The filegroup already exists with //:__subpackages__ visibility.
The pins stay on the test that actually covers the S4 members.
Validation: bazel test //internal/httpclient/encode:encode_test --config=ci
--nocache_test_results, run two ways. In the local processwrapper sandbox
(--remote_executor= --strategy=TestRunner=processwrapper-sandbox) the same
command fails both rows without this change and passes with it. It also passes
on the remote executor. Plus tools/bazel/go_srcs.py --check, gazelle
-mode=diff on the package (no change), git diff --check, and
go test ./internal/httpclient/encode/.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(httpapi): pin the S4 sweep members at the wire edge, gate golden sides
The `sides` map this change adds to golden.json predates schemas main gained
since (#7248's BatchGetIssue*, BatchGetIssuesRequest* and
BatchGetIssuesResult*, plus IssueDetails.gated_by[]), so the rebase left it 9
schemas short of what gendigest writes, and goldenDrift never compared Sides,
so nothing noticed. Regenerated (+9 sides lines, no entry changes), and
goldenDrift now fails with the regenerate instruction when the golden's sides
disagree with a fresh digest; TestGoldenDrift drives that arm three ways.
The SweepSkips description still called the first two buckets protections
and the last four defenses, which filed the new live_dependent protection
under the defenses. It now names pinned, referenced and live_dependent as the
protections (apigen regenerated: the two comment copies only), and
handleSweep's comment counts eight members.
internal/httpapi's sweep pins stopped at the original six members: nothing
there sent protect_live_dependents or limit, refused a mistyped one, or read
live_dependent or remaining back. The forward, refuse and publish tests now
cover all four, and TestSweepResponseCarriesEveryRoleField, named by
sweepResponse's comment but never written, counts both projection levels and
requires every wire field populated from a fully set role result.
The httpclient Sweep defer comment described ProtectLiveDependents/Limit
refusal paths this change replaced with capability gates; it now says why
the pass-through defer stays.
Validation: go test ./internal/httpapi/... ./internal/httpclient/... (CGO,
gms_pure_go), the served sweeper tier with BEADS_TEST_EMBEDDED_DOLT=1 (19/19
pass, none skipped), make api-check, go vet, git diff --check, and bazel test
--config=ci on httpapi_test, wireshape/..., httpclient_test, encode_test and
types_gen_drift_test. Mutants, each restored: disabling the sides arm reds
three TestGoldenDrift arms; the pre-fix golden reds TestWireShapeDigest
naming the 9 schemas; dropping the live_dependent or remaining projection,
the protect_live_dependents decode, or the limit assignment each reds its
new pin.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* feat(httpclient): lift the HTTP client store and roles from bd-enterprise (MIT contribution)
Contributed by gascity from bd-enterprise (github.com/gascity/bd-enterprise,
internal/enterprise/httpstore @ 49d1df2f6) to OSS beads under the MIT
license, with the owner's explicit approval. Every lifted file carries a
provenance header naming its source path.
Lifted into internal/httpclient: the Store (DoltStorage over the wire), the
dial/register glue, the read roles (reader, querier, counters, edges,
relations, graph, tree, cycles, stats, config, memories, journal), the write
roles (lifecycle, claimer, releaser, deleter, dependency editor, metadata
CAS, commenter, batch closer/creator/applier, ready claimer, sweeper), and
their tests. The store transport seam (WireClient/WireDialer) and the
store-dependent tests deferred from the S2 lift are restored here.
Not lifted: the hosted gateway (httpgw/gwauth), box-login, storage profiles
and gasworks. dial.go only mentions the gateway in comments.
This commit is the mechanical lift and does NOT build yet. It references
enterprise-only APIs absent from OSS: issueops.ReadyLister,
journalops.Watcher, storage.ServerEnforcedPolicy, the
NonCommitGraphBackend/RemoteWorkspaceBackend markers, DoltStorage
differences, and BatchCloseRequest.claim_next. The following commits
reconcile it with OSS (S3/S4/S5).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(httpclient): reconcile the bd-enterprise lift's compile-time API surface against OSS
The mechanical lift (02a9dad17) carried several bd-enterprise-only shapes
that do not exist in OSS beads:
- ReadyLister, journalops.Watcher/StreamWire, and ServerEnforcedPolicy have
no OSS wire counterpart; drop the role, its served/journal-watch tests,
and the policy enforcement path entirely rather than leave dead code that
cannot compile against OSS's apigen types.
- claim_hook_gate_test.go exercised a hook surface OSS does not publish.
- recordingWire/fakeWire no longer embed a StreamWire double now that no
read role can reach a watch stream; testTarget's two conflicting
package-scope declarations (store_test.go and helpers_test.go) are split
apart as pinnedProjectTarget vs. the generic helper.
- unsupported_gen.go is regenerated from scratch against OSS's actual
storage.DoltStorage via a new, from-scratch reflection-based generator
(internal/storage/unsupportedgen) rather than hand-copied from
bd-enterprise's generated output; completeness_test.go's
legitimatelyUnsupported map grows the handful of OSS-only or
previously-missed methods (AddRemoteWithRef, RenameLabel, etc.) this
regeneration surfaces.
- write_ledger_test.go and the divergence ledger doc gain the
force_notes_overwrite and claim pending rows OSS's apigen.UpdateRequest
and SweepRequest actually carry, and drop the Remaining/LiveDependent
assertions SweepResult/SweepSkips have no wire member to ever populate.
go build ./... and go vet ./... are clean after this change. No behavior
beyond the removed surfaces changes here; read-role and write-role
reconciliation land in follow-up commits.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): stop sending listIssues a reverse/sort vocabulary OSS does not publish
The bd-enterprise lift's sortedPage pushdown assumed GET /v0/beads/issues
(listIssues) shared the same sort vocabulary and a reverse parameter with
GET /v0/beads/issues:query (handleQueryIssues) -- a different operation.
OSS's openapi.v0.yaml publishes listIssues a CLOSED two-value `sort` enum
(created, priority; deliberately smaller than the nine values :query
takes) and no `reverse` parameter at all. Sending either would earn an
unknown-parameter or invalid_value refusal from the real server, not a
silently-wrong answer -- which is why this only surfaces against a served
backend, not a Go-side unit test of the request builder.
Add listSortPushdownEligible to gate the pushdown fast path to the two
keyset orders listIssues can actually page, unconditionally refusing any
reversed request (listIssues has no parameter that names a reversed
direction, so a reversed request of any order walks and sorts
client-side). Drop the unconditional `reverse` send from sortedPage.
served_list_test.go's three affected cases encoded the wrong,
enterprise-only wire shape (expecting reverse=false on the fallback path,
expecting a reversed order to push down with sort+reverse, and expecting a
Go-side/SQL-side mix in listIssues' sort enum); corrected to match OSS's
actual, provable wire contract rather than left red. list_sort_test.go's
publishedParamEnum helper now reads the OpenAPI document via the
go:embed'd spec.OpenAPIV0() accessor instead of a relative os.ReadFile, so
it no longer depends on the test's working directory (this also fixes the
same test failing under Bazel's sandbox, which does not expose arbitrary
relative-path files).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): reconcile write-role tests against OSS's BatchClose/Update shapes
OSS's apigen.BatchCloseRequest and BatchCloseResponse publish no
claim_next/claimed_next member at all (ledger row
W-CloseBatchRequest.ClaimNext) -- bd-enterprise's claim-folded-into-close
shape has no OSS wire counterpart. Replace the three tests that exercised
decoding a served claim (TestBatchCloseRefusesAServedClaimCarryingNoIssue,
TestBatchCloseRefusesAServedClaimTheRequestNeverEarned,
TestBatchCloseKeepsTheClaimItEarned) with
TestBatchCloseRefusesClaimNextUnconditionally, which pins the actual OSS
behavior: a CloseBatchRequest naming ClaimNext refuses before any dial, on
both the unserved and served legs, regardless of what a server would
otherwise answer. Drop the now-dead "claim-next" case and helper claim
variable from TestBatchCloseServesTheSingleItemShapeAndRefusesTheRest.
Also:
- Add the ForceNotesOverwrite case to
TestUpdateRefusesEveryMemberTheWireExcludes's hand-maintained member
map -- a ledgered-pending UpdateRequest member (see
W-UpdateRequest.ForceNotesOverwrite) the lift's test left uncovered.
- Remove write_roles_test.go's duplicate `ptr[T]` generic helper, which
redeclared the one already in helpers_test.go and never compiled.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(conformance): pin post-write RowVersion propagation across Update/Close/Reopen
types.Issue.RowVersion is json:"-", so an implementation that forgot to
populate it on the way back from storage would still compile and still
pass every existing content assertion in lifecycle_close_reopen_contract.go
-- none of them read RowVersion. Add
RunLifecycleResultsCarryThePostWriteRowVersion, which chains each write's
result token into the next write's ExpectedVersion (Update -> Close ->
Reopen) with no intervening read, so a dropped or stale token fails closed
on the next write's optimistic-concurrency guard rather than passing
silently.
Register it in role_bundle_cases.go's roleContractCases dispatch table at
its declaration-order position -- TestRoleContractCasesCoverEveryContractCase
was failing because the function existed with no dispatcher entry.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* chore(bazel): sync BUILD files via gazelle for the S3 reconciliation
bazel run //:gazelle after the compile/read-role/write-role reconciliation
commits:
- internal/httpclient/BUILD.bazel: regenerate srcs/deps for the files
added, removed and newly imported above (drops the deleted
policy/journal-watch/readylister files, adds the spec dep for
list_sort_test.go's embedded OpenAPI read). Manually add
`data = glob(["*.go"])` to the go_test rule, matching the idiom already
used by //internal/httpclient/encode: completeness_test.go and
divergence_citation_gate_test.go read their own package's .go sources at
runtime (a regex scan of unsupported_gen.go and an AST walk of the
package directory), and Bazel's go_test sandbox only copies in files a
rule declares as `data` -- `srcs` are compiled away, not left readable.
A `# keep` directive protects the attribute across future gazelle runs
(confirmed gazelle does not manage `data` on this rule).
- internal/storage/BUILD.bazel,
internal/storage/unsupportedgen/BUILD.bazel: pick up the new
from-scratch unsupportedgen generator package.
bazel test //internal/httpclient/... //backend/conformance/... now passes
all 4 targets (previously 4 of the package's tests failed only under
Bazel's sandbox: TestInterfaceCompleteness,
TestTheCountGroupVocabularyMatchesTheSharedOne,
TestFlaglessListSortIsTheSameOrderNamed,
TestDivergenceParkCitationsResolveToLiveLedgerRows).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(conformance): close two pre-existing leg-wiring gaps found while registering http
- RunLifecycleResultsCarryThePostWriteRowVersion (added in 536561124) was
never wired into dolt/embeddeddolt/uow's own lifecycle_close_reopen test
tables, only into the http leg's. TestEveryLegWiresEveryRoleContract
catches this once a fourth leg forces the test to actually run again;
wire the missing t.Run into all three.
- The three StatsReporter "suppressed rows" cases (GateIssues/TemplateIssues
breakdown) were never added to served_graph_aux_test.go even though the
wire already carries both fields end-to-end (types.Statistics is shared
verbatim by apigen.StatsResponse and the client's decode). Wire them; all
three pass over HTTP with no server or client change needed.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* feat(conformance): register the http leg in the role-contract lock
Registers "http" (wiringRoot internal/httpclient) in contractLegRegistry.
The served-surface harness (served_harness_test.go + 16 served_*_test.go
files) already wired 495 of 576 role-contract entrypoints from the
bd-enterprise lift; this change:
- Waives the 3 RunCycleDetectorIncludeTracks* cases: issueops.
DetectCyclesRequest.IncludeTracks has no plumbing on either side of the
wire today (cycles.go always calls DetectCycles with a zero-value
request; the client's DetectCycles ignores its request parameter). No
slice through S13 adds one, so the waiver says a new slice is needed
rather than pointing at an existing one.
- Sets adoptionCeiling: 75 for the remaining, not-yet-wired write-role and
internal-plumbing entrypoints (lifecycle writes, DependencyEditor,
MetadataCAS, Lease, Sweeper, VersionReconciler, Bootstrapper/
InitVerifier, cross-record invariants) that S4 and later write slices
pick up and ratchet down.
- Adds //internal/httpclient:go_srcs to storage_test's data: the leg's
wiring root lives outside internal/storage, and the Bazel sandbox has no
other reason to materialize those sources for a test that reads them at
runtime.
TestEveryLegWiresEveryRoleContract, TestEveryRoleMethodHasAContractCase,
and RunUnsupportedContract (already wired pre-lift in
internal/httpclient/completeness_test.go) all pass for the http leg.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): close review's HIGH 2-5 gaps and reconcile their test doubles
HIGH 2 (BatchCloser), HIGH 3 (created_by stamping, absent-parent 404/400,
force_notes_overwrite carriage) and HIGH 4 (CapabilityError now unwraps to a
typed *storage.ErrUnsupported with Capability) were implemented in prior
commits on this branch; this change finishes HIGH 5 and the verification the
review asked for:
- role_reader.go's Reader.Get and bridge.go's raw GetIssue both now stitch
Revision back onto Issue.RowVersion via parseRevision, so a guarded write
built off either read carries the row's real token instead of a decoded
zero. Both are pinned by round-trip served tests that guard a write with
the read's token and require a stale-token replay to refuse.
- Fixed create_test.go's stale assertion that created_by must stay empty
(contradicted the HIGH 3 stamping fix it predated).
- Fixed recordingWire's canned IssueDetails{} response (roles_test.go): it
omitted Revision, which is a required field on every getIssue response
per the OpenAPI spec, and the HIGH 5 stitch now reads it unconditionally.
- Synced internal/httpclient/wire/BUILD.bazel via gazelle: handshake_test.go's
new internal/storage import had no corresponding dep.
- gofmt'd write_roles_test.go's stubWire struct tags.
Verified: served HTTP conformance tier (BEADS_TEST_EMBEDDED_DOLT=1
BEADS_HTTP_TEST_REQUIRED=1 go test ./internal/httpclient/, -timeout=40m)
600 PASS / 0 FAIL / 72 SKIP (all ledgered known-divergence waivers). One
TLS-handshake-timing test failed in that run and passed 3/3 in isolation
(unrelated file, pre-existing flake under machine load, not reproducible).
Also green: default go test (minus the pre-existing, unrelated
TestEngdocsAndRootMarkdownLinks doc-link drift and the environmental
internal/storage/uow dolt-server-spawn hang), bazel build/test for the
touched packages, make api-check, and gofmt/vet.
Live-mutated and reverted 3 guards to confirm their tests are load-bearing:
role_reader.go's RowVersion stitch, bridge.go's RowVersion stitch, and
lifecycle.go's force_notes_overwrite wiring.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* feat(ci): add served HTTP conformance as Tier 3 of the conformance gate
The served tier (internal/httpclient's served_*_test.go corpus) never ran
in CI, so HIGH 2-5's regressions (and any future ones) would merge
undetected. Add it as Tier 3 of scripts/conformance.sh, the existing
required entrypoint conformance.yml already runs on every PR/push/merge_group
(not a new workflow, not wired through ci-gate.sh's aggregation -- this
repo's convention for this gate is a single standalone job):
CGO_ENABLED=1 BEADS_TEST_EMBEDDED_DOLT=1 BEADS_HTTP_TEST_REQUIRED=1 \
go test -timeout=40m ./internal/httpclient/
Left unsharded: Tier 1 and Tier 2 are themselves single unsharded
invocations, and Tier 3 is one Go package, not a multi-package corpus the
repo's existing package-sharding scripts apply to. No Bazel-lane addition:
bazel-coverage's embedded/dolt_server outputs only ever substitute for
main.yml/pr-risk.yml jobs, never for conformance.yml's own job, so there is
no existing Bazel-lane relationship for this gate to extend.
Bumped the job's timeout-minutes 45 -> 100 (30m + 10m + 40m budgeted
sub-timeouts plus checkout/setup-go overhead) and updated the three policy
tests that pin this script/workflow byte-for-byte
(TestConformanceScriptUsesExplicitTimeoutBudgets,
TestConformanceScriptPropagatesGoTestFailures,
TestConformanceWorkflowHasOuterTimeoutBudget), re-included
internal/httpclient/** in both path filters (push and pull_request, kept
identical) since served_*_test.go files are the suite itself and would
otherwise be excluded by the shared !**_test.go negation, and documented the
new filter entry in ci_f7c_advisory_test.go's own-entries map.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): root-cause and fix the Happy-Eyeballs TLS flake in store_dependent_test.go
TestTransportForSucceedsWithEnvCAFile (and 3 Handshake-based siblings that
assert on a successful dial through a configured CA: SidecarCAFile,
CAFileEnvAgreeingWithSidecarSucceeds, DialWithNilTransportHTTPClientGetsCAInjectedOnACopy)
flaked once with "tls: first record does not look like a TLS handshake".
Root cause: our code, same class S2 already fixed for TransportFor's direct
callers (forceIPv4Loopback in ca_test.go/ca_wrong_ca_test.go). Every server
these tests dial is addressed by hostname "localhost" (ca.startServer
rewrites it there deliberately, so SNI is actually sent), which Go's
default dialer races a tcp6 dial to ::1:<port> against the real tcp4 dial to
127.0.0.1:<port> for (RFC 6555). An unrelated local process already bound to
a colliding ephemeral port on ::1 can occasionally win that race before the
real dial completes, and the client speaks TLS to that unrelated process
instead -- the misleading handshake error, not a real hang or a product bug.
These four tests go through Handshake with DialOptions{} (HTTPClient left
nil deliberately, since that is itself the nil-HTTPClient branch of DialWith
under test), so they never get a *http.Transport back to mutate the way
forceIPv4Loopback's existing callers do. Fixed via warmIPv4OnlyCATransport:
pre-build the target's CA-scoped transport through the same public
TransportFor the product code itself calls (so it lands in the exact
(path, content)-keyed cache transportForFile's cache hit returns), force
tcp4-only on that cached pointer, and let Handshake's own DialWith run
unchanged -- same branch under test, same cached transport, no sleeps, no
retries. Verified with -race -count=50 on all four: 200/200 pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): refuse DetectCycles(IncludeTracks=true) instead of silently ignoring it
roles_graph.go's httpCycleDetector.DetectCycles took its request as `_`,
forwarding nothing: a caller asking for the widened (tracks-following) walk
silently got the narrower default walk back with no error. listDependencyCycles
has no include_tracks wire parameter at all, so there is no way to honor the
field — only to refuse it loudly or drop it silently. Switch to the typed,
ledger-cited refusal (encode.RefusedError via refuse(), citing new row
"L-cycles-tracks") that CountEdges' own wire bound already uses, add the
ledger row and its Op, regenerate the auto-generated ledger doc, and pin the
behavior with a unit test (no served-tier case needed: the refusal is
pre-dial by design, same reasoning as the existing edge-count bound pin).
Also fix leg_contract_wiring_test.go's cycleTracksWireGapWaiverReason, which
had gone stale: it described the http leg as silently forwarding nothing for
this field, which was true before this change and is not after. The waiver
itself (the three RunCycleDetectorIncludeTracks* contract cases stay unwired
for the http leg) is unaffected — they were never wired, and still are not —
only the reason text needed updating to describe a typed refusal instead of a
silent ignore.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(storage): name the http leg's permanent contract gaps instead of budgeting them
The http leg's role-contract adoption ceiling (internal/storage/contract_leg_registry_test.go)
sat at a flat 75, with a prose "adopting" note that bundled every skip into
one vague bucket — including MetadataCAS, which is in fact fully wired (0
missing cases), a false claim left over from an earlier wiring pass.
Twenty-six of the 75 skips are not S4-and-later work at all: they are
PERMANENT gaps that no future slice closes, because the contract itself has
no publicops role for an HTTP client to route through:
- Importer (4 cases): uow is Importer's one accessor, same precedent the
dolt and embeddeddolt legs already carry (importerOneAccessorWaiverReason).
- RetentionFixture/EpochFixture (15 cases) and CrossRecordInvariantFixture
(7 cases): both fixtures carry raw storage hooks (Resolve, Erase, Mint,
CurrentEpoch, GuardedWrite, EnforceCrossRecordInvariant, ...) with no
publicops field at all. dolt, embeddeddolt and uow wire these because
they ARE the storage engine this address/epoch/retention and
cross-record transaction bookkeeping belongs to; the http leg is a
remote client with none of its own to report. There is no wire surface
for this to ever route through short of a new role being designed from
scratch — a new slice, not a missing test line.
These 26 are now named, reasoned waivers in unwiredContractEntrypoints
(two new reason constants: retentionEpochNoRoleWaiverReason and
crossRecordInvariantNoRoleWaiverReason), and the ceiling drops from 75 to 49
to match. The "adopting" note is rewritten to correctly name every remaining
category under budget (lifecycle writes, DependencyEditor, DualWrite,
Sweeper, VersionReconciler, Bootstrapper/InitVerifier, ExpectedRevision/
Refusal) and to drop the false MetadataCAS claim.
Also documents, at conformanceEntrypointsWiredBy, why a leg wiring a
conformance.RunX reference with every hook left nil would read as "adopted"
by this lock's static source grep while actually running as a skip —
matching the loophole internal/httpclient's divergence_citation_gate_test.go
already closes for skipKnownDivergence call sites. No leg currently does
this (verified by inspection); the note sets the review expectation for
future wiring rather than papering over the gap with no record of the policy.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(licensing): scrub internal program/org naming and a leaked private ID from OSS-visible text
MEDIUM 8 of the S3 ship review: remove licensing-hygiene leaks found by a
read-only repo-wide survey, while leaving every legitimate "Contributed by
gascity from bd-enterprise ... to OSS beads under the MIT license." provenance
header and every genuine public gascity/gastownhall self-reference (the real
OSS org, beads.gascity.com docs domain, RBE infra) untouched:
- Delete release-gates/ga-7psli2-3-1-baseline-cmd-bd-fix-gate.md: the only
file in release-gates/ keyed by a private `ga-` tracker ID instead of the
directory's established public `be-` convention (30 other files), and the
only one leaking internal filesystem paths (/home/jaword/...,
gc-management/.gc/artifacts) and internal routing terms (mayor/mpr,
"deployer session"). Not referenced from anywhere else in the tree.
- .golangci.yml: drop two private `ga-2ltro.12`/`ga-26w10` history citations
used as nolint-comment justifications; reworded to the same explanatory
content without naming a private tracker ID.
- Reword 19 "gc native-program" occurrences (14 files, comments and one
design doc) to drop the internal program name while keeping the "S3
reconciliation (2026-10)" dating they were attached to.
- cmd/bd/if_revision.go, if_revision_test.go, update.go,
update_proxied_server.go: drop literal citations of gascity's private
bdstore_conditional.go classifier (including a test function name,
TestIfRevisionEnvelopeGascityContract -> ...DownstreamContract) while
keeping the substantive explanation of why this envelope's shape is
load-bearing for a downstream consumer.
- internal/httpclient/lifecycle.go: drop a citation of gascity's private
internal/beads/bdstore.go.
- internal/httpclient/dial.go: drop the internal/enterprise/httpgw package
path, keeping "a gateway dialer outside this repo".
- internal/httpclient/register.go: reword away from naming "the enterprise
distribution" while keeping the build-tag-opt-in behavior it documents.
Verified: go build ./..., go vet ./internal/httpclient/... ./cmd/bd/...,
go test ./internal/httpclient/... and ./cmd/bd/... -run TestIfRevision all
pass; TestDivergenceLedgerDocMatchesLedger still passes (ledger.go and its
doc were edited in lockstep). gofmt -l reports no diffs on any touched file.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient/wire): correct the CapExternalDependencies doc's implied false claim
MEDIUM 9 of the S3 ship review. The old comment on CapExternalDependencies
said this client "has no external-dependency policy layer to gate" and that
"OSS publishes no storage.ExternalDependencyQueryStore-backed client policy
... to compose" immediately after naming bd-enterprise's removed policy.go --
easily misread as "OSS has no external-dependency decorator at all." It does:
internal/storage/externaldeps's decorator is unconditional (no build tag) and
is wired into every local storage chain by cmd/bd/storage_chain.go.
Reworded to say precisely what is and is not true: the decorator exists and
runs for local backends; what this http client lacks is a client-side
composition of that decorator around a remote store, which is moot anyway
because a server advertising this capability already applies the policy
itself before answering. (Rolled in the same "gc native-program" wording
removal from the MEDIUM 8 commit, since both edits touch this comment block.)
A second claim from the same review item -- that OSS is said somewhere not to
serve events:watch -- could not be located despite an exhaustive repo-wide
search (this file, engdocs/, docs/reference/events-journal.md,
SERVE_RUNBOOK.md, the divergence ledger, CHANGELOG.md, and a dedicated
read-only research pass). internal/httpapi/events_watch.go,
routes.go's events.watch route entry, and internal/httpclient/wire/stream.go
all confirm OSS serves it unconditionally (gated only per-workspace by the
events journal setting, not by build/distribution). No corresponding false
claim exists in this worktree to fix; noting this rather than editing
something that already reads correctly.
Verified: go build ./internal/httpclient/..., go vet, go test
./internal/httpclient/wire/... pass. gofmt -l clean.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(unsupportedgen): add a freshness check for the generated shell
LOW item from the S3 ship review: internal/storage/unsupportedgen had no
tests of its own, so the generator could drift from the checked-in
internal/httpclient/unsupported_gen.go (a storage.DoltStorage interface
change, or a hand-written method added/removed on Store) with nothing to
catch it short of a human noticing the diff. TestInterfaceCompleteness
(completeness_test.go) already pins which methods belong in the shell by
name, but not whether the checked-in bytes match what the generator would
produce today.
TestGeneratedShellIsFresh runs the same scan-then-generate pipeline main()
runs for the registered DoltStorage/httpclient/Store consumer and diffs the
result against the checked-in file -- mirrors the existing
TestDivergenceLedgerDocMatchesLedger pattern in
internal/httpclient/encode/ledger_render_test.go. Added
TestScanHandWrittenMethodsExcludesOwnOutput alongside it to pin the
correctness property the freshness check depends on (scanning must not see
the generator's own prior output as hand-written).
BUILD.bazel: added the go_test rule by hand (gazelle cannot infer the
cross-package `data` dependency a relative-path os.ReadFile needs under the
Bazel sandbox) with data = ["//internal/httpclient:go_srcs"], following the
existing cross-package data pattern in
internal/httpclient/encode/BUILD.bazel. Placed go_test before the
go_srcs.py-managed filegroup block, which `make bazel-sync-check` requires.
Verified: `bazel run //:gazelle` leaves the rule untouched, `bazel test
//internal/storage/unsupportedgen:unsupportedgen_test` passes, `make
bazel-sync-check` is clean, go build/vet/test ./... all pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient/encode): scrub a private tracker-ID cluster from the shipped divergence-ledger doc
Follow-up to the MEDIUM 8 licensing scrub: internal/httpclient/encode's
ledger_render.go header and ledger.go's comments/pinnedElsewhere constant/two
Why strings cited "ga-b8ddd.12/.19/.23/.30" by name. These feed directly into
engdocs/design/http-divergence-ledger.md -- a shipped, generated OSS design
doc, the most visible surface this private ID cluster reached (Fork A's
MEDIUM 8 survey found ~40 occurrences of "ga-b8ddd" across the httpclient
package; this commit addresses the subset inside package encode that is
checked-in prose/doc text, not test-fixture or assertion values). Reworded to
keep the same substantive explanation (what closed, what's still deferred,
which dual run resolved L17) without naming the private ID.
The remaining ~30 occurrences of "ga-b8ddd" outside package encode
(offrole.go, metadata.go, store.go, roles_test.go, wire/*_test.go,
served_*_test.go) are left for a follow-up pass: scrubbing them individually
needs the same per-file verification this commit did, and is a larger,
separate blast radius than was practical in this pass.
Regenerated engdocs/design/http-divergence-ledger.md via
`go test ./internal/httpclient/encode -run TestDivergenceLedgerDocMatchesLedger
-update-ledger-doc`; diff confirmed only the ga-b8ddd text changed. go build
./..., go vet ./internal/httpclient/..., and go test ./internal/httpclient/...
all pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(httpclient): drop a private host reference from a test comment
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* revert(licensing): keep the scrub to the contributed client code
The previous scrub also edited upstream files this PR doesn't otherwise
touch (.golangci.yml, cmd/bd --if-revision files from #7203) and deleted an
upstream release-gate record. Restore them; the provenance scrub applies only
to the code contributed from bd-enterprise.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(httpclient): wire S8 count-scope fields on the client
Encode ParentID/NoParent/ExcludeTypes/ExcludeStatus onto countIssues
(table.go + encode.go), add issues.count.scope to the client capability
table (wire/handshake.go, wire/vocabulary_test.go), and refuse locally
before dialing when the server hasn't advertised the token and any scope
field is set (counter.go's refuseUnservedScope), returning a typed
*storage.ErrUnsupported{Capability:"issues.count.scope"} rather than
dropping fields or taking a guaranteed-400 round trip.
Adds encoding-parity coverage (counts_test.go), a masked-token skew test
proving the pre-dial refusal and zero dials (counts_test.go), roundtrip
and skew-table fixes for the newly-encoded fields (encode/roundtrip_test.go,
encode/skew.go), and wires S8's nine shared Counter conformance cases into
the served http leg (served_counter_test.go), including AddDependency so
the wisp/compose cases run instead of skipping. List stays nil on this
fixture since listTable() has pre-existing, unrelated permanent refusals
for ListRequest.NoParent/ExcludeTypes, so the three *MatchesListCardinality
cases skip here by design.
internal/storage's TestEveryLegWiresEveryRoleContract/http ceiling check
remains red (53 skipped vs ceiling 49) after this change, but strictly
improved: before this change the inherited baseline was 62 skipped (13
over ceiling), all nine of S8's new entrypoints unwired. This change wires
all nine, closing exactly that gap; the remaining 4-over are named
RunBootstrapper*/RunDependencyEditor* cases unrelated to count-scope,
pre-existing debt from other already-merged slices whose ceiling was
never bumped for them. Left the ceiling constant alone rather than
raising it to paper over debt this change doesn't own.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(storage): close the http leg's role-contract ceiling regression
TestEveryLegWiresEveryRoleContract/http went red after the rebase (62
skipped, 13 past its ceiling of 49) before any work in this session; the
prior commit closed 9 of those (S8's Counter cases). The remaining 4-over
were RunBootstrapper* (9 entries) and RunDependencyEditor* (2 entries),
both newly-merged contracts this leg had never classified.
RunBootstrapper*: internal/httpclient/accessors.go already names
Bootstrapper PERMANENTLY UNSERVABLE over http (bd init resolves its
substrate identity entirely client-side, before any server exists to
dial) — add a new named waiver, bootstrapperPermanentlyUnservableWaiverReason,
covering all nine entrypoints. VersionReconciler and InitVerifier are
named permanently unservable by the same accessors.go comment but are
left under the ceiling for their own reviewed change, out of scope here.
RunDependencyEditor*: the OSS server already serves add/remove and the
http leg already wires nearly all of DependencyEditor's contract. The two
missing cases (SameTypeReAddWithChangedMetadataMintsOneVersion,
SameTypeReAddWithIdenticalMetadataIsANoOp) only needed
SetVersionedHistoryEnabled wired onto the fixture, the same way
SetJournalEnabled already is — wired it for real; both pass served.
With Bootstrapper waived and DependencyEditor fully wired, the leg's
unwaived-missing count drops from 53 to 42, so adoptionCeiling moves
from 49 to 42 to keep the ratchet exact, with the adopting prose updated
to match.
TestEveryLegWiresEveryRoleContract is green. Served tier (real, CGO +
embedded dolt): 611 PASS, 0 FAIL, 72 SKIP (up from 609). bazel build/test
and make api-check pass for the touched targets.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* build(bazel): auto-sync BUILD files
Applied from the bazel-sync-patch artifact of https://github.com/gastownhall/beads/actions/runs/37307836753
(`make bazel-sync`: gazelle, tools/bazel/go_srcs.py, bazel mod tidy).
Only BUILD.bazel, MODULE.bazel and MODULE.bazel.lock are ever pushed; see
scripts/bazel-autofix-push.sh.
* fix(conformance): pass -tags gms_pure_go to Tier 3's served httpclient run
scripts/conformance.sh:61 ran a bare `go test -timeout=40m ./internal/httpclient/`
for Tier 3 (served HTTP client/role conformance), which `make ci-pr-policy`'s
build-tag policy check refuses ("bare go test without -tags=gms_pure_go").
Pass the same -tags Tier 1 already does, and update
TestConformanceScriptUsesExplicitTimeoutBudgets' pinned argv to match.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(bazel): give //internal/httpclient:httpclient_test room to run
The package takes ~350s under --config=ci (BEADS_TEST_SKIP=dolt, no
BEADS_TEST_EMBEDDED_DOLT) — mostly wall-clock wait on the CA tests'
dialer/keep-alive timeouts, not CPU — but the go_test had no size/timeout
override, so it inherited the medium default's 300s and timed out
intermittently under Bazel (and took "Go test equivalence" down with it).
Set size = "large", timeout = "long", matching
//internal/storage/embeddeddolt's go_test.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): fix data race in caContextHandler test helper
TestTransportForRaisesMaxIdleConnsPerHostForBursts drives caContextHandler
with 8 concurrent requests; handler() wrote requestSeen/host/sni from every
server goroutine with no synchronization, and the other nine callers (all
single-request) never exercised the race. go test -race reproduced it as
3x DATA RACE across repeated runs.
Guard the fields with a mutex and expose them only through accessor methods
(sawRequest/seenHost/seenSNI), updating every call site in
store_dependent_test.go accordingly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(unsupportedgen): canonicalize reflect-visible stdlib aliases
TestGeneratedShellIsFresh fails on Go >= 1.27: encoding/json.RawMessage
became an alias of encoding/json/jsontext.Value, and reflect only ever sees
an alias's underlying type, so formatType rendered
storage.DoltStorage.MergeMetadata's signature with the new, non-portable
name even though the signature itself did not change. A contributor on
1.27 following the freshness test's own advice ("go generate
./internal/httpclient") would commit a shell that does not compile on the
1.26.7 SDK this repo pins.
Add reflectAliasCanonical, a table mapping a reflect-visible alias target
back to the name a human wrote in source, consulted by namedType. Add an
entry here for any future stdlib alias this generator's output needs to
stay stable across.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): claimOnlyUpdate propagates the claim's RowVersion
bridge.go's GetIssue already stitches details.Revision onto
hydrated.RowVersion when claimOnlyUpdate rehydrates labels/CreatedBy onto
the claim response, but the claim response itself (issueops.Claimer's
bare-row contract) carries no revision at all, and the copy-back only
touched Labels and CreatedBy. So Lifecycle.Update({Actor, IssueID, Claim:
true}) — `bd update X --claim` — handed back Issue.RowVersion == 0 over
http where the local leg returns the real token, and feeding that into the
next write's ExpectedVersion got a spurious mismatch instead of none.
Copy RowVersion back too. Extend
RunLifecycleResultsCarryThePostWriteRowVersion (shared lifecycle/close/reopen
conformance contract) with a claim-shaped first link in the chain: claim,
then guard the next write with the claim result's own token, proving the
claim-only path populates the real version rather than a nonzero constant.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): stitch RowVersion on SearchIssues' exact-id fast path
resolve.go's getIssuesByExactID decodes the same IssueDetails shape
bridge.go's GetIssue does, but never parsed details.Revision the way
GetIssue's own stitch does, so SearchIssues(ctx, "<exact id>") answered
RowVersion 0 — a one-line gap: Issue.RowVersion is json:"-", so the decode
left it at zero, and only the explicit parseRevision stitch recovers it from
the response's own Revision string member.
Add TestSearchIssuesExactIDPopulatesRowVersionForAGuardedWrite, pinning the
same guarded-write round trip TestBridgeGetIssuePopulatesRowVersionForAGuardedWrite
already pins for the plain GetIssue path.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): route every write role's refusals through inexpressible
Review finding 7: write-side refusals were not uniformly *ErrUnsupported.
Read roles already wrap encoder refusals through Store.inexpressible, which
reaches both encode.RefusedError and encode.CapabilityError; the write side's
refuse() returned a bare *encode.RefusedError instead, so a caller doing
errors.As(err, &unsupported) caught the count-scope refusal but missed
Sweeper.Sweep(Limit), DetectCycles(IncludeTracks), ReadyClaimer.ClaimNext,
BatchApplier.ApplyBatch, BatchCloser.CloseBatch, Deleter.Delete,
DependencyEditor.AddDependencies, and BatchCreator.CreateBatch.
Give InexpressibleError a detail field that preserves the original error's
composite text (an "items[%d]..." or "Issue.%s:" prefix a deeper encoder
helper already adds) instead of collapsing the message to the bare ledger
row text, and wrap every remaining write role's exported method in a single
named-return defer calling store.inexpressible, matching the pattern
lifecycle.go's Create/Update/Reopen already use.
Add TestWriteRoleRefusalsMatchTheReadShape, pinning three write-side
refusals (Sweeper.Sweep Limit, CycleDetector.DetectCycles IncludeTracks,
ReadyClaimer.ClaimNext) now classify via errors.As(*storage.ErrUnsupported)
the same way a read-side refusal does.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(cmd/bd): stop spelling out Status: StatusOpen on a markdown batch create
Review nit 8: batchcreator.go's refuseUnwirableIssue refuses a populated
Status (apigen.BatchCreateItem has no wire slot for it), and
buildMarkdownBatchRequest always set Status: types.StatusOpen explicitly, so
`bd create --file` refused on every call against an http-backed store.
PreparePublicCreateRequest already defaults an empty Status to StatusOpen on
every backend, including the http client store's own server, so the explicit
assignment here was never a different outcome - only a populated member the
wire can't carry. Leave it unset; the created issue is identical on every
backend, and the http leg's role-level accounting for why Status and
CreatedBy are excluded from its allowlists is documented on
batchCreateCarriedIssueMembers (internal/httpclient/batchcreator.go).
CreatedBy is left as-is: that member genuinely has no wire slot AND the
server does not yet stamp it from Actor (a gap already tracked in this PR's
Follow-ups), so its refusal is correct, not a bug to route around.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(httpapi): correct create.go's CreatedBy comment to caller-asserted
Review nit 8: the comment claimed CreatedBy is stamped from the
"authenticated actor," but actor is parsed straight from the request body
(s.bodyActor) and never authenticated - exactly as this file's own doc
comment states a few lines above. Reword to "caller-asserted actor" and
cross-reference that doc comment so the two stay consistent. No behavior
change: the stamp itself and its test coverage were already correct.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(httpclient): raise MaxIdleConnsPerHost for a supplied client's nil Transport
Review nit 8: DialWith's doc comment promises the raised MaxIdleConnsPerHost
ceiling on every dial, "whether or not a CA is configured," but the
opts.HTTPClient.Transport == nil arm only injected a transport when the
target's CA was configured (resolved.configured()). A caller-supplied
*http.Client with a nil Transport and no CA fell through untouched, so it
defaulted to http.DefaultTransport's own ceiling of 2 at request time instead
- silently exempting this one shape from the doc's promise and forcing a
fresh TLS handshake on most of a concurrent burst even once the pool is warm.
Route this arm through the same dialTransport helper the opts.HTTPClient ==
nil arm above already uses (the CA-scoped transport when a CA is configured,
the shared baseline otherwise), injected onto a copy so the caller's own
*http.Client fields (Timeout, CheckRedirect, Jar) stay untouched.
Add TestDialWithSuppliedClientNilTransportNoCARaisesMaxIdleConnsPerHost: an
end-to-end burst through wire.Client.Do, traced with httptrace, asserting the
connection pool settles into reuse at a burst size the default ceiling of 2
cannot sustain.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(httpclient): stop citing nonexistent design docs from new source files
Review nit 8: several comments added by this lift cited
engdocs/design/http-client-backend.md, "D8 row N", and beads-design/slices.json
- none of which exist in this repository (the design lived in the
bd-enterprise-internal source this code was lifted from).
Point each citation at what actually ships in-repo instead:
engdocs/design/http-divergence-ledger.md (the generated, human-readable
rendering of the divergence ledger in encode/ledger.go) for the D7/D8/D9
discipline citations in encode.go, ledger.go, bijection_test.go,
write_ledger_test.go, wire/credential.go and store.go's package doc; and a
direct description of the wire-gap it records, rather than a slices.json
scope reference, in leg_contract_wiring_test.go's cycle-tracks waiver
rationale. Regenerate http-divergence-ledger.md from ledger_render.go (which
had the same stale citation) via
`go test ./internal/httpclient/encode -run TestDivergenceLedgerDocMatchesLedger -update-ledger-doc`
so the shipped doc and its generator agree.
No behavior change; comment and generated-doc text only.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* feat(httpclient): implement issueops.BatchGetter for the HTTP client leg
The rebase onto origin/main (item 9 of PR #7247's review) brought in
upstream #7248's new issueops.BatchGetter role on storage.DoltStorage,
breaking the HTTP client leg's interface satisfaction. This wires it up
as a read role (no actor, no version guard, writes nothing — dialed as
a POST only because MaxGetManyIDs ids cannot ride a GET query string),
mirroring Counter/Querier rather than the WriteWire-wrapped roles.
- wire/paths.go: add PathIssuesBatchGet ("/v0/beads/issues:batchGet").
- batchgetter.go: httpBatchGetter.GetMany dials the server and stitches
each resolved issue's RowVersion from apigen.BatchGetIssue.Revision
(the role's only wire spelling of the row token, since RowVersion is
json:"-"). checkGetManyIDs pre-validates the cap and blank-id rules,
in the same order internal/storage/issueops.ValidateGetManyRequest
applies them, because batch_get.go's failBatchGetErr collapses every
validation failure into one generic, code-less InvalidArgument the
client could never decode back into *issueops.TooManyIDsError.
- accessors.go: add the BatchGetter() accessor (26th wire-backed role).
- unsupported_gen.go: regenerated, dropping the now-implemented stub.
- completeness_test.go: move BatchGetter into wireBackedAccessors and
bump the asserted accessor-matrix total from 28 to 29.
- served_test.go / served_harness_test.go: both package-local "by hand"
httpapi.Config builders (serveRoles, serveConfig) now wire
cfg.BatchGetter, fixing ~56 served-tier tests that broke once
BatchGetter joined httpapi.Listen's required role set.
- served_batch_getter_test.go: wire the HTTP leg into all 14
backend/conformance.RunBatchGetterXxx cases, following
served_graph_counter_test.go's pattern. This surfaced a real bug:
GetMany built Missing via append([]string(nil), body.Missing...),
which stays nil when the server reports no misses, violating the
role's "Missing is never nil on success" contract — fixed to build
via make([]string, len(body.Missing)) + copy.
Verified: go build/vet clean; internal/httpclient suite green
(including the embedded-dolt served tier); TestEveryLegWiresEveryRoleContract
holds the http leg's adoption ceiling at exactly 42 with no change needed;
TestInterfaceCompleteness and TestAccessorMatrixMatchesDesign pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* build(bazel): auto-sync BUILD files
Applied from the bazel-sync-patch artifact of https://github.com/gastownhall/beads/actions/runs/37450731721
(`make bazel-sync`: gazelle, tools/bazel/go_srcs.py, bazel mod tidy).
Only BUILD.bazel, MODULE.bazel and MODULE.bazel.lock are ever pushed; see
scripts/bazel-autofix-push.sh.
* test(httpclient): lock contextServer.seen against concurrent handler goroutines
TestDialWithSuppliedClientNilTransportNoCARaisesMaxIdleConnsPerHost drives
the stub with bursts of 8 concurrent requests; the handler appended to
seen without a lock. Readers only look at seen after their requests return.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* build(bazel): sync go_srcs managed blocks for unsupportedgen after the main merge
The PR adds internal/storage/unsupportedgen on a base that predates #7320,
which gave every Bazel package a managed repo_files filegroup. On the merge,
`python3 tools/bazel/go_srcs.py --check` (TestBazelGoSrcsBlocksCurrent) found
3 stale blocks: the package's own repo_files block, its entry in the root
BUILD.bazel repo_files list, and its entry in tools/bazel/BUILD.bazel.
`make bazel-sync` regenerated exactly those; gazelle changed nothing else.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Gas City Adopt-PR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(httpclient): refuse DepAddItem.HasSpawner and ThreadID on applyBatch after the main merge
Main's #7209 gave issueops.DepAddItem two members, HasSpawner and
ThreadID, and a conformance case, RunBatchApplyStampsSpawnerIDOnlyWhenNamed.
ApplyDepAddItem on the v0 wire publishes source, target, type and
metadata only, so on the merge the http leg dropped both silently and
two of the PR's gates went red:
- TestEveryWireExcludedWriteMemberCarriesALedgerRow: the reflective
census found two wire-excluded DepAddItem members with no ledger row.
- TestEveryLegWiresEveryRoleContract/http: the new case left the leg
at 43 unwired cases against its exact ceiling of 42.
applyDepAddItemBody now refuses each member where the role would store
something the wire cannot say, under two new KindRefuse rows,
W-DepAddItem.HasSpawner and W-DepAddItem.ThreadID. The spawner flag
refuses only on a waits-for edge, because the role ignores it on every
other type and stores the same row either way. The ledger doc is
regenerated (264 rows).
The served tier wires the new case as a park on W-DepAddItem.HasSpawner,
owned by the family's existing bead, which brings the http leg back to
its ceiling. With the skip removed the case fails on the client's
refusal; with the refusal also removed it fails on the drop the row
names: spawner_id "" where the role stamps the resolved target.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Gas City Adopt-PR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(httpclient): address #7247 relaunch review iteration 1
Review iteration 1 of the relaunched adoption raised six majors. This
commit fixes all six. Five are the majors the first adoption's
iteration 1 raised. Its fixup, 696803f250 (tag
adopt-pr/bd-f5illd/stranded-fixup-696803f250), fixed them but never
reached the branch. That fix is ported here onto the contributor's
current head, with its reasoning unchanged; the sixth is new.
Creates refused what the CLI sends. Every `bd create` carries
CreatedBy, a workspace whose config.yaml names a prefix also carries
IDPrefix, and the client refused both.
- The server stamps created_by from the actor on all three create
shapes: batch_create.go and batch_apply.go now match create.go.
- The client sends a CreatedBy that names the actor and refuses any
other value, which the server's stamp would silently replace.
createIssue and the apply create item share
refuseUnwirableIssueMembers.
- IDPrefix refuses only where the role would act on it: an explicit,
unforced id.
- `bd create --file` stays refused over http. Dropping its Status was
safe but not enough: the batch create still refuses its Provenance
and Owner. The markdown.go and batchcreator.go comments that called
it servable now say so.
keysetFilter ignored AfterPriority. It now compares priority first,
mirroring sqlbuild's KeysetPriorityCreatedAtIDPredicate, and a new
served case resumes a priority keyset position. AfterID or AfterPriority
without AfterCreatedAt no longer reads as a zero-instant position that
discarded every row (the AfterID minor).
Claim with a patch was refused on a false ledger claim. `claim`,
`force_assignee_transfer` and `force_close_policy` now ride updateBody
like `force_notes_overwrite`, so a claim with a patch or a version guard
is one updateIssue call. A claim ALONE sent to a server that predates
the member (#6890) falls back to claimIssue. The three ledger rows are
retired, and the served cases parked on them now run.
OpenReadOnly returns a writable store. It stays writable, as a
documented exception: backends.Backend.OpenReadOnly also serves the
root pre-run's classified reads, and `bd ready --claim` writes through
that store. The exception is named in the backends.Backend contract,
the store_factory invariant and the store doc, and
TestReadOnlyOpenServesTheClaimBdReadyMakes pins it. An OpenNonMutating
backend hook is the follow-up.
Security surface.
- http_target.json is in the doctor gitignore template and its required
patterns.
- BEADS_HTTP_TOKEN and BEADS_HTTP_TOKEN_COMMAND are host-scoped with
BEADS_HTTP_CA_FILE's "host[:port]=value" syntax. A value scoped to
another server falls through to the next rung, and a command scoped
elsewhere never runs.
- LoadTarget and SaveTarget refuse a url that carries userinfo, and
Target.String drops userinfo.
The served Tier 3 had no CI home. The new target
//internal/httpclient:httpclient_served_test is an `embedded`-tagged
sh_test. It reruns httpclient_test's binary through
tools/bazel/go_test_variant.sh with the script's
BEADS_TEST_EMBEDDED_DOLT=1 and BEADS_HTTP_TEST_REQUIRED=1, in 24 shards
on the embedded lane's race build. bazel.yml's bazel-embedded job
already runs `bazel test //... --config=embedded`, so no workflow
changes.
- -test.timeout=19m, not the script's 40m: Go's own timeout then fires,
and dumps every goroutine, before the action's 1200s limit.
- TestBazelRetiredLanesCannotBeNarrowed pins its args and env. The new
TestConformanceServedTierRunsUnderBazel ties the script's Tier 3
switches to the rule.
- The new untagged TestServedTierIsLinkedWhenRequired fails a required
run built without cgo, which drops every served file (the sentinel
minor).
- A first 12-shard run found two test defects; both are fixed.
TestServedBatchApplyBoundsTheItemCount's 1000-item apply outlasts the
client's 60s per-request timeout under -race, so a
race_detector_{on,off}_test.go pair scales its "at bound" half to 150
there, as embeddeddolt's TestBatchApplyContract does. And
TestTheCompositionCatchesAWrongParameter's dropped-filter case leaned
on rows earlier tests had seeded: run alone, or first in its shard,
it failed. It now seeds its own row outside the scope.
- conformance.sh, its script test and
engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md name the target.
Deviations from the review's suggested fixes:
- A bare BEADS_HTTP_TOKEN(_COMMAND) fails closed rather than falling
back, and the error does not echo the value: a bare token split at an
"=" would put token text into the pattern half. Dropping the bare
syntax is safe today: the backend has no Register call site and no
docs/ page names the variables.
- Target.String drops userinfo instead of using url.URL.Redacted, which
masks only the password, so a token used as the username would print.
- The pre-#6890 claimIssue fallback leaves RowVersion unset instead of
borrowing the follow-up read's token. That read is a second snapshot,
so its token could postdate a write this claim never saw and arm a
guard that should miss; a guard built from the unset token fails
closed. Against a current server the claim rides updateIssue, whose
`revision` is stitched as for any update.
Also fixed: the nit about the completeness failure message, which now
says to regenerate the shell, and the offrole.go tombstone comment that
named a skip list which no longer exists. Left for follow-up (all
latent, since httpclient.Register has no production caller): vocabOnce
latching a failed fetch, snapshot holding s.mu across the handshake
dial, unchunked graph anchors, private tracker IDs in park owners, and
the bounded journal limit above 10000.
Validation:
- git diff --check; gofmt -l; go vet over internal/httpclient/... and
scripts
- go test -tags gms_pure_go over internal/httpapi/...,
internal/httpclient/..., internal/storage/backends/... and
backend/conformance/...; the doctor gitignore tests; the cmd/bd
events-journal construction guard; ./scripts
- bazel test --config=embedded
//internal/httpclient:httpclient_served_test on the lane's remote
executors: 24 shards, 702 top-level tests, 632 pass, 70 skip (69
ledgered KNOWN DIVERGENCE, plus
TestCAFileHygieneRefusesGroupWritableFile, which finds no
supplementary group on the executor), 0 fail, 0 data races; slowest
shard 283s. tools/bazel/check_testcases.py --bep passes.
- each of the 702 tests run alone (go test -run '^Name$', without
-race): 0 fail
- the whole tier under go test without -race, with the script's
switches and -timeout=40m, before the two test fixes: 633 pass, 69
skip, 0 fail
- removing BEADS_HTTP_TEST_REQUIRED from the rule fails both policy
tests
- bazel test --config=ci over //internal/httpclient/...,
//internal/httpapi/..., //scripts/..., //test/docsync/...,
//internal/storage/backends/..., //backend/conformance/... and
//cmd/bd/doctor/...: 32 tests pass
- make ci-pr-lint: nogo native plus windows/darwin, passes
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Gas City Adopt-PR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eddie the Engineer <adopt-pr@gascity.com>
* ci: bigger runners for the slowest CI legs (MCP gate, Bazel test, Windows preflight)
Runner-size A/B against merge group 37721729916 (3m49s):
- package-mcp: 4 -> 8 vCPU with pytest -n 16 (BEADS_MCP_PYTEST_WORKERS,
mode remote only; forks/ubuntu-latest keep package-mcp.sh's default 8).
pytest was 70s, dominated by CPU-bound per-test `bd init` setup. Local,
pinned with taskset: -n 8 on 4 CPUs 112s; -n 16 on 8 CPUs 60/57/58s,
228 passed / 5 skipped in all three runs.
- bazel-test: 2 -> 4 vCPU. `bazel test //... --config=ci` spent ~63 of
81s in client-side loading/analysis (critical path 7.65s, every action
a remote cache hit).
- pr-preflight-platforms Windows leg: 4 -> 8 vCPU. main.yml's test-windows
saver stays on 4 vCPU: the cache keys name runner.os/runner.arch, never
the label, and actions/cache's version covers only paths + compression,
so the entries are not size-specific; the other Windows consumers keep
their exact label. TestWindowsPreflightLegReachesSaverAcrossSizes pins it.
Runner labels live in the shared constants in
scripts/ci_blacksmith_runner_test.go; TestBlacksmithBazelRunnerSizes checks
every bazel.yml lane's runs-on and the MCP worker count per rbe mode with
evalGHExpr. Revert any bump that does not save at least 15s.
Agent-Signature: claude-code-claude-opus-5-5-medium on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(pr): keep the Windows preflight leg on 4 vCPU (A/B: 8 vCPU queued 63s)
#7381's PR run put pr-preflight-platforms' Windows leg on
blacksmith-8vcpu-windows-2025. The cache restore from main.yml's 4 vCPU
test-windows saver hit, but the job waited 63s for an 8 vCPU Windows runner
and finished at 144s against the 129s baseline on 4 vCPU, so the leg goes
back to blacksmith-4vcpu-windows-2025. With saver and consumer on one label
again, TestWindowsPreflightLegReachesSaverAcrossSizes and the separate
preflight runner map have nothing left to pin and are dropped; the result
is recorded next to platformsMatrixRunners, in pr.yml and in
CI_REQUIRED_CHECK_TOPOLOGY.md.
Agent-Signature: claude-code-claude-opus-5-5-medium on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): fetch the LLVM toolchain as a 149 MB slice; re-key the runner cache
Port of gascity #7279. @llvm_dist_linux_x86_64 downloaded the 1.94 GB
LLVM-22.1.8-Linux-X64.tar.xz and ran a single-threaded `tar -xJf` over
11 GiB to keep a 688 MB slice. That took 94-147 s in every Bazel lane,
and every cgo, race and stdlib action waits on it.
- llvm_dist.bzl gains `sliced`: download_and_extract of a members-only
.tar.zst, plus a missing-member check. The xz path stays.
- MODULE.bazel pins the toolchain-llvm-22.1.8-slice-1 asset by sha256
(de614777...6bec5). The URL is gascity's release asset for now; the
list form leaves room for a beads mirror of the same bytes.
- tools/cc_toolchain/repack_llvm.sh and llvm_members.txt rebuild the slice
from the pinned upstream release.
- Runner cache v4, keyed on MODULE.bazel too. MODULE.bazel.lock does not
record llvm_dist, so the v3 key never changed and kept restoring the
2.9 GB entry that holds the xz archive.
- bazel_hermetic_cc_test: a sliced llvm_dist may only download from a
gastownhall/beads or gastownhall/gascity release, and its members must
equal llvm_members.txt.
Verified locally:
- Every file in the extracted slice (2009 entries: types, modes,
symlink targets, sha256) is identical to the xz extraction.
- aquery action keys are identical, base vs head, at the same workspace
path: 7565/7565 over deps(//cmd/bd:bd_for_tests) and 7146/7146 over
the race deps(//internal/storage/embeddeddolt:embeddeddolt_test).
- Extraction time: 178 s (xz) vs 1.9 s (zstd).
Agent-Signature: claude-code-claude-opus-5-5-medium on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): run the release cross-compile as its own lane
After the LLVM slice, bazel-pure is the longest cached Bazel lane (about
170 s). Its "Cross-compile every release target" step takes 54-58 s of
that (78.9k configured targets, 25k cache-hit lookups) and shares no
analysis with the pure invocations, because release_cross is a split
transition.
The step moves, unchanged, into a new job, bazel-release-cross ("release
cross-compile"). The job uses bazel-pure's runner, `needs: rbe` and skip
rule, so it runs in every mode except skip. It reports job.status like
every lane: the workflow_call output is bazel-release-cross, and pr.yml's
CI Gate requires it as BAZEL_RELEASE_CROSS. bazel-gate.sh skips it only in
mode skip, as it does BAZEL_PURE. Merge groups use the same pr.yml gate.
Push and dispatch runs gate nothing. Existing gate ids are unchanged.
The policy test now pins the step to bazel-release-cross, requires the new
gate id, and rejects any other job that runs the script (no double runs).
The new job is listed as having no CI analytics step. It captured no BEP as
a bazel-pure step either, and the analytics steps are unchanged. Docs:
LINTING.md, TESTING.md, CI_REQUIRED_CHECK_TOPOLOGY.md.
Expected: bazel-pure about 110 s on cached runs; the new lane about 85 s,
in parallel. Cost: one more 2-vCPU Blacksmith runner per run.
Agent-Signature: claude-code-claude-opus-5-5-medium on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* build(bazel): stop building protoc for protoc-gen-validate
github.com/envoyproxy/protoc-gen-validate ships validate/validate.pb.go,
but its own validate/BUILD makes the Go library a go_proto_library. So
every lane built protoc from source just to regenerate that file. The
module reaches the graph only through grpc xds and the cloud SDKs.
A gazelle_override now regenerates the module's BUILD files with
`gazelle:proto disable`. It sets build_file_generation = "on" and adds
`gazelle:build_file_name BUILD.bazel`, so gazelle writes BUILD.bazel
(which Bazel prefers) instead of keeping the upstream BUILD. The proto
directive alone changes nothing, because the upstream BUILD files win.
validate is now a plain go_library over validate.pb.go.
Measured locally with aquery:
- //... minus the manual release_cross target: base has 2096 CppCompile,
612 CppArchive, 314 CppLink and 1 GoProtocGen action; head has 0.
- cquery somepath(//..., @protobuf//:protoc): base goes through
grpc xds -> envoy core/v3 -> validate_go_proto -> protoc; head is
empty.
- deps(//cmd/bd:bd_for_tests): 7565 actions become 3077. The race
deps(//internal/storage/embeddeddolt:embeddeddolt_test): 7146 become
2658.
MODULE.bazel.lock does not change. The v4 runner cache key includes
MODULE.bazel, so it still moves. Expect one cold compile of the Go
packages above validate on the first run after merge.
Agent-Signature: claude-code-claude-opus-5-5-medium on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* build(bazel): bazel mod tidy formatting
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PR preflight process (windows-latest) is a CI Gate input and, after the
Bazel fixed-cost work, the merge-group critical path (ends at +247..+303s).
Step timings from merge group 37710264475 and seven same-repo PR runs:
45-115s setup (setup-go, then module and build cache tar extraction),
33-71s "Exercise the real Bash process boundary", 27-58s ./cmd/bd test
compile+link, 5-9s each for three more go test relinks.
- scripts/pr_preflight_test.go: the ~29 pr-preflight.sh runs (about 1.5s
each under Git Bash on Windows, 42.8s total in the merge group) now run
as parallel subtests. Each run already had its own temp dir, call log
and env; the one test that t.Setenv's stays serial. Linux: 4.8s -> 0.8s.
- pr.yml: the hook-timeout step and the bd build fallback step become one
go test of ./cmd/bd, saving a package re-hash and test-binary relink
(5-9s on Windows for a sub-second test). Policy tests and the allowlist
and topology docs follow the step name.
- warm-non-race-cache.sh: on Windows also compile the three CGO_ENABLED=0
credential-fixture test packages the Windows-only fixture step runs, so
main.yml's test-windows seeder covers them.
No step, test or gate input is dropped; the job id, name, matrix and
runner are unchanged.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
checks.nix's hook-timeout-backends (the tracked git hook shims against
real GNU/uutils/busybox/toybox timeout implementations, with and without
perl, under dash, bash and busybox ash: 240 cases) was the one test PR
Risk's test-nix ran on a GitHub runner, through `nix flake check`. It is
now //tests/hook_timeout_backends:hook_timeout_backends_test, an sh_test
(pr-core-only) that the bazel-test lane runs remotely on every PR: the
static uutils 0.12.0, busybox 1.35.0 and toybox 0.8.15 binaries come in
sha256-pinned through MODULE.bazel; dash, bash, perl and GNU coreutils
from the executor, failing (not skipping) when one is missing.
checks.nix goes and flake.nix declares no checks, so test-nix's
`nix run .#default` + `nix flake check` is a packaging check (build the
package Nix users install, evaluate every flake output), not a test.
TestHookTimeoutBackendsRunUnderBazel pins the target and that no flake
check comes back.
ga-96smfk.22
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- pr.yml's Windows jobs and the macOS/Windows legs of pr-preflight-platforms
and check-doc-freshness-platforms run on Blacksmith for every PR and merge
group, forks and Dependabot included: no windows-latest/macos-latest
fallback (Blacksmith serves this org's fork PRs). Matrix legs name their
label (runs-on: ${{ matrix.runner }}); the same-repo "matrix marker"
ternary and its policy plumbing are gone.
- pr-preflight-platforms drops its Linux leg: its tests run under Bazel on
rbe-west (//scripts:scripts_test, //cmd/bd:bd_test,
//internal/config:config_test).
- The Linux-cross-compiled Windows path is retired: windows-test-binaries,
its two -prebuilt twins, main.yml's windows-test-binaries-cache, the
WINDOWS_PREBUILT_REQUIRED flag and the build script/manifest. The native
pair (test-windows-liveness, worktree-remove-windows) is the required run.
- main.yml's test-windows and blacksmith-macos-go-build-cache drop their
GitHub-hosted venue legs (no GitHub-hosted consumer left).
Gate names unchanged. ga-96smfk.22
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Push to main and the nightly schedule no longer run go test or repo checks
on GitHub runners (ga-96smfk.22, ga-96smfk.58):
- main.yml keeps only the macOS -race -short suite, the Windows smoke build
and the push-to-main savers of the GOCACHEs pr.yml's Windows/macOS jobs
restore. Its Linux jobs (migration hygiene, build artifacts, build tags,
versions, duplicate migrations, doc flags, package gates, PR policy
wrapper, gofmt, the Linux and setup-go cache seeders, the Nix flake
check) are gated on the merge queue's pr.yml/pr-risk.yml run of the
same commit and re-run as Bazel targets by bazel.yml's push run.
- nightly.yml is the fresh bazel.yml call plus the worker-env check; its
Full Test Suite, PR Core go-test-json side and measure dispatch are gone,
as are ci-measurements.yml and bazel.yml's go-test-json-artifact input.
- The non-race embedded batch-apply step becomes
//internal/storage/embeddeddolt:embeddeddolt_batch_apply_nonrace_test
(go_test_race_off, BEADS_TEST_EMBEDDED_DOLT=1) in the embedded tier.
- make ci-pr-policy and scripts/ci/pr-policy.sh go: every check it ran is
a Bazel test (TestPRPolicyChecksRunAsBazelTargets).
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Every pull_request and merge group already took the Bazel lanes for the
retired tiers (BAZEL_RETIRES_LEGACY_* and BAZEL_COVERS_FORKS all "true",
and pr.yml/pr-risk.yml run on no other event), so the legacy jobs those
flags stood down could never run again. Remove them with their decision:
- pr-risk.yml: build-embedded, test-embedded-{storage,conformance,cmd},
test-proxied-cmd, test-server-storage{,-full}, detect-ci-tier (and its
ci-embedded-tier.sh / ci-capability-selector.sh scripts) and
bazel-coverage. PR Risk keeps the Nix packaging check (test-nix) and its
gate, PR Risk Gate / Required.
- pr.yml: build-artifacts, check-cmd-bd-puregeo-tests, pr-core-wrapper and
bazel-coverage; the BAZEL_RETIRES_LEGACY_* and BAZEL_COVERS_FORKS flags.
The three BAZEL_*_RETIRED gate ids become one, BAZEL_REMOTE: the Bazel
call must have run remotely (remote, fork-ro or fork-rw) on every PR and
merge group, each lane's own id still required. Gate names unchanged.
Policy tests: the D2 decision matrix becomes
TestPRGateRequiresRemoteBazelLanes (bazel.yml's actual rbe step and
pr.yml's actual gate over every event/variable/secret/fork/actor/mint
fact); the parity tests that read the legacy jobs now pin the Bazel lanes
against those jobs' frozen commands.
ga-96smfk.22
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Bazel is beads' build and test system: bazel.yml's lanes gate every PR,
and nogo (lint + vet), gofmt and the repository guards exist only as
Bazel targets. The docs, the Makefile and the hooks now say so.
Makefile: `make test` runs bazel.yml's test lane (`bazel test //...
--config=ci`), `make check` adds the testing.Short policy and the
`make ci-pr-lint` nogo gate, and `make check-docs` runs the docsync and
doc-freshness Bazel targets before the pinned-release CLI flag check.
BAZEL_FLAGS passes --config=fork-cache or --config=remote-exec through.
The plain-Go recipes stay as explicit twins: test-go, check-go,
check-docs-go. No workflow called the primary names, and
TestWorkflowsNameTheirTestEngine keeps it that way.
Hooks: pre-push runs scripts/pre-push-suite.sh for branch pushes whose
commits change Go or Bazel inputs: the test lane with
--config=remote-exec when some rc names an executor, else
--config=fork-cache. Without bazel, or with BD_PREPUSH_SUITE=go, it runs
make test-go under a banner saying that is not what CI gates on.
Docs: AGENTS.md, CONTRIBUTING.md, engdocs/TESTING.md (a per-lane command
table and the fork-cache/remote-exec setup), README, RELEASING, the PR
template and the .bazelrc header. Bazelisk is a required prerequisite;
go test is an inner-loop convenience CI does not enforce.
Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): nogo replaces go vet and golangci-lint (ga-96smfk.18)
Lint and vet now run as nogo inside the Bazel build, so they gate wherever
the Bazel lanes execute (rbe-west), and the golangci-lint and go vet jobs
leave pr.yml and main.yml.
- //tools/nogo (own go.mod, joined to beads' for go_deps only through
gazelle.go.work): go test's vet checks (cmd/go's defaultVetFlags, the set
scripts/ci/go-test-vet.sh ran) plus the eight linters .golangci.yml
enables, each a wrapper over the library version golangci-lint v2.10.1
uses (depguard, errcheck, forbidigo, gosec, misspell, sloglint, unconvert,
unparam).
- .golangci.yml stays the single lint policy: Bazel embeds it and
tools/nogo/internal/golangci applies it as golangci-lint does (enabled
set, settings, run.tests: false as library-unit-only analysis, lax
generated-file detection, path/path-except/text exclusion rules), with
strict decoding so an unimplemented key fails the build.
- gascity's rules_go //nolint-range patch and x/tools ctrlflow patch,
byte-identical.
- Windows/darwin: cross-configured, not a golangci leg. The pure lane's
release cross-compile (//tools/bazel:release_cross, every library and
binary for all eight release platforms, cgo off) runs nogo on every
compile, a superset of golangci-lint's windows and darwin legs.
scripts/pr-lint (make ci-pr-lint, bd preflight) runs `bazel build
--config=nogo //...` plus release_cross for windows_amd64,darwin_arm64.
release_cross skips tools/nogo, a separate Go module `go build ./...`
never compiled.
- pr.yml: scripts-go-checks (vet) and pr-lint-wrapper (x3) are gone, with
their ci-gate entries; main.yml: pr-lint-wrapper (x6) and go-vet-cache.
scripts/ci/go-test-vet.sh and install-golangci-lint.sh are deleted.
- pre-commit hook and .pre-commit-config.yaml run `make lint-changed
LINT_CHANGED_SCOPE=staged` (nogo over the staged packages); Makefile adds
lint, vet and lint-changed. pr-lint.sh no longer runs gofmt
(//scripts/repochecks:fmt_test owns it; ga-96smfk.41).
- internal/testutil/integration: five gosec findings in integration-tagged
library files golangci-lint never built, now linted by the integration
lanes, carry reasoned //nolint directives.
Parity: with the exclusion rules removed, golangci-lint and nogo report the
same 3,916 findings natively and 3,859 each for windows and darwin (file,
line, linter, text); with .golangci.yml as committed both report none.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): equivalence.py leaves nested Go modules' tests out of go test's set
tools/nogo is its own Go module, so `go test ./...` in the root never runs
its tests; Bazel's unit lane does. Its packages are neither expected nor
extra.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The dolt-server lane (--config=doltserver) has been the only pre-merge run
of the Dolt-backed domain, uow, tracker, doctor/fix and protocol suites
since BAZEL_COVERS_FORKS went "true": bazel-coverage reports pr_lanes=true
for every pull_request and merge_group, so pr.yml's test-domain-uow and
contract-corpus never run. An A/B run of every requires-docker target
against its dolt-server twin on the same commit shows identical test sets
and statuses (2683 testcases) except TestDoltServerFingerprint/container,
the container half of the fingerprint, which needs docker by design.
Delete the six requires-docker sh_tests, test:docker in .bazelrc, the
requires-docker tag from the taxonomy and lane filters, bazel.yml's
dolt-lane dispatch input and image pull, and pr.yml's test-domain-uow and
contract-corpus jobs with their ci-gate wiring. The testcontainers backend
in internal/testutil stays: it is plain go test's default. pull-dolt-image.sh
stays for pr-risk.yml's legacy tiers. No required check changes: the
rulesets require only CI Gate / Required and PR Risk Gate / Required.
Refs ga-96smfk.21
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
pr.yml's check-release-target-cross-compilation ran `CGO_ENABLED=0
GOOS/GOARCH go build -tags gms_pure_go ./...` for the eight release targets
on two GitHub/Blacksmith runners. It is now a step of bazel.yml's pure-Go
lane (BAZEL_PURE, already required by ci-gate):
scripts/ci/bazel-release-cross-compile.sh builds //tools/bazel:release_cross
once, remotely, with --//tools/bazel:release_platforms set from
scripts/ci/release-targets.txt (still the single source of truth, pinned to
.goreleaser.yml). release_cross's split transition configures every
go_library/go_binary for each rules_go platform with cgo off, so all eight
platforms build in parallel in one invocation.
- tools/bazel/release_cross.bzl: the split-transition rule and the
string-list flag.
- tools/bazel/go_srcs.py (make bazel-sync, checked by bazel-sync-check and
TestBazelGoSrcsBlocksCurrent) keeps the release_cross target list; the
script checks with bazel query that every Bazel package holding Go
targets is reached before it builds.
- //tools/bazel:pure_bd_has_no_cgo_only_deps: Bazel compiles gozstd's pure
stubs where `go build` rejects them, so the pure bd of every platform
must not link gozstd.
- //internal/storage/embeddeddolt/cmd:cmd (cgo-only main, skipped by
`go build ./...` under CGO_ENABLED=0) is tagged cgo-only and incompatible
with pure builds.
- A failed build is re-run per platform (cache hits) to name each failing
GOOS/GOARCH.
Same cgo-off coverage boundary as the retired job. Refs ga-96smfk.20.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
cross-version-smoke.yml resolved the newest 5 GitHub releases (30 on a tag
push) with `gh release list`, then built the candidate and downloaded each
release on a GitHub runner for scripts/upgrade-smoke-test.sh.
//tests/upgrade_smoke has one target per release in the newest 30 the
release catalog pins a linux/amd64 asset for (@bd_releases//:versions.bzl):
upgrade_smoke_<release>_test runs the script against the non-race
bd_for_tests with that release pinned as PREV_BIN (sha256-verified when
Bazel fetches it; the script checks it reports the release and downloads
nothing). A release added to the catalog joins the window. Tagged
pr-core-only, so bazel-test (not the integration lane) runs them remotely
on every PR, merge group and
push, cached until the candidate, the script or the release changes.
The tested set is now reviewed rather than resolved at run time: stable
releases from the catalog, where the workflow took GitHub releases
including prereleases. cross-version-smoke.yml and the F7c checks of its
chunk fold, path filter, runners and binary cache are removed (the
path-filter and binary-cache checks had no other workflow left).
Refs: ga-96smfk.19
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(migration-test): extend the release catalog through v1.3.1
The catalog stopped at v1.1.2 (the v1.2 upgrade census). The migration
corpus already upgrades from v1.2.2, and the Bazel targets that replace
migration-test.yml and cross-version-smoke.yml take their pinned release
binaries from the catalog (@bd_releases), so it has to cover the releases
since. Regenerated with `catalog generate` after raising maximumVersion to
v1.3.1: five new stable versions (v1.2.0, v1.2.1, v1.2.2, v1.3.0, v1.3.1;
three with a linux/amd64 asset) and five new proxy prereleases; no existing
entry, drift record or repository-only exclusion changed. The count
constants and the identity digest are updated to match, and the README now
says how to add a release.
Refs: ga-96smfk.19
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): run the historical-upgrade corpus under Bazel; retire migration-test.yml
migration-test.yml ran scripts/migration-test/run.sh --version <release> for
14 reviewed releases in 3 shards on GitHub runners: it downloaded each
release archive, built v0.9.1 from source with Go 1.25 through the module
proxy, installed libicu74 and the dolt 2.1.8 runtime, all over the network.
//tests/migration now has one target per corpus release
(historical_upgrade_<release>_test) plus legacy_bridge_test, all hermetic:
- Published releases come from @bd_releases (the release catalog's
sha256-verified assets) through a per-target directory
(HISTORICAL_RELEASE_DIR); lib/binary.sh uses it instead of downloading and
still checks each binary's self-reported version.
- v0.9.1 is //tests/migration:bd_source_tag, the same `go mod download` +
`go build -trimpath` with CGO and Go 1.25.0, run offline as a build
action: the module files come from tests/migration/source_tag_modules.json
through a file:// GOPROXY tree (tools/bazel/go_module_proxy.bzl), the
release's own zip is the catalog's source_zip, and go checks every
dependency against the release's go.sum (SOURCE_TAG_SQLITE_BIN).
- The external Dolt runtime is @dolt_test_runtime_linux_amd64 (dolt.bzl's
dolt_release gains a version attribute; 2.1.8 is pinned to versions.sh's
digest), passed as DOLT_BIN to the server-Dolt and wisp-plane releases.
- The workers already provide jq, python3, sqlite3 and libicu74.
The targets are untagged, so bazel-test runs them remotely on every PR,
merge group and push; result caching replaces the path filter. Every
release also passed inside a loopback-only network namespace.
scripts/migration_corpus_bazel_test.go keeps the BUILD lists equal to
versions.sh's corpus, the catalog digests equal to STRICT_RELEASE_SHA256,
the source-tag lock equal to the catalog's source_zip, and the Dolt runtime
pin equal to versions.sh's. migration-test.yml and the policy tests that
pinned its shards, caches, apt step and runner are removed.
Refs: ga-96smfk.19
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): run the historical-upgrade targets in the PR-core lane only
The integration lane runs every untagged target too, and its
check_testcases.py requires Go testcases, which a shell test's test.xml does
not list. A new pr-core-only tag keeps //tests/migration out of
--config=integration (bazelIntegrationExcludedTags adds it), so the corpus
runs once, in bazel-test, against the release-shaped bd_for_tests (no
integration tag). build_source_tag.sh carries the build-tags opt-out: it
builds a historical release with that release's own go.mod, which predates
gms_pure_go.
Refs: ga-96smfk.19
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
regression.yml ran `go test -tags=regression ./tests/regression/...` on a
GitHub runner: it built the candidate with `go build`, downloaded the v0.49.6
baseline release over the network, and pulled the dolt-sql-server image.
None of that works on rbe-west workers (no network for fork lanes, no docker).
- tools/bazel/bd_releases.bzl: a module extension that reads
scripts/migration-test/release-catalog.json and declares one repository per
catalog release with a linux_amd64 asset digest (bd_release_<version>,
verified against the catalog's sha256), behind the @bd_releases hub
(@bd_releases//:<version>, plus versions.bzl). Adding a release is a
catalog change only; nothing downloads until a test declares one.
- //tests/regression:regression_test: the suite's files build under
`regression || integration`, so gazelle generates the target. It runs the
injected non-race bd_for_tests (BEADS_TEST_BD_BINARY) against
@bd_releases//:v0.49.6 (BD_REGRESSION_BASELINE_BIN), both over a hermetic
dolt sql-server (BEADS_TEST_DOLT_SERVER=local, required), in 8 shards.
TestMain checks the baseline reports BASELINE_VERSION, so the label and the
file cannot drift. Tagged dolt-server-cmd: bazel.yml's bazel-cmd-dolt lane,
which pr.yml's gate requires, runs it remotely; test result caching stands
in for the old path detector.
- A plain `go test -tags=integration ./...` (nightly) compiles the files but
skips the suite; only -tags=regression (make test-regression) or Bazel
runs it.
- regression.yml, main.yml's warm-up compile for it and the policy tests that
pinned its jobs are removed.
Refs: ga-96smfk.19
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>