* test(integration): let SubprocessRunner reuse a prebuilt test binary
BEADS_TEST_SUBPROCESS_BINARY hands SubprocessRunner an already-built test
binary of the package instead of running `go test -c`, which no Bazel
action can do offline (it needs the module source tree and module cache).
A Bazel target passes the running go_test itself: the helper tests
(TestHelperSchemaInit, TestHelperMultiStore) live in the same package.
Unset, behavior is unchanged.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(dolt): keep a lane's REQUIRE switch out of the leak-probe child
TestSuiteFixtureLeakFailsOwningSuite re-runs the suite with
BEADS_TEST_SKIP=dolt on purpose. When the parent runs under
BEADS_TEST_REQUIRE_DOLT_CONTAINER=1 (a fail-closed server lane), the child
inherited it and TestMain exited FATAL before the leak sweep the test
checks. Clear it in the child like the other suite-scoped variables.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(bazel): proxied-server and server-Dolt storage tiers (D6d, D6e)
PR Risk's "Test (Proxied Dolt Cmd N/15)" (also main.yml's) and "Test
(Server Dolt Conformance)" / "Test (Server Dolt Full Suite N/16)" as
Bazel variants against local dolt sql-servers (internal/testutil local
backend, pinned dolt from the test wrapper), fail-closed like the
dolt-server lane:
- //cmd/bd:bd_proxied_test: 15 shards; shard k runs the job's
proxied-test-shard.sh k+1 15 through go_test_manifest_shard.sh over the
race bd_test, non-race bd_for_tests as the subprocess bd,
BEADS_TEST_PROXIED_SERVER=1, GOMAXPROCS=4. Tag dolt-server-proxied,
--config=doltserver-proxied (the doltserver lane's build).
- //internal/storage/dolt:dolt_server_{conformance,full}_test over
dolt_race_off (go_test_race_off of dolt_test: the jobs' binary is not
race); the full suite runs server-storage-test-shard.sh k+1 16 with
BEADS_TEST_ENV_RUN_DOLT=1 and hands SubprocessRunner its own binary.
Tag dolt-server-integration, --config=doltserver-integration, whose
build flags are exactly --config=integration's, so the tier shares that
lane's compile (race-off deps land where bd_for_tests already is)
instead of compiling the tagged graph a third time.
- dolt_test gains //internal/storage/schema:migrations as data (the
PR4107/migration replay tests read ../schema/migrations).
- test_env.sh: BEADS_TEST_GIT_IDENTITY=1 writes the jobs' global git
identity ("Configure Git"); the git-remote tests commit in fresh repos.
- Both tags join the taxonomy and bazelPRCoreExcludedTags, so prcore/ci
and integration exclude them.
Per-shard names and statuses equal a replay of the jobs' commands
(container backend) for all 32 jobs.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): run the proxied and server storage tiers remotely (advisory)
bazel-doltserver gains a second, remote-only step, `bazel test //...
--config=doltserver-proxied` (15 shards of ~5-10 min with a busy dolt
sql-server each do not fit a GitHub-hosted runner; forks and rbe=off keep
the local lane unchanged). bazel-integration gains `bazel test //...
--config=doltserver-integration`, which shares its build flags, so the
server storage tier compiles nothing the integration step has not. Both
steps write their own BEP, run check_testcases.py on it, run even when the
job's first test step failed, and upload logs on failure.
Policy (TestBazelDoltServerTiersMirrorPRRisk): each variant runs its jobs'
shard script with their shard total and has script + manifest in data;
the conformance variant passes the job's flags; the jobs' race/non-race
binaries and switches (BEADS_TEST_PROXIED_SERVER, BEADS_TEST_ENV_RUN_DOLT)
match; doltserver-integration's tags and race equal --config=integration's;
the steps are pinned to their jobs. checkDoltServerRules now holds all
three dolt-server lane tags to the local-backend, fail-closed,
remote-capable rules.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): run the proxied and server storage tiers in jobs of their own
Review of D6d/e: as steps of bazel-doltserver and bazel-integration the
tiers inherited those jobs' gating (a caller switching the integration
lane off would drop PR Risk's PR-time server tier; a gate requiring the
dolt-server lane would silently require the proxied tier too) and
lengthened their critical paths.
bazel-proxied (--config=doltserver-proxied, 15 shards) and
bazel-server-storage (--config=doltserver-integration: conformance + 16
shards) are remote-only jobs that need only rbe, each with its own BEP,
check_testcases.py step and log upload, 25-minute test step inside a
30-minute job. bazel-doltserver and bazel-integration are back to their
previous content, including the dolt-server step's 80-minute timeout for
local runs. The server tier shares bazel-integration's compiles through
the remote cache (same build flags).
The proxied tier mirrors PR Risk's race bd-cmd-test; main.yml's twin
job runs build-artifacts' non-race one, so Bazel is the stricter of the
two. Comments now say so, and the policy test pins main.yml's build so a
change there is noticed. Policy: the new jobs are pinned (command,
config, remote-only if, BEP + testcase steps, timeouts, log upload), and
no tier step may run in bazel-integration or bazel-doltserver.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): decide the RBE execution mode once, in an rbe job
Dependabot PRs are same-repo (fork=false) but receive no Actions secrets,
so the per-job vars/fork conditions sent them down the remote path with
no executor: every lane ran locally on the 2-vCPU Blacksmith runner and
the remote-only embedded tier timed out (review D1 F1). The conditions
were also repeated in every job and re-read at different times (F5/F6).
A new first job, rbe, decides the mode from four booleans (the
RBE_WEST_WORKERS var, rbe input, fork, and whether RBE_WEST_EXECUTOR is
non-empty) and outputs mode=remote|local|skip plus enabled. Every lane
needs it and takes runs-on, if and the setup-bazel env from its outputs
alone; remote-only bazel-embedded skips unless remote, local-capable
lanes run on ubuntu-latest for forks, rbe=off and secret-less runs.
Same-repo runs still skip while the var is unset. The outputs are also
workflow_call outputs (rbe-enabled, rbe-mode) for a future gate.
Policy tests: every lane needs rbe and uses the pinned expressions; no
value outside the decision step mentions the var, inputs.rbe or fork;
the one extra secret reference is pinned to the emptiness test in the
decision step's env; and the step script is run for same-repo, push,
Dependabot, fork, rbe=off, var-unset and mixed-case scenarios.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): add the advisory bazel-integration job
Runs `bazel test //... --config=integration` (#6916, main.yml's
integration jobs) as its own job in bazel.yml: remote-only like
bazel-embedded (skipped unless the rbe job chose remote), 30-minute test
step inside a 40-minute job, BEP plus check_testcases.py, test logs on
failure. A separate job keeps ci's and integration's shared
bazel-testlogs apart (review-integration F3). No equivalence step:
equivalence.py's default mode is the --config=ci selection, and its job
mode needs the integration jobs' go test -json, which no run here has.
check_testcases.py gains --not-go LABEL for a tested non-Go target
(//tools/bazel:dolt_version_test, a plain sh_test the integration tag
filter keeps); an exemption for a target the BEP does not list fails.
Policy test pins the job's command (no extra filter, selector or remote
config), the count step, the log upload, its remote-only if, and that no
other job runs --config=integration (nor this one --config=ci or
equivalence.py); the .bazelrc tag filter stays pinned by
checkBazelrcIntegrationLane.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): dolt-server lane for the storage domain + uow job
--config=doltserver runs pr.yml's "Test (storage domain + uow)" job as
remote-executable Bazel tests: each dolt-server target runs an existing
go_test binary with BEADS_TEST_DOLT_SERVER=local, so every Dolt server
is a `dolt sql-server` child of the test process, started from the
pinned dolt the test wrapper already ships. No docker, no
no-remote-exec, and BEADS_TEST_REQUIRE_DOLT_CONTAINER=1 fails a target
whose server cannot start, so cached results are trustworthy.
- db_dolt_test, uow_dolt_test (8 shards), tracker_dolt_test,
fix_dolt_test (4 shards, BEADS_FIX_REQUIRE_DOLT=1); GOMAXPROCS=4 like
the job's runner.
- no -short twins of domain, domain/fs, domain/git and
tracker/conformance, so the lane alone runs every package of the job.
- tag `dolt-server` in the taxonomy; test:prcore (and so test:ci)
excludes it. The requires-docker variants stay as the A/B control.
Remote (default instance, --nocache_test_results): 9/9 PASS in 113 s
wall; longest shard 111 s (uow). Per-test statuses, subtests included,
equal the job's go test -json on the same tree: 0 differences.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): contract corpus on the dolt-server lane
protocol_dolt_test runs protocol_test as pr.yml's "Contract corpus" job
does (non-race via protocol_race_off, BEADS_PROTOCOL_REQUIRE_DOLT=1) with
the local dolt sql-server backend, in 8 shards, so the corpus golden,
determinism and conformance tests run on remote workers and cannot skip.
Remote: 8 shards, longest 53 s. 153 tests (151 PASS / 2 SKIP, subtests
included) equal the job's go test -json: 0 differences.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): run the dolt-server lane in place of the docker lane
bazel.yml's container-lane job becomes bazel-doltserver: `bazel test
//... --config=doltserver`, whose targets start their own dolt
sql-servers and so execute on the remote workers (locally for forks and
rbe=off) instead of against the runner's docker daemon. The docker lane
stays reachable as the A/B control: workflow_dispatch dolt-lane=docker
runs --config=docker in the same job, with the image pull that only it
needs. Still advisory; runner, rbe-west gate and secret handling are
unchanged. Policy test and TESTING.md follow.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): reap processes left in a test's private root on exit
A Bazel test timeout signals the test's process group, which misses the
detached bd db-proxy-child processes (Setsid) and the dolt sql-servers they
start. A proxy that died without its idle timeout left its server orphaned on
a persistent remote worker. test_env.sh's EXIT trap now kills every process of
the current user whose command line names the action's private mktemp root
(pkill -f, two passes; a /proc scan when pkill is absent) before removing it.
The root is unique per action and never in the wrapper's own argv; cleanup
still cannot change the test's exit status.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): fail closed on every dolt-server target, checked per rule
The no-short twins (domain, domain/fs, domain/git, tracker/conformance) now
pin BEADS_TEST_DOLT_SERVER=local and BEADS_TEST_REQUIRE_DOLT_CONTAINER=1 like
the lane's other targets, so a Dolt-server test added to those packages fails
instead of skipping into a cached pass.
TestBazelDoltJobMirrorsContainerJobs checked the env with a file-wide
substring search, so a docker variant in the same BUILD file covered for a
dolt-server target that lost it. It now parses each rule tagged dolt-server
and requires both variables, BEADS_FIX_REQUIRE_DOLT on fix_dolt_test,
BEADS_PROTOCOL_REQUIRE_DOLT on protocol_dolt_test, and no no-remote-exec.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(test): find the module root only when the concurrency test builds its binary
TestConcurrencyMultiProcess looked up go.mod before checking
BEADS_TEST_EMBEDDED_TEST_BINARY, so a pre-built binary run outside a
checkout (Bazel's runfiles hold no go.mod) failed before using it. Only
the fallback go test -c build needs the module root.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): job-mode equivalence reports TestEmbedded tests Bazel ran extra
The extra-test check always ignored ^TestEmbedded names, the --config=ci
lane's implicit skip, so a job comparison of the embedded tier could not
see a Bazel variant running more TestEmbedded* tests than the CI job.
Apply the skip only outside --job.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(bazel): embedded-Dolt tier variants and --config=embedded
PR Risk's embedded tier as embedded-tagged variants over the existing
race test binaries (no second compile):
- //cmd/bd:bd_embedded_test (20 shards) and
//internal/storage/embeddeddolt:embeddeddolt_embedded_test (5 shards)
run the jobs' own shard scripts through go_test_manifest_shard.sh, which
maps Bazel shard k to the script's shard k+1 of n and stops the binary
from sharding again. Each Bazel shard runs exactly the tests of the CI
job with the same number (same discovery, committed manifest and hash
fallback, binary flags). A plain -test.run ^TestEmbedded would not: nine
TestEmbedded* functions outside *_embedded_test.go run in no CI job.
- embeddeddolt_conformance_core_test / _audit_test pass the conformance
jobs' exact selectors and -test.timeout=30m.
- cmd shards use the race //cmd/bd:bd as BEADS_TEST_BD_BINARY, like the
jobs' /tmp/bd-embedded-test.
test:embedded: race, tag filter embedded, build_tests_only, the jobs'
-test.parallel (4) and no -short/BEADS_TEST_SKIP; eternal is capped at
1200s, rbe-west's maximum action timeout.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): run the embedded-Dolt tier in bazel.yml
New advisory job bazel-embedded (same runner, rbe-west gate and secret
handling as the other Bazel jobs) runs bazel test //... --config=embedded.
It is a job of its own so the tier's long race shards stay off
bazel-test's critical path and budget; it compiles nothing bazel-test does
not.
TestBazelEmbeddedJobMirrorsEmbeddedTier ties the config and variants to
pr-risk.yml: race builds, shard totals and scripts, BEADS_TEST_EMBEDDED_DOLT,
the race subprocess bd, the conformance selectors, and no -short.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(bazel): sync BUILD files after rebase onto main
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): Go timeouts below Bazel's 1200s cap for embedded variants
rbe-west caps actions at 1200s, so the eternal embedded variants are killed
there, and rules_go's wrapper ignores that SIGTERM: a hang ended as a bare
TIMEOUT without the goroutine dump the pr-risk.yml jobs rely on. The cmd
shards (job: -test.timeout=20m) and conformance core/audit (job: 30m) now
pass -test.timeout=19m, a documented deviation, so Go's timeout fires first.
Storage shards keep the job's 15m, which already does.
Correct the .bazelrc and BUILD comments that claimed the variants keep "the
jobs' own" timeouts, and state each target's effective limit. The policy
test now pins the 19m on the cmd shards and in place of the conformance
jobs' 30m (and flags a change of the jobs' value).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): fail bazel-embedded on targets or shards that ran no tests
The embedded variants inherit silent passes from PR Risk's shard scripts:
a shard the manifest assigns nothing exits 0 ("no tests assigned"), and a
manifest missing from the runfiles falls back to hash assignment, so every
shard still passes but no longer runs its job's tests.
- tools/bazel/check_testcases.py reads the run's BEP and fails if any tested
target's test.xml, or any shard's, is missing or lists no top-level test
(reusing equivalence.py's BEP and testlogs helpers). bazel-embedded writes
a BEP and runs it after the tests; test logs now upload on any failure.
- The policy test requires each manifest-sharded variant's data to hold its
shard script and the script's default manifest, and pins the new step.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): run bazel-embedded only with remote execution
Fork PRs and rbe=off dispatches ran the embedded-Dolt tier locally: 27 race
test processes (~7-10k test-seconds) plus the race compile of cmd/bd on one
GitHub-hosted runner, est. an hour or more per fork PR against the pool
whose job cap this track exists to relieve, while pr-risk.yml's embedded
jobs already run those tests for forks. bazel-embedded now runs only when
rbe-west is on (RBE_WEST_WORKERS, same repo, rbe != off); its job and step
timeouts shrink to the remote budget (60/50 min).
The policy test pins this job's if and keeps every other job on the shared
fork / rbe=off rule.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(testutil): local dolt sql-server backend behind the Dolt test server API
Add a second backend to internal/testutil behind the unchanged container
API (EnsureDoltContainerForTestMain, RequireDoltContainer,
StartIsolatedDoltContainer[Handle], NewContainerProvider,
RestartSharedDoltContainer, DoltContainerCrashed, IsolatedDoltContainer
Stop/Start/CurrentPort/Exec): the test process spawns `dolt sql-server`
from the pinned dolt CLI instead of a dolthub/dolt-sql-server container.
- BEADS_TEST_DOLT_SERVER=local|container selects it; unset keeps plain
`go test` on the container (no behavior change) and makes `bazel test`
use the local backend. Other values fail instead of guessing.
- The CLI (BEADS_TEST_DOLT_BINARY, else PATH) must be the image's version.
- Provisioned like testcontainers' dolt module: root@% (DOLT_ROOT_HOST=%),
database beads_test, user test/test. Clean env, TZ=UTC, GOMAXPROCS=4,
own dolt global config with metrics and the version check disabled.
- Loopback port picked here (dolt rejects -P 0), never 3307, retried when
another process wins the port; readiness requires the server's own
"Server ready" line plus a bounded ping, so a foreign listener on a
contested port cannot pass for it.
- State lives under the TMPDIR captured at package init, outside every
PinSuiteTempRoot root, so suite leak sweeps never see it. The server
stays in the test's process group (bazel's group kill reaps it) with
Pdeathsig on Linux.
- BEADS_TEST_REQUIRE_DOLT_CONTAINER=1 now also makes every TestMain that
only warned about an unavailable server exit 1
(DoltUnavailableForTestMain), plus the shared proxied harness.
- dolt_benchmark_purge_test finds .dolt_dropped_databases relative to
Exec's working directory (the data dir in both backends).
- TestDoltServerFingerprint checks each available backend against one
checked-in fingerprint (users, grants, databases, server variables);
local-backend tests cover the bind-race retry, 3307, crash detection,
Stop/Start, Exec cwd, state outside the suite root, and teardown.
- Bazel: the requires-docker variants pin BEADS_TEST_DOLT_SERVER=container
so the docker lane stays the container A/B control; the test wrapper's
dolt global config disables metrics and the version check.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(testutil): select the local Dolt test server only when asked for
Under Bazel an unset BEADS_TEST_DOLT_SERVER used to mean the local
backend, so every non-ci `bazel test` started servers for Dolt suites no
lane runs with one (//internal/storage/dolt:dolt_test went from a 16 s
skip to a timeout). Unset now means container everywhere: in a Bazel
action without docker that is the pre-existing warn+skip, and only a
target's env or --test_env=BEADS_TEST_DOLT_SERVER=local starts local
servers. Plain `go test` is unchanged.
The docker variants keep their container pin: a rule env beats
--test_env, so a local-backend invocation cannot flip the docker lane.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(testutil): harden the local Dolt test server's host footprint
- DOLT_DISABLE_EVENT_FLUSH=1 for every dolt the backend runs (and in the
Bazel test wrapper): the metrics/versioncheck keys stop network calls
but not the detached `dolt send-metrics` child each command forks on
exit, which re-created the version probe's removed HOME (one leaked
bdt-doltver-* per test process) and raced terminate's RemoveAll.
- Every bdt-dolt-*/bdt-doltver-* root records its owner PID, and the
first use of the backend in a process removes this user's roots whose
owner is dead (the SweepDeadSuiteRoots rule; a copy, since doltserver's
tests import testutil). A panicking, timed-out or killed test binary,
or a package whose TestMain never terminates the singleton, no longer
leaks a 40-100 MB state dir per run.
- secure_file_priv is the state root's sfp/ directory, set through a
per-launch --config file (dolt ignores other flags with --config): a
local server runs as the test user on the host with a passwordless
root@%, so LOAD_FILE / INTO OUTFILE must not reach the user's files.
The fingerprint treats that path as the container's "".
- Fingerprint: character_set_server, collation_server,
max_allowed_packet, transaction_isolation, lower_case_table_names,
lower_case_file_system (compared on Linux only: APFS reports ON),
wait_timeout, innodb_lock_wait_timeout.
- The local backend's own tests skip off Linux (no Pdeathsig, so a
killed test binary would orphan servers on the macOS runners) unless
BEADS_TEST_DOLT_SERVER=local asks for them.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: compare the container and local Dolt test servers in the domain+uow job
TestDoltServerFingerprint's container half never ran in CI: only the
test-domain-uow job has both the pulled image and the pinned dolt CLI,
and it never ran ./internal/testutil. Run the fingerprint there (with
BEADS_TEST_REQUIRE_DOLT_CONTAINER=1 so the container half cannot skip)
so an image bump that drifts the container side fails in the PR.
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(bazel): require exclude read-permission coverage in test:prcore
pr.yml's PR Core step sets BEADS_TEST_REQUIRE_EXCLUDE_PERMISSION=1 so
TestAddExcludePatternsRefusesReadErrors fails, rather than skips, on a root
or non-POSIX executor. test:prcore now sets it too, and a policy test keeps
the two in step.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(bazel): compare Bazel runs with one CI job's go test results
equivalence.py --job takes a job's `go test -json` as the complete expected
set, so a Bazel selection can be shown to replace that job: every top-level
test the job ran must run under Bazel, no other test in those packages may,
and nothing the job passed may be skipped. --bep is repeatable (a job can map
to --config=ci plus --config=docker), and go_test_variant.sh sh_tests count,
since their go_test binary writes the same test.xml. In job mode a test seen
in several targets keeps its best status: the prcore run skips what the
docker variant exists to run.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): docker-lane variant for internal/tracker
pr.yml's "Test (storage domain + uow)" job runs ./internal/tracker/... with
-race and without -short or BEADS_TEST_SKIP=dolt, so tracker's TestMain
starts the shared dolt container and all 112 top-level tests run. Under
--config=prcore they skip. tracker_docker_test reruns tracker_test that way
in the docker lane, and tracker's TestMain now fails instead of skipping when
BEADS_TEST_REQUIRE_DOLT_CONTAINER=1 and the container does not start.
The job's other packages (storage/domain, domain/fs, domain/git,
tracker/conformance) consult neither testing.Short nor the dolt skip, and
pass identically under --config=ci.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): publish the Bazel-built bd as a ci-build-artifacts artifact
pr.yml's build-artifacts job uploads ci-build-artifacts (bd-linux-gms-pure,
SHA256SUMS, build-manifest.txt), which PR Core, the domain+uow job and both
package gates download and check with `sha256sum -c`. The Bazel lane now
uploads the same name and layout from //cmd/bd:bd_for_tests, the non-race
gms_pure_go cgo bd its own tests exec (//cmd/bd:bd is race-built under
--config=ci); test:ci downloads it under --remote_download_minimal. No
consumer is repointed yet.
A rules_go binary has no vcs.* or CGO_ENABLED build settings: `bd version`
shows no commit, and scripts/verify-cgo.sh would pass it vacuously. No
consumer of this artifact reads either; the manifest records the commit.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): pure-Go and js/wasm lane for pr.yml's boundary job
pr.yml's "Check pure-Go and js/wasm boundaries (CGO_ENABLED=0)" job builds
bd and three test binaries with CGO off, runs a 16-name -short cmd/bd subset,
and runs the js/wasm hook refusal test under node with an exact count guard.
bazel.yml's new bazel-pure job does the same with Bazel binaries:
- --config=pure (--@rules_go//go/config:pure, -test.short) builds //cmd/bd:bd,
bd_test, embeddeddolt_test and tracker_test, and runs bd_test unsharded
with the job's -run selector (policy-tested to stay equal to pr.yml's).
- --config=js-wasm builds //internal/hooks:hooks_test for js/wasm
(--use_target_platform_for_tests satisfies the test toolchain; nothing is
tested by Bazel under it); the Go SDK's go_js_wasm_exec runs it under node
with pr.yml's selector and count guard, verbatim.
rules_go compiles every declared dep, and gazelle's deps ignore the cgo
constraint of beads' embedded-Dolt files, so a pure build compiled dolt's
store/nbs and failed in github.com/dolthub/gozstd (cgo only; go build never
imports it with CGO_ENABLED=0). third_party/patches/gozstd_nocgo.patch adds
panicking !cgo stubs for the API dolt uses.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): run prcore tests with -test.parallel=4 like pr-core.sh
pr-core.sh runs go test -parallel 4. test:prcore passed no -test.parallel,
so Go defaulted to GOMAXPROCS: the executor's core count (192 on a farm
worker) instead of a runner's 4, which let dozens of t.Parallel bd
subprocesses run at once. A policy test keeps the value equal to
pr-core.sh's GO_TEST_PARALLEL default.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): -test.parallel=4 in the pure lane
pr.yml's pure-Go job passes no -parallel, so go test uses GOMAXPROCS, 4 on
ubuntu-latest; under Bazel the default would be the executor's core count.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): run the contract corpus non-race in the docker lane
pr.yml's Contract corpus job runs go test ./cmd/bd/protocol without -race,
but --config=docker races every target. protocol_docker_test now runs
:protocol_race_off, protocol_test built through a race=false transition
(tools/bazel/race.bzl), so no second go_test rule has to track gazelle's
srcs. Tagged manual so other lanes do not build it; the extra non-race work
is protocol_test's link plus ~100 test-only libraries.
The docker lane also mirrors the jobs' concurrency now: they pass no -p or
-parallel, so go test uses GOMAXPROCS, 4 on ubuntu-latest, for both; the
lane runs at most 4 test processes (so at most 4 dolt containers start at
once) with -test.parallel=4. It writes -test.v test.xml like test:ci, for
equivalence.py.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): run the docker lane in bazel.yml
New advisory job bazel-docker runs `bazel test //... --config=docker` on
ubuntu-latest after pre-pulling the dolt image like pr.yml's container jobs.
The requires-docker variants (domain/db, uow, tracker, doctor/fix,
protocol) run on the runner against its docker daemon (no-remote-exec);
their builds use remote execution when setup-bazel configured it. With
bazel-test's --config=ci this covers "Test (storage domain + uow)" and
"Contract corpus". The lane name is one env var, so a hermetic dolt-server
lane can replace it.
Policy tests now cover every bazel.yml job: an exact job list, timeouts, no
continue-on-error, pinned actions (setup-node added), one setup-bazel step
per job as the only secret reader, cache saves only in bazel-test, plus
job-specific mirrors of pr.yml (the docker job's runner, image pull and
lane; a requires-docker target in each container-backed package).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* perf(bazel): build the non-race contract corpus in bd_for_tests' configuration
go_test_race_off only set race=false, while rules_go's go_transition (as
used by //cmd/bd:bd_for_tests, race = "off") also records the overridden
value in original_race. The two non-race configurations differed, so the
docker lane (and --config=ci, which builds protocol_docker_test through
//...) compiled the whole dolt graph twice without race. Record
original_race the same way: aquery GoCompilePkg for
deps(protocol_docker_test) under race drops from ~2630 actions in two
configurations to 1359 in one.
Fix the BUILD comment: manual does not keep protocol_race_off out of other
lanes' builds; protocol_docker_test pulls it in.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): job-mode equivalence fails on any target's failure or missing test.xml
In --job mode a test seen in several targets keeps its best status, so a
failure in one variant was hidden when another target passed the test, and
a go_test_variant.sh sh_test without a test.xml was skipped silently. List
every failed test per target and every target in the job's packages whose
test.xml is missing, and fail on either.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): gate pure-lane contamination, never cache docker-lane results
- gozstd_nocgo.patch: the stubs' package init panics, so a pure binary
that links gozstd (which CGO_ENABLED=0 go build rejects at compile time)
fails at startup. bazel-pure starts every pure artifact (bd version, and
embeddeddolt_test/tracker_test with -test.run=^$; bd_test runs its
subset) so contamination fails the lane.
- test:docker --nocache_test_results: the requires-docker variants depend on
host state no action key covers, like the container jobs' -count=1.
build:remote-exec --noremote_upload_local_results in the committed rc, so
local runs cannot seed the shared cache with host-dependent results.
- The artifact packaging moves to scripts/ci/package-bazel-bd.sh, which
sources .buildflags itself; sourcing it in bazel.yml exempted the whole
workflow from the build-tag scan.
- bazel-pure and bazel-docker use bazel-test's runs-on (Blacksmith when
remote execution is possible); the policy test pins it for every job.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): put the pure and docker lanes behind the rbe-west gate
Apply bazel-test's rbe-west setup-bazel env (RBE_WEST_EXECUTOR, instance
oss, RBE_WEST_WORKERS) and its job if to bazel-pure and bazel-docker, so
same-repo runs of all three lanes skip together until the variable is set
and forks and rbe=off dispatches still run locally. The policy test pins
runs-on, if and the setup-bazel env for every bazel.yml job.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): run the js/wasm hook test with a minimal environment
wasm_exec.js caps argv+env size, and the Blacksmith runner's environment
exceeds it ("total length of command line and environment variables
exceeds limit").
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 Bazel workflow and setup-bazel action
Add .github/workflows/bazel.yml, a side-by-side lane that runs
`bazel test //... --config=ci` (PR Core parity) on pull_request,
merge_group, push to main and workflow_dispatch. It is advisory: not in
ci-gate's CI_GATE_REQUIRED.
.github/actions/setup-bazel installs a sha256-pinned Bazelisk (Bazel from
.bazelversion), restores the runner cache (--disk_cache and
--repository_cache only), and writes a CI bazelrc outside the workspace
and outside the cached directory. Remote execution is enabled only when
BAZEL_REMOTE_EXECUTOR, RBE_TLS_CERT and RBE_TLS_KEY are all set (base64
PEM cert/key; optional RBE_TLS_CA, RBE_INSTANCE); none set (fork PRs, or
workflow_dispatch rbe=off) runs locally; a partial set fails. The endpoint
and its bare host are masked. The rc logic lives in write-bazelrc.sh so it
is testable offline.
The runner cache is saved only by push-to-main runs under a run-unique key
and restored by prefix, so it never freezes at its first save and PRs do
not churn the quota. The job also reports the tier (T1/T2/local) and
wall time in the step summary, runs tools/bazel/critpath.py against the
profile, and checks BUILD drift with make bazel-sync-check plus
make bazel-sync and a clean git status.
tools/bazel/critpath.py reports the critical path as the sum of the
chained "critical path component" events rather than the longest one (a
cold race build: 395s over 75 components, where the single-component
version printed 69s and a false scheduling gap), lists the longest
members and Bazel's processes: cache line, and checks a report-only
budget (warning annotation, exit 0) unless --enforce is given.
scripts/ci_workflow_test.go covers the new lane: not wired into any gate,
every action SHA-pinned to the repo's released SHAs, no monolithic
actions/cache, no unbounded apt-get, the cache topology, secrets only
reaching setup-bazel, --profile after `test`, and the rc writer's
none/partial/full/invalid-PEM/secret-dir-in-workspace behaviour.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): check go test / Bazel test equivalence in the Bazel lane
tools/bazel/equivalence.py compares the Go tests `bazel test //...
--config=ci` ran with the ones pr.yml's go test lanes run, so a tag
filter, a stray manual tag, a package without a go_test target, or a
shard that runs zero tests cannot shrink the Bazel lane while it stays
green:
- package set: every package `go list -race -tags gms_pure_go` reports
with test files has a go_test target (bazel query);
- test-name set: every top-level TestXxx in the files go list selects
(minus ^TestEmbedded, as PR Core skips) appears as a testcase in the
test.xml of a go_test target this invocation tested (from the BEP);
runtime skips count as run. Tests Bazel ran that go test would not
are divergences too.
Expected differences go in tools/bazel/equivalence_allowlist.txt, one
justified line each (empty today); unused entries are reported.
Results go to the step summary; the full listing with --details.
.bazelrc test:ci now sets GO_TEST_WRAP_TESTV=1 (rules_go lists passing
tests in test.xml only under -test.v) and downloads test.xml despite
--remote_download_minimal.
The Bazel workflow runs the check after the critical-path report, and
nightly.yml calls the workflow (suite "bazel", and on schedule) with the
full listing.
Verified locally against a remote --config=ci run: 103 packages and
8843 tests on both sides. Tagging //internal/gitignore:gitignore_test
manual keeps `bazel test` green but fails the check, listing its two
tests.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(fs): run RepoContextAndRole from its own git repo
The test relied on its working directory being inside a git checkout to
make BEADS_DIR external to the CWD repo. Under Bazel the working
directory is the runfiles tree, not a git repository, so RepoContext
failed with "not a git repository" and the test skipped itself.
Create a second temporary repo and chdir into it instead; go test keeps
passing and Bazel now runs the assertions.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): fail equivalence on tests Bazel skips but go test passes
The equivalence docstring claimed runtime skips count as run because go
test skips them the same way. It does not: against PR Core's go test
-json on the same commit, 11 tests passed under go test and skipped
under Bazel while the check printed ok with an empty allowlist.
- equivalence.py --go-test-json compares per-test status with the
Bazel test.xml: passed under go test and skipped under Bazel is a
divergence; other status differences are listed, not failed. The
in-job (PR) run cannot see skip divergences and says so.
- The allowlist gains a `skip` kind (`<pkg> <test> skip # why`, the
justification still mandatory) and lists the 10 intentional skips:
cmd/bd TestGOMODCACHENotUnderTestHome and TestZZStdioNotLeaked, and
the scripts policy tests that walk the source checkout. The eleventh,
fs TestContextRepository_RepoContextAndRole, is fixed in the test.
- scripts/ci/pr-core.sh writes `go test -json` to
BEADS_PR_CORE_GO_TEST_JSON when set (same flags otherwise).
- nightly.yml runs that in a new job, uploads the JSON, and calls
bazel.yml with go-test-json-artifact, which downloads it and passes
--go-test-json to the equivalence step.
Verified on a remote `bazel test //... --config=ci` run: ok with the
allowlist; a TEST_SRCDIR-only t.Skip injected into
internal/gitignore TestAppendLines fails the check (and passes the
name-only in-job check, as documented).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): freeze the runner cache per lock, mask key material, tighten policy
Runner cache: every push to main saved ~2.3 GB (repository cache, disk
cache, Bazelisk) under a run-unique key, on a repo already over its
Actions cache quota. The cache now holds only the repository cache and
Bazelisk, whose content is fixed by .bazelversion and MODULE.bazel.lock:
exact key bazel-repo-v2-<os>-<hash>, restore falls back to the previous
lock's entry, and only a push to main that missed the key saves. No
--disk_cache in either mode (remote runs have the remote cache; local
runs never used it). About 2 GB per lock change.
Credentials:
- write-bazelrc.sh masks every non-armor line of each decoded PEM
(cert, key, CA). GitHub only masks the base64 value as stored. The CA
used to be decoded inside the rc redirect, so its mask commands would
have gone into the rc; it is decoded first now.
- The CI rc sets build:remote-exec --noremote_upload_local_results, so
CI never writes locally executed (PR-code) results into the shared
action cache. Developer rcs keep Bazel's default.
- RBE_INSTANCE stays optional; an empty one is a ::warning.
- bazel.yml's header states the accepted risk: same-repo PR code runs
with the RBE client certificate (as in gascity); forks never get it;
what is in place and what is pending a human decision.
Policy tests (each proved with a scratch mutation that now fails):
triggers must be exactly pull_request, merge_group, push,
workflow_dispatch and workflow_call (no pull_request_target); secrets
may appear only in the setup-bazel step's env, not in workflow or job
env, run, with or if; no continue-on-error anywhere in bazel.yml or
setup-bazel; the cache-save if is matched exactly; the critical-path
and equivalence steps must end with the bare script call and the test
step with exit "$rc", with no exit 0, || true, || :, ; true, set +e or
trap.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(ci): record the same-repo RBE decision in bazel.yml
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): bazel wrapper version check; keep go-test prose out of the build-tag scan
The wrapper prepends --bazelrc, so 'bazel --version' reached the server
as an unknown startup option; ask bazelisk directly. check-build-tags
matched 'go test' in workflow prose and step names.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): run the RBE lane on Blacksmith runners; mask the executor's IPs
GitHub-hosted runners are refused by the remote-execution edge; the
Blacksmith pool (as in gascity) is admitted and does not count against
GitHub's concurrent-job cap. Forks and rbe=off keep ubuntu-latest.
Bazel prints the resolved executor address in connection errors, so mask
every address the endpoint host resolves to.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): target rbe-west (instance oss) behind RBE_WEST_WORKERS
The original edge does not admit CI runners. Mirror gascity: remote
execution uses secrets.RBE_WEST_EXECUTOR and instance oss when the repo
variable RBE_WEST_WORKERS is true; same-repo runs are skipped until then
instead of failing, while forks and rbe=off still run locally.
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(doctor): detect test binaries with testing.Testing(), not the file name
getBdBinary refuses to return a test binary as "bd" so fix tests cannot
fork-bomb by re-running themselves. The guard matched only the `go test`
naming (<pkg>.test). Bazel names test binaries <target>_test, so under
`bazel test` every fix that shells out to bd re-ran the whole fix_test suite,
recursively (~60 levels), until the 300s timeout.
testing.Testing() is true for any binary linked as a test by `go test` or
rules_go (both set testing.testBinary=1), whatever its name. The name check
stays as a fallback. bd already links package testing, so the product binary
gains no dependency. Behavior under `go test` is unchanged.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): tag taxonomy, docker lane, and green //scripts targets (slice B5)
`bazel test //... --config=ci` is now fully green, locally and with
--config=remote-exec.
- scripts_test declares what it reads and runs: this package's own tree
(:scripts_files), .github/** (//:workflow_files, widened from the
workflows), and .buildflags/.test-skip for scripts/test.sh. The complexity
diff test builds a one-commit git fixture instead of git-archiving the
real checkout's HEAD. Under Bazel it skips the whole-repo testing.Short()
scan (it would pass vacuously over the runfiles) and the two release
formula tests (.beads is in .bazelignore). Tagged host-tools +
no-remote-exec: it runs the host's git/python3/coreutils and some subtests
skip without git.
- prlintmake_test resolves fmt-check.sh through bazeltest.CallerDir and
declares it; it needs only bash (gofmt is shimmed), so it stays untagged
and runs remotely.
- //cmd/bd/doctor/fix:fix_docker_test reruns the fix_test binary (no second
compile, tools/bazel/go_test_variant.sh) with BEADS_FIX_REQUIRE_DOLT=1, like
pr.yml's container-backed doctor/fix job. Tagged requires-docker +
no-remote-exec; `--config=docker` selects it (race, no -short, no
BEADS_TEST_SKIP=dolt). fix_test itself stays untagged: under prcore it
skips the Dolt-backed tests exactly as pr-core's `go test` does.
- scripts/bazel_policy_test.go: every BUILD `tags` value must be in the
taxonomy, be named in the comment above its rule, and host-bound tags must
come with no-remote-exec; test:prcore must exclude requires-docker,
embedded and manual.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bd): reset git's cwd cache in TestContextRoutesNameOneWorkspaceTheSameWay
The test chdirs into a fresh git repo but reset only beads' caches. git
caches the cwd's repository context process-wide, so when an earlier test in
the same process had resolved it from a non-repo directory (for example
TestCollectMetadataEntriesNoBeadsDir), GetMainRepoRoot kept answering "not a
git repository". Test order hid it under `go test ./cmd/bd`; Bazel sharding
reorders tests and exposed it. Reproduces with plain go test:
go test -run '^(TestCollectMetadataEntriesNoBeadsDir|TestContextRoutesNameOneWorkspaceTheSameWay)$' ./cmd/bd
The cache is reset on entry only. Resetting it again in cleanup changes what
later tests inherit, and TestCreateRemoteRepoSkipsLocalDatabaseGuard (which
never resets it) then fails under the unsharded go test order.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): shard bd_test and embeddeddolt_test; keep test re-execs shard-free (slice B6)
- //cmd/bd:bd_test shard_count = 16, //internal/storage/embeddeddolt:
embeddeddolt_test shard_count = 8. Remote -race under --config=ci: bd_test
max shard 61-82s (unsharded 252-264s), embeddeddolt max shard 84-122s
(unsharded 207-377s). The embeddeddolt max is a single test
(TestWithPeerAuth, ~93s), so more shards would not lower it. Every shard
runs tests (bd 161-172 top-level tests each, embeddeddolt 15-20).
protocol (4s), legacysqlite (4s) and dbproxy/server (22s) stay unsharded.
- Tests that re-exec their own binary now pass bazeltest.ShardFreeEnv
(a no-op under go test), so a helper child does not inherit
TEST_SHARD_INDEX/TEST_TOTAL_SHARDS/TEST_SHARD_STATUS_FILE and filter away
the one test it was asked to run: dolt suite_leak_linux, dbproxy
force_stop_linux, workspacegate (3 helpers), metrics spawn_reap, bd
worktree_remove, conformance role_bundle, linear synclock (windows).
scripts/test_script_test.go (child env built from scratch) and
repro-dolt-prod-timeouts (copies the binary, never runs it) need nothing.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): keep sharded bd_test off ~/.beads and keep its stdio leak guard
Two things sharding //cmd/bd:bd_test exposed:
- config.Initialize walks up from the test's cwd for .beads/config.yaml and,
under BEADS_TEST_IGNORE_REPO_CONFIG, stops at the module root (go.mod).
The runfiles tree had no go.mod, so the walk left it; with the output base
under $HOME it loaded the developer's ~/.beads/config.yaml (here
dolt.shared-server: true) and two embedded-mode autocommit tests failed
locally, though not on remote workers. bd_test now declares //:go.mod, so
the walk stops at the runfiles root as it stops at the checkout under go
test. Unsharded runs hid this: an earlier test re-initialized config first.
- TestZZStdioNotLeaked skipped in every shard, because the baseline test is
always in shard 1 and the guard in another. Without a baseline it now
checks the descriptors instead (a leaked capture leaves a pipe where fd 1
or 2 was). Under go test the baseline is always captured, so nothing
changes there.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(bazel): sync BUILD files with test files added on main
Gazelle picks up cmd/bd and internal/notion tests that landed on main after
the last sync (make bazel-sync).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(discovery): add BEADS_CEILING_DIRECTORIES; bound bazel tests' walks
bd finds its workspace by walking up from the working directory for .beads
and .beads/config.yaml. Under `bazel test` the working directory is in the
runfiles tree under the output base, usually below the developer's HOME, so
the walks left the sandbox: tests read the developer's ~/.beads/config.yaml
(results depended on it) and wrote into ~/.beads (interactions.jsonl from the
audit log, .local_version from version tracking).
BEADS_CEILING_DIRECTORIES takes git's GIT_CEILING_DIRECTORIES form (a PATH-
style list of absolute directories): a search starting inside a ceiling never
examines the ceiling or anything above it; the start itself is always
examined. Unset, nothing changes. Honored by every upward .beads/config
search: beads.AncestorDirWalk (all FindBeadsDir walks), config.Initialize
(the go.mod and config.yaml walks, and the worktree-fallback git probe, whose
routing scrub drops GIT_CEILING_DIRECTORIES), findProjectBeadsDir, the legacy
upgrade guard, the --db beads-dir walk, store reopen and findBeadsRepoRoot.
The migration-freeze marker walk is left alone on purpose: it is a write
safety gate, and BD_MIGRATION_FREEZE_FILE is already its explicit override.
tools/bazel/test_env.sh sets BEADS_CEILING_DIRECTORIES and
GIT_CEILING_DIRECTORIES to the runfiles root, TEST_TMPDIR and its own temp
root. It does not fail on an ancestor .beads: a live ~/.beads above the
output base is normal on a developer machine. bd_test no longer needs
//:go.mod as a walk stop.
Canary check: with an invalid-YAML .beads above a scratch --output_base,
compact, issueops, validation and bd_test pass under --config=ci and nothing
is written there; the previous wrapper fails on it and writes
interactions.jsonl into it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bd): check for leaked stdio after m.Run in every process
TestZZStdioNotLeaked only sees the tests that ran before it in the same
process. Under Bazel's 16-way sharding that is ~1/16 of bd_test: the baseline
test is in shard 1, the guard in another shard, and leaks in the other shards
were never checked.
TestMain now compares os.Stdout/os.Stderr after m.Run with the streams from
before it (runTestsAndSweep, so every shard and every go test run) and fails
the process on a leak. The one allowed change is the framework's own
os.Stderr = os.Stdout under -json. TestZZStdioNotLeaked stays for its go test
report and skips when it has no baseline; the descriptor fallback added for
sharding is gone.
Verified: a test that leaks os.Stdout fails `go test -run` for it alone, with
and without -json; a clean -json run passes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): keep host-tools results out of the remote cache; tighten tag policy
- //scripts:scripts_test (host-tools, no-remote-exec) ran locally but its
result was still uploaded to the remote cache and served to other clients,
though the action key does not cover the host's git/python3/bash. It is now
also tagged no-remote-cache (neither read nor uploaded). Checked: after a
--config=remote-exec run and `bazel clean`, a rerun without the disk cache
executes the test again instead of taking a remote cache hit.
- Under Bazel a missing git or bash now fails those tests instead of
skipping (the host-tools tag promises them); under go test they still skip.
- Tag policy: host-tools requires no-remote-exec and no-remote-cache;
`tags = [...] + X` is rejected as non-literal; every --test_tag_filters set
by test:prcore or a config that expands it (test:ci, transitively) must
exclude requires-docker/embedded/manual, not only the first prcore line.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): run go_test variants from their package directory
rules_go gives a go_test GO_TEST_RUN_FROM_BAZEL=1 (and its `env`) through
RunEnvironmentInfo; an sh_test that reruns the binary gets neither, so the
binary skipped its chdir into the package directory and ran from the
runfiles root. go_test_variant.sh now exports GO_TEST_RUN_FROM_BAZEL=1, and
its header says the variant target must repeat the go_test's `env`.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): docker-lane variants for domain/db, uow and protocol
--config=docker only ran doctor/fix. pr.yml's container jobs also run
internal/storage/domain/... + uow/... (race, no -short, Dolt image pulled)
and cmd/bd/protocol (BEADS_PROTOCOL_REQUIRE_DOLT=1). Under --config=ci those
container suites skip (BEADS_TEST_SKIP=dolt), so without variants their
coverage would vanish if Bazel replaced those jobs.
- testutil: BEADS_TEST_REQUIRE_DOLT_CONTAINER=1 makes RequireDoltContainer
and StartIsolatedDoltContainer(Handle) fail instead of skip when the Dolt
container is unavailable (the generic form of BEADS_FIX_REQUIRE_DOLT).
- db_docker_test, uow_docker_test (4 shards) and protocol_docker_test
(8 shards, BEADS_PROTOCOL_REQUIRE_DOLT=1) rerun the go_test binaries via
go_test_variant.sh, repeating their `env`; tagged requires-docker +
no-remote-exec. The other domain/tracker packages have no container tests
and already run under --config=ci.
`bazel test //... --config=docker --test_arg=-test.v`: 4/4 PASS; db 908
PASS / 0 SKIP, uow 985 PASS / 32 SKIP (conformance capabilities the backend
does not implement, as under go test), protocol 151 PASS / 2 SKIP (tracked
known gaps). With --test_env=BEADS_TEST_SKIP=dolt, db_docker_test fails.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test: shard-free env for the embeddeddolt concurrency helper; 2m bd init timeout
- concurrency_test re-execs its test binary with -test.run=^TestHelperProcess$
inside the now-sharded embeddeddolt_test; pass bazeltest.ShardFreeEnv so a
child cannot inherit TEST_SHARD_* and filter its one test away (it is
gated by BEADS_TEST_EMBEDDED_DOLT=1, so dark today).
- initBeadsWorkspace / runBDStdout (TestClose_UpdatesLastTouched and the
gemini prime hook tests) allowed 30s per bd subprocess. A -race bd on a
loaded host exceeded that for a single `bd init` (killed at 30.18s in 1 of
3 sharded remote runs; the whole test otherwise passes in ~21s), so allow
2 minutes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bd): give TestCreateRemoteRepoSkipsLocalDatabaseGuard its own git state
The test chdirs into a fresh non-repo temp dir but used whatever git/beads
cwd caches earlier tests left. When an earlier test had reset git's cache and
a later one refilled it from the package directory, workspace discovery in
the test returned the checkout's .beads (from a git worktree: the MAIN
checkout's live .beads via the worktree fallback) and `bd create` tried to
open it, so it failed with "could not verify workspace identity" instead of
the expected downstream error. It passed only on stale state (a cache
pointing at a deleted temp repo).
It now resets the git and beads caches after its chdir and again in cleanup,
so it neither depends on nor leaks cwd state. With that fixed,
TestContextRoutesNameOneWorkspaceTheSameWay also resets git's cache in
cleanup. Reproduced with the context-test cleanup reset in place, running
every cmd/bd test declared up to this one (the failing go test order); now
passes there, alone, with the two context tests, and under -shuffle seeds
1-5 (other pre-existing order dependencies show up under shuffle; this test
is not among them).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* build(bazel): re-sync BUILD files with main
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): pin BD_MIGRATION_FREEZE_FILE in test_env
The freeze-marker ancestor walk is intentionally not ceiling-bounded; an
explicit BD_MIGRATION_FREEZE_FILE replaces the walk, so a MIGRATION-FREEZE
above the output base can no longer change test results.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(scripts): give the complexity diff fixture a Go package
complexity.sh expands "${analyzer_paths[@]}" under set -u; with an empty
fixture tree that is an unbound-variable error on bash 3.2 (macOS runners).
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(bazel): run every test against a hermetic, pinned dolt CLI (slice B4)
Tests that shell out to dolt ran whatever /usr/local/bin/dolt the executor
had, a version outside the action key, and skipped (a vacuous, cacheable
PASS) on an executor without one.
- tools/bazel/dolt.bzl: dolt_release repository rule fetching the upstream
release pinned to scripts/ci/install-dolt.sh (2.2.0), sha256 for
linux/darwin amd64/arm64; MODULE.bazel declares one repo per platform and
//tools/bazel:dolt selects the one for the execution platform.
- //tools/bazel:test_env (the --run_under wrapper) carries the pinned dolt
as data. Bazel merges the run_under runfiles into every test's runfiles, so
every test action declares dolt as an input; test_env.sh puts it first on
PATH, exports BEADS_TEST_DOLT_BINARY, and fails the test if it is missing.
DOLT_ROOT_PATH identity seeding stays in test_env.sh.
- testutil.requireDoltBinaryPresent fails instead of skipping under Bazel.
- TestPinnedDoltCLIMatchesContainerImage also checks tools/bazel/dolt.bzl.
scripts_test declares the pin files and resolves the repo root through
bazeltest, so the three dolt pin tests now pass under bazel test.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): declare the Go source dolt_test's scope guards scan
TestEveryRawTxJournalScopeIsScopedOrExempt, TestEveryRawTxVersionScopeIsScopedOrExempt,
TestTxMintingWrappersScopeVersionedHistory and TestHelperSubprocessSentinelsAreComplete
parse internal/storage/dolt and internal/storage/issueops at test time; under
bazel test that source was not in the runfiles, so all four failed.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): tie hermetic dolt download to its version; skip on unpinned platforms
- Key DOLT_SHA256 by version and pass canonical_id=url, so bumping
DOLT_VERSION without new digests fails instead of silently reusing the
previous release from the sha256-keyed repository cache.
- //tools/bazel:dolt_version_test runs the hermetic dolt and checks it
reports DOLT_VERSION.
- Unpinned platforms (e.g. windows) resolve to an incompatible target, so
bazel build //... skips the wrapper there instead of failing analysis.
- test_env.sh also unsets BEADS_DOLT_BIN so it cannot bypass the pin.
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(bazel): isolate the bazel test environment like pr-core's go test
Every `bazel test` process now runs under //tools/bazel:test_env (wired with
`test --run_under`), a wrapper that mirrors scripts/ci/lib/test-env.sh: a
private HOME/USERPROFILE, XDG_CONFIG_HOME, DOLT_ROOT_PATH and empty
GIT_CONFIG_GLOBAL, GIT_CONFIG_NOSYSTEM, BEADS_TEST_IGNORE_REPO_CONFIG, and
the same scrub of workspace/Dolt-server variables. Everything lives in one
fresh mktemp directory under /tmp that is removed when the test exits, so
TMPDIR (t.TempDir) stays short enough for unix sockets and is never shared
between concurrent runs.
This replaces `--test_env=HOME` (the client's HOME string entered the action
key and was shipped to remote workers, where it does not exist: the
embeddeddolt suite panicked on "stat /home/ubuntu") and the shared
`--test_tmpdir=/tmp/bbt`. No host path or client env enters the action key.
bd_test (~10 min under -race -short) and embeddeddolt_test (~6 min) get
size = "large" / timeout = "long" instead of Bazel's 300 s default; pr-core
gives go test -timeout=30m. rules_shell (already in the module graph) becomes
a direct dep for sh_binary. MODULE.bazel.lock records the pybind11 extension
that building these test targets evaluates, so `make bazel-sync` is stable.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): inject the bd binary into subprocess tests (slice B3)
Tests that exec bd used to `go build` it themselves, which cannot work under
`bazel test` (no Go toolchain or module tree in the sandbox or on a remote
worker): 135 cmd/bd subtests failed with "go build failed", and protocol,
doctor and uow failed the same way.
- //cmd/bd:bd_for_tests: a go_binary named bd, race = "off" (the non-race
gms_pure_go binary these tests build today, even under --config=prcore).
- bd_test, protocol_test, doctor_test and uow_test declare it as data and set
BEADS_TEST_BD_BINARY to its $(rlocationpath).
- bazeltest.PrebuiltBD is the one resolver: under Bazel it resolves the
rlocationpath through runfiles (via the new bazeltest.RunfileEnv) and
requires it; under plain go test it keeps today's semantics (absolute form
of BEADS_TEST_BD_BINARY, or "" so the caller builds bd).
- cmd/bd's findPrebuiltBDBinary delegates to it, and the sites that read the
variable by hand (init_embedded, shared_server_integration, cli_fast,
migrate front door) now go through findPrebuiltBDBinary; uow calls it
directly.
- Raw `go build` sites that never honored the variable (protocol, doctor
dolt_e2e, test/conformance e2e, internal/beads integration TestMain) use
it only under Bazel, so go test is unchanged; protocol and doctor fail
instead of skipping when the injection is miswired. tests/regression is
left alone (it builds candidate and baseline binaries on purpose).
- The read-only canary still forces a source build under go test; under
Bazel the injected binary is already built from this tree.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): declare what cmd/bd and doctor tests read under bazel
With bd injected, the remaining //cmd/bd:bd_test and //cmd/bd/doctor failures
under `bazel test` were inputs the tests read from the checkout without
declaring them (they were hidden behind the go-build failures before):
- source-scanning guards (capability registry, events-journal construction,
serve database source) parse cmd/bd, cmd/bd/doctor, cmd/bd/doctor/fix and
internal/storage/embeddeddolt/cmd: those packages get go_srcs filegroups
(tools/bazel/go_srcs.py) declared as data; serve_test resolves its package
dir with bazeltest.CallerDir.
- .githooks (managed-section parity) and examples/formulas/primitives are
declared through //:bd_test_files.
- the gofmt preflight tests exec gofmt: under Bazel they use the Go SDK's,
declared as data and named by BEADS_TEST_GOFMT (bazeltest.RunfileEnv).
- TestGOMODCACHENotUnderTestHome guards in-test `go build`, which does not
happen under Bazel, so it skips there.
- doctor's TestCheckDeletionsManifest_LegacyFile only passed because the
process cwd happened to be inside a git checkout; its fixture is now a git
repo and the check runs in it.
go test behavior is unchanged except that the deletions-manifest test no
longer depends on the caller's cwd.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(bazel): give test_env a dolt identity; never fail on cleanup
beads_test_env_enter sets a dolt user.name/user.email in the fresh
DOLT_ROOT_PATH; test_env.sh created it empty, so tests that shell out to
dolt (remotecache, storage/dolt) failed with 'Author identity unknown'.
Write config_global.json directly (no dolt exec per test).
Also keep rm -rf in the EXIT trap from overriding the test's exit status
when a leftover child is still writing to the tmp root.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* build(bazel): re-sync BUILD files with main
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(bazel): add internal/testutil/bazeltest runfiles helpers
Repository-path resolution for tests that works identically under plain
go test (package cwd, full checkout), bazel test locally, and remote
execution (declared runfiles only):
- IsBazel, RepoRoot (BEADS_TEST_REPO_ROOT, then the runfiles workspace
root, then a go.mod walk), OverrideRoot (drop-in condition for existing
helpers; empty under plain go test), CallerDir
- Runfile for $(rlocationpath) values, GOROOT for type-checking tests
- ShardFreeEnv for helpers that re-exec a test binary
Every helper reduces to the pre-Bazel behavior under go test.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): declare source/data reads for 14 scan-guard targets
Source-scanning and repo-file tests read files their Bazel targets never
declared, so they failed under `bazel test` (and could not run on remote
workers at all). Declare narrow inputs as `data` and resolve paths through
bazeltest where the test located the tree via runtime.Caller:
- tools/bazel/go_srcs.py (run by `make bazel-sync` after gazelle) keeps a
managed `go_srcs` filegroup in the packages whose Go source tests scan,
plus `//internal/storage:tree_go_srcs` for the storage-tree walk. Bazel
globs stop at package boundaries, so the aggregate needs one filegroup
per package; the script keeps it in sync and gazelle-stable.
- Hand-written narrow inputs: //internal/storage/schema:migrations,
//:docsync_files, //plugins/beads:plugin_files, and exports of
.gitattributes, .claude-plugin/marketplace.json, cmd/bd list.go and
ready.go, testutil/testdoltcommon.go, scripts README.md and the release
catalog, each visible only to its consumer.
- runtime.Caller-based roots in backend, backend/conformance,
internal/storage, internal/formula and test/docsync now go through
bazeltest.CallerDir / OverrideRoot; relative-path tests need data only.
- integrations/ leaves .bazelignore (it is still gazelle-excluded) so the
docsync link check can declare integrations/beads-mcp/PYPI.md.
Under --config=prcore every target reports the same PASS/SKIP/FAIL test
set as `go test -race -short` for its package, locally and remotely.
Plain `go test` behavior is unchanged.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): guard generated go_srcs and harden bazeltest root override
- tools/bazel/go_srcs.py: add --check (print diff, exit 1 on stale blocks);
new `make bazel-sync-check` target runs it.
- scripts/bazel_policy_test.go: under go test, assert every tree_go_srcs
(//internal/storage) lists exactly the BUILD.bazel packages below its
root, run go_srcs.py --check, and forbid BUILD files under docs/ and
engdocs/ (they would cut subtrees out of //:docsync_files).
- bazeltest: honor BEADS_TEST_REPO_ROOT only when it holds go.mod
(RepoRoot fails loudly otherwise); drop the unused GOROOT() helper,
whose compiled-in branch could never fire under rules_go.
- scripts/ci/lib/test-env.sh: unset BEADS_TEST_REPO_ROOT.
- Document the hand-listed out-of-tree link targets in //:docsync_files.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* build(bazel): re-sync BUILD files with main
Regenerated with make bazel-sync after commits that landed while the
scaffold PR was in CI (new internal/execenv, gitenv, gitignore packages
and new sources/deps).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): declare init_safety_help.go for docsync
TestInitSafetyCLIHelpCoversReCloneGotchas (#6431) reads
cmd/bd/init_safety_help.go; export it to //test/docsync 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>
* build(bazel): add side-by-side Bazel scaffold (module + gazelle)
Add a Bzlmod Bazel build alongside the Go toolchain. `go build` and
`go test` are unchanged; nothing in CI invokes Bazel yet.
- MODULE.bazel: rules_go 0.63.0, gazelle 0.53.0, Go SDK 1.26.7 (matches
the go.mod toolchain directive), go_deps from go.mod.
- ICU policy (engdocs/ICU-POLICY.md): a go-mysql-server gazelle_override
selects the pure-Go regex backend and excludes regex_cgo.go, and
.bazelrc builds with --@rules_go//go/config:tags=gms_pure_go, so no
target depends on go-icu-regex or links libicu.
- third_party/patches: three module_override patches for dolt deps that
ship WORKSPACE-era BUILD files, adapted from the gascity project.
- .bazelrc: prcore/ci test configs (inert for now; they match pr-core's
test selection, not yet its environment isolation) and a generic
remote-exec config with a bounded remote timeout. Executor endpoints and
TLS credentials come only from a gitignored .bazelrc.local/user.bazelrc
or a CI rc outside the workspace.
- .bazelversion pins Bazel 9.2.0; .bazelignore skips separate modules,
non-Go trees, nested agent worktrees (.claude, .worktrees) and local
data/output dirs (.beads, .dolt, dist, .runtime, tmp), so a primary
checkout neither builds nor gazelle-rewrites nested worktree copies.
- Gazelle-generated BUILD.bazel files for every Go package.
- Makefile: `make bazel-sync` (gazelle + bazel mod tidy).
- .gitignore: bazel-* output symlinks and machine-local rc files.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(bazel): policy tests for the Bazel configuration
Add scripts/bazel_policy_test.go, plain Go tests that run under both
`go test ./scripts` and `bazel test //scripts:scripts_test`:
- MODULE.bazel go_sdk.download version equals the go.mod toolchain.
- ICU policy: .bazelrc sets gms_pure_go for build, the go-mysql-server
gazelle_override excludes regex_cgo.go, and the root BUILD.bazel
carries `# gazelle:build_tags gms_pure_go`.
- .bazelversion pins an exact Bazel release.
- .bazelrc.local and user.bazelrc are gitignored (parsed from .gitignore
and cross-checked with git check-ignore when in a checkout).
- No remote-execution endpoints or credentials in committed bazelrc-like
files, Markdown docs or .github/**: remote/BES/TLS flags
(--remote_executor, --remote_cache, --bes_backend, --remote_header,
--tls_client_certificate, ...) with a literal value, with or without a
URL scheme, and non-loopback gRPC URLs in rc/.github files. Placeholders,
$VARIABLES, and loopback are allowed; Markdown gRPC URLs (OTel exporter
docs) are not flagged. Skipped outside a git checkout, e.g. in the Bazel
sandbox.
Each check is a pure function also exercised against fixtures that break
the invariant. The files the tests read are declared as data via
//:bazel_policy_files so they resolve from runfiles under Bazel.
scripts/check-build-tags.sh now treats Bazel invocations as governed by
.bazelrc: the shell command segment that invokes Bazel (split on &&, ||,
;, |, $( and backticks) is exempt from the per-line `go` tag check, while
a bare `go` in another segment of the same line is still flagged. When
any scanned file invokes Bazel (or .bazelrc exists) .bazelrc must set
--@rules_go//go/config:tags=gms_pure_go for build.
scripts/check_build_tags_test.go covers both in a temp repository.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(scripts): split bazel lines in pure bash so check-build-tags works with BSD sed
BSD sed (macOS) does not expand \n in s/// replacements, so the segment
split never happened and the Bazel-exemption tests failed on macos-latest.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(scripts): skip check-build-tags tests when bash lacks mapfile
macOS runners use /bin/bash 3.2, which has no mapfile; check-build-tags.sh
has always required bash >= 4, so the new tests are skipped there.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Assert the exact native filepath.Join-derived staging directory in the missing-staging error. This preserves the production diagnostic while allowing the regression to pass on Windows as well as POSIX hosts.
Agent-Signature: codex-tui-gpt-5.6-sol-ultra on behalf of Ewen Cuthiell
* docs(pipeline): pin the generated CLI docs to the released bd; repair main's CLI reference
The #4874 squash-merge raced the docs-autofix bot: the bot had pushed a
regeneration from main's source onto the PR branch, so the squash landed a
contradictory mix — the release-aligned hand-written docs plus a CLI
reference re-documenting unreleased commands and flags, with docs.json
referencing four pages (heartbeat, migrate-personal, reclaim, unclaim)
whose files do not exist. That broken nav fails the docsync guard on main
and on every branch cut from it. This restores the intended end state of
#4874 and lands the pin that prevents the race from recurring.
- Regenerate the CLI reference from a bd built from the v1.1.0 tag (CI's
canonical pure-Go build), removing the unreleased commands/flags and
fixing the dangling nav entries.
- docs/cli-docs.pin names the release tag; scripts/resolve-docs-bd.sh
builds and caches a canonical pure-Go bd from that tag, fetching the tag
first in shallow CI checkouts.
- generate-cli-docs.sh, check-doc-flags.sh, and check-cli-docs-drift.sh
resolve bd through the pin and ignore a supplied binary while pinned
(BD_DOCS_IGNORE_PIN=1 bypasses), so the drift gates and the autofix bot
now enforce docs-match-release instead of docs-match-main.
- tools/docsmint detects the pre-overhaul Docusaurus staging layout that
bd <= v1.1.0 emits and converts it to the generic form before its normal
Mintlify transform (tested); removable once the pin reaches a release
whose emitter writes build/cli-docs.
- check-doc-flags.sh: run without timeout(1) on macOS instead of failing
Check 4.
- Decision record: engdocs/decisions/2026-07-17-docs-release-pin.md; the
beads-docs skill §8 updated to match.
* lint: annotate gosec G705 false positive in the docsmint legacy bridge
Same class as the existing nav-splice annotation: a developer tool writing
repo Markdown, not a web-output sink.
- docsmint: all page rewrites (HTML-comment, relative-link, ESM) now skip
fenced code blocks; fence contents render verbatim
- docsmint: spliceCLINav fails closed when the "pages" key found after
"group": "CLI Reference" is not a sibling key of the same object, and
validates the spliced docs.json parses before writing
- docsmint: neutralize MDX ESM hazards in docs/CLI_REFERENCE.md too (bd
emits it without the per-page transforms, but Mintlify serves it as a
hidden page); regenerated docs/CLI_REFERENCE.md accordingly
- help_all: fail loudly when two commands collide on the same doc page ID
instead of letting the later write win; repair a garbled comment
- generate-cli-docs.sh: --check no longer trusts a repo-root ./bd it was
not explicitly given (the CGO guard detects CGO-ness, not staleness)
- docsync: validate the docs.json redirects array (well-formed, no dup
sources, destinations resolve)
- pour: runtime strings match the corrected Long text (Dolt sync, issue
database — not "sync to git" / "persistent in .beads/")
- testdata: formula_help.txt asserts the new docs/workflows/formulas.md path
CI's golangci-lint v2.10.1 carries a newer gosec with taint-analysis rule
G705 (XSS), which flags directory-listing-derived strings flowing into
the docs.json write. Not a web-output sink: this developer tool writes
the repo's own docs.json with %q-quoted slugs the same pipeline
generates. Verified 0 issues under the exact CI linter version.
check-build-tags requires every go test/go run in tracked scripts,
workflows, and the Makefile to carry -tags=gms_pure_go (ICU-linkage
guard): added to the docsync invocations in docs-mintlify.yml and
make check-docs, and to the docsmint stage of generate-cli-docs.sh
(the flagged workflow job name no longer embeds a bare invocation).
docsmint's two variable-path os.ReadFile sites get justified
#nosec G304 annotations — both read only repo-owned files derived
from the tool's repo-root argument. golangci-lint: 0 issues.
Three generated-content defects from the adversarial review, all
structurally invisible to the drift gate (generated-vs-generated):
- Usage lines now mirror Cobra's help template: a runnable command shows
its UseLine, a command with subcommands shows '<path> [command]', both
when both apply. Previously bare UseLine() stamped 'bd mol [flags]' on
30 parent pages — a line the binary never prints.
- The generated CLI index publishes the Global Flags block; the binary
prints it on every --help but no page carried it.
- docsmint neutralizes prose lines that Mintlify's prebuild would dedent
into MDX ESM blocks (a line beginning 'export'/'import' outside a
fence gets wrapped in a code span). This is why /cli-reference/mail
returned HTTP 200 while rendering only a parse-error placeholder —
reproduced, fixed, and covered by a planted-hazard test; fenced
content stays verbatim.
Also rewords check-cli-docs-drift.sh's early-PASS message, which
asserted 'the supplied binary differs' as the cause when uncommitted
local edits produce the same result.
All 113 pages + docs/CLI_REFERENCE.md regenerated through the pipeline;
TDD'd in cmd/bd/help_all_test.go and tools/docsmint/docsmint_test.go.
Verified live: /cli-reference/mail renders real content, zero parse
errors; generate-cli-docs.sh --check, docsync, freshness, and
mint broken-links all pass on this tree.
The 113-page generated CLI Reference moves from a top-level nav group to
a nested group inside Reference — Mintlify renders nested groups
collapsed by default, so the command list no longer dominates the
sidebar. The docsmint nav splice is depth-agnostic (indentation is
derived from the pages key's line), verified by regenerating and by
re-pointing its test fixture at the nested shape. Reference overview and
the beads-docs skill IA note updated.
Per the decision record (engdocs/decisions/2026-07-10-mintlify-docs-overhaul.md):
bd's doc generator is vendor-neutral. `bd help --docs-root` now writes
docs/CLI_REFERENCE.md plus a generic per-command tree (title/description
frontmatter, portable CommonMark, HTML-comment markers) into build/cli-docs/
— uncommitted staging, gitignored. All site-generator-specific output leaves
the binary: Docusaurus frontmatter, sidebarPositionMap, the website/ writers,
the Mintlify writers, the docs.json nav splice, and the --docs-version
snapshot flag are gone from cmd/bd.
tools/docsmint (Go, unit-tested) is the Mintlify post-processor: it turns
the staging tree into the committed docs/cli-reference/ pages (JSX comment
markers, extensionless route links) and splices the CLI Reference pages
array in docs/docs.json. scripts/generate-cli-docs.sh runs both stages;
--check seeds the committed artifacts into a scratch root, regenerates, and
diffs, exactly as before.
Regenerated output: the 113 pages are byte-identical through the new
pipeline; docs.json nav ordering is now plain filename sort;
docs/CLI_REFERENCE.md drops the removed --docs-version flag.
`bd help --doc <cmd>` stdout is likewise generic now (no Docusaurus
id/slug/sidebar_position).