Compare commits

..

3 commits

Author SHA1 Message Date
mayor
a31d162877 fix(storage): use factory for cross-repo routing to respect backend config
When routing issues to other repos (via contributor routing or --rig flag),
the code was hardcoding sqlite.New instead of using the storage factory.
This meant Dolt-configured repos would fail when receiving routed issues.

Changed two locations:
- Contributor routing (line 357): use factory.NewFromConfig
- createInRig --rig flag (line 789): use factory.NewFromConfig

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 12:10:57 -08:00
mayor
4481d8c216 feat(cli): add bd dolt commands for version control
Add CLI commands to expose Dolt version control operations:
- bd dolt status: Show pending database changes
- bd dolt commit: Commit all changes with message
- bd dolt log: Show commit history
- bd dolt branch: List/create branches
- bd dolt checkout: Switch branches
- bd dolt merge: Merge branches
- bd dolt push/pull: Sync with remotes
- bd dolt remote add: Add remotes
- bd dolt diff: Show changes between refs
- bd dolt history: Show issue change history
- bd dolt show: Show issue at specific commit
- bd dolt conflicts/resolve: Handle merge conflicts

Also fix bugs in storage layer:
- StatusEntry.Status is string not int
- dolt_conflicts uses 'table' not 'table_name'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 07:57:28 -08:00
mayor
a1a9dd9fc6 fix(storage): resolve Dolt deadlock in dependency queries
Change nested database queries to a two-phase approach to prevent
deadlocks with Dolt embedded driver. Instead of fetching issues
while iterating over result sets, we now:
1. Collect all IDs/metadata in first query
2. Close the first result set
3. Fetch issue details in separate queries

Also improve Dolt detection in tests to check multiple paths
including /opt/homebrew/bin/dolt for Apple Silicon Macs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 07:57:28 -08:00
5590 changed files with 247183 additions and 1280590 deletions

View file

@ -1,51 +1,59 @@
---
description: How to resolve merge conflicts in the beads Dolt database
description: How to resolve merge conflicts in .beads/issues.jsonl
---
# Resolving Beads Merge Conflicts
# Resolving `issues.jsonl` Merge Conflicts
Beads uses Dolt as its storage backend. Dolt handles merges natively using its built-in three-way merge, similar to git.
If you encounter a merge conflict in `.beads/issues.jsonl` that doesn't have standard git conflict markers (or if `bd merge` failed automatically), follow this procedure.
## 1. Check for Conflicts
```bash
bd doctor
bd dolt pull
## 1. Identify the Conflict
Check if `issues.jsonl` is in conflict:
```powershell
git status
```
If `bd dolt pull` reports merge conflicts, Dolt will list the conflicting tables and rows.
## 2. Extract the 3 Versions
Git stores three versions of conflicted files in its index:
1. Base (common ancestor)
2. Ours (current branch)
3. Theirs (incoming branch)
## 2. Resolve Conflicts
Dolt provides SQL-based conflict resolution:
```bash
# View conflicts
bd sql "SELECT * FROM dolt_conflicts"
# Resolve by accepting ours or theirs
bd sql "CALL dolt_conflicts_resolve('--ours')"
# OR
bd sql "CALL dolt_conflicts_resolve('--theirs')"
Extract them to temporary files:
```powershell
git show :1:.beads/issues.jsonl > beads.base.jsonl
git show :2:.beads/issues.jsonl > beads.ours.jsonl
git show :3:.beads/issues.jsonl > beads.theirs.jsonl
```
## 3. Verify and Complete
## 3. Run `bd merge` Manually
Run the `bd merge` tool manually with the `--debug` flag to see what's happening.
Syntax: `bd merge <output> <base> <ours> <theirs>`
```bash
# Verify the resolution
bd list --json | head
# Push the resolved state
bd dolt push
```powershell
bd merge beads.merged.jsonl beads.base.jsonl beads.ours.jsonl beads.theirs.jsonl --debug
```
## Legacy: JSONL Merge Conflicts
## 4. Verify the Result
Check the output of the command.
- **Exit Code 0**: Success. `beads.merged.jsonl` contains the clean merge.
- **Exit Code 1**: Conflicts remain. `beads.merged.jsonl` will contain conflict markers. You must edit it manually to resolve them.
If you encounter merge conflicts in `.beads/issues.jsonl` from a legacy setup, import the resolved file:
Optionally, verify the content (e.g., check for missing IDs if you suspect data loss).
```bash
# Resolve the git conflict in the JSONL file manually, then:
bd import -i .beads/issues.jsonl
## 5. Apply the Merge
Overwrite the conflicted file with the resolved version:
```powershell
cp beads.merged.jsonl .beads/issues.jsonl
```
## 6. Cleanup and Continue
Stage the resolved file and continue the merge:
```powershell
git add .beads/issues.jsonl
git merge --continue
```
## 7. Cleanup Temporary Files
```powershell
rm beads.base.jsonl beads.ours.jsonl beads.theirs.jsonl beads.merged.jsonl
```

View file

@ -1,10 +0,0 @@
npm-package/node_modules
website
node_modules
.claude/worktrees
.worktrees
.beads
.dolt
dist
.runtime
tmp

523
.bazelrc
View file

@ -1,523 +0,0 @@
# Bazel configuration for beads. Bazel is beads' build and test system: CI
# gates on the `bazel test` lanes in .github/workflows/bazel.yml, and
# `make test`/`make check` run the same commands (engdocs/TESTING.md
# "Building and Testing"). Plain `go build`/`go test` still work as an
# inner-loop convenience but are not what CI enforces. Where actions run is
# per machine, never committed here: contributors read the anonymous,
# read-only cache with --config=fork-cache (defined below); maintainers with
# an rbe-west client certificate execute remotely with --config=remote-exec.
# Make either the default with a `build --config=...` line in the gitignored
# .bazelrc.local. Bzlmod only; Bazel version is pinned in .bazelversion.
common --enable_bzlmod
common --color=no
# C/C++ (and so cgo, -race and the Go stdlib) builds only with MODULE.bazel's
# pinned LLVM toolchain: no host-detected local_config_cc to fall back to,
# which would key actions to the client's gcc and lld and fail remote links
# on workers without lld (scripts/bazel_hermetic_cc_test.go).
common --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# The pinned remote-worker host in every action key: //platforms:rbe_worker's
# worker-env exec property is the sha256 of tools/rbe/worker-env.txt, and
# rbe-west's schedulers run an action only on a worker that measured that
# host (platforms/BUILD.bazel). Key-affecting, so unconditional: local,
# fork-cache and remote runs hash alike.
build --extra_execution_platforms=//platforms:rbe_worker
# ICU policy (engdocs/ICU-POLICY.md): build go-mysql-server with its pure-Go
# regex backend so no target links libicu. MODULE.bazel carries the matching
# gazelle_override for github.com/dolthub/go-mysql-server.
build --@rules_go//go/config:tags=gms_pure_go
# Keep the client PATH/env out of action keys.
build --incompatible_strict_action_env
test --test_output=errors
# Test environment isolation (the pr-core `go test` environment of
# scripts/ci/lib/test-env.sh): every test process runs under a wrapper that
# gives it a private HOME, XDG_CONFIG_HOME, DOLT_ROOT_PATH, empty global
# gitconfig and a short, per-process TMPDIR (unix-socket sun_path limit).
# Client HOME/TMPDIR are never forwarded, so no host value enters the action key.
test --run_under=//tools/bazel:test_env
test --test_env=BD_DISABLE_METRICS=1
test --test_env=BD_DISABLE_EVENT_FLUSH=1
# PR-core parity: the same test selection as scripts/ci/pr-core.sh (race,
# -short, skips, tag filters); the environment comes from the wrapper above.
test:prcore --@rules_go//go/config:race
test:prcore --test_arg=-test.short
# pr-core.sh's -parallel 4. Without it -test.parallel defaults to GOMAXPROCS,
# the executor's core count (192 on a farm worker), not a runner's 4.
test:prcore --test_arg=-test.parallel=4
test:prcore --test_arg=-test.skip=^TestEmbedded
test:prcore --test_env=BEADS_TEST_SKIP=dolt
# As in pr.yml's PR Core step: a root or non-POSIX executor fails
# TestAddExcludePatternsRefusesReadErrors instead of skipping it.
test:prcore --test_env=BEADS_TEST_REQUIRE_EXCLUDE_PERMISSION=1
# Every tag that belongs to another lane (scripts/bazel_policy_test.go
# bazelPRCoreExcludedTags). integration-only targets run zero tests outside
# --config=integration.
test:prcore --test_tag_filters=-dolt-server,-dolt-server-proxied,-dolt-server-integration,-dolt-server-cmd,-embedded,-manual,-integration-only
test:ci --config=prcore
test:ci --keep_going --test_summary=terse
# tools/bazel/equivalence.py compares the Go tests Bazel ran with the ones
# `go test` would run, from each target's test.xml. rules_go only lists passing
# tests in test.xml under -test.v, and --remote_download_minimal would leave
# test.xml on the remote side, so ask for both.
test:ci --test_env=GO_TEST_WRAP_TESTV=1
test:ci --remote_download_regex=.*/test\.xml$
# bazel.yml publishes the non-race bd as pr.yml's ci-build-artifacts.
test:ci --remote_download_regex=.*/bin/cmd/bd/bd_for_tests/bd$
# Embedded-Dolt tier: PR Risk's embedded jobs ("Test (Embedded Dolt Cmd
# N/20)", "Test (Embedded Dolt Storage N/5)", "Test (Embedded Dolt
# Conformance - core/audit)"), as the `embedded`-tagged variants of bd_test
# and embeddeddolt_test. Race like the jobs' binaries, no -short, no
# BEADS_TEST_SKIP; each variant sets BEADS_TEST_EMBEDDED_DOLT=1. The shard
# variants run the jobs' shard scripts, so every Bazel shard runs exactly the
# tests of the job with the same number.
# Only the variants and what they need are built (the same race configuration
# as --config=ci, so the two lanes share every compile).
test:embedded --@rules_go//go/config:race
test:embedded --test_tag_filters=embedded
test:embedded --build_tests_only
test:embedded --keep_going
test:embedded --test_summary=terse
# The variants are timeout = "eternal" because the jobs' Go timeouts are past
# "long"; rbe-west rejects any action timeout over 1200s, so eternal means
# 1200s here, and the effective limit of every variant is -test.timeout=19m
# (the storage and cmd shard jobs pass 20m, conformance core/audit 30m), so
# that Go's timeout, which dumps every goroutine, fires before Bazel's 1200s
# kill, which does not (see the BUILD targets).
test:embedded --test_timeout=-1,-1,-1,1200
# The jobs pass no -parallel: GOMAXPROCS on a 4-vCPU runner.
test:embedded --test_arg=-test.parallel=4
test:embedded --test_env=GO_TEST_WRAP_TESTV=1
test:embedded --remote_download_regex=.*/test\.xml$
# Since D2 step 1 this lane is the tier's only pre-merge run on same-repo PRs
# (pr-risk.yml's legacy jobs stand down). Its results are cached like every
# lane's: an unchanged test reuses its recorded PASS, and nightly re-executes
# everything (--config=fresh below).
# No whole-invocation retry on a remote cache eviction ("Lost inputs"):
# Bazel would re-run every test, and a test that failed in the first
# attempt but passes in the retry would report green, unlike the legacy
# jobs, which never retried. Evicted inputs fail the step instead; a
# visible "Re-run failed jobs" retries it.
test:embedded --experimental_remote_cache_eviction_retries=0
# The race configuration's nogo validations run once, in bazel.yml's `test`
# lane (`bazel test //... --config=ci`), which is a strict superset of every
# race-group lane's RunNogo/ValidateNogo keys. --norun_validations is a
# build-request option, not a configuration flag: it changes no action key
# (compile, link and nogo actions are shared with `test` through the action
# cache; test results are not, since each lane's test actions carry its own
# test env and args) and discards no analysis; it only skips re-running nogo's
# validation actions that the owner lane already runs on this configuration.
# scripts/nogo_lint_policy_test.go's TestNogoConfigurationsHaveOneValidatingLane
# pins `test` as this configuration's sole validating lane.
test:embedded --norun_validations
# Dolt-server lane: what pr.yml's retired container-backed jobs ("Test
# (storage domain + uow)" and "Contract corpus") ran, but every dolt
# sql-server is a child of the test process, started from the pinned dolt in
# the test wrapper's runfiles (BEADS_TEST_DOLT_SERVER=local, set by each
# dolt-server target), so the targets run on remote workers and need no
# docker. As those jobs: race (//cmd/bd/protocol's variant opts out, like its
# job), no -short, no BEADS_TEST_SKIP=dolt, -test.parallel=4, and the
# no--short twins of the job's other packages. Results are cacheable: every
# input (test binary, dolt, env) is in the action key, and a server that
# cannot start fails the target (BEADS_TEST_REQUIRE_DOLT_CONTAINER=1) instead
# of skipping. test.xml is downloaded for tools/bazel/equivalence.py --job,
# test.log for bazel.yml's failure artifact.
test:doltserver --@rules_go//go/config:race
test:doltserver --test_tag_filters=dolt-server
test:doltserver --build_tests_only
test:doltserver --keep_going
test:doltserver --test_env=GO_TEST_WRAP_TESTV=1
test:doltserver --test_arg=-test.parallel=4
# Locally (rbe=off, no executor): at most 4 test processes, the jobs' 4-vCPU
# runner shape; remote workers are not limited by it.
test:doltserver --local_test_jobs=4
test:doltserver --remote_download_regex=.*/test\.(log|xml)$
# Race-group nogo is owned by the `test` lane; see test:embedded's comment
# above.
test:doltserver --norun_validations
# Proxied-server tier: PR Risk's "Test (Proxied Dolt Cmd N/15)" jobs, as
# //cmd/bd:bd_proxied_test and //cmd/bd:bd_managed_local_test (the
# managed-local lifecycle in a loopback-only network namespace) (the
# dolt-server-proxied tag). Kept out of
# --config=doltserver because bazel.yml runs that lane locally too (forks,
# rbe=off), where 30 concurrent shards, each with a dolt sql-server busy on
# ~4 cores, do not fit regardless of any single shard's wall time; bazel.yml
# runs this one only with remote execution, in a job of its own
# (bazel-proxied). The build is
# --config=doltserver's: race, like PR Risk's /tmp/bd-cmd-test; the
# subprocess bd is the non-race bd_for_tests, like the jobs'. Each shard runs its job's
# shard script, whose -test.timeout=15m is past "long": the target is
# eternal, which rbe-west caps at 1200s.
test:doltserver-proxied --@rules_go//go/config:race
test:doltserver-proxied --test_tag_filters=dolt-server-proxied
test:doltserver-proxied --build_tests_only
test:doltserver-proxied --keep_going
test:doltserver-proxied --test_summary=terse
test:doltserver-proxied --test_timeout=-1,-1,-1,1200
test:doltserver-proxied --test_env=GO_TEST_WRAP_TESTV=1
# The jobs pass no -parallel: GOMAXPROCS (the target's 4, a runner's vCPUs).
test:doltserver-proxied --test_arg=-test.parallel=4
test:doltserver-proxied --local_test_jobs=4
test:doltserver-proxied --remote_download_regex=.*/test\.(log|xml)$
# Since D2 step 2 this lane is the tier's only pre-merge run on same-repo
# PRs. Results are cached like every lane's (nightly: --config=fresh).
# No whole-invocation retry on a remote cache eviction ("Lost inputs"):
# Bazel would re-run every test, and a test that failed in the first
# attempt but passes in the retry would report green, unlike the legacy
# jobs, which never retried. Evicted inputs fail the step instead; a
# visible "Re-run failed jobs" retries it.
test:doltserver-proxied --experimental_remote_cache_eviction_retries=0
# Race-group nogo is owned by the `test` lane; see test:embedded's comment
# above.
test:doltserver-proxied --norun_validations
# dolt-server + proxied union (item 5): bazel.yml's bazel-dolt-race job runs
# both tiers in one invocation in mode remote, in place of the bazel-doltserver
# and bazel-proxied lanes, which still run --config=doltserver and
# --config=doltserver-proxied in every other mode. Exactly the union of the two
# member configs' lines, with one tag filter naming both tiers
# (scripts/bazel_dolt_race_test.go). Every other flag is the same in both
# members or outside any action key for the other: the race build,
# -test.parallel=4 and GO_TEST_WRAP_TESTV=1 are common; the eternal timeout
# applies to no dolt-server target; the eviction retry count is what
# doltserver gets from --config=sole-run wherever it executes remotely;
# test_summary, local_test_jobs and remote_download_regex are not in any action
# key. So each member target's test action is unchanged (aquery: all 62
# TestRunner actions byte-identical), and whichever arm the mode picks shares
# cached results with the other. The member configs stay for those modes, make
# and developers.
test:dolt-race --@rules_go//go/config:race
test:dolt-race --test_tag_filters=dolt-server,dolt-server-proxied
test:dolt-race --build_tests_only
test:dolt-race --keep_going
test:dolt-race --test_summary=terse
test:dolt-race --test_timeout=-1,-1,-1,1200
test:dolt-race --test_env=GO_TEST_WRAP_TESTV=1
test:dolt-race --test_arg=-test.parallel=4
test:dolt-race --local_test_jobs=4
test:dolt-race --remote_download_regex=.*/test\.(log|xml)$
test:dolt-race --experimental_remote_cache_eviction_retries=0
# The union carries its members' --norun_validations line
# (TestBazelDoltRaceConfigIsMemberUnion needs no change: both members and the
# union carry the same line).
test:dolt-race --norun_validations
# Server-Dolt storage tier: PR Risk's "Test (Server Dolt Conformance)" and
# "Test (Server Dolt Full Suite N/16)" jobs, as
# //internal/storage/dolt:dolt_server_{conformance,full}_test
# (dolt-server-integration tag): the integration-tagged internal/storage/dolt
# tests, non-race like the jobs' binary, against a local dolt sql-server.
# The build flags are exactly --config=integration's (the tags, and race for
# everything the variants do not turn off), so the two lanes share every
# compile: the variants' race-off binary lands in the configuration
# --config=integration already builds the non-race //cmd/bd:bd_for_tests in.
# A per-target gotags transition would instead compile the whole graph a
# third time. No BEADS_TEST_SKIP, no -short; the full suite's
# BEADS_TEST_ENV_RUN_DOLT=1 is target env. Remote only in bazel.yml, in a
# job of its own (bazel-server-storage) that shares bazel-integration's
# compiles through the remote cache.
build:doltserver-integration --@rules_go//go/config:tags=gms_pure_go,integration
test:doltserver-integration --@rules_go//go/config:race
test:doltserver-integration --test_tag_filters=dolt-server-integration
test:doltserver-integration --build_tests_only
test:doltserver-integration --keep_going
test:doltserver-integration --test_summary=terse
test:doltserver-integration --test_timeout=-1,-1,-1,1200
test:doltserver-integration --test_env=GO_TEST_WRAP_TESTV=1
# The jobs pass no -parallel: GOMAXPROCS (the targets' 4, a runner's vCPUs).
test:doltserver-integration --test_arg=-test.parallel=4
test:doltserver-integration --local_test_jobs=4
test:doltserver-integration --remote_download_regex=.*/test\.(log|xml)$
# F5 S2 Variant A: this configuration (integration, doltserver-integration,
# doltserver-cmd -- the same fingerprint, race=true plus
# tags=gms_pure_go,integration) has no full-lane owner. Its nogo runs once,
# narrowly, in bazel.yml's bazel-integration job: a `bazel build
# --output_groups=nogo_fix` step over //internal/testutil/integration only
# (the configuration's non-test library; the 56 integration-tagged _test.go
# files this loses vet/lint coverage on are listed in
# tools/nogo/unvalidated_integration_tests.txt, f5-spec.md §3/§5 S2).
# --norun_validations is a build-request option, not a configuration flag:
# it changes no action key and discards no analysis; it only skips
# re-running nogo's validation actions, which bazel-integration's nogo-only
# step already runs for this configuration's library files.
# scripts/nogo_lint_policy_test.go's TestNogoConfigurationsHaveOneValidatingLane
# pins the nogo-only step as this configuration's sole validating lane.
test:doltserver-integration --norun_validations
# Since D2 step 2 this lane is the tier's only pre-merge run on same-repo
# PRs. Results are cached like every lane's (nightly: --config=fresh).
# No whole-invocation retry on a remote cache eviction ("Lost inputs"):
# Bazel would re-run every test, and a test that failed in the first
# attempt but passes in the retry would report green, unlike the legacy
# jobs, which never retried. Evicted inputs fail the step instead; a
# visible "Re-run failed jobs" retries it.
test:doltserver-integration --experimental_remote_cache_eviction_retries=0
# cmd/bd Dolt-server tier: //cmd/bd:bd_dolt_server_test (dolt-server-cmd
# tag), the whole integration-tagged cmd/bd suite against a hermetic dolt
# sql-server, i.e. the Dolt-gated cmd/bd tests every other lane skips
# (BEADS_TEST_SKIP=dolt in --config=prcore/ci and --config=integration), and //tests/regression:regression_test
# (the differential regression suite, formerly regression.yml, against the
# catalog-pinned baseline in @bd_releases). The build flags are exactly
# --config=integration's, so it compiles nothing bazel-integration does not
# (shared through the remote cache). bazel.yml runs it where it runs the
# integration lane (remote, or with the read-only cache in mode cache), in a
# job of its own (bazel-cmd-dolt), advisory until pr.yml's
# BAZEL_CMD_DOLT_REQUIRED says otherwise. No BEADS_TEST_SKIP, no -short.
# Results are cacheable, as in --config=doltserver: every input is in the
# action key, and a server that cannot start fails the target.
build:doltserver-cmd --@rules_go//go/config:tags=gms_pure_go,integration
test:doltserver-cmd --@rules_go//go/config:race
test:doltserver-cmd --test_tag_filters=dolt-server-cmd
test:doltserver-cmd --build_tests_only
test:doltserver-cmd --keep_going
test:doltserver-cmd --test_summary=terse
test:doltserver-cmd --test_timeout=-1,-1,-1,1200
# As in --config=integration: Go's own timeout fires first and dumps every
# goroutine to test.log, which Bazel's kill at 1200s does not. Item 5 A2: the
# -test.timeout=19m arg and the BEADS_TEST_REQUIRE_EXCLUDE_PERMISSION env moved
# onto //cmd/bd:bd_dolt_server_test's and //tests/regression:regression_test's
# own args/env (the rules), so --config=dolt-int below does not need them:
# without the move, server-storage's 15m Go timeout would become 19m under
# the union, and the env would leak into server-storage's targets. The final
# argv and environment Bazel assembles (target args, then -test.timeout=19m,
# then this config's own -test.parallel=4 test_arg; same env map either way)
# are unchanged, so the remote action digest -- what RBE's cache keys on --
# is unaffected and cached results should carry over. This IS a local
# actionKey change for these two targets' 46 actions: --test_env is part of
# the build configuration's own fingerprint, picked up by every target
# analyzed under that configuration, unlike a target's own env attribute,
# which only the target carries. To be confirmed in practice by the first
# merge group's tests_cached == tests_total in ci-analytics, not claimed here
# as already observed.
test:doltserver-cmd --test_arg=-test.parallel=4
test:doltserver-cmd --test_env=GO_TEST_WRAP_TESTV=1
test:doltserver-cmd --local_test_jobs=4
test:doltserver-cmd --remote_download_regex=.*/test\.(log|xml)$
# F5 S2 Variant A: same configuration as --config=integration /
# doltserver-integration above; see that block's comment for the owner
# (bazel-integration's nogo-only step over //internal/testutil/integration).
test:doltserver-cmd --norun_validations
# server-storage + cmd-dolt union (item 5 A2): bazel.yml's bazel-dolt-int job
# runs both tiers in one invocation in mode remote, in place of the
# bazel-server-storage and bazel-cmd-dolt jobs, which still run
# --config=doltserver-integration and --config=doltserver-cmd in every other
# mode (fork-ro, fork-rw, cache, local): there one client does both tiers'
# work with no in-flight deduplication, so a union would cost the sum of the
# tiers instead of the max. Exactly the union of the two member configs'
# lines above, with one tag filter naming both members' tags
# (scripts/bazel_dolt_int_test.go). Every other flag is the same in both
# members: the race build, tags=gms_pure_go,integration, keep_going,
# test_summary, the eternal 1200s timeout, GO_TEST_WRAP_TESTV=1,
# -test.parallel=4, local_test_jobs, remote_download_regex and
# norun_validations. So each member target's test action is unchanged in the
# sense that matters for caching (aquery: all 63 TestRunner actions' remote
# action digests are byte-identical, the key RBE's cache lookups use), though
# each action's local actionKey differs since these flags now reach the
# target via its own env/args rather than the member's build configuration.
# Cached results carry over both ways regardless.
# New for cmd-dolt here: --experimental_remote_cache_eviction_retries=0.
# server-storage already has it (above); cmd-dolt did not (it has no
# --config=sole-run of its own, unlike doltserver). Adding it to the union is
# stricter for cmd-dolt (no whole-invocation retry on a remote cache
# eviction) and policy-conformant with sole-run semantics; the eviction
# allowlist in pr_risk_bazel_coverage_test.go records the new line.
build:dolt-int --@rules_go//go/config:tags=gms_pure_go,integration
test:dolt-int --@rules_go//go/config:race
test:dolt-int --test_tag_filters=dolt-server-integration,dolt-server-cmd
test:dolt-int --build_tests_only
test:dolt-int --keep_going
test:dolt-int --test_summary=terse
test:dolt-int --test_timeout=-1,-1,-1,1200
test:dolt-int --test_env=GO_TEST_WRAP_TESTV=1
test:dolt-int --test_arg=-test.parallel=4
test:dolt-int --local_test_jobs=4
test:dolt-int --remote_download_regex=.*/test\.(log|xml)$
test:dolt-int --norun_validations
test:dolt-int --experimental_remote_cache_eviction_retries=0
# Integration lane: the `go test` main.yml's former "Main Linux integration"
# jobs ran on push (this lane replaced them, and nightly.yml's retired Full
# Test Suite, which ran the same `go test` over ./... in one job): every package
# built with -tags=integration,gms_pure_go, race, no -short, no -skip,
# BEADS_TEST_SKIP=dolt. The tag is set for the whole build, as `go test -tags`
# does, not per target: gazelle generates srcs/deps with integration files
# included (root BUILD.bazel `gazelle:build_tags`), rules_go drops them from
# every other configuration, and //internal/testutil/integration (integration
# files only) compiles to its real contents only here. A per-target `gotags`
# would not save the compile either: it transitions the whole dep graph.
build:integration --@rules_go//go/config:tags=gms_pure_go,integration
test:integration --@rules_go//go/config:race
test:integration --test_env=BEADS_TEST_SKIP=dolt
# The variants the PR-core lane leaves out stay out, except integration-only
# (targets with tests only under the tag): the jobs' BEADS_TEST_SKIP=dolt
# keeps every container- or server-backed test skipped, which is what the
# untagged base targets already do. scripts/bazel_policy_test.go derives the
# required exclusions from the PR-core list, so a new lane tag lands here too.
# pr-core-only targets (the historical-release suites: shell tests against
# the release-shaped bd, which the PR-core lane already runs) stay out too.
test:integration --test_tag_filters=-dolt-server,-dolt-server-proxied,-dolt-server-integration,-dolt-server-cmd,-embedded,-manual,-pr-core-only
test:integration --build_tests_only
test:integration --keep_going
test:integration --test_summary=terse
# The jobs pass no -p/-parallel: GOMAXPROCS on a 4-vCPU ubuntu-latest runner.
test:integration --test_arg=-test.parallel=4
# The jobs give each package binary -timeout=30m. rbe-west rejects an action
# timeout over 1200s, so every size gets 1200s, and Go's own -test.timeout (19m,
# after the 1200s rules_go derives from TEST_TIMEOUT: the last flag wins) fires
# first and dumps every goroutine to test.log, which Bazel's kill does not.
test:integration --test_timeout=1200
test:integration --test_arg=-test.timeout=19m
# The runner is not root, so TestAddExcludePatternsRefusesReadErrors runs
# there; make a root executor fail it rather than skip (as test:prcore does).
test:integration --test_env=BEADS_TEST_REQUIRE_EXCLUDE_PERMISSION=1
# -test.v in test.xml, as in test:ci, for tools/bazel/equivalence.py.
test:integration --test_env=GO_TEST_WRAP_TESTV=1
# ci and integration build into the same output directory (the tags flag
# does not change it), so they share bazel-testlogs: a lane's test.xml is
# overwritten by the other lane's next run of the same target. Run
# equivalence.py / check_testcases.py right after each lane's own
# `bazel test`, before the other lane runs (or give the lanes separate jobs).
test:integration --remote_download_regex=.*/test\.xml$
# F5 S2 Variant A: same configuration as --config=doltserver-integration /
# doltserver-cmd above; see that block's comment for the owner
# (bazel-integration's nogo-only step over //internal/testutil/integration).
# The 56 integration-tagged _test.go files this configuration no longer
# validates in any full lane are the accepted loss, listed in
# tools/nogo/unvalidated_integration_tests.txt.
test:integration --norun_validations
# Pure-Go lane: pr.yml's "Check pure-Go and js/wasm boundaries
# (CGO_ENABLED=0)" job. CGO is off for every Go target (rules_go drops
# cgo-constrained files like go build does; third_party/patches/
# gozstd_nocgo.patch lets dolt's store/nbs, an unused but declared dep,
# compile; its package init panics, so a pure binary that links it fails when
# run). bazel.yml builds bd and the job's pure test binaries, runs each of
# them once (the contamination check `go build` does at compile time) and runs
# its -short cmd/bd subset.
build:pure --@rules_go//go/config:pure
test:pure --test_arg=-test.short
# The job passes no -parallel: GOMAXPROCS on a 4-vCPU runner.
test:pure --test_arg=-test.parallel=4
test:pure --test_env=GO_TEST_WRAP_TESTV=1
test:pure --remote_download_regex=.*/test\.xml$
# js/wasm hook boundary (same job): build for GOOS=js GOARCH=wasm. Bazel
# cannot run the wasm test binary itself; bazel.yml runs it with the Go SDK's
# go_js_wasm_exec (node), like `go test -exec`. The test toolchain needs an
# exec platform matching the target platform, hence
# --use_target_platform_for_tests (no test action runs under this config).
build:js-wasm --platforms=@rules_go//go/toolchain:js_wasm
build:js-wasm --use_target_platform_for_tests
build:js-wasm --remote_download_outputs=toplevel
# nogo (//tools/nogo: go test's vet checks plus the golangci-lint linters
# .golangci.yml enables) runs beside every Go compile, so `bazel build`/
# `bazel test` fails on a finding -- in bazel.yml's one validating (owner)
# lane per configuration (since F5 S1: a race-group non-owner lane reuses
# its owner's nogo results instead of re-running them; see
# scripts/nogo_lint_policy_test.go's nogoConfigurations table).
# --config=nogo asks for the analysis alone (the nogo_fix output group;
# nothing is linked), in the race configuration bazel.yml's unit lane
# (test:ci) builds, so a local run reuses CI's remote cache. make lint,
# scripts/pr-lint and the pre-commit hook use it.
build:nogo --@rules_go//go/config:race
build:nogo --keep_going
build:nogo --output_groups=nogo_fix
# The same analyzers over the files only other platforms compile
# (//go:build windows, darwin, !linux ...): scripts/pr-lint builds
# //tools/bazel:release_cross, every go_library and go_binary split-transitioned
# to rules_go's non-cgo platforms, for its windows/amd64 and darwin/arm64
# passes (golangci-lint's former GOOS=windows/darwin legs). bazel.yml's pure
# lane builds the same target for every release platform, which validates
# nogo there too.
build:nogo-cross --keep_going
build:nogo-cross --output_groups=nogo_fix
# D2 step 3: bazel.yml's bazel-test, bazel-pure and bazel-doltserver lanes
# add this in the remote modes, where (on same-repo PRs and merge groups)
# they are the only pre-merge run of pr.yml's legacy PR Core,
# pure-Go/js-wasm, domain+uow and contract corpus jobs, which never retried.
# Like the retired PR Risk tiers' configs: no whole-invocation retry after
# a remote cache eviction ("Lost inputs"), whose exit code outranks a test
# failure, so a test that failed in the first attempt and passed in the
# retry would report green.
test:sole-run --experimental_remote_cache_eviction_retries=0
# Test result caching. Every lane caches its test results (read and write;
# Bazel's default): a test whose action key (test binary, runfiles, test env,
# platform) is unchanged reuses the PASS the farm recorded for it, on a PR
# (any attempt), a merge group or a push to main, so only what a change
# touched runs. Why that is safe:
# - Identical key, identical test: these targets are hermetic (dolt and
# every input are runfiles).
# - A cached failure is never reused: Bazel treats a failed cached action
# as a miss, so whatever failed re-runs.
# - Only rbe-west's workers write the action cache (clients' writes are
# refused), so a cached PASS is a real remote execution, not a client
# upload.
# - What is given up is re-sampling a nondeterministic (-race, timing)
# test on unchanged inputs. nightly.yml passes fresh-test-results: true,
# so bazel.yml appends this config last to every `bazel test` and the
# whole suite re-executes once a night.
# - No retries: --experimental_remote_cache_eviction_retries=0 (the
# retired tiers' configs and sole-run) and no flaky attempts anywhere.
# Policy: scripts/ci_merge_queue_test.go.
test:fresh --nocache_test_results
# Read-only anonymous cache for fork PRs: rbe-west's rbe-cache endpoint serves
# action-cache and CAS reads only (writes and Execute are refused by the farm)
# and needs no credentials, so it is committed (scripts/bazel_policy_test.go
# allowlists exactly the two endpoint lines). bazel.yml's rbe job selects it
# (mode "cache") for fork pull requests; setup-bazel adds --config=fork-cache.
# Only non-key flags differ from trusted runs, so fork actions hash like the
# trusted ones and hit what trusted CI executed.
build:fork-cache --remote_cache=grpcs://rbe-cache.ops.gascity.com:8443
build:fork-cache --remote_instance_name=oss
build:fork-cache --remote_accept_cached
build:fork-cache --noremote_upload_local_results
# bazel.yml passes --build_event_json_file and --profile; with a remote cache
# Bazel would upload the files the build events reference (test logs, the
# profile) over ByteStream. Fork runs upload nothing.
build:fork-cache --experimental_build_event_upload_strategy=local
build:fork-cache --remote_download_minimal
# If the farm closes the endpoint (kill switch) GetCapabilities fails, and
# Bazel 9 then fails every action unless both of these are set.
build:fork-cache --remote_local_fallback
build:fork-cache --incompatible_remote_local_fallback_for_remote_cache
# Lookups are network-bound; local CPU work is still bounded by --local_resources.
build:fork-cache --jobs=64
# A slow (not closed) endpoint: each lookup gives up after 15s per attempt,
# and the failure-rate circuit breaker stops calling the endpoint once too
# many lookups fail (Bazel's default: 10% within 60s); the rest run locally.
build:fork-cache --remote_timeout=15
build:fork-cache --remote_retries=2
build:fork-cache --experimental_circuit_breaker_strategy=failure
# The farm admits 16 connections per source IP.
build:fork-cache --remote_max_connections=8
# No --remote_cache_compression here: setup-bazel's write-bazelrc.sh adds it
# for fork-cache while rbe-cache advertises zstd (cache-zstd-probe.sh), so the
# server decides and rollback needs no change here.
# Remote execution against any REAPI-compatible service. Only generic tuning
# lives here; the executor endpoint and TLS credentials are never committed.
# Developers put them in a gitignored user.bazelrc or .bazelrc.local; CI writes
# a generated rc outside the workspace and passes it with --bazelrc.
build:remote-exec --jobs=64
build:remote-exec --remote_download_minimal
build:remote-exec --remote_timeout=600
build:remote-exec --remote_retries=3
# Upload only remotely executed results. A locally executed action (a
# no-remote-exec test, whose result depends on the host) must not seed the
# shared cache that CI and every other developer read.
build:remote-exec --noremote_upload_local_results
try-import %workspace%/.bazelrc.local
try-import %workspace%/user.bazelrc

View file

@ -1 +0,0 @@
9.3.0

82
.beads-hooks/post-checkout Executable file
View file

@ -0,0 +1,82 @@
#!/usr/bin/env sh
# bd-hooks-version: 0.25.1
#
# bd (beads) post-checkout hook
#
# This hook syncs the bd database after a branch checkout:
# 1. Checks if any .beads/*.jsonl file was updated
# 2. Runs 'bd sync --import-only' to import changes
#
# Arguments provided by git:
# $1 = ref of previous HEAD
# $2 = ref of new HEAD
# $3 = flag (1 if branch checkout, 0 if file checkout)
#
# Install: cp examples/git-hooks/post-checkout .git/hooks/post-checkout && chmod +x .git/hooks/post-checkout
# Only run on branch checkouts
if [ "$3" != "1" ]; then
exit 0
fi
# Check if bd is available
if ! command -v bd >/dev/null 2>&1; then
exit 0
fi
# Check if we're in a bd workspace
if [ ! -d .beads ]; then
exit 0
fi
# Detect git worktree: compare --git-dir and --git-common-dir
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
GIT_COMMON_DIR=$(git rev-parse --git-common-dir 2>/dev/null)
if [ -n "$GIT_DIR" ] && [ -n "$GIT_COMMON_DIR" ]; then
GIT_DIR_ABS=$(cd "$GIT_DIR" 2>/dev/null && pwd || echo "$GIT_DIR")
GIT_COMMON_DIR_ABS=$(cd "$GIT_COMMON_DIR" 2>/dev/null && pwd || echo "$GIT_COMMON_DIR")
if [ "$GIT_DIR_ABS" != "$GIT_COMMON_DIR_ABS" ]; then
# We're in a git worktree
cat >&2 <<'EOF'
╔══════════════════════════════════════════════════════════════════════════╗
║ Welcome to beads in git worktree! ║
╠══════════════════════════════════════════════════════════════════════════╣
║ Note: Daemon mode is not recommended with git worktrees. ║
║ Worktrees share the same database, and the daemon may commit changes ║
║ to the wrong branch. ║
║ ║
║ RECOMMENDED: Disable daemon for this session: ║
║ export BEADS_NO_DAEMON=1 ║
║ ║
║ For more information: ║
║ - Run: bd doctor ║
║ - Read: docs/GIT_INTEGRATION.md (lines 10-53) ║
║ ║
║ Issue tracking: bd-dc9 ║
╚══════════════════════════════════════════════════════════════════════════╝
EOF
fi
fi
# Check if any JSONL file exists in .beads/
if ! ls .beads/*.jsonl >/dev/null 2>&1; then
exit 0
fi
# Run bd sync --import-only to import the updated JSONL
if ! output=$(bd sync --import-only 2>&1); then
echo "Warning: Failed to sync bd changes after checkout" >&2
echo "$output" >&2
echo "" >&2
echo "Run 'bd doctor --fix' to diagnose and repair" >&2
# Don't fail the checkout, just warn
fi
# Run quick health check (silent on success, hints if issues found)
# This catches version mismatches, outdated hooks, etc.
bd doctor --check-health 2>/dev/null || true
exit 0

49
.beads-hooks/post-merge Executable file
View file

@ -0,0 +1,49 @@
#!/usr/bin/env sh
# bd-hooks-version: 0.25.1
#
# bd (beads) post-merge hook
#
# This hook syncs the bd database after a git pull or merge:
# 1. Checks if any .beads/*.jsonl file was updated
# 2. Runs 'bd sync --import-only' to import changes
#
# Installation:
# cp examples/git-hooks/post-merge .git/hooks/post-merge
# chmod +x .git/hooks/post-merge
#
# Or use the install script:
# examples/git-hooks/install.sh
# Check if bd is available
if ! command -v bd >/dev/null 2>&1; then
echo "Warning: bd command not found, skipping post-merge sync" >&2
exit 0
fi
# Check if we're in a bd workspace
if [ ! -d .beads ]; then
# Not a bd workspace, nothing to do
exit 0
fi
# Check if any JSONL file exists in .beads/
if ! ls .beads/*.jsonl >/dev/null 2>&1; then
exit 0
fi
# Run bd sync --import-only to import the updated JSONL
# This is more robust than direct import as it handles all edge cases
# Capture both stdout and stderr to show user what went wrong
if ! output=$(bd sync --import-only 2>&1); then
echo "Warning: Failed to sync bd changes after merge" >&2
echo "$output" >&2
echo "" >&2
echo "Run 'bd doctor --fix' to diagnose and repair" >&2
# Don't fail the merge, just warn
fi
# Run quick health check (silent on success, hints if issues found)
# This catches version mismatches, outdated hooks, etc.
bd doctor --check-health 2>/dev/null || true
exit 0

46
.beads-hooks/pre-commit Executable file
View file

@ -0,0 +1,46 @@
#!/usr/bin/env sh
# bd-hooks-version: 0.29.0
#
# bd (beads) pre-commit hook
#
# This hook ensures that any pending bd issue changes are flushed to
# .beads/issues.jsonl before the commit is created, preventing the
# race condition where daemon auto-flush fires after the commit.
#
# Installation:
# cp examples/git-hooks/pre-commit .git/hooks/pre-commit
# chmod +x .git/hooks/pre-commit
#
# Or use the install script:
# examples/git-hooks/install.sh
# Check if bd is available
if ! command -v bd >/dev/null 2>&1; then
echo "Warning: bd command not found, skipping pre-commit flush" >&2
exit 0
fi
# Check if we're in a bd workspace
if [ ! -d .beads ]; then
# Not a bd workspace, nothing to do
exit 0
fi
# Flush pending changes to JSONL
# Use --flush-only to skip git operations (we're already in a git hook)
# Suppress output unless there's an error
# Note: We warn but don't fail - this allows commits to proceed even if
# beads has issues (e.g., user removed .beads from their branch)
if ! bd sync --flush-only >/dev/null 2>&1; then
echo "Warning: Failed to flush bd changes to JSONL" >&2
echo "Run 'bd sync --flush-only' manually to diagnose" >&2
# Don't block the commit - user may have removed beads or have other issues
fi
# Stage all tracked JSONL files (issues.jsonl is canonical, beads.jsonl for backward compat, deletions.jsonl for deletion propagation)
# git add is harmless if file doesn't exist
for f in .beads/beads.jsonl .beads/issues.jsonl .beads/deletions.jsonl; do
[ -f "$f" ] && git add "$f" 2>/dev/null || true
done
exit 0

111
.beads-hooks/pre-push Executable file
View file

@ -0,0 +1,111 @@
#!/usr/bin/env sh
# bd-hooks-version: 0.24.2
#
# bd (beads) pre-push hook
#
# This hook prevents pushing stale JSONL by:
# 1. Flushing any pending in-memory changes to JSONL (if bd available)
# 2. Checking for uncommitted changes (staged, unstaged, untracked, deleted)
# 3. Failing the push with clear instructions if changes found
#
# The pre-commit hook already exports changes, but this catches:
# - Changes made between commit and push
# - Pending debounced flushes (5s daemon delay)
#
# Installation:
# cp examples/git-hooks/pre-push .git/hooks/pre-push
# chmod +x .git/hooks/pre-push
#
# Or use the install script:
# examples/git-hooks/install.sh
# Check if we're in a bd workspace
if [ ! -d .beads ]; then
# Not a bd workspace, nothing to do
exit 0
fi
# Skip if bd sync is already in progress (GH#532: prevents circular error)
# bd sync sets this env var when pushing from worktree
if [ -n "$BD_SYNC_IN_PROGRESS" ]; then
exit 0
fi
# Optionally flush pending bd changes so they surface in JSONL
# This prevents the race where a debounced flush lands after the check
if command -v bd >/dev/null 2>&1; then
bd sync --flush-only >/dev/null 2>&1 || true
fi
# Collect all tracked or existing JSONL files (beads.jsonl, issues.jsonl for backward compat, deletions.jsonl for deletion propagation)
FILES=""
for f in .beads/beads.jsonl .beads/issues.jsonl .beads/deletions.jsonl; do
# Include file if it exists in working tree OR is tracked by git (even if deleted)
if git ls-files --error-unmatch "$f" >/dev/null 2>&1 || [ -f "$f" ]; then
FILES="$FILES $f"
fi
done
# Check for any uncommitted changes using porcelain status
# This catches: staged, unstaged, untracked, deleted, renamed, and conflicts
if [ -n "$FILES" ]; then
# shellcheck disable=SC2086
if [ -n "$(git status --porcelain -- $FILES 2>/dev/null)" ]; then
echo "❌ Error: Beads JSONL has uncommitted changes" >&2
echo "" >&2
echo "You made changes to bd issues between your last commit and this push." >&2
echo "" >&2
# Check if bd is available and offer auto-sync
if command -v bd >/dev/null 2>&1; then
# Check if we're in an interactive terminal
if [ -t 0 ]; then
echo "Would you like to run 'bd sync' now to commit and push these changes? [y/N]" >&2
read -r response
case "$response" in
[yY][eE][sS]|[yY])
echo "" >&2
echo "Running: bd sync" >&2
if bd sync; then
echo "" >&2
echo "✓ Sync complete. Continuing with push..." >&2
exit 0
else
echo "" >&2
echo "❌ Sync failed. Push aborted." >&2
exit 1
fi
;;
*)
echo "" >&2
echo "Push aborted. Run 'bd sync' manually when ready:" >&2
echo "" >&2
echo " bd sync" >&2
echo " git push" >&2
echo "" >&2
exit 1
;;
esac
else
# Non-interactive: just show the message
echo "Run 'bd sync' to commit these changes:" >&2
echo "" >&2
echo " bd sync" >&2
echo "" >&2
exit 1
fi
else
# bd not available, fall back to manual git commands
echo "Please commit the updated JSONL before pushing:" >&2
echo "" >&2
# shellcheck disable=SC2086
echo " git add $FILES" >&2
echo ' git commit -m "Update bd JSONL"' >&2
echo " git push" >&2
echo "" >&2
exit 1
fi
fi
fi
exit 0

39
.beads/.gitignore vendored Normal file
View file

@ -0,0 +1,39 @@
# SQLite databases
*.db
*.db?*
*.db-journal
*.db-wal
*.db-shm
# Daemon runtime files
daemon.lock
daemon.log
daemon.pid
bd.sock
sync-state.json
last-touched
# Local version tracking (prevents upgrade notification spam after git ops)
.local_version
# Legacy database files
db.sqlite
bd.db
# Worktree redirect file (contains relative path to main repo's .beads/)
# Must not be committed as paths would be wrong in other clones
redirect
# Merge artifacts (temporary files from 3-way merge)
beads.base.jsonl
beads.base.meta.json
beads.left.jsonl
beads.left.meta.json
beads.right.jsonl
beads.right.meta.json
# NOTE: Do NOT add negation patterns (e.g., !issues.jsonl) here.
# They would override fork protection in .git/info/exclude, allowing
# contributors to accidentally commit upstream issue databases.
# The JSONL files (issues.jsonl, interactions.jsonl) and config files
# are tracked by git by default since no pattern above ignores them.

291
.beads/BD_GUIDE.md Normal file
View file

@ -0,0 +1,291 @@
<!-- Auto-generated by bd v0.24.2 - DO NOT EDIT MANUALLY -->
<!-- Run 'bd onboard --output .beads/BD_GUIDE.md' to regenerate -->
# BD (Beads) Guide for AI Agents
This file contains canonical bd (beads) workflow instructions for AI agents.
It is auto-generated and version-stamped to track bd upgrades.
> **For project-specific instructions**, see AGENTS.md in the repository root.
> This file only covers bd tool usage, not project-specific workflows.
---
## Issue Tracking with bd (beads)
**IMPORTANT**: This project uses **bd (beads)** for ALL issue tracking. Do NOT use markdown TODOs, task lists, or other tracking methods.
### Why bd?
- Dependency-aware: Track blockers and relationships between issues
- Git-friendly: Auto-syncs to JSONL for version control
- Agent-optimized: JSON output, ready work detection, discovered-from links
- Prevents duplicate tracking systems and confusion
### Quick Start
**Check for ready work:**
```bash
bd ready --json
```
**Create new issues:**
```bash
bd create "Issue title" -t bug|feature|task -p 0-4 --json
bd create "Issue title" -p 1 --deps discovered-from:bd-123 --json
```
**Claim and update:**
```bash
bd update bd-42 --status in_progress --json
bd update bd-42 --priority 1 --json
```
**Complete work:**
```bash
bd close bd-42 --reason "Completed" --json
```
### Issue Types
- `bug` - Something broken
- `feature` - New functionality
- `task` - Work item (tests, docs, refactoring)
- `epic` - Large feature with subtasks
- `chore` - Maintenance (dependencies, tooling)
### Priorities
- `0` - Critical (security, data loss, broken builds)
- `1` - High (major features, important bugs)
- `2` - Medium (default, nice-to-have)
- `3` - Low (polish, optimization)
- `4` - Backlog (future ideas)
### Workflow for AI Agents
1. **Check ready work**: `bd ready` shows unblocked issues
2. **Claim your task**: `bd update <id> --status in_progress`
3. **Work on it**: Implement, test, document
4. **Discover new work?** Create linked issue:
- `bd create "Found bug" -p 1 --deps discovered-from:<parent-id>`
5. **Complete**: `bd close <id> --reason "Done"`
6. **Commit together**: Always commit the `.beads/issues.jsonl` file together with the code changes so issue state stays in sync with code state
### Auto-Sync
bd automatically syncs with git:
- Exports to `.beads/issues.jsonl` after changes (5s debounce)
- Imports from JSONL when newer (e.g., after `git pull`)
- No manual export/import needed!
### GitHub Copilot Integration
If using GitHub Copilot, also create `.github/copilot-instructions.md` for automatic instruction loading.
Run `bd onboard` to get the content, or see step 2 of the onboard instructions.
### MCP Server (Recommended)
If using Claude or MCP-compatible clients, install the beads MCP server:
```bash
pip install beads-mcp
```
Add to MCP config (e.g., `~/.config/claude/config.json`):
```json
{
"beads": {
"command": "beads-mcp",
"args": []
}
}
```
Then use `mcp__beads__*` functions instead of CLI commands.
### Managing AI-Generated Planning Documents
AI assistants often create planning and design documents during development:
- PLAN.md, IMPLEMENTATION.md, ARCHITECTURE.md
- DESIGN.md, CODEBASE_SUMMARY.md, INTEGRATION_PLAN.md
- TESTING_GUIDE.md, TECHNICAL_DESIGN.md, and similar files
**Best Practice: Use a dedicated directory for these ephemeral files**
**Recommended approach:**
- Create a `history/` directory in the project root
- Store ALL AI-generated planning/design docs in `history/`
- Keep the repository root clean and focused on permanent project files
- Only access `history/` when explicitly asked to review past planning
**Example .gitignore entry (optional):**
```
# AI planning documents (ephemeral)
history/
```
**Benefits:**
- ✅ Clean repository root
- ✅ Clear separation between ephemeral and permanent documentation
- ✅ Easy to exclude from version control if desired
- ✅ Preserves planning history for archeological research
- ✅ Reduces noise when browsing the project
### Important Rules
- ✅ Use bd for ALL task tracking
- ✅ Always use `--json` flag for programmatic use
- ✅ Link discovered work with `discovered-from` dependencies
- ✅ Check `bd ready` before asking "what should I work on?"
- ✅ Store AI planning docs in `history/` directory
- ❌ Do NOT create markdown TODO lists
- ❌ Do NOT use external issue trackers
- ❌ Do NOT duplicate tracking systems
- ❌ Do NOT clutter repo root with planning documents
For more details, see README.md and QUICKSTART.md.
---
# GitHub Copilot Instructions for Beads
## Project Overview
**beads** (command: `bd`) is a Git-backed issue tracker designed for AI-supervised coding workflows. We dogfood our own tool for all task tracking.
**Key Features:**
- Dependency-aware issue tracking
- Auto-sync with Git via JSONL
- AI-optimized CLI with JSON output
- Built-in daemon for background operations
- MCP server integration for Claude and other AI assistants
## Tech Stack
- **Language**: Go 1.21+
- **Storage**: SQLite (internal/storage/sqlite/)
- **CLI Framework**: Cobra
- **Testing**: Go standard testing + table-driven tests
- **CI/CD**: GitHub Actions
- **MCP Server**: Python (integrations/beads-mcp/)
## Coding Guidelines
### Testing
- Always write tests for new features
- Use `BEADS_DB=/tmp/test.db` to avoid polluting production database
- Run `go test -short ./...` before committing
- Never create test issues in production DB (use temporary DB)
### Code Style
- Run `golangci-lint run ./...` before committing
- Follow existing patterns in `cmd/bd/` for new commands
- Add `--json` flag to all commands for programmatic use
- Update docs when changing behavior
### Git Workflow
- Always commit `.beads/issues.jsonl` with code changes
- Run `bd sync` at end of work sessions
- Install git hooks: `bd hooks install` (ensures DB ↔ JSONL consistency)
## Issue Tracking with bd
**CRITICAL**: This project uses **bd** for ALL task tracking. Do NOT create markdown TODO lists.
### Essential Commands
```bash
# Find work
bd ready --json # Unblocked issues
bd stale --days 30 --json # Forgotten issues
# Create and manage
bd create "Title" -t bug|feature|task -p 0-4 --json
bd update <id> --status in_progress --json
bd close <id> --reason "Done" --json
# Search
bd list --status open --priority 1 --json
bd show <id> --json
# Sync (CRITICAL at end of session!)
bd sync # Force immediate export/commit/push
```
### Workflow
1. **Check ready work**: `bd ready --json`
2. **Claim task**: `bd update <id> --status in_progress`
3. **Work on it**: Implement, test, document
4. **Discover new work?** `bd create "Found bug" -p 1 --deps discovered-from:<parent-id> --json`
5. **Complete**: `bd close <id> --reason "Done" --json`
6. **Sync**: `bd sync` (flushes changes to git immediately)
### Priorities
- `0` - Critical (security, data loss, broken builds)
- `1` - High (major features, important bugs)
- `2` - Medium (default, nice-to-have)
- `3` - Low (polish, optimization)
- `4` - Backlog (future ideas)
## Project Structure
```
beads/
├── cmd/bd/ # CLI commands (add new commands here)
├── internal/
│ ├── types/ # Core data types
│ └── storage/ # Storage layer
│ └── sqlite/ # SQLite implementation
├── integrations/
│ └── beads-mcp/ # MCP server (Python)
├── examples/ # Integration examples
├── docs/ # Documentation
└── .beads/
├── beads.db # SQLite database (DO NOT COMMIT)
└── issues.jsonl # Git-synced issue storage
```
## Available Resources
### MCP Server (Recommended)
Use the beads MCP server for native function calls instead of shell commands:
- Install: `pip install beads-mcp`
- Functions: `mcp__beads__ready()`, `mcp__beads__create()`, etc.
- See `integrations/beads-mcp/README.md`
### Scripts
- `./scripts/bump-version.sh <version> --commit` - Update all version files atomically
- `./scripts/release.sh <version>` - Complete release workflow
- `./scripts/update-homebrew.sh <version>` - Update Homebrew formula
### Key Documentation
- **AGENTS.md** - Comprehensive AI agent guide (detailed workflows, advanced features)
- **AGENT_INSTRUCTIONS.md** - Development procedures, testing, releases
- **README.md** - User-facing documentation
- **docs/CLI_REFERENCE.md** - Complete command reference
## Important Rules
- ✅ Use bd for ALL task tracking
- ✅ Always use `--json` flag for programmatic use
- ✅ Run `bd sync` at end of sessions
- ✅ Test with `BEADS_DB=/tmp/test.db`
- ❌ Do NOT create markdown TODO lists
- ❌ Do NOT create test issues in production DB
- ❌ Do NOT commit `.beads/beads.db` (JSONL only)
---
**For detailed workflows and advanced features, see [AGENTS.md](../AGENTS.md)**
---
**Generated by bd v0.24.2**
To regenerate this file after upgrading bd:
```bash
bd onboard --output .beads/BD_GUIDE.md
```

81
.beads/README.md Normal file
View file

@ -0,0 +1,81 @@
# Beads - AI-Native Issue Tracking
Welcome to Beads! This repository uses **Beads** for issue tracking - a modern, AI-native tool designed to live directly in your codebase alongside your code.
## What is Beads?
Beads is issue tracking that lives in your repo, making it perfect for AI coding agents and developers who want their issues close to their code. No web UI required - everything works through the CLI and integrates seamlessly with git.
**Learn more:** [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
## Quick Start
### Essential Commands
```bash
# Create new issues
bd create "Add user authentication"
# View all issues
bd list
# View issue details
bd show <issue-id>
# Update issue status
bd update <issue-id> --status in_progress
bd update <issue-id> --status done
# Sync with git remote
bd sync
```
### Working with Issues
Issues in Beads are:
- **Git-native**: Stored in `.beads/issues.jsonl` and synced like code
- **AI-friendly**: CLI-first design works perfectly with AI coding agents
- **Branch-aware**: Issues can follow your branch workflow
- **Always in sync**: Auto-syncs with your commits
## Why Beads?
✨ **AI-Native Design**
- Built specifically for AI-assisted development workflows
- CLI-first interface works seamlessly with AI coding agents
- No context switching to web UIs
🚀 **Developer Focused**
- Issues live in your repo, right next to your code
- Works offline, syncs when you push
- Fast, lightweight, and stays out of your way
🔧 **Git Integration**
- Automatic sync with git commits
- Branch-aware issue tracking
- Intelligent JSONL merge resolution
## Get Started with Beads
Try Beads in your own projects:
```bash
# Install Beads
curl -sSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
# Initialize in your repo
bd init
# Create your first issue
bd create "Try out Beads"
```
## Learn More
- **Documentation**: [github.com/steveyegge/beads/docs](https://github.com/steveyegge/beads/tree/main/docs)
- **Quick Start Guide**: Run `bd quickstart`
- **Examples**: [github.com/steveyegge/beads/examples](https://github.com/steveyegge/beads/tree/main/examples)
---
*Beads: Issue tracking that moves at the speed of thought* ⚡

54
.beads/config.yaml Normal file
View file

@ -0,0 +1,54 @@
# Beads Configuration File
# This file configures default behavior for all bd commands in this repository
# All settings can also be set via environment variables (BD_* prefix)
# or overridden with command-line flags
# Issue prefix for this repository (used by bd init)
# If not set, bd init will auto-detect from directory name
# Example: issue-prefix: "myproject" creates issues like "myproject-1", "myproject-2", etc.
issue-prefix: "bd"
# Use no-db mode: load from JSONL, no SQLite, write back after each command
# When true, bd will use .beads/issues.jsonl as the source of truth
# instead of SQLite database
# no-db: false
# Disable daemon for RPC communication (forces direct database access)
# no-daemon: false
# Disable auto-flush of database to JSONL after mutations
# no-auto-flush: false
# Disable auto-import from JSONL when it's newer than database
# no-auto-import: false
# Enable JSON output by default
# json: false
# Default actor for audit trails (overridden by BD_ACTOR or --actor)
# actor: ""
# Path to database (overridden by BEADS_DB or --db)
# db: ""
# Auto-start daemon if not running (can also use BEADS_AUTO_START_DAEMON)
# auto-start-daemon: true
# Debounce interval for auto-flush (can also use BEADS_FLUSH_DEBOUNCE)
# flush-debounce: "5s"
# Sync branch for multi-clone setups
# When set, .beads changes are committed to this branch via worktree
# instead of the current branch. This allows multiple clones to sync
# beads data without polluting main branch commits.
# Can also be set via BEADS_SYNC_BRANCH environment variable.
sync-branch: "beads-metadata"
# Integration settings (access with 'bd config get/set')
# These are stored in the database, not in this file:
# - jira.url
# - jira.project
# - linear.url
# - linear.api-key
# - github.org
# - github.repo

12
.beads/cost_state.json Normal file
View file

@ -0,0 +1,12 @@
{
"hourly_tokens_used": 84530,
"hourly_cost_used": 0.39143399999999995,
"window_start_time": "2025-11-21T22:59:34.058436-08:00",
"issue_tokens_used": {
"SYSTEM": 50702,
"bd-9f86-baseline-test": 33055
},
"total_tokens_used": 84530,
"total_cost_used": 0.39143399999999995,
"last_updated": "2025-11-21T23:28:18.766601-08:00"
}

View file

@ -5,10 +5,10 @@
# until GitHub Actions finishes.
#
# Phases:
# 1. Prep & Push: preflight -> push-tag (polecat work)
# 1. Prep & Push: preflight → push-tag (polecat work)
# 2. Gate: await-ci (async wait for release.yml)
# 3. Verify: verify-github, verify-npm, verify-pypi, verify-homebrew-core (parallel)
# 4. Install: local-install -> cleanup-stale-dolt-orphans -> release-complete
# 3. Verify: verify-github, verify-npm, verify-pypi (parallel)
# 4. Install: local-install → release-complete (fan-in)
formula = "beads-release"
description = """
@ -26,11 +26,11 @@ Gate (Async Wait):
5. await-ci: Gate on GitHub Actions release.yml completion
Phase 2 (Parallel Verification):
6. Verify GitHub release, npm package, PyPI package, Homebrew core formula (concurrent)
6. Verify GitHub release, npm package, PyPI package (concurrent)
Phase 3 (Installation):
7. Local installation update
8. Stale Dolt orphan cleanup
8. Daemon restart
## Usage
@ -48,7 +48,6 @@ until release.yml finishes. A new polecat (or the same one) resumes for Phases 2
"""
type = "workflow"
phase = "vapor" # Ensures this runs as a wisp - bd pour will warn, gt sling --formula creates wisp
pour = true # Materialize release steps for checkpoint/resume visibility
version = 1
[vars.version]
@ -74,7 +73,7 @@ git remote get-url origin
git worktree list
```
For worktree setups, releases should be done from the main worktree to ensure:
For worktree setups, releases should be done from the **main worktree** to ensure:
- Correct file paths in commits
- Proper tag association
- Clean branch history
@ -84,7 +83,7 @@ If you're in a linked worktree:
2. Switch to that directory before proceeding
3. Or use: `cd $(git worktree list | head -1 | cut -d' ' -f1)`
Red flags:
**Red flags:**
- Remote URL doesn't match expected repository
- You're in a linked worktree (not the main one)
- `git status` shows different files than expected
@ -101,13 +100,13 @@ Ensure working tree is clean before starting release.
git status --short
```
Handling uncommitted changes:
**Handling uncommitted changes:**
If changes are in release-related files (CHANGELOG, version files), you may want to:
- Include them in the release commit
- Or stash and apply after version bump
If changes are in non-release files (e.g., .beads/config.yaml, .claude/settings.json, local configs):
If changes are in **non-release files** (e.g., .beads/config.yaml, .claude/settings.json, local configs):
```bash
# Auto-stash non-release files
git stash push -m "pre-release: non-release changes" -- .beads/ .claude/ *.local* .env*
@ -116,7 +115,7 @@ git stash push -m "pre-release: non-release changes" -- .beads/ .claude/ *.local
git status --short
```
Important: The bump script may fail if non-release files are modified. Always stash:
**Important:** The bump script may fail if non-release files are modified. Always stash:
- `.beads/` directory (local config)
- `.claude/` directory (agent settings)
- Any `.local`, `.env`, or personal config files
@ -134,20 +133,6 @@ needs = ["preflight-git"]
description = """
Ensure we're up to date with origin and branch is properly synced.
**Every `origin/...` below means the branch you are RELEASING FROM, which is
`release/x.y.z` — never `main`.** Resetting a release branch onto main's tip
destroys the reviewed release-prep commit and leaves you tagging an untested
main SHA, which is exactly the failure the release-branch policy exists to
prevent. Pin the name first and use the variable:
```bash
# The branch you are releasing from. For a prerelease this is still the BASE
# version's branch: an RC for 1.3.0 is cut on release/1.3.0.
REL_BRANCH="release/1.3.0"
git rev-parse --abbrev-ref HEAD # must equal $REL_BRANCH
```
```bash
# Fetch latest from origin
git fetch origin
@ -156,33 +141,34 @@ git fetch origin
git status -sb
```
Branch sync verification:
- "Your branch is behind" -> Pull needed, proceed with `git pull --rebase`
- "Your branch is ahead" -> You have unpushed commits - review before release!
- "Your branch has diverged" -> STOP - resolve divergence first
**Branch sync verification:**
- "Your branch is behind" → Pull needed, proceed with `git pull --rebase`
- "Your branch is ahead" → You have unpushed commits - review before release!
- "Your branch has diverged" → **STOP** - resolve divergence first
```bash
# If branch is behind or even, pull latest
git pull --rebase
```
Recovering from divergence:
**Recovering from divergence:**
If your branch has diverged from origin (e.g., after a botched commit):
```bash
# Option 1: Back up first, ALWAYS
# Option 1: Reset to origin (loses local commits)
git reset --hard origin/main
# Option 2: Rebase local commits on top of origin
git rebase origin/main
# Option 3: Create a backup branch first
git branch backup-before-release
# Option 2: Reset to the release branch's origin (loses local commits)
git reset --hard "origin/$REL_BRANCH"
# Option 3: Rebase local commits on top of it
git rebase "origin/$REL_BRANCH"
git reset --hard origin/main
```
After pulling, verify sync:
**After pulling, verify sync:**
```bash
git status -sb
# Should show: "## release/1.3.0...origin/release/1.3.0" (no ahead/behind)
# Should show: "## main...origin/main" (no ahead/behind)
```
"""
@ -193,7 +179,7 @@ needs = ["preflight-pull"]
description = """
Check if a previous release was started but not completed (version mismatch).
Compare versions across all sources:
**Compare versions across all sources:**
```bash
# Last git tag
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "none")
@ -212,16 +198,16 @@ NPM_VERSION=$(jq -r '.version' npm-package/package.json)
echo "npm version: $NPM_VERSION"
```
Healthy state (ready for new release):
**Healthy state (ready for new release):**
- All versions match (e.g., all show 0.46.0)
- Last tag matches code version
Half-done release detected if:
**Half-done release detected if:**
- CHANGELOG shows {{version}} but code shows previous version
- Code version doesn't match last tag
- npm/PyPI versions are out of sync
Recovery from half-done release:
**Recovery from half-done release:**
```bash
# If CHANGELOG was updated but code wasn't bumped:
# Either complete the release or revert CHANGELOG changes
@ -261,22 +247,22 @@ needs = ["review-changes"]
description = """
Ensure CHANGELOG captures ALL commits since the last release.
Step 1: Count commits since last tag
**Step 1: Count commits since last tag**
```bash
LAST_TAG=$(git describe --tags --abbrev=0)
COMMIT_COUNT=$(git rev-list $LAST_TAG..HEAD --count)
echo "Commits since $LAST_TAG: $COMMIT_COUNT"
```
Step 2: List all commits with their messages
**Step 2: List all commits with their messages**
```bash
git log $LAST_TAG..HEAD --oneline --no-merges
```
Step 3: Cross-reference with CHANGELOG
**Step 3: Cross-reference with CHANGELOG**
Open CHANGELOG.md and verify every significant commit is documented in [Unreleased].
Red flags for stale CHANGELOG:
**Red flags for stale CHANGELOG:**
- If CHANGELOG was last modified days ago but there are recent commits
- If commit count seems high but [Unreleased] section is sparse
- If PR titles in commits don't match CHANGELOG entries
@ -289,7 +275,7 @@ git log -1 --format="%ar" -- CHANGELOG.md
git log -1 --format="%ar"
```
If CHANGELOG is stale:
**If CHANGELOG is stale:**
1. Review all commits since last tag
2. Add missing entries to appropriate sections (Added/Changed/Fixed)
3. Group related changes
@ -339,95 +325,138 @@ Focus on workflow-impacting changes agents need to know.
"""
[[steps]]
id = "bump-versions"
title = "Bump every version reference"
id = "bump-version-go"
title = "Bump version in version.go"
needs = ["update-info-go"]
description = """
Run the one script that owns every version reference.
Update the Go version constant.
```bash
./scripts/update-versions.sh {{version}}
# macOS
sed -i '' 's/Version = "[^"]*"/Version = "{{version}}"/' cmd/bd/version.go
# Linux
sed -i 's/Version = "[^"]*"/Version = "{{version}}"/' cmd/bd/version.go
```
This is the ONLY sanctioned way to bump. Hand-rolled sed per file is how the
set drifts: this formula used to carry its own copies and pointed at a
`claude-plugin/` path that has not existed since the plugins moved under
`plugins/beads/`, while missing the copilot plugin, the MCP lockfile and the
tracked git-hook markers entirely — so it would have failed outright, or
shipped inconsistent versions, on every step after the stale path.
`scripts/update-versions.sh` rewrites, in one pass:
- `cmd/bd/version.go` — the canonical version everything else is compared to
- `plugins/beads/.claude-plugin/plugin.json`
- `plugins/beads/.codex-plugin/plugin.json`
- `plugins/beads/.copilot-plugin/plugin.json`
- `.claude-plugin/marketplace.json`
- `integrations/beads-mcp/pyproject.toml`
- `integrations/beads-mcp/src/beads_mcp/__init__.py`
- `integrations/beads-mcp/uv.lock` — via `uv lock`
- `npm-package/package.json`
- `.githooks/*` — the `BEGIN`/`END BEADS INTEGRATION v<version>` markers
- `default.nix`
- `cmd/bd/winres/winres.json`, `cmd/bd/winres/manifest.xml`
- `README.md` — the static Alpha badge, if one is present (it is not today;
README uses live npm/PyPI/GitHub badges)
Two of those have burned a release before, so check the script's output rather
than assuming:
- **`uv` must be installed.** Without it the script WARNS and leaves
`uv.lock` stale. The release workflow's MCP gate runs `uv sync --locked`,
which fails only in the tag-triggered run — after the tag exists and can no
longer be rewritten. That burned v1.1.1 and cost v1.1.0 and v1.1.2 their
first runs. If you see `uv not found` or `uv lock failed`, stop and fix it:
```bash
uv lock --directory integrations/beads-mcp
```
- **The `.githooks/*` markers are rewritten wholesale**, not matched against
the current version, because they can already be drifted when the bump runs
(they still said v1.1.0 during the v1.2.0 bump).
Not covered here, by design: `CHANGELOG.md` and `cmd/bd/info.go` (earlier
steps), and `default.nix`'s `vendorHash` (next step).
Verify:
```bash
git diff --stat
grep 'Version = ' cmd/bd/version.go
```
"""
[[steps]]
id = "update-vendorhash"
title = "Update Nix vendorHash if needed"
needs = ["bump-versions"]
id = "bump-plugin-json"
title = "Bump version in plugin JSON files"
needs = ["bump-version-go"]
description = """
Update vendorHash if go.mod/go.sum changed since last release.
Update Claude plugin manifest versions.
Check if update is needed:
```bash
# Compare go.mod/go.sum against last tag
LAST_TAG=$(git describe --tags --abbrev=0)
git diff $LAST_TAG -- go.mod go.sum
# macOS/Linux with jq
jq '.version = "{{version}}"' .claude-plugin/plugin.json > tmp && mv tmp .claude-plugin/plugin.json
jq '.plugins[0].version = "{{version}}"' .claude-plugin/marketplace.json > tmp && mv tmp .claude-plugin/marketplace.json
```
If there are changes, run the update script:
```bash
./scripts/update-nix-vendorhash.sh
```
The script auto-detects nix or Docker and updates the hash automatically.
Verify:
```bash
grep 'vendorHash = ' default.nix
jq -r '.version' .claude-plugin/plugin.json
jq -r '.plugins[0].version' .claude-plugin/marketplace.json
```
"""
[[steps]]
id = "bump-mcp-python"
title = "Bump version in MCP Python package"
needs = ["bump-plugin-json"]
description = """
Update the beads-mcp Python package version.
```bash
# macOS
sed -i '' 's/version = "[^"]*"/version = "{{version}}"/' integrations/beads-mcp/pyproject.toml
sed -i '' 's/__version__ = "[^"]*"/__version__ = "{{version}}"/' integrations/beads-mcp/src/beads_mcp/__init__.py
# Linux
sed -i 's/version = "[^"]*"/version = "{{version}}"/' integrations/beads-mcp/pyproject.toml
sed -i 's/__version__ = "[^"]*"/__version__ = "{{version}}"/' integrations/beads-mcp/src/beads_mcp/__init__.py
```
Verify:
```bash
grep 'version = ' integrations/beads-mcp/pyproject.toml | head -1
grep '__version__ = ' integrations/beads-mcp/src/beads_mcp/__init__.py
```
"""
[[steps]]
id = "bump-npm-package"
title = "Bump version in npm package"
needs = ["bump-mcp-python"]
description = """
Update the npm package version.
```bash
# macOS/Linux with jq
jq '.version = "{{version}}"' npm-package/package.json > tmp && mv tmp npm-package/package.json
```
Verify:
```bash
jq -r '.version' npm-package/package.json
```
"""
[[steps]]
id = "bump-hook-templates"
title = "Bump version in hook templates"
needs = ["bump-npm-package"]
description = """
Update version comment in git hook templates.
```bash
# macOS
for f in cmd/bd/templates/hooks/pre-commit cmd/bd/templates/hooks/post-merge cmd/bd/templates/hooks/pre-push cmd/bd/templates/hooks/post-checkout; do
sed -i '' 's/# bd-hooks-version: .*/# bd-hooks-version: {{version}}/' "$f"
done
# Linux
for f in cmd/bd/templates/hooks/pre-commit cmd/bd/templates/hooks/post-merge cmd/bd/templates/hooks/pre-push cmd/bd/templates/hooks/post-checkout; do
sed -i 's/# bd-hooks-version: .*/# bd-hooks-version: {{version}}/' "$f"
done
```
Verify:
```bash
grep '# bd-hooks-version:' cmd/bd/templates/hooks/pre-commit
```
"""
[[steps]]
id = "bump-readme"
title = "Bump version in README badge"
needs = ["bump-hook-templates"]
description = """
Update the Alpha version badge in README.md.
```bash
# macOS
sed -i '' 's/Alpha (v[^)]*)/Alpha (v{{version}})/' README.md
# Linux
sed -i 's/Alpha (v[^)]*)/Alpha (v{{version}})/' README.md
```
Verify:
```bash
grep 'Alpha (v' README.md
```
"""
[[steps]]
id = "stamp-changelog"
title = "Stamp changelog with release date"
needs = ["update-vendorhash"]
needs = ["bump-readme"]
description = """
Add the release date to the [Unreleased] section header.
@ -456,45 +485,16 @@ id = "verify-versions"
title = "Verify version consistency"
needs = ["stamp-changelog"]
description = """
Run the gate, not a hand-listed grep pile — the grep list is what drifts.
Confirm all versions match {{version}}.
```bash
./scripts/check-versions.sh
grep 'Version = ' cmd/bd/version.go
jq -r '.version' .claude-plugin/plugin.json
jq -r '.version' npm-package/package.json
grep 'version = ' integrations/beads-mcp/pyproject.toml
```
`scripts/check-versions.sh` reads the canonical version out of
`cmd/bd/version.go` and compares the gated files against it: all three plugin
manifests (claude, codex, copilot), the marketplace, the MCP pyproject /
`__init__.py` / `uv.lock` pin (plus `uv lock --check` for freshness when `uv`
is present), the npm package, both `BEADS INTEGRATION` markers in every
`.githooks/*` file, and the Windows PE metadata in `winres.json` and
`manifest.xml`. It exits non-zero on any mismatch and names the file. This is
the same script the release-tag pre-push hook and CI run, so a green run here
is the real signal.
It must print `✓ Version files in sync at: {{version}}` before you continue.
**If it fails, do NOT just re-run the bump — that is a no-op here.**
`update-versions.sh` derives the OLD version from `cmd/bd/version.go`, which by
this point already reads `{{version}}`, so its substitutions rewrite
`{{version}} -> {{version}}` and leave the drifted file exactly as it was while
printing a green "Version constants updated". Only the `.githooks` markers
(rewritten wholesale) and `uv.lock` (regenerated) heal on a re-run. The script
prints the three remedies that do work; the usual one is to edit the named file
to `{{version}}` and re-run the check.
`check-versions.sh` does NOT gate `default.nix` or `README.md`. Confirm
`default.nix` yourself:
```bash
grep 'version = ' default.nix # should be {{version}}
```
(For a prerelease, do not expect the version string to appear uniformly in the
winres files: `file_version`/`product_version` and the manifest's four-part
version carry the BASE version because PE fields must be purely numeric, while
`FileVersion`/`ProductVersion` carry the full `{{version}}`. check-versions.sh
now encodes that split, so let it do the checking.)
All should show {{version}}.
"""
[[steps]]
@ -513,74 +513,37 @@ Review the commit to ensure all expected files are included.
"""
[[steps]]
id = "push-main"
title = "Land the release prep as a PR"
id = "create-tag"
title = "Create release tag"
needs = ["commit-release"]
description = """
Releases are cut from `release/x.y.z`, not from the tip of `main` — see the
"Release Branches" section of RELEASING.md. **Nothing is pushed straight to the
release branch, and nothing is tagged before the PR merges.**
The branch is named for the BASE version: a `1.3.0-rc.1` run still targets
`release/1.3.0`. Derive it rather than substituting `{{version}}` directly,
which would name a branch nothing ever creates and fail with
`src refspec ... does not match any`:
Create annotated git tag.
```bash
BASE="$(printf '%s' "{{version}}" | sed 's/-.*//')"
REL_BRANCH="release/$BASE"
echo "$REL_BRANCH"
```
Create the prep branch, push it, and open the PR:
```bash
git checkout -b "release-prep/v{{version}}"
git push -u origin "release-prep/v{{version}}"
gh pr create --base "$REL_BRANCH" --label status/needs-review-auto
```
Wait for it to merge, then take the merged state:
```bash
git checkout "$REL_BRANCH" && git pull
```
After the release ships, every commit that landed only on the release branch
needs a forward-port PR to `main`, the version bump included:
```bash
git log --oneline "main..$REL_BRANCH"
```
"""
[[steps]]
id = "create-tag"
title = "Create release tag on the merged commit"
needs = ["push-main"]
description = """
Create the annotated tag on the MERGED commit, with the release branch checked
out and pulled (previous step).
```bash
git rev-parse --abbrev-ref HEAD # must be the release branch, not the prep branch
git tag -a v{{version}} -m "Release v{{version}}"
```
Tagging before the merge is the failure to avoid, in two shapes. With branch
protection on, the direct push is rejected after the tag already exists
locally. With a squash merge, the tag points at a commit that is not an
ancestor of the release branch — and goreleaser packages `CHANGELOG.md` *from
the tag* into every published archive, so the release would ship the
pre-review notes.
Verify: `git tag -l | tail -5`
"""
[[steps]]
id = "push-main"
title = "Push to main"
needs = ["create-tag"]
description = """
Push the release commit to origin.
```bash
git push origin main
```
If rejected, someone else pushed. Pull, rebase, try again.
"""
[[steps]]
id = "push-tag"
title = "Push release tag"
needs = ["create-tag"]
needs = ["push-main"]
description = """
Push the version tag to trigger CI release.
@ -590,7 +553,7 @@ git push origin v{{version}}
This triggers GitHub Actions to build artifacts and publish.
Phase 1 Complete: After this step, signal phase-complete:
**Phase 1 Complete**: After this step, signal phase-complete:
```bash
gt done --phase-complete
```
@ -640,7 +603,7 @@ needs = ["await-ci"]
description = """
Check the GitHub releases page.
https://github.com/gastownhall/beads/releases/tag/v{{version}}
https://github.com/steveyegge/beads/releases/tag/v{{version}}
Verify:
- Release created
@ -688,66 +651,6 @@ Should show {{version}}.
Note: PyPI may have a small propagation delay (1-2 min).
"""
[[steps]]
id = "verify-homebrew-core"
title = "Verify Homebrew core formula"
needs = ["await-ci"]
description = """
Confirm Homebrew core has the stable formula update.
Release candidates are not published to Homebrew. If `{{version}}` contains a
hyphen, record that Homebrew intentionally remains on the latest stable release
and skip the rest of this step.
Stable releases:
1. Check whether Homebrew already opened the canonical bump PR:
```bash
gh pr list \
--repo Homebrew/homebrew-core \
--search "beads {{version}} in:title" \
--state all
```
2. If a BrewTestBot or `brew bump-formula-pr` PR already exists, track that PR.
Do not open a duplicate manual PR. Do not push to the PR branch before
Homebrew's bottle commits are pushed.
3. If no PR exists, open it with Homebrew's bump tool:
```bash
brew bump-formula-pr \
--url="https://github.com/gastownhall/beads/archive/refs/tags/v{{version}}.tar.gz" \
beads
```
This computes the source checksum and lets Homebrew/BrewTestBot manage the
bottle block. Do not remove or hand-edit the bottle block.
4. If a manual PR is unavoidable, fill in Homebrew's current PR template before
opening or editing the PR:
```bash
gh api repos/Homebrew/homebrew-core/contents/.github/PULL_REQUEST_TEMPLATE.md \
-H 'Accept: application/vnd.github.raw'
```
Do not leave the checklist/body blank. An incomplete or stale template causes
Homebrew automation to close the PR.
5. Verify the merged formula on `Homebrew/homebrew-core@main`:
```bash
gh api '/repos/Homebrew/homebrew-core/contents/Formula/b/beads.rb?ref=main' \
-H 'Accept: application/vnd.github.raw' | tee /tmp/homebrew-beads.rb
grep -F 'homepage "https://github.com/gastownhall/beads"' /tmp/homebrew-beads.rb
grep -F 'url "https://github.com/gastownhall/beads/archive/refs/tags/v{{version}}.tar.gz"' /tmp/homebrew-beads.rb
grep -F 'bottle do' /tmp/homebrew-beads.rb
```
6. Record the merged Homebrew PR on the release tracker. If a duplicate manual
PR was closed by Homebrew automation after the canonical PR merged, leave it
closed and note which PR is canonical.
"""
# =============================================================================
# Phase 3: Installation (Fan-in)
# =============================================================================
@ -755,131 +658,51 @@ Stable releases:
[[steps]]
id = "local-install"
title = "Update local installation"
needs = ["verify-github", "verify-npm", "verify-pypi", "verify-homebrew-core"]
needs = ["verify-github", "verify-npm", "verify-pypi"]
description = """
Update local bd to the new version.
Step 1: Install release binary
Option A - Homebrew:
Option 1 - Homebrew:
```bash
brew upgrade beads
brew upgrade bd
```
Option B - Install script:
Option 2 - Install script:
```bash
curl -fsSL https://raw.githubusercontent.com/gastownhall/beads/main/scripts/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
```
Step 2: Check for dev builds (developers only)
If you build bd from source, you may have multiple `bd` binaries in your PATH:
```bash
which -a bd
```
Common locations:
- `~/.local/bin/bd` - release binary (installed above)
- `~/go/bin/bd` - Go dev build
- Project worktree builds
If you have a dev build that takes precedence, rebuild from source:
```bash
# From the beads source directory
make install
# Or using go install directly
go install -ldflags="-X main.Build=$(git rev-parse --short HEAD)" ./cmd/bd
```
Verify ALL bd binaries are updated:
```bash
# Check which bd runs by default
which bd && bd --version
# If you have go/bin/bd, verify it too
test -f ~/go/bin/bd && ~/go/bin/bd --version
```
All should show {{version}}.
"""
[[steps]]
id = "cleanup-stale-dolt-orphans"
title = "Clean up stale Dolt orphans"
needs = ["local-install"]
description = """
Clean up orphaned local Dolt server processes left behind by older bd runs.
The active canonical server, embedded mode, and external Dolt hosts are left alone.
```bash
STATUS_JSON=$(bd dolt status --json 2>/dev/null) || {
echo "Could not query Dolt status."
bd dolt status
exit 1
}
MODE=$(printf "%s\n" "$STATUS_JSON" | sed -n 's/.*"mode"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/p' | head -1)
case "$MODE" in
embedded)
echo "Embedded Dolt mode; no server restart needed."
;;
external)
echo "External Dolt mode; no local orphan cleanup needed."
;;
"")
if ! printf "%s\n" "$STATUS_JSON" | grep -Eq '"(running|data_dir)"[[:space:]]*:'; then
echo "Dolt status JSON did not identify a mode or local server state."
bd dolt status
exit 1
fi
bd dolt killall
;;
*)
echo "Unrecognized Dolt mode: $MODE"
bd dolt status
exit 1
;;
esac
```
This step only reaps orphaned local Dolt processes. It does not stop the
canonical active server.
Verify:
```bash
bd dolt status
bd --version
```
Should show {{version}}.
"""
[[steps]]
id = "generate-newsletter"
title = "Generate release newsletter"
needs = ["push-tag"]
id = "restart-daemons"
title = "Restart daemons"
needs = ["local-install"]
description = """
Generate a narrative newsletter summarizing this release.
The newsletter generator aggregates changelog, commits, new commands, and
breaking changes into a narrative format suitable for users.
Restart bd daemons to pick up new version.
```bash
# Generate newsletter for this release
uv run scripts/generate-newsletter.py --to-release v{{version}}
# Or specify the range explicitly (e.g., from last release)
PREV_TAG=$(git describe --tags --abbrev=0 v{{version}}^)
uv run scripts/generate-newsletter.py --from-release $PREV_TAG --to-release v{{version}}
bd daemons killall
```
The script outputs to NEWSLETTER.md by default. Review and commit if desired.
Daemons will auto-restart with new version on next bd command.
Note: This step can run in parallel with verification steps since it only
needs the tag to exist, not the CI artifacts.
Verify:
```bash
bd daemons list
```
"""
[[steps]]
id = "release-complete"
title = "Release complete"
needs = ["cleanup-stale-dolt-orphans", "generate-newsletter"]
needs = ["restart-daemons"]
description = """
Release v{{version}} is complete!
@ -889,11 +712,9 @@ Summary:
- CI artifacts built (via gate)
- npm and PyPI packages verified
- Local installation updated
- Dolt servers refreshed if applicable
- Newsletter generated
- Daemons restarted
Optional next steps:
- Review and publish NEWSLETTER.md
- Announce on social media
- Update documentation site
- Close related milestone

3066
.beads/issues.jsonl Normal file

File diff suppressed because one or more lines are too long

836
.beads/issues.jsonl.new Normal file

File diff suppressed because one or more lines are too long

1
.beads/last-touched Normal file
View file

@ -0,0 +1 @@
bd-rig-beads

5
.beads/metadata.json Normal file
View file

@ -0,0 +1,5 @@
{
"database": "beads.db",
"jsonl_export": "issues.jsonl",
"last_bd_version": "0.27.2"
}

11
.beads/mq/bd-0e3m.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-0e3m",
"branch": "polecat/jade-1767138549967",
"target": "main",
"source_issue": "jade-1767138549967",
"worker": "",
"rig": "beads",
"title": "Merge: jade-1767138549967",
"priority": 2,
"created_at": "2025-12-30T15:55:27.93949-08:00"
}

11
.beads/mq/bd-0kue.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-0kue",
"branch": "polecat/onyx-1767106262992",
"target": "main",
"source_issue": "onyx-1767106262992",
"worker": "",
"rig": "beads",
"title": "Merge: onyx-1767106262992",
"priority": 2,
"created_at": "2025-12-30T06:59:46.966142-08:00"
}

11
.beads/mq/bd-1200.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-1200",
"branch": "polecat/jasper-1767106250817",
"target": "main",
"source_issue": "jasper-1767106250817",
"worker": "",
"rig": "beads",
"title": "Merge: jasper-1767106250817",
"priority": 2,
"created_at": "2025-12-30T07:05:01.456893-08:00"
}

11
.beads/mq/bd-13c2.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-13c2",
"branch": "polecat/garnet-1767138539231",
"target": "main",
"source_issue": "garnet-1767138539231",
"worker": "",
"rig": "beads",
"title": "Merge: garnet-1767138539231",
"priority": 2,
"created_at": "2025-12-30T16:00:34.709829-08:00"
}

11
.beads/mq/bd-2c64.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-2c64",
"branch": "polecat/ruby-1767142029451",
"target": "main",
"source_issue": "ruby-1767142029451",
"worker": "",
"rig": "beads",
"title": "Merge: ruby-1767142029451",
"priority": 2,
"created_at": "2025-12-30T17:00:14.138585-08:00"
}

11
.beads/mq/bd-2lkh.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-2lkh",
"branch": "polecat/obsidian-1767138468820",
"target": "main",
"source_issue": "obsidian-1767138468820",
"worker": "",
"rig": "beads",
"title": "Merge: obsidian-1767138468820",
"priority": 2,
"created_at": "2025-12-30T16:14:15.964858-08:00"
}

11
.beads/mq/bd-3rko.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-3rko",
"branch": "polecat/topaz-1767142022153",
"target": "main",
"source_issue": "topaz-1767142022153",
"worker": "",
"rig": "beads",
"title": "Merge: topaz-1767142022153",
"priority": 2,
"created_at": "2025-12-30T17:06:22.779045-08:00"
}

11
.beads/mq/bd-5482.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-5482",
"branch": "polecat/obsidian-1767083466920",
"target": "main",
"source_issue": "obsidian-1767083466920",
"worker": "",
"rig": "beads",
"title": "Merge: obsidian-1767083466920",
"priority": 2,
"created_at": "2025-12-30T00:36:06.075415-08:00"
}

11
.beads/mq/bd-6vnu.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-6vnu",
"branch": "polecat/opal-1767142018955",
"target": "main",
"source_issue": "opal-1767142018955",
"worker": "",
"rig": "beads",
"title": "Merge: opal-1767142018955",
"priority": 2,
"created_at": "2025-12-30T17:14:02.069377-08:00"
}

11
.beads/mq/bd-71v3.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-71v3",
"branch": "polecat/topaz-1767083484329",
"target": "main",
"source_issue": "topaz-1767083484329",
"worker": "",
"rig": "beads",
"title": "Merge: topaz-1767083484329",
"priority": 2,
"created_at": "2025-12-30T00:39:43.097575-08:00"
}

11
.beads/mq/bd-7wrh.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-7wrh",
"branch": "polecat/jasper-1767083473604",
"target": "main",
"source_issue": "jasper-1767083473604",
"worker": "",
"rig": "beads",
"title": "Merge: jasper-1767083473604",
"priority": 2,
"created_at": "2025-12-30T00:39:04.849184-08:00"
}

11
.beads/mq/bd-90fs.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-90fs",
"branch": "polecat/amber-1767138546434",
"target": "main",
"source_issue": "amber-1767138546434",
"worker": "",
"rig": "beads",
"title": "Merge: amber-1767138546434",
"priority": 2,
"created_at": "2025-12-30T15:57:38.683138-08:00"
}

11
.beads/mq/bd-98b4.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-98b4",
"branch": "polecat/onyx-1767138516448",
"target": "main",
"source_issue": "onyx-1767138516448",
"worker": "",
"rig": "beads",
"title": "Merge: onyx-1767138516448",
"priority": 2,
"created_at": "2025-12-30T16:17:51.540906-08:00"
}

11
.beads/mq/bd-a1t0.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-a1t0",
"branch": "polecat/opal-1767138520240",
"target": "main",
"source_issue": "opal-1767138520240",
"worker": "",
"rig": "beads",
"title": "Merge: opal-1767138520240",
"priority": 2,
"created_at": "2025-12-30T15:59:09.907511-08:00"
}

11
.beads/mq/bd-agye.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-agye",
"branch": "polecat/quartz-1767083470444",
"target": "main",
"source_issue": "quartz-1767083470444",
"worker": "",
"rig": "beads",
"title": "Merge: quartz-1767083470444",
"priority": 2,
"created_at": "2025-12-30T00:36:39.739127-08:00"
}

11
.beads/mq/bd-cfxq.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-cfxq",
"branch": "polecat/topaz-1767106269860",
"target": "main",
"source_issue": "topaz-1767106269860",
"worker": "",
"rig": "beads",
"title": "Merge: topaz-1767106269860",
"priority": 2,
"created_at": "2025-12-30T07:18:49.116137-08:00"
}

11
.beads/mq/bd-ehwp.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-ehwp",
"branch": "polecat/ruby-1767138542815",
"target": "main",
"source_issue": "ruby-1767138542815",
"worker": "",
"rig": "beads",
"title": "Merge: ruby-1767138542815",
"priority": 2,
"created_at": "2025-12-30T15:59:42.842575-08:00"
}

11
.beads/mq/bd-g1ai.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-g1ai",
"branch": "polecat/opal-1767106266450",
"target": "main",
"source_issue": "opal-1767106266450",
"worker": "",
"rig": "beads",
"title": "Merge: opal-1767106266450",
"priority": 2,
"created_at": "2025-12-30T07:03:00.721165-08:00"
}

11
.beads/mq/bd-ir5t.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-ir5t",
"branch": "polecat/quartz-1767106247671",
"target": "main",
"source_issue": "quartz-1767106247671",
"worker": "",
"rig": "beads",
"title": "Merge: quartz-1767106247671",
"priority": 2,
"created_at": "2025-12-30T07:02:08.920599-08:00"
}

11
.beads/mq/bd-jjzz.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-jjzz",
"branch": "polecat/obsidian-1767106243818",
"target": "main",
"source_issue": "obsidian-1767106243818",
"worker": "",
"rig": "beads",
"title": "Merge: obsidian-1767106243818",
"priority": 2,
"created_at": "2025-12-30T07:00:26.330057-08:00"
}

11
.beads/mq/bd-jxp6.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-jxp6",
"branch": "polecat/jasper-1767142011373",
"target": "main",
"source_issue": "jasper-1767142011373",
"worker": "",
"rig": "beads",
"title": "Merge: jasper-1767142011373",
"priority": 2,
"created_at": "2025-12-30T16:57:20.35112-08:00"
}

11
.beads/mq/bd-kvwf.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-kvwf",
"branch": "polecat/quartz-1767142008267",
"target": "main",
"source_issue": "quartz-1767142008267",
"worker": "",
"rig": "beads",
"title": "Merge: quartz-1767142008267",
"priority": 2,
"created_at": "2025-12-30T16:50:35.729624-08:00"
}

11
.beads/mq/bd-oajy.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-oajy",
"branch": "polecat/garnet-1767142025508",
"target": "main",
"source_issue": "garnet-1767142025508",
"worker": "",
"rig": "beads",
"title": "Merge: garnet-1767142025508",
"priority": 2,
"created_at": "2025-12-30T17:03:48.371414-08:00"
}

11
.beads/mq/bd-qvpn.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-qvpn",
"branch": "polecat/jasper-1767138512869",
"target": "main",
"source_issue": "jasper-1767138512869",
"worker": "",
"rig": "beads",
"title": "Merge: jasper-1767138512869",
"priority": 2,
"created_at": "2025-12-30T15:51:49.013034-08:00"
}

11
.beads/mq/bd-s5kf.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-s5kf",
"branch": "polecat/onyx-1767083477016",
"target": "main",
"source_issue": "onyx-1767083477016",
"worker": "",
"rig": "beads",
"title": "Merge: onyx-1767083477016",
"priority": 2,
"created_at": "2025-12-30T00:37:08.216603-08:00"
}

11
.beads/mq/bd-tglv.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-tglv",
"branch": "polecat/onyx-1767142014545",
"target": "main",
"source_issue": "onyx-1767142014545",
"worker": "",
"rig": "beads",
"title": "Merge: onyx-1767142014545",
"priority": 2,
"created_at": "2025-12-30T17:05:30.190725-08:00"
}

11
.beads/mq/bd-txds.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-txds",
"branch": "polecat/obsidian-1767142004753",
"target": "main",
"source_issue": "obsidian-1767142004753",
"worker": "",
"rig": "beads",
"title": "Merge: obsidian-1767142004753",
"priority": 2,
"created_at": "2025-12-30T16:57:13.545352-08:00"
}

11
.beads/mq/bd-wx8t.json Normal file
View file

@ -0,0 +1,11 @@
{
"id": "bd-wx8t",
"branch": "polecat/topaz-1767138533986",
"target": "main",
"source_issue": "topaz-1767138533986",
"worker": "",
"rig": "beads",
"title": "Merge: topaz-1767138533986",
"priority": 2,
"created_at": "2025-12-30T16:00:41.077442-08:00"
}

View file

@ -1,24 +0,0 @@
# Canonical build flags for beads. Source this in any script that invokes
# `go` to get the project-wide build settings. Scripts that intentionally
# exercise the ICU path (e.g. scripts/test-cgo.sh) do NOT source this.
#
# Rationale: go-mysql-server links ICU by default under cgo. beads never
# uses SQL REGEXP, so we always build with -tags=gms_pure_go. See
# engdocs/ICU-POLICY.md for the full policy.
# Embedded Dolt requires CGO; server mode and nocgo builds do not. Default
# to 1 for the embedded-capable build paths that sourced this, but respect
# a caller who explicitly set CGO_ENABLED=0 (e.g. a static/nocgo build).
: "${CGO_ENABLED:=1}"
export CGO_ENABLED
# Build tag that tells go-mysql-server to use Go's stdlib regex instead of
# the ICU-backed go-icu-regex. Exported so callers can compose with extra
# tags: `go test -tags=regression,$BEADS_BUILD_TAGS ...`
export BEADS_BUILD_TAGS="gms_pure_go"
# Propagate the tag via GOFLAGS so every subsequent bare `go` invocation
# picks it up automatically. Idempotent: re-sourcing is a no-op.
if [[ "${GOFLAGS:-}" != *gms_pure_go* ]]; then
export GOFLAGS="${GOFLAGS:+$GOFLAGS }-tags=${BEADS_BUILD_TAGS}"
fi

View file

@ -7,9 +7,9 @@
"plugins": [
{
"name": "beads",
"source": "./plugins/beads",
"source": "./claude-plugin",
"description": "AI-supervised issue tracker for coding workflows",
"version": "1.3.0"
"version": "0.47.2"
}
]
}

View file

@ -0,0 +1,21 @@
---
description: Hand off to fresh session, work continues from hook
allowed-tools: Bash(gt mail send:*),Bash(gt handoff:*)
argument-hint: [message]
---
Hand off to a fresh session.
User's handoff message (if any): $ARGUMENTS
Execute these steps in order:
1. If user provided a message, send handoff mail to yourself first.
Construct your mail address from your identity (e.g., beads/crew/emma for crew).
Example: `gt mail send beads/crew/emma -s "HANDOFF: Session cycling" -m "USER_MESSAGE_HERE"`
2. Run the handoff command (this will respawn your session with a fresh Claude):
`gt handoff`
Note: The new session will auto-prime via the SessionStart hook and find your handoff mail.
End watch. A new session takes over, picking up any molecule on the hook.

View file

@ -1,20 +0,0 @@
#!/bin/bash
# Block commands that burn through GitHub API rate limits or violate workflow.
# The GitHub API allows 5000 requests/hour. `gh run watch` polls every 3
# seconds (1200 req/hr), and has repeatedly exhausted the quota during
# releases, blocking all crew members for up to an hour.
COMMAND=$(jq -r '.tool_input.command' < /dev/stdin)
if echo "$COMMAND" | grep -qE 'gh run watch|gh run list.*--watch'; then
jq -n '{
hookSpecificOutput: {
hookEventName: "PreToolUse",
permissionDecision: "deny",
permissionDecisionReason: "BLOCKED: gh run watch polls every 3s and burns through the 5000/hr GitHub API rate limit. Use `gh run view <run-id>` for a single status check, or `sleep 600 && gh run view <id>` to wait and check once."
}
}'
exit 0
fi
exit 0

View file

@ -1,31 +0,0 @@
#!/bin/bash
# Block cp/mv/rm without -f flag to prevent interactive prompt hangs.
#
# Problem: macOS shell profiles often alias cp/mv/rm with -i (interactive),
# causing AI agents to hang indefinitely waiting for y/n input they can't
# provide. Observed in multiple polecats during swarm operations.
#
# Solution: Block these commands unless -f flag or alias-bypass is present.
# The agent can easily retry with -f added.
COMMAND=$(jq -r '.tool_input.command' < /dev/stdin)
for cmd in cp mv rm; do
# Match: cmd at word boundary, followed by space and arguments
# Skip if: -f flag present, or using 'command' builtin / absolute path / backslash
if echo "$COMMAND" | grep -qE "(^|[;&|] *)${cmd} " && \
! echo "$COMMAND" | grep -qE "(^|[;&|] *)${cmd} +-[a-eg-zA-Z]*f" && \
! echo "$COMMAND" | grep -qE "(command +${cmd}|/bin/${cmd}|/usr/bin/${cmd})" && \
! echo "$COMMAND" | grep -qE "(^|[;&|] *)\\\\${cmd} "; then
jq -n --arg cmd "$cmd" '{
hookSpecificOutput: {
hookEventName: "PreToolUse",
permissionDecision: "deny",
permissionDecisionReason: ("BLOCKED: `" + $cmd + "` without `-f` flag may hang on interactive prompts (macOS often aliases `" + $cmd + "` to `" + $cmd + " -i`). Use `" + $cmd + " -f ...` instead, or prefix with `command " + $cmd + "` to bypass aliases.")
}
}'
exit 0
fi
done
exit 0

View file

@ -1,19 +0,0 @@
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-gh-watch.sh"
},
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-interactive-cmds.sh"
}
]
}
]
}
}

View file

@ -1,223 +0,0 @@
---
name: beads-docs
description: >-
Project conventions for writing, editing, restructuring, or reviewing the
beads user documentation — the Mintlify site under docs/. Use this whenever
you touch anything in docs/ (pages, concept docs, reference, integration
guides, recovery runbooks, diagrams, docs.json navigation) or write/edit
prose about beads, even when the request is just "fix the docs", "write a
docs page", "the docs are wrong/confusing", "rename X across the docs", or
an edit to a file under docs/. It defines the canonical concept model
(bead → dependencies → ready work; formula → proto → molecule/wisp; gates;
Dolt sync and federation), required terminology, the prose/emphasis/diagram
conventions, the rule that generated docs are edited at their source, and
the gates to run before docs work is done.
---
# Writing beads docs
This is the house style for `docs/` — the beads user documentation, published
as a Mintlify site. The goal is docs that motivate before they jargon, say the
same thing the same way everywhere, show concepts as pictures and snippets
instead of walls of prose, and never drift from the code. Apply it to any page
you create, edit, or review.
The audience of `docs/` is a **user** of beads — a human or agent installing
`bd`, tracking work, and syncing it. Contributor-facing material lives in
`engdocs/` and `AGENTS.md` and follows different rules (it may describe the
implementation literally). When this skill says "the docs," it means `docs/`.
## 1. The canonical model
Beads is a dependency-aware issue graph with a workflow layer on top. Teach it
consistently and link to the canonical concept page —
**`docs/core-concepts/index.md`** — rather than re-explaining it.
| Concept | Role | Key idea |
|---|---|---|
| **bead** (issue) | the unit of work | one tracked item with a hash ID (`bd-a1b2`), type, status, priority; "bead" and "issue" name the same thing |
| **dependency** | ordering | `blocks` edges hide a bead from agents until its blockers close; `parent-child`, `related`, `discovered-from` organize without blocking |
| **ready work** | what `bd ready` computes | open beads with no open blockers, excluding in_progress, blocked, deferred, and hooked — the claimable frontier |
| **formula** | workflow source | a TOML/JSON file defining a DAG of steps; `bd cook` compiles it into a proto |
| **proto** | workflow template | a template epic (label `template`) with `{{variables}}`; not live work |
| **molecule** | instantiated workflow | real beads poured from a proto (`bd mol pour`); persistent |
| **wisp** | ephemeral molecule | same instantiation, transient lifecycle (`bd mol wisp`); purged by `bd purge` |
| **gate** | async wait | blocks a workflow step until closed — by a human, a timer, a GitHub run/PR, or a cross-rig bead |
| **sync** | cross-machine movement | Dolt push/pull over `refs/dolt/data` on the git remote; `.beads/issues.jsonl` is a passive export, never the database |
| **federation** | cross-repo sync | peer-to-peer sharing of beads across repos/organizations |
The pipeline worth internalizing: **formula → (cook) → proto → (pour) →
molecule** or **→ (wisp) → wisp**. Gates pause molecule steps; `bd ready`
surfaces the claimable steps; sync moves the whole graph between machines.
Storage facts that pages keep getting wrong: embedded mode (the default
`bd init`) stores data at `.beads/embeddeddolt/`; server mode
(`bd init --server`) uses `.beads/dolt/`. Never present `.beads/dolt/` as the
general data path.
**Cross-project vocabulary (beads ↔ Gas City).** Gas City (the sibling
project) shares the words molecule, formula, wisp, and gate, but the two doc
corpora use them differently: Gas City's docs treat molecule/wisp as v1
implementation detail (never a user concept), and a Gas City formula is an
orchestration method the orchestrator runs across agents. In beads,
molecule/wisp/proto ARE user concepts, and a formula is the TOML source you
cook into a proto. Never import Gas City's definitions into beads pages (or
vice versa); when a page must bridge the two projects, say explicitly which
project's sense is meant.
## 2. Required terminology
Use the left column; never the right (except as noted). The full
prose-vs-literal rename discipline is in
[references/terminology.md](references/terminology.md).
| Use this | Not this | Notes |
|---|---|---|
| **bead** / **issue** | "task", "ticket", "TODO item" as the unit's name | Both terms are correct and interchangeable; lead with *bead* when teaching identity, use *issue* when mirroring CLI output or flags (`bd create`, "issue types"). "task" is one issue *type*, never the generic unit. |
| **ready work** | "unblocked queue", "available tasks", "the ready set" as a formal term | Say what `bd ready` returns: open beads with no open blockers. |
| **proto** | "template" as a noun for the concept | `template` stays only as the literal label name protos carry. |
| **molecule** | "mol" in prose | `mol` is the command literal (`bd mol pour`); the concept is a molecule. |
| **formula** | conflating formula with molecule/proto | The formula is the *file*; cooking makes a proto; pouring makes live work. |
| **gate** | "barrier", "checkpoint", "lock" | Gates are async wait conditions with types (human, timer, gh:run, gh:pr, bead). |
| **sync** = Dolt push/pull | export/import as a sync workflow | `bd dolt push` / `bd dolt pull` over `refs/dolt/data`. `.beads/issues.jsonl` is a passive export for viewers and interchange. |
| **embedded mode** / **server mode** | "local mode", "daemon mode" for storage | Embedded is the default; data at `.beads/embeddeddolt/`. Server mode connects to `dolt sql-server`; data at `.beads/dolt/`. |
| **federation** | "multi-repo sync" as a distinct feature name | Federation is the peer-to-peer cross-repo sharing feature. |
| **hash ID** | "random ID", "UUID" | IDs like `bd-a1b2` are content-derived hashes sized adaptively to prevent collisions. |
## 3. Content stance
- **Motivate before you mechanize.** Lead a page with the problem it solves,
then the solution, then the mechanics. Never open on vocabulary.
- **Docs are not the project's history.** No `internal/*` package paths, no
"this was removed in vX", no "(v0.20.1+)" gating on user pages — beads is a
1.x product and pre-1.0 archaeology belongs in `engdocs/` or the CHANGELOG.
- **Lead with the value.** Beads' value is persistent, dependency-aware memory
for coding agents — agents that survive context loss because the work graph
outlives the session. The comparison framing (vs GitHub Issues, Jira,
markdown TODO lists) is the best newcomer conversion tool; keep it early
where it exists.
- **One concrete example beats three abstract sentences.** Where you assert a
capability, show a `bd` invocation and what it prints.
## 4. Information architecture
Navigation lives in `docs/docs.json`: Getting Started, Core Concepts,
Architecture, Workflows, Recovery, Multi-Agent, Integrations, Community, and
Reference — with the generated CLI Reference nested inside Reference as a
collapsed sub-group.
- **Every section has an index/Overview page** that introduces the section in
a sentence or two, then lists every child page with a one-line accurate
summary and link.
- One page, one purpose. A page that tries to teach *and* specify does
neither — split it and cross-link.
- Concept material is unified on `core-concepts/index`; don't re-derive the
model on other pages — link to it.
- The repository map belongs in the README, not in `docs/`.
## 5. Prose doctrine — cut words, sharpen points
Most bloat is information stored in the wrong medium. Move it to a cheaper
carrier, then delete what isn't pulling weight. Every page must **stand
alone** — a reader landing cold needs a one-line setup, not a previous page.
**Convert** (move load off prose):
- A relationship or sequence → a **diagram** (mermaid renders natively;
richer diagrams follow the Excalidraw pipeline — see §7).
- Parallel options/fields/comparisons → a **table**.
- "you run X, which does Y" narration → an **annotated CLI snippet** (show
the command and its output, comment the interesting lines).
- Edge cases and deep mechanics → an `<Accordion>`, or a reference page.
Keep the 80% case on the page.
**Delete** (the load was fake): throat-clearing openers ("In this section
we'll…"), hedge chains ("generally / typically / in most cases"),
restatement, narrating an artifact a snippet already shows, and adjectives
standing in for evidence.
When you run a deliberate simplification pass, follow
[references/simplification.md](references/simplification.md) — the per-page
loop and the two guardrails that keep a trim honest: a **loss-check** (never
drop a fact that lives nowhere else) and a **fact-check** (trimmed prose must
not drift from the code).
## 6. Emphasis and formatting
- **Bold** *names a term*, on first mention only. *Italic* marks a property
or contrast. ~1–2 marks per paragraph; never re-emphasize a term already
introduced; never give one phrase both treatments.
- No body `# H1` — the frontmatter `title` is the H1. Use `##`/`###`.
- Links are root-relative and extensionless (`/getting-started/quickstart`).
Links out of the site (engdocs/, repo files) use full GitHub URLs.
- Mintlify parses `.md` as MDX: no HTML comments (`{/* … */}` instead), and
angle-bracket placeholders like `<id>` must stay inside backticks or code
fences.
- Mintlify components (`<Note>`, `<Tip>`, `<Warning>`, `<Accordion>`)
sparingly — they lose force with repetition.
## 7. Diagrams
Mermaid fences render natively — prefer them for graphs and flows. For richer
diagrams use the Excalidraw pipeline: author the `.excalidraw` source under
`docs/diagrams/excalidraw/`, render with `make diagrams-excalidraw` (source
and rendered `.svg` are both committed), embed as
`/diagrams/excalidraw-rendered/<name>.svg` with descriptive alt text, and
keep labels short (a two-line "Name / role" beats a sentence crammed in a
box). Two non-negotiables:
- **Rasterize and look at every rendered diagram** — text overflow and layout
problems are invisible in a text diff.
- **Diagrams and images cannot be reviewed in a diff.** Render them and get
the maintainer's approval before committing.
## 8. Generated content is edited at its source
Never hand-edit a generated file. The generated surfaces are:
- `docs/cli-reference/*.md` and the CLI Reference pages array inside
`docs/docs.json` — bd emits vendor-neutral pages (`bd help --docs-root`,
from the Cobra command strings in `cmd/bd/*.go`) into an uncommitted
staging tree, and `tools/docsmint` post-processes them into the committed
Mintlify form. bd itself never emits Mintlify (or any site-generator)
specifics; that lives in docsmint.
- `docs/CLI_REFERENCE.md` — the single-file reference, emitted directly by
`bd help --docs-root`.
To change wording in any of them, edit the Go source (`Short:`, `Long:`,
`Example:` strings) and run `./scripts/generate-cli-docs.sh` (which runs both
stages). To change the Mintlify page form itself (comment markers, link
style, nav), edit `tools/docsmint` and its tests. The drift gates
(`generate-cli-docs.sh --check`, `scripts/check-cli-docs-drift.sh` in PR CI,
and the docs-autofix bot) fail or auto-fix any hand edit.
**The docs describe the pinned release, not main.** `docs/cli-docs.pin`
names the release tag the whole docs corpus targets; the pipeline builds bd
from that tag and validates against it, so a Go-source edit on main shows up
in the committed docs only after the pin is bumped (at release time,
followed by a regeneration). Hand-written pages follow the same policy:
document what the pinned release does, never main-only features. See
`engdocs/decisions/2026-07-17-docs-release-pin.md`.
## 9. Verify before you call it done
Run the gates in [references/verification.md](references/verification.md).
The short list: `bazel test //test/docsync:docsync_test --config=ci`
(nav↔file sync + link conventions),
`./scripts/generate-cli-docs.sh --check` (generated docs fresh),
`./scripts/check-doc-freshness.sh` (Last reviewed markers), and a live
preview with `make docs-dev` (or `./mint.sh dev`) at `localhost:3000`.
When you **move or remove a page**: add a redirect to the `redirects` array
in `docs/docs.json`, rewrite inbound links repo-wide (README, engdocs/,
examples/, npm-package/, plugin resources — grep, don't guess), and check
whether `bd` prints the old path (if so, fix the Go source and regenerate —
never a pointer stub; decision 6 covers old routes with redirects).
## 10. Review and commit discipline
- **Author → the maintainer reviews → commit on explicit approval.** This
matters most for diagrams and images, which can't be reviewed in a text
diff.
- Group commits by audience: user docs (`docs/`) separate from contributor
docs (`engdocs/`, `AGENTS.md`) separate from generator/Go changes.
- Track docs work as bd issues per `AGENTS.md`.

View file

@ -1,85 +0,0 @@
# Running a simplification pass
Read this when you're trimming a page or a whole section — "simplify the
reference", "this page is a wall of text", "cut this down". SKILL.md §5–§7
define the *moves* (convert to a cheaper carrier, delete dead load, emphasis,
diagrams). This file is the *process*: how to run those moves across real
pages without dropping facts or drifting from the code.
## The goal
Remove **redundancy and unnecessary words**, and make the point *sharper*,
not thinner. **Word count is the output, not the target** — never trim toward
a number. The win is almost never deleting information; it's moving it to a
cheaper carrier (a table, an accordion, a diagram, or a link to the page that
already owns it) and deleting what was only restatement.
How much a page sheds depends entirely on how much *genuine redundancy* it
carries:
- A page that **restates what a sibling page owns** sheds a lot — replace the
restatement with one sentence plus a link to the owner (usually
`/core-concepts/index` for model material, `/cli-reference/<cmd>` for
command detail).
- A page whose length is **earned teaching** (worked examples plus the
behavior they illustrate) barely moves — forcing it toward a number guts
the teaching.
- A page that is **already lean** gets left alone entirely.
Accordions and tables fold content for scannability without deleting words —
don't measure that work by the word delta.
## The per-page loop
1. **Measure.** `wc -w <page>`; note the count.
2. **Find opportunities, by carrier:** dedup-by-link, prose→table,
prose→accordion, add/reuse a diagram, delete (throat-clearing, hedges,
restatement).
3. **Apply** the moves in the page's own voice. Never reflow prose you are
*not* simplifying — it buries the real change in the diff.
4. **Loss-check** (below).
5. **Fact-check** (below).
6. **Gates:** `bazel test //test/docsync:docsync_test --config=ci`, every
fence parses, no body H1, no HTML comments (MDX), preview with
`make docs-dev`.
7. **Preview, then commit on approval** — one page or section per batch, so
the reviewer can steer before a cut compounds across the section.
## Loss-check: simplification must not lose facts
Trimming is where real details quietly disappear. After a pass, diff the page
against its pre-trim version and walk the removed lines:
> For each removed block: is it an important **fact, command, flag, config
> key, caveat, behavior, or worked example** — and is it **preserved nowhere
> else** (`grep` across `docs/` to check for relocation)?
Separate removals honestly:
- **Intentional cuts** (leave them gone): terminology migration,
hedge/restatement deletion, content relocated to a better carrier (with a
redirect), deliberately-retired stale claims (pre-1.0 gating, removed
commands).
- **Genuine losses** (restore): a real detail dropped with no home elsewhere.
Restore a genuine loss as a **sharpened clause, not restored bulk** — fold
the missing *why* back into a sentence you kept rather than re-adding the
paragraph you cut.
## Fact-check: simplified prose drifts from code
Authoring and trimming both introduce drift — a stale version number, a
renamed flag surviving in prose, a rewritten sentence overstating the
implementation. Before pushing, verify every **checkable claim** on the
touched pages against the current code: CLI commands/subcommands/flags
(cheapest check: the generated `docs/cli-reference/` pages, which are correct
by construction), config keys and defaults (`internal/configfile/`,
`cmd/bd/config.go`), environment variables, file and directory paths
(embedded mode data lives at `.beads/embeddeddolt/`, server mode at
`.beads/dolt/`), issue types and dependency types, and numeric defaults.
Verify **adversarially**: try to prove each claim *false* against a
`file:line`, defaulting to "unverified" rather than "fine". In practice a
verification pass catches several real errors per rewrite. Generated
reference pages are exempt — they are correct by regeneration, and
fact-checking them against their own source is circular.

View file

@ -1,53 +0,0 @@
# Renaming a concept across the docs
When the project's word for something changes, the rule is: **rename the
concept in prose; preserve every literal that reflects the actual program.**
The code and its output are the source of truth — if the docs rename a string
the binary still prints, the docs now lie.
## The discipline
1. **Survey first.** Count occurrences in `docs/`, `engdocs/`, `README.md`,
every `AGENTS.md` (root and nested), and `*.go`. Read enough to tell
*prose* (the concept) from *literals*.
2. **Rename prose only**, with judgment per occurrence — fix articles and
grammar so it reads naturally.
3. **Preserve literals:**
- Real program output inside a code fence. Verify against `cmd/bd/` and
`internal/` source; if the binary prints it, the doc must match.
- Command and subcommand names (`bd mol`, `bd dep`), flags, JSON field
names, config keys (`.beads/config.yaml`), label names (a proto's
`template` label), issue types, file paths, and any backticked
identifier.
- A *different* thing with the same word (a "task" issue type vs a task in
prose; Dolt's own "branch" vs a git branch).
- **Generated files** (`docs/cli-reference/*`, `docs/CLI_REFERENCE.md`,
the CLI pages array in `docs/docs.json`, `website/docs/cli-reference/`):
never hand-edit. If the term must change there, change the Cobra strings
in `cmd/bd/*.go` and run `./scripts/generate-cli-docs.sh`.
4. **Don't touch the code or `engdocs/` implementation names** as part of a
docs rename unless explicitly asked. Renaming the binary's output strings
is a separate Go PR (with regenerated CLI docs), worth flagging as a
follow-up so output and docs align.
5. **Watch for collateral words.** A word-boundary match for `gate` must not
touch "delegate" or "aggregate"; a `mol` rename must not mangle
"molecule".
6. **Verify after:** every remaining occurrence in `docs/` (outside generated
files) should be a justified literal — audit them explicitly, classify
each as "literal (correct)" or "missed prose (fix)".
## Settled literal notes (as of the Mintlify port)
- `mol` — command literal only (`bd mol pour`, `bd ready --mol`); the concept
in prose is always **molecule**.
- `template` — the label literal protos carry; the concept is **proto**.
- `issue` vs `bead` — both are sanctioned; CLI output and flags say issue, so
prose mirroring the CLI keeps issue. Don't "fix" one into the other
mechanically.
- `.beads/issues.jsonl` — always described as a passive export. Never call it
the database, the sync protocol, or a backup.
- Paths `bd` prints (`docs/RECOVERY.md`, `docs/SETUP.md`, …) — never
recreate pointer stubs at old paths; moved pages are covered by the
`redirects` array in `docs/docs.json` (decision 6 of
`engdocs/decisions/2026-07-10-mintlify-docs-overhaul.md`). If bd prints an
old path, fix the Go source so it prints the new one and regenerate.

View file

@ -1,71 +0,0 @@
# Verification gates
Run these before considering docs work complete. Ordered cheapest-first.
## Durable repo gates (committed — always available)
```bash
# 1. Docs sync: docs.json nav <-> file consistency, link conventions
# (root-relative extensionless in docs/, exact paths in engdocs/ and
# curated root files), orphan detection (only CLI_REFERENCE.md is exempt).
bazel test //test/docsync:docsync_test --config=ci
# 2. Generated CLI docs freshness: regenerates from the live command tree
# and diffs docs/CLI_REFERENCE.md, docs/cli-reference/, and the CLI
# pages array in docs/docs.json (bd emits generic pages to staging;
# tools/docsmint produces the committed Mintlify form).
./scripts/generate-cli-docs.sh --check
# CI's blame-scoped variant (only fails PRs for drift they introduced):
./scripts/check-cli-docs-drift.sh
# 3. Doc flags + freshness markers: stale flag/command references and the
# `Last reviewed:` / `Freshness source:` markers on reference docs.
# (make check-docs runs 1 + 3 together.)
./scripts/check-doc-flags.sh ./bd
./scripts/check-doc-freshness.sh
# 4. Live preview while editing.
make docs-dev # or: ./mint.sh dev -> http://localhost:3000
# 5. Broken links the way CI checks them (baseline-aware on PRs via
# .github/workflows/docs-mintlify.yml):
./mint.sh broken-links
```
## Principles the gates don't fully cover
- **Every code fence must be real.** A `bash` fence should show a command the
current `bd` accepts (check the generated CLI reference); TOML fences for
formulas must parse.
- **MDX validity**: no HTML comments (`{/* … */}` instead), no bare
angle-bracket placeholders outside backticks, balanced Mintlify components.
- **No body `# H1`** — frontmatter `title` is the H1. (Beware false
positives: `#` comments inside code fences are not H1s.)
- **Freshness markers**: pages carrying `Last reviewed:` / `Freshness
source:` lines (configuration, ide-setup, azure-devops, json-schema,
init-safety runbooks) must keep them intact and current when edited —
`scripts/check-doc-freshness.sh` enforces format, age, and that the named
source paths exist.
## Moving or removing a page
Removing or merging a page breaks inbound links and external bookmarks. Do
all of:
1. **Redirect** — add an entry to the `redirects` array in `docs/docs.json`
from the old route to the new one.
2. **Rewrite inbound links** — grep the whole repo, not just `docs/`:
README.md, every AGENTS.md (root and nested), engdocs/, examples/,
npm-package/, plugins/, integrations/, scripts, and Go comments.
3. **Check bd's printed output** — if `bd` prints the old path (grep `cmd/`
and `internal/templates/` for it), fix the Go source to print the new
path and regenerate the CLI docs. Do **not** create a pointer stub at the
old path — decision 6 (no pointer stubs; Mintlify redirects) accepts that
old GitHub links printed by already-released binaries 404.
4. **Fix anchor text** — if a link's label named the old page, update the
label too, and dedupe links that now collapse to the same target.
## Review rule for images
Diagrams and images cannot be reviewed in a text diff. Render them (rasterize
SVGs), look at them, and get the maintainer's approval before committing.

View file

@ -0,0 +1,71 @@
---
name: handoff
description: >
Hand off to a fresh Claude session. Use when context is full, you've finished
a logical chunk of work, or need a fresh perspective. Work continues from hook.
allowed-tools: "Bash(gt handoff:*),Bash(gt mail send:*)"
version: "1.0.0"
author: "Gas Town"
---
# Handoff - Session Cycling for Gas Town Agents
Hand off your current session to a fresh Claude instance while preserving work context.
## When to Use
- Context getting full (approaching token limit)
- Finished a logical chunk of work
- Need a fresh perspective on a problem
- Human requests session cycling
## Usage
```
/handoff [optional message]
```
## How It Works
1. If you provide a message, it's sent as handoff mail to yourself
2. `gt handoff` respawns your session with a fresh Claude
3. New session auto-primes via SessionStart hook
4. Work continues from your hook (pinned molecule persists)
## Examples
```bash
# Simple handoff (molecule persists, fresh context)
/handoff
# Handoff with context notes
/handoff "Found the bug in token refresh - check line 145 in auth.go first"
```
## What Persists
- **Hooked molecule**: Your work assignment stays on your hook
- **Beads state**: All issues, dependencies, progress
- **Git state**: Commits, branches, staged changes
## What Resets
- **Conversation context**: Fresh Claude instance
- **TodoWrite items**: Ephemeral, session-scoped
- **In-memory state**: Any uncommitted analysis
## Implementation
When invoked, execute:
1. If user provided a message, send handoff mail:
```bash
gt mail send <your-address> -s "HANDOFF: Session cycling" -m "<message>"
```
2. Run the handoff command:
```bash
gt handoff
```
The new session will find your handoff mail and hooked work automatically.

103
.claude/test-strategy.md Normal file
View file

@ -0,0 +1,103 @@
# Test Running Strategy for Claude Code
## Critical Rules
1. **ALWAYS use `./scripts/test.sh` instead of `go test` directly**
- It automatically skips broken tests from `.test-skip`
- Uses appropriate timeouts (3m default)
- Consistent with human developers and CI/CD
2. **Use `-run` to target specific tests when developing features**
```bash
# Good: When working on feature X
./scripts/test.sh -run TestFeatureX ./cmd/bd/...
# Avoid: Running full suite unnecessarily
./scripts/test.sh ./...
```
3. **Understand the bottleneck: COMPILATION not EXECUTION**
- 180s compilation time vs 3.8s actual test execution (cmd/bd)
- Running subset of tests doesn't save much time (still recompiles)
- But use `-run` anyway to avoid seeing unrelated failures
## Common Commands
```bash
# Full test suite (what 'make test' runs)
./scripts/test.sh
# Test specific package
./scripts/test.sh ./cmd/bd/...
./scripts/test.sh ./internal/storage/sqlite/...
# Test specific feature
./scripts/test.sh -run TestCreate ./cmd/bd/...
./scripts/test.sh -run TestImport
# Verbose output (when debugging)
./scripts/test.sh -v -run TestSpecificTest
```
## When Tests Fail
1. **Check if it's a known broken test:**
```bash
cat .test-skip
```
2. **If it's new, investigate:**
- Read the test failure message
- Run with `-v` for more detail
- Check if recent code changes broke it
3. **If unfixable now:**
- File GitHub issue with details
- Add to `.test-skip` with issue reference
- Document in commit message
## Package Size Context
The `cmd/bd` package is LARGE:
- 41,696 lines of code
- 205 files (82 test files)
- 313 individual tests
- Compilation takes ~180 seconds
This is why:
- Compilation is slow
- Test script uses 3-minute timeout
- Targeting specific tests is important
## Environment Variables
Use these when needed:
```bash
# Custom timeout
TEST_TIMEOUT=5m ./scripts/test.sh
# Verbose by default
TEST_VERBOSE=1 ./scripts/test.sh
# Run pattern
TEST_RUN=TestSomething ./scripts/test.sh
```
## Quick Reference
| Task | Command |
|------|---------|
| Run all tests | `make test` or `./scripts/test.sh` |
| Test one package | `./scripts/test.sh ./cmd/bd/...` |
| Test one function | `./scripts/test.sh -run TestName` |
| Verbose output | `./scripts/test.sh -v` |
| Custom timeout | `./scripts/test.sh -timeout 10m` |
| Skip additional test | `./scripts/test.sh -skip TestFoo` |
## Remember
- The test script is in `.gitignore` path: `scripts/test.sh`
- Skip list is in repo root: `.test-skip`
- Full documentation: `docs/TESTING.md`
- Current broken tests: See GH issues #355, #356

View file

@ -74,5 +74,5 @@ git config --global user.email "your.email@example.com"
## Related Issues
- GitHub Issue [#229](https://github.com/gastownhall/beads/issues/229): Git hooks not available in devcontainers
- GitHub Issue [#229](https://github.com/steveyegge/beads/issues/229): Git hooks not available in devcontainers
- bd-ry1u: Publish official devcontainer configuration

View file

@ -1,6 +1,6 @@
{
"name": "beads Development Container",
"image": "mcr.microsoft.com/devcontainers/go:2-1.24-bookworm",
"image": "mcr.microsoft.com/devcontainers/go:1-1.24-bookworm",
"features": {
"ghcr.io/devcontainers/features/git:1": {

View file

@ -1,30 +1,6 @@
#!/bin/bash
set -e
# Persist -tags=gms_pure_go in the go env config file (`go env -w`), so a
# bare `go build`/`go test` run later from a shell that never sourced
# .buildflags still picks up the tag (see engdocs/ICU-POLICY.md and
# `make doctor-build`). Read the persisted value here, before sourcing
# .buildflags below, since that export would otherwise shadow the on-disk
# go env value for the rest of this script.
echo "⚙️ Persisting -tags=gms_pure_go in go env..."
PERSISTED_GOFLAGS="$(go env GOFLAGS)"
if [[ "$PERSISTED_GOFLAGS" != *gms_pure_go* ]]; then
if [[ "$PERSISTED_GOFLAGS" == *-tags=* ]]; then
# Merge into the existing -tags value instead of appending a second
# -tags flag: Go does not merge repeated -tags flags, so a second one
# would silently replace the first and disable the existing tags.
PERSISTED_GOFLAGS="$(printf '%s' "$PERSISTED_GOFLAGS" | sed -E 's/-tags=([^[:space:]]*)/-tags=\1,gms_pure_go/')"
else
PERSISTED_GOFLAGS="${PERSISTED_GOFLAGS:+$PERSISTED_GOFLAGS }-tags=gms_pure_go"
fi
go env -w GOFLAGS="$PERSISTED_GOFLAGS"
fi
# Canonical build flags (GOFLAGS=-tags=gms_pure_go, CGO_ENABLED=1).
# shellcheck source=../.buildflags
source "$(dirname "$0")/../.buildflags"
echo "🔧 Building bd from source..."
go build -o bd ./cmd/bd

9
.gitattributes vendored
View file

@ -1,8 +1 @@
# Keep repository text deterministic on every host. The global rule makes future
# text formats opt in automatically and protects LF-sensitive hook templates,
# embedded Markdown bytes, migration content hashes, and generated-doc byte
# comparisons without requiring workstation Git configuration.
* text=auto eol=lf
# Tracked binary assets must never pass through text conversion or text diffs.
*.jpg binary
.beads/issues.jsonl merge=beads

View file

@ -1,59 +0,0 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.3.0 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
case "$_bd_timeout" in
*[!0-9]*|'') _bd_timeout_invalid=1 ;;
*[1-9]*) _bd_timeout_invalid=0 ;;
*) _bd_timeout_invalid=1 ;;
esac
if [ "$_bd_timeout_invalid" -eq 1 ]; then
echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds"
_bd_timeout=300
fi
_bd_timeout_backend=none
_bd_timeout_command=
for _bd_timeout_candidate in timeout gtimeout; do
if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then
if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then
case "$_bd_timeout_version" in
"timeout (GNU coreutils) "*|"timeout (uutils coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
done
if [ -n "$_bd_timeout_command" ]; then
_bd_timeout_backend=coreutils
if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run post-checkout "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
elif command -v perl >/dev/null 2>&1; then
_bd_timeout_backend=perl
if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run post-checkout "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
else
echo >&2 "beads: hook 'post-checkout' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
if bd hooks run post-checkout "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
fi
if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then
echo >&2 "beads: hook 'post-checkout' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ "$_bd_exit" -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'post-checkout'"
_bd_exit=0
fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.3.0 ---

View file

@ -1,59 +0,0 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.3.0 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
case "$_bd_timeout" in
*[!0-9]*|'') _bd_timeout_invalid=1 ;;
*[1-9]*) _bd_timeout_invalid=0 ;;
*) _bd_timeout_invalid=1 ;;
esac
if [ "$_bd_timeout_invalid" -eq 1 ]; then
echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds"
_bd_timeout=300
fi
_bd_timeout_backend=none
_bd_timeout_command=
for _bd_timeout_candidate in timeout gtimeout; do
if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then
if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then
case "$_bd_timeout_version" in
"timeout (GNU coreutils) "*|"timeout (uutils coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
done
if [ -n "$_bd_timeout_command" ]; then
_bd_timeout_backend=coreutils
if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run post-merge "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
elif command -v perl >/dev/null 2>&1; then
_bd_timeout_backend=perl
if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run post-merge "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
else
echo >&2 "beads: hook 'post-merge' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
if bd hooks run post-merge "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
fi
if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then
echo >&2 "beads: hook 'post-merge' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ "$_bd_exit" -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'post-merge'"
_bd_exit=0
fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.3.0 ---

View file

@ -1,86 +0,0 @@
#!/usr/bin/env bash
# Pre-commit hook: auto-format with gofmt, then lint and vet with nogo.
# Installed via: git config core.hooksPath .githooks
# See also: make install (sets hooksPath automatically)
set -euo pipefail
# Only check staged Go files (Added, Copied, Modified). No early exit here:
# the beads section at the bottom must run for non-Go commits too.
staged_go_files=$(git diff --cached --name-only --diff-filter=ACM -- '*.go')
if [ -n "$staged_go_files" ]; then
# Auto-format and re-stage, through the go.mod-pinned gofmt. A bare PATH
# gofmt belongs to the host toolchain, and on a host newer than the go
# directive it rewrites and re-stages files into a form CI's gofmt rejects
# -- silently, on every Go commit. See scripts/ci/gofmt-bin.sh.
gofmt_bin="$(./scripts/ci/gofmt-bin.sh)"
echo "$staged_go_files" | xargs "$gofmt_bin" -w
echo "$staged_go_files" | xargs git add
# Lint and vet: nogo (//tools/nogo) over the staged files' Bazel packages,
# the analyzers bazel.yml gates on (go test's vet checks plus the
# golangci-lint linters .golangci.yml enables). Findings fail the commit;
# nogo prints a `patch -p1` command for the ones with suggested fixes.
# Needs bazel (or bazelisk) on PATH; the windows/darwin passes run in CI
# and in `make lint`.
make lint-changed LINT_CHANGED_SCOPE=staged || exit 1
fi
# --- BEGIN BEADS INTEGRATION v1.3.0 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
case "$_bd_timeout" in
*[!0-9]*|'') _bd_timeout_invalid=1 ;;
*[1-9]*) _bd_timeout_invalid=0 ;;
*) _bd_timeout_invalid=1 ;;
esac
if [ "$_bd_timeout_invalid" -eq 1 ]; then
echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds"
_bd_timeout=300
fi
_bd_timeout_backend=none
_bd_timeout_command=
for _bd_timeout_candidate in timeout gtimeout; do
if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then
if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then
case "$_bd_timeout_version" in
"timeout (GNU coreutils) "*|"timeout (uutils coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
done
if [ -n "$_bd_timeout_command" ]; then
_bd_timeout_backend=coreutils
if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run pre-commit "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
elif command -v perl >/dev/null 2>&1; then
_bd_timeout_backend=perl
if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run pre-commit "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
else
echo >&2 "beads: hook 'pre-commit' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
if bd hooks run pre-commit "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
fi
if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then
echo >&2 "beads: hook 'pre-commit' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ "$_bd_exit" -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'pre-commit'"
_bd_exit=0
fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.3.0 ---

View file

@ -1,152 +0,0 @@
#!/usr/bin/env bash
# Pre-push hook: run the Bazel test suite for branch pushes that change Go or
# Bazel inputs (scripts/pre-push-suite.sh), and when pushing a release tag
# (refs/tags/v*), refuse the push if version constants disagree. The version
# check stops a release from being tagged/published with drifted versions (the
# failure mode that left main red after the 1.0.5 release) before it ever
# reaches CI.
#
# Installed via: git config core.hooksPath .githooks
# See also: make install (sets hooksPath automatically)
#
# Bypass (not recommended for release tags): git push --no-verify
set -euo pipefail
# git feeds "<local ref> <local sha> <remote ref> <remote sha>" lines on stdin.
# Capture it so the chained beads hook at the bottom still sees the ref list.
push_refs="$(cat)"
pushing_version_tag=0
while read -r local_ref _local_sha _remote_ref _remote_sha; do
case "$local_ref" in
refs/tags/v[0-9]*) pushing_version_tag=1 ;;
esac
done <<< "$push_refs"
if [ "$pushing_version_tag" -eq 1 ]; then
repo_root="$(git rev-parse --show-toplevel)"
# Skip on older checkouts without the consistency check; do not block.
if [ -x "$repo_root/scripts/check-versions.sh" ]; then
while read -r local_ref _local_sha _remote_ref _remote_sha; do
case "$local_ref" in
refs/tags/v[0-9]*)
tag_version="${local_ref#refs/tags/v}"
echo "Release tag v$tag_version push detected — verifying version consistency..."
checker_status=0
(cd "$repo_root" && ./scripts/check-versions.sh --expect "$tag_version") || checker_status=$?
if [ "$checker_status" -ne 0 ]; then
echo ""
if [ "$checker_status" -eq 1 ]; then
echo "❌ Refusing to push release tag v$tag_version: versions are inconsistent." >&2
echo " See the checker output above for what is inconsistent and how to fix it." >&2
elif [ "$checker_status" -eq 3 ]; then
echo "❌ Refusing to push release tag v$tag_version: the tag does not match this checkout's release version." >&2
echo " The release surfaces agree with each other, so do NOT re-run update-versions.sh." >&2
echo " Push only the tag matching this checkout (see CONTRIBUTING.md)." >&2
else
echo "❌ Refusing to push release tag v$tag_version: version checker unavailable or failed (exit $checker_status)." >&2
echo " Check the Go toolchain and checker diagnostics above." >&2
fi
echo " Override with --no-verify only if you know what you are doing." >&2
exit 1
fi
;;
esac
done <<< "$push_refs"
fi
fi
# The push-time test suite (scripts/pre-push-suite.sh): bazel.yml's test lane,
# `bazel test //... --config=ci`, for branch pushes whose new commits change
# Go or Bazel inputs. A tag push, a deletion, or a docs-only push skips it.
# BD_PREPUSH_SUITE=go runs plain go test instead, under a banner.
#
# The decision keys on the remote ref and the shas, never on the local ref's
# shape: for `git push origin HEAD` and `HEAD:refs/heads/x` git passes the
# literal local ref `HEAD`, which a `refs/heads/*` match would skip (#7351).
zero_sha=0000000000000000000000000000000000000000
suite_needed=0
while read -r _local_ref local_sha remote_ref remote_sha; do
case "$remote_ref" in
refs/tags/*) continue ;;
esac
if [ "$local_sha" = "$zero_sha" ] || ! git cat-file -e "$local_sha^{commit}" 2>/dev/null; then
continue
fi
base="$remote_sha"
if [ "$base" = "$zero_sha" ] || ! git cat-file -e "$base^{commit}" 2>/dev/null; then
# A new remote branch: compare against main's merge-base.
base="$(git merge-base "$local_sha" origin/main 2>/dev/null || true)"
fi
if [ -z "$base" ] || git diff --name-only "$base" "$local_sha" -- \
'*.go' 'go.mod' 'go.sum' '*.bazel' '*.bzl' '.bazelrc' '.bazelversion' 'MODULE.bazel.lock' | grep -q .; then
suite_needed=1
fi
done <<< "$push_refs"
if [ "$suite_needed" -eq 1 ]; then
repo_root="$(git rev-parse --show-toplevel)"
"$repo_root/scripts/pre-push-suite.sh" </dev/null
fi
exec < <(printf '%s\n' "$push_refs")
# --- BEGIN BEADS INTEGRATION v1.3.0 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
case "$_bd_timeout" in
*[!0-9]*|'') _bd_timeout_invalid=1 ;;
*[1-9]*) _bd_timeout_invalid=0 ;;
*) _bd_timeout_invalid=1 ;;
esac
if [ "$_bd_timeout_invalid" -eq 1 ]; then
echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds"
_bd_timeout=300
fi
_bd_timeout_backend=none
_bd_timeout_command=
for _bd_timeout_candidate in timeout gtimeout; do
if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then
if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then
case "$_bd_timeout_version" in
"timeout (GNU coreutils) "*|"timeout (uutils coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
done
if [ -n "$_bd_timeout_command" ]; then
_bd_timeout_backend=coreutils
if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run pre-push "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
elif command -v perl >/dev/null 2>&1; then
_bd_timeout_backend=perl
if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run pre-push "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
else
echo >&2 "beads: hook 'pre-push' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
if bd hooks run pre-push "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
fi
if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then
echo >&2 "beads: hook 'pre-push' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ "$_bd_exit" -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'pre-push'"
_bd_exit=0
fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.3.0 ---

View file

@ -1,59 +0,0 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.3.0 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
case "$_bd_timeout" in
*[!0-9]*|'') _bd_timeout_invalid=1 ;;
*[1-9]*) _bd_timeout_invalid=0 ;;
*) _bd_timeout_invalid=1 ;;
esac
if [ "$_bd_timeout_invalid" -eq 1 ]; then
echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds"
_bd_timeout=300
fi
_bd_timeout_backend=none
_bd_timeout_command=
for _bd_timeout_candidate in timeout gtimeout; do
if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then
if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then
case "$_bd_timeout_version" in
"timeout (GNU coreutils) "*|"timeout (uutils coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
done
if [ -n "$_bd_timeout_command" ]; then
_bd_timeout_backend=coreutils
if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run prepare-commit-msg "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
elif command -v perl >/dev/null 2>&1; then
_bd_timeout_backend=perl
if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run prepare-commit-msg "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
else
echo >&2 "beads: hook 'prepare-commit-msg' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
if bd hooks run prepare-commit-msg "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
fi
if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then
echo >&2 "beads: hook 'prepare-commit-msg' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ "$_bd_exit" -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'prepare-commit-msg'"
_bd_exit=0
fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.3.0 ---

26
.github/CODEOWNERS vendored
View file

@ -1,26 +0,0 @@
# CODEOWNERS — review ownership
#
# Changes under cmd/bd/init*.go interact with init-safety invariants
# documented in engdocs/adr/0002-init-safety-invariants.md. Reviewers MUST
# confirm new flags / data sources extend CheckRemoteSafety's guard
# matrix (cmd/bd/init_safety_test.go) before approving. Silent guard
# accretion is how we ended up with 8+ paper-over commits before ADR 0002
# — the matrix + review gate is the structural hedge.
# Init-safety critical path
cmd/bd/init.go @gastownhall/beads-maintainers
cmd/bd/init_*.go @gastownhall/beads-maintainers
cmd/bd/init_safety*.go @gastownhall/beads-maintainers
engdocs/adr/0002-init-safety-invariants.md @gastownhall/beads-maintainers
# Schema-migration critical path (bd-6dnrw.15). The 2026 Apr-Jun window
# shipped a corrupting migration (PR 4039, DEFAULT (UUID()) PK, zero reviews,
# self-merged), a duplicate version number (PR 4027), and in-place edits to
# released migrations (PRs 3991/3918/3942). Migration changes get at least
# one human maintainer review; scripts/check-migration-hygiene.sh enforces
# the mechanical invariants in CI, and reviewers should treat allowlist
# additions and hygiene-script changes with the same suspicion as the
# migrations themselves. NOTE: GitHub only enforces CODEOWNERS when branch
# protection has "require review from Code Owners" enabled (bd-6dnrw.23).
internal/storage/schema/migrations/ @gastownhall/beads-maintainers
scripts/check-migration-hygiene.sh @gastownhall/beads-maintainers

View file

@ -1,94 +0,0 @@
name: Bug report
description: Report broken behavior in bd.
title: "bug: "
body:
- type: markdown
attributes:
value: |
Thanks for the report. This issue is the record a fix PR links to, so the more evidence here, the better. You can open a fix PR right away; no approval is needed first.
**Agents filling in this form:** answer each question only from evidence you have. If you cannot answer a question from the evidence, write exactly `NOT_ENOUGH_INFO` instead of guessing.
- type: checkboxes
id: checks
attributes:
label: Before you continue
options:
- label: I searched existing issues and did not find a duplicate.
required: true
- label: I reproduced this with stock `bd`, without an orchestrator or agent framework in the loop.
required: false
- type: textarea
id: summary
attributes:
label: Summary
description: What is broken, in one or two sentences.
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce
description: Exact commands, starting from a fresh directory where possible.
render: shell
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual behavior
description: Include the full error output.
validations:
required: true
- type: input
id: version
attributes:
label: bd version
description: Output of `bd version`.
validations:
required: true
- type: dropdown
id: mode
attributes:
label: Storage mode
options:
- Embedded (default `bd init`)
- Server mode (`bd init --server`)
- Proxied server
- Not sure
validations:
required: true
- type: input
id: os
attributes:
label: Operating system
placeholder: "macOS 15.5 (arm64), Ubuntu 24.04, Windows 11, ..."
validations:
required: true
- type: textarea
id: impact
attributes:
label: Impact
description: Who is affected, how severe it is (data loss, blocked, workaround exists), and how often it happens.
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional context
description: Logs, `bd doctor` output, root-cause notes, or a proposed fix.

View file

@ -1,11 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Documentation
url: https://beads.gascity.com/
about: Installation, concepts, CLI reference, and troubleshooting.
- name: Questions and ideas
url: https://github.com/gastownhall/beads/discussions
about: Ask usage questions or float an idea before it is ready to be an issue.
- name: Security vulnerability
url: https://github.com/gastownhall/beads/security/policy
about: Report security issues privately, never in a public issue.

View file

@ -1,108 +0,0 @@
name: Feature request
description: Propose a change to bd, with the information needed to accept it.
title: "feat: "
body:
- type: markdown
attributes:
value: |
This form collects the context reviewers and future readers need for a change worth discussing. You can open your PR right after filing; no approval is needed first. Small, self-explanatory changes can skip the issue and go straight to a PR. Read the [project charter](https://github.com/gastownhall/beads/blob/main/engdocs/PROJECT_CHARTER.md) first — beads owns issue-tracking primitives, not orchestration policy or storage-engine behavior.
**Agents filling in this form:** answer each question only from evidence you have. If you cannot answer a question from the evidence, write exactly `NOT_ENOUGH_INFO` instead of guessing.
- type: checkboxes
id: checks
attributes:
label: Before you continue
options:
- label: I searched existing issues and pull requests and did not find a duplicate.
required: true
- type: textarea
id: motivation
attributes:
label: Motivation
description: The problem, and who has it. Describe the pain, not the implementation you prefer.
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed change
description: The behavior, command, flag, or API you want.
validations:
required: true
- type: textarea
id: impact
attributes:
label: Impact
description: Who is affected and how — users, agents, integrations, downstream consumers of the `--json` output.
validations:
required: true
- type: textarea
id: risk
attributes:
label: Risk and compatibility
description: Schema or migration changes, wire or `--json` output changes, behavior changes for existing workspaces, and how to roll back.
validations:
required: true
- type: textarea
id: verification
attributes:
label: Verification plan
description: How we will know it works end to end, beyond unit tests.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Current workarounds, issue metadata, an integration or plugin, or other designs.
- type: dropdown
id: size
attributes:
label: Estimated size
options:
- XS (under 50 lines)
- S (under 200 lines)
- M (under 500 lines)
- L (under 1,000 lines)
- XL (more than 1,000 lines; likely needs splitting)
- Not sure
validations:
required: true
- type: dropdown
id: intent
attributes:
label: Intent
options:
- I am opening or will open a PR
- I'm reporting the need; someone else would implement it
validations:
required: true
- type: dropdown
id: ai
attributes:
label: AI assistance
description: Was an AI agent used to draft this issue?
options:
- "No"
- Yes, partly
- Yes, mostly
validations:
required: true
- type: checkboxes
id: accountability
attributes:
label: Accountability
options:
- label: A human has read this issue and stands behind it.
required: true

View file

@ -1,24 +0,0 @@
<!--
Link an issue when there is one (`Closes #123`); it is recommended for
user-visible bugs and changes worth discussing, and optional for small,
self-explanatory fixes. Either way, say why the change is needed below. See
CONTRIBUTING.md#issues-and-pull-requests.
-->
Closes #
## What changed
<!-- One or two plain-language sentences. -->
## Evidence it works
<!-- Commands a reviewer can run and what they show, end to end.
"Unit tests pass" alone is not evidence. -->
## Checklist
- [ ] The why is documented: in a linked issue (reproduction or motivation, impact, risk) or in this description.
- [ ] `make test` (the Bazel test lane, nogo lint included) and any other lane `engdocs/TESTING.md` selects pass locally.
- [ ] User-facing behavior changes are reflected in `docs/` or the generated CLI reference.
- [ ] If an invariant or rule changed, the owning `AGENTS.md` is updated.

View file

@ -1,158 +0,0 @@
name: setup-bazel
description: >
Install a sha256-pinned Bazelisk, have it download the sha256-pinned Bazel
release .bazelversion names (never from the runner cache), restore the
runner Bazel cache (--repository_cache only, whose entries Bazel re-hashes
on use),
and write a CI bazelrc outside the workspace. When the caller passes all of
BAZEL_REMOTE_EXECUTOR, RBE_TLS_CERT and RBE_TLS_KEY in the step env, that rc
enables --config=remote-exec for every bazel command; with none of them the
job runs locally; with BAZEL_FORK_CACHE=true (and no secrets) it enables
the read-only fork cache (--config=fork-cache), and with BAZEL_RRC_READ=true
too (the remote repo contents cache readers) Bazel's remote repo contents
cache through rbe-cache while it answers; with BAZEL_FORK_REMOTE=true
(fork and Dependabot PRs, bazel.yml modes fork-ro/fork-rw; needs
RBE_FORK_PR and RBE_FORK_TIER) it gets a short-lived certificate from
rbe-fork-mint (fork-credential.sh, proving the run with a CSR artifact) and
enables remote execution on rbe-fork; a partial set, or two of these
together, fails. `bazel` on PATH is a wrapper that always passes the
generated rc.
outputs:
remote:
description: '"true" when remote execution is configured'
value: ${{ steps.rc.outputs.remote }}
cache:
description: '"true" when the read-only fork cache (rbe-cache) is configured'
value: ${{ steps.rc.outputs.cache }}
cache-restored:
description: '"true" when a runner Bazel cache was restored (any prefix match)'
value: ${{ steps.restore.outputs.cache-matched-key != '' }}
cache-hit:
description: '"true" when the cache for this .bazelversion and MODULE.bazel.lock was restored exactly'
value: ${{ steps.restore.outputs.cache-hit }}
runs:
using: composite
steps:
# Keyed on what determines its content; saved only by a push to main that
# missed the exact key (see the caller's "Save Bazel runner cache" step).
# A lock change restores the previous lock's entry, which still holds most
# of the downloads. It holds only the content-addressable repository cache,
# which Bazel checks against each download's sha256 on every hit; the
# unverified repo contents cache is off (write-bazelrc.sh) and the Bazel
# binary is not cached, so a poisoned entry (a cache written by an
# untrusted run) cannot change what executes. v3: v2 also held Bazelisk's
# download and the contents cache. v4: MODULE.bazel joins the key because
# the lock does not record non-registry repository rules (llvm_dist), so
# v3 kept restoring the 1.94 GB LLVM .tar.xz after the switch to the
# 149 MB slice.
- name: Restore Bazel runner cache
id: restore
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ runner.temp }}/bazel-ci-cache
key: bazel-repo-v4-${{ runner.os }}-${{ hashFiles('.bazelversion', 'MODULE.bazel', 'MODULE.bazel.lock') }}
restore-keys: |
bazel-repo-v4-${{ runner.os }}-
- name: Install Bazelisk
shell: bash
run: |
set -euo pipefail
version=v1.29.0
case "$(uname -m)" in
x86_64) arch=amd64; sha=5a408715e932c0250d28bd84555f12edbf70117de42f9181691c736eacc4a992 ;;
aarch64 | arm64) arch=arm64; sha=e20e8b0f4f240091b7a55bf17b9398bd4f40ee70ae0208dff95dd4c445fb4010 ;;
*) echo "setup-bazel: unsupported arch $(uname -m)" >&2; exit 1 ;;
esac
curl -fsSL --retry 3 --max-time 120 -o "$RUNNER_TEMP/bazelisk" \
"https://github.com/bazelbuild/bazelisk/releases/download/${version}/bazelisk-linux-${arch}"
echo "${sha} $RUNNER_TEMP/bazelisk" | sha256sum -c -
sudo install -m 755 "$RUNNER_TEMP/bazelisk" /usr/local/bin/bazelisk
rm -f "$RUNNER_TEMP/bazelisk"
# The Bazel release .bazelversion names, pinned like Bazelisk above
# (the release's bazel-<v>-linux-<arch>.sha256). Bazelisk verifies
# only fresh downloads, so its home is a fresh directory outside the
# runner cache: every job downloads and verifies Bazel. A .bazelversion
# bump adds its pair here (policy-tested).
bazel_version="$(tr -d '[:space:]' < .bazelversion)"
case "$bazel_version/$arch" in
9.2.0/amd64) bazel_sha=7668a95db1250f12c40407251e4e203b4ec8bf39bc495d2f485b2d8c99048694 ;;
9.2.0/arm64) bazel_sha=049dd21f40ad979db11c3ee68c96a42ce75f1185e69ac61ab20de1501427a410 ;;
9.3.0/amd64) bazel_sha=d302d22ed77ee5658b87857249baa579db84300ecebe0a1e9a357b5b20f80eb8 ;;
9.3.0/arm64) bazel_sha=615cc2509819047e4930fe6643c5f01ebd705ccadf75e8f0b85f9b83cc6a6ca0 ;;
*) echo "setup-bazel: no pinned sha256 for Bazel '$bazel_version' ($arch); add it from the release's .sha256 file" >&2; exit 1 ;;
esac
{
echo "BAZELISK_HOME=$RUNNER_TEMP/bazelisk-home"
echo "BAZELISK_VERIFY_SHA256=$bazel_sha"
echo "BAZEL_CI_BAZEL_SHA256=$bazel_sha"
} >> "$GITHUB_ENV"
# Fork and Dependabot runs (no secrets, no OIDC): a key and a CSR, the CSR
# as an artifact of this run (the mint's proof that the request comes
# from a running job of it), then the certificate. The key stays in the
# secret dir; the CSR and the certificate are public.
# fork-credential.sh key does nothing (no outputs) unless the caller set
# BAZEL_FORK_REMOTE=true; the next two steps follow its csr output.
- name: rbe-fork key and CSR
id: fork-key
shell: bash
env:
BAZEL_CI_SECRET_DIR: ${{ runner.temp }}/bazel-ci-secret
run: bash "$GITHUB_ACTION_PATH/fork-credential.sh" key
- name: rbe-fork CSR artifact (proof of this run)
id: fork-csr
if: steps.fork-key.outputs.csr != ''
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ steps.fork-key.outputs.artifact-name }}
path: ${{ steps.fork-key.outputs.csr }}
retention-days: 1
if-no-files-found: error
compression-level: 0
- name: rbe-fork certificate (rbe-fork-mint)
id: fork-cert
if: steps.fork-key.outputs.csr != ''
shell: bash
env:
BAZEL_CI_SECRET_DIR: ${{ runner.temp }}/bazel-ci-secret
ARTIFACT_ID: ${{ steps.fork-csr.outputs.artifact-id }}
run: bash "$GITHUB_ACTION_PATH/fork-credential.sh" cert
- name: Write CI bazelrc
id: rc
shell: bash
env:
BAZEL_CI_CACHE_DIR: ${{ runner.temp }}/bazel-ci-cache
BAZEL_CI_SECRET_DIR: ${{ runner.temp }}/bazel-ci-secret
RBE_FORK_CERT_FILE: ${{ steps.fork-cert.outputs.cert }}
RBE_FORK_KEY_FILE: ${{ steps.fork-cert.outputs.key }}
RBE_FORK_ENDPOINT: ${{ steps.fork-cert.outputs.endpoint }}
RBE_FORK_INSTANCE: ${{ steps.fork-cert.outputs.instance }}
run: bash "$GITHUB_ACTION_PATH/write-bazelrc.sh"
- name: Install bazel wrapper
shell: bash
env:
RC: ${{ steps.rc.outputs.rc }}
run: |
set -euo pipefail
printf '%s\n' '#!/usr/bin/env bash' "exec /usr/local/bin/bazelisk --bazelrc=\"$RC\" \"\$@\"" > "$RUNNER_TEMP/bazel-wrapper"
sudo install -m 755 "$RUNNER_TEMP/bazel-wrapper" /usr/local/bin/bazel
rm -f "$RUNNER_TEMP/bazel-wrapper"
# Downloads Bazel (Bazelisk checks BAZELISK_VERIFY_SHA256; the
# wrapper's --bazelrc would make --version an unknown startup
# option), then checks again: every Bazel binary in Bazelisk's home
# is the pinned release.
/usr/local/bin/bazelisk --version
n=0
while IFS= read -r -d '' bin; do
echo "${BAZEL_CI_BAZEL_SHA256} $bin" | sha256sum -c - >/dev/null
n=$((n + 1))
done < <(find "$BAZELISK_HOME/downloads" -type f -path '*/bin/bazel' -print0)
if [ "$n" -eq 0 ]; then
echo "setup-bazel: no Bazel binary under $BAZELISK_HOME" >&2
exit 1
fi

View file

@ -1,151 +0,0 @@
#!/usr/bin/env bash
# May this fork-cache lane read Bazel's remote repo contents cache through
# rbe-west's anonymous read-only cache (rbe-cache :8443, .bazelrc's
# fork-cache) right now? Exits 0 only when the kill switch below is on,
# rbe-cache answers a REAPI GetCapabilities for instance oss with gRPC status
# 0 and a ServerCapabilities that has cache_capabilities, and then answers a
# GetActionResult for a key no action has, and a ByteStream Read for a blob
# the CAS does not hold, each with NOT_FOUND (gRPC 5): the whole read chain
# (Caddy, nativelink-anon, the action cache and the CAS) is up. Anything else
# exits nonzero: switched off, an HTTP or gRPC error, a refused connection,
# a timeout, an answer that does not parse, no curl or python3. The caller
# then writes no repo contents cache lines, and never fails on it. The
# verdict carries the GetCapabilities TCP connect time without the DNS
# lookup (about one round trip to rbe-cache), for the lane's step summary.
#
# Why a probe: with the startup flag set and the cache unreachable (closed
# by rbe-west's kill switch, or down), Bazel retries every repository
# against it before fetching it itself (engdocs/design/
# bazel-remote-repo-contents-cache.md, R6), which costs far more than the
# cache saves. Fork pull_request runs see no repository variables, so the
# opt-out is the committed line below and the server's own answer.
#
# Three gRPC calls over curl's HTTP/2, the first answer decoded by
# python3's standard library: no grpcurl, no new action. Nothing goes to
# stdout (callers write their rc from it); one verdict line goes to stderr. A copy lives in gascity
# (tools/rbe/) and beads (.github/actions/setup-bazel/); keep in sync, except
# the kill switch, which is each repository's own.
#
# Tests only: RBE_CACHE_PROBE_URL (a stand-in server) and
# RBE_CACHE_PROBE_MAX_TIME (seconds).
set -uo pipefail
# Kill switch: off stops this repository's fork-cache lanes reading the
# remote repo contents cache (they fetch external repositories themselves),
# with a one-line pull request; on lets rbe-cache's answer decide. To stop
# every reader of rbe-cache, set it off in both copies (gascity and beads).
# It reaches a lane when the lane's checkout carries it.
fork_rrc_read=on
url=${RBE_CACHE_PROBE_URL:-https://rbe-cache.ops.gascity.com:8443}
max_time=${RBE_CACHE_PROBE_MAX_TIME:-5}
rtt=
no() {
echo "rbe-cache rrc probe: $*${rtt:+ ($rtt)}; this lane fetches external repositories itself" >&2
exit 1
}
[ "$fork_rrc_read" = on ] || no "switched off (fork_rrc_read=$fork_rrc_read in $(basename "$0"))"
command -v curl >/dev/null 2>&1 || no "no curl"
command -v python3 >/dev/null 2>&1 || no "no python3"
tmp=$(mktemp -d) || no "no temp dir"
trap 'rm -rf "$tmp"' EXIT
# call WHAT METHOD REQ: one gRPC call (METHOD: service/method); the answer's
# messages go to $tmp/body, its grpc-status to $st, and the TCP connect time
# without the DNS lookup to $tc. Fails the probe (prefixed with WHAT) on a
# transport error or a non-200 answer.
call() {
local what=$1 out code dns
out=$(curl -sS --http2 --connect-timeout 3 --max-time "$max_time" \
-H 'content-type: application/grpc' -H 'te: trailers' \
--data-binary @"$3" -D "$tmp/head" -o "$tmp/body" -w '%{http_code} %{time_namelookup} %{time_connect}' \
"$url/$2" 2>"$tmp/err") ||
no "$what$(tr '\n' ' ' <"$tmp/err")"
read -r code dns tc <<<"$out"
tc=$(awk -v d="$dns" -v c="$tc" 'BEGIN { if (c > d) printf "%.6f", c - d }' 2>/dev/null) || tc=
[ "$code" = 200 ] || no "${what}HTTP $code"
# grpc-status is a trailer; curl writes trailers after the headers.
st=$(tr -d '\r' <"$tmp/head" | sed -n 's/^grpc-status: *//Ip' | tail -1)
}
# GetCapabilitiesRequest{instance_name: "oss"} (fork-cache's
# --remote_instance_name) as one uncompressed gRPC message.
printf '\000\000\000\000\005\012\003oss' >"$tmp/req" || no "cannot write the request"
call "" build.bazel.remote.execution.v2.Capabilities/GetCapabilities "$tmp/req"
rtt=$(awk -v s="$tc" 'BEGIN { if (s > 0) printf "tcp connect %.1f ms", s * 1000 }' 2>/dev/null) || rtt=
[ "$st" = 0 ] || no "gRPC status ${st:-missing}"
why=$(python3 -I - "$tmp/body" <<'PY'
import sys
def varint(b, i):
v = s = 0
while True:
if i >= len(b) or s > 63:
raise ValueError("truncated varint")
c = b[i]
i += 1
v |= (c & 0x7F) << s
s += 7
if c < 0x80:
return v, i
def fields(b):
i = 0
while i < len(b):
key, i = varint(b, i)
num, wire = key >> 3, key & 7
if wire == 0:
v, i = varint(b, i)
elif wire == 1:
v, i = b[i:i + 8], i + 8
elif wire == 2:
n, i = varint(b, i)
v, i = b[i:i + n], i + n
elif wire == 5:
v, i = b[i:i + 4], i + 4
else:
raise ValueError("wire type %d" % wire)
if i > len(b):
raise ValueError("truncated field %d" % num)
yield num, wire, v
try:
body = open(sys.argv[1], "rb").read()
if len(body) < 5 or body[0] != 0:
raise ValueError("not an uncompressed gRPC message")
n = int.from_bytes(body[1:5], "big")
if len(body) != 5 + n:
raise ValueError("gRPC length %d, %d bytes" % (n, len(body) - 5))
# ServerCapabilities.cache_capabilities
cache = [v for num, wire, v in fields(body[5:]) if num == 1 and wire == 2]
except (OSError, ValueError) as e:
print("unreadable answer (%s)" % e)
sys.exit(2)
if not cache:
print("no cache_capabilities in the answer")
sys.exit(1)
PY
) || no "${why:-python3 failed}"
# GetActionResultRequest{instance_name: "oss", action_digest: {hash:
# sha256("cache-rrc-probe: no action has this key"), size_bytes: 1}}: a key
# no action has, so the action cache behind rbe-cache must say NOT_FOUND.
key=ad12d7a2f1dec188fc1f2c4f5535a4a65eb630fa2f309eca423695e6ec7abee7
printf '\000\000\000\000\113\012\003oss\022\104\012\100%s\020\001' "$key" >"$tmp/req" ||
no "cannot write the request"
call "GetActionResult: " build.bazel.remote.execution.v2.ActionCache/GetActionResult "$tmp/req"
[ "$st" = 5 ] || no "GetActionResult: gRPC status ${st:-missing}, want 5 (NOT_FOUND)"
# ReadRequest{resource_name: "oss/blobs/<the same hash>/1"}: a blob the CAS
# does not hold (its content would have to hash to that key), so the CAS
# behind rbe-cache must say NOT_FOUND.
printf '\000\000\000\000\116\012\114oss/blobs/%s/1' "$key" >"$tmp/req" ||
no "cannot write the request"
call "ByteStream Read: " google.bytestream.ByteStream/Read "$tmp/req"
[ "$st" = 5 ] || no "ByteStream Read: gRPC status ${st:-missing}, want 5 (NOT_FOUND)"
echo "rbe-cache rrc probe: rbe-cache answers GetCapabilities, GetActionResult and ByteStream Read${rtt:+ ($rtt)}; this lane reads the remote repo contents cache" >&2

View file

@ -1,119 +0,0 @@
#!/usr/bin/env bash
# Does rbe-west's anonymous read-only cache (rbe-cache :8443, .bazelrc's
# fork-cache) advertise zstd right now? Exits 0 only when its REAPI
# GetCapabilities answer lists ZSTD in cache_capabilities.supported_compressors,
# the field Bazel checks before it accepts --remote_cache_compression (it
# refuses a remote that does not list it). Anything else exits nonzero: not
# listed, an HTTP or gRPC error, a refused connection, a timeout, an answer
# that does not parse, no curl or python3. The caller then leaves the flag
# off, and never fails on it.
#
# So the server decides, at run time: when rbe-west turns zstd on, fork-cache
# runs use it; when it turns it off (rollback), they stop. No repository
# variable (fork pull_request runs see none) and no revert.
#
# One unary gRPC call over curl's HTTP/2, decoded by python3's standard
# library: no grpcurl, no new action. Nothing goes to stdout (callers write
# their rc from it); one verdict line goes to stderr. A byte copy lives in
# gascity (tools/rbe/) and beads (.github/actions/setup-bazel/); keep in sync.
#
# Tests only: RBE_CACHE_PROBE_URL (a stand-in server) and
# RBE_CACHE_PROBE_MAX_TIME (seconds).
set -uo pipefail
url=${RBE_CACHE_PROBE_URL:-https://rbe-cache.ops.gascity.com:8443}
max_time=${RBE_CACHE_PROBE_MAX_TIME:-5}
no() {
echo "rbe-cache zstd probe: $*; the fork cache stays identity" >&2
exit 1
}
command -v curl >/dev/null 2>&1 || no "no curl"
command -v python3 >/dev/null 2>&1 || no "no python3"
tmp=$(mktemp -d) || no "no temp dir"
trap 'rm -rf "$tmp"' EXIT
# GetCapabilitiesRequest{instance_name: "oss"} (fork-cache's
# --remote_instance_name) as one uncompressed gRPC message.
printf '\000\000\000\000\005\012\003oss' >"$tmp/req" || no "cannot write the request"
code=$(curl -sS --http2 --connect-timeout 3 --max-time "$max_time" \
-H 'content-type: application/grpc' -H 'te: trailers' \
--data-binary @"$tmp/req" -D "$tmp/head" -o "$tmp/body" -w '%{http_code}' \
"$url/build.bazel.remote.execution.v2.Capabilities/GetCapabilities" 2>"$tmp/err") ||
no "$(tr '\n' ' ' <"$tmp/err")"
[ "$code" = 200 ] || no "HTTP $code"
# grpc-status is a trailer; curl writes trailers after the headers.
st=$(tr -d '\r' <"$tmp/head" | sed -n 's/^grpc-status: *//Ip' | tail -1)
[ "$st" = 0 ] || no "gRPC status ${st:-missing}"
why=$(python3 -I - "$tmp/body" <<'PY'
import sys
ZSTD = 1 # build.bazel.remote.execution.v2.Compressor.Value.ZSTD
def varint(b, i):
v = s = 0
while True:
if i >= len(b) or s > 63:
raise ValueError("truncated varint")
c = b[i]
i += 1
v |= (c & 0x7F) << s
s += 7
if c < 0x80:
return v, i
def fields(b):
i = 0
while i < len(b):
key, i = varint(b, i)
num, wire = key >> 3, key & 7
if wire == 0:
v, i = varint(b, i)
elif wire == 1:
v, i = b[i:i + 8], i + 8
elif wire == 2:
n, i = varint(b, i)
v, i = b[i:i + n], i + n
elif wire == 5:
v, i = b[i:i + 4], i + 4
else:
raise ValueError("wire type %d" % wire)
if i > len(b):
raise ValueError("truncated field %d" % num)
yield num, wire, v
try:
body = open(sys.argv[1], "rb").read()
if len(body) < 5 or body[0] != 0:
raise ValueError("not an uncompressed gRPC message")
n = int.from_bytes(body[1:5], "big")
if len(body) != 5 + n:
raise ValueError("gRPC length %d, %d bytes" % (n, len(body) - 5))
compressors = []
for num, wire, v in fields(body[5:]):
if num != 1 or wire != 2: # ServerCapabilities.cache_capabilities
continue
for cnum, cwire, cv in fields(v):
if cnum != 6: # CacheCapabilities.supported_compressors
continue
if cwire == 0:
compressors.append(cv)
elif cwire == 2: # packed
j = 0
while j < len(cv):
x, j = varint(cv, j)
compressors.append(x)
except (OSError, ValueError) as e:
print("unreadable answer (%s)" % e)
sys.exit(2)
if ZSTD in compressors:
print("advertises zstd")
sys.exit(0)
print("zstd not advertised (supported_compressors %s)" % compressors)
sys.exit(1)
PY
) || no "${why:-python3 failed}"
echo "rbe-cache zstd probe: $why; the fork cache uses zstd" >&2

View file

@ -1,91 +0,0 @@
#!/usr/bin/env bash
# setup-bazel: a short-lived rbe-west client certificate for fork and
# Dependabot pull_request runs, which get no secrets and no OIDC token
# (infra nativelink-cas/west README "rbe-fork"). Two steps around the CSR
# artifact upload (action.yml):
#
# fork-credential.sh key an EC P-256 key in BAZEL_CI_SECRET_DIR (outside the
# workspace; PKCS#8: Bazel's Netty TLS refuses a
# SEC1 "EC PRIVATE KEY"), and a CSR for the upload.
# Outputs: csr (path), artifact-name.
# fork-credential.sh cert asks rbe-fork-mint for a certificate naming the
# uploaded artifact (ARTIFACT_ID). Outputs: cert,
# key, endpoint, instance, tier.
#
# The mint signs only for an in-progress pull_request run of this repository
# whose artifact holds this CSR (only code running in the run can upload one),
# at the head of RBE_FORK_PR. It decides the tier from the PR's author and the
# run's triggering actor; RBE_FORK_TIER is what the rbe job's status probe
# said, and a different answer fails the job (re-run all jobs). The key never
# leaves the runner; the certificate is public. Nothing here is secret enough
# to mask, but the key file is 0600 like the CI key.
set -euo pipefail
MINT=${RBE_FORK_MINT:-https://rbe-mint.ops.gascity.com:8444}
ENDPOINT_RE=${RBE_FORK_ENDPOINT_RE:-'^grpcs://rbe-fork\.ops\.gascity\.com:8444$'}
dir=${BAZEL_CI_SECRET_DIR:?BAZEL_CI_SECRET_DIR is required}
out=${GITHUB_OUTPUT:-/dev/stdout}
case "${1:-}" in
key)
# Only fork and Dependabot runs (bazel.yml modes fork-ro/fork-rw).
[ "${BAZEL_FORK_REMOTE:-}" = true ] || exit 0
install -d -m 0700 "$dir"
csr_dir="${RUNNER_TEMP:?}/rbe-csr"
rm -rf "$csr_dir" && install -d -m 0700 "$csr_dir"
umask 077
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out "$dir/fork.key" 2>/dev/null
openssl req -new -key "$dir/fork.key" -subj "/CN=rbe-fork-request" -out "$csr_dir/csr.pem"
job=${GITHUB_JOB:?}
[[ $job =~ ^[a-z0-9][a-z0-9_-]{0,39}$ ]] || { echo "setup-bazel: job id '$job' does not fit the mint's job pattern" >&2; exit 1; }
{
echo "csr=$csr_dir/csr.pem"
echo "artifact-name=rbe-csr-$job-${GITHUB_RUN_ATTEMPT:?}-$(openssl rand -hex 8)"
} >>"$out"
;;
cert)
: "${ARTIFACT_ID:?}" "${RBE_FORK_PR:?}" "${RBE_FORK_TIER:?}" "${GITHUB_REPOSITORY:?}" "${GITHUB_RUN_ID:?}"
body=$(jq -cn --arg repo "${GITHUB_REPOSITORY#*/}" --argjson run "$GITHUB_RUN_ID" \
--argjson attempt "${GITHUB_RUN_ATTEMPT:?}" --argjson pr "$RBE_FORK_PR" --arg job "${GITHUB_JOB:?}" \
--argjson artifact "$ARTIFACT_ID" \
'{repo: $repo, run_id: $run, run_attempt: $attempt, pr: $pr, job: $job, artifact_id: $artifact}')
reply="$dir/mint.json"
code=000
for attempt in 1 2 3 4; do
# --connect-timeout: a closed gate drops the SYN; fail fast, not in 60 s.
code=$(curl -sS -o "$reply" -w '%{http_code}' --connect-timeout 5 --max-time 60 \
-H 'content-type: application/json' --data "$body" "$MINT/v1/cert") || code=000
# Retry what may pass on its own: a rate or live-certificate limit (429;
# the rates are per minute, the backoff sums to one), the mint could not
# reach GitHub (502), or the network (000). Everything else is an answer.
case "$code" in 429 | 502 | 000) ;; *) break ;; esac
[ "$attempt" -eq 4 ] || sleep $((attempt * 10))
done
if [ "$code" != 200 ]; then
echo "::error title=rbe-fork mint refused (HTTP $code)::$(jq -r '.error // empty' "$reply" 2>/dev/null || true)"
exit 1
fi
endpoint=$(jq -r .endpoint "$reply")
instance=$(jq -r .instance "$reply")
tier=$(jq -r .tier "$reply")
[[ $endpoint =~ $ENDPOINT_RE ]] || { echo "::error::rbe-fork mint returned endpoint '$endpoint'" >&2; exit 1; }
case "$tier/$instance" in ro/oss-fork | rw/oss) ;; *) echo "::error::rbe-fork mint returned tier '$tier' instance '$instance'" >&2; exit 1 ;; esac
if [ "$tier" != "$RBE_FORK_TIER" ]; then
echo "::error title=rbe-fork tier changed::the mint says '$tier', this run's mode says '$RBE_FORK_TIER' (allowlist changed?); re-run all jobs"
exit 1
fi
umask 077
jq -r .cert_pem "$reply" >"$dir/fork.crt"
openssl x509 -in "$dir/fork.crt" -noout -subject -enddate
{
echo "cert=$dir/fork.crt"
echo "key=$dir/fork.key"
echo "endpoint=$endpoint"
echo "instance=$instance"
echo "tier=$tier"
} >>"$out"
;;
*)
echo "usage: $0 key|cert" >&2
exit 2
;;
esac

View file

@ -1,288 +0,0 @@
#!/usr/bin/env bash
# Write the CI bazelrc for .github/actions/setup-bazel.
#
# Always: --repository_cache under BAZEL_CI_CACHE_DIR (the directory the
# runner cache saves and restores; Bazel checks every hit's sha256) and no
# repo contents cache (--repo_contents_cache=: its extracted repos would be
# restored from the runner cache unverified). Never --disk_cache: remote runs have the
# remote cache, and a local run's disk cache (about 7 GB) would not fit next to
# its output base on a hosted runner.
#
# Remote execution only when all three of BAZEL_REMOTE_EXECUTOR, RBE_TLS_CERT
# and RBE_TLS_KEY are set (repo secrets; empty on fork PRs, so those runs stay
# local). Exactly one or two of them is a misconfiguration and fails. Optional:
# RBE_TLS_CA (base64 PEM CA bundle) and RBE_INSTANCE (instance name; a warning
# when empty, because the default instance may share its action cache with
# other repos on the same farm). Cert and key are base64-encoded PEM (raw PEM
# is accepted too). Every line of the decoded PEM is masked in the job log.
#
# CI uploads only remotely executed results (--noremote_upload_local_results):
# a job's locally executed actions (PR code included) never enter the shared
# action cache from here. Developer rcs keep Bazel's default.
#
# The rc and the key material go to BAZEL_CI_SECRET_DIR, which must be outside
# the workspace (tests that walk the checkout must never see an endpoint or a
# cert path) and outside BAZEL_CI_CACHE_DIR (the runner cache must never store
# credentials). The endpoint is masked in the job log.
#
# BAZEL_FORK_CACHE=true (bazel.yml mode "cache": rbe=cache dispatches, and
# fork/Dependabot runs while rbe-fork is closed) appends --config=fork-cache:
# .bazelrc's credential-free, read-only rbe-west cache. While that cache
# advertises zstd (cache-zstd-probe.sh asks its GetCapabilities; any failure
# means no) it also asks for zstd transfers (--remote_cache_compression). A
# probe, not a repository variable: fork pull_request runs see no vars. No
# other mode ever asks, because only the anonymous cache can advertise zstd,
# and Bazel refuses a remote that does not. With BAZEL_RRC_READ=true too
# (bazel.yml's remote repo contents cache readers alone: the jobs whose
# configs rrc-lane-commands.txt seeds), and while rbe-cache answers
# (cache-rrc-probe.sh, which also holds the committed kill switch), it reads
# Bazel's remote repo contents cache, as those jobs' trusted readers do: the
# trees rrc-seed wrote on main pushes, through rbe-cache's anonymous AC and
# CAS reads. The job's step summary says whether it reads, and why.
#
# RBE_FORK_CERT_FILE + RBE_FORK_KEY_FILE + RBE_FORK_ENDPOINT + RBE_FORK_INSTANCE
# (bazel.yml modes fork-ro/fork-rw: fork-credential.sh's outputs, a
# short-lived rbe-fork-mint certificate) enable --config=remote-exec against
# rbe-fork: instance oss-fork (the fork pool, nothing cached) or oss
# (allowlisted authors: the OSS pool, results cached by the workers). The
# three modes are mutually exclusive.
#
# Outputs (to $GITHUB_OUTPUT when set, else stdout): rc=<path>,
# remote=true|false, cache=true|false.
set -euo pipefail
cache_dir="${BAZEL_CI_CACHE_DIR:?BAZEL_CI_CACHE_DIR is required}"
secret_dir="${BAZEL_CI_SECRET_DIR:?BAZEL_CI_SECRET_DIR is required}"
workspace="${GITHUB_WORKSPACE:-$PWD}"
abs() { mkdir -p "$1" && (cd "$1" && pwd -P); }
cache_dir="$(abs "$cache_dir")"
secret_dir="$(abs "$secret_dir")"
workspace="$(cd "$workspace" && pwd -P)"
case "$secret_dir/" in
"$workspace"/*)
echo "setup-bazel: BAZEL_CI_SECRET_DIR ($secret_dir) must be outside the workspace" >&2
exit 1
;;
"$cache_dir"/*)
echo "setup-bazel: BAZEL_CI_SECRET_DIR must not be inside the cached BAZEL_CI_CACHE_DIR" >&2
exit 1
;;
esac
chmod 700 "$secret_dir"
mkdir -p "$cache_dir/repo"
mask() {
local v="${1:-}"
[[ -z "$v" ]] && return 0
printf '::add-mask::%s\n' "$v"
}
# Mask the endpoint and its bare host[:port]: Bazel prints bytestream:// URIs
# that carry the host without the scheme.
executor="${BAZEL_REMOTE_EXECUTOR:-}"
if [[ -n "$executor" ]]; then
mask "$executor"
hostport="${executor#*://}"
hostport="${hostport%%/*}"
mask "$hostport"
mask "${hostport%:*}"
# Bazel's connection errors print the resolved address ("host/1.2.3.4:443").
if command -v getent >/dev/null 2>&1; then
while read -r addr _; do
mask "$addr"
done < <(getent ahosts "${hostport%:*}" 2>/dev/null | sort -u -k1,1)
fi
fi
cert="${RBE_TLS_CERT:-}"
key="${RBE_TLS_KEY:-}"
ca="${RBE_TLS_CA:-}"
instance="${RBE_INSTANCE:-}"
fork_cache="${BAZEL_FORK_CACHE:-}"
rrc_reader="${BAZEL_RRC_READ:-}"
fork_cert="${RBE_FORK_CERT_FILE:-}"
fork_key="${RBE_FORK_KEY_FILE:-}"
fork_endpoint="${RBE_FORK_ENDPOINT:-}"
fork_instance="${RBE_FORK_INSTANCE:-}"
fork_fields=0
for v in "$fork_cert" "$fork_key" "$fork_endpoint" "$fork_instance"; do
[[ -n "$v" ]] && fork_fields=$((fork_fields + 1))
done
case "$fork_fields/$fork_instance" in
0/ | 4/oss | 4/oss-fork) ;;
*)
echo "setup-bazel: RBE_FORK_CERT_FILE, RBE_FORK_KEY_FILE, RBE_FORK_ENDPOINT and RBE_FORK_INSTANCE (oss or oss-fork) go together" >&2
exit 1
;;
esac
case "$fork_cache" in
"" | true) ;;
*)
echo "setup-bazel: BAZEL_FORK_CACHE must be \"true\" or empty, got \"$fork_cache\"" >&2
exit 1
;;
esac
case "$rrc_reader" in
"" | true) ;;
*)
echo "setup-bazel: BAZEL_RRC_READ must be \"true\" or empty, got \"$rrc_reader\"" >&2
exit 1
;;
esac
rc="$secret_dir/ci.bazelrc"
umask 077
{
echo "# Generated by .github/actions/setup-bazel; not a workspace file."
echo "common --repository_cache=$cache_dir/repo"
# The repo contents cache (default: under the repository cache, so in
# the runner cache) holds extracted repos Bazel never re-verifies; off.
echo "common --repo_contents_cache="
# Every mode fetches external repositories on the runner. gazelle's
# go_repository fetches Go modules with the go command (fetch_repo), not
# Bazel's downloader, and the go command never retries: one TLS
# handshake timeout against proxy.golang.org failed a whole lane. With
# "|" the go command moves to the next entry on any error (a ","
# list only on 404/410): the proxy twice, then the module's origin.
# fetch_repo checks every module against its go.sum hash whatever the
# source. Key neutral: repository fetching only, no action reads it.
echo "common --repo_env=GOPROXY=https://proxy.golang.org|https://proxy.golang.org|direct"
# Bazel's own downloader (the Go SDK, http_archive) already retries;
# give slow TLS handshakes and reads twice the default timeouts.
echo "common --http_timeout_scaling=2.0"
# The client's JVM heap. Bazel's default caps it at 25% of RAM, about
# 2 GB on the 8 GB 2 vCPU runners every remote lane uses; //... analysis
# fits today, with little headroom. A startup option: key neutral, it only
# restarts the server. Each lane reports peak-heap-size to size this.
echo "startup --host_jvm_args=-Xmx4g"
} >"$rc"
# write_pem DEST VALUE: decode base64 (or accept raw PEM) and check it is PEM.
write_pem() {
local dest="$1" body="$2"
body="$(printf '%s' "$body" | tr -d '\r')"
if [[ "$body" != *"-----BEGIN "* ]]; then
if ! body="$(printf '%s' "$body" | tr -d '\n ' | base64 -d 2>/dev/null)"; then
echo "setup-bazel: $(basename "$dest") secret is neither PEM nor base64 PEM" >&2
return 1
fi
fi
if [[ "$body" != *"-----BEGIN "* ]]; then
echo "setup-bazel: $(basename "$dest") secret does not decode to PEM" >&2
return 1
fi
# GitHub masks the secret as stored (base64), not what it decodes to.
local line
while IFS= read -r line; do
[[ -z "$line" || "$line" == -----* ]] || mask "$line"
done <<<"$body"
printf '%s\n' "$body" >"$dest"
chmod 600 "$dest"
}
set_fields=0
for v in "$executor" "$cert" "$key"; do
[[ -n "$v" ]] && set_fields=$((set_fields + 1))
done
remote=false
cache=false
if [[ "$fork_fields" -eq 4 ]]; then
if [[ "$set_fields" -ne 0 || "$fork_cache" == true ]]; then
echo "setup-bazel: the rbe-fork certificate, the remote execution secrets and BAZEL_FORK_CACHE are mutually exclusive" >&2
exit 1
fi
{
echo "build:remote-exec --remote_executor=$fork_endpoint"
echo "build:remote-exec --tls_client_certificate=$fork_cert"
echo "build:remote-exec --tls_client_key=$fork_key"
echo "build:remote-exec --remote_instance_name=$fork_instance"
echo "build:remote-exec --noremote_upload_local_results"
# The farm admits 128 connections per source IP (Blacksmith runners
# share addresses). Key-neutral, like everything in this rc.
echo "build:remote-exec --remote_max_connections=8"
echo "build --config=remote-exec"
} >>"$rc"
remote=true
echo "setup-bazel: remote execution on rbe-fork (instance $fork_instance, short-lived certificate)"
elif [[ "$set_fields" -eq 3 ]]; then
if [[ "$fork_cache" == true ]]; then
echo "setup-bazel: BAZEL_FORK_CACHE and the remote execution secrets are mutually exclusive" >&2
exit 1
fi
write_pem "$secret_dir/client.crt" "$cert"
write_pem "$secret_dir/client.key" "$key"
# Outside the rc block below: write_pem's mask commands go to the log.
if [[ -n "$ca" ]]; then
write_pem "$secret_dir/ca.crt" "$ca"
fi
{
echo "build:remote-exec --remote_executor=$executor"
echo "build:remote-exec --tls_client_certificate=$secret_dir/client.crt"
echo "build:remote-exec --tls_client_key=$secret_dir/client.key"
if [[ -n "$ca" ]]; then
echo "build:remote-exec --tls_certificate=$secret_dir/ca.crt"
fi
if [[ -n "$instance" ]]; then
echo "build:remote-exec --remote_instance_name=$instance"
fi
echo "build:remote-exec --noremote_upload_local_results"
# Every command in this job (test, run //:gazelle, query) uses the
# executor; the committed .bazelrc holds the generic remote-exec tuning.
echo "build --config=remote-exec"
} >>"$rc"
if [[ -z "$instance" ]]; then
echo "::warning title=RBE_INSTANCE not set::remote execution uses the executor's default instance, whose action cache other repos on the farm may share; set RBE_INSTANCE to a beads-only instance"
fi
remote=true
echo "setup-bazel: remote execution enabled"
elif [[ "$set_fields" -ne 0 ]]; then
echo "setup-bazel: remote execution is partially configured; BAZEL_REMOTE_EXECUTOR, RBE_TLS_CERT and RBE_TLS_KEY must be set together (or none, for local execution)" >&2
exit 1
elif [[ "$fork_cache" == true ]]; then
# The remote repo contents cache, read-only, for the jobs that opt in
# (BAZEL_RRC_READ: only their configs are seeded), while rbe-cache
# answers and the probe's kill switch (fork_rrc_read) is on. With the
# startup flag set and the cache unreachable, every repository first
# fails a lookup (gascity engdocs/design/bazel-remote-repo-contents-cache.md,
# R6), so a closed or down rbe-cache gets no lines, and a notice says
# why. That holds at probe time only: after loading, Bazel fetches the
# files lazily, and losing rbe-cache then fails the command (R4). Both
# lines are key neutral, as for the trusted readers; fork-cache uploads
# nothing, and rbe-cache refuses every write.
rrc_read=false
if [[ "$rrc_reader" != true ]]; then
why="not a remote repo contents cache reader (no BAZEL_RRC_READ)"
elif why=$(bash "$(dirname "${BASH_SOURCE[0]}")/cache-rrc-probe.sh" 2>&1); then
rrc_read=true
echo "$why"
else
echo "::notice title=No remote repo contents cache::$why"
fi
echo "Fork cache remote repo contents cache read: **$([[ "$rrc_read" == true ]] && echo on || echo off)** (${why#rbe-cache rrc probe: })" >>"${GITHUB_STEP_SUMMARY:-/dev/null}"
# zstd for the anonymous cache's transfers while it advertises zstd:
# transport only, so action keys are unchanged. The probes never fail
# this script; they only decide the lines.
{
echo "build --config=fork-cache"
if bash "$(dirname "${BASH_SOURCE[0]}")/cache-zstd-probe.sh"; then
echo "build:fork-cache --remote_cache_compression"
fi
if [[ "$rrc_read" == true ]]; then
echo "startup --experimental_remote_repo_contents_cache"
echo "common --loading_phase_threads=64"
fi
} >>"$rc"
cache=true
echo "setup-bazel: read-only remote cache (rbe-cache); executing locally"
else
echo "setup-bazel: no remote execution secrets; running locally"
fi
out="${GITHUB_OUTPUT:-/dev/stdout}"
{
echo "rc=$rc"
echo "remote=$remote"
echo "cache=$cache"
} >>"$out"

View file

@ -1,17 +0,0 @@
{
"github_owned_allowed": true,
"verified_allowed": false,
"patterns_allowed": [
"DeterminateSystems/determinate-nix-action@*",
"DeterminateSystems/nix-installer-action@*",
"anchore/sbom-action@*",
"codecov/codecov-action@*",
"cygwin/cygwin-install-action@*",
"docker/setup-buildx-action@*",
"dorny/paths-filter@*",
"goreleaser/goreleaser-action@*",
"msys2/setup-msys2@*",
"ossf/scorecard-action@*",
"peter-evans/create-pull-request@*"
]
}

View file

@ -1,21 +0,0 @@
# GitHub users whose fork PRs get the Bazel remote-execution farm
# (.github/workflows/bazel-farm.yml). One numeric user id per line, the login
# as a comment; blank lines and # comments are ignored. Ids, not logins: a
# renamed account's old login can be registered by anyone. Look an id up
# with: gh api users/<login> --jq .id
#
# Read only from the base branch (the pull_request_target run's own commit),
# never from a PR: editing this file in a PR changes nothing until it merges.
# Both the PR author and the user who triggered the run (opener or pusher)
# must be listed, and the PR must come from the author's own fork. A listed
# user gets same-repo-PR-level trust: its PR code runs with the RBE client
# certificate. Same people as gascity's .github/blacksmith-allowlist.txt.
# rbe-west's rbe-fork-mint reads this file too, from the default branch, by
# the same rules: a listed author's own-fork PR, triggered by a listed user,
# gets rbe-fork tier rw (bazel.yml mode fork-rw: the trusted OSS pool) when
# the farm has rw switched on; everyone else gets tier ro (fork pool). A
# line that is not a numeric id makes the mint treat the list as empty.
8082291 # julianknutsen
91582 # quad341
36544495 # sjarmak
2568253 # csells

View file

@ -1,15 +1,134 @@
# GitHub Copilot instructions for beads
# GitHub Copilot Instructions for Beads
The canonical contributor instructions for this repository are in
[AGENTS.md](../AGENTS.md); area-specific rules are in the nested `AGENTS.md`
files listed in its routing table. Read those, not this file, for workflow,
build, test, and scope rules.
## Project Overview
The rules most often missed in review:
**beads** (command: `bd`) is a Git-backed issue tracker designed for AI-supervised coding workflows. We dogfood our own tool for all task tracking.
- A PR must close a documented GitHub issue (filed before or alongside it).
- Build with `make install`, never `go build -o bd ./cmd/bd` or `go install ./cmd/bd`.
- `make ci-pr-lint` must pass with zero issues; choose tests with
[engdocs/TESTING.md](../engdocs/TESTING.md).
- Never create test issues in a production database; use `t.TempDir()`.
- CLI output uses small Unicode status symbols, never emoji icons.
**Key Features:**
- Dependency-aware issue tracking
- Auto-sync with Git via JSONL
- AI-optimized CLI with JSON output
- Built-in daemon for background operations
- MCP server integration for Claude and other AI assistants
## Tech Stack
- **Language**: Go 1.21+
- **Storage**: SQLite (internal/storage/sqlite/)
- **CLI Framework**: Cobra
- **Testing**: Go standard testing + table-driven tests
- **CI/CD**: GitHub Actions
- **MCP Server**: Python (integrations/beads-mcp/)
## Coding Guidelines
### Testing
- Always write tests for new features
- Use `BEADS_DB=/tmp/test.db` to avoid polluting production database
- Run `go test -short ./...` before committing
- Never create test issues in production DB (use temporary DB)
### Code Style
- Run `golangci-lint run ./...` before committing
- Follow existing patterns in `cmd/bd/` for new commands
- Add `--json` flag to all commands for programmatic use
- Update docs when changing behavior
### Git Workflow
- Always commit `.beads/issues.jsonl` with code changes
- Run `bd sync` at end of work sessions
- Install git hooks: `bd hooks install` (ensures DB ↔ JSONL consistency)
## Issue Tracking with bd
**CRITICAL**: This project uses **bd** for ALL task tracking. Do NOT create markdown TODO lists.
### Essential Commands
```bash
# Find work
bd ready --json # Unblocked issues
bd stale --days 30 --json # Forgotten issues
# Create and manage (ALWAYS include --description)
bd create "Title" --description="Detailed context" -t bug|feature|task -p 0-4 --json
bd update <id> --status in_progress --json
bd close <id> --reason "Done" --json
# Search
bd list --status open --priority 1 --json
bd show <id> --json
# Sync (CRITICAL at end of session!)
bd sync # Force immediate export/commit/push
```
### Workflow
1. **Check ready work**: `bd ready --json`
2. **Claim task**: `bd update <id> --status in_progress`
3. **Work on it**: Implement, test, document
4. **Discover new work?** `bd create "Found bug" --description="What was found and why" -p 1 --deps discovered-from:<parent-id> --json`
5. **Complete**: `bd close <id> --reason "Done" --json`
6. **Sync**: `bd sync` (flushes changes to git immediately)
**IMPORTANT**: Always include `--description` when creating issues. Issues without descriptions lack context for future work.
### Priorities
- `0` - Critical (security, data loss, broken builds)
- `1` - High (major features, important bugs)
- `2` - Medium (default, nice-to-have)
- `3` - Low (polish, optimization)
- `4` - Backlog (future ideas)
## Project Structure
```
beads/
├── cmd/bd/ # CLI commands (add new commands here)
├── internal/
│ ├── types/ # Core data types
│ └── storage/ # Storage layer
│ └── sqlite/ # SQLite implementation
├── integrations/
│ └── beads-mcp/ # MCP server (Python)
├── examples/ # Integration examples
├── docs/ # Documentation
└── .beads/
├── beads.db # SQLite database (DO NOT COMMIT)
└── issues.jsonl # Git-synced issue storage
```
## Available Resources
### MCP Server (Recommended)
Use the beads MCP server for native function calls instead of shell commands:
- Install: `pip install beads-mcp`
- Functions: `mcp__beads__ready()`, `mcp__beads__create()`, etc.
- See `integrations/beads-mcp/README.md`
### Scripts
- `./scripts/bump-version.sh <version> --commit` - Update all version files atomically
- `./scripts/release.sh <version>` - Complete release workflow
- `./scripts/update-homebrew.sh <version>` - Update Homebrew formula
### Key Documentation
- **AGENTS.md** - Comprehensive AI agent guide (detailed workflows, advanced features)
- **AGENT_INSTRUCTIONS.md** - Development procedures, testing, releases
- **README.md** - User-facing documentation
- **docs/CLI_REFERENCE.md** - Complete command reference
## Important Rules
- ✅ Use bd for ALL task tracking
- ✅ Always use `--json` flag for programmatic use
- ✅ Run `bd sync` at end of sessions
- ✅ Test with `BEADS_DB=/tmp/test.db`
- ❌ Do NOT create markdown TODO lists
- ❌ Do NOT create test issues in production DB
- ❌ Do NOT commit `.beads/beads.db` (JSONL only)
---
**For detailed workflows and advanced features, see [AGENTS.md](../AGENTS.md)**

View file

@ -5,39 +5,10 @@ updates:
directory: "/"
schedule:
interval: "weekly"
# Headroom above the group count: grouped PRs count as one, but SemVer-major
# singles plus the testcontainers group plus a migration window with old
# singleton PRs still open must not wedge at the limit (dependabot opens no
# new version PR while the limit is saturated).
open-pull-requests-limit: 10
open-pull-requests-limit: 5
labels:
- "dependencies"
- "go"
# Group minor/patch Go bumps into a single PR. Every gomod bump rewrites
# go.sum, which invalidates the nix vendorHash in default.nix; N singleton
# PRs mean N vendorHash bot-commits and N '@dependabot recreate' rounds
# after each merge (see update-vendor-hash.yml caveat). One grouped PR
# gets one bot-computed hash. SemVer-majors stay separate so they cannot
# block the routine group (note: pre-1.0 modules ship breaking changes as
# "minor" bumps, which do ride in the group — dependabot classifies by
# version arithmetic only).
#
# testcontainers-go and its modules/dolt child must bump in lockstep
# (the module requires a matching root), and the project pins 0.x
# releases with routine breaking changes — so they get their own group:
# always coupled together, never blocking go-deps.
groups:
testcontainers:
applies-to: version-updates
patterns:
- "github.com/testcontainers/testcontainers-go*"
go-deps:
applies-to: version-updates
exclude-patterns:
- "github.com/testcontainers/testcontainers-go*"
update-types:
- "minor"
- "patch"
# GitHub Actions
- package-ecosystem: "github-actions"
@ -48,14 +19,9 @@ updates:
labels:
- "dependencies"
- "ci"
groups:
actions:
applies-to: version-updates
patterns:
- "*"
# Python (beads-mcp)
- package-ecosystem: "uv"
- package-ecosystem: "pip"
directory: "/integrations/beads-mcp"
schedule:
interval: "weekly"
@ -64,8 +30,3 @@ updates:
- "dependencies"
- "python"
- "mcp"
groups:
beads-mcp-python:
applies-to: version-updates
patterns:
- "*"

View file

@ -1,44 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="redirect-destination" content="https://beads.gascity.com" />
<meta http-equiv="refresh" content="1; url=https://beads.gascity.com/" />
<title>Beads documentation has moved</title>
</head>
<body>
<p>
The Beads documentation has moved to
<a id="destination" href="https://beads.gascity.com/">beads.gascity.com</a>.
</p>
<noscript>
<p>
JavaScript is required to preserve this page's path. Continue to the
<a href="https://beads.gascity.com/">current Beads documentation</a>.
</p>
</noscript>
<script>
(function () {
var path = window.location.pathname;
var destinationPath = path;
if (path === "/beads" || path === "/beads/") {
destinationPath = "/";
} else if (path.indexOf("/beads/") === 0) {
destinationPath = path.slice("/beads".length);
}
var destination =
document.querySelector('meta[name="redirect-destination"]').content +
destinationPath +
window.location.search +
window.location.hash;
document.getElementById("destination").href = destination;
window.location.replace(destination);
})();
</script>
</body>
</html>

View file

@ -1,125 +0,0 @@
#!/usr/bin/env bash
# bazel-farm.yml's authorize job: may this pull_request_target run hand a
# fork PR's head to bazel.yml with the RBE secrets? Runs from a checkout of
# the base branch (the run's own commit), never the PR; reads event facts
# from the environment only (the workflow never interpolates them into a
# script). Writes allowed=true|false to $GITHUB_OUTPUT and the reason to the
# log and step summary. Exits non-zero only on a broken invocation.
#
# Allowed only when all hold:
# EVENT_NAME is pull_request_target and ACTION is opened or synchronize
# (reopened and ready_for_review would re-test a head no listed user
# necessarily pushed: a fork collaborator's push while the PR was closed
# or a draft);
# BASE_REPO is REPOSITORY and HEAD_REPO is another repository (a fork);
# HEAD_OWNER_ID (the head repository owner's numeric id) is PR_AUTHOR_ID:
# the PR comes from the author's own fork, not from a third party's fork
# whose owner could push between the author's review and "Create";
# BASE_REF is DEFAULT_BRANCH;
# HEAD_SHA is a full 40-hex commit id (what bazel.yml checks out);
# PR_AUTHOR_ID and SENDER_ID (numeric user ids) are both on ALLOWLIST.
# SENDER is who triggered this event: the pusher on synchronize, so a
# collaborator on a listed author's fork cannot push code that runs with
# secrets. Ids, not logins: a renamed account's old login can be
# registered by anyone. Logins (PR_AUTHOR, SENDER) are for the log only.
#
# ALLOWLIST: one numeric user id per line; # starts a comment (the login,
# for humans). Any other entry is a broken allowlist and fails the job.
#
# Inputs (environment): ALLOWLIST (file path), EVENT_NAME, ACTION,
# REPOSITORY, BASE_REPO, HEAD_REPO, HEAD_OWNER_ID, BASE_REF, DEFAULT_BRANCH,
# HEAD_SHA, PR_AUTHOR, PR_AUTHOR_ID, SENDER, SENDER_ID, GITHUB_OUTPUT;
# GITHUB_STEP_SUMMARY optional.
set -euo pipefail
# Byte semantics for the [A-Za-z0-9] / [0-9] classes and lower(): in some
# UTF-8 locales they match or fold non-ASCII (e.g. the Kelvin sign to k).
export LC_ALL=C
# ASCII lowercase. Not ${v,,}: that is bash >= 4, and macOS ships bash 3.2.
# shellcheck disable=SC2018,SC2019 # ASCII only, on purpose (logins, repo names)
lower() {
printf '%s' "${1:-}" | tr 'A-Z' 'a-z'
}
: "${GITHUB_OUTPUT:?GITHUB_OUTPUT is not set}"
allowlist="${ALLOWLIST:?ALLOWLIST is not set}"
if [[ ! -f "$allowlist" ]]; then
echo "::error::allowlist $allowlist is missing" >&2
exit 1
fi
decide() {
allowed=false
reason="$1"
}
# A login: GitHub's charset, lowercased. Anything else never matches.
login() {
local v="${1:-}"
if [[ "$v" =~ ^[A-Za-z0-9]([A-Za-z0-9-]{0,38})$ ]]; then
lower "$v"
fi
}
# A numeric GitHub user id; anything else is not one.
is_id() {
[[ "${1:-}" =~ ^[1-9][0-9]{0,19}$ ]]
}
ids=()
while IFS= read -r line || [[ -n "$line" ]]; do
line="${line%%#*}"
line="${line//[[:space:]]/}"
[[ -n "$line" ]] || continue
if ! is_id "$line"; then
echo "::error::allowlist $allowlist has an entry that is not a numeric user id" >&2
exit 1
fi
ids+=("$line")
done < "$allowlist"
listed() {
local want="${1:-}" id
is_id "$want" || return 1
for id in "${ids[@]}"; do
if [[ "$id" == "$want" ]]; then
return 0
fi
done
return 1
}
allowed=true
reason="author and sender are on the allowlist"
author="${PR_AUTHOR:-}"
sender="${SENDER:-}"
if [[ "${EVENT_NAME:-}" != pull_request_target ]]; then
decide "event is not pull_request_target"
elif ! [[ "${ACTION:-}" =~ ^(opened|synchronize)$ ]]; then
decide "action is not opened or synchronize"
elif [[ -z "${REPOSITORY:-}" || "${BASE_REPO:-}" != "$REPOSITORY" ]]; then
decide "PR base repository is not this repository"
elif [[ -z "${HEAD_REPO:-}" || "$(lower "$HEAD_REPO")" == "$(lower "${REPOSITORY:-}")" ]]; then
decide "PR head is not a fork (same-repo PRs use pr.yml's remote run)"
elif ! is_id "${HEAD_OWNER_ID:-}" || [[ "${HEAD_OWNER_ID}" != "${PR_AUTHOR_ID:-}" ]]; then
decide "PR head is not the author's own fork"
elif [[ -z "${DEFAULT_BRANCH:-}" || "${BASE_REF:-}" != "$DEFAULT_BRANCH" ]]; then
decide "PR does not target the default branch"
elif ! [[ "${HEAD_SHA:-}" =~ ^[0-9a-f]{40}$ ]]; then
decide "head SHA is not a full commit id"
elif ! listed "${PR_AUTHOR_ID:-}"; then
decide "PR author is not on the allowlist"
elif ! listed "${SENDER_ID:-}"; then
decide "the user who triggered this run is not on the allowlist"
fi
# Logins are printed only after the charset check (log-injection safe).
shown_author="$(login "$author")"
shown_sender="$(login "$sender")"
echo "allowed=$allowed" >> "$GITHUB_OUTPUT"
msg="Bazel farm: allowed=$allowed ($reason; author ${shown_author:-<invalid>}, sender ${shown_sender:-<invalid>})"
echo "$msg"
if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then
echo "$msg" >> "$GITHUB_STEP_SUMMARY"
fi

View file

@ -1,62 +0,0 @@
#!/usr/bin/env bash
# pr.yml's ci-gate view of its bazel.yml call (the `bazel` job). bazel.yml's
# rbe job decides the execution mode once and exports it as the call's
# rbe-mode / rbe-enabled outputs; this script reads those outputs and never
# re-derives the decision (repo variable, fork, secrets) itself.
#
# bazel-gate.sh skips the Bazel gate ids whose job is skipped by design
# in this mode, for CI_GATE_SKIPPED_OK:
# skip: every lane and the aggregate (BAZEL)
# local: the remote-only BAZEL_EMBEDDED,
# BAZEL_PROXIED, BAZEL_SERVER_STORAGE,
# BAZEL_INTEGRATION and BAZEL_CMD_DOLT
# cache: BAZEL_EMBEDDED, BAZEL_PROXIED,
# BAZEL_SERVER_STORAGE (integration
# and cmd-dolt run with the read-only
# cache)
# remote, fork-ro, fork-rw: none
# bazel-gate.sh aggregate the value to gate on for BAZEL: the call's
# aggregate result, or, when the mode is missing
# or invalid (the rbe job failed, the call never
# started), an unexpected value that ci-gate.sh
# rejects.
#
# Any other skip, a failure, a cancellation, or a lane that should run but
# reported nothing (pr.yml maps an empty output to skipped) fails the gate.
#
# Inputs (environment): BAZEL_RBE_MODE, BAZEL_RBE_ENABLED (the call's
# rbe-mode / rbe-enabled outputs), BAZEL_CALL (needs.bazel.result).
set -euo pipefail
mode="${BAZEL_RBE_MODE:-}"
enabled="${BAZEL_RBE_ENABLED:-}"
valid=false
case "$mode/$enabled" in
remote/true | fork-ro/true | fork-rw/true | local/false | cache/false | skip/false) valid=true ;;
esac
case "${1:-}" in
skips)
skips=()
if [[ "$valid" == true ]]; then
case "$mode" in
skip) skips+=(BAZEL BAZEL_TEST BAZEL_PURE BAZEL_RELEASE_CROSS BAZEL_EMBEDDED BAZEL_INTEGRATION BAZEL_DOLTSERVER BAZEL_PROXIED BAZEL_SERVER_STORAGE BAZEL_CMD_DOLT) ;;
local) skips+=(BAZEL_EMBEDDED BAZEL_INTEGRATION BAZEL_PROXIED BAZEL_SERVER_STORAGE BAZEL_CMD_DOLT) ;;
cache) skips+=(BAZEL_EMBEDDED BAZEL_PROXIED BAZEL_SERVER_STORAGE) ;;
esac
fi
echo "${skips[*]-}"
;;
aggregate)
if [[ "$valid" != true ]]; then
echo "invalid-rbe-mode:$(printf '%s/%s' "$mode" "$enabled" | tr -cd 'a-z/')"
else
echo "${BAZEL_CALL:-}"
fi
;;
*)
echo "usage: $0 skips|aggregate" >&2
exit 2
;;
esac

View file

@ -1,56 +0,0 @@
#!/usr/bin/env bash
# Evaluate an aggregate GitHub Actions gate from needs.*.result values.
set -euo pipefail
gate_name="${CI_GATE_NAME:-CI Gate}"
required_vars="${CI_GATE_REQUIRED:-}"
skipped_ok_vars=" ${CI_GATE_SKIPPED_OK:-} "
failed=0
is_skipped_ok() {
local var="$1"
[[ "$skipped_ok_vars" == *" $var "* ]]
}
report_failure() {
local message="$1"
echo "::error::$message"
failed=1
}
if [[ -z "$required_vars" ]]; then
report_failure "CI_GATE_REQUIRED is empty for $gate_name"
fi
for var in $required_vars; do
result="${!var:-}"
case "$result" in
success)
echo "ok: $var=$result"
;;
skipped)
if is_skipped_ok "$var"; then
echo "ok: $var=$result (allowed)"
else
report_failure "$var was skipped"
fi
;;
failure|cancelled)
report_failure "$var=$result"
;;
"")
report_failure "$var is unset"
;;
*)
report_failure "$var has unexpected result: $result"
;;
esac
done
if [[ "$failed" -ne 0 ]]; then
echo "$gate_name failed"
exit 1
fi
echo "$gate_name passed"

View file

@ -1,151 +0,0 @@
#!/usr/bin/env bash
#
# docs-render-check.sh — baseline-aware Mintlify broken-link check for CI.
#
# Runs `mint broken-links` on the HEAD docs tree. When the HEAD has broken
# page links, materializes the BASE docs tree (via git archive) and reports
# only NET-NEW breakage — links that the PR introduced, not pre-existing ones.
# Static-asset refs (.png/.svg/.jpg/.gif) are excluded: mint over-reports
# in-tree images the published build serves fine.
#
# Usage:
# docs-render-check.sh [<base-ref>]
#
# <base-ref> The base branch/sha to compare against (default: origin/main).
# Enables baseline-aware net-new detection.
#
# Exit codes:
# 0 — no net-new page-link regressions
# 1 — net-new page-link regressions found (details on stdout), or the
# mint tool itself failed to produce a broken-links report
#
# Requires: git, npx (Node.js)
#
set -euo pipefail
DOCS_DIR="docs"
DOCS_CONFIG="$DOCS_DIR/docs.json"
BASE_REF="${1:-origin/main}"
# Pinned so a floating release can't silently change the output format this
# script parses (keep in sync with mint.sh).
MINT_VERSION="${MINT_VERSION:-4.2.687}"
MINT_CMD="${MINT_CMD:-npx --yes mint@$MINT_VERSION}"
WORK_TMP="$(mktemp -d)"
trap 'rm -rf "$WORK_TMP"' EXIT
# Verify we have a Mintlify docs tree.
if [[ ! -f "$DOCS_CONFIG" ]]; then
echo "docs-render-check: no docs/docs.json found — skipping" >&2
exit 0
fi
# Static-asset refs are excluded: mint over-reports in-tree images the
# published build serves fine.
ASSET_EXTS='\.png$|\.svg$|\.jpg$|\.jpeg$|\.gif$|\.ico$|\.webp$|\.woff2?$|\.ttf$|\.eot$'
# has_report <mint-output-file> — did mint produce a broken-links report at
# all (as opposed to dying on a registry outage / crash)?
has_report() {
grep -qE '✗|broken' "$1" 2>/dev/null
}
# Parse `mint broken-links` report lines. Each broken link looks like:
# [broken-links] tutorials/01-beads.md -> /tutorials/01-beads.md
# or
# ✗ /tutorials/01-beads.md
# Capture path-shaped tokens on report lines only — root-relative (/foo) or
# relative with a slash — excluding URLs and static assets. The same parser
# runs on both HEAD and BASE output, so residual noise cancels out in the
# net-new comparison.
parse_mint_broken_links() {
local file="$1"
grep -E '✗|broken' "$file" 2>/dev/null \
| grep -oE '[/][^ )]+|[A-Za-z0-9_.-]+/[^ )]+' \
| grep -vE '^https?:|^[A-Za-z0-9_.-]+\.[A-Za-z]{2,}/' \
| grep -vE "$ASSET_EXTS" \
| sort -u || true
}
# --- run_mint <docs-root> <output-file> → exit code -------------------------
run_mint() {
local root="$1"
local out="$2"
cd "$root"
if $MINT_CMD broken-links >"$out" 2>&1; then
cd - >/dev/null
return 0
fi
cd - >/dev/null
return 1
}
HEAD_OUT="$WORK_TMP/head-mint.txt"
BASE_OUT="$WORK_TMP/base-mint.txt"
BASE_TREE="$WORK_TMP/base-docs"
# --- HEAD check --------------------------------------------------------------
HEAD_EXIT=0
run_mint "." "$HEAD_OUT" || HEAD_EXIT=$?
if [[ $HEAD_EXIT -eq 0 ]]; then
echo "docs-render-check: no broken links in HEAD — PASS" >&2
exit 0
fi
HEAD_LINKS="$WORK_TMP/head-links.txt"
parse_mint_broken_links "$HEAD_OUT" | sort -u >"$HEAD_LINKS"
if [[ ! -s "$HEAD_LINKS" ]]; then
if has_report "$HEAD_OUT"; then
# mint produced a report, but every flagged link is a static asset
# we deliberately ignore. Pass.
echo "docs-render-check: mint flagged only static-asset links — PASS" >&2
exit 0
fi
# mint exited non-zero without producing a broken-links report at all
# (registry outage, crash, output-format change). Fail closed rather
# than let the gate silently stop enforcing.
echo "::error::docs-render-check: mint failed without producing a broken-links report — tool failure, not a clean run"
echo "mint output follows:" >&2
cat "$HEAD_OUT" >&2
exit 1
fi
# --- BASE check (baseline-aware) --------------------------------------------
mkdir -p "$BASE_TREE"
if git archive "$BASE_REF" -- "$DOCS_DIR" 2>/dev/null | tar -x -C "$BASE_TREE"; then
BASE_EXIT=0
run_mint "$BASE_TREE" "$BASE_OUT" || BASE_EXIT=$?
BASE_LINKS="$WORK_TMP/base-links.txt"
parse_mint_broken_links "$BASE_OUT" | sort -u >"$BASE_LINKS"
# Net-new = in HEAD but NOT in BASE.
NEW_LINKS="$WORK_TMP/new-links.txt"
comm -23 "$HEAD_LINKS" "$BASE_LINKS" >"$NEW_LINKS"
else
echo "docs-render-check: could not materialize base tree from $BASE_REF — checking HEAD only" >&2
cp "$HEAD_LINKS" "$WORK_TMP/new-links.txt"
NEW_LINKS="$WORK_TMP/new-links.txt"
fi
if [[ ! -s "$NEW_LINKS" ]]; then
echo "docs-render-check: broken links exist but none are net-new — PASS (pre-existing baseline)" >&2
exit 0
fi
# --- NET-NEW regressions found — fail with explanation --------------
echo ""
echo "::error::docs-render-check: net-new broken Mintlify page links detected"
echo ""
echo "The following page links are newly broken by this PR:"
while IFS= read -r link; do
echo " $link"
done <"$NEW_LINKS"
echo ""
echo "──────────────────────────────────────────────────────────────────────────"
echo "docs/ is authored for the Mintlify site (the beads Mintlify site),"
echo "not for direct GitHub viewing. These paths/links are intentional —"
echo "please don't reformat them for GitHub. If something is genuinely broken"
echo "on the live site, note it in the PR and we'll fix it Mintlify-side."
echo "──────────────────────────────────────────────────────────────────────────"
exit 1

View file

@ -1,545 +0,0 @@
# Embedded-Dolt cmd/bd test shard manifest.
#
# Format: <total_shards> <shard_number> <top_level_test_name>
#
# 100-shard split for the Bazel-only embedded-Dolt cmd tier
# (bazel-embedded in .github/workflows/bazel.yml), bin-packed
# longest-first by measured wall-time from
# scripts/ci/embedded_cmd_test_durations.json (see that file for provenance
# and its "relative weight, not absolute SLA" caveat) onto the shard
# whose estimated wall time grows least: serial tests (no top-level
# t.Parallel) add up, parallel ones share -test.parallel=4.
# Regenerate with scripts/ci/gen_embedded_cmd_shard_manifest.py 100
# --weights=duration --write after adding, splitting or removing
# TestEmbedded* functions in cmd/bd/*_test.go. --write is
# incremental: it keeps every already-assigned test on its current shard
# and only places newly-discovered names, onto whichever shard is
# currently lightest, so two unrelated PRs that each add one test do not
# textually conflict or silently invalidate each other's packing. Pass
# --repack to force a full from-scratch rebalance instead (a deliberate,
# separate change — expect a large diff). --check only verifies every
# discovered name is listed here exactly once (no stale or duplicate
# entries); it does NOT verify the packing is still well-balanced.
#
# This file is generated: notes added here are erased by the next
# regeneration. Add them to the generator or the durations file instead.
100 1 TestEmbeddedUpdateConcurrent
100 2 TestEmbeddedShowConcurrent
100 3 TestEmbeddedCloseConcurrent
100 4 TestEmbeddedEpicConcurrent
100 5 TestEmbeddedConfigConcurrent
100 6 TestEmbeddedListFilteringBasicAndLabels
100 7 TestEmbeddedDepConcurrent
100 8 TestEmbeddedMaxRowsListLimitInteraction
100 9 TestEmbeddedChildrenConcurrent
100 10 TestEmbeddedCreateScalarAndRelationships
100 11 TestEmbeddedKVConcurrent
100 12 TestEmbeddedGatedRendering
100 13 TestEmbeddedListFilteringStatusAndHierarchy
100 14 TestEmbeddedReopenConcurrent
100 15 TestEmbeddedPurgeWispsPlaneRetention
100 16 TestEmbeddedMemoryConcurrent
100 17 TestEmbeddedReopen
100 18 TestEmbeddedLabelPropagateRename
100 18 TestEmbeddedPrune_protectsBeadCitedByCustomStatusBead
100 19 TestEmbeddedLabelConcurrent
100 19 TestEmbeddedNewDoltStore_StrictReadOnlyRefusesWritesOnFreshDatabase
100 20 TestEmbeddedInitRoleRoutingRetainedFork
100 20 TestEmbeddedMigrateSchema_IdentityMismatchRefusesBeforeApplying
100 21 TestEmbeddedMaxRowsReady
100 21 TestEmbeddedMigratePersonal_movesIssues
100 22 TestEmbeddedCount
100 22 TestEmbeddedIfRevisionCloseReplaysMoleculeAutoClose
100 23 TestEmbeddedCountConcurrent
100 23 TestEmbeddedExportExcludeOwner_flag
100 24 TestEmbeddedEventsTailFollowReportsTruncationOnTheStream
100 24 TestEmbeddedUndeferConcurrent
100 24 TestEmbeddedWispGCProtectsActiveWisps
100 25 TestEmbeddedDoltRemoteAdd_LocalOnly_FiresBeforeGuard
100 25 TestEmbeddedMaxRowsListBasic
100 25 TestEmbeddedRemovedBackendHealRejectionPerBackend
100 26 TestEmbeddedDoltRemoteAdd_JSON_AllowGitOrigin_WarningOnStderr
100 26 TestEmbeddedExternalMutationPolicy
100 26 TestEmbeddedPersistentPreRunLogsAndSkipsIdentityCheckForFreshEmbeddedWorkspace
100 27 TestEmbeddedDoltRemoteAdd_GitOriginCollision_RefusalMessageCopy
100 27 TestEmbeddedNewDoltStoreFromConfig_DottedDBName
100 27 TestEmbeddedShipConcurrent
100 28 TestEmbeddedDoltLocalOnly_RemoteAdd_RefusesExitOne
100 28 TestEmbeddedHistoryConcurrent
100 28 TestEmbeddedImportChunkedRealStoreResumeConverges
100 29 TestEmbeddedDoltLocalOnly_RemoteAdd_ErrorOnStderr
100 29 TestEmbeddedEpicCloseEligibleReasonFlag
100 29 TestEmbeddedImportChunkedNoReadyWindowWithReadinessEdgeIntoCycle
100 30 TestEmbeddedCloseGuardsAndEpics
100 30 TestEmbeddedDoltLocalOnly_Push_ExitsZeroWithMessage
100 30 TestEmbeddedImportChunkedCrossBucketBlocksEdgesResumeBackfills
100 31 TestEmbeddedDoltLocalOnly_ConfigRoundTrip
100 31 TestEmbeddedIfRevisionCloseWarnsOnForcedOpenChildren
100 31 TestEmbeddedInitSelectedExcludeRoutingForkInvalidQuiet
100 32 TestEmbeddedDoctorUnsupportedJSON
100 32 TestEmbeddedIfRevisionAdvertisedOnFourVerbs
100 32 TestEmbeddedListSearchAndOutputFormats
100 33 TestEmbeddedBootstrapJSONLAndGitOrigin
100 33 TestEmbeddedDeleteJournalsTheRequestingActor
100 33 TestEmbeddedExportExcludeOwner_verbose
100 34 TestEmbeddedCopyIssueRelations_preservesCommentWithTimestamp
100 34 TestEmbeddedEventsTailReportsTruncationToTheCLI
100 34 TestEmbeddedUnclaimBatchAndRefusals
100 34 TestEmbeddedWispGCPurgeClosedDoesNotCascadeIntoLiveSteps
100 35 TestEmbeddedAutoPruneRespectsBdConfigSet
100 35 TestEmbeddedEventsReadNoticesADisabledJournal
100 35 TestEmbeddedGateCreateBeadRename
100 35 TestEmbeddedVersionedHistoryEnvIsProcessWideAndOnlyTurnsRecordingOn
100 36 TestEmbeddedAutoPruneLeavesAnUnboundedJournalAlone
100 36 TestEmbeddedDoltRemoteResetData_UnknownRemote
100 36 TestEmbeddedGateConcurrent
100 36 TestEmbeddedUnclaimIfAssigneeCLIDifferentSpelling
100 37 TestEmbeddedAutoPruneBoundsTheJournalAfterAMutatingCommand
100 37 TestEmbeddedDoltRemoteResetData_CloudRemoteRefused
100 37 TestEmbeddedMaxRowsDepTreeAndDuplicates
100 37 TestEmbeddedSpawnMolecule_SubstitutesTemplatedStepFields
100 38 TestEmbeddedGraphConcurrent
100 38 TestEmbeddedRoutedCreateJournalsIntoTheTargetWorkspace
100 38 TestEmbeddedUnclaimIfAssigneeFlagValidation
100 39 TestEmbeddedIfRevisionRejectsLabelAndParentEdits
100 39 TestEmbeddedMaxRowsGraph
100 39 TestEmbeddedNewDoltStoreFromConfig_NoMetadata
100 40 TestEmbeddedIfRevisionOutranksReassignFenceCLI
100 40 TestEmbeddedNewDoltStoreFromConfig_HyphenatedDBName
100 40 TestEmbeddedUpdateLifecycleClaimParentCommit
100 41 TestEmbeddedDuplicateConcurrent
100 41 TestEmbeddedVersionedHistoryFollowsTheStoreItWritesInto
100 42 TestEmbeddedInitAForkAutoContributor
100 42 TestEmbeddedUpdateIfGuardsFlagValidation
100 43 TestEmbeddedIfRevisionMultiIDRejected
100 43 TestEmbeddedInitExplicitBeadsDirIsAuthoritative
100 44 TestEmbeddedIfRevisionComposesWithIfAssigneeIfStatus
100 44 TestEmbeddedStaleConcurrent
100 45 TestEmbeddedGraph
100 45 TestEmbeddedUpdateIfGuardsCLI
100 46 TestEmbeddedCloseAlreadyClosedClaimNextAndMolecule
100 46 TestEmbeddedIfRevisionMatchAndMismatch
100 47 TestEmbeddedListSearchAndOutputSearchAndSort
100 47 TestEmbeddedRevisionRemintMatrix
100 48 TestEmbeddedDeferConcurrent
100 48 TestEmbeddedReassignFenceCLI
100 49 TestEmbeddedBackupRestoreStrictReadonly
100 49 TestEmbeddedInitAPushConsentAndRemoteBootstrap
100 49 TestEmbeddedMigratePersonal_abortOnNoConfirm
100 50 TestEmbeddedDiffConcurrent
100 50 TestEmbeddedDoltRemoteAdd_AllowGitOrigin_WarningOnStderr
100 50 TestEmbeddedImportChunkedWaitsForChildImportedLaterStaysBlocked
100 50 TestEmbeddedVersionOutputShape
100 51 TestEmbeddedDoltRemoteAdd_AllowGitOrigin_Exits0
100 51 TestEmbeddedHistoryAndShowAsOfReadDoltCommits
100 51 TestEmbeddedImportChunkedStaleRejectedRowKeepsDeferredDepsOut
100 51 TestEmbeddedInitGitBootstrapRoutingFreshQuiet
100 52 TestEmbeddedConfigSetOtherKeysSkipTheVersionedHistoryScan
100 52 TestEmbeddedDoltLocalOnly_Push_LocalStoreCopy
100 52 TestEmbeddedImportChunkedNoReadyWindowAtAnyFreezePoint
100 52 TestEmbeddedSwarmConcurrent
100 53 TestEmbeddedDoltLocalOnly_Push_JSON_DisabledStatus
100 53 TestEmbeddedIfRevisionOrdinaryCAS
100 53 TestEmbeddedImportChunkedMixedRegularWispCrossBucketEdgesWired
100 53 TestEmbeddedInitSelectedExcludeRoutingStealthDecoyQuiet
100 54 TestEmbeddedDiscoveryPinsEnvFileReadonly
100 54 TestEmbeddedFormatJSONAliasMatchesJSON
100 54 TestEmbeddedGraphModeDependencyWorkspaceUnaffected
100 54 TestEmbeddedInitAgentArtifactsGolden
100 54 TestEmbeddedSearchConcurrent
100 54 TestEmbeddedShowAsOfFailureExitCodes
100 55 TestEmbeddedDoltLocalOnly_Pull_JSON_DisabledStatus
100 55 TestEmbeddedImportChunkedConcurrentUpdateKeepsDeferredDeps
100 55 TestEmbeddedUndefer
100 55 TestEmbeddedVersionedHistorySwitchScansEveryRowNotOnePage
100 56 TestEmbeddedDepNoCycleCheck
100 56 TestEmbeddedDoltLocalOnly_Pull_ExitsZeroWithMessage
100 56 TestEmbeddedImportChunkedConcurrentUpdateKeepsBlockingDeps
100 56 TestEmbeddedVersionedHistorySwitchRoundTrip
100 57 TestEmbeddedDoltLocalOnly_DoltStatus_ShowsDisabled
100 57 TestEmbeddedIfRevisionDeletePreflightGoneIsPreconditionFailed
100 57 TestEmbeddedQueryConcurrent
100 57 TestEmbeddedVersionedHistorySwitchRefusesUnversionableMetadata
100 58 TestEmbeddedDepAAddRejectionsAndBulk
100 58 TestEmbeddedDoctorUnsupportedProse
100 58 TestEmbeddedIfRevisionCascadeDelete
100 58 TestEmbeddedVersionedHistorySwitchRefusesAnUnrecordableGateTimeout
100 59 TestEmbeddedDeferAutoWake
100 59 TestEmbeddedDoctorSupportedChecks
100 59 TestEmbeddedIdentityGateRendersSchemaSkewFromForwardDriftedWorkspace
100 59 TestEmbeddedVersionedHistorySetManyRefusesUnversionableMetadata
100 60 TestEmbeddedCommentsCLI
100 60 TestEmbeddedCorruptMetadataFailsLoudUntilRestored
100 60 TestEmbeddedExportExcludeOwner_config
100 60 TestEmbeddedRoutedWriteMissDoesNotCreateTargetDatabase
100 60 TestEmbeddedWispGCPurgeClosedStillPurgesFullyClosedMolecules
100 61 TestEmbeddedBootstrapCloneFailureScrubsCredentials
100 61 TestEmbeddedContributorRoutedWritesCommitInPlanning
100 61 TestEmbeddedEventsPruneHonorsRetainRowsFloorFromConfig
100 61 TestEmbeddedUpdateRoutedStoreCommitsTargetHead
100 61 TestEmbeddedVersionedHistoryConfigSetWritesTheStoreRow
100 62 TestEmbeddedAutoPruneDoesNotRunForReadOnlyCommands
100 62 TestEmbeddedDoltRemoteResetData_GitBacked
100 62 TestEmbeddedGateCheckSkipsTemplateGates
100 62 TestEmbeddedReadyBlockersAndLabels
100 62 TestEmbeddedUnclaimIfAssigneeCLI
100 63 TestEmbeddedDepAndLinkBatchAutoCommitDoesNotAdvanceHead
100 63 TestEmbeddedGateCheckLimitCountsOnlyLiveGates
100 63 TestEmbeddedIfRevisionDeletePreflightGoneParentIsPreconditionFailed
100 63 TestEmbeddedListPageEdges
100 64 TestEmbeddedAutoExportExcludeOwner_config
100 64 TestEmbeddedDoltRemoteAdd_NoGitOrigin_ProceedsNormally
100 64 TestEmbeddedGateWaiterCheckLifecycle
100 64 TestEmbeddedPromoteMovesAWispParent
100 64 TestEmbeddedSpawnMolecule_PreservesStepLabels
100 65 TestEmbeddedIfRevisionPreflightGoneIsPreconditionFailedOnEveryVerb
100 65 TestEmbeddedRemovedBackendHealRoundTrip
100 65 TestEmbeddedSupersede
100 66 TestEmbeddedCloseBasicIsolatedStores
100 66 TestEmbeddedShowCommentsTail
100 67 TestEmbeddedAdminCompactReadOnlyAllowed
100 67 TestEmbeddedAutoImportFallback_ConflictSkip_DoesNotClobber
100 67 TestEmbeddedBootstrapConcurrent
100 67 TestEmbeddedCountIncludeInfra
100 67 TestEmbeddedCreateCommitPending
100 67 TestEmbeddedCreateDryRunRepoDoesNotInitializeTarget
100 67 TestEmbeddedCreateRepoFromNonBeadsCwd
100 67 TestEmbeddedCreateRepoRelativeUninitRefused
100 67 TestEmbeddedHooks
100 67 TestEmbeddedOnboard
100 67 TestEmbeddedPrime
100 67 TestEmbeddedPromote
100 67 TestEmbeddedQuickstart
100 67 TestEmbeddedQuickstartConcurrent
100 67 TestEmbeddedWhere
100 67 TestEmbeddedWhereConcurrent
100 68 TestEmbeddedAutoImportFallback_ConflictSkip_EmptyDBImportsAll
100 68 TestEmbeddedBlocked
100 68 TestEmbeddedCompactConcurrent
100 68 TestEmbeddedContext
100 68 TestEmbeddedCreateJSONEchoesSubSecondTimestamps
100 68 TestEmbeddedDoltBlockedAndCommit
100 68 TestEmbeddedDoltConcurrent
100 68 TestEmbeddedInfo
100 68 TestEmbeddedInfoSuppressGitHooks
100 68 TestEmbeddedOrphans
100 68 TestEmbeddedRoutedMutatingSiblingDeleteCloseDelete
100 68 TestEmbeddedSetupConcurrent
100 68 TestEmbeddedTodoConcurrent
100 68 TestEmbeddedTypes
100 69 TestEmbeddedCompact
100 69 TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout
100 69 TestEmbeddedCreateConcurrent
100 69 TestEmbeddedDepBulkNoCycleCheckKeepsWholeGraphGate
100 69 TestEmbeddedDuplicatesSharedFixture
100 69 TestEmbeddedGateListScoped
100 69 TestEmbeddedGetDependencies
100 69 TestEmbeddedInfoConcurrent
100 69 TestEmbeddedRenamePrefixConcurrent
100 69 TestEmbeddedRoutedSiblingWritesCommitTargetHeadNote
100 69 TestEmbeddedTypesConcurrent
100 69 TestEmbeddedUpdateBatchAutoCommitDoesNotAdvanceHead
100 70 TestEmbeddedExportConcurrent
100 70 TestEmbeddedFlattenConcurrent
100 70 TestEmbeddedGCDryRunAndSkips
100 70 TestEmbeddedImportConcurrent
100 70 TestEmbeddedImportUpsertAndPrefixSync
100 70 TestEmbeddedLabelAddRemoveMultiAndDuplicate
100 70 TestEmbeddedMemory
100 70 TestEmbeddedMigrateConcurrent
100 70 TestEmbeddedPurgeConcurrent
100 70 TestEmbeddedRoutedMutatingSiblingAssignTagDepTag
100 71 TestEmbeddedCloseJSONReportsMoleculeAutoClose
100 71 TestEmbeddedInitRoleRoutingExplicitDefault
100 71 TestEmbeddedPrimeChangeDirRedirectNoticeFollowsTarget
100 71 TestEmbeddedRoutedCreateHonorsTheEnvOverrideOverTheTargetsConfig
100 71 TestEmbeddedSearchRoutesAgree
100 72 TestEmbeddedContributorCreateMultiple
100 72 TestEmbeddedCreateWithGitRemote
100 72 TestEmbeddedFederationConcurrent
100 72 TestEmbeddedGateCreateRepoErrorsList
100 72 TestEmbeddedHumanConcurrent
100 72 TestEmbeddedImportPromotedWispRoundtrip
100 72 TestEmbeddedPrimeChangeDirPrimesTarget
100 72 TestEmbeddedRoutedMutatingSiblingDeleteCloseClose
100 72 TestEmbeddedRoutedSiblingWritesCommitTargetHeadReopen
100 72 TestEmbeddedUpdateFieldsMappingAndRefs
100 73 TestEmbeddedCompactMisdatedChild
100 73 TestEmbeddedExportFlags
100 73 TestEmbeddedFederationPeers
100 73 TestEmbeddedGateCreateFlags
100 73 TestEmbeddedGateCreateReady
100 73 TestEmbeddedPrimeChangeDirDefaultTemplateMatchesTarget
100 73 TestEmbeddedQuickConcurrent
100 73 TestEmbeddedRenamePrefixBasic
100 73 TestEmbeddedRoutedMutatingSiblingAssignTagDepDepAdd
100 74 TestEmbeddedBlockedConcurrent
100 74 TestEmbeddedBranch
100 74 TestEmbeddedCountIncludeEphemeral
100 74 TestEmbeddedDepAddWispSource
100 74 TestEmbeddedMigrate
100 74 TestEmbeddedPrimeConcurrent
100 74 TestEmbeddedRestore
100 74 TestEmbeddedVCConcurrent
100 75 TestEmbeddedCommentsCLIConcurrent
100 75 TestEmbeddedContextConcurrent
100 75 TestEmbeddedFlatten
100 75 TestEmbeddedInitC
100 75 TestEmbeddedListComments
100 75 TestEmbeddedOpen_EmptyDatabaseRejected
100 75 TestEmbeddedReclaimRunsTheLeaseReclaimerRole
100 75 TestEmbeddedRoutedSiblingWritesCommitTargetHeadComment
100 75 TestEmbeddedVCStatusAndCommit
100 76 TestEmbeddedCloseAlreadyClosedContinue
100 76 TestEmbeddedCloseAlreadyClosedMultipleIDs
100 76 TestEmbeddedExportFormats
100 76 TestEmbeddedGCForceWithDecay
100 76 TestEmbeddedGCFullAndNoForcePrompts
100 76 TestEmbeddedInitAGitOriginRemote
100 76 TestEmbeddedLabelAddRemoveRemove
100 76 TestEmbeddedOnboardConcurrent
100 77 TestEmbeddedClaimPools
100 77 TestEmbeddedConfigNoWorkspaceStoreFreeCommands
100 77 TestEmbeddedCreateStorageClassConflicts
100 77 TestEmbeddedExternalCapabilityReadyAfterShip
100 77 TestEmbeddedHumanListStatsRespondDismiss
100 77 TestEmbeddedMemoryCorpusBudget
100 77 TestEmbeddedOrphansConcurrent
100 77 TestEmbeddedStatus
100 78 TestEmbeddedBranchConcurrent
100 78 TestEmbeddedComments
100 78 TestEmbeddedDepBRemove
100 78 TestEmbeddedLabelAddRemoveAdd
100 78 TestEmbeddedShip
100 78 TestEmbeddedUpdateFieldsNotesOverwrite
100 78 TestEmbeddedVCCommitVariantsAndMerge
100 78 TestEmbeddedVersionConcurrent
100 79 TestEmbeddedCreateCrossRepoUninit
100 79 TestEmbeddedDeleteJSONDependencyErrorContract
100 79 TestEmbeddedEpicCloseEligibleNotEligible
100 79 TestEmbeddedInitABasic
100 79 TestEmbeddedInitBRemoteSchemaAndCloneFailure
100 79 TestEmbeddedRenamePrefixEdgeCases
100 79 TestEmbeddedUpdateFieldsNotesClearAndDefer
100 80 TestEmbeddedCreateCrossRepoWithParent
100 80 TestEmbeddedCreateFormCommitsLabelOnlyCreate
100 80 TestEmbeddedCreateStorageClassBasic
100 80 TestEmbeddedRoutedMutatingSiblingAssignTagDepAssign
100 80 TestEmbeddedStatusConcurrent
100 80 TestEmbeddedSwarmCreate
100 80 TestEmbeddedSwarmValidate
100 81 TestEmbeddedAdminCompactTier2Honesty
100 81 TestEmbeddedBackup
100 81 TestEmbeddedDeleteForceAndBatch
100 81 TestEmbeddedGateCreateBeadCheck
100 81 TestEmbeddedGateList
100 81 TestEmbeddedRestoreConcurrent
100 81 TestEmbeddedStaleLabelFilters
100 81 TestEmbeddedStateConcurrent
100 82 TestEmbeddedCreateCrossRepoDryRunWithParent
100 82 TestEmbeddedDeleteBasic
100 82 TestEmbeddedDepBTreeAndCycles
100 82 TestEmbeddedDirectCommitPathsBatchAutoCommitDoesNotAdvanceHead
100 82 TestEmbeddedHooksConcurrent
100 82 TestEmbeddedImportFromSources
100 82 TestEmbeddedStale
100 83 TestEmbeddedAdminBlocked
100 83 TestEmbeddedAutoImportJSONLConcurrentWriter
100 83 TestEmbeddedInitBAutoCommitAndJSONLRemote
100 83 TestEmbeddedLabelEditReportsPrefix
100 83 TestEmbeddedMaxRowsDoctorAndConfig
100 83 TestEmbeddedPurgeFiltered
100 83 TestEmbeddedReadyConcurrent
100 84 TestEmbeddedDoltRemoteAdd_GitOriginCollision_Exits1
100 84 TestEmbeddedInitGitBootstrapRoutingDecoyInvalid
100 84 TestEmbeddedInitSelectedExcludeRoutingStealthInvalid
100 84 TestEmbeddedMigratePersonal_preservesComments
100 85 TestEmbeddedBootstrapExistingDryRunInit
100 85 TestEmbeddedChildrenBasicAndEmpty
100 85 TestEmbeddedCreateGraphAndBulk
100 85 TestEmbeddedCreateRepoRelativeExistingWorkspaceUnaffected
100 85 TestEmbeddedIfRevisionReopenGuardDirect
100 85 TestEmbeddedInitArtifactRouting
100 86 TestEmbeddedDoltRemoteAdd_DifferentURL_ProceedsNormally
100 86 TestEmbeddedExplicitHierarchicalParentEdges
100 86 TestEmbeddedInitHooksRouting
100 86 TestEmbeddedMigratePersonal_noopWhenEmpty
100 87 TestEmbeddedCreateRepoProxiedTargetError
100 87 TestEmbeddedGateInheritsDownParentChain
100 87 TestEmbeddedReadyClaimConcurrent
100 87 TestEmbeddedState
100 87 TestEmbeddedSupersedeConcurrent
100 87 TestEmbeddedSwarmCreateForceAndErrors
100 88 TestEmbeddedChangeDirOverridesInheritedBeadsDir
100 88 TestEmbeddedDepAAddAndList
100 88 TestEmbeddedKV
100 88 TestEmbeddedMaxRowsReadyMerge
100 88 TestEmbeddedPromoteCLI
100 88 TestEmbeddedUnclaimSuccess
100 89 TestEmbeddedBackupConcurrent
100 89 TestEmbeddedCreateDryRunDoesNotMigrate
100 89 TestEmbeddedGateShowResolve
100 89 TestEmbeddedInitBStealthAndForceReinit
100 89 TestEmbeddedLabelEditReportsNoop
100 89 TestEmbeddedShowBasicsAndJSON
100 90 TestEmbeddedAutoImportJSONLSkipsNonEmpty
100 90 TestEmbeddedConfig
100 90 TestEmbeddedFindDuplicatesConcurrent
100 90 TestEmbeddedLabelEditReportsListAndTemplate
100 90 TestEmbeddedLintConcurrent
100 90 TestEmbeddedUpdateLifecycleDefer
100 90 TestEmbeddedVersion
100 91 TestEmbeddedDuplicate
100 91 TestEmbeddedPreviewDoesNotConsumeVersionMarker
100 91 TestEmbeddedPruneDryRunAndFilters
100 91 TestEmbeddedReadOnlyCommandsSpawnNoGit
100 91 TestEmbeddedShowUnresolvableDeps
100 91 TestEmbeddedTypesAgreeWithCreate
100 92 TestEmbeddedAutoImportJSONLNoExplicitCommit
100 92 TestEmbeddedDefer
100 92 TestEmbeddedDepAAddTypesAndFlags
100 92 TestEmbeddedEpicCloseEligibleClosesEpics
100 92 TestEmbeddedSetup
100 92 TestEmbeddedSwarmStatusList
100 93 TestEmbeddedCreateStorageClassBatchAndMisc
100 93 TestEmbeddedDeletePreviewAndGuards
100 93 TestEmbeddedDepBRemoveOutputAndRelatesTo
100 93 TestEmbeddedListConcurrent
100 93 TestEmbeddedPruneSafetyAndScope
100 93 TestEmbeddedShowDetailAndCurrentFlags
100 94 TestEmbeddedCreateDryRunCrossRepoDoesNotMigrateTarget
100 94 TestEmbeddedDepListSingleIDWarnsOnDroppedExternalEdge
100 94 TestEmbeddedEpicCloseEligibleReasonOutput
100 94 TestEmbeddedFederationStatus
100 94 TestEmbeddedGCConcurrent
100 94 TestEmbeddedReadyDefaultJSONAndFlags
100 95 TestEmbeddedChildrenJSONAndAllStatuses
100 95 TestEmbeddedFindDuplicates
100 95 TestEmbeddedImportClosedChildWhoseParentWasDeleted
100 95 TestEmbeddedInitConcurrent
100 95 TestEmbeddedQuick
100 96 TestEmbeddedDiff
100 96 TestEmbeddedDuplicatesConcurrent
100 96 TestEmbeddedHistory
100 96 TestEmbeddedShowDetailAndCurrentHistoryAndCurrent
100 96 TestEmbeddedSquashWispMoleculeClearsRootEphemeral
100 97 TestEmbeddedDuplicatesOwnWorkspaces
100 97 TestEmbeddedHumanPositionalFileAndGuards
100 97 TestEmbeddedPurgeBasics
100 97 TestEmbeddedQuietFlagSuppressesSuccessOutput
100 97 TestEmbeddedSearchStatusLimitSortDatesMetadata
100 98 TestEmbeddedCloseBasicSharedStore
100 98 TestEmbeddedContributorCreateRoutesToPlanning
100 98 TestEmbeddedGCConditionalMatcherDecode
100 98 TestEmbeddedQuery
100 98 TestEmbeddedTodo
100 99 TestEmbeddedBlockedLabelFilters
100 99 TestEmbeddedDoltRemoteAndPush
100 99 TestEmbeddedEpicStatus
100 99 TestEmbeddedInitSelectedExcludeRoutingForkDecoyAuto
100 99 TestEmbeddedSearchQueryStatusAssigneeLabels
100 100 TestEmbeddedContributorCreateShowReadsRouted
100 100 TestEmbeddedCreateCrossRepo
100 100 TestEmbeddedInitGitBootstrapRoutingExistingExplicit
100 100 TestEmbeddedLint
100 100 TestEmbeddedPromoteCLIConcurrent

View file

@ -1,157 +0,0 @@
#!/usr/bin/env bash
# embedded-storage-test-shard.sh — run a shard of embedded dolt storage tests.
#
# Usage: embedded-storage-test-shard.sh <shard_number> <total_shards>
#
# Discovers all top-level Test* functions from
# internal/storage/embeddeddolt/*_test.go, excluding TestConformance. That
# suite runs in the dedicated test-embedded-conformance job instead, sharded
# by sub-test path (core/audit) rather than by top-level function name; this
# manifest's exact-name matching does not cover it. See
# engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md for why the two use different
# sharding mechanisms.
#
# Tests listed in embedded-storage-test-shards.txt for the requested shard
# count use that committed assignment; newly-added tests fall back to
# hash(name) % total. Runs the matching subset using the pre-built test
# binary at BEADS_TEST_EMBEDDED_TEST_BINARY (or /tmp/embeddeddolt-test).
#
# Every store-open in these tests re-runs the full migration chain, which
# grows with each migration (bd-lrgn1 pushed a slow runner past the old
# unsharded job's 20m). The manifest spreads TestEmbeddedMigration* /
# TestEmbeddedMigrate* tests round-robin across shards (~2-3 each of ~11
# total) rather than clustering them, so each shard's migration-chain
# overhead is a fraction of what the unsharded job carried.
#
# Environment:
# BEADS_TEST_EMBEDDED_DOLT=1 required (tests skip without it)
# BEADS_TEST_EMBEDDED_TEST_BINARY=<path> pre-built storage test binary
# (default: /tmp/embeddeddolt-test)
# BEADS_TEST_SHARD_LIST_ONLY=1 print selected tests without running them
set -euo pipefail
SHARD_NUMBER="${1:?usage: $0 <shard_number> <total_shards>}"
TOTAL_SHARDS="${2:?usage: $0 <shard_number> <total_shards>}"
shift 2
if ! [[ "$SHARD_NUMBER" =~ ^[0-9]+$ ]] || ! [[ "$TOTAL_SHARDS" =~ ^[0-9]+$ ]]; then
echo "Shard number and total shards must be positive integers" >&2
exit 1
fi
if (( TOTAL_SHARDS < 1 || SHARD_NUMBER < 1 || SHARD_NUMBER > TOTAL_SHARDS )); then
echo "Invalid shard ${SHARD_NUMBER}/${TOTAL_SHARDS}" >&2
exit 1
fi
SHARD_INDEX=$(( SHARD_NUMBER - 1 ))
MANIFEST="${BEADS_TEST_SHARD_MANIFEST:-.github/scripts/embedded-storage-test-shards.txt}"
# Discover all top-level Test* functions except TestConformance, which is
# sharded separately (core/audit sub-test partition in the workflow, not this
# manifest) because it is a single top-level function with sub-tests reached
# via -test.run path regex, not distinct top-level function names.
ALL_TESTS=$(grep -rh '^func Test' internal/storage/embeddeddolt/*_test.go \
| sed 's/func \(Test[A-Za-z0-9_]*\).*/\1/' \
| grep -v '^TestConformance$' \
| sort -u)
if [ -z "$ALL_TESTS" ]; then
echo "No Test* functions found" >&2
exit 1
fi
declare -A ALL_TEST_SET=()
while IFS= read -r name; do
ALL_TEST_SET["$name"]=1
done <<< "$ALL_TESTS"
declare -A MANIFEST_SHARDS=()
if [ -f "$MANIFEST" ]; then
while IFS= read -r line || [ -n "$line" ]; do
line="${line%%#*}"
read -r manifest_total manifest_shard test_name extra <<< "$line"
if [ -z "${manifest_total:-}" ]; then
continue
fi
if [ -n "${extra:-}" ] || ! [[ "$manifest_total" =~ ^[0-9]+$ ]] || ! [[ "$manifest_shard" =~ ^[0-9]+$ ]] || ! [[ "$test_name" =~ ^Test[A-Za-z0-9_]+$ ]] || [ "$test_name" = "TestConformance" ]; then
echo "Invalid shard manifest line: $line" >&2
exit 1
fi
if (( manifest_total != TOTAL_SHARDS )); then
continue
fi
if (( manifest_shard < 1 || manifest_shard > TOTAL_SHARDS )); then
echo "Invalid shard ${manifest_shard}/${manifest_total} for $test_name in $MANIFEST" >&2
exit 1
fi
if [ -n "${MANIFEST_SHARDS[$test_name]:-}" ]; then
echo "Duplicate shard manifest entry for $test_name in $MANIFEST" >&2
exit 1
fi
MANIFEST_SHARDS["$test_name"]="$manifest_shard"
done < "$MANIFEST"
fi
for name in "${!MANIFEST_SHARDS[@]}"; do
if [ -z "${ALL_TEST_SET[$name]:-}" ]; then
echo "Shard manifest entry does not match a discovered test: $name" >&2
exit 1
fi
done
SHARD_TESTS=()
MANIFEST_COUNT=0
FALLBACK_COUNT=0
while IFS= read -r name; do
assigned_shard="${MANIFEST_SHARDS[$name]:-}"
if [ -n "$assigned_shard" ]; then
if (( assigned_shard == SHARD_NUMBER )); then
SHARD_TESTS+=("$name")
MANIFEST_COUNT=$(( MANIFEST_COUNT + 1 ))
fi
continue
fi
# Use cksum for a portable numeric hash fallback for newly-added tests.
hash=$(printf %s "$name" | cksum | cut -d ' ' -f 1)
if (( hash % TOTAL_SHARDS == SHARD_INDEX )); then
SHARD_TESTS+=("$name")
FALLBACK_COUNT=$(( FALLBACK_COUNT + 1 ))
fi
done <<< "$ALL_TESTS"
if [ ${#SHARD_TESTS[@]} -eq 0 ]; then
echo "Shard ${SHARD_NUMBER}/${TOTAL_SHARDS}: no tests assigned (all hashed to other shards)"
exit 0
fi
# Build the -run regex: "^(TestA|TestB|TestC)$"
RUN_REGEX="^($(IFS='|'; echo "${SHARD_TESTS[*]}"))$"
echo "Shard ${SHARD_NUMBER}/${TOTAL_SHARDS}: running ${#SHARD_TESTS[@]} test(s)"
echo " manifest: ${MANIFEST_COUNT}, fallback: ${FALLBACK_COUNT}"
printf " %s\n" "${SHARD_TESTS[@]}"
echo ""
# Use pre-built test binary if available, otherwise fall back to go test.
STORAGE_BINARY="${BEADS_TEST_EMBEDDED_TEST_BINARY:-/tmp/embeddeddolt-test}"
if [ "${BEADS_TEST_SHARD_LIST_ONLY:-}" = "1" ]; then
exit 0
fi
# 20m, as embedded-test-shard.sh: under -race, TestBatchApplyContract alone
# takes ~10m at the 1000-item issueops.MaxApplyBatchItems cap, and the
# heaviest shard projects to ~13m (see embedded-storage-test-shards.txt).
# The jobs' timeout-minutes (25) leave room for setup after this fires.
if [ -x "$STORAGE_BINARY" ]; then
exec "$STORAGE_BINARY" -test.v -test.count=1 -test.timeout=20m \
-test.run "$RUN_REGEX" \
"$@"
else
echo "Warning: pre-built test binary not found at $STORAGE_BINARY, falling back to go test"
exec go test -tags=gms_pure_go -v -race -count=1 -timeout 20m \
-run "$RUN_REGEX" \
"$@" \
./internal/storage/embeddeddolt/
fi

View file

@ -1,608 +0,0 @@
# Embedded storage test shard manifest.
#
# Format: <total_shards> <shard_number> <top_level_test_name>
#
# There is no committed recent per-test duration artifact for these tests
# (engdocs/CI_CLEANUP_PLAN.md records only whole-job wall clock for the
# unsharded storage job, and engdocs/CI_TEST_SURFACE_AUDIT.md does not track
# per-test timing here either). This manifest assigns tests round-robin over
# the alphabetically sorted discovered-test list for the 5-shard CI matrix,
# which spreads adjacent same-prefix families (e.g. the seven
# TestEmbeddedMergeAndSettle* tests and the TestEmbeddedMigration* tests)
# across different shards instead of clustering them in one, as a balance
# heuristic in the absence of timing data. embedded-storage-test-shard.sh
# continues to hash-distribute newly-added tests that are not listed here. TestConformance is deliberately
# excluded — it runs in the separate test-embedded-conformance job, which
# shards by sub-test path (core/audit), not by top-level function name, and
# is a different mechanism from this manifest.
#
# Several tests are placed by measured -race duration instead (PR Risk run
# 36807191489, at the 1000-item issueops.MaxApplyBatchItems cap):
# TestBatchApplyContract (604s) on shard 4, which has ~3m of other tests,
# and TestLargeBatchApplyWallClock_Embedded (261s) on shard 5. Hashed,
# TestBatchApplyContract shared shard 2 with ~5m of other tests and ran it
# past the job's old 15m timeout; placed so, the heaviest shard projects to
# ~13m.
#
# TestLargeBatchApplyStatementCounts_Embedded (247s in that same run) was
# later split into TestLargeBatchApplyStatementCounts356_Embedded,
# TestLargeBatchApplyStatementCounts712_Embedded and
# TestLargeBatchApplyStatementCountsClassic40_Embedded (slice F1, CI shard
# balance; see internal/storage/embeddeddolt/large_batch_apply_measure_test.go).
# All 3 are kept on shard 2, where the single test used to live, rather than
# rebalanced across this frozen 5-shard block.
5 1 TestActiveDatabaseSizeFailsForMissingEmbeddedDatabase
5 2 TestActiveDatabaseSizeScopesToActiveEmbeddedDatabase
5 3 TestAddDependency
5 4 TestAddLabel
5 4 TestBatchApplyContract
5 5 TestBuildDSN_NoDatabase
5 1 TestBuildDSN_SpacesInPath
5 2 TestBuildDSN_WithDatabase
5 3 TestCleanGitRemoteCacheGarbage
5 4 TestCleanGitRemoteCacheGarbage_NoCacheDir
5 5 TestCleanGitRemoteCacheGarbage_Throttled
5 1 TestConcurrencyMultiProcess
5 2 TestConcurrentOpenReturnsCached
5 3 TestCountsIncludeWispDependencies
5 4 TestCreateIssue
5 5 TestCreateIssues
5 1 TestCreateIssuesRejectStaleUpserts
5 2 TestCreateRejectsCrossTableIDCollision
5 1 TestEmbeddedConfigCommitStagesConfig
5 2 TestEmbeddedDirtyTablesGate_BlocksReopenThenWorkingSetReconcileRecovers
5 3 TestEmbeddedGetMergeBlockersOnAQuietStore
5 4 TestEmbeddedMergeAndSettleDirtyWorkingSetSurvivesRefusedMerge
5 5 TestEmbeddedMergeAndSettleFKCascadeRepair
5 1 TestEmbeddedMergeAndSettleMemoryConfigConflict
5 2 TestEmbeddedMergeAndSettleMetadataConflict
5 3 TestEmbeddedMergeAndSettleRefusesUnknownTable
5 4 TestEmbeddedMergeAndSettleReportsOperatorConflicts
5 5 TestEmbeddedMergeAndSettleSkipsNonMemoryConfigConflict
5 1 TestEmbeddedMigrateConvergesUnderConcurrentInterruptedRetries_4566
5 2 TestEmbeddedMigrateRepairedDependenciesIDColumnCommitsAtomicallyWithVersion53_4690
5 3 TestEmbeddedMigrateSelfHealsAfterMidPassFault_4566
5 4 TestEmbeddedMigrateStepCommitLeavesUntouchedUserDirt_4566
5 5 TestEmbeddedMigration0047DelegatesToSplitTargetRepairAndConvergesThroughIgnoredChain
5 1 TestEmbeddedMigration0057ConvertsTextEventsColumnsToLongtext
5 2 TestEmbeddedMigration0058AddsOnlyMissingConstraintInMixedPopulation
5 3 TestEmbeddedMigration0058CleansOrphanedAndInvalidWispDependenciesRowsBeforeAddingConstraints
5 4 TestEmbeddedMigration0058HealsAlreadyAffectedDatabase
5 5 TestEmbeddedOpenForReadOnlyCommand_LenientGate
5 1 TestEmbeddedOpenReadOnly_FreshDatabaseNoWrites
5 2 TestEmbeddedOpenReadOnly_SkipsGateAndMigrations
5 3 TestEmbeddedRecomputeAllBlockedDirtyGraphIsTyped
5 4 TestEmbeddedRecomputeAllBlockedWiring
5 5 TestEmbeddedRemoteMigrateGate_BlocksReopen
5 1 TestEmbeddedSyncCommitsConfigBeforeMerge
5 4 TestEventsSinceEmbedded
5 5 TestGetDependentRecordsEmbedded
5 1 TestGetDependentRecordsForIssuesEmbedded
5 2 TestGetIssue
5 3 TestGetIssueCommentsPageEmbedded
5 4 TestGetLabels
5 5 TestGetNextChildID
5 1 TestGetReadyWorkIncludeEphemeralAppliesWispFilters
5 2 TestGetReadyWorkIncludeEphemeralExcludesNonReadyWisps
5 3 TestGetReadyWorkMoleculeFilter
5 4 TestHeartbeatRejectsWispEmbedded
5 5 TestHelperProcess
5 1 TestHistory_NullTextColumns
5 2 TestHookFiringStoreCreateIssuesFiresDependencyUpdatesFromEmbeddedStore
5 3 TestIsBlockedBatchEmbedded
5 2 TestLargeBatchApplyStatementCounts356_Embedded
5 2 TestLargeBatchApplyStatementCounts712_Embedded
5 2 TestLargeBatchApplyStatementCountsClassic40_Embedded
5 5 TestLargeBatchApplyWallClock_Embedded
5 4 TestLeaseLifecycleEmbedded
5 5 TestListWisps
5 1 TestOpenAfterCloseCreatesNewStore
5 2 TestOpenDifferentDirsReturnsDifferentStores
5 3 TestOpenReturnsCachedStore
5 4 TestPromoteStillWorksWithCollisionGuard
5 5 TestReclaimAnyReplicaOverride
5 1 TestReclaimExpiredLeaseSurvivesRestartEmbedded
5 2 TestReclaimRefusesForeignReplicaLease
5 3 TestReopenIssue
5 4 TestSchemaAfterInit
5 5 TestUnknownProvenanceLeaseStaysReclaimable
5 1 TestUpdateIssueType
5 2 TestUpdateMergeOps_DoltEngine
5 3 TestUpdateMergeOps_DoltEngine_TwoIssues
# Embedded-Dolt storage test shard manifest.
#
# Format: <total_shards> <shard_number> <top_level_test_name>
#
# 40-shard split for the Bazel-only embedded-Dolt storage tier
# (bazel-embedded in .github/workflows/bazel.yml), bin-packed
# longest-processing-time-first by measured wall-time from
# scripts/ci/embedded_storage_test_durations.json (see that file for provenance
# and its "relative weight, not absolute SLA" caveat).
# Regenerate with scripts/ci/gen_embedded_storage_shard_manifest.py 40
# --weights=duration --write after adding or removing Test* functions in
# internal/storage/embeddeddolt/*_test.go. --write is incremental: it
# keeps every already-assigned test on its current shard and only places
# newly-discovered names, onto whichever shard is currently lightest, so
# two unrelated PRs that each add one test do not textually conflict or
# silently invalidate each other's packing. Pass --repack to force a full
# from-scratch rebalance instead (a deliberate, separate change — expect a
# large diff). --check only verifies every discovered name is listed here
# exactly once (no stale or duplicate entries); it does NOT verify the
# packing is still well-balanced.
#
# This file is generated: notes added here are erased by the next
# regeneration. Add them to the generator or the durations file instead.
40 1 TestLifecycleCloseReopenContract
40 2 TestBatchApplyContract
40 3 TestActiveDatabaseSizeFailsForMissingEmbeddedDatabase
40 3 TestActiveDatabaseSizeScopesToActiveEmbeddedDatabase
40 3 TestBuildDSN_NoDatabase
40 3 TestBuildDSN_SpacesInPath
40 3 TestBuildDSN_WithDatabase
40 3 TestCleanGitRemoteCacheGarbage
40 3 TestCleanGitRemoteCacheGarbage_NoCacheDir
40 3 TestCleanGitRemoteCacheGarbage_Throttled
40 3 TestCommitAllOutOfBandChangeAndHonestNoOp
40 3 TestCreateBatchEquivalencePartsCoverEveryScenario
40 3 TestCreateBatchFastPathsMatchPerRowLarge_Embedded
40 3 TestCrossRecordInvariantContract
40 3 TestDepRekeyMarkerStillInIgnoredSeries
40 3 TestDoltCommitResponseLossIsIndeterminate
40 3 TestEmbeddedDependencyEditorRefusesADottedChildGatedOnItsOwnParent
40 3 TestEmbeddedDoltStoreIssueLifecycleBuildsOperations
40 3 TestEmbeddedDoltStoreIssueLifecycleRejectsNilStore
40 3 TestEmbeddedOpenReadOnly_FreshDatabaseNoWrites
40 3 TestEmbeddedSQLCommitResponseLossIsIndeterminate
40 3 TestEpochContract
40 3 TestExpectedRevisionContract
40 3 TestGitRefPinsMatchDolt
40 3 TestHasRepository
40 3 TestHelperProcess
40 3 TestLargeBatchApplyStatementCounts712_Embedded
40 3 TestLargeGraphCreateTiming_Embedded
40 3 TestLenientGateWarningBody_BluntRefusalKeepsSharedGuidance
40 3 TestLenientGateWarningBody_ShapedDecisions
40 3 TestLenientGateWarning_ComposedOutput
40 3 TestMain
40 3 TestPushCommitsPendingChangesFirst
40 3 TestRemoteEntryPointsUseVersionControlOps
40 3 TestRetentionContract
40 3 TestStageAndCommitAfterSQLCommitResponseLossIsIndeterminateAndNotReplayed
40 3 TestTransactionCleanupAfterSQLCommitIsIndeterminate
40 3 TestTransactionCleanupBeforeSQLCommitRemainsDefinite
40 3 TestUnknownProvenanceLeaseStaysReclaimable
40 4 TestBlockedListerContract
40 4 TestCreateBatchFastPathsMatchPerRowSmallDepAdd_Embedded
40 4 TestEmbeddedIssueOperationsUpdateLabelPatchOrdering
40 4 TestEmbeddedReaderGetMissIsNotFoundAndBackendFailureDoesNotDecay
40 4 TestEmbeddedReaderListFilterFamiliesNarrowToTheirRows
40 4 TestMergeAndSettleWithStrategy_EmptyStrategyMatchesMergeAndSettle
40 5 TestEmbeddedClaimerRefusesIncompleteRequestsAndAnAbsentIDWithoutTouchingState
40 5 TestEmbeddedIssueOperationsCloseAndReopenAWisp
40 5 TestEmbeddedReaderListKeysetPositionResumesTheCreatedDescIDAscOrder
40 5 TestRecordVersionKeepsSubSecondChangeAt
40 5 TestWithPeerAuth
40 6 TestCreateBatchFastPathsMatchPerRowApplyWaitsFor_Embedded
40 6 TestEmbeddedMergeAndSettleFKCascadeRepair
40 6 TestEmbeddedMergeAndSettleSkipsNonMemoryConfigConflict
40 6 TestEmbeddedReaderListKeysetPositionNarrowsWithoutReplacingTheOtherPredicates
40 6 TestEmbeddedRelationsAnswersAWispTargetInTheOutDirection
40 6 TestPromoteStillWorksWithCollisionGuard
40 6 TestSearchWithMissingWispPlaneTables
40 6 TestVersionedHistoryKeepsNumbersTheStoreDistinguishesApart
40 7 TestConcurrencyMultiProcess
40 7 TestEmbeddedBatchCloserRecordsOneHistoryEntryForWhatLanded
40 7 TestEmbeddedDependencyEditorAcceptsAnExternalTarget
40 7 TestEmbeddedDependencyEditorRelatesToAddLeavesItsSourceUnblocked
40 7 TestEmbeddedIssueOperationsUpdateMetadataReplaceClearsAndValidates
40 7 TestEmbeddedLenientOpenWarning_DataBehind
40 7 TestEmbeddedRelationsLeavesTheCallersRequestAlone
40 7 TestLoseVersionLeavesTheEpochTablesCommitted
40 7 TestMergeAndSettleWithStrategy_ResolvesDeclinedConflict
40 8 TestDeleterContract
40 8 TestEmbeddedDependencyEditorRoutesWispSourcedRemovalToTheWispPlane
40 8 TestEmbeddedMergeAndSettleDirtyWorkingSetSurvivesRefusedMerge
40 8 TestEmbeddedMintLeavesUpdatedAtWhereHistoryOffDoes
40 8 TestEmbeddedReaderGetBriefDepsProjectsTheDependencyRows
40 8 TestEmbeddedRelationsOrdersNeighborsFromBothPlanesTogether
40 8 TestEmbeddedReopenIssueCategorySemantics
40 8 TestGetIssueCommentsPageEmbedded
40 8 TestListWisps
40 9 TestBumpEpochCarryingNeitherCarriesNorServesARowFromAFutureEpoch
40 9 TestEmbeddedDependencyEditorRefusesCrossPlaneCycle
40 9 TestEmbeddedDependencyEditorSameTypeReAddIsIdempotent
40 9 TestEmbeddedDependencyEditorSnapshotsTheRequest
40 9 TestEmbeddedMigration0058AddsOnlyMissingConstraintInMixedPopulation
40 9 TestEmbeddedReaderReadyPageWiderThanTheHydrationBatchIsStillThatPrefix
40 9 TestEmbeddedReadyClaimerHydratesOnlyItsBlocksEdgesIntoTheCardinalities
40 9 TestGetReadyWorkIncludeEphemeralExcludesNonReadyWisps
40 9 TestPristineEmbeddedDoltFixtureRelocatesPrefixes
40 9 TestUpdateMergeOps_DoltEngine
40 10 TestEmbeddedClaimerStampsStartedAtOnceAcrossTheTwoWritesItChoosesBetween
40 10 TestEmbeddedDependencyEditorRemoveIsIdempotent
40 10 TestEmbeddedIssueOperationsUpdateClaimCASAndTransferMatrix
40 10 TestEmbeddedReaderGetResolvesTheExactIDAcrossBothPlanes
40 10 TestEmbeddedReaderReadyEphemeralPageKeepsBothPlanesCountsAtItsBoundary
40 10 TestGraphCounterContract
40 10 TestIgnoredCursorHealRespectsOperatorOverride
40 10 TestRunInTransactionPostCommitStageFailureIsIndeterminate
40 10 TestVersionedHistoryOffMatchesPreStackGolden_Embedded
40 10 TestWithPeerAuth_WarnsWhenStoredPeerSuppressesAmbientPasswordAmbient
40 11 TestABumpUnderOneStoreIDMovesTheEpochSeenThroughEveryStoreID
40 11 TestEmbeddedBatchCreateFirstVersionCarriesCreationTimeEdges
40 11 TestEmbeddedClaimerRefusalMessagesCarryTheirFragments
40 11 TestEmbeddedGuardedUpdateMintsOnceAfterItsPatches
40 11 TestEmbeddedMergeAndSettleRefusesUnknownTable
40 11 TestEmbeddedReaderListMaxRowsBoundaryIsLimitPlusOffset
40 11 TestEmbeddedReadyClaimerRecordsOneHistoryEntryForAWin
40 11 TestEventsJournal_ActorMatrixOnEmbedded
40 11 TestMemoriesContract
40 11 TestWithPeerAuth_WarnsWhenStoredPeerSuppressesAmbientPasswordStored
40 12 TestCounterExcludeStatusAcceptsAWorkspaceCustomStatusWithoutIncludeInfra
40 12 TestEmbeddedClaimerAcceptsAConfiguredActiveStatusAndRefusesAConfiguredWipOne
40 12 TestEmbeddedClaimerRefusesAWispIDAsNotFound
40 12 TestEmbeddedDependencyEditorVersionsOnlyARealAddOrRemove
40 12 TestEmbeddedIgnoredMigration0023RepairsForkLineageJournalShape
40 12 TestEmbeddedIssueOperationsCreateUnderAParentMintsTheNextChildID
40 12 TestEmbeddedReadyClaimerAnswersTheQuestionReaderReadyLists
40 12 TestHistoryPresenceContract
40 12 TestLifecycleUpdateContract
40 12 TestReaderListExcludeStatusAcceptsAWorkspaceCustomStatus
40 13 TestEmbeddedDepRekeyConvergesRenameChain
40 13 TestEmbeddedDependencyEditorAppliesParentChildBeforeBlockingEdges
40 13 TestEmbeddedDependencyEditorRefusesAGhostSource
40 13 TestEmbeddedIssueOperationsCreateParentChildRecomputesWaitsForClosure
40 13 TestEmbeddedIssueOperationsUpdateClaimPatchAppliesAfterClaim
40 13 TestEmbeddedIssueOperationsUpdateFoldsMetadataIntoOneEvent
40 13 TestEmbeddedPre0058RepairMarchesDriftedWispDependenciesToFinalShape
40 13 TestEmbeddedRelationsDirectionSelectsTheInverseGraph
40 13 TestGraphWalkPlansHonorJoinHints
40 14 TestBatchCreatorContract
40 14 TestBlockingAnnotatorContract
40 14 TestCountsIncludeWispDependencies
40 14 TestEmbeddedIssueOperationsPersistenceRollbackWispAndDetachedResults
40 14 TestEmbeddedOpenForRemoteSync_DataBehind
40 14 TestEmbeddedReaderOffsetSkipsTheRowsBeforeThePage
40 14 TestEmbeddedReaderReadyDefaultTypeExclusionsYieldToAnExplicitType
40 14 TestEmbeddedReadyClaimerClaimsTheFrontRowAndReturnsThePostClaimState
40 14 TestEmbeddedReadyClaimerDoesNotMutateTheCallerRequest
40 14 TestHeartbeatIssueCommitsARefusalOnlyWhenItReadTheIssueEmbedded
40 14 TestHistory_NullTextColumns
40 15 TestCreateIssuesRejectStaleUpserts
40 15 TestDecryptPassword_ShortCiphertextClassifiesAsKeyMismatch
40 15 TestEmbeddedGetMergeBlockersOnAQuietStore
40 15 TestEmbeddedIgnoredMigration0023NoopsWithoutItsTables
40 15 TestEmbeddedIssueOperationsRequestValuesAreNotMutated
40 15 TestEmbeddedReaderReadyBriefDropsTheFreeFormTextAndNothingElse
40 15 TestEmbeddedRelationsFiltersByAnOpenTypeVocabulary
40 15 TestGetIssue
40 15 TestLegacyTrackedIgnoredCursorHealsOnOpen
40 15 TestMoleculeContract
40 15 TestReadyWorkPageTotalFilterMatrix
40 16 TestDescendantWalkReachesEveryTargetKindAndStopsOnCycles
40 16 TestEmbeddedDependencyEditorAddedEchoesTheRequestOrder
40 16 TestEmbeddedDependencyEditorRemovesOnlyTheNamedEdge
40 16 TestEmbeddedReaderDoesNotMutateTheCallerRequest
40 16 TestEmbeddedReaderListLimitBoundaryUnderASortTheDatabaseCanExpress
40 16 TestEmbeddedRenameKeepsDependencyIDsDeterministic
40 16 TestExternalCapabilityBlocksEmbeddedReadyAndAppearsInTree
40 16 TestGetReadyWorkIncludeEphemeralAppliesWispFilters
40 16 TestMergeWithStrategy_OursKeepsLocal
40 16 TestWithPeerAuth_DivergedRemoteURLFailsClosed
40 17 TestAddDependency
40 17 TestEmbeddedBatchCloserWispItemClosesAndEarnsTheClaim
40 17 TestEmbeddedDependencyEditorSameTypeReAddWithChangedThreadMintsOneVersion
40 17 TestEmbeddedIssueOperationsUpdateIssuePlaneOnlyRefusesWisps
40 17 TestEmbeddedIssueOperationsUpdateStatusCrossingSettlesAConditionalBlocksDepender
40 17 TestEmbeddedReaderListRejectsATypeOutsideTheWorkspaceVocabulary
40 17 TestEmbeddedReadyClaimerLeasesADurableWinButNotAnEphemeralOne
40 17 TestHeartbeatMatchesActorAcrossSpellingEmbedded
40 17 TestStatsReporterContract
40 17 TestVersionReconcilerContract
40 18 TestCreateBatchParticipationGeneration
40 18 TestEmbeddedBatchCloserIdempotentRecloseIsAPerItemSuccess
40 18 TestEmbeddedDependencyEditorMixedBatchWritesBothPlanes
40 18 TestEmbeddedIssueOperationsUpdateRawMetadataTakesTheFunnelsValueShapes
40 18 TestEmbeddedMergeAndSettleMemoryConfigConflict
40 18 TestEmbeddedReaderListIncludeEphemeralMergesThePlanesIntoOneOrder
40 18 TestEmbeddedReaderListParentReachesEveryDescendantAndOnlyItsOwn
40 18 TestMetadataCASContract
40 18 TestOpenDifferentDirsReturnsDifferentStores
40 18 TestPromoteClearsNoHistory
40 18 TestRemoteVerbPlainRemoteWithoutAuthPresentsNone
40 19 TestEmbeddedDependencyEditorRetypeRefusalLeavesTheOriginalEdge
40 19 TestEmbeddedIssueOperationsUpdateInvalidIssueTypePreservesValidationSentinel
40 19 TestEmbeddedMigration0062FlipsEventsToIgnoredPlane
40 19 TestEmbeddedReaderListMaxRowsIsHonored
40 19 TestEmbeddedRelationsAnswersInThePinnedOrder
40 19 TestIgnoredCursorHealConvergesFromEveryCrashState
40 19 TestOpenAfterCloseCreatesNewStore
40 19 TestOpenReturnsCachedStore
40 19 TestParticipationGenerationFixtureKitIsWired
40 19 TestRemoteVerbsPresentStoredPeerCredentials
40 19 TestRenameLabelMintsOneVersionPerTouchedBead
40 20 TestBumpEpochCarryingCarriesOnlyTheLineageHoldingTheNewestRow
40 20 TestCreateIssue
40 20 TestEmbeddedCheckedWrappersRouteTheirPreconditions
40 20 TestEmbeddedIssueOperationsCreateRoutesInfraTypesToWisps
40 20 TestEmbeddedMigrateStepCommitLeavesUntouchedUserDirt_4566
40 20 TestEmbeddedOpenReadOnly_SkipsGateAndMigrations
40 20 TestEmbeddedReadyClaimerClaimsAnEphemeralRowTheFilterAdmits
40 20 TestEventsJournalRestartAndRetentionBoundary
40 20 TestForeignSkipDetailIsBounded
40 20 TestHeartbeatRejectsWispEmbedded
40 20 TestIgnoredCursorHealNeverResurrectsRolledBackVersions
40 21 TestBumpEpochCarryingCarriesTheLiveRowsOfEveryStoreInTheDatabase
40 21 TestCreateRejectsCrossTableIDCollision
40 21 TestEmbeddedBatchCloserItemsAnswerToTheCloseGuards
40 21 TestEmbeddedDependencyEditorAcceptsATypeOutsideTheConstants
40 21 TestEmbeddedIssueOperationsUpdateParentStagesBlockedStateAndRollsBackFailure
40 21 TestEmbeddedMigration0047DelegatesToSplitTargetRepairAndConvergesThroughIgnoredChain
40 21 TestEmbeddedRelationsLeavesAnExternalTargetOutOfTheAnswer
40 21 TestEmbeddedRemoteMigrateGate_BlocksReopen
40 21 TestEmbeddedRoleFixtureKitCountHistoryMovesWithACommit
40 21 TestEmbeddedTransactionStandaloneWispLifecyclePersistsWithoutDoltCommit
40 21 TestLargeBatchApplyWallClock_Embedded
40 22 TestEdgeReaderContract
40 22 TestEmbeddedDepRekeyAbortLeavesMarkerUnrecorded
40 22 TestEmbeddedDepRekeyRefusesToWriteIntoDirtyDependencies
40 22 TestEmbeddedDependencyEditorRefusesSelfDependencyWithTheProbeSkipped
40 22 TestEmbeddedReaderListStatusAcceptsACommaSeparatedORSet
40 22 TestEmbeddedReaderReadyLimitBoundary
40 22 TestEventsAutoPruneKeepsAnUnboundedJournalUnbounded
40 22 TestEventsJournalPruneNeverSplitsASkewedPair
40 22 TestLargeBatchApplyStatementCounts356_Embedded
40 22 TestLeaseLifecycleEmbedded
40 22 TestPolicyBlockingAnnotatorForeignOpensAreSublinear
40 23 TestAsOfReadContract
40 23 TestEmbeddedBatchCloserBackendFailureReturnsNoOutcomes
40 23 TestEmbeddedBatchCloserClaimNextHydratesWhenSomethingClosed
40 23 TestEmbeddedDependencyEditorAcceptsBlockingAcrossIssueTypes
40 23 TestEmbeddedDependencyEditorRecordsNoHistoryForAnAllEphemeralRequest
40 23 TestEmbeddedMigrateConvergesUnderConcurrentInterruptedRetries_4566
40 23 TestEmbeddedReaderListEmptyPageIsWellFormed
40 23 TestEmbeddedReadyClaimerFencesTheClaimByEveryLabelSetAndTheParentItWasGiven
40 23 TestEmbeddedRoleFixtureKitHooksAreUsable
40 23 TestEventsAutoPruneBoundsTheJournalToTheFloors
40 23 TestJournalContract
40 24 TestBootstrapperContract
40 24 TestEmbeddedBatchCloserOutcomesMirrorItemsIndexForIndex
40 24 TestEmbeddedClaimerReclaimsAcrossSpellingWithoutWriting
40 24 TestEmbeddedConfigCommitStagesConfig
40 24 TestEmbeddedIgnoredSeriesConvergesWithFreshInitShape
40 24 TestEmbeddedIssueOperationsCreateWithDependenciesSettlesInTheCreatingTransaction
40 24 TestEmbeddedMigrateSelfHealsAfterMidPassFault_4566
40 24 TestEmbeddedReaderListQueryMatchesTheTitleOrTheID
40 24 TestEmbeddedReaderListWispTypeNarrowsTheAdmittedPlaneRatherThanAdmittingIt
40 24 TestIgnoredCursorHealResumeRespectsOperatorOverride
40 24 TestLargeBatchApplyStatementCountsClassic40_Embedded
40 24 TestReopenIssue
40 25 TestBatchGetterContract
40 25 TestDatabases
40 25 TestDualWriteFixtureKitIsWired
40 25 TestEmbeddedBatchCloserClaimNextIsNilWhenNothingClosed
40 25 TestEmbeddedIssueOperationsUpdateClaimHonorsConfiguredActiveStatuses
40 25 TestEmbeddedReadyClaimerLeavesEphemeralRowsOutOfTheDefaultReadySet
40 25 TestEmbeddedReadyClaimerRejectsLimitOffsetBriefAndEmptyActor
40 25 TestGetDependentRecordsForIssuesEmbedded
40 25 TestHeartbeaterContract
40 25 TestIgnoredCursorHealIsIdempotent
40 25 TestIsBlockedBatchEmbedded
40 25 TestReadyWorkPageTotal
40 25 TestWithPeerAuth_RestoresAbsentEnv
40 26 TestEmbeddedIssueOperationsCreateClosedDerivesTheClosedStamp
40 26 TestEmbeddedMigration0058CleansOrphanedAndInvalidWispDependenciesRowsBeforeAddingConstraints
40 26 TestEmbeddedOpenForReadOnlyCommand_LenientGate
40 26 TestEmbeddedReaderListReadyFlagCarriesTheAssigneeAndPriorityFilters
40 26 TestEmbeddedReaderReadyParentScopesToItsTransitiveDescendants
40 26 TestEmbeddedReadyClaimerSkipsIneligibleFrontRows
40 26 TestEmbeddedRecomputeAllBlockedDirtyGraphIsTyped
40 26 TestEmbeddedRelationsRefusesTheZeroDirection
40 26 TestHookFiringStoreCreateIssuesFiresDependencyUpdatesFromEmbeddedStore
40 26 TestReclaimAnyReplicaOverride
40 26 TestWithPeerAuth_EnvFallbackDoesNotObservePeerCredentials
40 27 TestEmbeddedBatchCloserDurableHistoryNeverNamesAWisp
40 27 TestEmbeddedBatchCloserRequestValidationReturnsZeroResultAndChangesNothing
40 27 TestEmbeddedDependencyEditorAcceptsADiamond
40 27 TestEmbeddedDependencyEditorAddMarksItsSourceInTheSameVerb
40 27 TestEmbeddedMigration0058HealsAlreadyAffectedDatabase
40 27 TestEmbeddedReaderGetOptionalRowListsAreOffByDefault
40 27 TestEmbeddedRelationsRefusesATypeFilterOverTheColumnLength
40 27 TestEventsJournalReadRefusesAnInteriorHole
40 27 TestPartitionWispIDs
40 27 TestRemoteGitDataRefOnEngine
40 27 TestSweeperContract
40 28 TestBumpEpochCarryingDoesNotCarryALostLineage
40 28 TestEmbeddedBatchCloserForceBypassesOnlyClosePolicy
40 28 TestEmbeddedBatchCloserSettlesTheDependersOfWhatItClosed
40 28 TestEmbeddedClaimerClaimsAnUnassignedOpenIssueAndAnswersTheBareRow
40 28 TestEmbeddedClaimerReclaimsItsOwnInProgressIssueWithoutWriting
40 28 TestEmbeddedClaimerTakesAPoolAssignedIssueButRefusesAForeignHolder
40 28 TestEmbeddedIssueOperationsUpdateLabelPatchValueRules
40 28 TestEmbeddedIssueOperationsUpdateRefusesATypeOutsideTheWorkspaceVocabulary
40 28 TestEmbeddedReaderListReadyFlagAnswersTheBlockerAwareSet
40 28 TestRenameLabel
40 28 TestUpdateIssueType
40 28 TestWithPeerAuth_RestoresEnvWhenCallbackFails
40 29 TestEmbeddedBatchCloserClaimFilterValueFailureIsARequestValidationFailure
40 29 TestEmbeddedBatchCloserClaimNextIsNilWhenTheFrontIsEmpty
40 29 TestEmbeddedDepRekeyMergesFreshDuplicateEdges
40 29 TestEmbeddedDependencyEditorRecordsOneHistoryEntryPerLandedRequest
40 29 TestEmbeddedMergeAndSettleMetadataConflict
40 29 TestEmbeddedReaderListDefaultExclusionsAndTheirOverrides
40 29 TestEmbeddedReaderListTimeBoundsAreStrictAndWholeSecond
40 29 TestEmbeddedReaderReadySetOwnsItsStatusPinnedAndTemplateDecisions
40 29 TestEmbeddedTransactionSameStatusDoesNotPublishUnrelatedDurableChanges
40 29 TestEventsJournalAccessor
40 29 TestLeaseReclaimerContract
40 29 TestLifecycleCreateContract
40 30 TestCounterContract
40 30 TestCycleDetectorContract
40 30 TestEmbeddedClaimerTakesAnOpenIssueTheActorAlreadyHolds
40 30 TestEmbeddedCommitToleratesNothingToCommit
40 30 TestEmbeddedEveryAcceptedLifecycleMutationMintsOneVersion
40 30 TestEmbeddedIssueOperationsUpdateClaimConflictCarriesTheLosingState
40 30 TestEmbeddedIssueOperationsUpdateStampsStartedAtOnceOnTheFirstInProgress
40 30 TestEmbeddedReaderReadySortPoliciesOrderTheSameRows
40 30 TestEmbeddedTransactionStandaloneWispMutationDoesNotPublishUnrelatedDurableChanges
40 30 TestLegacyTrackedIgnoredCursorUnwedgesPull
40 30 TestUpdateMergeOps_DoltEngine_TwoIssues
40 31 TestBumpEpochCarryingWritesOneCarryRowPerLiveIDNamingTheLineageRoot
40 31 TestDualWriteContract
40 31 TestEmbeddedDependencyEditorAcceptsAForeignRepoTarget
40 31 TestEmbeddedDependencyEditorMaintainsBlockedStateAcrossPlanes
40 31 TestEmbeddedDependencyEditorWritesTheTargetIntoItsTypedColumn
40 31 TestEmbeddedMigrateConsent_BehindAndDirtyWorkingSetReconcileRecovers
40 31 TestEmbeddedReaderListPriorityKeysetWalkOverAnOversizedEqualKeyRunLosesNothingAndRepeatsNothing
40 31 TestEmbeddedTransactionWispLifecyclePersistsDurableDependent
40 31 TestEventsSinceEmbedded
40 31 TestGetLabels
40 31 TestReadyCounterContract
40 31 TestWithPeerAuth_KeyMismatchFailsClosed
40 32 TestCurrentAddressForNeverReseedsAnAbsentStoreEpochRow
40 32 TestEmbeddedClaimerGrantsALiveLeaseOnTheRowItWonAndLeavesARefusedOneAlone
40 32 TestEmbeddedDependencyEditorRefusesAMissingLocalTarget
40 32 TestEmbeddedDirtyTablesGate_BlocksReopenThenWorkingSetReconcileRecovers
40 32 TestEmbeddedIgnoredMigration0019CreatesEventsForFreshClones
40 32 TestEmbeddedIssueOperationsCreateReverseNonBlockingStagesConcreteTables
40 32 TestEmbeddedReadyClaimerEmptyFrontIsNormal
40 32 TestEmbeddedRecomputeAllBlockedWiring
40 32 TestEventsJournal_EmbeddedConcurrentGaplessNoDup
40 32 TestGetNextChildID
40 32 TestRemoteVerbPlainRemoteKeepsAmbientEnv
40 32 TestWithPeerAuth_MissingRemoteFailsClosed
40 33 TestEmbeddedBatchCloserDuplicateItemRecloseAtItsOwnIndex
40 33 TestEmbeddedDependencyEditorClosedChildAddSatisfiesAnAnyChildrenGate
40 33 TestEmbeddedDependencyEditorValidationRefusalsWriteNothing
40 33 TestEmbeddedIgnoredMigration0023NoopsOnHealthyWorkspace
40 33 TestEmbeddedMoveIssuePersistenceEphemeralNoHistorySmoke
40 33 TestEmbeddedRelationsResolvesTheAnchorIDExactly
40 33 TestEmbeddedSyncCommitsConfigBeforeMerge
40 33 TestEventsAutoPruneThrottleSkipsTheSecondPass
40 33 TestFirstMintLeavesTheEpochTablesCommitted
40 33 TestGetDependentRecordsEmbedded
40 33 TestPruneEventsBatchDeletesTheLowestSeqsOnly
40 33 TestTreeWalkerContract
40 34 TestAddLabel
40 34 TestBumpEpochCarryingLeavesTheEpochTablesCommitted
40 34 TestDecryptPassword_KeyMismatchNamesTheLocalKey
40 34 TestEmbeddedBlockedRecheckRecordsUnblockingWrites
40 34 TestEmbeddedDependencyEditorAttributesItsEventsToTheActor
40 34 TestEmbeddedDependencyEditorSameTypeReAddWithIdenticalMetadataIsANoOp
40 34 TestEmbeddedIssueOperationsCreateAggregatesRelations
40 34 TestEmbeddedReaderReadyDeferredAndEphemeralGates
40 34 TestEmbeddedReaderReadyPageIsThePrefixOfTheUnboundedAnswerCountsIncluded
40 34 TestMergeWithStrategy_TheirsResolvesAndCommits
40 34 TestQuerierContract
40 34 TestReadyWorkStatementBudget
40 35 TestEmbeddedBatchCloserAllIdempotentBatchLandsNothing
40 35 TestEmbeddedClaimIssueWrapperClaimsTheWispPlane
40 35 TestEmbeddedDependencyEditorGateScopeFollowsTheEdgeType
40 35 TestEmbeddedDependencyEditorRefusesASamePlaneEdgeClosingACrossPlaneCycle
40 35 TestEmbeddedDependencyEditorRepeatsWithinOneRequestCollapse
40 35 TestEmbeddedIssueOperationsUpdateAllScalarAndPointerFieldsReportChanged
40 35 TestEmbeddedIssueOperationsUpdateWritesEveryScalarPatchField
40 35 TestMerge_NoStrategyStillErrorsWithEscapeHatchHint
40 35 TestReadEventsAutoPruneStateResolvesBothHalvesInOneQuery
40 35 TestReadyWorkWithMissingDeferredParentTables
40 35 TestReclaimExpiredLeaseSurvivesRestartEmbedded
40 36 TestBumpEpochCarryingFailsAndRollsBackWhenARowAlreadyExistsAtTheNewEpoch
40 36 TestCommenterContract
40 36 TestConcurrentOpenReturnsCached
40 36 TestEmbeddedBatchCloserAllRefusedBatchRecordsNoHistory
40 36 TestEmbeddedDependencyEditorRefusalWritesNothing
40 36 TestEmbeddedDependencyEditorSkipPerEdgeCycleCheckDropsOnlyTheProbe
40 36 TestEmbeddedMigration0057ConvertsTextEventsColumnsToLongtext
40 36 TestEmbeddedReaderListReadyFlagRefusesAFilterItCannotCarry
40 36 TestEmbeddedRelationsRefusesAnUnusableTypeFilter
40 36 TestGetReadyWorkMoleculeFilter
40 36 TestReleaserContract
40 36 TestSchemaAfterInit
40 37 TestEmbeddedBatchCloserClaimNextSeesAnUnblockingFromItsOwnBatch
40 37 TestEmbeddedBatchCloserOutcomeSnapshotIsTheDocumentedShape
40 37 TestEmbeddedDependencyEditorRecordsOneHistoryEntryForAMixedPlaneRequest
40 37 TestEmbeddedDependencyEditorRefusesACycleThroughAParentChildHop
40 37 TestEmbeddedDependencyEditorRemoveUnmarksItsSourceAndDescendants
40 37 TestEmbeddedIssueOperationsCreateEmptyIDPreservesParentAndReverseDependencies
40 37 TestEmbeddedLenientOpenWarning_OtherRefusalsKeepBluntGuidance
40 37 TestEmbeddedMergeAndSettleReportsOperatorConflicts
40 37 TestEmbeddedReaderListBriefDropsTheFreeFormTextAndNothingElse
40 37 TestEmbeddedReaderListNaturalNumericIDSortTrimsAfterTheFetch
40 37 TestEpochWritesReportAnUnpublishedCommitAsIndeterminate
40 37 TestIgnoredCursorHealRespectsOverrideUnderBroaderPattern
40 38 TestCreateIssues
40 38 TestEmbeddedClaimerRefusesABuiltInIneligibleStatusWithTheStateThatRefusedIt
40 38 TestEmbeddedDependencyEditorRefusesBlockingEdgeAcrossItsOwnHierarchy
40 38 TestEmbeddedIssueOperationsUpdateClosedFieldsMatchClose
40 38 TestEmbeddedIssueOperationsUpdateNotesConflictPreservesValidationSentinel
40 38 TestEmbeddedReaderGetDetailShapeMatchesTheSeededIssue
40 38 TestEmbeddedReaderListCountsAreBlocksOnlyWhereGetCountsEveryEdge
40 38 TestEmbeddedReaderListKeysetWalkOverAnOversizedGroupLosesNothingAndRepeatsNothing
40 38 TestEmbeddedTempRebuildIntermediatesNeverReachHistory
40 38 TestEventsJournalPruneWhenEveryRowIsOlderThanTheCutoff
40 38 TestPolicyBlockingAnnotatorBatchEqualsPerItem
40 38 TestWithPeerAuth_ConcurrentPeersDoNotMixCredentials
40 39 TestDualWriteContractFlagOff
40 39 TestEmbeddedBatchCloserPerItemRefusalIsAResultAndSurvivorsCommit
40 39 TestEmbeddedBlockedRecheckFailureKeepsTheWrite
40 39 TestEmbeddedDependencyEditorMixedBatchRefusalRollsBackBothPlanes
40 39 TestEmbeddedIssueOperationsClaimLeavesBlockedStateAlone
40 39 TestEmbeddedMigrateRepairedDependenciesIDColumnCommitsAtomicallyWithVersion53_4690
40 39 TestEmbeddedReaderListSkipCountsDropsTheCardinalitiesAndNothingElse
40 39 TestEmbeddedRelationsResolvesAWispAnchor
40 39 TestParticipationGenerationFence
40 39 TestPreviewStoreRefusesLocalMetadataWrite
40 39 TestReclaimRefusesForeignReplicaLease
40 39 TestWorkspaceConfigContract
40 40 TestCountsWithMissingWispPlaneTables
40 40 TestEmbeddedBatchCloserDoesNotMutateTheCallerRequest
40 40 TestEmbeddedBlockedRecheckSettlesWhatTheWriteRecorded
40 40 TestEmbeddedDepRekeyRepairsHalfRekeyedDuplicateEdge
40 40 TestEmbeddedDependencyEditorRefusesBlockingEdgeAcrossAWispHierarchy
40 40 TestEmbeddedDependencyEditorRoutesWispSourcedEdgeToTheWispPlane
40 40 TestEmbeddedDependencyEditorSameTypeReAddWithChangedMetadataMintsOneVersion
40 40 TestEmbeddedIssueOperationsUpdateStatusCrossingSettlesDependers
40 40 TestEmbeddedOpenForRemoteSync_OtherRefusalsStayFatal
40 40 TestEmbeddedRelationsSeparatesNoNeighborsFromNoSuchIssue
40 40 TestEmbeddedReopenCustomDoneFallsBackWhenNormalizedTableMissing

View file

@ -1,139 +0,0 @@
#!/usr/bin/env bash
# embedded-test-shard.sh — run a shard of embedded dolt cmd/bd tests.
#
# Usage: embedded-test-shard.sh <shard_number> <total_shards>
#
# Discovers all TestEmbedded* top-level functions in cmd/bd/*_test.go.
# Tests listed in embedded-cmd-test-shards.txt for the requested shard count use
# that committed assignment; newly-added tests fall back to hash(name) % total.
# Runs the matching subset using the pre-built test binary at
# BEADS_TEST_CMD_BINARY (or /tmp/bd-cmd-test).
#
# Environment:
# BEADS_TEST_EMBEDDED_DOLT=1 required (tests skip without it)
# BEADS_TEST_BD_BINARY=<path> optional pre-built bd binary (used by tests)
# BEADS_TEST_CMD_BINARY=<path> pre-built cmd/bd test binary (default: /tmp/bd-cmd-test)
# BEADS_TEST_SHARD_LIST_ONLY=1 print selected tests without running them
set -euo pipefail
SHARD_NUMBER="${1:?usage: $0 <shard_number> <total_shards>}"
TOTAL_SHARDS="${2:?usage: $0 <shard_number> <total_shards>}"
shift 2
if ! [[ "$SHARD_NUMBER" =~ ^[0-9]+$ ]] || ! [[ "$TOTAL_SHARDS" =~ ^[0-9]+$ ]]; then
echo "Shard number and total shards must be positive integers" >&2
exit 1
fi
if (( TOTAL_SHARDS < 1 || SHARD_NUMBER < 1 || SHARD_NUMBER > TOTAL_SHARDS )); then
echo "Invalid shard ${SHARD_NUMBER}/${TOTAL_SHARDS}" >&2
exit 1
fi
SHARD_INDEX=$(( SHARD_NUMBER - 1 ))
MANIFEST="${BEADS_TEST_SHARD_MANIFEST:-.github/scripts/embedded-cmd-test-shards.txt}"
# Discover all top-level TestEmbedded* functions across every cmd/bd test
# file, by name rather than by file glob (as proxied-test-shard.sh does): a
# test gated on BEADS_TEST_EMBEDDED_DOLT runs in this lane or in none, wherever
# it lives. scripts/embedded_lane_coverage_test.go fails on a gated test this
# selection misses.
ALL_TESTS=$(grep -rh '^func TestEmbedded' cmd/bd/*_test.go \
| sed 's/func \(TestEmbedded[A-Za-z0-9_]*\).*/\1/' \
| sort -u)
if [ -z "$ALL_TESTS" ]; then
echo "No TestEmbedded* functions found" >&2
exit 1
fi
declare -A ALL_TEST_SET=()
while IFS= read -r name; do
ALL_TEST_SET["$name"]=1
done <<< "$ALL_TESTS"
declare -A MANIFEST_SHARDS=()
if [ -f "$MANIFEST" ]; then
while IFS= read -r line || [ -n "$line" ]; do
line="${line%%#*}"
read -r manifest_total manifest_shard test_name extra <<< "$line"
if [ -z "${manifest_total:-}" ]; then
continue
fi
if [ -n "${extra:-}" ] || ! [[ "$manifest_total" =~ ^[0-9]+$ ]] || ! [[ "$manifest_shard" =~ ^[0-9]+$ ]] || ! [[ "$test_name" =~ ^TestEmbedded[A-Za-z0-9_]+$ ]]; then
echo "Invalid shard manifest line: $line" >&2
exit 1
fi
if (( manifest_total != TOTAL_SHARDS )); then
continue
fi
if (( manifest_shard < 1 || manifest_shard > TOTAL_SHARDS )); then
echo "Invalid shard ${manifest_shard}/${manifest_total} for $test_name in $MANIFEST" >&2
exit 1
fi
if [ -n "${MANIFEST_SHARDS[$test_name]:-}" ]; then
echo "Duplicate shard manifest entry for $test_name in $MANIFEST" >&2
exit 1
fi
MANIFEST_SHARDS["$test_name"]="$manifest_shard"
done < "$MANIFEST"
fi
for name in "${!MANIFEST_SHARDS[@]}"; do
if [ -z "${ALL_TEST_SET[$name]:-}" ]; then
echo "Shard manifest entry does not match a discovered test: $name" >&2
exit 1
fi
done
SHARD_TESTS=()
MANIFEST_COUNT=0
FALLBACK_COUNT=0
while IFS= read -r name; do
assigned_shard="${MANIFEST_SHARDS[$name]:-}"
if [ -n "$assigned_shard" ]; then
if (( assigned_shard == SHARD_NUMBER )); then
SHARD_TESTS+=("$name")
MANIFEST_COUNT=$(( MANIFEST_COUNT + 1 ))
fi
continue
fi
# Use cksum for a portable numeric hash fallback for newly-added tests.
hash=$(printf %s "$name" | cksum | cut -d ' ' -f 1)
if (( hash % TOTAL_SHARDS == SHARD_INDEX )); then
SHARD_TESTS+=("$name")
FALLBACK_COUNT=$(( FALLBACK_COUNT + 1 ))
fi
done <<< "$ALL_TESTS"
if [ ${#SHARD_TESTS[@]} -eq 0 ]; then
echo "Shard ${SHARD_NUMBER}/${TOTAL_SHARDS}: no tests assigned (all hashed to other shards)"
exit 0
fi
# Build the -run regex: "^(TestA|TestB|TestC)$"
RUN_REGEX="^($(IFS='|'; echo "${SHARD_TESTS[*]}"))$"
echo "Shard ${SHARD_NUMBER}/${TOTAL_SHARDS}: running ${#SHARD_TESTS[@]} test(s)"
echo " manifest: ${MANIFEST_COUNT}, fallback: ${FALLBACK_COUNT}"
printf " %s\n" "${SHARD_TESTS[@]}"
echo ""
# Use pre-built test binary if available, otherwise fall back to go test.
CMD_BINARY="${BEADS_TEST_CMD_BINARY:-/tmp/bd-cmd-test}"
if [ "${BEADS_TEST_SHARD_LIST_ONLY:-}" = "1" ]; then
exit 0
fi
if [ -x "$CMD_BINARY" ]; then
exec "$CMD_BINARY" -test.v -test.count=1 -test.timeout=20m \
-test.run "$RUN_REGEX" \
"$@"
else
echo "Warning: pre-built test binary not found at $CMD_BINARY, falling back to go test"
exec go test -tags=gms_pure_go -v -race -count=1 -timeout 20m \
-run "$RUN_REGEX" \
"$@" \
./cmd/bd/
fi

View file

@ -1,288 +0,0 @@
# Proxied-server cmd test shard manifest.
#
# Format: <total_shards> <shard_number> <top_level_test_name>
#
# 34-shard split for the Bazel-only proxied-server tier
# (bazel-proxied in .github/workflows/bazel.yml), bin-packed
# longest-processing-time-first by measured wall-time from
# scripts/ci/proxied_test_durations.json (see that file for
# provenance and its "relative weight, not absolute SLA" caveat).
# Regenerate with scripts/ci/gen_proxied_shard_manifest.py 34
# --weights=duration --write after adding or removing
# TestProxiedServer*/TestServerMode* functions. --write is incremental:
# it keeps every already-assigned test on its current shard and only
# places newly-discovered names, onto whichever shard is currently
# lightest, so two unrelated PRs that each add one test do not textually
# conflict or silently invalidate each other's packing. Pass --repack to
# force a full from-scratch rebalance instead (a deliberate, separate
# change — expect a large diff). --check only verifies every discovered
# name is listed here exactly once (no stale or duplicate entries); it
# does NOT verify the packing is still well-balanced, so a reweighted
# proxied_test_durations.json does not by itself fail --check — rerun
# with --repack periodically (or whenever shard loads look uneven in CI)
# to rebalance on purpose. Newly-added tests not listed here
# hash-distribute via proxied-test-shard.sh: cksum(name) % total,
# unrelated to proxied_test_durations.json (that file only feeds this
# generator's own cost estimate for a test it has not measured yet).
#
# This file is generated: notes added here are erased by the next
# regeneration. Add them to the generator or the durations file
# instead.
34 1 TestProxiedServerDep2
34 1 TestProxiedServerMolProgress
34 1 TestProxiedServerReadyClaimConcurrent
34 1 TestProxiedServerServeActivatesTheEventsJournal
34 1 TestProxiedServerServeRelease
34 2 TestProxiedServerDepListSingleIDWarnsOnDroppedExternalEdge
34 2 TestProxiedServerGateList
34 2 TestProxiedServerList
34 2 TestProxiedServerServeRemoveDependency
34 2 TestProxiedServerUpdateC
34 3 TestProxiedServerAutoPrune
34 3 TestProxiedServerClose2B
34 3 TestProxiedServerEventsJournalOffByDefault
34 3 TestProxiedServerIfRevisionCloseMismatchRefuses
34 3 TestProxiedServerMolLastActivity
34 3 TestProxiedServerPurgeWispsPlaneRetention
34 3 TestProxiedServerServeLifecycle
34 3 TestProxiedServerStatuses
34 4 TestProxiedServerMolStale
34 4 TestProxiedServerReadyConcurrent
34 4 TestProxiedServerServeRelatedIssues
34 4 TestProxiedServerServeSettingsWrites
34 4 TestProxiedServerShow2
34 4 TestServerModeServeSkipsPostRunMaintenance
34 5 TestProxiedServerHistoryRemoteRefusalFrontDoorMatrix
34 5 TestProxiedServerInfo
34 5 TestProxiedServerNote
34 5 TestProxiedServerOutageReconnectAcceptanceMatrix
34 5 TestProxiedServerUpdate3
34 5 TestServerModeDeferAutoWake
34 6 TestProxiedServerPing
34 6 TestProxiedServerQuick
34 6 TestProxiedServerServeReadsTheJournalItJustWrote
34 6 TestProxiedServerSwarm
34 6 TestProxiedServerUpdate2B
34 6 TestProxiedServerVersionedHistorySwitchRefusesAnUnrecordableGateTimeout
34 6 TestProxiedServerWispList
34 7 TestProxiedServerCloseConcurrent
34 7 TestProxiedServerCreateInfraTypeRoutesToWisps
34 7 TestProxiedServerDeleteIfRevisionSingleWinner
34 7 TestProxiedServerExternalCreate
34 7 TestProxiedServerIfRevisionGuardDelete
34 7 TestProxiedServerIfRevisionTargetGoneIsPreconditionFailed
34 7 TestProxiedServerLabelC
34 7 TestProxiedServerMoleculeLifecycleAgreesOnEveryRoute
34 7 TestProxiedServerTypesAgreeWithCreate
34 8 TestProxiedServerClose2
34 8 TestProxiedServerDeleteWisp
34 8 TestProxiedServerExport
34 8 TestProxiedServerFindDuplicates
34 8 TestProxiedServerGateCheck
34 8 TestProxiedServerServeReadParity
34 9 TestProxiedServerCloseSiblingBlockersFanIn
34 9 TestProxiedServerGateLifecycle
34 9 TestProxiedServerHistoryRemoteSupportedFrontDoorParity
34 9 TestProxiedServerIfRevisionGuardReopen
34 9 TestProxiedServerIfRevisionOutranksReassignFence
34 9 TestProxiedServerServeRefusesTheJournalWhenItIsDisabled
34 9 TestProxiedServerUpdate
34 9 TestServerModeServe
34 10 TestProxiedServerContext
34 10 TestProxiedServerCreate2B
34 10 TestProxiedServerGateCheckB
34 10 TestProxiedServerServeRefusesAStreamOnADisabledJournal
34 10 TestProxiedServerTypes
34 10 TestProxiedServerUpdate2C
34 11 TestProxiedServerBatchParity
34 11 TestProxiedServerCompactHistory
34 11 TestProxiedServerPour
34 11 TestProxiedServerQuery
34 11 TestProxiedServerReady
34 11 TestProxiedServerServeAddDependencies
34 12 TestProxiedServerBlocked
34 12 TestProxiedServerChildren
34 12 TestProxiedServerCleanDatabases
34 12 TestProxiedServerReadyB
34 12 TestProxiedServerReadyWisp
34 12 TestProxiedServerReclaim
34 12 TestProxiedServerShowCommentsTail
34 12 TestProxiedServerUnclaim
34 13 TestProxiedServerCompactDolt
34 13 TestProxiedServerCreate2
34 13 TestProxiedServerGraph
34 13 TestProxiedServerHistoryRemoteSupportedDirectParity
34 13 TestProxiedServerMolSquash
34 13 TestProxiedServerPromote
34 13 TestProxiedServerServeRefusesAStaleCheckpointWithGone
34 14 TestProxiedServerAssign
34 14 TestProxiedServerCloseB
34 14 TestProxiedServerDuplicates
34 14 TestProxiedServerHeartbeat
34 14 TestProxiedServerIfRevisionCloseReplaysMoleculeAutoClose
34 14 TestProxiedServerInitIfMissing
34 14 TestProxiedServerMolReadyGated
34 15 TestProxiedServerDepConcurrent
34 15 TestProxiedServerImport
34 15 TestProxiedServerMoleculeFrontDoorWriteParity
34 15 TestProxiedServerReopenConcurrent
34 15 TestProxiedServerSQL
34 16 TestProxiedServerBackupRefusedOnExternalTopology
34 16 TestProxiedServerCascadeParity
34 16 TestProxiedServerConfigSetMany
34 16 TestProxiedServerKV
34 16 TestProxiedServerServeCount
34 16 TestProxiedServerServeCreate
34 16 TestProxiedServerUpdateHooks
34 17 TestProxiedServerDep
34 17 TestProxiedServerMultiStatementSQL
34 17 TestProxiedServerOrphans
34 17 TestProxiedServerPrime
34 17 TestProxiedServerSQLDatabaseFlag
34 17 TestProxiedServerServeModeGate
34 17 TestServerModeServeIgnoresGraphModeDependency
34 18 TestProxiedServerClose3
34 18 TestProxiedServerCount
34 18 TestProxiedServerCountIncludeInfra
34 18 TestProxiedServerDoltRemoteRemove
34 18 TestProxiedServerMolShow
34 18 TestProxiedServerWispCreateRejectsEnumViolatingVar
34 19 TestProxiedServerCreate
34 19 TestProxiedServerMolCurrent
34 19 TestProxiedServerServeBatchClose
34 19 TestProxiedServerShow3
34 19 TestServerModeTypesAgreeWithCreate
34 20 TestProxiedServerDelete
34 20 TestProxiedServerLint
34 20 TestProxiedServerPriority
34 20 TestProxiedServerShow2B
34 20 TestProxiedServerWispGC
34 20 TestServerModeSharedServeGlobalReportsTheServedDatabase
34 21 TestProxiedServerBatchDepAddRefusesADottedChildGatedOnItsParent
34 21 TestProxiedServerConfig
34 21 TestProxiedServerExternalPolicyDirectParity
34 21 TestProxiedServerMoleculeFrontDoorDirectServerProxyParity
34 21 TestProxiedServerPathHelpers
34 21 TestProxiedServerPrune
34 21 TestProxiedServerServeClose
34 21 TestProxiedServerUnclaimIfAssigneeParity
34 22 TestProxiedServerGateCreateInheritsRepoMetadata
34 22 TestProxiedServerRecomputeBlocked
34 22 TestProxiedServerServeEdgeCounts
34 22 TestProxiedServerTag
34 22 TestProxiedServerUpdateB
34 22 TestProxiedServerUpdateConcurrentMetadata
34 23 TestProxiedServerDep2B
34 23 TestProxiedServerIfRevisionGuardUpdate
34 23 TestProxiedServerListWatchCountsTheOffsetIntoMaxRows
34 23 TestProxiedServerMolBurn
34 23 TestProxiedServerSearchRoutesAgree
34 23 TestProxiedServerServeUpdate
34 23 TestProxiedServerUpdateConcurrentClaim
34 23 TestProxiedServerUpdateWisp
34 24 TestProxiedServerDeleteBlockedJSONSingleDoc
34 24 TestProxiedServerDeleteForceOrphans
34 24 TestProxiedServerHuman
34 24 TestProxiedServerIfRevisionDeleteMatchAndMismatch
34 24 TestProxiedServerIfRevisionGuardAssign
34 24 TestProxiedServerListComments
34 24 TestProxiedServerListSortRetiresTheWalk
34 24 TestProxiedServerShowWatch
34 24 TestProxiedServerUpdateIfGuards
34 25 TestProxiedServerInitExplicitBeadsDirIsAuthoritative
34 25 TestProxiedServerSetState
34 25 TestProxiedServerShow
34 25 TestProxiedServerShowB
34 25 TestProxiedServerStale
34 25 TestProxiedServerWispCreate
34 26 TestProxiedServerDeferAutoWake
34 26 TestProxiedServerExternalMutationPolicy
34 26 TestProxiedServerReopenB
34 26 TestProxiedServerSearch
34 26 TestProxiedServerServeClaim
34 26 TestProxiedServerShow3B
34 27 TestProxiedServerDeferUndefer
34 27 TestProxiedServerGatedRendering
34 27 TestProxiedServerHistory
34 27 TestProxiedServerLabel
34 27 TestProxiedServerLabelB
34 27 TestProxiedServerUpdateClosePolicy
34 28 TestProxiedServerDep2C
34 28 TestProxiedServerDoltLifecycle
34 28 TestProxiedServerIfRevisionCloseWarnsOnForcedOpenChildren
34 28 TestProxiedServerReady2
34 28 TestProxiedServerReassignFence
34 28 TestProxiedServerSQLStatementRouting
34 28 TestProxiedServerServeClaimNext
34 28 TestProxiedServerUpdateConcurrentAppendNotes
34 29 TestProxiedServerGateFrontDoorDirectServerProxyParity
34 29 TestProxiedServerMolDistill
34 29 TestProxiedServerReopen
34 29 TestProxiedServerServeDelete
34 29 TestProxiedServerState
34 30 TestProxiedServerDeleteConcurrent
34 30 TestProxiedServerReadyC
34 30 TestProxiedServerServeAddComment
34 30 TestProxiedServerStatus
34 30 TestProxiedServerTodo
34 30 TestProxiedServerUpdate2
34 30 TestProxiedServerVersionedHistoryServeActivatesTheProviderFromItsOwnRow
34 31 TestProxiedServerCloseBeadGate
34 31 TestProxiedServerComment
34 31 TestProxiedServerConfigB
34 31 TestProxiedServerEventsJournal
34 31 TestProxiedServerGateAddWaiterConvoy
34 31 TestProxiedServerIfRevisionGuardClose
34 31 TestProxiedServerMolBond
34 32 TestProxiedServerCleanDatabasesPurgeDropped
34 32 TestProxiedServerConfigConcurrent
34 32 TestProxiedServerDepB
34 32 TestProxiedServerServeStreamsTheJournalItIsWriting
34 32 TestProxiedServerServeUpdateClaim
34 32 TestProxiedServerStorageClass
34 33 TestProxiedServerBatchDefersThenDoltCommitAdvancesHeadOnce
34 33 TestProxiedServerClose
34 33 TestProxiedServerGC
34 33 TestProxiedServerMemory
34 33 TestProxiedServerPourRejectsEnumViolatingVar
34 33 TestProxiedServerRelate
34 34 TestProxiedServerClose4
34 34 TestProxiedServerCreate2C
34 34 TestProxiedServerEdit
34 34 TestProxiedServerEpic
34 34 TestProxiedServerLink
34 34 TestProxiedServerServeReadRevision

View file

@ -1,153 +0,0 @@
#!/usr/bin/env bash
# proxied-test-shard.sh — run a shard of proxied-server dolt cmd/bd tests.
#
# Usage: proxied-test-shard.sh <shard_number> <total_shards>
#
# Discovers all TestProxiedServer* and TestServerMode* top-level functions
# across cmd/bd/*_test.go (the proxied integration suites plus
# TestProxiedServerExternalCreate and the TestProxiedServerPathHelpers unit
# test, widening the lane's historical `-run '^TestProxiedServer'`). The
# TestServerMode* suites all gate on requireSharedProxiedServer and drive the
# same shared dolt sql-server, and this lane is the only one that sets
# BEADS_TEST_PROXIED_SERVER=1, so it is the only place they run: before the
# widening a top-level TestServerMode* entry point matched no discovery pattern
# here, so it skipped everywhere else and was never executed by CI at all.
# The TestProxiedServer* side is mixed and should not be generalized over: most
# gate on requireSharedProxiedServer, the rest on requireProxiedServerEnv, and
# TestProxiedServerPathHelpers (pure path helpers) has no gate and no build tag,
# so that one also runs in every ordinary `go test ./cmd/bd/` lane.
#
# Tests listed in proxied-cmd-test-shards.txt for the requested shard count use
# that committed assignment; newly-added tests fall back to hash(name) % total.
# Runs the matching subset using the pre-built test binary at
# BEADS_TEST_CMD_BINARY (or /tmp/bd-cmd-test).
#
# Environment:
# BEADS_TEST_PROXIED_SERVER=1 required (tests skip without it)
# BEADS_TEST_BD_BINARY=<path> pre-built bd binary used as the subprocess
# BEADS_TEST_CMD_BINARY=<path> pre-built cmd/bd test binary (default: /tmp/bd-cmd-test)
# BEADS_TEST_SHARD_MANIFEST=<path> override committed manifest path
# BEADS_TEST_SHARD_LIST_ONLY=1 print selected tests without running them
set -euo pipefail
SHARD_NUMBER="${1:?usage: $0 <shard_number> <total_shards>}"
TOTAL_SHARDS="${2:?usage: $0 <shard_number> <total_shards>}"
shift 2
if ! [[ "$SHARD_NUMBER" =~ ^[0-9]+$ ]] || ! [[ "$TOTAL_SHARDS" =~ ^[0-9]+$ ]]; then
echo "Shard number and total shards must be positive integers" >&2
exit 1
fi
if (( TOTAL_SHARDS < 1 || SHARD_NUMBER < 1 || SHARD_NUMBER > TOTAL_SHARDS )); then
echo "Invalid shard ${SHARD_NUMBER}/${TOTAL_SHARDS}" >&2
exit 1
fi
SHARD_INDEX=$(( SHARD_NUMBER - 1 ))
MANIFEST="${BEADS_TEST_SHARD_MANIFEST:-.github/scripts/proxied-cmd-test-shards.txt}"
# Discover all top-level TestProxiedServer*/TestServerMode* functions across
# every cmd/bd test file (integration suites live in
# *_proxied_integration_test.go, but TestProxiedServerExternalCreate,
# TestProxiedServerPathHelpers and the TestServerMode* suites do not, so match
# by name rather than by file glob).
ALL_TESTS=$(grep -rhE '^func Test(ProxiedServer|ServerMode)' cmd/bd/*_test.go \
| sed -E 's/func (Test(ProxiedServer|ServerMode)[A-Za-z0-9_]*).*/\1/' \
| sort -u)
if [ -z "$ALL_TESTS" ]; then
echo "No TestProxiedServer*/TestServerMode* functions found" >&2
exit 1
fi
declare -A ALL_TEST_SET=()
while IFS= read -r name; do
ALL_TEST_SET["$name"]=1
done <<< "$ALL_TESTS"
declare -A MANIFEST_SHARDS=()
if [ -f "$MANIFEST" ]; then
while IFS= read -r line || [ -n "$line" ]; do
line="${line%%#*}"
read -r manifest_total manifest_shard test_name extra <<< "$line"
if [ -z "${manifest_total:-}" ]; then
continue
fi
if [ -n "${extra:-}" ] || ! [[ "$manifest_total" =~ ^[0-9]+$ ]] || ! [[ "$manifest_shard" =~ ^[0-9]+$ ]] || ! [[ "$test_name" =~ ^Test(ProxiedServer|ServerMode)[A-Za-z0-9_]+$ ]]; then
echo "Invalid shard manifest line: $line" >&2
exit 1
fi
if (( manifest_total != TOTAL_SHARDS )); then
continue
fi
if (( manifest_shard < 1 || manifest_shard > TOTAL_SHARDS )); then
echo "Invalid shard ${manifest_shard}/${manifest_total} for $test_name in $MANIFEST" >&2
exit 1
fi
if [ -n "${MANIFEST_SHARDS[$test_name]:-}" ]; then
echo "Duplicate shard manifest entry for $test_name in $MANIFEST" >&2
exit 1
fi
MANIFEST_SHARDS["$test_name"]="$manifest_shard"
done < "$MANIFEST"
fi
for name in "${!MANIFEST_SHARDS[@]}"; do
if [ -z "${ALL_TEST_SET[$name]:-}" ]; then
echo "Shard manifest entry does not match a discovered test: $name" >&2
exit 1
fi
done
SHARD_TESTS=()
MANIFEST_COUNT=0
FALLBACK_COUNT=0
while IFS= read -r name; do
assigned_shard="${MANIFEST_SHARDS[$name]:-}"
if [ -n "$assigned_shard" ]; then
if (( assigned_shard == SHARD_NUMBER )); then
SHARD_TESTS+=("$name")
MANIFEST_COUNT=$(( MANIFEST_COUNT + 1 ))
fi
continue
fi
# Use cksum for a portable numeric hash fallback for newly-added tests.
hash=$(printf %s "$name" | cksum | cut -d ' ' -f 1)
if (( hash % TOTAL_SHARDS == SHARD_INDEX )); then
SHARD_TESTS+=("$name")
FALLBACK_COUNT=$(( FALLBACK_COUNT + 1 ))
fi
done <<< "$ALL_TESTS"
if [ ${#SHARD_TESTS[@]} -eq 0 ]; then
echo "Shard ${SHARD_NUMBER}/${TOTAL_SHARDS}: no tests assigned (all hashed to other shards)"
exit 0
fi
# Build the -run regex: "^(TestA|TestB|TestC)$"
RUN_REGEX="^($(IFS='|'; echo "${SHARD_TESTS[*]}"))$"
echo "Shard ${SHARD_NUMBER}/${TOTAL_SHARDS}: running ${#SHARD_TESTS[@]} test(s)"
echo " manifest: ${MANIFEST_COUNT}, fallback: ${FALLBACK_COUNT}"
printf " %s\n" "${SHARD_TESTS[@]}"
echo ""
# Use pre-built test binary if available, otherwise fall back to go test.
CMD_BINARY="${BEADS_TEST_CMD_BINARY:-/tmp/bd-cmd-test}"
if [ "${BEADS_TEST_SHARD_LIST_ONLY:-}" = "1" ]; then
exit 0
fi
if [ -x "$CMD_BINARY" ]; then
exec "$CMD_BINARY" -test.v -test.count=1 -test.timeout=15m \
-test.run "$RUN_REGEX" \
"$@"
else
echo "Warning: pre-built test binary not found at $CMD_BINARY, falling back to go test"
exec go test -tags=gms_pure_go -v -count=1 -timeout 15m \
-run "$RUN_REGEX" \
"$@" \
./cmd/bd/
fi

View file

@ -1,17 +0,0 @@
# Every bazel.yml lane's loading and analysis, for the remote repo contents
# cache: rrc-seed runs each line with --nobuild on a push to main (uploading
# the repositories it fetches) and rrc-verify runs each cold every night.
# One `bazel` command per line (no shell quoting); # starts a comment.
# scripts/bazel_rrc_test.go checks that every --config a reading lane's
# bazel command uses appears here.
test //... --config=ci
test //... --config=embedded
test //... --config=integration
test //... --config=doltserver
test //... --config=doltserver-proxied
test //... --config=dolt-race
test //... --config=doltserver-integration
test //... --config=doltserver-cmd
test //... --config=dolt-int
build --config=pure //cmd/bd:bd //cmd/bd:bd_test //internal/storage/embeddeddolt:embeddeddolt_test //internal/tracker:tracker_test
build --config=js-wasm //internal/hooks:hooks_test

View file

@ -1,51 +0,0 @@
#!/usr/bin/env bash
# Loading and analysis of every bazel.yml lane, for the remote repo contents
# cache (bazel.yml's rrc-seed and rrc-verify jobs).
#
# Usage: rrc-run-lanes.sh [STARTUP_FLAG...] -- [COMMAND_FLAG...]
#
# Runs `bazel STARTUP_FLAG... <line> --nobuild COMMAND_FLAG...` for each
# command line in .github/scripts/rrc-lane-commands.txt (or RRC_LANE_COMMANDS),
# in order, stopping at the first failure. --nobuild: repository rules,
# loading and analysis only, never a build or test action.
#
# Bazel exits 1 after `test --nobuild` even when loading and analysis succeed
# ("Couldn't start the build. Unable to run tests"). A command passes when it
# exits 0, or exits non-zero having printed "Build completed successfully"
# and no ERROR line but that one.
set -euo pipefail
startup=()
while [ $# -gt 0 ] && [ "$1" != -- ]; do
startup+=("$1")
shift
done
[ $# -gt 0 ] || {
echo "usage: rrc-run-lanes.sh [STARTUP_FLAG...] -- [COMMAND_FLAG...]" >&2
exit 2
}
shift
flags=("$@")
file=${RRC_LANE_COMMANDS:-$(dirname "${BASH_SOURCE[0]}")/rrc-lane-commands.txt}
mapfile -t cmds < <(sed -e 's/#.*//' -e 's/[[:space:]]*$//' "$file" | grep -v '^[[:space:]]*$' || true)
if [ "${#cmds[@]}" -eq 0 ]; then
echo "::error::no lane commands in $file"
exit 1
fi
log=$(mktemp)
trap 'rm -f "$log"' EXIT
summary=${GITHUB_STEP_SUMMARY:-/dev/null}
for cmd in "${cmds[@]}"; do
read -r -a args <<<"$cmd"
start=$(date +%s)
rc=0
bazel ${startup[@]+"${startup[@]}"} "${args[@]}" --nobuild ${flags[@]+"${flags[@]}"} </dev/null 2>&1 | tee "$log" || rc=$?
if [ "$rc" -ne 0 ] && grep -q '^INFO: Build completed successfully' "$log" &&
! grep '^ERROR:' "$log" | grep -qv "^ERROR: Couldn't start the build. Unable to run tests$"; then
rc=0
fi
echo "rrc: \`bazel $cmd\`: exit $rc, $(($(date +%s) - start))s" | tee -a "$summary"
[ "$rc" -eq 0 ] || exit "$rc"
done

View file

@ -1,113 +0,0 @@
#!/usr/bin/env bash
# A 30-minute rbe-west client certificate for the remote repo contents cache
# writer (bazel.yml's rrc-seed job; engdocs/design/bazel-remote-repo-contents-cache.md).
#
# The job trades its GitHub Actions OIDC token (audience rbe-rrc-writer) for a
# certificate CN=rbe-rrc-writer from rbe-west's mint. The mint signs only for
# this repository's bazel.yml on a push to main (repository, ref, event_name
# and job_workflow_ref claims); pull_request, fork and Dependabot runs cannot
# get one (no OIDC token, or a refs/pull/N/merge one). On rbe-west that
# certificate reaches only GetCapabilities, the CAS and an action cache front
# (rrc-gate) that admits repo-contents entries and refuses everything else, so
# it can never write an execution result or execute anything.
#
# The key is an EC P-256 key (PKCS#8: Bazel's Netty TLS refuses a SEC1 "EC
# PRIVATE KEY") generated here in BAZEL_CI_SECRET_DIR, outside the workspace;
# it never leaves the runner. The OIDC token is masked. Outputs (to
# $GITHUB_OUTPUT when set, else stdout): cert, key, endpoint, instance; none
# when the mint answers 503 or cannot be reached (seeding switched off on
# rbe-west: infra nativelink-cas/west/README.md "Client contract"), which
# exits 0 with a warning.
#
# Tests only: RBE_RRC_MINT (a stand-in mint) and RBE_RRC_ENDPOINT_RE.
set -euo pipefail
MINT=${RBE_RRC_MINT:-https://rbe-mint.ops.gascity.com:8444}
ENDPOINT_RE=${RBE_RRC_ENDPOINT_RE:-'^grpcs://rbe-west\.ops\.gascity\.com(:443)?$'}
AUDIENCE=rbe-rrc-writer
dir=${BAZEL_CI_SECRET_DIR:?BAZEL_CI_SECRET_DIR is required}
out=${GITHUB_OUTPUT:-/dev/stdout}
if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ] || [ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ]; then
echo "::error title=rrc writer::no OIDC token request URL; the job needs permissions: id-token: write" >&2
exit 1
fi
install -d -m 0700 "$dir"
umask 077
oidc=$(curl -sS --fail --connect-timeout 5 --max-time 30 --retry 3 --retry-all-errors \
-H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$AUDIENCE" | jq -r '.value // empty')
if [ -z "$oidc" ]; then
echo "::error title=rrc writer::GitHub returned no OIDC token" >&2
exit 1
fi
printf '::add-mask::%s\n' "$oidc"
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out "$dir/rrc-writer.key" 2>/dev/null
csr=$(openssl req -new -key "$dir/rrc-writer.key" -subj "/CN=rbe-rrc-writer-request")
body=$(jq -cn --arg csr "$csr" '{csr_pem: $csr}')
reply="$dir/rrc-mint.json"
code=000
for attempt in 1 2 3 4; do
# --connect-timeout: a closed gate drops the SYN; fail fast, not in 60 s.
code=$(curl -sS -o "$reply" -w '%{http_code}' --connect-timeout 5 --max-time 60 \
-H "Authorization: Bearer $oidc" -H 'content-type: application/json' \
--data "$body" "$MINT/v1/rrc-writer/cert") || code=000
# Retry what may pass on its own: a rate limit (429), the mint could not
# reach GitHub's JWKS (502), or the network (000). Everything else is an
# answer.
case "$code" in 429 | 502 | 000) ;; *) break ;; esac
[ "$attempt" -eq 4 ] || sleep $((attempt * 10))
done
case "$code" in
200) ;;
503 | 000)
# The mint's switch is off, its CA is not installed, or rbe-west's fork
# edge is closed: seeding is off, not broken. No outputs, so the seed
# step skips; the push to main never fails on it.
echo "::warning title=rrc writer: seeding off (HTTP $code)::$(jq -r '.error // empty' "$reply" 2>/dev/null || true)"
exit 0
;;
*)
echo "::error title=rrc writer mint refused (HTTP $code)::$(jq -r '.error // empty' "$reply" 2>/dev/null || true)"
exit 1
;;
esac
endpoint=$(jq -r '.endpoint // empty' "$reply")
instance=$(jq -r '.instance // empty' "$reply")
[[ $endpoint =~ $ENDPOINT_RE ]] || {
echo "::error::rrc writer mint returned endpoint '$endpoint'" >&2
exit 1
}
[ "$instance" = oss ] || {
echo "::error::rrc writer mint returned instance '$instance', want oss" >&2
exit 1
}
jq -r '.cert_pem // empty' "$reply" >"$dir/rrc-writer.crt"
subject=$(openssl x509 -in "$dir/rrc-writer.crt" -noout -subject -nameopt RFC2253) || {
echo "::error::rrc writer mint returned no certificate" >&2
exit 1
}
rdns=$(tr ',' '\n' <<<"${subject#subject=}")
cn=$(sed -n 's/^CN=//p' <<<"$rdns")
org=$(sed -n 's/^O=//p' <<<"$rdns")
if ! [[ $cn =~ ^rbe-rrc-writer(-[a-z0-9]+)?$ ]] || [ "$org" != gascity ]; then
echo "::error::rrc writer mint returned a certificate for '$subject'" >&2
exit 1
fi
# The certificate must belong to the key generated above.
if [ "$(openssl x509 -in "$dir/rrc-writer.crt" -noout -pubkey | openssl sha256)" != "$(openssl pkey -in "$dir/rrc-writer.key" -pubout | openssl sha256)" ]; then
echo "::error::rrc writer mint returned a certificate for another key" >&2
exit 1
fi
openssl x509 -in "$dir/rrc-writer.crt" -noout -subject -enddate
rm -f "$reply"
{
echo "cert=$dir/rrc-writer.crt"
echo "key=$dir/rrc-writer.key"
echo "endpoint=$endpoint"
echo "instance=$instance"
} >>"$out"

View file

@ -1,160 +0,0 @@
#!/usr/bin/env bash
# server-storage-test-shard.sh — run a shard of server dolt storage tests.
#
# Usage: server-storage-test-shard.sh <shard_number> <total_shards>
#
# Discovers all top-level Test* functions from internal/storage/dolt/*_test.go,
# excluding TestConformance. That suite runs in the dedicated
# test-server-storage job instead, sharded by sub-test path (-test.run
# '^TestConformance$'), not by top-level function name; this manifest's
# exact-name matching does not cover it. See
# engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md for why the two use different
# sharding mechanisms.
#
# Tests listed in server-storage-test-shards.txt for the requested shard count
# use that committed assignment; newly-added tests fall back to
# hash(name) % total. Runs the matching subset using the pre-built test
# binary at BEADS_TEST_SERVER_TEST_BINARY (or /tmp/dolt-conformance-test).
#
# This package hands 1126 top-level tests to a single job (be-extn): the
# sibling embedded lane's test-embedded-storage shards 324 tests over 5 jobs.
# Server mode is also slower per-test (real socket round-trips, per-test
# CREATE/DROP DATABASE) than embedded. TestCloudAuthCLIRouting alone took 566s
# (63% of the old 15m budget) across 16 subtests, each paying a full
# CREATE DATABASE + migration chain + dolt init + dolt remote add + DROP
# DATABASE (~35s) to test one routing predicate; it uses t.Setenv, so it can
# never be parallel. The manifest pins it (and other known-heavy tests) to
# distinct shards so they do not cluster.
#
# Environment:
# BEADS_TEST_ENV_RUN_DOLT=1 required (tests skip without it)
# BEADS_TEST_SERVER_TEST_BINARY=<path> pre-built storage test binary
# (default: /tmp/dolt-conformance-test)
# BEADS_TEST_SHARD_LIST_ONLY=1 print selected tests without running them
set -euo pipefail
SHARD_NUMBER="${1:?usage: $0 <shard_number> <total_shards>}"
TOTAL_SHARDS="${2:?usage: $0 <shard_number> <total_shards>}"
shift 2
if ! [[ "$SHARD_NUMBER" =~ ^[0-9]+$ ]] || ! [[ "$TOTAL_SHARDS" =~ ^[0-9]+$ ]]; then
echo "Shard number and total shards must be positive integers" >&2
exit 1
fi
if (( TOTAL_SHARDS < 1 || SHARD_NUMBER < 1 || SHARD_NUMBER > TOTAL_SHARDS )); then
echo "Invalid shard ${SHARD_NUMBER}/${TOTAL_SHARDS}" >&2
exit 1
fi
SHARD_INDEX=$(( SHARD_NUMBER - 1 ))
MANIFEST="${BEADS_TEST_SHARD_MANIFEST:-.github/scripts/server-storage-test-shards.txt}"
# Discover all top-level Test* functions except TestConformance, which is
# sharded separately (test-server-storage job, -test.run '^TestConformance$')
# because it is a single top-level function with sub-tests reached via
# -test.run path regex, not distinct top-level function names.
ALL_TESTS=$(grep -rh '^func Test' internal/storage/dolt/*_test.go \
| sed 's/func \(Test[A-Za-z0-9_]*\).*/\1/' \
| grep -v '^TestConformance$' \
| sort -u)
if [ -z "$ALL_TESTS" ]; then
echo "No Test* functions found" >&2
exit 1
fi
declare -A ALL_TEST_SET=()
while IFS= read -r name; do
ALL_TEST_SET["$name"]=1
done <<< "$ALL_TESTS"
declare -A MANIFEST_SHARDS=()
if [ -f "$MANIFEST" ]; then
while IFS= read -r line || [ -n "$line" ]; do
line="${line%%#*}"
read -r manifest_total manifest_shard test_name extra <<< "$line"
if [ -z "${manifest_total:-}" ]; then
continue
fi
if [ -n "${extra:-}" ] || ! [[ "$manifest_total" =~ ^[0-9]+$ ]] || ! [[ "$manifest_shard" =~ ^[0-9]+$ ]] || ! [[ "$test_name" =~ ^Test[A-Za-z0-9_]+$ ]] || [ "$test_name" = "TestConformance" ]; then
echo "Invalid shard manifest line: $line" >&2
exit 1
fi
if (( manifest_total != TOTAL_SHARDS )); then
continue
fi
if (( manifest_shard < 1 || manifest_shard > TOTAL_SHARDS )); then
echo "Invalid shard ${manifest_shard}/${manifest_total} for $test_name in $MANIFEST" >&2
exit 1
fi
if [ -n "${MANIFEST_SHARDS[$test_name]:-}" ]; then
echo "Duplicate shard manifest entry for $test_name in $MANIFEST" >&2
exit 1
fi
MANIFEST_SHARDS["$test_name"]="$manifest_shard"
done < "$MANIFEST"
fi
for name in "${!MANIFEST_SHARDS[@]}"; do
if [ -z "${ALL_TEST_SET[$name]:-}" ]; then
echo "Shard manifest entry does not match a discovered test: $name" >&2
exit 1
fi
done
SHARD_TESTS=()
MANIFEST_COUNT=0
FALLBACK_COUNT=0
while IFS= read -r name; do
assigned_shard="${MANIFEST_SHARDS[$name]:-}"
if [ -n "$assigned_shard" ]; then
if (( assigned_shard == SHARD_NUMBER )); then
SHARD_TESTS+=("$name")
MANIFEST_COUNT=$(( MANIFEST_COUNT + 1 ))
fi
continue
fi
# Use cksum for a portable numeric hash fallback for newly-added tests.
hash=$(printf %s "$name" | cksum | cut -d ' ' -f 1)
if (( hash % TOTAL_SHARDS == SHARD_INDEX )); then
SHARD_TESTS+=("$name")
FALLBACK_COUNT=$(( FALLBACK_COUNT + 1 ))
fi
done <<< "$ALL_TESTS"
if [ ${#SHARD_TESTS[@]} -eq 0 ]; then
echo "Shard ${SHARD_NUMBER}/${TOTAL_SHARDS}: no tests assigned (all hashed to other shards)"
exit 0
fi
# Build the -run regex: "^(TestA|TestB|TestC)$"
RUN_REGEX="^($(IFS='|'; echo "${SHARD_TESTS[*]}"))$"
echo "Shard ${SHARD_NUMBER}/${TOTAL_SHARDS}: running ${#SHARD_TESTS[@]} test(s)"
echo " manifest: ${MANIFEST_COUNT}, fallback: ${FALLBACK_COUNT}"
printf " %s\n" "${SHARD_TESTS[@]}"
echo ""
# Use pre-built test binary if available, otherwise fall back to go test.
STORAGE_BINARY="${BEADS_TEST_SERVER_TEST_BINARY:-/tmp/dolt-conformance-test}"
if [ "${BEADS_TEST_SHARD_LIST_ONLY:-}" = "1" ]; then
exit 0
fi
if [ -x "$STORAGE_BINARY" ]; then
# The tests use paths relative to their own package dir (e.g.
# ../schema/migrations, ../issueops). `go test` runs them with cwd = the
# package dir; a prebuilt binary inherits OUR cwd, so set it explicitly.
cd internal/storage/dolt
exec "$STORAGE_BINARY" -test.v -test.count=1 -test.timeout=15m \
-test.run "$RUN_REGEX" \
"$@"
else
echo "Warning: pre-built test binary not found at $STORAGE_BINARY, falling back to go test"
exec go test -tags=integration,gms_pure_go -v -count=1 -timeout 15m \
-run "$RUN_REGEX" \
"$@" \
./internal/storage/dolt/
fi

View file

@ -1,38 +0,0 @@
# Server storage test shard manifest.
#
# Format: <total_shards> <shard_number> <top_level_test_name>
#
# TestCloudAuthCLIRouting uses one shared outer store (#5841); its
# environment-sensitive subtests run serially. #6396 checks that remote
# writes use the shared fixture without imposing a machine-speed threshold.
# It remains pinned alone on shard 1. The remaining pins below
# (TestCloudAuthCLIRoutingStructural, TestCreateGuard_* (9 tests),
# TestFederationPeerCredentialLifecycleLazyKeyInit,
# TestConcurrentWorkQueueDrain, TestHighContentionStress,
# TestSerializationConflictRetry,
# TestConcurrentCommentAndCloseWithoutCallerRetry, TestReadWriteMix, and
# TestConcurrentIssueCreationWithoutCallerRetry) are each roughly 10-20s and
# are spread across the remaining shards so they don't cluster on one.
# Every other discovered test (the bulk of the 1126) is not listed here and
# falls through to server-storage-test-shard.sh's hash(name) % total
# fallback, the same mechanism the embedded manifest uses for its unlisted
# tests. TestConformance is deliberately excluded -- it runs in the separate
# test-server-storage job (sharded by sub-test path, not by this manifest).
16 1 TestCloudAuthCLIRouting
16 2 TestCloudAuthCLIRoutingStructural
16 2 TestReadWriteMix
16 3 TestCreateGuard_ErrorMessage
16 3 TestConcurrentIssueCreationWithoutCallerRetry
16 4 TestCreateGuard_ExistingDB_DoesNotCreateMissingBeadsDir
16 5 TestCreateGuard_ExistingDB_NoFlag
16 6 TestCreateGuard_ExistingDB_WithData
16 7 TestCreateGuard_MissingDB_CreateIfMissing
16 8 TestCreateGuard_MissingDB_DefaultConfig
16 9 TestCreateGuard_ReadOnly_MissingDB
16 10 TestCreateGuard_UnderscoreBothExist
16 11 TestCreateGuard_UnderscoreInName
16 12 TestFederationPeerCredentialLifecycleLazyKeyInit
16 13 TestConcurrentWorkQueueDrain
16 14 TestHighContentionStress
16 15 TestSerializationConflictRetry
16 16 TestConcurrentCommentAndCloseWithoutCallerRetry

View file

@ -1,160 +0,0 @@
# Auto-fix stale Bazel BUILD files on PRs.
#
# bazel.yml's "BUILD files in sync" step runs `make bazel-sync` (gazelle,
# tools/bazel/go_srcs.py, bazel mod tidy) and, when that leaves drift, fails
# and uploads the BUILD.bazel / MODULE.bazel / MODULE.bazel.lock part of the
# fix as the bazel-sync-patch artifact (scripts/ci/bazel-sync-patch.sh). This
# workflow closes the loop, like docs-autofix.yml does for generated CLI docs:
# when a PR run fails and left that artifact, it pushes the sync commit to the
# PR branch (same-repo PRs) or leaves an idempotent comment with the apply
# recipe (fork PRs). Drift elsewhere (third_party/patches, go.mod) is never
# patched; the failing run lists it for a human.
#
# Trigger: only "PR" (pr.yml). bazel.yml has no pull_request trigger of its
# own: PRs run it through pr.yml's `bazel` job (workflow_call), so its
# bazel-sync-patch upload belongs to the PR run, and a failing sync step
# fails that run. The "Bazel" workflow's own runs (push to main, dispatch)
# are never pull_request events, so triggering on them would only ever be a
# no-op. A PR run without the artifact (it failed for other reasons) is a
# no-op too. bazel.yml builds the PR MERGE commit, so the patch also
# carries any drift main has; only files in packages the PR itself changed
# are pushed (see the script), so main's drift never lands on an unrelated PR.
#
# CONCURRENCY: job-level (a skipped run - success, or another event - never
# takes part), and shared with docs-autofix.yml per head branch without
# cancel-in-progress, so the two bots queue instead of racing on one branch
# or cancelling a fix that is already running. The second one sees the moved
# head and stops; with the PAT its push retriggers CI, which re-derives the
# other fix. Both bots now fire on the same PR run's completion, so one runs
# while the other waits. GitHub keeps one pending job per group: a later PR
# run finishing inside that short window can displace a waiting job, whose
# fix the next failing run re-derives.
#
# SECURITY MODEL: this runs with write permissions via workflow_run, so it
# never checks out or executes PR code. It checks out the base default branch
# for scripts, and treats the artifact strictly as data: only the two expected
# regular files are extracted, every path in the patch must match an anchored
# Bazel build-file allowlist (no hidden or `..` segments, nothing under
# third_party/), mode/symlink/rename/binary hunks are refused, and
# the patch is applied to an index in a bare clone (the PR tree never touches
# the disk) and re-checked once staged (scripts/bazel-autofix-push.sh), so a
# hostile patch can at most rewrite BUILD.bazel / MODULE.bazel /
# MODULE.bazel.lock on its own PR branch. Pushes are leased to the run's head
# SHA and skipped for heads that are protected or under a ruleset. The App
# private key is a secret of the `autofix` environment, whose deployment-
# branch policy allows only `main`, so only a job running on main can read
# it; the minted token itself is scoped to this one repo with contents:write
# only, so even a hostile patch gains nothing beyond what the job already
# had.
#
# TOKEN NOTE: pushes made with the default GITHUB_TOKEN do not retrigger PR
# checks. On same-repo PRs the push step mints a short-lived installation
# token for the gastownhall-autofix GitHub App (contents:write, scoped to
# this repo only) and uses that instead. Fork PRs always get the apply-recipe
# comment - no token we hold can push to a fork, so the mint step is skipped
# for them. workflow_run always runs this file from the default branch, so
# edits take effect only after they merge.
name: Bazel Autofix
on:
workflow_run:
workflows: ["PR"]
types: [completed]
permissions:
contents: write
pull-requests: write
actions: read
jobs:
autofix:
name: Apply Bazel BUILD sync to PR
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'failure'
runs-on: ubuntu-latest
timeout-minutes: 10
# Grants the job read access to this environment's secrets; its
# deployment-branch policy restricts that to jobs running on main
# (workflow_run always does), not to any PR branch.
environment: autofix
# Shared with docs-autofix.yml; queue, never cancel (see header).
concurrency:
group: autofix-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: false
steps:
# Trusted side only: base repo default branch, never the PR head. The
# workflow token is not left in .git/config.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
persist-credentials: false
- name: Download BUILD sync patch (if any)
id: patch
env:
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.event.workflow_run.id }}
run: |
artifact_ids="$(gh api --paginate "repos/${GITHUB_REPOSITORY}/actions/runs/${RUN_ID}/artifacts?per_page=100" \
--jq '.artifacts[] | select(.name == "bazel-sync-patch") | .id')"
artifact_id="$(printf '%s\n' "$artifact_ids" | head -1)"
if [ -z "$artifact_id" ]; then
echo "No BUILD sync patch artifact on run ${RUN_ID}; it failed for other reasons."
echo "found=false" >> "$GITHUB_OUTPUT"
exit 0
fi
dir="${RUNNER_TEMP}/bazel-patch"
mkdir -p "$dir"
gh api "repos/${GITHUB_REPOSITORY}/actions/artifacts/${artifact_id}/zip" > "${RUNNER_TEMP}/bazel-patch.zip"
# Extract only the two expected names, and only as regular files.
unzip -o "${RUNNER_TEMP}/bazel-patch.zip" bazel-sync.patch bazel-sync-meta.txt -d "$dir" || true
ls -la "$dir"
for f in bazel-sync.patch bazel-sync-meta.txt; do
if [ -L "$dir/$f" ] || { [ -e "$dir/$f" ] && [ ! -f "$dir/$f" ]; }; then
echo "::error::artifact entry $f is not a regular file"
exit 1
fi
done
if [ ! -f "$dir/bazel-sync.patch" ]; then
echo "Artifact has no bazel-sync.patch; nothing to do."
echo "found=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "found=true" >> "$GITHUB_OUTPUT"
# Same-repo PRs only: no token we hold can push to a fork, and a fork's
# head_repository can even be absent (deleted fork), so this mints
# nothing for it and the push script falls back to the apply-recipe
# comment. app-token outputs are empty (not failed) when the step is
# skipped, which is what the fallback below relies on.
- name: Mint autofix app token
id: app-token
if: github.event.workflow_run.head_repository.full_name == github.repository
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
with:
app-id: ${{ secrets.AUTOFIX_APP_ID }}
private-key: ${{ secrets.AUTOFIX_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ github.event.repository.name }}
permission-contents: write
- name: Push sync commit or leave apply recipe
if: steps.patch.outputs.found == 'true'
env:
BASE_REPO: ${{ github.repository }}
HEAD_REPO: ${{ github.event.workflow_run.head_repository.full_name }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
PATCH_FILE: ${{ runner.temp }}/bazel-patch/bazel-sync.patch
META_FILE: ${{ runner.temp }}/bazel-patch/bazel-sync-meta.txt
RUN_ID: ${{ github.event.workflow_run.id }}
RUN_URL: ${{ github.event.workflow_run.html_url }}
# Split tokens: gh api calls (PR lookup, comments) always use the
# workflow token, which carries this job's pull-requests:write; the
# App token is used ONLY for the git push, so it needs no more
# than contents:write.
GH_TOKEN: ${{ github.token }}
PUSH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
AUTOFIX_TOKEN_KIND: ${{ steps.app-token.outputs.token && 'app' || 'default' }}
run: ./scripts/bazel-autofix-push.sh

View file

@ -1,153 +0,0 @@
# Bazel lanes on the remote-execution farm for fork PRs by trusted authors.
#
# Fork PRs get no Actions secrets, so pr.yml's Bazel call runs them locally
# with rbe-west's anonymous read-only cache (mode cache: no embedded,
# proxied-server or server-storage tier). This workflow gives the farm to
# fork PRs whose
# author AND triggering user are on .github/bazel-farm-allowlist.txt (by
# numeric user id), by calling bazel.yml from pull_request_target, which has
# the secrets.
#
# ADVISORY. pr.yml is unchanged: every fork PR, listed or not, still runs the
# cache-mode Bazel lanes (local execution, read-only cache) inside the
# enforced `CI Gate / Required`. This run adds a fast remote signal,
# including the remote-only embedded, proxied-server and server-storage
# tiers, that no required check and no privileged workflow
# reads. Making it authoritative needs a trusted reporter; see
# engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md, "Trusted-author fork PRs".
#
# SECURITY MODEL (policy-tested in scripts/ci_workflow_test.go,
# TestBazelFarmWorkflowSecurity; threat model in the engdoc):
# - pull_request_target runs THIS file, and bazel.yml (`uses: ./`, resolved
# from the same commit), from the base branch: a PR cannot edit either
# for its own run.
# - authorize runs no PR code: a sparse checkout of the run's own base
# commit (github.sha) holding only the allowlist and the decision script,
# no token on disk, no secrets, and event facts passed through env, never
# interpolated into a script. It requires the PR author and the sender
# (the pusher on synchronize) to be listed, so a collaborator on a listed
# author's fork, or someone opening a PR from that fork, gets nothing, and
# the head repository's owner to be the author (no PR from a third
# party's fork).
# - farm hands bazel.yml exactly the four RBE secrets and the event's head
# SHA, which every lane checks out pinned (a later push is a new event,
# judged on its own sender), without persisted credentials. The token is
# contents: read everywhere, so PR code holds no write access.
# - Accepted: a listed author's PR code runs with the RBE client
# certificate, as a same-repo PR's does.
# - Caches: this run is in the default branch's cache scope. GitHub's cache
# is read-only for pull_request_target, and nothing here may declare a
# cache-mode other than read or none (policy-tested). Whether Blacksmith's
# colocated cache enforces that is unverified. Either way, trusted runs
# verify what they restore: the Bazel binary is never cached, the
# repository cache is content-addressed, the repo contents cache is off,
# and go mod verify runs after the module cache restore (see the engdoc).
# - No artifact from this run is consumed: bazel-autofix.yml reads only
# "PR" runs of pull_request events, and bazel.yml skips its sync-patch
# upload here.
#
# Re-runs replay the original event: the same pinned head SHA, and the
# allowlist at the original base commit. De-listing a user therefore also
# means cancelling/deleting their old farm runs, or rotating the RBE
# certificate (engdoc: "Re-runs, Adding and Removing a User").
#
# Workflow edits take effect only once merged to the default branch.
name: Bazel Farm (trusted forks)
on:
pull_request_target:
# Not reopened or ready_for_review: they re-test a head no listed user
# necessarily pushed (see the script).
types: [ opened, synchronize ]
branches: [ main ]
# One run per PR; a newer event supersedes (its sender is judged afresh).
# Differs from bazel.yml's group (bazel-pull_request_target-<n>).
concurrency:
group: bazel-farm-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
jobs:
authorize:
name: authorize
runs-on: ubuntu-latest
timeout-minutes: 5
# Cheap prefilter; the script re-checks these and decides on the list.
if: >-
github.event.pull_request.base.repo.full_name == github.repository &&
github.event.pull_request.head.repo.full_name != github.repository
permissions:
contents: read
outputs:
allowed: ${{ steps.decide.outputs.allowed }}
steps:
# The base commit this run's workflow file came from; never the PR.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
persist-credentials: false
sparse-checkout: |
.github/bazel-farm-allowlist.txt
.github/scripts/bazel-farm-authorize.sh
sparse-checkout-cone-mode: false
- name: Check author and sender against the allowlist
id: decide
env:
ALLOWLIST: .github/bazel-farm-allowlist.txt
EVENT_NAME: ${{ github.event_name }}
ACTION: ${{ github.event.action }}
REPOSITORY: ${{ github.repository }}
BASE_REPO: ${{ github.event.pull_request.base.repo.full_name }}
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
HEAD_OWNER_ID: ${{ github.event.pull_request.head.repo.owner.id }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_AUTHOR_ID: ${{ github.event.pull_request.user.id }}
SENDER: ${{ github.event.sender.login }}
SENDER_ID: ${{ github.event.sender.id }}
run: bash .github/scripts/bazel-farm-authorize.sh
# Not "Bazel": pr.yml's call is named that, and this run's lane results are
# PR-controlled, so its check names ("Bazel Farm / <lane>") must never
# collide with ones a ruleset might require.
farm:
name: Bazel Farm
needs: authorize
if: ${{ needs.authorize.outputs.allowed == 'true' }}
# A called workflow's job gets at most this call's token permissions, and
# GitHub checks them when the run starts, even for a job whose if: skips
# it (startup_failure otherwise; gascity #7478): bazel.yml's rrc-seed asks
# id-token: write (push to main only) and rrc-verify issues: write
# (schedule and dispatch only). Neither runs for this event, every other
# bazel.yml job keeps contents: read, and rbe-west's mint refuses any OIDC
# token but a main-push bazel.yml one
# (scripts/bazel_rrc_test.go, TestBazelWorkflowCallersGrantEveryRequestedPermission).
permissions:
contents: read
id-token: write
issues: write
uses: ./.github/workflows/bazel.yml
# Exactly the four RBE secrets: never the rbe-prewarm app private key
# (B1, security review of bdef342d5). This pull_request_target run is
# the one caller whose code under test is an untrusted fork's, so it
# must never carry the credential that mints gastownhall/gascity
# Actions tokens; pre-warming is accepted as a same-repo-only benefit
# (bazel.yml's rbe-prewarm job also gates on mode remote only, which a
# fork-authorized farm run never reaches). See "rbe-west Pre-warm",
# engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md.
secrets:
RBE_WEST_EXECUTOR: ${{ secrets.RBE_WEST_EXECUTOR }}
RBE_TLS_CERT: ${{ secrets.RBE_TLS_CERT }}
RBE_TLS_KEY: ${{ secrets.RBE_TLS_KEY }}
RBE_TLS_CA: ${{ secrets.RBE_TLS_CA }}
with:
checkout-sha: ${{ github.event.pull_request.head.sha }}
fork-farm: authorized
integration: "on"
build-artifact-name: bazel-farm-build-artifacts

Some files were not shown because too many files have changed in this diff Show more