* 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>
gascity commit 9865cc045aee1391dbcc7eac99339c26e3a5ce71 fixed a
production bug: negative protobuf durations in the compact exec log
were decoded as unsigned, so the collector rejected roughly 22% of
artifacts on remote_queue_ms. Re-vendor the extractor and its unit
test byte-identical from that commit and update the sha256 pins in
ci_analytics_extract_test.go accordingly. testdata/ci_analytics/ is
untouched by the fix; its tree-hash pin is re-verified unchanged
against gascity's tree.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
rbe-west's pool workers run gascity main's tools/rbe/worker-env and
advertise its pin; the schedulers match //platforms:rbe_worker's pin
exactly. When gascity re-pins and beads' copy falls behind, every remote
action queues until the lanes time out, and the only check ran nightly
with no notification (review finding S1).
- bazel.yml's rbe job: after decide, only when the lanes execute remotely
(enabled: modes remote, fork-ro, fork-rw; merge groups are remote), a
sparse checkout of tools/rbe and platforms and tools/rbe/worker-env-sync
main. Out of step fails the job, so every lane skips and pr.yml's gate is
red within a minute, with the diff and the pin to commit in the summary.
No fallback to mode cache: pr.yml's ci-gate requires a remote run
(BAZEL_REMOTE), so it would be just as red, only slower. gascity
unreachable warns and proceeds. The steps set no output; the job's
outputs stay decide's.
- worker-env-sync: exit 1 only for out of step, exit 2 (warning) when it
cannot compare (ERR trap; curl timeouts), WORKER_ENV_SYNC_REPORT copies
the markdown report.
- nightly.yml: top-level permissions contents: read; rbe-worker-env-sync
gets issues: write and, on exit 1, tools/rbe/worker-env-sync-issue opens
a ci/infra issue with the report or updates the open one (body + comment
linking the run). GITHUB_TOKEN is in that one step.
- Policy tests: TestBazelRBEWorkerEnvPreflight (shape + the step's script
run in step / out of step / unreachable), TestNightlyWorkerEnvSyncOpensIssue
(permissions, token scope, rc output, issue create/update via a stub gh),
TestRBEWorkerEnvSync (exit codes, report); rbe job step and checkout
counts updated.
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>
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>
tools/bazel/ci_analytics_extract.py turns a lane's BEP file, compact
execution log and JSON profile into a redacted ci-analytics-summary
(timing, per-mnemonic cache classes, cold actions, test results,
repo-fetch time): only validated labels, mnemonics, enums and numbers
leave the runner, never an endpoint, cert/key path, env value, token
or hostname. Every lane's "CI analytics summary" step runs the
extractor and uploads its output as ci-analytics-<lane>-<run_attempt>
(7-day retention); CHECK_RUN_ID uses the real job.check_run_id
context (requires actionlint >= 1.7.8), and both the summary and
upload steps are continue-on-error, the summary capped at
timeout-minutes: 3, and both gated on !cancelled() (not always(),
which also runs after a workflow cancellation).
The extractor, its 62-case unittest file, and testdata/ci_analytics/
(the real/* Bazel 9.2.0 fixtures, poisoned-bep.json, mismatch.bep.jsonl
and regen.sh) are vendored byte-identical from gascity's
ci/analytics-extractor slice (final squashed commit
00161373bc7bbfcef8d6a05ac5ce70409fc7f2ac), which is canonical for this
pair the same way tools/rbe/cache-zstd-probe.sh is a byte copy.
Fixtures are regenerated under env -i with every BEP field stripped
unless it's on an explicit allowlist, and the compact exec log is
committed decompressed (*.binpb) rather than as a zstd frame, so
nothing opaque reaches version control.
scripts/ci_analytics_extract_test.go is the thin Go wrapper:
TestCIAnalyticsExtractorIsPinnedToGascity pins both vendored files'
sha256 so local drift is caught, and TestCIAnalyticsExtractUnitTests
runs gascity's unittest file in place. scripts/ci_analytics_workflow_test.go's
TestCIAnalyticsStepsAreSafeAndBounded mirrors gascity's pin test,
adapted to beads' 8 separately-named lane jobs: continue-on-error,
timeout-minutes bounds, no raw ${{ }} expression in run:, !cancelled()
required in if:, correct per-lane upload artifact name/path, and
CHECK_RUN_ID == ${{ job.check_run_id }}, for every lane.
Co-authored-by: Claude Sonnet 5 <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>
gascity now builds the worker-env manifest from the worker's toolchain,
not the image's patch revisions. The manifest records the arch, the OS
release, Go and dolt, and the upstream releases of the libraries and
tools actions reach (major.minor; git and yq at their major). The Debian
epochs and Ubuntu revisions are gone, so the Blacksmith image's routine
security updates no longer move the hash. That is what stranded every
remote action on 2026-10-07: coreutils 9.4-3ubuntu6.1 -> 6.2 and libc6
2.39-0ubuntu8.6 -> 8.8 forced re-pins (gascity #7266, beads #7338).
- tools/rbe/worker-env.txt: byte-identical copy of gascity's new
manifest. platforms/BUILD.bazel pins its sha256,
sha256:6be1381cf08e7fd66684cfce6f26aca57de2561e722c505d1f2f578e9fdeafa7.
The manifest now also measures python3, curl, openssl, unzip and yq,
which //scripts:scripts_test runs from the executor.
- scripts/rbe_worker_env_test.go: the manifest must be a rendering of
gascity's tools/rbe/worker-env (sorted; one arch, dolt, go, os and yq
line; packages at most major.minor, installed). A copy of an older
gascity manifest with dpkg revisions, a hand edit or a truncated copy
fails here.
- tools/rbe/worker-env-sync, run by nightly.yml: compares the manifest
and the pin with gascity's main byte for byte. If they differ, it
prints the diff and the pin to commit, and fails.
Merge this together with the gascity change. Pool workers run gascity
main's provisioning, so they serve the new hash only once that change
lands, and beads' actions on any other pin queue. This supersedes #7338
(the old-format re-pin). The new key misses the cache once.
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>
rbe-ci-cost-latency-study.md recommendation 4: this tier's last shard
has trailed the rest by 4.3-4.5 min in 2 of 8 runs. tools/bazel/shard_budget.py
reads the job's BEP file and prints ::warning when a sharded target's
slowest shard exceeds max(150s, 2x median); --fail-on-imbalance (not
wired in yet) switches that to ::error and a nonzero exit once the
budget has run clean for a while.
Co-authored-by: Claude Sonnet 5 <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>
fast-checks, PR Policy, and the Linux leg of check-doc-freshness-platforms
ran repository guards on GitHub runners. They now run as Bazel tests in
bazel.yml's `test` lane (remote, cached), each over only the files it reads:
- tools/bazel/repo_subset.bzl picks a narrow, path-selected slice of
//:repo_files at analysis time. scripts/repochecks/run_check.sh copies that
slice into a throwaway git checkout and runs the unchanged guard there.
- //scripts/repochecks: build_tags, workflow_tags, go_install_guidance,
winget_portable_alias, migration_hygiene (checks A and B),
fmt (registered SDK gofmt), doc_freshness, workapi_frontend_boundary,
types_gen_drift (`make api-check` drift, oapi-codegen from go.mod).
- //scripts:doc_freshness_required_test (integration lane, -required-suite)
and //scripts/gitattributespolicy:gitattributespolicy_required_host_test
cover the Linux doc-freshness leg.
- check-versions stays covered by //internal/versioncheck:versioncheck_test.
check-testing-short stays covered by //scripts:scripts_test.
pr-policy-wrapper is deleted. fast-checks keeps only the two checks that
need the PR base: migration hygiene's delta half (MIGRATION_HYGIENE_SCOPE=
delta) and the .beads diff. check-doc-flags stays, because it builds bd from
the pinned release tag. The example Go modules leave .bazelignore so gofmt
and the grep guards see them. check_testcases.py now accepts --not-go
//pkg:all.
Refs: ga-96smfk.20
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
pr.yml's every-PR "Test (Dolt server fingerprint)" job installed dolt, pulled
the dolt-sql-server docker image and ran TestDoltServerFingerprint against
both backends. The rbe-west workers have no docker, and the container backend
is now used only by the container-backed legacy jobs, which run only where
bazel-coverage does not cover pr_lanes.
- //internal/testutil:testutil_dolt_test runs testutil_test with the local
backend selected and required (BEADS_TEST_DOLT_SERVER=local,
BEADS_TEST_REQUIRE_DOLT_CONTAINER=1) on the dolt-server lane, which
pr.yml's gate requires: the fingerprint's local half against the pinned
dolt, plus the TestLocalDoltServer_* tests every other configuration
skips under BEADS_TEST_SKIP=dolt.
- The container half moves back to test-domain-uow's first test step (where
it was before D2 step 3), so it runs exactly where containers are used.
//internal/testutil:testutil_docker_test is its docker-lane A/B control.
TestPinnedDoltCLIMatchesContainerImage still pins the image tag to the
dolt release.
- test-dolt-server-fingerprint, its ci-gate need/result and its policy
tests are removed; TestDoltServerFingerprintRunsWhereEachBackendRuns
pins the new placement.
Refs: ga-96smfk.19
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
proxied-local-smoke.yml built bd and the cmd/bd test binary on a GitHub
runner, installed the pinned dolt, and ran `-test.run ^TestManagedLocalProxied`
under `sudo unshare --net` with only loopback up, to prove the managed-local
lifecycle (bd -> loopback proxy -> dolt sql-server) needs no outbound network.
//cmd/bd:bd_managed_local_test runs the same tests (BEADS_TEST_PROXIED_LOCAL=1,
BEADS_TEST_SKIP=dolt, the non-race bd_for_tests as the bd under test, the
pinned dolt from the test wrapper's PATH) through tools/bazel/go_test_offline.sh,
which enters an unprivileged user + network namespace with only loopback up
and fails if outbound network is reachable: the job's netns, without sudo,
on the rbe-west workers. Tagged dolt-server-proxied, so bazel.yml's
bazel-proxied lane (remote-only, required by pr.yml's gate) runs it; test
result caching replaces the workflow's path filter. The job's "tests are
compiled in" assertion becomes scripts/managed_local_lane_test.go, which
evaluates cmd/bd's build constraints for a linux cgo build and requires each
of the 17 pinned tests.
The target joins the pinned retired-lane targets in
TestBazelRetiredLanesCannotBeNarrowed. proxied-local-smoke.yml and the policy
tests that pinned its job and its dolt version are removed (the Bazel dolt
pin is already enforced against install-dolt.sh).
Refs: ga-96smfk.19
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
beads' MODULE.bazel registered no C toolchain, so -race and cgo builds used
the autodetected local_config_cc of the machine that ran analysis. From a
client with lld installed (cherry) every remote cgo/-race link failed with
"collect2: fatal error: cannot find 'ld'" (the workers have no lld), and the
host gcc path, lld availability and gcc-version inputs keyed every Go action
to the client machine.
Port gastownhall/gascity's design:
- toolchains_llvm 1.11.0 with a pinned LLVM 22.1.8 slice
(third_party/cc_toolchain/llvm_dist.bzl) and a sysroot of sha256-pinned
Ubuntu 24.04 debs (deb_sysroot.bzl), without ICU (ICU policy);
stock toolchains_llvm LLVM on other hosts.
- .bazelrc: BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 so nothing falls back to the
host compiler.
- //platforms:rbe_worker, selected unconditionally, whose worker-env exec
property is the sha256 of tools/rbe/worker-env.txt (a copy of the shared
rbe-west OSS pool's manifest, owned by gascity), so the worker host is in
every action key.
- scripts/bazel_hermetic_cc_test.go and scripts/rbe_worker_env_test.go guard
both.
Refs: ga-96smfk.20
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
#7147 gave migration-test, conformance and cross-version-smoke a shared
paths filter: non-test Go files plus build inputs. The schema migrations
are .up.sql files embedded into the binary (go:embed in
internal/storage/schema), so they match no entry. A PR that adds a
migration with only a _test.go beside it skipped all three workflows,
where before #7147 it ran all three. d26230d0d and 63a471a1e have that
shape.
Add internal/storage/schema/migrations/** to the shared base in each
paths block and in advisoryPathFilterBase, which pins the base across
the three files.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
conformance.yml ran two tiers on a GitHub runner. Tier 1 (the embedded-Dolt
TestConformance) already runs as the embedded lane's
embeddeddolt_conformance_{core,audit}_test. Tier 2, the real-binary CLI
corpus (`go test -tags 'gms_pure_go e2e' ./test/conformance`), had only a
go_library under Bazel. Its two test files now build under `e2e ||
integration`, so gazelle generates //test/conformance:conformance_test
(integration-only, against the injected non-race bd_for_tests) and
--config=integration runs it remotely in bazel-integration, which pr.yml's
gate requires. PR Core's go test builds neither tag, so the --config=ci
equivalence check is unchanged; scripts/conformance.sh keeps working with
-tags e2e as the local go test entrypoint. With both tiers covered,
conformance.yml and main.yml's warm-up compiles for it are removed.
docs-mintlify.yml drops its docsync job (`go test ./test/docsync`, run by
bazel-test as //test/docsync:docsync_test on every PR) and keeps only
Mintlify's broken-link check, which needs the network (npx mint) and the
base branch's history; its path filter narrows to what that check reads.
Refs: ga-96smfk.17
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Actions runs the dispatch step as bash -e, so a failing gh run list ended the
step at the assignment and the could-not-read warning never printed. The
assignment now tolerates the failure. A RBE_PREWARM_WORKERS too long for the
shell's integer compare slipped past the max-4 clamp and the loop dispatched
without bound; two or more digits is now decided in the case (all zeros stays
the kill switch). The behaviour test runs the script with bash -e, as Actions
does, under a 30s deadline, and pins the clamp.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
//scripts:scripts_test and //scripts/check-versions:check-versions_test
drop their host-tools/no-remote-exec/no-remote-cache tags and run on the
rbe-west workers like every other target (the worker image ships bash, git,
python3, jq, yq, curl, openssl, unzip and coreutils; a missing tool fails the
test under Bazel rather than skipping it). Go comes in hermetically as the
registered SDK; check-versions.sh's `go build` is stood in for by the
Bazel-built checker.
The tests that walked the source checkout now get it as data:
tools/bazel/go_srcs.py keeps a managed `repo_files` filegroup in every
package and aggregates them into //:repo_files (exactly the tracked files
Bazel can see; make bazel-sync-check fails on a package without one).
scripts_test and docsync_test take it instead of hand-listed filegroups,
and every TEST_SRCDIR/IsBazel skip and go-test-only block in them is gone.
The release formula under .bazelignore'd .beads/ comes in through a
@beads_formulas local repository; npm-package/ and .claude/ are visible to
Bazel again (only their node_modules/worktrees stay ignored), so the npm
manifest release check and the AGENTS.md skill links run under Bazel too.
TestZZStdioNotLeaked falls back to TestMain's pre-run streams instead of
skipping in a shard without its baseline.
tools/bazel/equivalence_allowlist.txt shrinks from 20 skip entries to the
two cmd/bd tests of plain go test's own bd build fallback, which Bazel never
takes; pr-preflight-platforms now runs them on Linux, macOS and Windows. The
scripts-go-checks scripts-test and allowlisted legs, their scripts
(scripts-go-test.sh, allowlisted-go-tests.sh, run_allowlisted_go_tests.py)
and main.yml's --compile-only warm for them are removed. The vet leg stays
(ga-96smfk.18).
Refs: ga-96smfk.16
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bazel.yml already runs on every push to main and executes the PR Core,
pure-Go, dolt-server, embedded, proxied, server-storage, integration and
cmd/bd Dolt-server tiers on rbe-west in about five minutes. main.yml re-ran
the same tiers as legacy go test jobs (62 jobs, about 380 runner-minutes a
push), and its runs were all failing or cancelled. Remove the duplicated
Linux jobs: the ubuntu -race -short leg with its Codecov upload, PR Core,
the pure-Go compile check, domain+uow, the 6+8 integration shards, the 15
proxied shards, and the embedded build plus its storage, conformance and
cmd shards.
The macOS -race -short suite (rbe-west has no macOS workers) moves to
Blacksmith macOS and restores the macOS saver's caches. The cache savers
that fed the fork path from the removed jobs move to venue matrices: the
macOS saver gains a GitHub-hosted leg, and the Linux saver gains a
GitHub-hosted race leg (the embedded build used to seed it).
Refs ga-96smfk.14
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: make the required gates merge-queue ready
The default-branch ruleset requires "CI Gate / Required" and "PR Risk
Gate / Required". Prepare both for a GitHub merge queue (ALLGREEN,
squash), so enabling the ruleset's merge_queue rule is the only step left.
- pr.yml, pr-risk.yml: merge_group pinned to types [checks_requested].
- D2: bazel-coverage covers every merge_group run (same repository, CI
secrets, actor github-merge-queue[bot], bazel.yml mode remote), so the
retired legacy tiers stay retired in the queue and ci-gate requires
their Bazel lanes to have run remotely and passed; a missing secret or
the farm switch off is red, as on a same-repo PR.
- Diff bases on merge_group: the package gates diff
merge_group.base_sha..head_sha (not HEAD^, which misses all but the
last commit of a rebase-method entry), the .beads/issues.jsonl guard
now runs on merge_group against base_sha (ci-gate no longer excuses
its skip), and check-doc-flags passes BD_DOCS_DIFF_BASE so CLI-docs
drift already on main cannot eject every queued PR.
- Test result reuse: on a merge_group run and on attempt 2+ of a PR run,
the six always-execute Bazel lanes append --config=reuse-test-results
(--cache_test_results=auto), so tests whose action key is unchanged
reuse the farm's recorded PASS and only what the merge changed runs.
Failures are never reused, eviction retries stay 0, and each PR's first
attempt, push to main and nightly still execute every test.
- scripts/ci_merge_queue_test.go simulates merge_group through the shared
evalGHExpr evaluator (now with true/false/null literals, hyphenated
identifiers and case-insensitive ==) and the workflows' own scripts:
triggers and gate names, concurrency groups, every pull_request field
read, the coverage and rbe decisions, result reuse, the package-gate,
.beads and doc-drift diff bases.
- engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md: new "Merge Queue" section (how
to queue, settings, what runs, result reuse rationale, ejection and
flakes, rollback).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: cache Bazel test results except nightly; queue trust and sizing
Review follow-ups to the merge-queue readiness change.
- Test results (S1): --nocache_test_results also stops Bazel writing
results, so a PR's first run never fed the cache and the merge-queue
reuse config could only hit on later reuse runs. Drop it from
test:embedded, test:doltserver-proxied, test:doltserver-integration and
test:sole-run (which keeps --experimental_remote_cache_eviction_retries=0),
and drop test:reuse-test-results and BAZEL_REUSE_RESULTS. Results are now
cached (read and write) on PRs, merge groups and pushes to main.
nightly.yml passes the new fresh-test-results input, so every `bazel
test` appends --config=fresh (--nocache_test_results) and the suite
re-executes nightly. The docker lane keeps --nocache_test_results.
Measured locally with a disk cache: a default run writes and the next
reads ("(cached) PASSED"); a fresh run neither reads nor writes.
- Security headers (S2): bazel.yml now states that a merge_group run
executes the queued commit's workflows, so a queued fork or Dependabot
PR's CI edits run with every CI secret, the pre-warm app key included
(merging-level trust), and records the maintainer rule: review fork
changes to .github/, .bazelrc, tools/bazel, MODULE.bazel, BUILD files
and CI scripts before queueing. Same note in the topology doc.
- Queue sizing (S3): recommend max_entries_to_build 3 and
check_response_timeout_minutes 60 (max_entries_to_merge 5, ALLGREEN,
SQUASH unchanged).
- Nits: the .beads guard fails closed on a missing diff base, and its
test runs under GitHub's default `bash -e`; evalGHExpr follows GitHub's
loose equality (true == 'true' is false, false == '' is true, missing
context keys are null) with a typed-context variant; the
detect-package-gates comment notes the SQUASH/HEAD^ equivalence and
path-filter scope; the doc covers re-run reuse, flake re-sampling via
dispatch, stale queue runs and how to confirm reuse on the farm.
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-platforms and check-doc-freshness-platforms now resolve their
same-repo-macos marker like the Linux/Windows legs: blacksmith-6vcpu-macos-26
for same-repo PRs and merge_group, GitHub-hosted macos-latest for forks,
Dependabot and every other event. The label is pinned to macos-26 because
GitHub's macos-latest is macos-26-arm64 today, so both paths run the same
OS/arch; 6 vCPU is already 2x macos-latest's 3 vCPU.
Blacksmith cannot see GitHub-saved caches, so main.yml gains
blacksmith-macos-go-build-cache: a push-to-main-only saver on the same label
(same job guard as the other Blacksmith savers) that builds ./cmd/bd and runs
the shared warm-non-race-cache.sh, saving the module cache and a non-race
GOCACHE keyed by go.sum + UTC day. The PR legs stay restore-only. main.yml's
GitHub-hosted macOS full-suite leg is unchanged and keeps seeding the fork
path.
Policy tests: the macOS marker arm is evaluated for same-repo/merge_group/
fork/deleted-head/dependabot/push/schedule and must match the flat macOS
const; the saver joins the PR-guard and per-day-key sweeps and the cache
ownership inventory; TestBlacksmithMacOSSaverMatchesPRLegs pins the
label/path/key/warm-up contract between saver and PR legs.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Makes the repo's agent and contributor surface describe developing beads, not using bd, and requires every PR to link a documented issue.
- Contributor-only root AGENTS.md with a routing table; cmd/bd/AGENTS.md and engdocs/AGENTS.md seam files; CLAUDE.md symlinks so Claude Code loads nested files.
- Bug and feature issue forms, a PR template that requires Closes #, CONTRIBUTING sections for the triage and pipeline labels, and the opt-in fork-cache during dev setup.
- ROADMAP.md for 1.4: versioned beads (#6132), Graph Preview 2 (#7170), contributor onboarding (#7228).
- docsync guards: root AGENTS.md at or under 20 KB; every AGENTS.md symlinked, routed, and with resolving links, paths, and guard-test names.
Agent-Signature: claude-code-claude-opus-5-5-high on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bazel-integration (--config=integration) and bazel-cmd-dolt
(--config=doltserver-cmd, //cmd/bd:bd_dolt_server_test) both run the
integration-build cmd/bd bd_test; the second without BEADS_TEST_SKIP=dolt,
so it is a superset. Once pr.yml requires bazel-cmd-dolt, the integration
lane's bd_test run is a duplicate.
bazel.yml gains a boolean workflow_call input, cmd-dolt-required (default
false). When true, bazel-integration tests //... -//cmd/bd:bd_test. pr.yml
passes it, and a policy test pins it to pr.yml's BAZEL_CMD_DOLT_REQUIRED
(a `with:` cannot read env), so the drop only happens where ci-gate
requires BAZEL_CMD_DOLT. bazel-farm.yml, nightly.yml, push and dispatch
leave it unset and keep bd_test. While the flag is "false" (current main)
nothing changes; with #7226's flip the input flips with it.
Coverage: both lanes share the same `if:` (modes remote, fork-ro, fork-rw,
cache; Dependabot included) and bazel-gate.sh accepts their skips in the
same modes (skip, local). TestBazelIntegrationExcludesBdTestOnlyWhereCmdDoltCovers
pins that, the exact exclusion, the flag/input equality, the gate's
conditional requirement, and that no other caller passes the input.
Rollback: commit BAZEL_CMD_DOLT_REQUIRED "false" and cmd-dolt-required:
false together in pr.yml.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Advisory since #7185. On the farm it passed on every PR run based on
current main; its only failures (3) were branches predating #7219 and
reproduced a real test bug that #7219 fixed. Flip the committed flag so
CI Gate / Required enforces BAZEL_CMD_DOLT. Rollback: set it back to
"false".
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
pr-preflight-platforms' "Exercise native init gateway credential shell"
step had no GOCACHE env, so it fell back to the runner's empty default
cache and cold-compiled all of ./cmd/bd's test binary on every PR, right
after the hook-timeout step had compiled the identical binary (same tags,
same platform-default CGO) into the restored non-race cache. Job logs:
213s of a ~350s macos-latest leg, ~117s on Windows; on Linux the rerun
with a shared cache is a relink only (~8s).
- pr.yml: point that step, and the three Windows-only Go steps, at the
restored non-race GOCACHE.
- main.yml: the macOS test leg (the only macOS non-race seeder) now runs
warm-non-race-cache.sh, so the PR macOS legs restore the test packages
and test-only deps they compile, not just the non-test ./cmd/bd graph.
- Policy tests: every run step in pr-preflight-platforms and
check-doc-freshness-platforms must use the restored GOCACHE, and the
macOS seeder must warm before it saves.
No test selection, matrix, or gate wiring changes.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(autofix): push bot fixes with a scoped GitHub App token
github-actions[bot] pushes left PR checks action_required instead of
retriggering, and the DOCS_AUTOFIX_TOKEN fallback secret was never
configured. bazel-autofix.yml and docs-autofix.yml now mint a short-lived,
repo-scoped (contents:write) installation token for the gastownhall-autofix
App via the `autofix` environment on same-repo PRs, falling back to the
default workflow token (and its manual re-run note) when the App token
isn't available; fork PRs are unaffected and still only get the apply-recipe
comment.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(ci): job environment parses as a name or a mapping; gofmt
ciWorkflowJob.Environment was a string, so every test that loads all
workflows failed on deploy-pages-redirect.yml's mapping form
(environment: {name, url}).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
pr.yml and pr-risk.yml (and the three advisory workflows that already
list release/** beside it -- conformance.yml, cross-version-smoke.yml,
regression.yml) trigger pull_request only on main and release/**. A PR
based on hotfix/1.3.1 (or any sibling hotfix/** line) matched neither
pattern, so it ran almost no CI: #7146, a backport to hotfix/1.3.1,
showed 17 checks -- 15 cross-version historical smokes and triage/label
jobs, 2 skipped -- no Lint, no unit shards, no embedded tier, no CI
Gate / Required, no PR Risk Gate / Required.
pr.yml's own comment states exactly why release/** is there:
release-prep and release-fix PRs are based on the release branch, not
main, and without it they run almost no CI before the tag build. A
hotfix line is in the identical position. Added hotfix/** alongside
release/** in all five files.
New TestPullRequestWorkflowsTriggerOnHotfixBranches pins hotfix/**
presence in each file's pull_request.branches list -- red before this
change (observed [main release/**] in all five), green after. The
existing TestPRRiskBazelCoverageJob equality check (pr.yml and
pr-risk.yml's pull_request triggers must match) still passes, since
both were updated identically. go vet/gofmt clean.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
* perf(storage): cut batch-create round trips (import, bulk create, apply-batch)
A multi-issue create (import, bulk create, CreateIssuesWithFullOptions) ran
~20 SQL statements per issue, and its dependency pass ran a recursive cycle
CTE per edge over the union of both dependency tables, which Dolt cannot
index — every recursion step rescanned the edge tables, so an import whose
edges form chains went superlinear (400 issues: 73 s of 82 s in that CTE).
issueops batch create, same transaction and same stored outcome:
- createBatchCache: one IN-list read of every explicit id's presence in both
planes (replacing two COUNT probes per issue), one read of the batch's
stored labels (each issue's new labels then land in one multi-row INSERT),
created/label_added events buffered and written in one pass under the ids
InsertDerivedEvent would mint (same digest, same lowest free ordinal), and
runs of brand-new rows written with multi-row INSERTs (same ODKU clause)
then finished in order.
- Dependency pass: wisp routing and target presence from batch reads; the
cycle and hierarchy checks walk an in-memory copy of the edge tables,
loaded once and kept in step with every edge the pass writes (a pair it
already holds is re-read, since a clientFoundRows connection reports a
matched duplicate as written).
- createBlockedRecomputeIDs seeds all created edges and expands once.
Shared paths:
- Blocked-state recompute splits ids once per call by whether they own a
dependency row; edgeless ids (every freshly created issue) skip the two
union UPDATEs for one plain unmark, run after the chunk's union statements
on the first pass so the unions see what they saw before.
- appendChildrenInTx reads children per IN-list chunk, not per parent.
- ExecuteCreate hands its BatchContext to the batch body instead of having
it re-read the same config (-6 statements per apply-batch create item).
Not changed: one version-history row per created issue (the version
contract, version_history.go), journal order and content, and the per-row
bodies, which stay the path for singular creates.
Equivalence: internal/storage/createbatchequiv runs an import scenario
(upserts, duplicate ids, wisps, generated ids, cycles, hierarchy conflicts,
dangling/external targets, stale is_blocked, comments, journal and
versioned history on) through the fast and per-row bodies on the embedded
and server engines and compares every written table and the skip reports.
Re-pinned TestLargeBatchApplyStatementCounts*: embedded 7009/14014/846 ->
6396/12790/793, server 7008/14014/846 -> 6396/12791/793 (breakdown in
pinnedEmbeddedStatementCounts).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* perf(storage): batch-create review fixes — lazy edge graph, opt-in recompute probe, insert budget
Review of the batch-create round-trip change (S1-S3 and nits):
- The dependency pass's in-memory graph no longer loads both edge tables.
It reads a node's outgoing edges through the issue_id index the first
time a walk reaches it: the batch's own endpoints up front, then one
IN-list read per BFS level. Memory and reads scale with the subgraph
the batch's walks touch, not the edge tables, so a two-edge create on a
large database no longer materialises every edge. A written edge whose
source was never loaded loads that source (row included).
- The blocked-state no-edge probe runs only when a create asks for it or
when a chunk holds at least 32 ids. Single-issue recomputes on close,
reopen, update and dependency edits issue exactly the statements they
did on main (the reopen sqlmock expectation is back to main's).
- Multi-row issue INSERTs are bounded by an estimated 16 MiB of bound
text as well as 100 rows. When a multi-row statement fails, its rows are
replayed one at a time, and the batch continues if every row lands
instead of returning the original error.
- Nits: document the binary-collation assumption behind Go string
equality; DisableCreateFastPathsForTest documents that it is
process-global and non-parallel, and panics on an overlapping caller;
drop the unreachable skip branch; explain why wisp targets need no
presence read.
Re-pinned TestLargeBatchApplyStatementCounts* classic 40: 793 -> 786
(the +7 probes on dep-add recomputes are gone; net vs main is -60, all of
it ExecuteCreate's config reuse). 356/712 unchanged.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* perf(storage): search the batch dependency graph from both ends
The lazy per-node load (previous commit) still walked forward from the
check's start, so on a large stored graph a single create's cycle check
read every node reachable from its target — about 800 statements per
create on a 2000-issue fixture. The cycle and hierarchy questions a batch
asks almost always end at a row the batch just created, whose only
incoming edges are the batch's own.
depGraph now answers each reachability question with a bidirectional
search: forward from the start along outgoing edges (issue_id index),
backward from the goal along incoming edges (the three target-column
indexes, read as one UNION ALL per table), always expanding the smaller
frontier and loading a level's nodes in that direction once. The batch's
endpoints are loaded in both directions up front, so a create's checks
usually finish with no further read (a chain import, too: each new
edge's goal has no incoming edge yet). Rows are keyed by (table, source,
target), so a row read from both ends counts once. An incoming read
ignores a row whose matching column is not its first set target column,
as the CTE's COALESCE does. A written pair that neither loaded end can
vouch for is re-read instead of assumed new.
On a 50k-issue / 100k-edge database, a create with two blocks edges
now runs 27 statements, against the full-scan or per-node walks before
(numbers in the review-fix summary).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(storage): hold batch create to golden digests from the pre-change code
The batch-create equivalence test compared the fast paths with the same
code's per-row bodies, so changes the fast-path switch does not gate —
the recompute seed merge, the IN-list children read, ExecuteCreate's
context reuse, the prepare/finish split — were checked only by older
contract tests. Its batch was also too small to cross a chunk boundary
and never set RejectStaleUpserts.
createbatchequiv now runs four scenarios, each through the fast and
per-row bodies, and checks both against a per-table row count and
SHA-256 recorded from ebe3b6bcb (before the fast paths existed;
CREATEBATCHEQUIV_GOLDEN_DIR re-records them):
- small: the original scenario;
- import458 and import458-reject-stale: the review's 458-issue batch
(every chunk boundary, wisps and cross-plane edges, cycles, hierarchy
conflicts, duplicate ids across deferred runs, generated and
hierarchical ids, stale upserts rejected and accepted), plus new edges
whose blocked-state fallout reaches stored rows outside the batch (a
spawner's waiter, an upserted parent's existing child);
- apply: an apply-batch through ExecuteCreate, dep adds and an update.
The recorded digests match on the embedded and server engines (the
server test now sets the fixture's prefix, so generated ids agree).
Dropping the spawner-waiter seeding is invisible to the fast-vs-per-row
comparison and caught by the golden check.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(storage): large-graph create benchmark
batchbench measures creates against a database already holding a large
dependency graph (batchfixtures.LargeGraphInserts: N issues, ~2N
acyclic edges with wide reachable sets and a deep parent-child forest,
committed as a Dolt version): ExecuteCreate under an existing parent with
an existing blocker, a store create with two blocks edges, and an
apply-batch of creates each with a parent-child and a blocks dep_add.
It logs wall time, statements and Go allocation per shape on the
embedded and server engines. Opt in with BEADS_BENCH_LARGE_GRAPH=<issues>
(and BEADS_BENCH_LARGE_GRAPH_CREATES); it asserts nothing.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* perf(storage): read incoming dependency edges one target column at a time
The bidirectional graph search read a node's incoming edges with one
UNION ALL over the three target columns per table. Dolt plans that as a
scan: 0.7 s per read on a 100k-edge table, where each leg alone is a 1 ms
lookup on its own index (EXPLAIN shows IndexedTableAccess per leg). Issue
the three legs as separate reads into one row set; a row matched through
two columns still counts once.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(storage): run the 458-issue equivalence scenarios outside the race lane
The 458-issue golden scenarios took the embedded tier's shard over its
20-minute limit under -race (the in-process engine's own instrumentation;
about 35 s each without it). They move to
TestCreateBatchFastPathsMatchPerRowLarge_Embedded, skipped under -race and
added to nightly.yml's non-race embedded step, following the precedent of
the 712-item statement-count and 1000-item wall-clock cases. The light
scenarios (small, apply) stay in TestCreateBatchFastPathsMatchPerRow_Embedded
on every lane. The server backend (built without -race in its full
suite) runs both: TestCreateBatchFastPathsMatchPerRow_Dolt and, as its own
top-level test so the shard manifest's hash places it on another shard
(about four minutes there), TestCreateBatchFastPathsMatchPerRowLarge_Dolt.
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): zstd cache transfers for the anonymous fork cache only, behind RBE_CACHE_ZSTD (E4)
E4 of the rbe-west egress reduction (design A.5), reworked for the
read-only zstd server shape. rbe-west's trusted MAIN and OSS schedulers
(:443 to :50052) and rbe-fork (:8444) advertise no compressor, and Bazel
refuses a remote that does not advertise zstd. So only the anonymous fork
cache (rbe-cache :8443, nativelink-anon, which keeps zstd) may ask for it.
- **`write-bazelrc.sh`:** no `--remote_cache_compression` on the trusted
remote-exec or rbe-fork paths. In mode cache, with `RBE_CACHE_ZSTD=1`, it
adds `build:fork-cache --remote_cache_compression`. Empty or 0 adds
nothing; another value warns and stays off, rather than failing every
cache lane.
- **`bazel.yml`:** every setup-bazel caller passes
`RBE_CACHE_ZSTD: ${{ needs.rbe.outputs.mode == 'cache' &&
vars.RBE_CACHE_ZSTD || '' }}`, so only cache runs see the variable.
Merging changes nothing, and rollback is the variable, with no revert.
- **`.bazelrc`:** fork-cache no longer sets the flag; a comment points at
the gate.
Tests:
- `TestBazelCacheModeReachesTheRC` evaluates `vars.` right-hand sides and
simulates `RBE_CACHE_ZSTD=1`. Mode cache's rc carries exactly the
fork-cache zstd line; the remote, fork-ro, fork-rw and local modes carry
no compression at all.
- `TestSetupBazelRCWriter` runs `RBE_CACHE_ZSTD` = 1, 0, empty and a bad
value in mode cache, and remote-exec with 1 (never compressed).
`TestSetupBazelRCWriterForkMode` pins rbe-fork's exact lines with
`RBE_CACHE_ZSTD=1`.
- The bazel.yml setup-env pin includes `RBE_CACHE_ZSTD`.
- `checkBazelrcForkCache` rejects the flag in any `.bazelrc` config, with
fork-cache and remote-exec fixtures.
- New `TestBazelRemoteCacheCompressionOnlyForkCache` scans `.bazelrc`, the
workflows and the local action files. The flag must appear once: the
writer's fork-cache echo.
**Merge order:** after rbe-west's anonymous process advertises zstd. Even
then the flag stays off until `RBE_CACHE_ZSTD=1` is set. If rbe-cache stops
advertising zstd, fork-cache's fallback flags make lanes build locally.
**Action keys:** unchanged; the flag only changes ByteStream resource
names (`compressed-blobs/zstd/`).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): zstd for the fork cache by a GetCapabilities probe, not a repository variable (E4)
Review finding 3: GitHub gives fork pull_request runs no repository
variables (bazel.yml: forks "see no secrets and no vars"), so
vars.RBE_CACHE_ZSTD was always empty exactly where the switch matters. Fork
run 37220594372 logs RBE_VAR_ON: false. The variable could never turn zstd
on for fork-cache clients, and once on it could not follow rbe-cache
rolling zstd back.
- New setup-bazel/cache-zstd-probe.sh, a byte copy of gascity's
tools/rbe/cache-zstd-probe.sh: one unary REAPI GetCapabilities call
(instance oss) to rbe-cache :8443 over curl's HTTP/2, decoded with
python3's standard library. It exits 0 only when
cache_capabilities.supported_compressors lists ZSTD, the field Bazel
checks. Any other result exits nonzero: not listed, an HTTP or gRPC
error, a refused connection, a timeout (connect 3s, total 5s), an
unparsable answer, or no curl or python3. It writes nothing to stdout
and one verdict line to stderr. No new action and no new dependency.
- write-bazelrc.sh: in mode cache, `if bash .../cache-zstd-probe.sh` adds
build:fork-cache --remote_cache_compression. The probe never fails the
script. RBE_CACHE_ZSTD and its bad-value warning are gone.
- bazel.yml: the ten RBE_CACHE_ZSTD env lines are gone (back to the
pre-E4 setup env).
Tests:
- New TestCacheZstdProbe runs the real script against a TLS HTTP/2
stand-in for rbe-cache, which checks the exact request. Passes: zstd
advertised (packed, and unpacked among others). Fails: rbe-cache's real
2026-10-04 answer (no compressors), deflate only, zstd for batch updates
only, zstd outside cache_capabilities, a gRPC error trailer, no
grpc-status, trailers-only UNIMPLEMENTED, HTTP 502, a compressed or
truncated message, a truncated field, not gRPC, a timeout, a refused
connection, an untrusted certificate. It also pins the probe's endpoint
and instance to .bazelrc's fork-cache.
- TestSetupBazelRCWriter: the fork cache gets exactly the zstd line after
--config=fork-cache against a zstd stand-in, and none against the live
answer or a refused port. Remote-exec and rbe-fork, with a zstd
stand-in, never probe and never carry compression.
- TestBazelCacheModeReachesTheRC again rejects any vars. in setup-bazel's
env, and no mode's rc carries compression (the probe is refused there).
- The writer harnesses default RBE_CACHE_PROBE_URL to a refused loopback
port, so no test reaches rbe-cache.
Live check, 2026-10-04: rbe-cache answers without supported_compressors,
so the writer's mode cache rc has no flag until the E1 cutover.
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(cmd/bd): reset cobra flags between in-process runs; keep them out of parallel tests
runBDInProcess and runBDInProcessAllowError execute the package-level
rootCmd tree again and again in one process, and cobra never resets a
flag between Execute calls: a value one invocation parsed (create's
--title, --labels, list's --status, ...) and its Changed bit stayed on the
FlagSet, so the next invocation saw it, and a slice flag that had been
set appended to the stale value instead of replacing it. With a Dolt test
server (the only setup in which these tests run) that failed about 20
TestCLI_* tests depending on suite order.
TestMain now snapshots every flag of the tree (snapshotCommandFlags,
after all init()s registered them, before any test runs) and both runners
put the tree back before and after each run (resetCommandFlags): the
pointee of each flag.Value is restored (for pflag's scalar types that is
the bound variable; for slice types it also clears the internal "changed"
bit, so the next Set replaces), slice contents via SliceValue.Replace,
and Changed=false. TestResetCommandFlagsRestoresEveryFlag sets every flag
of the real tree and checks the reset. The ad-hoc --title reset in
TestCLI_CreateRejectsEmptyTitle_ProxiedServerMode is no longer needed.
Seven TestCLI_Comment* tests called t.Parallel() around the runners.
inProcessMutex serializes the runners only against each other, so their
chdir, stdio swap, env and config re-initialization raced every other
parallel test (data races on config globals; TestCobraParallelPolicyGuard
failing to read its own source files after a concurrent chdir). They run
serially now, and the guard treats the two runners like rootCmd.Execute.
Also two stale TestCLI_Create* cases: DryRunWithRigPrefix exercised a
create --prefix flag that no longer exists, and the flag-like-title cases
passed "--help" or "--foo-bar" where cobra parses them as flags; they now
pass the title after "--", the only way it reaches create's own guard.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cmd/bd): fix the ADO round-trip and bulk-delete tests that rotted unseen
Both need the integration tag and a Dolt test server, which no CI lane
gave cmd/bd (BEADS_TEST_SKIP=dolt everywhere), so they failed unnoticed:
- TestADORoundTrip* stored ado.pat in the database. ado.pat is a secret
read only from config.yaml or AZURE_DEVOPS_PAT (config.IsYamlOnlyKey),
so the tracker found no PAT. The fixture sets AZURE_DEVOPS_PAT.
- TestBulkDeleteNoResurrection expected GetIssue to return (nil, nil) for
a deleted issue; the Dolt store reports storage.ErrNotFound.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cmd/bd): fix parity, completion and notion tests that only fail with a Dolt server
These are Dolt-gated (integration tag + test server), so no CI lane ran
them and they rotted:
- TestParityCreate*/TestParityReopenErrorExits1Silently: bd create
auto-routes via routing.DetectUserRole("."), which warns "beads.role
not configured (GH#2950)" on stderr when the working directory's git
config has no beads.role. The suite pins the configured case, so the
parity env now sets beads.role=maintainer in a test-owned global git
config ($XDG_CONFIG_HOME/git/config; the role lookup scrubs every
GIT_CONFIG_* variable, so those cannot be used).
- TestIssueIDCompletion: issueIDCompletion resolves a database path
before looking at the open store and returns nothing when there is
none; the test now sets dbPath to its store's path.
- TestIssueIDCompletion_UsesWorktreeFallbackWhenStoreNil and
TestGetNotionConfigReadsDBPathWhenStoreUnset: the code under test
reopens the store from metadata.json, which names a database but not
the per-test branch of the shared database that newTestStore uses, so
the reopened store saw none of the test's rows. They now use their own
database (newTestStoreIsolatedDB).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cmd/bd): fix stale doctor/e2e/autocommit/readonly Dolt-gated tests
These need the integration tag and a Dolt test server, which no CI lane
gave cmd/bd, so they rotted unseen:
- TestE2E_DoctorFixMetadataRoundtrip, TestE2E_MigrateDoltMetadata,
TestDoctorCheckHealthReportsVersionMismatchOnRepoLocalPort: bd init now
defaults to embedded mode, where `bd sql` and `bd dolt start` are
refused. Init with --server on a repo-local server of their own
(repoLocalServerEnv: the suite's shared-server port vars cleared, server
stopped at cleanup) and start it explicitly, since BEADS_TEST_MODE=1 never
auto-starts one. MigrateDoltMetadata's DELETE also needed `key` quoted.
- TestDoctor{Conventions,Pollution}MaxRows_EnvOnly_Exits2: bdRunRaw drops
every BEADS_* variable, so the subprocess hit dolt.New's test-database
firewall (exit 1) before the row cap; pass BEADS_TEST_SERVER=1.
- TestDoltAutoCommit_On_WritesAdvanceHead: the embedded engine keeps its
data under .beads/embeddeddolt, not .beads/dolt; findDoltRepoDir looks
in both.
- TestValidateCheck_AllClean: bd doctor validate runs five checks since
the cross-table duplicates check was added.
- TestConfigValidateReadOnlyIsHermetic: readonly commands take a shared
workspace gate, whose lock file (.beads/dolt.gate.lock) workspacegate
creates on first use by design; compare the .beads tree without gate
lock files.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cmd/bd): undo each in-process execution's env and storage-mode leaks
Every in-process run of the bd command tree (runBDInProcess and the many
tests that call rootCmd.Execute directly) leaves process state behind:
PersistentPreRun exports the selected workspace as BEADS_DIR, loads its
.beads/.env, and records the workspace's mode in serverMode /
proxiedServerMode. With a Dolt test server, later tests in the same shard
then resolved a deleted fixture ("no active beads workspace found",
"migration sidecar is missing"), ran subprocess bd against the wrong
workspace ("recorded as proxied-server in .beads/metadata.json"), or took
the proxied path in RunE-level tests ("proxied-server UOW provider not
initialized", a nil-UOW panic in reopenProxiedResolve that killed a shard).
TestMain now registers a cobra initializer/finalizer pair
(installExecuteIsolation) that snapshots the environment and the two mode
globals when an execution starts and restores them when it ends; the
runners' restoreEnvSnapshot shares the helper. TestDoltConfigEnvironmentOverrides
used os.Setenv + defer os.Unsetenv, which deleted the suite's
BEADS_DOLT_SERVER_PORT (the test server's port) for every later test; it
uses t.Setenv now.
Full integration-tagged cmd/bd suite against a hermetic dolt (16 shards):
18 order-dependent failures and the shard panic gone; the 27 remaining
failures all fail alone too.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(init): keep --quiet quiet through the Claude/Codex/Cursor auto-setup
`bd init --quiet` ("Suppress output") still printed the project
integration installers' progress to stdout ("Installing Claude hooks for
this project...", "Claude Code integration installed", ...): the
installers write to os.Stdout unconditionally. Point stdout at the null
device around them while quiet; their failures keep going to stderr as
before. Found by TestInitCommand's quiet case, which asserts no output and
had not run in CI (Dolt-gated).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(init): bring the Dolt-gated init tests up to the current init contract
These tests need a Dolt test server, so no CI lane ran them and they
drifted from the product:
- Embedded is init's default mode, so the server-mode assertions
(.beads/dolt, opening the database on the test server, dolt_mode
"server" in metadata.json) now pass --server (TestInitCommand,
TestInitAlreadyInitialized, TestInitRedirect, TestInitBEADS_DIR,
TestInitDoltMetadata, TestInitDoltMetadataNoGit, TestInitDatabaseFlag's
metadata subtests). The in-process ones reset rootCmd's flags around
themselves so --server cannot leak into later in-process inits.
- Each server init gets its own --database: the suite shares one test
server, and a "test" database another test created belongs to another
project (init refuses: PROJECT IDENTITY MISMATCH).
- The marker tests seed a current-era version witness: the legacy-upgrade
guard refuses a non-empty .beads/dolt without one.
- The redirect test provisions the canonical target with config.yaml: bd
ignores a redirect to a directory with no project files (#4692).
- Shared-server inits get a free port of their own
(sharedServerTestEnv): the inherited BEADS_DOLT_SERVER_PORT is the
suite's test server, which a shared-server start refuses as another
project's, and the default shared port is 3308, a developer's live
server.
- --shared-server's config.yaml is now nested YAML (dolt: shared-server:
true); parse it instead of matching the old flat line.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cmd/bd): run the Dolt-gated tests that skipped on a bare dolt.New
setupTestDB (config, kv and Linear round-trip tests), setupGatedTestDB
(mol ready --gated) and the rename-prefix and bd sql tests opened stores
with dolt.New(&dolt.Config{Path: ...}): no server port, no
CreateIfMissing, so against a running test server they got "database ...
not found" and skipped as "Dolt server not available". They now use the
suite's newTestStore helpers (skip only when no test server runs), and
what that exposed is fixed test-side:
- TestCustomStatusConfig: custom_statuses is read back ORDER BY name;
look statuses up by name / expect name order.
- TestLinearRoundTripCoreFields, TestLinearPullMilestonesCreatesEpicHierarchy:
linear.api_key is a yaml-only secret (LINEAR_API_KEY), push now needs an
explicit linear.state_map, and batch push uses TeamLabels and
issueBatchCreate, which the mock server now answers.
- TestSqlCommand: bd sql refuses in the default embedded mode; set
serverMode for the server-backed store, and stop discarding RunE errors.
- TestE2E_AutoStartedRepoLocalServerPersistsAcrossCommands skipped on
this process's embedded mode although every bd it runs is a subprocess
on a --server workspace; gate on the dolt binary instead and stop the
auto-started server at cleanup.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cmd/bd): no fixed "unused" port, no swallowed JSON, no leaked front-door server
Three more things the Dolt-backed cmd/bd run exposed:
- TestTestServerConnection, TestSharedServerCfgNilHonorsSharedServer and
the two TestLegacyGuard* e2e tests pointed bd at 127.0.0.1:59999 as a
port nothing listens on. Any process on the host may hold it; a
listener that accepts and resets turns the expected "connection
refused" / "Dolt server unreachable" into another error. They take a
just-freed port from closedLoopbackPort (testutil.FindFreePort) now.
- TestDoltSetConfigJSONOutput and TestDoltSetConfigWithUpdateConfig
created .beads 0755, so bd's permissions warning landed in the JSON
under test and the tests skipped ("output not pure JSON") every run.
The fixture uses 0700, and non-JSON output fails instead of skipping.
- TestMigrateDoltModeFrontDoor's closing show/list auto-start a
repo-local server after the reverse migration; nothing stopped it, so
the suite's leak check failed (when the opt-in
BEADS_TEST_MIGRATION_FRONTDOOR suite runs). It stops it at cleanup.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): advisory cmd/bd Dolt-server tier (bazel-cmd-dolt)
No CI lane ran cmd/bd's Dolt-gated tests (TestCLI_*, the init and
store-backed suites, the doctor/e2e tests): main.yml's integration shards,
nightly's Full Test Suite, and Bazel's --config=prcore/ci and
--config=integration all pass BEADS_TEST_SKIP=dolt, so cmd/bd's TestMain
never starts a test server and those tests skip; the proxied and embedded
tiers run only their manifests' tests. They rotted unseen.
//cmd/bd:bd_dolt_server_test (tag dolt-server-cmd) runs the whole
integration-tagged cmd/bd suite, the integration build's bd_test, against
a hermetic dolt sql-server: BEADS_TEST_DOLT_SERVER=local starts it from
the pinned dolt in the test wrapper's runfiles, and
BEADS_TEST_REQUIRE_DOLT_CONTAINER=1 fails the target instead of skipping
into a cached pass. No test selection: the Go binary shards itself over
every top-level test (32 shards), so each runs exactly once, and
check_testcases.py fails a shard that ran none. --config=doltserver-cmd
has exactly --config=integration's build flags, so the two lanes share
bd_test's compile; prcore/ci and integration exclude the tag.
bazel.yml's new bazel-cmd-dolt job runs it exactly where bazel-integration
runs (same if: remotely on the farm for same-repo PRs, fork-ro/fork-rw,
and locally with the read-only cache in mode cache for forks). It is
advisory: job-level continue-on-error keeps a failure out of the call's
aggregate (BAZEL), and pr.yml's ci-gate reads its result (BAZEL_CMD_DOLT)
but requires it only while the committed top-level flag
BAZEL_CMD_DOLT_REQUIRED is "true" (now "false"; flipping it is the one
change needed). bazel-gate.sh accepts its skip in modes skip and local.
Policy tests: a third lane category in TestBazelLaneIsGatedAlongsideLegacy
(bazelFlagGatedLanes: gate env wired, never statically required, added by
the run script exactly when the pinned flag is "true"), the gate
simulation over every mode with the flag off (advisory: nothing it
reports reddens the gate) and on (exactly a gated lane), the cache-mode
and execution-mode checks, the tag taxonomy and prcore/integration
exclusions, and TestBazelCmdDoltJob (job steps, timeouts, .bazelrc
config equal to integration's build with no dolt skip or test selection,
the target's dolt-server rules, and bd_test's env repeated).
Measured locally (all fixes in this series, 32 shards, 16 at a time on a
shared host): 3267 top-level tests, all shards pass, max shard 313s (one
5001-issue export test, 214s, sets it), mean 100s.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(init): hand the project installers a writer instead of swapping os.Stdout
The --quiet fix earlier in this series pointed the process-global
os.Stdout at the null device around the Claude/Codex/Cursor installers.
That works, but it mutates a global from inside a cobra Run: anything else
writing to stdout meanwhile (a goroutine, a future concurrent installer)
would vanish, and a concurrent read of os.Stdout is a data race.
The installers already write through env structs with stdout/stderr
fields. setup.ProjectInstallOutput carries the two writers, and
InstallClaudeProjectTo / InstallCodexProjectTo / InstallCursorProjectTo
use them (the old entry points keep the process streams). init passes
QuietProjectInstallOutput() under --quiet: progress discarded, error lines
still on stderr. The proxied-server init path (domain adapter
InstallClaudeProject now takes quiet) does the same, so its
"Installing Claude hooks..." is quiet too.
Consistent error policy under --quiet: errors still reach stderr. init's
own "Warning: failed to setup <installer>" lines were suppressed under
--quiet while the installers' "Error:" lines were not, and some installer
failures (Cursor rules) print nothing themselves; the warnings now print
whether or not quiet, like the installers' errors.
Coverage in required lanes: TestProjectInstallersReportToTheGivenOutput
(cmd/bd/setup) and TestEmbeddedInitA/basic, which now asserts that
`bd init --quiet` with agents enabled installs the Claude hooks and prints
none of the installers' progress (verified to fail with the quiet output
disabled).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(export): exercise the incremental-export fallback with a small threshold
TestTryIncrementalExport_ThresholdExceededFallsBack seeded
incrementalExportThreshold+1 = 5001 issues to cross the threshold. Batch
create is one transaction but still several statements per issue, so under
-race against the shared test server it took ~214 s, the longest test in
cmd/bd's Dolt-backed suite by far. The behaviour under test is only
"more changed issues than the threshold -> full export fallback".
incrementalExportThreshold becomes a var (same value), and the test, which
is not parallel, sets it to 20 and seeds 21 issues: 214 s -> 0.6 s.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cmd/bd): tighten the flag-reset self-test, guards and canaries
Review follow-ups:
- TestResetCommandFlagsRestoresEveryFlag no longer skips a flag it cannot
set: a flag type without a sample value, a Set error, or a non-pointer
Value (which resetCommandFlags could not restore) is an error, so a new
flag type cannot go untested. resetCommandFlags documents that it also
resets flag-bound package globals.
- TestCobraParallelPolicyGuard treats .ExecuteC/.ExecuteContext/
.ExecuteContextC like .Execute (the per-execution isolation writes the
mode globals; a parallel execution would race).
- TestConfigValidateReadOnlyIsHermetic ignores only the gate a readonly
command takes (.beads/dolt.gate.lock and its .info sidecar), not any
"*.gate.lock*" file, so a new unexpected gate still trips the canary.
- TestCLI_CreateRejectsFlagLikeTitles: a bare `bd create --foo-bar` must
fail and create no issue (bd-2c0's intent), next to the "--" cases.
- TestCustomStatusConfig cites why statuses come back in name order: the
normalized custom_statuses table (#2961, 8537d943b) has no ordinal and is
read ORDER BY name, like custom_types; the test predates it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): run the cmd/bd Dolt-server tier in 16 shards
Each shard pays ~30-40 s of fixed cost (TestMain plus its own dolt
sql-server), so 32 shards spent roughly 40% of the lane's executor time on
setup and added 32 farm actions to every PR touching cmd/bd. With the
5001-issue export test cut to under a second, 16 shards measure (locally,
--nocache_test_results): max 186 s, mean 137 s, 2,187 executor-seconds
(vs ~2,800-3,200 at 32), all 3,267 top-level tests, every shard passing.
TestBazelCmdDoltJob pins the count; bazel.yml's timing comment is
restated (cache mode ~20-30 minutes).
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(proxy): fail fast with a MySQL error when the external upstream is unreachable
A proxied-server command against a stopped external Dolt upstream stalled
~20-30s before failing with a bare "invalid connection". The local db proxy
stays up, so on a refused backend dial (or a front such as stunnel/socat
that accepts and closes because its own upstream is gone) it simply closed
the client connection. The MySQL driver reports that as invalid
connection / unexpected EOF, which the uow bootstrap ping (#6003) classifies
as a transient drop and retries with exponential backoff for its whole 30s
budget. Retrying cannot help: the proxy already proved the upstream at its
own startup, and the outage is the upstream's.
The proxy now answers such a connection itself with a MySQL ERR packet
(2003, HY000) in place of the server greeting, naming the upstream and the
cause, exactly as a real server refuses a connection before the handshake.
The driver surfaces it as a *mysql.MySQLError, which the bootstrap retry
already treats as permanent, so the command fails in ~0.1s with an
actionable message. Only shapes that prove the upstream is not serving
qualify: ECONNREFUSED/ENOENT/EHOSTUNREACH/ENETUNREACH on dial, or a backend
that reaches EOF having sent zero bytes (a MySQL server always speaks
first). A dial timeout or a drop after the greeting keeps the plain close
and the client's transient retry.
External backends only: a managed (local sidecar) backend is owned by the
proxy and its dial can be refused transiently while bd drives it (the
full proxied lane caught TestProxiedServerInitExplicitBeadsDirIsAuthoritative
hitting exactly that mid-init when this applied to every backend), so
managed backends keep the bare close and the client's bootstrap retry.
TestExternalProxyOutageAndRestoreReDialsTCPAndUnix asserted the old
silent close during an outage; it now asserts the ERR packet.
With the latency fixed, TestProxiedOutageReconnectAcceptanceMatrix is
renamed into the proxied discovery pattern as
TestProxiedServerOutageReconnectAcceptanceMatrix and placed in the Bazel
30-shard block by gen_proxied_shard_manifest.py's incremental --write
(shard 8). The frozen legacy 15-shard block is untouched; the test
hash-distributes there like every other test added since it was frozen.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(proxy,uow): retry the proxy's upstream-outage report for ~1s; hedge the zero-byte case
Review follow-up to the fail-fast change.
A zero-byte close from the upstream is not proof it is down: Dolt closes
queued connections without a byte when max_connections/back_log are full,
when a queued connection times out, and while it shuts down for a
restart; an L4 front does the same while its target is replaced. Its
report now says "closed the connection before the MySQL greeting (down,
restarting, or at its connection limit)" instead of "unreachable", and
the comment no longer claims proof.
Refusals and endpoint churn also lost #6003's retry entirely, so an
external Dolt restart or a Service with no ready endpoints failed a
command at once. The client now retries the proxy's report
(proxy.IsUpstreamOutageError: 2003 with the "beads db proxy: " prefix)
for upstreamOutageRetryWindow (1s) from the first time it sees it, with
the backoff clamped so the last attempt lands at the window's end; other
transient errors keep the 30s budget. A real outage still fails in about
a second, inside the acceptance test's 3s bound.
Also: the dial report drops Go call-site wrapping ("dial tcp H:P:
connection refused"), truncation keeps UTF-8 intact, the comment states
how the packet differs from a real server's pre-handshake ERR (keeps the
'#'+SQLSTATE marker for vitess; 2003 is a client code chosen on purpose),
a Stats counter for reported outages, and the isTransientPingError
paragraph is reflowed and corrected.
Tests: pingWithRetry retries the report inside the window and gives up
at its end without using the full budget; openDB against a front that
plays the proxy (its real packet) and comes back 300ms after the first
connection succeeds in one call, and fails in about the window when it
never does; NewProxyServer enables the report for external backends
only; the dial message carries no Go type names; rune-safe truncation.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(proxied): fail, not skip, socat-bridged subtests in the Bazel lane
The external-unix front-door matrix subtest and both outage/reconnect
matrix subtests bridge an external endpoint with socat and skipped when
it was missing, so they could stop running without anyone noticing (the
parent test still passes). requireSocat now fails them when
BEADS_TEST_REQUIRE_SOCAT=1, which //cmd/bd:bd_proxied_test sets (its
remote workers have socat; a recent main run's external-unix subtest
passed there). The legacy GitHub 15-shard jobs have no socat and leave
it unset, so the subtests keep skipping there. The check now runs before
the upstream Dolt server is started, so a skip no longer pays for one.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(proxied): measured weight for the outage matrix; pin it to legacy shard 1
Give TestProxiedServerOutageReconnectAcceptanceMatrix a duration entry
(80s: local runs measured 55-79s alone, 60-70s in its shard, and review
68-109s under load) and re-place it with the generator's incremental
--write: it moves from 30/8 to 30/11, one line, nothing else moved. The
heaviest estimated shard is now 435s against a ~357s median; a repack
would even that out but moves most assignments, so it is left to a
separate CI-only change that refreshes all durations together.
Legacy 15-shard block: the test would hash onto shard 14, already ~13.5
of the 15 min timeout on main. It is pinned to shard 1 (~6.5 min in
recent main runs) under the block's reviewed-pin rule; it skips there
today (no socat), and the pin keeps shard 14 safe if that changes.
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>
The Bazel client's JVM defaults to 25% of RAM, about 2 GB on the 8 GB
2 vCPU Blacksmith runners every remote lane runs on. //... analysis fits
today with little headroom, and the plan moves more lanes and targets
onto these runners. write-bazelrc.sh now writes
`startup --host_jvm_args=-Xmx4g`: a startup option, so it changes no
action key and only restarts the server. Verified with Bazel 9.2.0:
`bazel --bazelrc=<generated rc> info max-heap-size` reports 4294MB.
gascity's W1 byte-copies this composite, so the change lands here first.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
beads allows every action today (allowed_actions: all, no SHA pinning),
so a fork PR's workflow can call any action, including Blacksmith's
sticky-disk action that commits state later trusted runs restore.
.github/allowed-actions.json is the exact body of the selected-actions
setting: GitHub-owned actions plus gascity's list plus the third-party
actions beads uses. That includes DeterminateSystems/nix-installer-action,
which determinate-nix-action calls, and peter-evans/create-pull-request.
Every uses: under .github is already pinned to a full commit SHA. The new
ci_actions_policy_test.go keeps it that way: each reference is local or
owner/repo[/path]@<40-hex>, and allowed by the file, so the repository
setting can switch to allowed_actions=selected with
sha_pinning_required=true without breaking a workflow. Negative controls:
an @v6 tag ref and an unlisted owner/repo each fail the test.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Main's "Test (proxied-server cmd 5/15)" has hit the 15m -test.timeout in
6 of the 9 Main runs since #7129 where the shard ran to completion.
That PR renamed 12 proxied tests into TestProxiedServer* discovery.
They are not in the frozen 15-shard legacy block, so they hash-place,
and two landed on shard 5:
TestProxiedServerStorageClass (nine parallel inits, the heaviest of the
12) and TestProxiedServerServeRefusesAStaleCheckpointWithGone. Shard 5
went from 430-620s of job time to 800-950s. In those runs the timeout
fired while TestProxiedServerMolReadyGated's parallel subtests were still
queued behind the rest of the shard. That test is the victim, not a
pathological one. Shard 3 (also hash-loaded) runs 810-870s, within about
a minute of the same limit.
Measured locally (4 pinned CPUs, GOMAXPROCS=4), shard 5 took 897s with
its current test set and 524s with the pre-#7129 set.
Pin those two tests, plus shard 3's two heaviest hash-placed tests
(TestProxiedServerListComments and
TestProxiedServerServeRefusesAStreamOnADisabledJournal), onto the legacy
shards with the lowest measured job time: 14, 7, 4 and 1. Every test
already listed in the block stays where it is, so shard 5 is back to its
pre-#7129 test set. pr-risk.yml's fork jobs read the same block, so they
get the same relief. The script's 15m timeout, the job and step
timeouts, and the Bazel 30-shard block are unchanged. The block header
and the generator's legacy header now say a reviewed pin is allowed.
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(git): canonicalize PinNoRepositoryUnderForTesting root so the pin matches on macOS
On macOS t.TempDir()/os.TempDir() live under /var/folders/..., but /var is
a symlink to /private/var and getcwd(2) reports /private/var/folders/....
underPinnedRootForTesting compared the raw pin against os.Getwd() with a
string prefix test, so the pin never matched there and
TestPinNoRepositoryUnderForTestingSurvivesResetCaches failed on every Main
macOS run (GetRepoRoot() returned the /private/var repo instead of "").
Store the pin both as given (absolute) and symlink-resolved, and match the
working directory in both raw and resolved form. Canonicalization can only
widen the fence, never narrow it (e.g. Bazel runfiles symlink trees keep
matching exactly as before).
TestPinNoRepositoryUnderForTestingMatchesThroughSymlinks reproduces the
macOS shape on any platform with a symlinked repo root; it fails without
this change.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): make run-go-test-binary.sh and install-golangci-lint.sh parse under bash 3.2
The Main macOS job runs the scripts package tests with macOS's /bin/bash
3.2, where two constructs abort under `set -u`:
- run-go-test-binary.sh expanded the usually-empty PASSTHROUGH array bare;
bash < 4.4 treats that as an unbound variable ("PASSTHROUGH[*]: unbound
variable"), failing TestTestScriptPrebuiltTestBinaryContract and
TestRunGoTestBinaryDefaultsTimeoutWhenOmitted. Use the ${arr[@]+...}
guard.
- install-golangci-lint.sh used `declare -A`; bash 3.2 parses it as an
indexed array and `[amd64]=` dies as an arithmetic lookup ("amd64:
unbound variable"), failing
TestInstallGolangciLintFailsClosedOnChecksumMismatch. Replace it with a
case function and update TestGolangciLintInstallScriptPinned's pin check.
Reproduced and verified against a bash 3.2.57 build: all four tests fail
on origin/main and pass with this change.
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>
actions/create-github-app-token (v3.2.0, pinned) deprecates its app-id
input in favor of client-id. rbe-prewarm's mint step now passes the
bazel-allocator App's public Client ID (Iv23ligrqVEhlamZnoPU, from
GET /apps/bazel-allocator) as a reviewed literal: it is not a credential,
and a literal keeps it policy-tested with the rest of the step instead of
in an unversioned repository variable. The private key stays a secret.
RBE_POOL_APP_ID is now unused, so its workflow_call declaration in
bazel.yml and its pass-through in pr.yml and nightly.yml are removed,
and a policy test rejects any workflow mentioning it again. The
repository secret can be deleted.
engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md's "rbe-west Pre-warm" section now
documents the client-id, the single remaining secret, and
RBE_PREWARM_WORKERS (default 1, clamped to 4, 0 = kill switch, repo
variable currently 2). It also no longer cites a maintainer's local
planning-notes path; a new tracked-file policy test fails if one
reappears.
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The prebuilt twins of the Windows liveness and worktree-remove jobs passed
alongside the native ones on every PR since F4 (#7135): #7139, #7145,
#7147, #7155, #7156, #7159, #7160 — 1-1.5 min vs 3-8 min native. Flip the
committed flag so ci-gate enforces the prebuilt pair; the native pair keeps
running as advisory and is the rollback (set the flag back to "false").
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): best-effort pre-warm rbe-west's OSS worker pool on PR open
bazel.yml's Bazel lanes each separately wait ~120s at "N actions, 0
running" while gastownhall/gascity's rbe-west NativeLink worker pool
scales up from zero. Add an advisory rbe-prewarm job (never a `needs`
of any lane, never in bazel-gate.sh's vocabulary, job-level
continue-on-error so it can never fail bazel.yml's own run) that
mints a short-lived installation token for a "bazel-allocator" GitHub
App (installed on gastownhall/gascity only, Actions read/write +
Metadata read) and dispatches gastownhall/gascity's
rbe-worker-pool.yml ahead of time, only when this run's lanes will
actually target rbe-west's "oss" instance (modes remote and fork-rw;
fork-ro targets a separate pool this doesn't serve).
Adds RBE_POOL_APP_ID / RBE_POOL_APP_PRIVATE_KEY as new optional
workflow_call secrets, threaded through every caller (pr.yml,
bazel-farm.yml, nightly.yml); either secret missing (the app not yet
provisioned) or repo var RBE_PREWARM_WORKERS=0 disables pre-warming
cleanly. Policy tests (scripts/bazel_rbe_prewarm_test.go, plus updates
to the existing bazel.yml structural tests) pin the mode gate, the
credential scope, the dispatch target, and that the job can never gate
or fail a run; each invariant was hand mutation-tested. Docs added to
engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md ("rbe-west Pre-warm").
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci): close rbe-prewarm token-theft path, fix stale secret-count docs (B1)
Security review of bdef342d5 found a BLOCKER (B1): the rbe-prewarm job
checked out inputs.checkout-sha (the fork head, reachable via
bazel-farm.yml's pull_request_target path) and then ran
.github/scripts/rbe-prewarm.sh with the minted gastownhall/gascity
dispatch token present. Script-file edits don't require workflow-approval
the way workflow-file edits do, so a VIP fork or same-repo branch pusher
could edit that script to steal the shared bazel-allocator key.
Fix: delete the checkout step and the .sh file; inline the dispatch logic
into the step's own `run:` block, whose bytes always come from the
trusted (approval-gated) workflow definition even under
pull_request_target. Mint the token in the immediately preceding step;
nothing after the mint step touches a repo-relative path. Stop forwarding
RBE_POOL_APP_ID/RBE_POOL_APP_PRIVATE_KEY from bazel-farm.yml (that fork
path now gets a cold start instead of pre-warming) and narrow the job's
`if:` to mode == 'remote' only (fork-rw never carried secrets anyway, so
it was dead weight - S1).
Also addresses the review's should-fix items:
- S2: document the widened trust boundary (the bazel-allocator key is
shared with gascity's own rbe-west scaler; leak blast radius; rotation
breaks the scaler, so the kill switch is unset-secret /
RBE_PREWARM_WORKERS=0, not rotation) as an accepted risk in bazel.yml's
header and engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md.
- S3: fix stale "exactly four secrets" claims (pr.yml/nightly.yml pass 6;
bazel-farm.yml now correctly passes 4 again) and the false "never a
long-lived credential" claim.
- S4: flag the continue-on-error-preserves-caller-success assumption as
reasoned-through but not live-validated in this sandbox.
- N1: drop the unused RBE_PREWARM_IDLE_MINUTES knob entirely.
- N4: strengthen the dispatch-target test to check exact gh command
strings and ban hardcoded repo/workflow literals outside $POOL_REPO/
$POOL_WORKFLOW.
Test changes (scripts/bazel_rbe_prewarm_test.go rewritten; ci_workflow_test.go,
bazel_farm_workflow_test.go, bazel_cache_mode_test.go updated for the new
job shape): new TestRBEPrewarmNoCheckoutStep,
TestRBEPrewarmNothingAfterMintTouchesARepoPath,
TestRBEPrewarmTokenOnlyInDispatchStep, and
TestRBEPrewarmAppSecretsOnlyExpectedCallers directly target the B1
mutation class; TestRBEPrewarmDispatchScriptBehavior keeps the fake-gh
behavioral coverage for the now-inlined dispatch script. Verified by hand
that both of the reviewer's mutations (widen the `if:` back to include
fork-rw; add a step after mint running a checked-out script) are now
caught.
Verification: go test ./scripts/..., go vet, gofmt, actionlint on the
four touched workflow files, make ci-pr-policy, make bazel-sync-check,
and `bazel test //scripts:scripts_test` all pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* ci(bazel): embedded-Dolt tier 20/5 -> 40/14 duration-balanced shards (F1)
Give the Bazel-only bazel-embedded job its own duration-balanced manifest
blocks for //cmd/bd:bd_embedded_test (20 -> 40 shards) and
//internal/storage/embeddeddolt:embeddeddolt_embedded_test (5 -> 14
shards), decoupled from PR Risk's/main.yml's legacy frozen 20/5-shard
fork/push jobs, mirroring F2's bd_proxied_test precedent.
- Measured every TestEmbedded* / embeddeddolt test's wall time in
isolation; split 21 cmd-tier and 1 storage-tier single top-level test
over 180s into disjoint sub-tests (3 irreducible exceptions left:
TestEmbeddedUpdateConcurrent 475s, TestEmbeddedCloseConcurrent 308s,
TestLargeBatchApplyStatementCounts712_Embedded 261s).
- New scripts/ci/gen_embedded_{cmd,storage}_shard_manifest.py +
_embedded_shard_manifest_lib.py generate/check duration-balanced
manifest blocks (LPT packing, incremental --write/--repack, exact-once
--check), chosen at N=40/M=14 where the heaviest shard reaches the
irreducible-test floor.
- Fixed 18 stale legacy 20-shard cmd manifest entries (and 1 storage
entry) left over from earlier test splits, which would have hard-failed
every shard of PR Risk's real test-embedded-cmd jobs on their next run.
- New scripts/embedded_shard_count_test.go policy tests tie the
Bazel-only block's shard count to bazel.yml's check_shard_coverage.py
argument and catch generator staleness; generalized
TestBazelRetiredLanesCheckListedTestsRan's live-shard-count dispatch
from bd_proxied_test-only to a map covering both embedded targets;
removed TestBazelEmbeddedJobMirrorsEmbeddedTier's now-invalid
BUILD.bazel-shard-count-equals-PR-Risk-matrix assertion.
- Verified: go test ./scripts/..., bazel test //scripts:scripts_test,
actionlint, make ci-pr-policy, make bazel-sync-check all pass; full
local bazel test of both targets at 40/14 shards passes 2/2; mutation
testing confirms each new/changed policy test fails exactly when it
should.
See ~/beads-bazel-plan/f1/impl-report.md for full detail.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(embedded-dolt): skip 712-item statement-count assertion under -race (F1)
TestLargeBatchApplyStatementCounts712_Embedded genuinely costs ~260-300s
under -race (confirmed by solo re-measurement: 298.60s) -- 14014 real SQL
statement round-trips through the race-instrumented in-process Dolt engine,
not an artifact and not splittable (one indivisible ApplyBatchInTx
transaction). It was the storage tier's single-test floor for CI shard
packing.
Apply the exact precedent TestLargeBatchApplyWallClock_Embedded already set
for its 1000-item shape: skip this assertion under raceEnabled (the cost is
race-instrumentation overhead on the Dolt engine's own internal
goroutine/lock machinery, not this test's own logic) and extend nightly.yml's
"Embedded Dolt batch-apply suite (non-race)" step's -run regex so the full
pinned 14014-statement baseline still runs, non-race, every night. Verified
directly: under -race the assertion now skips in 0.00s; without -race it
still runs and asserts Total=14015 (within the existing +/-2 tolerance) in
36.76s.
Updates scripts/ci_workflow_test.go's
TestNightlyFullTestRunsEmbeddedDoltBatchApplySuite to match the extended
regex.
Storage tier's new single-test ceiling under the per-PR -race lane drops
from ~260.7s to 152.38s (TestBatchApplyContract).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* ci(bazel): correct cmd-tier long-pole durations, re-pack embedded manifolds (F1)
Investigated coordinator item 2 (single-test long poles): TestEmbeddedUpdateConcurrent
(recorded 475.39s) and TestEmbeddedCloseConcurrent (recorded 308.06s), plus
the two other >180s cmd-tier entries from the same capture
(TestEmbeddedInitA 196.94s, TestEmbeddedEpicCloseEligibleReason 192.47s).
Root cause: NOT host contention, NOT backoff/retry sleeps (bdRunWithFlockRetry
contributes negligibly), NOT race-instrumented-subprocess overhead alone.
These numbers were captured via `bazel --nohome_rc test --config=embedded`
with the then-current 20-shard legacy manifest (~10-11 tests/shard) and
`-test.parallel=4`. Go's t.Parallel() starts each parallel test's elapsed
clock when its function is invoked, before the Parallel() call blocks it
waiting for a free one-of-4 slot -- so a test queued behind several other
heavy shard-mates has that queueing wait baked into its own recorded
`--- PASS: TestX (Ys)` time. This is shard-composition-dependent scheduling
delay, not a cost intrinsic to the test.
Confirmed two ways in an isolated clone (not this worktree, per the
no-plain-go-test-from-a-beads-checkout rule):
- Solo (no rivals at all): 151.83s / 106.48s / 63.58s / 66.08s.
- All four together with the real -race -test.parallel=4 flags and exactly
4 tests requested (so nobody queues -- parallel slots == test count):
141.34s / 113.80s / 69.79s / 74.63s.
Both agree closely and both are far below the capture-time numbers.
F1's LPT packer already isolates the heaviest tests into shards with few or
no other heavy rivals (TestEmbeddedUpdateConcurrent lands alone in its own
40-shard-block shard), so under the new manifest these tests see little to
no queueing delay in real CI. None of the four needed splitting, parallel
subtests, or raceEnabled-scaled N: once correctly measured, none exceeds the
180s single-test guideline (new corrected weights: 155.0 / 115.0 / 72.0 /
77.0s). Corrected scripts/ci/embedded_cmd_test_durations.json accordingly
(with a doc-comment explaining the methodology and both confirmations) and
re-packed the 40-shard Bazel-only block (--repack --write); --check passes
(exact-once coverage of all 241 discovered tests). The frozen legacy 20-shard
block is untouched and independently re-verified exact-once by simulating
embedded-test-shard.sh across all 20 shards (241/241 tests, no
duplicates/misses/errors).
New cmd-tier single-test ceiling: 179.47s (TestEmbeddedCloseAlreadyClosed,
likely itself somewhat inflated by the same mechanism but already under the
180s line as recorded, so no action needed).
Also updates scripts/ci/embedded_storage_test_durations.json: the prior
commit's raceEnabled-skip for TestLargeBatchApplyStatementCounts712_Embedded
means it now costs ~0s in the per-PR -race lane bazel-embedded actually
packs for (not its real ~260-300s non-race cost, which nightly.yml still
exercises) -- weight set to 1.0 with a doc comment tying it to the skip in
large_batch_apply_measure_test.go. Re-packed the 14-shard Bazel-only block
accordingly; --check passes (exact-once coverage of all 387 discovered
tests, excluding TestMain/TestConformance per that file's existing
convention). The frozen legacy 5-shard block is untouched and independently
re-verified exact-once via embedded-storage-test-shard.sh simulation
(388/388 tests, no duplicates/misses/errors).
Verification: go test ./scripts/... (includes the nightly.yml policy test),
make ci-pr-policy, make bazel-sync-check, actionlint all pass. Real local
`bazel --nohome_rc test --config=embedded //cmd/bd:bd_embedded_test
//internal/storage/embeddeddolt:embeddeddolt_embedded_test`
(--local_test_jobs=8, both targets together, on a shared/noisy sandbox host)
passes both targets; per-shard wall time from each shard's test.xml: cmd/bd
max 218.9s (shard 23/40, min 20.6s), storage max 251.1s (shard 5/14, min
0.98s) -- down from the prior oversubscribed sweep's 783.41s / 351.94s and
well under the single-test-floor-based ~475s projection this slice started
from. Projected tier lane time (max of the two targets, real dedicated CI
runners should do at least this well): ~251s, under the 5-minute target.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(embedded): un-vacuous TestEmbeddedDepB edges, split epic-close test, trim concurrency stress N (F1 review)
Coordinator review follow-ups on the F1 embedded-Dolt resharding slice:
- TestEmbeddedDepB (one of TestEmbeddedDep's two CI-speed split halves) was
asserting its tree_* subtests against an edgeless graph, passing
vacuously; restores the same parent-child/blocks edges TestEmbeddedDepA
builds so those subtests exercise real multi-node traversal (review S2).
- TestEmbeddedEpicCloseEligibleReason split into
TestEmbeddedEpicCloseEligibleReasonFlag/...Output for CI shard balance,
matching the project's established single-concern split pattern.
- TestEmbeddedUpdateConcurrent/TestEmbeddedCloseConcurrent's
issuesPerWorker reduced 5->2: under real concurrent-shard-load
measurement these were genuine (not queueing-artifact) serialized-write
costs; 2 preserves every invariant the test checks (duplicate-ID
detection across all workers, one non-decreasing-list-count check per
worker) at a fraction of the serialized work.
- large712ShapeName: the 712-shape's race skip and its zero-match guard now
share one named constant instead of two independent literal shape-name
strings, so a future rename of the shape can't silently skip the pinned
statement-count assertion under race (review N2).
- Comment-only fixes (review N5) in files referencing test names since
renamed/split by this slice's earlier work: close_proxied_integration_test.go,
graph_apply_test.go, storage_class_proxied_integration_test.go,
tests/regression/discovery_test.go, plus doc-comment path cleanups (N1:
drop unverified ~/beads-bazel-plan paths/bead ids in favor of the
committed duration JSON files and engdocs/TESTING.md).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* ci(bazel): re-derive embedded-Dolt durations under concurrent load; cap cmd shards at Bazel's 50-shard limit (F1 round 2)
Coordinator review required re-deriving every per-test duration weight from
a single, consistent, CI-realistic measurement (all shards running
concurrently, -test.parallel=4, race-enabled) instead of the prior pass's
mix of crowded-shard captures and solo/4-together spot-corrections, and
required measuring per-shard wall time via BEP testAttemptDuration rather
than a shard's outer test.xml <testsuites time> (which can include a
different, already-finished shard-mate's setup/teardown).
- scripts/ci/embedded_cmd_test_durations.json (242 tests) and
scripts/ci/embedded_storage_test_durations.json (387 tests) rewritten in
full from one consistent sweep. Every entry is now a fresh measurement;
none is a carried-over capture-time value or an unverified estimate. Both
files' _comment blocks retract the earlier "queueing delay baked into a
test's own reported elapsed time" theory (testing.go's (*T).Parallel does
not add wait time to a blocked test's own clock) and document the real
methodology.
- Only one cmd-tier test remains over 200s (TestEmbeddedListFiltering,
239.70s), already under the ~240s ceiling; no further top-level splits
were needed this round.
- New finding: Bazel hard-caps shard_count at 50 per sh_test-like rule
("Having more than 50 shards is indicative of poor test organization";
a native analysis-time limit, not configurable). The previous 88-shard
plan for //cmd/bd:bd_embedded_test (chosen as the LPT-packed floor before
this limit was discovered) is reverted to 50, Bazel's real ceiling.
Repacking the fresh weights at 50 shards gives a heaviest shard of
409.6s -- above the single-test floor of 239.7s, because 50 bins is not
enough headroom over the suite's ~20145 measured test-seconds to flatten
every bin to that floor. This makes the <=5 min lane target unreachable
for the cmd tier via resharding alone within Bazel's native per-rule
limit; see ~/beads-bazel-plan/f1/impl-report.md section 3c for the full
writeup and the two remaining levers (suite-wide speedups or a
multi-Bazel-rule split), neither attempted in this slice.
- internal/storage/embeddeddolt gets 15 Bazel-only shards (unaffected by
the 50-shard cap): LPT-packed heaviest shard 225.3s, within target.
- cmd/bd/BUILD.bazel, internal/storage/embeddeddolt/BUILD.bazel,
.github/workflows/bazel.yml, engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md,
scripts/embedded_shard_count_test.go, scripts/pr_risk_bazel_coverage_test.go,
scripts/ci/gen_embedded_cmd_shard_manifest.py updated to the corrected
50/15 shard counts (and, for the generator, N3: --write without an
explicit total_shards now errors instead of silently regenerating the
frozen legacy 20-shard block).
- .github/scripts/embedded-{cmd,storage}-test-shards.txt: re-packed
Bazel-only blocks at 50/15; frozen legacy 20/5 blocks untouched except for
N5 fixes to stale entries left by this slice's earlier test splits
(TestShardScriptsListOnlyRealTests catches this class of bug; both
legacy blocks reconfirmed exact-once).
- .github/workflows/nightly.yml / scripts/ci_workflow_test.go (N4): the
embedded-dolt batch-apply nightly step now runs with `if: ${{
!cancelled() }}` and its own explicit `-timeout 20m`, independent of the
job-level timeout, with both halves now asserted by
TestNightlyFullTestRunsEmbeddedDoltBatchApplySuite.
Verified: gofmt -l clean, go vet ./scripts/... clean, go test ./scripts/...
green, both generators' --check pass at 50/15 (and legacy 20/5 remain
exact-once via the frozen-block invariant).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(ci): rename embedded manifest staleness tests out of the ^TestEmbedded skip
The allowlisted go-test leg runs with -skip ^TestEmbedded, so tests named
TestEmbedded*ShardManifestGeneratorNotStale never ran there and the leg
failed with "matched no test that ran".
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 Sonnet 5 <noreply@anthropic.com>
* ci: move same-repo PR Linux/Windows/macOS legs to Blacksmith, shard preflight (F7b)
PR-path jobs for same-repo PRs/merge_group now run on Blacksmith instead
of GitHub-hosted runners, following F4/F7a's ternary-expression and
restore-only-cache patterns; forks/Dependabot are unaffected:
- scripts-go-checks, pr-lint-wrapper: same-repo Blacksmith 4vcpu Linux.
- check-doc-freshness-platforms, pr-preflight-platforms: restructured
from a top-level matrix.os list to an include:-only "matrix marker"
shape (runner: same-repo-linux/-windows/-macos) so each host can
resolve an independent same-repo Blacksmith selection via one chained
ternary runs-on expression.
- Six standalone Windows jobs (test-windows-liveness,
worktree-remove-windows, test-windows-small,
test-windows-liveness-prebuilt, worktree-remove-windows-prebuilt,
windows-make-shell) move to same-repo Blacksmith Windows
(blacksmith-{2,4}vcpu-windows-2025, public beta). CGO/mingw-w64 and
Chocolatey preinstall are unconfirmed on that image; both risks are
flagged with one-line rollback instructions at the call sites.
- pr-preflight-platforms' Windows leg is split into two shards (common
steps on shard 1, the three Windows-only heavy steps on shard 2) to
shorten its critical path; shard 2 downloads Go modules directly
instead of sharing shard 1's runner/cache.
main.yml gains cache savers for the newly same-repo-Blacksmith PR
consumers, since Blacksmith and GitHub-hosted runners cannot see each
other's actions/cache entries even for identical keys:
- blacksmith-go-build-cache warms the Blacksmith-selection race/non-race
GOCACHEs scripts-go-checks and pr-preflight-platforms/check-doc-
freshness-platforms' ubuntu legs need, push-to-main only. Its non-race
leg shares scripts/ci/warm-non-race-cache.sh with build-artifacts, and
compiles tools/bazel/run_allowlisted_go_tests.py's allowlisted
packages via its new --compile-only flag, so the two paths and the
warm-up can never drift from what they actually run.
- pr-lint-wrapper, go-vet-cache, test-windows gain a venue: [blacksmith,
github] matrix leg to seed both runner selections pr.yml's
same-repo-Blacksmith-or-fork-hosted consumers can land on.
Updates the policy-test suite (ci_workflow_test.go,
ci_blacksmith_runner_test.go, pr_lanes_bazel_coverage_test.go) to cover
the new runner selections, matrix-marker shape, shard gating, and cache
topology, including a dedicated inventory/writer check for
blacksmith-go-build-cache.
Deferred follow-up (not done here): sharding check-doc-freshness-
platforms and the standalone Windows jobs, and moving/sharding macOS
legs beyond what check-doc-freshness-platforms'/pr-preflight-platforms'
matrix-marker form already covers.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci): F7b review response -- msys2/Blacksmith-saver guards, macOS stays hosted (B1/B2/S3)
Addresses ~/beads-bazel-plan/f7b/review.md's two cache-safety blockers and
one follow-up gap found after F7b moved same-repo PR Linux/Windows/macOS
legs onto Blacksmith and added push-to-main Blacksmith cache seeders:
- B1: windows-make-shell's msys2/setup-msys2 step caches its installed
packages by default, which implicitly SAVED a GitHub Actions cache entry
from a same-repo PR the moment it ran on a Blacksmith runner (confirmed
via a real cache-list entry from a refs/pull/.../merge ref). Disabled with
a fail-closed `cache: ${{ runner.environment == 'github-hosted' }}`, and
generalized the sweep (TestBlacksmithReachablePRJobsDisableDefaultCachingActions)
to cover any default-caching setup-* action on a Blacksmith-reachable job,
not just this one.
- B2: blacksmith-go-build-cache, pr-lint-wrapper, go-vet-cache and
test-windows (main.yml) had no (or an incomplete) same-repo push-to-main
guard, so a same-repo fork with push access to its own main could run --
and save a cache entry from -- a paid Blacksmith job. Added the exact
push-to-main/same-repo `if:` F7c's own blacksmith-setup-go-cache already
uses, pinned by TestBlacksmithSaverJobsGuardedAgainstPullRequest.
- S3: the macOS leg of pr-preflight-platforms/check-doc-freshness-platforms
resolved to Blacksmith for same-repo PRs; Blacksmith bills macOS at
roughly 20x its Linux/Windows rate and no push-to-main Blacksmith-macOS
saver exists, so that leg would pay the premium for a guaranteed cold
cache. macOS now stays unconditionally on GitHub-hosted macos-latest.
Also pins S7 (blacksmith-go-build-cache/go-vet-cache/test-windows's cache
keys are bounded by go.sum+UTC-day, not github.sha) and S6/S8 (their
20-minute timeouts), both already in place but previously unpinned, and
replaces run_allowlisted_go_tests.py's fragile GO_TEST_FLAGS[-2:] slice with
an explicit BUILD_FLAGS constant (N1).
Re-ran the reviewer's 15 mutations (~/beads-bazel-plan/f7b/review/mutate.py):
all now killed or structurally moot (the Windows preflight shard split this
review asked to revert-unless-helpful was reverted, in an earlier commit on
this branch, removing the vulnerability surface 6 of them targeted).
scripts/BUILD.bazel: add the new ci_f7b_review_test.go to scripts_test's
srcs -- bazel test caught it missing (file existed on disk but was not
compiled into the Bazel-built test binary).
Verification: go vet/test/build, gofmt, bazel --nohome_rc test
//scripts:scripts_test, actionlint -shellcheck, shellcheck, make
ci-pr-policy, make bazel-sync-check all pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(ci): drop local review-doc path from comment
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 Sonnet 5 <noreply@anthropic.com>
* ci(advisory): move Conformance/Regression/Migration/Smoke/Docs/Proxied-Local to Blacksmith, fold matrices, path-filter, drop redundant nix-build PR trigger (F7c)
Reduces per-PR GitHub-hosted job load for advisory (non-required) workflows
per the "PR CI -> 5 min" plan, slice F7c. None of these workflows gate the
required CI Gate / PR Risk Gate checks.
- conformance.yml: same-repo PR/merge_group runs move to Blacksmith
(4vcpu); PR trigger gets the shared "upgrade-relevant code" path filter
(any non-test Go change or build input); also now runs on push to main.
- regression.yml: fold detect-regression-need into regression's first step
(gated via `if:`), eliminating a whole job; move to Blacksmith.
- migration-test.yml: fold the 14-version x cache-identity matrix into 3
shards (src/pre-dolt/dolt-runtime), looping every version in a shard via
a new "Verify explicit historical upgrades" step so a bad version does
not hide the rest; gains the shared path filter; move to Blacksmith.
- cross-version-smoke.yml: fold the 1-job-per-version matrix into chunks of
5 (delegated to upgrade-smoke-test.sh's native SMOKE_VERSIONS support);
gains the shared path filter; move to Blacksmith.
- docs-mintlify.yml, proxied-local-smoke.yml: move to Blacksmith
(2vcpu/4vcpu); add missing timeout-minutes where absent.
- nix-build.yml: drop the pull_request trigger — pr-risk.yml's required
test-nix job (nix run + nix flake check) is a strict superset of
`nix build .#default`, pinned by a new regression test.
- main.yml: add blacksmith-setup-go-cache, a push-to-main-only job that
warms setup-go's implicit cache with cache: true, since Blacksmith
runners cannot see GitHub-saved actions/cache entries that the six
workflows above now rely on via setup-go's own caching. Carves a scoped,
documented exception into assertPinnedGoCacheActions for this one job;
every other setup-go step in main.yml/pr.yml/pr-risk.yml still must pin
cache: false.
Forks and Dependabot PRs are unaffected (still ubuntu-latest, no secrets),
via the same conditional runner expression used elsewhere in the repo.
New policy tests in scripts/ci_f7c_advisory_test.go pin: path-filter
identity across the three filtered workflows, full version-set coverage
of the migration-harness fold (no scenario dropped), the per-shard/per-
chunk retry-all-versions-even-on-failure loop, fork/dependabot runner
selection semantics, no Blacksmith job reads secrets, and that the new
cache-seed job exists and that its six consumers don't disable the cache
it warms. All new tests and their underlying behaviors were mutation-
tested (each fails when the behavior it pins is reverted).
Caveat for rollout: the Blacksmith cache-seed job assumes Blacksmith
labels have branch-protected cache isolation from fork/untrusted PRs at
the org level (spec-f7.md Group B precondition) — this needs confirming
with an org admin before merge, since the seed job's cache becomes shared
infrastructure the six advisory workflows implicitly trust.
Replayed the last 60 merged PRs' changed-file lists against the new path
filter: 20/60 would now skip Conformance/Migration/Smoke (matches the
spec's estimate), and none of the 60 touched non-test Go code while being
classified as skip.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci,advisory): F7c review B1/B2 - pin migration fallback, restore-only Blacksmith caches
B1: migration-test.yml's non-Blacksmith historical-upgrades fallback was
`ubuntu-latest`, which actions/runner-images#14748 schedules to move from
24.04 to 26.04 starting 2026-10-19. 26.04 drops libicu74, which the v0.55.4
fixture's ICU ABI depends on (and which "Install test dependencies" installs
explicitly). Pin the fallback to the literal `ubuntu-24.04` label instead, and
add the matching sameRepoBlacksmith4vcpuNoble constant so the pin itself is
tested. Confirmed via `git show <pre-F7c>` that none of the other five
workflows F7c touched ever had a pinned-OS fallback, so this regression was
scoped to migration-test.yml only.
B2: Blacksmith cannot see GitHub-hosted cache entries, and a same-repo PR
writing a cache entry another PR or main later reads back unverified is a
poisoning vector. Make every advisory consumer (conformance, regression,
migration-test, cross-version-smoke, docs-mintlify, proxied-local-smoke)
disable setup-go's own implicit cache on self-hosted runners and restore-only
from a self-defined `blacksmith-sg-v1-...` key namespace (not setup-go's own
implicit key, so there is no dependency on Blacksmith's $ImageOS matching
GitHub-hosted resolution). Only main.yml's new blacksmith-setup-go-cache job
(push-to-main only, always trusted) saves: it always restores, unconditionally
re-runs every warm-up command (no longer gated on a cache hit, so a stale or
partial restore self-heals), and always saves under the same key. Delete the
now-unneeded goCacheImplicitCacheExceptions carve-out in ci_workflow_test.go.
Also convert cross-version-smoke.yml's smoke-binaries-* and regression.yml's
regression-baseline-* caches from a monolithic actions/cache (auto-saves on
any miss) into an explicit restore (always, modulo the job's own gate) / save
(gated off pull_request) pair, closing the same poisoning vector for
per-release binaries. migration-test.yml's historical-dolt-* cache is left
unchanged: it is already checksum-verified on every read by
scripts/migration-test/lib/binary.sh.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(ci,advisory): F7c review SF - behavioral tests, path filters, F7a naming coordination
Replace substring-matching tests with behavioral ones that execute the real
embedded bash/jq against synthetic input, closing the reviewer's 12 surviving
mutations:
- TestMigrationHarnessLoopExecutesBehaviorally runs the real "Verify explicit
historical upgrades" step against a stub run.sh: every version in a shard
still runs after an earlier one fails (closes `exit 0`/`break` mutations),
failures are ::error:: annotated and written to $GITHUB_STEP_SUMMARY, a bad
or empty SHARD_VERSIONS fails closed without ever invoking run.sh, and a
hung version is bounded by `timeout --kill-after` without hiding the version
queued after it. The step's env now exports SHARD so its run: body has no
literal ${{ }} GH-expression syntax left for a test harness to choke on.
- TestMigrationHarnessCacheHashMatchesDerivation pins each shard's cache-hash
against sha256(join(",", <shard's cache-identity strings>))[:16], recovered
from the pre-fold 14-entry table (git show 362eecc6bf), closing a stale-
cache-hash mutation.
- TestMigrationHarnessDoltRuntimeStepGatedByShard pins the exact gate
expression for "Install Dolt test runtime".
- TestCrossVersionSmokeChunksEveryResolvedVersion now executes the real jq
chunking and join programs (via the new ghExtractJQProgram helper) against
synthetic version lists of several sizes, and asserts the smoke step's run:
command is an exact match - closing jq-slice-off-by-one and
dropped-SMOKE_VERSIONS mutations a substring check could not catch.
- TestRegressionStepsAfterDetectAreGated pins that every step after
regression.yml's detect step stays gated on
steps.detect.outputs.run_regression == 'true', closing an
ungated-regression-step mutation.
- TestBlacksmithSetupGoSeedExistsForAdvisoryConsumers,
TestAdvisoryBlacksmithConsumersAreCacheRestoreOnly (replacing
TestAdvisoryBlacksmithConsumersKeepImplicitSetupGoCache),
TestBlacksmithSetupGoCacheKeysMatchAcrossSeederAndConsumers, and
TestAdvisoryBinaryCachesAreRestoreAlwaysSavePRGated cover the B2
restore-only/seeder-saves cache topology end to end, including a
seeder/consumer key-match check and scoping the "no save in a consumer job"
check to the blacksmith-sg-v1- namespace specifically so migration-test.yml's
legitimate, checksum-verified historical-dolt-* cache is not flagged.
Path filters: add scripts/migrate-legacy-to-current.sh to migration-test.yml
(the harness invokes it directly but it lives outside scripts/migration-test/)
and internal/storage/embeddeddolt/conformance_test.go plus backend/conformance/**
to conformance.yml, with a new TestConformancePushPathsMatchPullRequestPaths
pinning push.paths and pull_request.paths stay identical.
Coordination with F7a (ci/f7a-blacksmith-fold, lands before F7c): F7a
independently defines its own sameRepoBlacksmith4vcpu/2vcpu constants and a
TestSameRepoBlacksmithExpressionSemantics, and is moving a real GH-Actions
expression evaluator into a shared scripts test helper file. Per the
coordinator, rename this branch's same-named test to
TestF7cAdvisorySameRepoBlacksmithExpressionSemantics (deliberately left as the
same simple literal mirror it always was, not a competing evaluator) so it
does not collide with F7a's helper on rebase; at rebase time this test should
be reduced or replaced in favor of F7a's shared evaluator.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(ci): update stale nix-build PR-trigger and renamed check-name references (F7c review S6)
F7c (bb81136203) dropped nix-build.yml's pull_request trigger as redundant
with PR Risk's test-nix job, and folded cross-version-smoke.yml's one-job-
per-version matrix into one job per 5-version chunk. Update the docs that
still described the old topology:
- CONTRIBUTING.md: nix build .#default no longer runs on PRs; point at PR
Risk's required test-nix job instead.
- update-vendor-hash.yml: same correction in its header comment and the
GITHUB_TOKEN-retrigger caveat.
- engdocs/CI_TEST_SURFACE_AUDIT.md: migration-test.yml now also runs on PRs
(path-filtered, advisory) across 3 shards instead of 14 per-version legs;
nix-build.yml's row now reflects push-to-main-only.
- engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md: replace `Upgrade smoke
(<version> -> candidate)` with the current `Upgrade smoke (chunk N)` job
name in both the "do not require directly" list and the Cross-Version
Smoke section; rewrite the Nix Build section to describe nix-build.yml as
push-to-main-only (no longer a PR check to warn about requiring directly)
and remove the now-unreachable `nix build .#default` bullet from the
"do not require" list.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* ci(advisory): rebase onto F7a shared Blacksmith helper, drop duplicate const/evaluator
F7a (PR #7139, ci/f7a-blacksmith-fold) landed its own sameRepoBlacksmith4vcpu
const and TestSameRepoBlacksmithExpressionSemantics, plus a real GitHub
Actions expression evaluator (evalGHExpr/mustEvalGHRunsOn) in a new shared
scripts/ci_blacksmith_runner_test.go. This branch rebased onto
origin/ci/f7a-blacksmith-fold and reconciles the two:
- Removed this branch's duplicate sameRepoBlacksmith4vcpu definition in
ci_workflow_test.go (rebase conflict); it's now served solely by F7a's
shared const. sameRepoBlacksmith4vcpuNoble (F7c's B1 fix, fallback pinned
to ubuntu-24.04 instead of ubuntu-latest) is kept as its own const, as
instructed, since it is F7c-specific and not shared.
- Replaced TestF7cAdvisorySameRepoBlacksmithExpressionSemantics's
hand-written Go mirror of the same-repo Blacksmith boolean logic with real
evaluation of each F7c advisory job's actual, as-parsed runs-on expression
text via F7a's evalGHExpr/mustEvalGHRunsOn, across the same event-shape
truth table F7a's own test uses (same-repo/fork/dependabot/deleted-fork-
head/merge_group/push/pull_request_target/schedule/workflow_dispatch).
This covers all 8 F7c advisory Blacksmith jobs, including
migration-test.yml's historical-upgrades job falling back to the literal
ubuntu-24.04 label rather than ubuntu-latest. Confirmed via a cp-backed
mutation (flipping the Noble fallback back to ubuntu-latest) that this new
test, unlike the deleted hand-written mirror, actually catches a
regression in the real expression text.
- Merged two more rebase conflicts in ci_workflow_test.go: the
assertNoUnmanagedGoCacheSteps main.yml allowlist (F7a's
windows-test-binaries-cache plus F7c's blacksmith-setup-go-cache) and a
subsequent non-conflicting-but-incomplete 3-way merge of
TestSameRepoBlacksmithRunners' main.yml entry (added
windows-test-binaries-cache alongside blacksmith-setup-go-cache so the "no
other Blacksmith label leaks" sweep covers both).
Did not merge TestBlacksmithAdvisoryJobsReadNoSecrets into F7a's
TestBlacksmithJobsReadNoSecrets (ci_workflow_test.go) even though the shared
helper file's doc comment suggests it; out of scope for this round per the
coordinator's explicit instructions, left as a follow-up.
Re-ran full verification after rebase + reconciliation: go build/vet/test
./scripts/..., bazel --nohome_rc test //scripts:scripts_test, actionlint
-shellcheck=shellcheck across all touched workflows, make ci-pr-policy, make
bazel-sync-check - all green. gofmt -l clean.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci,advisory): close F7c re-review blocker X1 and S1-S5/N1 gaps
Re-review (~/beads-bazel-plan/f7c/rereview.md) found one blocker and five
should-fix gaps against ci/f7c-advisory-workflows:
X1 (blocker): migration-test.yml's historical-dolt-* cache was still a bare
actions/cache that auto-saves on any key miss on Blacksmith for same-repo
PRs. tar -P extraction plus lib/binary.sh's cp -f following a planted
symlink can redirect a write before sha256 verification ever runs, so the
"checksum-verified" exemption was unsound. Converted to the same
restore-always/save-off-PR split as smoke-binaries-*/regression-baseline-*,
dropped the exemption comments, and added it to advisoryBinaryCaches.
S1: TestRegressionDetectStepBehavioral executes regression.yml's detect
step's actual bash against a scratch git repo, closing mutation M13 (detect
step hard-wired to emit run_regression=false).
S2: TestBlacksmithReachableAdvisoryJobsNeverSaveACache sweeps every job in
every F7c advisory workflow (plus main.yml) whose runs-on resolves to a
Blacksmith label under a same-repo pull_request/merge_group context, and
fails on any bare actions/cache, any un-gated actions/cache/save, or any
setup-go/setup-node/setup-python step that would still cache there. Also
added a job-level `if: github.event_name == 'push' && github.ref ==
'refs/heads/main' && github.repository == 'gastownhall/beads'` guard to
main.yml's seeder job (TestBlacksmithSeederGuardedAgainstPullRequest) so a
future pull_request/merge_group trigger on main.yml can't turn the seeder
into a same-repo-PR-reachable cache writer.
S3: advisoryBinaryCaches' save-gate check is now exact-equality, not
strings.Contains, so a `... || true` gate can no longer slip past it.
S4: conformance.yml's path filters now include
internal/storage/embeddeddolt/test_fixture_test.go, which holds TestMain
for the whole package (moved out of conformance_test.go) and was previously
excluded by the blanket !**_test.go negation.
S5: main.yml's blacksmith-setup-go-cache seeder keyed its save on
github.sha, so every push to main - regardless of whether go.sum changed -
wrote a new multi-GB ~/go/pkg/mod + ~/.cache/go-build entry, risking LRU
eviction of F7a's own Blacksmith-seeded caches. Added a "Compute cache
date" step and keyed on the UTC calendar day instead, capping writes to at
most once per day; the same step/key was added to all 6 consumers so their
restore key stays byte-identical to the seeder's save key
(TestBlacksmithSetupGoCacheKeysMatchAcrossSeederAndConsumers).
N1: flipped `cache: ${{ runner.environment != 'self-hosted' }}` to
`cache: ${{ runner.environment == 'github-hosted' }}` on setup-go's own
implicit cache across all 7 call sites, so an empty/unknown
runner.environment value fails closed (caching off) instead of open.
Verification: go build/vet/test ./scripts/..., bazel --nohome_rc test
//scripts:scripts_test, actionlint -shellcheck=shellcheck
.github/workflows/*.yml, make ci-pr-policy, make bazel-sync-check all pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci,advisory): close merge_group gap in binary-cache save gates
Running TestBlacksmithReachableAdvisoryJobsNeverSaveACache against every
Blacksmith trust context it is reachable under (instead of stopping at the
first match found, which made the check's coverage depend on Go's
randomized map iteration order) surfaced a real gap the S2 sweep was meant
to close: smoke-binaries-*, regression-baseline-* and historical-dolt-*'s
save gates were all `if: github.event_name != 'pull_request'`, a deny-list
that also admits a hypothetical future merge_group event. All three jobs'
runs-on expressions already resolve to a Blacksmith label under
merge_group, so a merge_group run would have been able to write those
caches too - the same same-repo-writer risk X1 closed for pull_request,
just not currently reachable since none of these three workflows has an
`on: merge_group:` trigger today.
Changed all three save gates to an exact allow-list of the triggers they
actually intend to write from (push, workflow_dispatch) rather than a
deny-list of the one trigger they don't. Updated
TestAdvisoryBinaryCachesAreRestoreAlwaysSavePRGated's wantSaveIf strings to
match, and made TestBlacksmithReachableAdvisoryJobsNeverSaveACache check
every blacksmithTrustContexts entry per job (sorted for determinism)
instead of breaking on the first Blacksmith-reachable context, so this
class of context-dependent gate gap can't hide behind map iteration order
again.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(ci,advisory): directly assert main.yml has no PR-reachable trigger
TestBlacksmithSeederGuardedAgainstPullRequest's job-level guard defuses the
vulnerability structurally, but a mutation that only edits main.yml's on:
block (adding pull_request:) without touching the job-level if: was not
caught by any existing test (confirmed: mutate.py's N6 probe survived).
Add TestMainWorkflowHasNoSameRepoPRReachableTrigger, the direct half of
F7c review fix S2's "pin the seeder's trust boundary" ask: assert main.yml's
on: has none of pull_request/pull_request_target/merge_group/workflow_run,
and still has push. Confirmed this kills N6 (manually applied and reverted
via a cp backup).
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/37159233834
(`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.
---------
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Under Bazel, prlintmake_test resolved go.mod's toolchain (go1.26.7)
through whatever go the executor has on PATH. When that is another
release, gofmt-bin.sh's GOTOOLCHAIN=go1.26.7 fallback downloads the
toolchain from proxy.golang.org on every run, and fails where actions
have no network: rbe-west's fork pool runs every action in its own
network namespace with loopback only (NETNS=1). Three tests failed
there (TestGofmtBinMatchesGoModToolchain, TestGofmtBinIgnoresPathGofmt,
TestFmtCheckReportsGofmtVersion) and passed with NETNS=0.
The registered SDK is go.mod's toolchain (bazel_policy_test pins them),
so declare it as data and have testGo put it first on PATH. gofmt-bin.sh
then takes its "host go already is the pinned one" path and fetches
nothing. Plain `go test` is unchanged.
Co-authored-by: gascity-agent <agent@gascity.ai>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>