Compare commits

..

59 commits

Author SHA1 Message Date
Julian Knutsen
53637a74ad
Merge pull request #7461 from gastownhall/release-prep/v1.3.2-rc.2
release: prep v1.3.2-rc.2 (after #7146)
2026-10-10 01:38:43 -07:00
Julian Knutsen
3d470c4a1b Merge remote-tracking branch 'origin/hotfix/1.3.1' into release-prep/v1.3.2-rc.2 2026-10-10 08:15:33 +00:00
Julian Knutsen
ce766f2a60
Merge pull request #7463 from gastownhall/backport/hotfix-1.3.1-doc-freshness
[hotfix/1.3.1] docs: backport doc re-reviews #7267 and #7268 (unblocks the date-based freshness gate)
2026-10-10 01:15:27 -07:00
Julian Knutsen
382cf6a7ef
Merge pull request #7146 from rjgeng/backport-7030-hotfix-1.3.1
fix(dolt): backport #6876 to hotfix/1.3.1 — publish the blocked-state recheck after its transaction commits
2026-10-10 01:12:17 -07:00
Bee
1d71e70fe4 docs(ide-setup): re-review against cmd/bd/setup and refresh its marker (#7268)
The Last reviewed marker (2026-07-10) passes the 90-day limit in
scripts/check-doc-freshness.sh at 2026-10-09 00:00 UTC, when the required
"Check doc flags freshness" job would fail on every PR and merge-group
run, as it did for ERROR_HANDLING.md (#7266).

Re-reviewed against cmd/bd/setup.go, cmd/bd/setup/ and internal/recipes/
at e72cd8b31 and corrected what had drifted:

- bd setup cursor installs the agent skill and .cursor/hooks.json
  (sessionStart, preCompact, postToolUse) besides the rules file, and
  takes --global (hooks and skill only).
- bd setup claude writes its managed section to AGENTS.md when
  CLAUDE.md is an @AGENTS.md import stub.
- bd setup codex takes --global.
- bd init runs the Claude Code, Codex and Cursor project setup, not
  Codex alone.

The marker is 2026-10-05, not the UTC date, because the script rejects a
future date and a Pacific shell still reads 10-05.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 8ae1a2beb3)
2026-10-10 07:40:53 +00:00
Bee
65b406fe56 docs(engdocs): re-review ERROR_HANDLING.md against cmd/bd and refresh its marker (#7267)
The Last reviewed marker (2026-07-07) passed the 90-day limit in
scripts/check-doc-freshness.sh at 2026-10-06 00:00 UTC, so the required
"Check doc flags freshness" job fails on every PR and merge-group run
(#7266).

Re-reviewed against cmd/bd at e72cd8b31 and corrected what had drifted:

- createConfigYaml takes three arguments.
- cmd/bd/sync.go has no warning or ignored-error sites any more; its
  citations are gone. Line-number citations into init.go and create.go
  no longer matched and are replaced by search strings.
- internal/syncbranch was removed with the sync-branch pipeline; the
  syncbranch.Set example and the sync.branch bullet are gone.
- No code writes last_import_hash; the tracking-metadata examples now
  show the bd_version write (SetLocalMetadata) and verifyMetadata as
  init.go has them.
- CheckReadonly also exits ExitMigrationFrozen under a migration freeze.
- HandleProxyCapabilityError is added to the helper list.

Fixes #7266

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 800d43eb8d)
2026-10-10 07:40:53 +00:00
Julian Knutsen
e29f0509c1 release: prep v1.3.2-rc.2
Second RC bump per RELEASING.md "Cut an RC", cut on hotfix/1.3.1. Owner
decision (2026-10-10): v1.3.2 = v1.3.1 + #7041 + #7044 (rc.1) + #7146,
the backport of #6876 (blocked-state recheck published after its
transaction commits, fixes #7030).

This branch sits on top of #7146's head (bb18223fbd), so it must merge
after #7146. Once #7146 merges, this PR's diff is only this commit.

./scripts/update-versions.sh 1.3.2-rc.2 stamps version.go, the plugin
manifests, marketplace.json, npm package.json, the MCP
pyproject/__init__/uv.lock (1.3.2rc2), default.nix, the .githooks markers
and the winres strings. The PE numeric fields stay at the 1.3.2 base.
./scripts/check-versions.sh is green at 1.3.2-rc.2.

CHANGELOG: a dated [1.3.2-rc.2] section that takes over #7146's
[Unreleased] entry as a Fixed entry and restates that the rc.1
#7037 upgrade note still applies. [1.3.2-rc.1] is unchanged and
[Unreleased] is empty again.

cmd/bd/info.go: a 1.3.2-rc.2 digest at index 0 of versionChanges.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 07:28:36 +00:00
Rongjun GENG
bb18223fbd Merge upstream/hotfix/1.3.1 into backport-7030-hotfix-1.3.1
Resolves the CHANGELOG.md conflict: keeps this PR's Unreleased entry
and the branch's own 1.3.2-rc.1 release-prep section, which includes
the port of #7198 (hotfix/** CI trigger) via #7217.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-05 03:45:29 -07:00
Julian Knutsen
3fdced064c
Merge pull request #7221 from gastownhall/release-prep/v1.3.2-rc.1
release: prep v1.3.2-rc.1
2026-10-04 22:13:24 -07:00
Julian Knutsen
a5f0707347
Merge pull request #7220 from gastownhall/backport/hotfix-1.3.1-v1.3.2-fixes
[hotfix/1.3.1] backport #7041 (purge transitive live dependents, #7031) and #7044 (backup watermark, #7032) for v1.3.2
2026-10-04 21:44:28 -07:00
Julian Knutsen
af9d553565 release: prep v1.3.2-rc.1
RC bump per RELEASING.md "Cut an RC", cut on hotfix/1.3.1. That branch is
the v1.3.1 tag plus the hotfix CI-trigger port (#7217) and the v1.3.2
backports (#7041 and #7044, via #7220).
./scripts/update-versions.sh 1.3.2-rc.1 stamps version.go, the plugin
manifests, marketplace.json, npm package.json, the MCP
pyproject/__init__/uv.lock (1.3.2rc1), default.nix, the .githooks markers
and the winres strings. The PE numeric fields stay at the 1.3.2 base.
./scripts/check-versions.sh is green at 1.3.2-rc.1.

CHANGELOG: a dated [1.3.2-rc.1] section with:
- an upgrade note for #7037: after upgrading from bd <=1.3.0, run
  `bd recompute-blocked` once per workspace, with the reason (migration
  0059 vs dolthub/dolt#11886 on Dolt < 2.4.0 and on the embedded engine)
- Fixed entries for #7031/#7041 and #7032/#7044
- a CI entry for #7148/#7198/#7217
[Unreleased] stays empty.

cmd/bd/info.go: a 1.3.2-rc.1 digest at index 0 of versionChanges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 04:25:26 +00:00
Rongjun GENG
711d238b96 fix(backup): anchor watermark before snapshot (#7044)
Record the commit read before BackupToDir as the newest revision guaranteed
to be in the snapshot. A commit landing during sync then remains pending for
the next backup instead of being hidden by an advanced watermark.

Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Rongjun GENG
(cherry picked from commit 874e2866ff)
2026-10-05 04:17:33 +00:00
Rongjun GENG
d9a09105bc fix(purge): preserve transitive live dependents (#7041)
Propagate sweep protection through closed candidates so an open descendant
keeps every candidate ancestor in its protecting dependency chain. Cover the
shared helper, dry-run, real sweep, and all storage contract wirings.

Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Rongjun GENG
(cherry picked from commit 5db60f42ac)
2026-10-05 04:17:32 +00:00
Julian Knutsen
adf91f2dc0
Merge pull request #7217 from gastownhall/ci/hotfix-1.3.1-ci-trigger
[hotfix/1.3.1] ci: trigger pull_request CI on hotfix/** branches (port of #7198, adapted, not a cherry-pick)
2026-10-04 21:17:15 -07:00
Julian Knutsen
09e6397f1e ci(hotfix/1.3.1): install pinned golangci-lint instead of the disallowed action
Release-only adaptation; there is no main commit to cherry-pick. The repo's
allowed-actions policy does not list golangci/golangci-lint-action, so with
pull_request now triggering pr.yml on hotfix/** the whole workflow fails at
startup (startup_failure on PR #7217). main dropped the action in #7127
(bc19f6e47) and installs the pinned v2.10.1 release binary with
scripts/ci/install-golangci-lint.sh. This takes that script verbatim from
main (4b2852ce2) and keeps this branch's single Lint job, with
--new-from-rev set to the PR base in place of only-new-issues. Locally,
golangci-lint v2.10.1 --new-from-rev=origin/hotfix/1.3.1 reports 0 issues.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 03:36:31 +00:00
Rongjun GENG
97bfa4c149 ci: trigger pull_request CI on hotfix/** branches, not just release/** (#7148)
Hand port of #7198 (main 3c65c99c29) onto hotfix/1.3.1. NOT a clean
cherry-pick; adapted for this branch:

- conformance.yml and cross-version-smoke.yml: main added `paths:` filters
  that this branch does not have. Only the `branches:` line is changed here;
  the path filters are not brought over.
- CHANGELOG.md: the [Unreleased] entry is dropped. The next release-prep on
  this branch records it in its own section.
- scripts/ci_workflow_test.go: this branch has no readPolicyFile helper and
  no prRiskWorkflowName constant. The test reads the files with os.ReadFile
  and names pr-risk.yml literally. The assertions are unchanged.

The pull_request trigger is read from the PR's merge ref, so this has to be
on hotfix/1.3.1 itself before PRs into it (the v1.3.2 backports) run the
full CI and produce `CI Gate / Required`.

(ported from commit 3c65c99c29)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 03:31:24 +00:00
Rongjun GENG
35fea9b049 docs(changelog): record the #6876 backport to hotfix/1.3.1 (#7030)
Fold-in note for the preceding cherry-pick. Documents the gap this
closes for a release-branch reader: the hotfix batches that ported
#6716's fan-in fix carried the post-commit blocked-state recheck in
the form #6876 later corrected on main, missing it between batches
2 and 4.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-03 14:54:09 -07:00
Julian Knutsen
d1840c043f fix(dolt): publish the blocked-state recheck after its transaction commits (#6876)
* fix(dolt): publish the blocked-state recheck after its transaction commits

Post-merge review of #6719 (landed 511849496..1ed5b3330) raised two majors
against the post-commit blocked-state recheck. Both are fixed here.

1. Publication ordering. recheckBlockedAfterCommit minted its Dolt commit
   with doltAddAndCommitInTx while its own recompute transaction was still
   open. That helper's doc block declares the ordering a live
   production-observed lost-update hazard (LatentLabsSpace/NEXUS#92):
   DOLT_ADD stages the whole table from the session's BEGIN-time root, so
   the minted commit writes every concurrently committed row in the staged
   tables back to its BEGIN-time value. The recheck is the worst possible
   adopter, because it runs precisely and only when concurrent unblocking
   writes are racing on issues. It now mirrors
   runIssueOperationTxWithMessage: the recompute runs alone inside
   withRetryTx, its IssueRowsChanged verdict is captured by plain
   assignment, and doltAddAndCommitPostTx publishes after the SQL
   transaction has committed, against the post-merge root. A failed
   trailing commit is accounted like that path's — post_tx_commit_dropped
   plus a log line — and not as a recheck failure, because the flag repair
   itself is committed and durable, so telling an operator the rows may be
   stale and prescribing `bd recompute-blocked` would be false.

2. Test evidence. The wiring from a committed public write to the
   post-commit recheck had no regression pin on either tier: deleting both
   Dolt runner tails left the whole TestCloseRecheckBlocked suite green,
   because those tests either call recheckBlockedAfterCommit themselves or
   take the pending set out of the transaction before the runner can.
   TestCloseRecheckBlocked_RunnerTailRechecksACommittedWrite now drives the
   race through withRetryTx and withWriteTx, one arm each (they carry
   separate tail calls), and asserts the dependent settles with no help
   from the test; each arm reads the dependent's flag inside the write's own
   transaction first, so a collapsed race window fails loudly instead of
   passing vacuously. TestEmbeddedBlockedRecheckSettlesWhatTheWriteRecorded
   does the same for withConn's tail on the serialized embedded tier,
   leaving the pending set in the transaction for the store to take.

   That embedded pin needed a second pass: its first form asserted on
   types.Issue.IsBlocked, which GetIssue never hydrates — is_blocked is not
   in sqlbuild.IssueBaseColumns — so the assertion could not fail and the
   arm survived deleting the tail. It now reads the stored flag through
   embeddedIsBlocked. The pre-existing "graph ends settled" assertion in
   the sibling test had the same defect and is fixed the same way, with its
   comment corrected to say what it actually pins (the in-transaction
   recompute, since each write there takes its own pending set).

The ordering itself cannot be pinned behaviorally — the hazard needs a
writer that commits inside the recheck's own transaction window, and no
seam exposes it — so it gets a structural guard in the shape the journal-
and version-scope completeness guards already use, with liveness anchors so
a rename cannot turn it into a tautology. Restoring the in-tx ordering
leaves every behavioral test in the package green and reds only that guard,
which is why it is here.

Mutation evidence for both pins, re-measured for this push. Deleting all
three runner tails (both Dolt, plus embedded withConn) reds exactly the two
new tests — both arms of the Dolt one at close_recheck_blocked_test.go:240,
and the embedded one at blocked_recheck_internal_test.go:180 — and nothing
else in either package. Restoring the in-tx publication ordering reds only
TestPostCommitRecheckPublishesOutsideItsTransaction.

The non-gating disclosure corrections the same review raised ride the next
commit. The rest — a recheck-scope completeness test, noteBlockedRecheck on
the sibling in-transaction recomputes, and routing
RemoveDependencyWithOptions through withRetryTx — stay out of this PR and
are tracked as beads.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(blocked-recheck): correct the residue claim and the out-of-scope list

Three non-gating items from the same post-merge review of #6719, all
disclosure rather than behavior.

blocked_recheck.go's package doc claimed the writes it does not record can
at worst leave a dependent "flagged ready while blocked". A sibling comment
two files away refutes that universal: addDependencyInTx documents that
parent-child adds are not monotonic, because adding an already-closed child
can satisfy an any-children waits-for gate. So an add of a still-open child
racing the close of that child strands the waiter in the other direction —
flagged blocked while ready and hidden from `bd ready`, which is the #6716
shape the recheck exists to fix, reached through `bd dep add` or
`bd create --parent`. The doc now states both directions. Recording the add
paths is the code fix, and it stays tracked separately.

The CHANGELOG's list of writes that still need the `bd doctor` /
`bd recompute-blocked` repair named `bd batch`, `bd cook`, `bd mol squash`,
`bd mol burn`, `bd duplicates --merge` and the wisp writes, but not the
proxied-server route: under `--proxied-server` the ordinary single verbs are
served by the uow provider (`bd close` reaches runCloseProxiedServer and its
BatchCloser), and no uow write is scoped. A proxied-mode operator reading
that list would have concluded their plain `bd close` races were fixed. The
code doc already disclosed this correctly; only the user-facing text did not.

closeIssueInTx hand-concatenated its recheck label instead of calling
statusChangeRecheckLabel, which exists so that a close through update and a
close through CloseIssue mint the same message. The helper returns the
identical string for the closed status, so no recheck commit message moves —
close_recheck_blocked_test.go:129 and :242 still assert the same text and
still pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* build(bazel): add the recheck publication guard to the dolt_test srcs

The post-merge review of #6719 found that this PR's own new test file,
internal/storage/dolt/blocked_recheck_publication_test.go, never reached
the go_test(name = "dolt_test") target. That target uses a gazelle-managed
explicit srcs list -- it names close_recheck_blocked_test.go and
journal_scope_completeness_test.go -- and the new file was missing from it,
so `bazel test` silently skipped the only pin on the ordering half of the
finding-1 fix.

Nothing caught it. The package's go_srcs filegroup is a glob(["**/*.go"]),
and `make bazel-sync-check` (tools/bazel/go_srcs.py --check) plus
scripts/bazel_policy_test.go only ever compare those glob filegroups, never
a go_test srcs list, so the sync check stays green while the target drops
the file. The glob filegroup sitting next to the explicit list is a decoy:
`bazel query 'kind("source file", deps(...))'` also reports the file as
present through it, and only `labels(srcs, //internal/storage/dolt:dolt_test)`
distinguishes the two -- that query returns the file with this line and
returns nothing without it.

Generated with `bazel run //:gazelle` and reduced to this PR's own file.
The same run also wants to touch twelve other BUILD.bazel files and to add
cli_mirror_ref_test.go to this same list; all of that drift reproduces
byte-identically from this branch's base commit with no part of this PR
applied, so it belongs to whoever landed those files, not here.

//internal/storage/dolt:dolt_test builds with the entry added, so the file
needs no new dep -- journalscan was already in the target's deps.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
(cherry picked from commit 73018a69eb)
2026-10-03 14:54:00 -07:00
Julian Knutsen
c1c4b642ac
Merge pull request #7048 from gastownhall/release-prep/v1.3.1
release: prep v1.3.1
2026-09-30 13:47:52 -07:00
Gas City Adopt-PR
498742a275 release: prep v1.3.1
Promote v1.3.1-rc.2 to stable per RELEASING.md "Validate and promote", on
the same branch the RC validated (hotfix/1.3.1, rc.2 = 696e3967be).
./scripts/update-versions.sh 1.3.1 drops the -rc.2 suffix from version.go,
the plugin manifests, marketplace.json, npm package.json, the MCP
pyproject/__init__/uv.lock, default.nix, the .githooks markers and the
winres strings. ./scripts/check-versions.sh is green at 1.3.1.

CHANGELOG: a dated [1.3.1] section, following the [1.1.0] precedent: it
points at [1.3.1-rc.2] and [1.3.1-rc.1] for the full notes and says the
code is unchanged since rc.2. The rc sections are untouched.

cmd/bd/info.go: a 1.3.1 digest at index 0 of versionChanges.

No code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 19:11:53 +00:00
Julian Knutsen
696e3967be
Merge pull request #6952 from gastownhall/release-prep/v1.3.1-rc.2
release: prep v1.3.1-rc.2
2026-09-29 09:37:58 -07:00
Gas City Adopt-PR
f83654b118 release: prep v1.3.1-rc.2
RC bump per RELEASING.md "Cut an RC", on the #6593 model, cut on
hotfix/1.3.1 (the owner's release branch for 1.3.1, cut from
release/1.3.0). ./scripts/update-versions.sh 1.3.1-rc.2 stamps version.go,
the plugin manifests, marketplace.json, npm package.json, the MCP
pyproject/__init__/uv.lock (1.3.1rc2), default.nix, the .githooks markers
and the winres strings; the PE numeric fields stay at the 1.3.1 base.
./scripts/check-versions.sh is green at 1.3.1-rc.2.

CHANGELOG: a dated [1.3.1-rc.2] section covers everything since
v1.3.1-rc.1: the five release/1.3.0 merges after rc.1 (#6653, #6659,
#6695, #6547, #6652) and the hotfix batches (#6582, #6584, #6694, #6883,
#6719, #6740+#6771, #6563+#6627, #6499, #6744, #6879, #6932-#6935,
#6937, #6938, #6942). Entries parked under [Unreleased] and the post-rc.1
additions inside [1.3.1] move into it, with an upgrade-notes list of the
behaviour changes. The two #6716 bullets are merged into one, the #6584
paragraph that said auto-backup was not wired now defers to the #6879
entry, and #6499, #6563/#6627 and #6547 get entries. The section rc.1
shipped as [1.3.1] is renamed [1.3.1-rc.1] with its body byte-identical to
the v1.3.1-rc.1 tag, following the [1.1.0-rc.N] precedent; the final
1.3.1 prep creates [1.3.1]. [Unreleased] stays empty.

cmd/bd/info.go: a 1.3.1-rc.2 digest at index 0 of versionChanges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 16:08:20 +00:00
Julian Knutsen
655dc0827d
Merge pull request #6947 from gastownhall/hotfix/1.3.1-batch4
hotfix/1.3.1: batch 4 — #6942 (hand port: proxied/uow + remaining routes blocked recheck)
2026-09-29 03:46:24 -07:00
Julian Knutsen
4b49bf2e80 fix(storage): recheck blocked state after commit on the proxied (uow) path and the remaining store routes (#6942)
Extends #6719's post-commit blocked-state recheck (gastownhall/beads#6716) to
every write runner #6719 left uncovered:
- the proxied (uow) write path: every proxied CLI write, bd batch when
  proxied, and bd serve;
- DoltStore.RunInTransaction. It also settles when the regular SQL commit
  lands and only the Dolt commit after it fails (ErrCommitIndeterminate);
- the raw-transaction wisp update, close and delete writers;
- both arms of RemoveDependencyWithOptions;
- the domain/db recomputes that bypassed issueops.
The recording shapes are shared issueops Note* helpers. A failed recheck is
reported through issueops.ReportBlockedRecheckFailure (the
bd.db.blocked_recheck_dropped counter plus a warning) and never returned.

Regression tests fail on main and pass here: a deterministic proxied uow
race in six shapes, RunInTransaction and concurrent wisp-close races,
sqlmock phase tests for the indeterminate commit, and a proxied CLI fan-in
test that runs concurrent `bd close` processes and then checks `bd ready`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit cda2407115)

Hand-ported to hotfix/1.3.1, per the #6942 review (section 5). The code
hunks are unchanged; every conflict came from main-only context:
- Versioned-history scope. It does not exist on the release line. Main's
  context installs ScopeVersionedHistoryTransaction/clearVersionScope/
  releaseVersionScope in internal/storage/dolt/dependencies.go (2 places),
  dolt/transaction.go (runDoltTransactionRecording),
  uow/dolt_sql_provider.go (BeginTx) and uow/doltserver_tx.go (struct,
  releaseConn, poisonConn, release helpers). Resolved by keeping the release
  code without those lines and adding only the blocked-recheck-scope lines.
  In dolt_sql_provider.go the release line keeps its journal-only comment
  wording, extended with the recheck-scope sentence.
- Close label. On the release line, issueops/close.go records with
  noteBlockedRecheck(tx, "close of "+id, ...), the label from the #6719 hand
  port. It now calls NoteStatusChangeBlockedRecheck, which produces the same
  "close of <id>" label through statusChangeRecheckLabel.
- BUILD.bazel (cmd/bd, dolt, issueops, uow) and
  dolt/version_scope_completeness_test.go do not exist on the release line
  and are dropped.
- CHANGELOG.md: the release CHANGELOG is kept. This entry is added verbatim
  before the #6716 entry from the #6719 port, and that entry's list of
  uncovered routes now points at this entry, as on main.
No schema change. go build ./... and go vet (internal/storage, cmd/bd) are clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 10:09:34 +00:00
Julian Knutsen
0cba03281c
Merge pull request #6945 from gastownhall/hotfix/1.3.1-batch3
hotfix/1.3.1: batch 3 — #6932, #6934, #6935, #6933 (hand), #6937 (hand), #6938
2026-09-29 02:55:09 -07:00
Julian Knutsen
b4d81fdf5b fix(beads): make an explicit BEADS_DIR authoritative during discovery (#6938)
* fix(beads): make an explicit BEADS_DIR authoritative during discovery

FindBeadsDir ignored a BEADS_DIR that did not hold project files yet
(missing, empty, or uninitialized) and walked up from the current
directory instead. PersistentPreRun then rebound BEADS_DIR to whatever
ancestor workspace the walk found, so:

- `bd init` refused with "already initialized" because of the parent
  workspace instead of initializing the named directory;
- data commands (`bd list`, `bd create`, ...) read and wrote the
  parent's store.

FindBeadsDir now returns "" for such a BEADS_DIR, matching
FindDatabasePath, which already refused to fall back. Commands that
create a workspace (import/setup default path, bootstrap's
fresh-clone synthesis) target the named directory via the new
beads.ExplicitBeadsDir helper instead of CWD. Behaviour with BEADS_DIR
unset is unchanged.

Tests: FindBeadsDir unit cases (missing/empty/non-project BEADS_DIR,
initialized BEADS_DIR, unset BEADS_DIR still walks up), and a bd
subprocess regression in embedded and proxied-server modes (init under
an initialized parent, list refuses, create lands in the new store).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(changelog): note that BEADS_DIR at a project root now errors

Review follow-up for the explicit-BEADS_DIR fix: call out the behaviour
change for BEADS_DIR pointing at a project root (or a not-yet-created
.beads), which previously worked only because discovery walked up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 51a7c8e324)

hand-resolved: CHANGELOG entry placed under the hotfix's [Unreleased] ### Fixed; cmd/bd/BUILD.bazel and internal/beads/BUILD.bazel dropped (no Bazel on hotfix/1.3.1). Go code applied unchanged.
2026-09-29 09:29:33 +00:00
Julian Knutsen
b2faf48e84 fix(dbproxy): retire the proxy when its Dolt backend exits cleanly (#6937)
* fix(dbproxy): retire the proxy when its Dolt backend exits cleanly

DoltServer supervised `dolt sql-server` with cmd.Wait inside an
errgroup, and Running read the errgroup context. errgroup cancels that
context only for a non-nil result, so a backend that shut down
gracefully (dolt exits 0 on SIGTERM) was reported as running forever.
The proxy's backend health watcher never fired: the proxy stayed up and
adoptable in front of a dead store. With --proxied-server-idle-timeout 0
(the setting Gas City uses) it never went away; `bd dolt status` said
"running" and every command, `bd ping` included, failed until
`bd dolt stop`.

The supervising goroutine now reports a clean exit as errBackendExited,
so Running flips on any backend exit and Stop treats it as benign. This
follows the existing proxied lifecycle contract (child death retires
the owned proxy; the next bd invocation starts a fresh proxy/backend
pair) rather than adding in-proxy restarts: spawn, adoption, stop
epochs and identity already live in the on-demand start path, and a
second restart loop inside the proxy would duplicate that and could
mask a crash-looping backend.

`bd dolt status` no longer headlines a proxy whose managed backend is
gone as "running"; it says the proxy is up but not serving and points
at `bd dolt stop` (for proxies from an older bd). The JSON payload is
unchanged. `bd ping` already verifies by running SELECT 1 through the
proxy, so after this fix a successful ping reflects a live pair.

Tests: DoltServer Running goes false after SIGTERM (clean exit) and
SIGKILL, and Stop succeeds; managed-local lane test that SIGTERMs the
backend with idle timeout 0 and requires the proxy to retire and
`bd ping --json` to succeed on a fresh pair; status render case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(dolt status): report running=false for a proxy over a dead managed backend

Review follow-up: the JSON running field now means "serving" (a live proxy
and, on a managed topology, a live dolt behind it), so scripts that key off
running alone are not fooled by a stranded proxy left by an older bd.
proxy_pid/proxy_port and backend_* are unchanged. Adds the PR link to the
CHANGELOG entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(changelog): resolve merge markers left by the origin/main merge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d803ec9126)

hand-resolved: .github/workflows/proxied-local-smoke.yml: the hotfix's lifecycle-test list differs in order and content, so TestManagedLocalProxiedBackendCleanExitRetiresProxy was appended to the hotfix list. CHANGELOG entry placed under the hotfix's [Unreleased] ### Fixed; cmd/bd/BUILD.bazel and internal/storage/dbproxy/server/BUILD.bazel dropped (no Bazel on hotfix/1.3.1).
2026-09-29 09:26:52 +00:00
Julian Knutsen
e25e5a71d3 fix(show): support bd show --watch under --proxied-server (#6933)
bd show --watch was refused in proxied-server mode (proxy.watch.unsupported). The direct and proxied routes now share one watch loop (2s poll, redraw on id:status:updated_at change, SIGINT/SIGTERM stop); the proxied route opens a short read per render/poll. A missing id now exits 1 on both routes, and failed polls keep the last render quietly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5ac483bc75)

hand-resolved: cmd/bd/proxy_capability.go: the hotfix front door keys on cmd.Name(), not commandRegistryPath; dropped its show --watch refusal block and kept the hotfix's ready block unchanged. cmd/bd/show_proxied_server.go: took main's side (in-runner watch refusal removed). cmd/bd/proxy_capability_test.go: took main's newProxyFrontDoorCommand and create/--repo front-door tests; kept both the hotfix's TestProxyCapabilityRefusalDoesNotNeedProvider and main's TestProxyFrontDoorAdmitsShowWatch. CHANGELOG entry placed under the hotfix's [Unreleased] ### Fixed; cmd/bd/BUILD.bazel dropped (no Bazel on hotfix/1.3.1).
2026-09-29 09:23:59 +00:00
Julian Knutsen
a8e5ccfc10 fix(init): admit a server workspace whose .beads/dolt is empty so the version marker is written (#6935)
A server-mode workspace with an empty .beads/dolt and no .local_version was refused as a legacy workspace, blocking every command including bd init. An empty directory holds no legacy data, so the guard now admits it (server mode only); bd init writes the marker and an existing workspace in that state self-heals on its next command. Refs #5682.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit e3a12f4e5c)

hand-resolved: CHANGELOG entry placed under the hotfix's [Unreleased] ### Fixed; cmd/bd/BUILD.bazel dropped (no Bazel on hotfix/1.3.1). Go code applied unchanged.
2026-09-29 09:12:11 +00:00
Julian Knutsen
66c6a0c9b3 fix(types): one source of truth for issue types across bd types and create (#6934)
bd types and create validation now both resolve custom types through issueops.ComposeCustomTypes in every mode (direct, server, proxied). Server-mode bd types now includes config.yaml types, proxied config set storage-class accepts DB types, and bd types lists the system types (message, molecule, gate, event); JSON gains additive system_types. Custom-type read errors now fail instead of being swallowed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2bb5337355)

hand-resolved: CHANGELOG entry placed under the hotfix's [Unreleased] ### Fixed; BUILD.bazel files dropped (no Bazel on hotfix/1.3.1). Go code applied unchanged.
2026-09-29 09:11:51 +00:00
Julian Knutsen
84e6faaa2d fix(sql): classify bd sql statements with the SQL parser; never drop result sets (#6932)
Proxied bd sql misclassified WITH [RECURSIVE] ... SELECT as a write and silently returned no rows; CALL result sets were dropped on both paths. Classify statements with the dolthub/vitess parser (internal/storage/sqlclass: Read/Write/Mixed); Mixed commits and renders any rows, so no path silently drops a result set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit c4b1cb699d)

hand-resolved: CHANGELOG entry placed under the hotfix's [Unreleased] ### Fixed; MODULE.bazel and BUILD.bazel files dropped (no Bazel on hotfix/1.3.1). Go code applied unchanged.
2026-09-29 08:47:51 +00:00
Julian Knutsen
dac1e6e91f
Merge pull request #6936 from gastownhall/hotfix/1.3.1-batch2
hotfix/1.3.1: batch 2 — #6719 (hand port), #6740+#6771, #6563+#6627, #6499, #6744, #6879
2026-09-28 22:49:26 -07:00
Gas City Adopt-PR
70867888ff test(release-1.3.x): drop dolt commit from the release-only direct-only refusal loop after #6499 [NOT a cherry-pick]
Release-only test adaptation. On main, TestHistoryDirectOnlyRefusalContract
iterates the keys of its expected map, so #6499 only had to delete the
"dolt commit" entry. The release copy (adapted in 2b27259cb4) iterates an
explicit path list instead, which the pick could not see. That list still
had "dolt commit", which #6499 now permits on the proxied route, so the test
read an empty refusal and failed:
  dolt commit refusal = "" (unexpected end of JSON input)
Seen in the nightly full-test and pr-linux runs dispatched on
hotfix/1.3.1-batch2. The only change is removing "dolt commit" from that list.
The refusal contract for every other path is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 05:20:09 +00:00
Gas City Adopt-PR
d15081d60e test(release-1.3.x): capability matrix expects proxied bd dolt commit to be honored after #6499 [NOT a cherry-pick]
Release-only test adaptation. cmd/bd/topology_capability_matrix_test.go
exists only on the release line (#6579 [release/1.3.0]); main has no copy,
so the #6499 pick could not update it. Its "dolt commit" row still expected
the proxy.dolt_commit.unsupported refusal on every proxied topology, which
#6499 removes (capability_registry.go: permitted("dolt commit")).

The row now expects HONORED on proxied topologies, matching the registry.
Before this change TestManagedLocalProxiedCapabilityMatrix failed on the
dolt commit cell, and every later refusal cell then reported "proxy started
for a refused command" because the honored commit had started the proxy.
No other expectation changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 04:10:59 +00:00
Julian Knutsen
48be70fb7e feat(backup): proxied auto-backup on managed-local, serialized with bd backup sync (#6879)
* feat(backup): run opted-in auto-backup on a managed-local proxied server

managed-local, and #6694 made `bd backup status` admit the remaining gap:
the proxied arm of PersistentPostRunE never called runPostRunAutoBackup,
so backup.enabled=true was inert on every proxied workspace. Close it.

The proxied arm now calls the auto-backup hook before it closes the
provider, under the direct arm's maintenance gate (strict --readonly,
`bd serve`, a migration freeze) plus previews. maybeAutoBackup picks a
backend for the command: the direct store as before, or the proxied
provider's RunNonTx seam, which `bd backup sync` already uses.

The proxied backend is honored exactly where `bd backup sync` is: the
"backup sync" capability row's rule for this workspace's topology, so
managed-local only. Auto-backup registers a server-side backup remote,
which on a server bd does not own is global to every client; an implicit
trigger must not get further than the explicit verb. It never opens a
provider of its own: a command that opened none (`bd dolt stop`) or
closed it (restore) backs nothing up rather than relaunching the server.
The default stays OFF, as on every server-mode workspace.

The register/sync-to-a-local-dir sequence that DoltStore and
EmbeddedDoltStore each carried a copy of moves to
versioncontrolops.BackupToDir (and HEAD lookup to CurrentCommit), so the
proxied backend reuses it instead of adding a third copy.

Tests: TestManagedLocalProxiedAutoBackup (default off, opt-in writes a
restorable backup, change detection, `bd dolt stop` stays quiescent,
restore round trip with issue-set equality; fails against origin/main);
TestManagedLocalProxiedBackupRestoreRefusedWhileAttached pins the restore
design (refused while another bd client holds the workspace, serving
child untouched, succeeds once it detaches); unit tests for the backend
locality gate, the post-run wiring, the status note and BackupToDir.
Both managed-local tests, and the existing round trip, are added to the
proxied-local smoke lane's compiled-in list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(backup): serialize auto-backup and bd backup sync with a workspace backup lock

Review follow-up on #6879. Auto-backup and an explicit bd backup sync
both run under the command's SHARED workspace gate, so nothing stopped
them overlapping, and auto-backup's remove -> add -> sync on one fixed
remote name races a concurrent copy of itself.

A per-workspace flock (.beads/backup.lock, already gitignored by
*.lock) now serializes them in every mode. Auto-backup takes it
non-blocking and skips when held (the throttle is left alone, so a
later command retries). bd backup sync waits up to exclusiveGateWait -
the bound restore's exclusive gate acquisition uses - then fails with
"another backup is running for this workspace" before touching the
store. Restore needs no part in it: its exclusive workspace gate
already excludes every command that could hold the lock.

Tests: lock semantics (refusal while held, bounded wait, release),
auto-backup skipping while held and running once released, and sync
failing loudly without reaching the store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 4e4ebdb443)

Hand-resolved for hotfix/1.3.1:
- cmd/bd/BUILD.bazel: does not exist on the release line (no Bazel build
  there); the file is dropped, as in #6905.
- .github/workflows/proxied-local-smoke.yml: the release lane list differs
  from main (it has CapabilityMatrix and BackupRoundTrip, lacks
  TrackerUOWConformance). Kept the release list and appended this commit's
  two new tests, AutoBackup and BackupRestoreRefusedWhileAttached
  (BackupRoundTrip was already listed). The backup*.go path-filter hunks
  applied cleanly.
- CHANGELOG.md: context-only conflict. The release CHANGELOG is kept and
  this commit's two Unreleased/Added entries are inserted verbatim before
  the bd purge entry, where main places them.
No code hunk needed changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 03:54:30 +00:00
Harry Miller
4d512abbc2 fix(query): apply bd list's piped-output limit policy to bd query (#6229) (#6744)
* fix(query): apply bd list's piped-output limit policy to bd query (#6229)

Root cause: bd list resolves an unflagged --limit through a policy that
treats piped stdout as unlimited (GH#4094), but bd query read its --limit
flag straight through, so its default of workapi.DefaultQueryLimit (50)
applied to piped output too. `bd query '...' | consumer` silently dropped
every row past 50; the truncation hint did not fire either, because it only
prints when stderr is a terminal.

Fix: factor the unflagged tail of bd list's policy into unflaggedLimit /
resolveUnflaggedLimit in list_input.go and call it from both commands, so
they cannot drift. bd list's switch is unchanged in behavior; bd query's
change is a single localized branch in gatherQueryInput.

Precedence for bd query, mirroring bd list:
  1. explicit --limit (including 0) wins
  2. piped stdout -> 0 (unlimited)
  3. agent mode on a terminal -> 20
  4. otherwise the 50 default
bd list keeps its own --all and list.limit branches ahead of step 2; bd
query has neither (its --all means "include closed", and there is no
query.limit config key), so none was invented.

Agent-Signature: claude-code-opus-5-5-unknown-reasoning on behalf of Harry Miller
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* review: document the query path's absent defensive cap; unstale a reachability comment

Maintainer review fixes for PR #6744 (GH#6229). Both are comment-only; no
behavior changes.

issueops.QueryRequest.Limit now states that nothing backstops it. ListRequest
pairs its Limit with MaxRows, a circuit breaker for an oversized answer, and
neither knob that sets that one (--max-rows, BEADS_MAX_ROWS) is read anywhere
on the query path, so an unlimited query is unbounded in the plain sense. That
was already reachable via `--limit 0`; this PR makes a piped `bd query` reach
it without asking, which is what makes it worth writing down. Recording the
absence is the documented half of the reviewers' choice — threading a MaxRows
twin onto QueryRequest stays available as a follow-up.

unionCountsGoSideSortKeepsTheRightSubset's comment justified its case with
"DefaultQueryLimit means a limit is always set", which this PR falsified for
the CLI half: an unflagged piped `bd query '<expr>' --sort id` now arrives on
the IsGoSideSort path with Limit 0 and no bound. The HTTP surface still brings
a bound, because an absent `limit` parameter resolves to DefaultQueryLimit, so
the clause is requalified rather than dropped. The assertions were never
affected — they pass an explicit Limit: 5.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
(cherry picked from commit 0e317c4fc0)

Hand-resolved for hotfix/1.3.1: CHANGELOG.md conflicted only on context
(main's surrounding Unreleased entries do not exist on the release line).
The release CHANGELOG is kept and this entry is added verbatim under
Unreleased "### Fixed". No code hunk needed changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 03:53:17 +00:00
Vishnu J
98d9675f5e fix: honor dolt.auto-commit in proxied server mode (#6499)
* fix(dolt): honor dolt.auto-commit=batch/off on the proxied-server write path (#4995)

In proxied-server mode every write minted a Dolt history commit whatever
dolt.auto-commit said. Two causes:

- cmd/bd/main.go never applied issueOpsContext(rootCtx) in the
  proxiedServerMode branch of the root pre-run, so the context carried no
  deferred-commit marker.
- internal/storage/uow/doltserver_tx.go: doltServerTx.Commit ignored
  issueops.VersionCommitDeferred(ctx) and ran CALL DOLT_COMMIT('-Am', ?)
  whenever a message was supplied.

Apply issueOpsContext to rootCtx in the proxied setup, and have
doltServerTx.Commit blank its message under a deferred context so the existing
plain-COMMIT branch persists the write to the working set without advancing
Dolt history. dolt.auto-commit=on is unchanged.

This commit alone strands batch/off writes in the working set; the explicit
flush point (`bd dolt commit`) follows in the later commits of this series.

(Originally recorded as "witness: salvage uncommitted work (ocb-ani)"; the
change itself is unmodified.)

* test(uow,cmd/bd): add regression tests for proxied dolt.auto-commit batch/off (#4995)

Add focused regression tests verifying that proxied dolt.auto-commit batch/off
defer Dolt version commits:
- cmd/bd: TestIssueOpsContextDefersByModeInProxiedServerMode verifies that
  issueOpsContext defers version commits in proxied-server mode when
  dolt.auto-commit is batch or off.
- internal/storage/uow: TestDoltServerTxCommitDefersDoltCommitUnderDeferredContext
  and TestDoltServerTxRunTxWithDeferredContextSkipsDoltCommit verify that
  doltServerTx.Commit blanks the commit message under a deferred context,
  bypassing DOLT_COMMIT and status checks, and executing plain COMMIT to
  persist writes into the working set without advancing Dolt history.

* fix(dolt): add the proxied flush point dolt.auto-commit=batch/off defers to (#4995)

The deferral half of this PR makes dolt.auto-commit=batch/off actually take
effect on the proxied-server write path. On its own that turns batch/off into
"never commit": proxied mode returns from the root pre-run before newDoltStore
runs, so getStore() is nil and `bd dolt commit` has no store to commit
through. Writes pile up in the sql-server working set where `dolt log`,
`dolt push` and backups never see them.

Add the missing half. cmd/bd/dolt_commit_proxied_server.go is the proxied dual
of `bd dolt commit`: it takes the uow.MaintenanceProvider route (RunNonTx) and
runs CALL DOLT_COMMIT('-Am', ?) on a pinned connection, gated on
issueops.HasPendingChanges. It deliberately does not go through
doltServerTx.Commit, which blanks its own message under the deferred context;
routing the flush through the deferral it exists to discharge would make the
flush a no-op. doltCommitCmd dispatches to it on usesProxiedServer(); the
message is built before the branch so both routes name the same default, and
the "Committed." / "Nothing to commit." contract is unchanged.

--dolt-auto-commit's help no longer claims proxied-server routes are
unaffected: it names the proxied flush point and keeps the SIGTERM/SIGHUP
flush marked embedded-only. docs/reference/configuration.md says the same.
`bd vc commit`'s proxied refusal now points at `bd dolt commit`.

Tests:
- cmd/bd/dolt_commit_proxied_integration_test.go: three batch writes leave
  dolt_log unchanged and stay readable, `bd dolt commit` advances it by
  exactly one, a second `bd dolt commit` reports "Nothing to commit." with
  dolt_log unchanged, and one write under --dolt-auto-commit on advances it
  by one. On the PR's original base it failed at the `bd dolt commit` step
  with "no store available". On current main the front door refuses the
  command before that code is reached, so this test is only green together
  with the next commit, which moves `dolt commit` to supported in the proxy
  capability registry.
- TestIssueOpsContextDefersByModeInProxiedServerMode renamed to
  TestIssueOpsContextDefersByModePolicyTable and the proxiedServerMode
  assignment dropped: issueOpsContext branches only on writesCommitNow(),
  never on the storage mode, so the old name over-promised.
- doltserver_tx_test.go: "bd: update bd-4995" -> "bd: update GH#4995", which
  no longer reads as a bead id.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(proxy): move `dolt commit` from refused to supported in the capability registry

Main's proxy capability registry (added by #6269, 24a9da6cc) declares
`dolt commit` direct-only: it has a "proxy.dolt_commit.unsupported" refusal
in proxyMaintenanceRefusals (cmd/bd/proxy_capability.go) and is classed
HistoryDirectOnly in historyCapabilityMatrix (cmd/bd/history_capability.go).
The front door therefore refuses `bd dolt commit` in proxied-server mode
before dispatch, so the proxied dual added earlier in this series is
unreachable, and dolt.auto-commit=batch/off has no way to flush.

the history/VC front-door contract, and neither the registry, its tests nor
the docs explain why `dolt commit` was listed. Nothing on main implemented
`dolt commit` for the proxied route at the time, which is consistent with the
entry being a statement of what existed rather than a design decision.

This flips a capability main had declared unsupported, deliberately: the
proxied route now has an implementation (runDoltCommitProxiedServer), and
batch/off need it as their flush point (GH#4995).

Declared the same way as the other proxied-supported command,
`dolt remote remove`: HistoryProxySupported in the history matrix, and no row
in proxyMaintenanceRefusals.

Tests follow: history_capability_test.go moves `dolt commit` from the
direct-only assertions and refusal contract to the proxy-supported ones
(including the nested front-door pass-through), and
history_remote_frontdoor_matrix_test.go drops the refusal row and adds a
`dolt commit` pass-through check to TestHistoryRemoteSupportedFrontDoorParity.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(proxy): exempt explicit commit points from the proxied deferral (#4995)

Maintainer review fixup for PR #6499, adopt-pr iterations 1-2.

Major (Contract & Interface Fidelity). The deferral is applied once, to
rootCtx, so it blanketed BOTH commit classes the direct route distinguishes by
which wrapper a verb picks: policy-honoring writes (transactHonoringAutoCommit,
per-verb issueOpsContext) and explicit commit points (transact, which passes
the caller's message whatever the policy says). Under dolt.auto-commit=batch a
proxied `bd batch -m "release batch"` therefore persisted the rows, discarded
the message and minted nothing, while the identical command and config on the
direct route committed it — and batch_proxied_server.go's own contract comment
rejects exactly that ("would persist these writes while silently bypassing
Dolt history"), as does batch.go's "the contract is the same on both backends".

issueops.WithImmediateVersionCommit clears the marker and cmd/bd's
explicitCommitPointContext applies it in the duals whose direct twin calls
transact. Scope is the intersection of the transact call sites with
proxyPermittedPaths: batch, mol bond/pour/squash, mol wisp create, and the
WISP half of mol burn (cook and migrate issues also call transact but are
refused in proxied mode, so they have no dual to exempt). The review sized the
radius at batch + 4 mol verbs; mol wisp create is the same class — its direct
twin reaches cloneSubgraph's transact through spawnMoleculeWithOptions — so it
is exempted with them.

Membership is per commit site, not per command (iteration 2). `bd mol burn` is
two classes on the direct route: wisps go through burnWisps -> transact, while
persistent molecules go through deleteBatch -> issueOpsContext ->
dolt/deleter.go, which returns before DOLT_COMMIT when the context defers.
Exempting the whole command minted one Dolt commit per persistent molecule
under batch/off — on a destructive verb, where the identical direct-route
command defers them all to `bd dolt commit`. runMolBurnProxiedServer now
applies the exemption to the wisp RunTxResult only, and the flag help,
configuration.md and the helper's own radius comment say so.

Minors:

- The flush passes '--author' like DoltStorage.CommitAll, so the one commit
  batch mode keeps is attributed to the bd actor rather than the SQL session
  user (without it dolt_log reads `root <root@localhost>`).
- runDoltCommitProxiedServer calls the shared runProxiedNonTx instead of
  re-implementing its provider checks, so `bd --json dolt commit` keeps the
  JSON error envelope; `dolt commit`'s RunE no longer re-wraps an
  already-reported failure, and runProxiedNonTx's message gains the provider
  %T the open-coded version had.
- The flag help and configuration.md drop two false claims: that the deferral
  covers "every write" in proxied mode (the bd serve plane over the same
  provider never touches rootCtx, so daemon writes still commit per write) and
  that the SIGTERM/SIGHUP flush is "embedded-only" (flushBatchCommitOnShutdown
  gates on an open store, which direct SQL-server mode has; only proxied mode
  lacks one). Both surfaces now name the explicit-commit-point exemption.
- Both user-facing enumerations of that exemption are now derived from the
  explicitCommitPointContext call sites rather than restated (iteration 2):
  they had omitted mol wisp create, listed mol burn wholesale, and implied a
  message-less `bd batch` defers when batch.go synthesizes a default message
  and the dual exempts unconditionally, so every proxied batch commits.
- doltserver_tx.go's ephemeral-form comment names its second entry point —
  RunTx/RunTxResult under a deferred context — where its
  ONLY-dolt_ignored-state rationale stops applying.

Not done: regenerating docs/CLI_REFERENCE.md. Its --dolt-auto-commit drift is
base-preexisting, and the generated CLI docs are built from the release tag
pinned in docs/cli-docs.pin, not from this source, so touching them converts
the drift gate's inherited-drift warn-pass into a failure.

Tests. The uow blanking table gains the immediate-commit arm (tagless, so it
runs in every lane); the proxied integration test gains an explicit-batch-commit
step with a deferred plain create as its control, plus the flush attribution
assertions. Mutation-proved: reverting explicitCommitPointContext to a no-op
reds the new step (dolt_log 80 -> 80, no commit minted), and dropping
'--author' reds the attribution assertion with committer=root.

Iteration 2 adds the WIRING pin those left open — the mechanism was covered,
but deleting `ctx = explicitCommitPointContext(ctx)` from a dual was green in
every lane, which is why the mol burn over-application above was invisible.
dolt_autocommit_exemption_wiring_test.go is tagless and needs no server: a
uow.UnitOfWorkProvider that records the context RunTxResult hands NewUOW and
then refuses observes exactly the context each dual gives its transaction.
Mutation-proved per arm: neutering the exemption at batch/bond/squash reds
those three rows and only those; dropping it from the wisp RunTxResult reds
the wisp arm alone; and restoring the command-wide reassignment reds the
persistent arm alone, reproducing the defect this iteration fixes.

Validation: go build ./..., go vet (cgo and CGO_ENABLED=0), gofmt clean;
internal/storage/issueops; internal/storage/uow -run TestDoltServerTx; the
cmd/bd registry / history / policy / batch / mol / wisp / errors battery; and
the gated real-server lane BEADS_TEST_PROXIED_SERVER=1 green for both
TestProxiedServerBatchDefersThenDoltCommitAdvancesHeadOnce (41s) and
TestProxiedServerMolBurn (33s, all four subtests including the mixed
wisp+persistent burn this iteration changed).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
(cherry picked from commit edb86e3470)

Hand-resolved for hotfix/1.3.1: cmd/bd/history_remote_frontdoor_matrix_test.go
conflicted because main's context around TestHistoryRemoteSupportedFrontDoorParity
includes direct-topology test helpers (snapshotHistoryState,
newDirectHistoryProject, historyCleanEnv, runDirectHistory,
openDirectHistoryDB, startHistoryUnixBridge) that the release line does not
have. Those main-only helpers are NOT brought over; only this commit's own
change to that region (the updated doc comment) is applied. The refusal-row
removal and the new dolt-commit parity assertion applied cleanly. All other
files applied unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 03:51:48 +00:00
Vishnu J
cf08d4e3f9 fix(storage): cascade wisp aux rows in the shared wisp delete path (#6487) (#6627)
deleteIssueRowInTx, behind Transaction.DeleteIssue (bd mol burn) and
DeleteResolvedSetInTx, removed only the wisps row and the dependencies
edges, so on stores lacking the wisp aux FKs every deleted wisp orphaned
its wisp_labels, wisp_events, wisp_comments and wisp_child_counters rows.
#5343 fixed only the DoltStore wisp GC paths.

Move the aux table list and delete into issueops.DeleteWispAuxRowsInTx,
call it from deleteIssueRowInTx, and have the DoltStore paths use the same
helper so the table set cannot drift.

Forward-fix only: cleaning existing orphans needs a batched backfill and
is left to a follow-up. Sibling of #6563 (wisp_dependencies).

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 3ba08dba1c)
2026-09-29 03:50:45 +00:00
Matthew Doka
26467a8d02 fix(storage): cascade wisp deletes into wisp_dependencies (#6563)
* fix(storage): cascade wisp deletes into wisp_dependencies

DeleteWispFromDependenciesInTx and DeleteWispsFromDependenciesInTx only
cleaned the dependencies table, never wisp_dependencies — even though
DeleteCascadeTables(isWisp=true) declares wisp_dependencies as part of
the wisp deletion set. On stores whose wisp_dependencies table lacks the
migration-0047 FK constraints (like a live production store observed
with only the ck_wisp_dep_one_target CHECK), every wisp deletion
orphaned that wisp's wisp_dependencies rows on both sides, and reaper
scans flagged the leftovers as dangling_parent_ref anomalies that
recurred after each cleanup (~100+ rows/hour under a busy daemon).

Remove the deleted wisp's wisp_dependencies edges as child (issue_id)
and as parent (depends_on_wisp_id) in both the single and batch delete
paths. Two targeted DELETEs per direction rather than one OR query, so
each hits its own index — the ff-tqm pattern; a single OR across both
columns previously caused Dolt i/o timeouts.

Adds TestWispDeleteCascade_CleansUpWispDependencies to the standalone-
server integration harness (the existing wisp_gc_test.go coverage
requires a Docker testcontainer and silently skips without one). The
test drops the fresh-bootstrap FKs first so it exercises the delete
path's own cascade, matching the production schema; it fails without
this fix and covers the single-delete path the Docker tests omit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fixup(review): pin over-deletion and correct two cascade comments

Maintainer review fixes for PR #6563. No production behavior change.

The new subtests asserted only that the deleted wisp's wisp_dependencies
rows were gone, so an unguarded "DELETE FROM wisp_dependencies" with no
WHERE passed both of them — verified by mutating both helpers and
watching the test stay green. Each subtest now also creates an edge
between two wisps it never deletes (a bystander pair for the single
delete, an out-of-batch pair for the IN (...) form) and asserts that
edge survives. Under the same mutation the test now fails three times
with expected-vs-got. This also replaces the comment that claimed the
surviving wisps' edge set was checked, which it was not: every edge the
subtest created involved the deleted wisp.

dropWispDependencyFKs attributed the FK constraints to migration 0047.
They come from 0021, which creates all three inline in CREATE TABLE;
0058 re-adds two when healing a legacy split store, and 0047's ADD
CONSTRAINT statements are gated on that same legacy path, so neither
runs on the fresh bootstrap this harness uses.

wispAuxCascadeTables exists so the cascade set cannot drift between the
two delete paths, so note there why wisp_dependencies is handled in
issueops instead: its rows are journaled as dependency removals.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
(cherry picked from commit 4213c229a4)
2026-09-29 03:50:42 +00:00
Julian Knutsen
0144dbe76b fix(close): make --json failed[].error route-independent (post-merge #6740) (#6771)
Post-merge review of #6740 (landed range c25059ada..730fb9867) found one
major: the machine-readable `failed[].error` field that PR added carried a
DIFFERENT string for the identical refusal depending on whether the caller
was on the embedded or the proxied-server route — the exact class of route
drift the close rewire exists to remove, shipped in the same commit that
states the principle in a comment. No test pinned the text, so CI was blind
to it.

Two causes, both on the proxied route:

1. The harvest loop copied `pre.errors[i]` — closeProxiedRefusal's DECORATED
   display line — straight into the JSON field, so a blocked id gained
   " (use --force to override)" that the direct route deliberately keeps out
   of the same field. Fixed by carrying the typed error in a parallel
   per-argument slot (`failureErrors`), mirroring the direct route's split,
   and reading that slot in the new closeProxiedFailures.

2. Stripping the decoration was not sufficient: a refusal reaching this route
   has also been wrapped by the layers it passed through, so the undecorated
   typed error still read
     close x-1: db: IssueSQLRepository.CloseChecked x-1: cannot close blocked …
   against the direct route's
     cannot close blocked issue: x-1 is blocked by [x-2]
   closeProxiedTypedRefusal unwraps to the sentence the engine actually wrote
   for the refusal classes the CLI already names by sentinel. Anything else
   keeps its whole chain, where the wrapping is the only thing that says where
   an unexpected failure came from.

Tests: the split and the unwrap are pinned in an untagged file so they run in
the CGO_ENABLED=0 lane too, and the shared assertion is applied by BOTH
integration suites — a new direct-route twin of
close_partial_failure_json_names_the_failed_ids, which also gives the default
route its first pin on reportCloseFailures' jsonOut branch. Every pin was
mutation-proved: reading the display line reds the three decorated classes
while the undecorated open-children control stays green; converging by
stripping the hint from stderr instead reds the human-line half; recording the
decorated line on the direct route reds the twin.

Scope: this is the only entry under the review's Required Changes. The five
non-gating minors (single-id --json report, closeCmd.Long paragraph, text-mode
per-id reprint, the `claimed` JSON type, the CHANGELOG not-found parenthetical)
are deliberately left for separate follow-ups.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 01bd1f1e54)

Hand-resolved for hotfix/1.3.1: CHANGELOG.md conflicted only on context
(main's Unreleased/Fixed list has entries the release line lacks). The
release CHANGELOG is kept and the same wording change is applied to the
#6648 entry carried by the previous pick. No code hunk needed changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 03:49:46 +00:00
Vishnu J
c296fc9205 Beads #6648: report partial batch-close failure (#6740)
* fix(close): fail partial batch closes

Fixes #6648

* review: exit nonzero on proxied partial close, update tests and changelog

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* review: print close failure summary only for multi-id batches

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* review: machine-readable close failures, and adjudicate --claim-next

Maintainer fixup for the two major findings on #6740 (Beads #6648).

1. --claim-next x partial failure (major). --claim-next rides inside the
   batch transaction and fires whenever something LANDED, so a mixed batch
   claimed a fresh issue and then exited 1, with nothing in the diff, the
   CHANGELOG or the tests saying so.

   Adjudicated as "the claim stands and the report names it", not "the claim
   is suppressed". Suppressing it at cmd/bd -- the site the review named --
   cannot un-claim anything: ExecuteCloseBatch (and the uow provider's twin)
   commit the claim alongside the survivors before the CLI ever sees a
   refusal, so gating the report would only leave an issue assigned to the
   actor with nothing on stdout or stderr saying so. Strictly worse than
   announcing it. The claim is now named in the text summary and in the JSON
   failure payload, so a caller that exits on the nonzero status can still
   see what it owns.

   The review's "unbounded claim leak -- another ready issue on every
   attempt" does not hold, and the new test pins why: on a retry the survivor
   is already closed, so `landed` is 0 and an empty batch earns no claim
   (close_batch.go:146, uow/batch_closer.go:71). The leak is bounded at the
   one claim the first run earned. The defect that remains -- a durable claim
   the caller is never told about -- is what this fixes.

2. --json partial failure carried no machine-readable signal (major). The new
   exit 1 left stdout as the success-shaped array of CLOSED issues and put
   only human refusal prose on stderr, so a JSON consumer could not learn
   WHICH ids failed without scraping it -- the exact fragility #6648 was filed
   about, left in place for the callers most likely to batch. Both routes now
   report through one reportCloseFailures helper modelled on bd update's
   reportUpdateFailures: a compact {"error","failed":[{"id","error"}]} line on
   stderr, stdout keeping the closed-issues array. That also removes the
   summary hand-rolled twice with two denominators (the architectural nit).

Also taken, all non-gating and adjacent to the above:
- CHANGELOG narrowed to the refusals it actually covers, noting that an
  UNRESOLVABLE id still aborts the direct route before any close runs while
  the proxied route refuses it per-argument (the route-parity overclaim).
- Tests for the three deliberately-chosen behaviours that had no pin: the
  --json partial failure (proxied), the --claim-next interaction above
  (embedded, both failure channels), and the single-id summary suppression
  that commit 97151ab8e exists solely to add -- asserted in
  TestParityCloseNothingSettledExits1, which checked stdout but not stderr.

Contributor commits preserved; behaviour of the original fix is unchanged on
every route it already covered. Single-id stderr stays byte-identical.

Validated: go build ./..., go vet ./cmd/bd/..., TestParityClose family,
cmd/bd/protocol, TestEmbeddedClose close/claim-next subtests
(BEADS_TEST_EMBEDDED_DOLT=1), TestProxiedServerClose partial-failure subtests
(BEADS_TEST_PROXIED_SERVER=1), TestMultiIDUpdatePartialFailure.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
(cherry picked from commit 730fb9867e)

Hand-resolved for hotfix/1.3.1: CHANGELOG.md conflicted only because main's
Unreleased/Fixed list does not exist on the release line. The release
CHANGELOG is kept and this entry is added verbatim under Unreleased
"### Fixed". No code hunk needed changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 03:49:22 +00:00
Gas City Adopt-PR
d79ef48048 test(release-1.3.x): black-box regression tests for the #6716 blocked-flag stall [NOT a cherry-pick]
Release-only test addition for the #6719 hand port. The tests #6719 ships
reference symbols the fix introduces, so on the pre-fix release line they
fail only to compile. These two use only store entry points that exist on
both sides of the fix, so they fail behaviourally on hotfix/1.3.1 @
f5a9402790 and pass with the port:

- dolt (server tier): a close through the store's own write runner
  (withWriteTx and withRetryTx) pins its snapshot, a sibling close commits
  on a second connection, the store's close commits last. Pre-fix rb-c
  stays is_blocked=1 and absent from GetReadyWork; post-fix it is ready.
- embeddeddolt: embedded transactions serialize, so the contract is
  pinned instead: a dependent a committed close recomputed is settled on a
  fresh snapshot after commit.

Proxied (uow/domain-db) mode is not covered: #6719 on main does not scope
that route either (see blocked_recheck.go's doc comment and the CHANGELOG
entry), so there is no proxied behaviour to test on this line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 03:48:16 +00:00
Alex
e352b96d60 fix(dolt): recheck dependents' blocked state after a close commits (#6719)
* fix(dolt): recheck dependents' blocked state after a close commits (be-cmn)

A close recomputes its dependents' is_blocked inside its own transaction,
against that transaction's start snapshot. Two concurrent closes of sibling
blockers each see the other blocker still open, so neither writes the shared
dependent's row; both commit without a conflicting cell, and the dependent
stays is_blocked=1 and hidden from `bd ready` until `bd recompute-blocked`.

The in-transaction close and status-change paths now record the dependents
they recomputed (never the closed issue itself) in a transaction-scoped note,
the same shape as the events-journal scope. The store's write-transaction
runners take that note once the transaction has committed and, only when it
is non-empty, run one more short retried transaction that recomputes exactly
those ids on a fresh snapshot. The recheck runs after the retry loop around
the write, so a recheck failure is reported as "write committed;
blocked-state recheck failed" and never replays a write that already landed.
When the recheck changes an issues row it mints a Dolt commit naming the
closed issue, so the corrected flag reaches history like the close's own
rows instead of sitting dirty in the working set. A close with no dependents
records nothing and issues no extra SQL.

This covers every DoltStore write path, including the lifecycle and batch
closers the CLI uses, and the embedded store's withConn. The RunInTransaction
path (doltTransaction.CloseIssue) keeps its pinned-connection commit and is
not scoped; nothing on the CLI's close or update path reaches a close
through it.

Fixes #6716

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(dolt): recheck blocked state after dependency removals and deletes too (be-cmn)

Only a close and an update to an inactive status recorded a post-commit
blocked recheck. A dependency removal and the three delete paths run the
same in-transaction recompute, can likewise only unblock a dependent, and
so reproduce gastownhall/beads#6716 when they commit last: a `bd close A`
overlapping a `bd dep remove C B` (or a delete of B) leaves C blocked on
every committed snapshot with no recheck to settle it.

Generalize the recording so each unblocking write records the dependents
it recomputed: noteBlockedRecheck now takes a human label for the recheck
commit message and an explicit exclusion set. A close or status update
excludes its own row (a concurrent writer conflicts on it rather than
racing past it); a delete excludes the rows that no longer exist; a
dependency removal excludes nothing, because its dependent is exactly the
row that needs rechecking. Labels stay bounded: a bulk delete of more
than three ids is named by count. The close path's commit message,
"bd: recheck blocked after close of <id>", is unchanged, and a close
through update mints the same message as a close through CloseIssue.

The server tier gains the close-versus-dependency-removal race and a
check that a delete records the deleted row's dependents; the embedded
tier pins the recording contract for a close, a removal and a delete on a
real engine; the issueops unit test pins deduplication, exclusion and the
labels.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(dolt): name a committed write's recheck failure with a sentinel (be-cmn)

A recheck failure reaches the caller as an error from the same store call
that just committed its write, indistinguishable from a write that never
landed. Add issueops.ErrBlockedRecheckFailed and wrap both stores' recheck
failures with it, keeping the underlying cause reachable through a second
%w, so a caller can errors.Is a committed-but-unrechecked write apart from
an uncommitted one. The stale flag it leaves is the one bd doctor and
bd recompute-blocked already repair. The CLI's exit-code treatment is a
separate follow-up; this is the storage layer only.

Correct the embedded store's comment, which claimed two withConn callers
in one process overlap as two server sessions do. They do not: commitConn
opens a fresh OpenSQL handle per transaction and OpenSQL waits, with no
elapsed-time limit, for the engine, so a second handle blocks until the
first is cleaned up. Embedded transactions serialize and the skew of
gastownhall/beads#6716 cannot occur there; the recheck stays so the
embedded store honors the same contract as the server store and runs
after the first handle's cleanup, so it cannot deadlock on itself.

Document that the recheck scope is keyed by the DBTX interface value: a
write records into it only when the very *sql.Tx the store scoped reaches
it, and a future DBTX wrapper would silently record nothing, the same
shape as the events-journal scope.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(issueops): state the blocked recheck's scope precisely (be-cmn)

The recorded writes are the ones that take a blocker away, not writes
that "can only unblock": removing the one closed child of an
any-children gate blocks its waiter, and the recheck, being a full
recompute, settles that too. Name the writes that add a blocker (reopen,
dependency add, parent-child add) as recomputing the same way without a
recheck, so the remaining gap is written down where the mechanism is.

The exclude list filters one call's ids only; say so, and that a stale
pending id for a row a later write deleted is a harmless no-op.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(dolt): keep a failed blocked recheck out of the caller, and scope the coverage claim

Maintainer fixup for the adoption review of #6719 (fixes gastownhall/beads#6716).
Three review majors, plus the cheap non-gating cleanups that sit next to them.
The contributor's commits are left exactly as authored.

1. A post-commit recheck failure no longer reaches the caller of a committed
   write. ErrBlockedRecheckFailed had no consumer, so every store-facing
   caller — CLI, HTTP, the batch closers — still read it as "the write did
   not land" and would retry an applied mutation: the double-apply inversion
   internal/storage/dolt/issue_operations_tx.go documents. The stores now
   wrap the failure with the sentinel and log it. What it leaves behind is
   the stale is_blocked flag `bd doctor` and `bd recompute-blocked` already
   repair, i.e. the state every write had before the recheck existed. This
   also removes #6723 as a prerequisite for shipping.

2. The recheck runs on issueops.BlockedRecheckContext: detached from the
   caller's cancellation — the write it repairs has already committed, so a
   CLI deadline, a disconnected HTTP client or shutdown must not skip the
   repair and leave exactly the stale flag #6716 is about — with its own
   ceiling, and marked so a recheck cannot start another. Termination
   previously rested only on RecomputeIsBlockedInTxWithResult never
   recording, an invariant nothing enforced.

3. The coverage claim is scoped where it was false. Recording only becomes a
   recheck on a transaction one of the two store write runners scoped, and
   `bd batch` reaches neither: it dispatches close, `update status=closed`
   and `dep remove` onto storage.Transaction when local (cmd/bd/batch.go:177)
   and onto uow.RunTxResult when proxied (cmd/bd/batch_proxied_server.go:41).
   5531d0592's message ("This covers every DoltStore write path … nothing on
   the CLI's close or update path reaches a close through it") and the PR
   description said otherwise. The CHANGELOG, blocked_recheck.go's doc
   comment and the PR description now scope the claim and name the uncovered
   routes: uow/domain-db, RunInTransaction (`bd batch`, `bd cook`,
   `bd mol squash`, `bd mol burn`), the legacy RemoveDependencyWithOptions
   (`bd duplicates --merge`), and the wisp writers.

Also non-gating: the recheck's Dolt commit message is bounded (it names up to
three writes and counts the rest), and a write that contributed no id is no
longer named in it. New tests pin the recheck context, the bounded message,
and the store seam the wrapper's unit test could not reach: a close whose
recheck transaction fails still returns nil and stays durable, and the failure
the withConn/commitConn path produces carries ErrBlockedRecheckFailed.

Second review iteration: the scorecard required no changes, and all four
findings were non-gating (one minor, three nits). Each indicted text this
fixup itself introduced rather than the contributor's, so they are fixed here
instead of deferred.

4. A dropped recheck is now counted, not only logged. Swallowing the failure
   in 1 made that log line the only signal a dependent is stale, while the
   convention it was modelled on — post_tx_commit_dropped, for the same
   "post-tx step failed, the write is durable" situation — is a counter *and*
   a line. bd.db.blocked_recheck_dropped is registered beside it and bumped
   on the Dolt side, and both stores' warnings now name the rows left
   unrechecked and point at `bd recompute-blocked`; an operator reading one
   line previously could not tell which issues needed it. The sentence is
   shared from issueops next to the sentinel, which also retires the
   near-duplicate doc comment the two stores carried.

5. The bounded commit message keeps the names it retained: past the limit it
   appends "and N more" instead of collapsing to a bare count, so the commit
   that is the only record of which write triggered a repair no longer
   discards the labels kept for exactly that purpose. N counts the unnamed
   writes, which also removes a skew — Sources deduplicates and SourceCount
   does not, so two equal-sized bulk deletes rendered one label and took the
   count-only form at two writes, not at "more than three" as documented.

6. The CHANGELOG's wisp clause now matches the doc comment and the PR
   description: closes, updates, deletes and demote-to-wisp. An update to an
   inactive status also takes a blocker away, and the narrower list
   under-counted the uncovered routes on the surface users actually read.

7. The Dolt tier's swallow is pinned. Every other test in
   close_recheck_blocked_test.go calls recheckBlockedAfterCommit directly, so
   nothing crossed either runner's tail on the tier #6716 was reported on —
   restoring `return s.recheckBlockedAfterCommit(...)` turned nothing red.
   TestCloseRecheckBlocked_FailureKeepsTheWrite runs a close through
   withRetryTx and through withWriteTx with the recheck forced to fail
   (marking the store closed inside fn, the analog of the embedded test's
   readOnly flip) and asserts nil plus durability.

Gates, this iteration: gofmt clean; go build ./internal/storage/... and
go vet on issueops, dolt and embeddeddolt clean;
go test ./internal/storage/issueops/ ok;
go test -tags gms_pure_go ./internal/storage/embeddeddolt/ -run BlockedRecheck
ok (9s, real engine); go test ./internal/storage/dolt/ -run CloseRecheckBlocked
ok (27s, dolt testcontainer). Iteration 1 additionally ran the full embedded
package (98s) and the dolt subset
'RunInTransaction|BatchCloser|IsBlocked_|CloseRecheck|LifecycleCloseReopen'
(156s). Every new assertion was proved non-vacuous by mutating the change it
pins — reverting CommitMessage to the count-only form, counting all writes
rather than the unnamed ones, dropping the ids and the repair pointer from the
warning, unbounding that id list, and restoring the propagation on each runner
tail — six mutations, each reddening only the assertions that defend it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>

(cherry picked from commit 1ed5b33303)

Hand-ported to hotfix/1.3.1 (release/1.3.0 base); the pick did not apply
cleanly:
- internal/storage/dolt/store.go (commitWriteTx) and
  internal/storage/embeddeddolt/store.go (commitConn): main's context lines
  install scopeVersionedHistoryTransaction / ScopeVersionedHistoryTransaction,
  a main-only feature absent on the release line. Resolved by keeping the
  release code and adding only the two ScopeBlockedRecheckTransaction lines;
  the versioned-history scope is NOT brought over. Every other hunk in both
  files (runner split, recheck, logging, metric) applied unchanged.
- CHANGELOG.md: main's entry sits in an Unreleased/Fixed list the release
  branch does not have. The release CHANGELOG is kept and the #6716 entry is
  added verbatim under a new Unreleased "### Fixed" heading.
No schema change; issueops, dolt and embeddeddolt build and vet clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 02:17:45 +00:00
Julian Knutsen
f5a9402790
Merge pull request #6905 from gastownhall/hotfix/1.3.1-proxied-backup
hotfix/1.3.1: proxied bd backup + purge wisps-plane/live-dependent protection/--limit
2026-09-28 12:39:50 -07:00
Gas City Adopt-PR
2b27259cb4 test(release-1.3.x): adapt release-only capability tests to the backported proxied backup [NOT a cherry-pick]
Release-only adaptation, not a copy of any main commit. The tests it
touches exist only on release/1.3.0, so there is nothing on main to
pick; every other commit on this branch is a faithful cherry-pick -x.

- topology_capability_matrix_test.go (#6579, release-only S0 matrix):
  flip backup status/sync as #6584's own description says. On
  proxied-local, status is HONORED and sync is ERROR "no backup
  destination configured"; other proxied topologies are REFUSED_TYPED
  with reason design. The runner already orders refusal rows before
  honored ones, so the honored cells no longer start the proxy ahead of
  the no-side-effect refusal checks (the red smoke-lane cells review
  found).
- proxy_capability_test.go: TestProxyMaintenanceAllowsTheSharedConsentVerb
  (#6695, release-only) called validateProxyMaintenanceBeforeProvider,
  which #6582 removes; it now calls validateProxyRegistryBeforeProvider
  for managed-local, with unchanged assertions. Until this commit the
  cmd/bd test package does not compile on the picks above it.
- proxied-local-smoke.yml: run the capability matrix and the backup
  round trip in the compiled-in check, and trigger on cmd/bd/backup*.go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 15:56:08 +00:00
Julian Knutsen
7c2568c323 feat(purge): live-dependent protection, --wisps-plane selector, hour-precision --older-than, --limit (#6883)
* feat(purge): live-dependent protection, --wisps-plane selector, hour-precision --older-than

An orchestrator's wisp retention step deletes every closed row in the
wisps table older than N hours, except a closed wisp that an
open/hooked/in_progress wisp depends on through parent-child, tracks or
blocks. `bd purge` could not express that: it selected the ephemeral
TIER (so closed --no-history beads, which live in the wisps table, were
left behind), it deleted a closed molecule root whose step was still
open, and it floored --older-than hours to whole days (36h swept rows
24h old). All three land together so `bd purge --wisps-plane
--older-than 168h --force` covers that step.

Live-dependent protection (issueops.SweepRequest.ProtectLiveDependents,
SweepSkips.LiveDependent): a candidate is held back when a live row
depends on it through a SweepLiveDependentEdgeTypes edge (parent-child,
tracks, blocks), read from both dependency tables. "Live" is the same
not-done set the reference scan uses, custom statuses included, so it
is a superset of open/hooked/in_progress. `bd purge` always asks for it
(no opt-out: removing live work's root is `bd delete`'s job); `bd prune`
does not. Reported as live_dependent_skipped in --json.

Wisps-plane selector (issueops.SweepWispsPlane, `--wisps-plane`): the
candidates are every closed row in the wisps TABLE, whatever its
ephemeral/no_history/wisp_type values, via a new single-plane search
(issueops.SearchWispsPlaneInTx) that the store backends call directly
and the unit-of-work provider reaches through
IssueUseCase.SearchWispsPlane, so embedded, server and proxied share one
body. It reaches durable-tier (no-history) rows, so it carries the
durable tier's require-a-filter gate.

--older-than (purge and prune): day values keep their meaning (7, 7d,
2w); anything else is a Go duration taken exactly (36h, 168h, 90m).

Tests: three new Sweeper contract cases (wisps plane clears the whole
table, wisps plane requires a filter, protects live dependents) run on
dolt, embeddeddolt and the uow provider; workapi unit tests; a CLI
retention scenario run in embedded, shared proxied and managed-local
proxied modes (fails against origin/main); TestParseOlderThan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(uow): classify IssueUseCase.SearchWispsPlane as a read in the notifying parity partition

TestRecordingIssueUseCaseCoversItsSurface requires every IssueUseCase
method to be either wrapped by the notifying decorator or exempted with
the reason it fires no hook. SearchWispsPlane reads state and changes
none, like SearchIssues beside it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(purge): refuse out-of-range --older-than; add --limit for bounded drains; cross-plane protection test

Review follow-ups on #6883.

--older-than: a day count past what a time.Duration holds (213504d,
30501w) used to wrap silently — 213504d became 25m26s, which on a
destructive command selected almost every closed row. It is now refused
as out of range; ParseDuration already refused oversized h/m/s values.

--limit N (issueops.SweepRequest.Limit, SweepResult.Remaining): one
purge deletes at most N rows, oldest closed_at first (then id), after
every protection, and reports the rest. --json adds remaining and
has_more when --limit is given. At ~15ms/row on the proxied path a
single unbounded sweep of a large backlog can outlive a caller's
deadline, roll back, and never clear; a bounded loop cannot. Negative
limits are ErrValidation at the role and refused at the CLI.

Tests: TestParseOlderThan out-of-range rows; contract cases
LimitTakesTheOldestClosedFirst and ProtectsLiveDependentsAcrossPlanes
(a live issues-table bead depending on a closed wisp via parent-child,
tracks and blocks keeps it) on dolt, embeddeddolt and uow; workapi
units for the ordering and the negative-limit refusal; the CLI
retention scenario now drains with --limit 1 and checks the overflow
refusal. CHANGELOG notes that sub-day Nh values used to round UP to a
day (12h is now taken exactly) and lists the protection under Changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2ec0b2f072)
2026-09-28 15:54:56 +00:00
Julian Knutsen
74dc7154c2 fix(backup): stop attributing proxied auto-backup OFF to a missing git remote (#6694)
Post-merge review of #6584 (landed 7ccb961f7..c69dd3061).

Honoring the backup family on a managed-local proxied server made
`bd backup status` reachable on that topology for the first time — and it
rendered the embedded-mode footnote `(auto: no git remote)`. That reason was
never true there: `isBackupAutoEnabled` returns false because `usesSQLServer()`
short-circuits it, whether or not a remote exists. The same command's help then
told the operator to set `backup.enabled=true` to opt in, which on proxied
changes nothing — the proxied arm of `PersistentPostRunE` never calls
`runPostRunAutoBackup`, so an operator following bd's own instructions gets
silent no-backup.

The status note now comes from `backupAutoStatusNote`, which narrates the reason
the decision actually used: proxied-server first (and regardless of the config
source, since an explicit `backup.enabled=true` is inert there and a bare
`enabled=true` is the misleading half), then sql-server mode — the reason
`bd config get backup.enabled` already reports for the same condition — then the
unchanged embedded git-remote arms. The `backup` help stops advertising the
opt-in on proxied and points at explicit `bd backup sync`, which is honored on
the one proxied shape that reaches these surfaces.

Wiring an auto-backup hook through the new proxied routes is the other half of
the reviewer's fix and is deliberately not taken here: all three reviewers
classified the missing hook as a pre-existing gap #6584 did not claim. Only the
newly produced misinformation is corrected.

`TestBackupAutoStatusNote` pins all seven shapes against the value they are
printed beside; reverting the helper to the pre-fix ordering fails exactly the
three server-mode cases and leaves the four embedded ones green.

(cherry picked from commit e677d90d88)
2026-09-28 15:54:19 +00:00
Julian Knutsen
ca37d8f9fc feat(backup): route the backup family over proxied-server, refused by design off-host (proxied-parity S3) (#6584)
* refactor(proxy): one capability registry, with a reason on every refusal

Proxied-server policy lived in three path tables (a maintenance refusal
map, a history classification map, a transform row list), each with its
own lookup and its own front-door validator, plus a flag matrix. Nothing
forced a new command to appear in any of them, so an unclassified
command sailed past the gate and died in the store factory with
`proxy server store should be uow provider`. That — not the table count
— was the root problem.

One table now (cmd/bd/capability_registry.go), and a test that fails
when a runnable command is missing from it. Adding a command is no
longer a place where policy can be forgotten: it is a build failure
until someone decides whether the proxied front door lets it through.

Every refusal carries a Reason: `design` where refusing is correct and
expected to stay (shared history, multi-repo routing, destructive admin,
storage-format surgery, strict --readonly), `unimplemented` where it is
a gap with a named owner. The reason renders in the refusal JSON,
additive to the frozen {code, error, mutates} contract, and is omitted
on refusals that report a runtime state rather than a policy so a
consumer keying on its presence is never told "" by mistake.

The registry also inventories the 57 untyped refusals commands raise
from their own RunE. Those rows are not enforced — converting them
changes observable output and belongs to the slice that owns each
family — but a source scan now keeps the inventory honest in both
directions.

The store-factory backstop is typed as `proxy.store.unrouted`, the
unreachable duplicate readonly refusal in main.go is gone (the proxied
branch above it already returns for the only config that reaches it),
and with it `backendSupportsStrictReadonly`, which had no other caller.

No outcome changes. Every code, message and exit status is identical,
which #6576's five-topology matrix proves: 90/90 cells unchanged
(HONORED 47, REFUSED_TYPED 24 = 4 design + 20 unimplemented, ERROR 12,
WRONG_ANSWER 4, DEGRADED 3), all five topologies exercised, no skips.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(proxy): `migrate hooks` is an unimplemented refusal, not a design one

The registry filed `migrate hooks` under "storage-format and workspace
surgery against a store other clients may be holding open". That rationale
does not describe it: migrate_hooks.go plans and applies GIT HOOK FILE
migration through doctor.PlanHookMigration, on the local filesystem, and
opens no store at all. Left as it was, proxied-local — the default topology
since 1.3.0 — loses the command permanently, because `design` tells every
later slice the refusal is semantic and settled.

It is not settled, but it is also not free to lift, and the difference is
structural rather than semantic. `migrate hooks` appears on none of main.go's
store-init skip lists, so permitting it makes the root pre-run open the
proxied provider before RunE runs. Measured with the row flipped to
permitted, not reasoned about: on a managed-local workspace
`bd migrate hooks --dry-run` started the proxy AND its dolt child — both
pidfiles present — to print a hook plan for five missing hooks, and on a
workspace with an unreadable sidecar it exited 1 with "failed to open uow
provider: corrupt proxied-server sidecar ..." where it had cleanly refused
before. Trading a typed refusal for a provider-open error is not a lift.

So: Reason=unimplemented with a Tracking item that names the actual work —
put the command on the store-init skip list first, then permit it — which is
S7's, not this slice's. No outcome changes; the row still refuses with the
same code, message and exit status. The registry header now says that
permitting a path costs a provider open, since that is the fact this row
turns on and the one the completeness test cannot see.

Also leaves S7 an explicit instruction on the rows next door. `migrate
issues`, `migrate-personal` and `admin cleanup`/`admin reset` claim `design`
on a topology-blind rationale — "a store other clients may be holding open",
"destructive against a possibly-shared store" — that describes external and
team-server workspaces and does not describe managed-local, which is 1:1 and
bd-owned. They are not reclassified here: the table cannot yet express
"refused, except on managed-local", and narrowing them is semantic work
nobody has done. The comments now say that is why, so the next reader does
not mistake conservatism for a considered verdict.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(backup): route the backup family over proxied-server, refuse it by design off-host

A proxied-server workspace had no backup path at all: all five verbs — init,
sync, remove, status, restore — refused. Proxied has been the default topology
since 1.3.0, which made this the highest user-weight gap in the proxied-parity
plan.

The mechanism needed no proxy work. CALL DOLT_BACKUP(...) is ordinary SQL,
RunNonTx already hands out a raw pinned connection (the seam compact --dolt and
gc run on), the UOW DSN sets a connect timeout and no read deadline, and an
active connection keeps the idle reaper from arming — so a backup that takes
minutes is safe from both the driver and the 30s reaper. The work was use
cases, route files and policy rows, and the premise held.

The policy is the interesting half, and it is the first genuinely
topology-differentiated rule in the capability registry. A backup destination
is resolved by the SERVER: `file:///…` names a path on the machine running
dolt. On managed-local that machine and that user are bd's own, because bd
spawned the child. Anywhere else — an external host or socket, or a
beads-team-server database — the URL describes a filesystem bd cannot see, so
honoring the command would either fail at the point of use or, far worse,
report success having written the backup where the operator will never look.
Those shapes stay refused with Reason=design: no plumbing on this side gives bd
a path on somebody else's host.

Team-server is classified by OWNERSHIP, not transport. bts owns the store's
schema and identity whether bd reaches it over a port, a socket, or a child bd
started, and one client registering a server-side backup remote acts on every
client's data — the shape of the storm this command's own help text warns about.

Restore quiesces before it replaces. DOLT_BACKUP('restore') swaps the database
under the server, which is undefined with clients connected, so: the exclusive
workspace gate `bd backup restore` already takes excludes every other gated bd
command (including `bd serve`); this closes the provider the pre-run opened and
shuts the proxy and its dolt child down; it reopens a provider of its own to
run the restore as the only client; then it puts the topology down and reopens
once more to reconcile the project identity and the backup remote — which also
proves the restored database is serviceable. The final shutdown leaves the
workspace quiescent for the next command to relaunch lazily.

Registry rows gain a Topology map and honoredOn(), stated as "refuse, except
here" so a shape nobody thought about — a new transport, or the unknown a
corrupt sidecar produces — inherits the refusal rather than the exemption.
resolveProxiedTopology reads the shape from the workspace and reports unknown
rather than guessing.

`bd backup restore --json` now prints a result object on every topology; it
printed nothing before, which left a caller unable to tell a completed restore
from a skipped one. The four backup subcommands that lacked SilenceUsage/
SilenceErrors no longer follow their error message with "Error: exit code 1"
and a usage block.

Verified by round trip, not by exit codes: TestManagedLocalProxiedBackupRoundTrip
takes a backup on a live managed-local workspace, creates an issue after it,
restores, and asserts the pre-backup issue is back and the post-backup one is
gone, with both pidfiles absent afterwards.
TestProxiedServerBackupRefusedOnExternalTopology pins the typed design refusal
against the shared container and proves a refused command starts nothing and
writes nothing.

Flips four cells of #6576's matrix: `backup status` and `backup sync` go
REFUSED_TYPED/unimplemented -> HONORED and -> ERROR ("no backup destination
configured", the command's own error, same as every direct topology) on
proxied-local, and unimplemented -> design on proxied-external-tcp.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(backup): say why proxied backup is refused, and stop calling a cleanup failure a restore failure

Review follow-ups on the proxied backup slice. None of them changes which
commands are honored on which topology; what changes is what the refusal
CLAIMS, and what a restore says when only its teardown failed.

The refusal rationale was true of one destination scheme out of five. It said
"a backup destination is resolved on the server's filesystem, not this
client's" — which describes `file://` and nothing else. resolveDoltBackupURL
passes `https://`, `aws://` and `gs://` straight through, and `bd backup`'s
own help recommends DoltHub by name; for those the server pushes over the
network from its own environment and no filesystem of anybody's is involved.
An operator running `bd backup init https://doltremoteapi.dolthub.com/...` on
an external topology got a permanent verdict explained by a filesystem the
command never touches.

The refusal itself stands, on the reason that is true of every scheme: `CALL
DOLT_BACKUP('add', …)` registers the remote ON THE SERVER, where it is global
to every client connected to it, so one workspace's backup decision becomes
everyone's — the same shape as the auto-backup storm this command's help text
already warns about. The file:// locality problem is now stated as the second,
scheme-specific problem it is. The message keeps its frozen
"<path> is not supported in proxied-server mode" prefix and its
proxy.backup.unsupported code.

The remote-scheme case gets a Tracking item, the way `diff` got "1.4
candidate". The outcome is design; that particular CASE is an open question,
and a design label with no tracking reads as "never" to every later slice.
It is the same server-env credential question S4 has to answer for `dolt
push` on these same topologies. Recorded there too: restore-from-a-remote is
already half-broken in DIRECT mode, because validateBackupRestoreDir stats its
argument, so `bd backup restore https://...` fails everywhere today.

A restore that succeeded and then failed to shut the proxy down reported
"restore failed". The operator's data was back; they were told it was not,
and the obvious next move — run the restore again — was the wrong one.
withQuiescedProxiedProvider now returns teardown failures wrapped in
*proxiedTeardownError instead of flattening them into the operation's error,
and the message the caller renders is split into a function a test can hold
still, because the judgement it encodes (did the data come back) is the point.
Both call sites distinguish now; the second one's "did not reopen" wording was
also wrong for a teardown failure, since it had reopened.

Two smaller things while in here. The guard-rail comment on
newProxiedServerUOWProviderAdopting still said "only two callers legitimately
have no workspace identity to assert" — this slice added a third. That comment
is the register of identity-assertion bypasses, so it now names the third and
why, and says what to do about a fourth. And DirToFileURL was "file://" +
filepath.Abs with no scheme check: it would have turned a DoltHub URL into
file:///cwd/https:/doltremoteapi.dolthub.com/... , a valid-looking URL naming a
directory nobody asked for. Unreachable today, and every caller is a restore
path, which is exactly the capability the tracking item above describes.

CHANGELOG additionally discloses two direct-mode changes this slice makes that
were previously only visible in the diff: `bd backup restore --json` prints a
result object on EVERY topology where it used to print nothing, and the four
backup subcommands that gained SilenceUsage/SilenceErrors no longer follow a
failure with "Error: exit code 1" and a usage block, on every topology.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(backup): quiesce failed restore reopens and pin JSON output (bd-obos)

Preserve the primary constructor or operation error while reporting cleanup failures without a successful-restore marker. Exercise a real malformed-backup reopen failure and assert both pidfiles are removed; retain the successful round trip and assert its JSON result.

Agent-Signature: codex-unknown-model-unknown-reasoning on behalf of Julian Knutsen

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit c69dd3061a)
2026-09-28 15:54:04 +00:00
Julian Knutsen
eac2597557 refactor(proxy): one capability registry with a reason on every refusal (proxied-parity S2) (#6582)
* refactor(proxy): one capability registry, with a reason on every refusal

Proxied-server policy lived in three path tables (a maintenance refusal
map, a history classification map, a transform row list), each with its
own lookup and its own front-door validator, plus a flag matrix. Nothing
forced a new command to appear in any of them, so an unclassified
command sailed past the gate and died in the store factory with
`proxy server store should be uow provider`. That — not the table count
— was the root problem.

One table now (cmd/bd/capability_registry.go), and a test that fails
when a runnable command is missing from it. Adding a command is no
longer a place where policy can be forgotten: it is a build failure
until someone decides whether the proxied front door lets it through.

Every refusal carries a Reason: `design` where refusing is correct and
expected to stay (shared history, multi-repo routing, destructive admin,
storage-format surgery, strict --readonly), `unimplemented` where it is
a gap with a named owner. The reason renders in the refusal JSON,
additive to the frozen {code, error, mutates} contract, and is omitted
on refusals that report a runtime state rather than a policy so a
consumer keying on its presence is never told "" by mistake.

The registry also inventories the 57 untyped refusals commands raise
from their own RunE. Those rows are not enforced — converting them
changes observable output and belongs to the slice that owns each
family — but a source scan now keeps the inventory honest in both
directions.

The store-factory backstop is typed as `proxy.store.unrouted`, the
unreachable duplicate readonly refusal in main.go is gone (the proxied
branch above it already returns for the only config that reaches it),
and with it `backendSupportsStrictReadonly`, which had no other caller.

No outcome changes. Every code, message and exit status is identical,
which #6576's five-topology matrix proves: 90/90 cells unchanged
(HONORED 47, REFUSED_TYPED 24 = 4 design + 20 unimplemented, ERROR 12,
WRONG_ANSWER 4, DEGRADED 3), all five topologies exercised, no skips.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(proxy): `migrate hooks` is an unimplemented refusal, not a design one

The registry filed `migrate hooks` under "storage-format and workspace
surgery against a store other clients may be holding open". That rationale
does not describe it: migrate_hooks.go plans and applies GIT HOOK FILE
migration through doctor.PlanHookMigration, on the local filesystem, and
opens no store at all. Left as it was, proxied-local — the default topology
since 1.3.0 — loses the command permanently, because `design` tells every
later slice the refusal is semantic and settled.

It is not settled, but it is also not free to lift, and the difference is
structural rather than semantic. `migrate hooks` appears on none of main.go's
store-init skip lists, so permitting it makes the root pre-run open the
proxied provider before RunE runs. Measured with the row flipped to
permitted, not reasoned about: on a managed-local workspace
`bd migrate hooks --dry-run` started the proxy AND its dolt child — both
pidfiles present — to print a hook plan for five missing hooks, and on a
workspace with an unreadable sidecar it exited 1 with "failed to open uow
provider: corrupt proxied-server sidecar ..." where it had cleanly refused
before. Trading a typed refusal for a provider-open error is not a lift.

So: Reason=unimplemented with a Tracking item that names the actual work —
put the command on the store-init skip list first, then permit it — which is
S7's, not this slice's. No outcome changes; the row still refuses with the
same code, message and exit status. The registry header now says that
permitting a path costs a provider open, since that is the fact this row
turns on and the one the completeness test cannot see.

Also leaves S7 an explicit instruction on the rows next door. `migrate
issues`, `migrate-personal` and `admin cleanup`/`admin reset` claim `design`
on a topology-blind rationale — "a store other clients may be holding open",
"destructive against a possibly-shared store" — that describes external and
team-server workspaces and does not describe managed-local, which is 1:1 and
bd-owned. They are not reclassified here: the table cannot yet express
"refused, except on managed-local", and narrowing them is semantic work
nobody has done. The comments now say that is why, so the next reader does
not mistake conservatism for a considered verdict.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 7ccb961f77)
2026-09-28 15:53:31 +00:00
Jim Wordelman
aa3c43b6bd
feat(storage): add events/bd_events_journal/bd_events_seq to cursorRealityFloor sentinel set (#6547)
* test(feat): red — Add sentinelFlooredTables to cursorRealityFloor so events/bd_events_journal/bd_events_seq self-heal (release/1.3.0) (refs be-u14.1)

* feat: green — Add sentinelFlooredTables to cursorRealityFloor so events/bd_events_journal/bd_events_seq self-heal (release/1.3.0) (refs be-u14.1)

* chore: release gate PASS for cursor-reality-floor-sentinel-self-heal (be-g69lt)

* chore: remove leaked internal release-gate doc from PR branch

  release-gates/be-g69lt-gate.md

Tracked our internal gc-management/beads-rig release-gate checklist and
should never have been committed to this upstream branch -- it's process
residue from our deploy tooling, not part of the change itself.

Per maintainer bee-ghosttrack's request during review of PR #6571. The
root cause (our deploy tooling auto-committing this file) is already fixed
as of gm-qatxl1; this branch predates that fix, so this commit is cleanup
only -- no other content on this branch is touched.

Ref: be-lk7o3

* fix(schema): pin the floored-sentinel minimum and generalize creator detection

Maintainer review fixups for PR #6547 (adoption review, iteration 1). No
behavior change beyond the probe error-message text.

- Pin the floored loop's intra-loop minimum. Every existing case removed
  exactly one floored sentinel, so `st.replayFloor < floor` was never
  evaluated against a floor an earlier absent sentinel had already set, and
  inverting it to `>` left the whole package green. Adds an "events and
  bd_events_journal both absent" case asserting floor 18 and widens
  allSentinelTablesExcept to variadic; the inversion now fails (floor = 21,
  want 18). The floors ascend in slice order today (18, 21, 21), so this is
  what keeps a future reordering or lower-floored addition from silently
  regressing to "last absent sentinel wins".

- Distinguish the floored-table probe's error wrap from the floor-0 loop's.
  They were byte-identical, so a store-open failure did not say which
  sentinel class failed, and the consequences differ sharply (floor 0 and a
  full series replay vs. floor 18/21).

- Detect both creator shapes in TestSentinelFlooredTablesAreCreatedByTheSeries
  rather than keying on the literal table name "events". The PREPAREd
  conditional CREATE is required of any creator whose table carries a named,
  database-unique constraint (ignored/0019's own comment), so a future floored
  sentinel in that shape would have fallen through to the __temp__ regex and
  failed with a misleading "never created by the series". Both arms are
  mutation-proved to be load-bearing.

- Record in the sentinelFlooredTables comment that events' dolt_ignore pattern
  is version-gated ({"events", 62}) rather than unconditional, and why the
  clamp is safe anyway: the ignored plane is only reached after the main pass
  succeeds, and a main pass from below 62 applies 0062_events_dolt_ignore,
  whose REPLACE INTO dolt_ignore lands before the ignored plane is touched.

Validation: go test -count=1 ./internal/storage/schema/ (ok, 36.5s), go vet
and gofmt clean, git diff --check clean.

---------

Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
2026-09-26 14:27:45 -07:00
Julian Knutsen
bb03a310a9
fix(schema,uow): cover the proxied data-behind path and make its consent step runnable (post-merge #6659) (#6695)
* fix(schema,uow): cover the proxied data-behind path and make its consent step runnable (post-merge #6659)

Post-merge review of the landed range d0063ac..e1e1158 (PR #6659, the
release/1.3.0 backport of #6658) raised two majors. Neither is a regression
from that PR; both are gaps its surface left open.

F-A — the uow/proxied path never reached the #6575 stop, and its blunt body
prescribed the wedge. `doltSQLProvider.initSchema` passed a nil adopter to
`CheckSharedStoreMigrateGate`, so `localDataBehind` short-circuited and routing
could never emit `smartDataBehind`. A proxied store that was level on schema
and behind in data reported `shared-store` instead, whose body is the
designated-migrator recipe — `bd migrate --force` then `bd dolt push` — which
in that state is exactly the #6368 wedge the stop exists to prevent. The
refusal was always safe (the shared arm suppresses the auto-migrate either
way); the guidance was not.

Only `AheadBehind` is wired. It is the complete data-behind predicate, while
leaving `IsStrictAncestor`/`WorkingSetClean` nil keeps `routeAdoptFastForward`
false, so the remote-AHEAD arm on this path keeps the plain adopt directive it
has today. `FastForward` stays nil: it is a write that would promote the schema
for every co-resident client.

The remedy also had to be topology-correct before it could be printed.
`bd dolt pull` is refused at the proxied front door
(`proxy.dolt_pull.unsupported`), as are `bd dolt push`, `bd migrate` and
`bd conflicts` — so the body, agent directive and `options` now name the
machine the pull runs on, and the option id becomes
`pull-first-on-server-host`. The don't-force warning gains
`BD_ALLOW_REMOTE_MIGRATE=1`, the one consent surface the proxy does not refuse.
Read-only proxied opens print the pull-first block instead of the shared
consent template.

The proxied fact is the caller's, not the provider's: `newSQLServerUOWProvider`
is also `bd serve`'s provider for SERVER-mode workspaces, where that pull
works. A new `uow.WithProxiedServerMode()` is set only by
`openProxiedServerUOWProvider`.

F-B — the shared data-behind consent step named a verb that cannot unlock a
remote-backed shared store. `sharedMigrateConsent` has one reader,
`sharedNoRemoteGate`, reachable only on the `!hasRemote` branch; a data-behind
stop has a remote by construction. The four surfaces now name
`SharedConsentCommandForced` (`bd migrate schema --force`) with its `--global`
twin, and the human/JSON `--global` retargets follow. Widening the verb consent
to the remote-backed arm was rejected: it would drop the designated-migrator
confirmation #4259 deliberately requires whenever a remote exists. This mirrors
PR #6692, the main-line remediation for the same defect on #6658, so the two
lines converge rather than diverge.

Tests: the consent step is proven by EXECUTING its path (a text assertion on
`Options()` is how the dead command shipped), with the bare verb as the
counterfactual; the proxied route is driven through `initSchema` against a
mocked behind-clone and asserts the body does not prescribe
`bd migrate --force`; a server-mode open pins that it keeps the runnable-here
remedy; a level clone pins that reading ancestry does not turn a genuine
first-mover into a stop.

Scope: the scorecard's two Required Changes only. Its non-gating items — F-C
(`noticeSharedMigrateRefusal` lacks an `IsDataBehind()` branch), F-D
(`warnRemoteSyncOpenRefusal` verbosity), F-E (`docs` not retargeted), F-F/F-G
(stale comments) — are left for separate follow-ups.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(schema,cli): the proxied consent step is not refused — say so (post-merge #6659 iter 2)

Post-merge review iteration 2 of PR #6695 found one major: the proxied
data-behind guidance this PR added asserts that its own prescribed consent
step, `bd migrate schema --force`, is refused at the proxied front door. It
is not.

The refusal table keys on the full command path. `proxyMaintenanceRefusals`
registers the bare `migrate` verb and its hooks/issues/sync children, but has
no `migrate schema` row, so the two-word path misses the lookup and
`validateProxyMaintenanceBeforeProvider` falls through to nil. `bd migrate
schema` then runs its proxied arm, which reports the migration the provider
open already applied under that verb's consent.

That makes the claim wrong in the unsafe direction: `forceOrEnvConsent` is
read BEFORE the data-behind stop is routed, so an operator told "it is refused
here anyway" who types it to confirm applies the migration to a data-behind
shared store — the #6368 wedge, reachable from the exact topology this
remediation was written for. The don't-force warning made it worse by
presenting BD_ALLOW_REMOTE_MIGRATE=1 as the only consent surface this
workspace can reach.

Reworded to the truth on all five surfaces, and pinned so it cannot drift
again:

- dataBehindBody's proxied consent clause now says the step CAN be run here
  and that the precondition is temporal, not locational: run it only after
  the pull lands on the server host.
- the proxied don't-force warning names `bd migrate schema --force` alongside
  BD_ALLOW_REMOTE_MIGRATE=1 as the two reachable consent surfaces, both
  honored before this stop is reached.
- the consent option's When/Risk drop "bd migrate is refused in
  proxied-server mode" and say the pull-first half is load-bearing here
  because this one does NOT fail closed the way the pull does.
- CHANGELOG drops "the one consent surface the proxy does not refuse".
- the same false premise is corrected in the uow test comment.
- TestProxyMaintenanceAllowsTheSharedConsentVerb resolves the command from
  SharedConsentCommandForced through the same cobra lookup the root pre-run
  uses, asserts validateProxyMaintenanceBeforeProvider returns nil for it,
  and keeps the bare `bd migrate` refusal (proxy.migrate.unsupported) as the
  counterfactual. No test called that function with this command before,
  which is why the false wording shipped green.

Also the two non-gating consistency findings from the same iteration:

- `--json` gate["expected"] carries the location qualifier when Proxied, so
  an expected-only reader is not handed a locally-refused command while
  options/hint carry it. Extracted to dataBehindExpectedField so the
  qualifier does not add a branch to handleRemoteMigrateGateJSON (cognitive
  stays 33, cyclomatic 18).
- fallbackReasonNote's data-behind arm gates its remedy on Proxied; the note
  prints after the body, so unqualified it made the last paragraph prescribe
  what the paragraph above called refused.
- smart_remote_migrate_gate.go's injection-site comment no longer says the
  shared UOW provider wires neither callback; it wires AheadBehind only.

Tests: ./internal/storage/schema (full, ok), ./cmd/bd -run
'Migrate|Consent|Proxy|RemoteGate|DataBehind|SharedStore|RemoteSyncOpen'
(ok), ./internal/storage/uow -run 'DataBehind|Proxied|MigrateGate' (ok).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-24 03:46:42 -07:00
Julian Knutsen
1e754a0156
docs(engdocs): proxied-server surfaces an embedder reads, as observed at 1.3.1 (#6652)
* docs(engdocs): write down the proxied-server surfaces an embedder reads, as observed at 1.3.1

An embedder — an external tool linking bd's Go packages, or one running beside
bd against the same workspace — ends up depending on surfaces bd never
published: proxy.pid's field names, the db-proxy-child argv, the shape of
`bd dolt status --json`, whether a Go symbol is exported or reachable only by
type assertion. Eleven of those were asked about; none of them is a contract,
and the answer to "will these hold" is no promise. This writes them down
anyway, as observed behaviour with the commit they were read at, so that an
embedder can build against what the code does instead of guessing.

Framing is deliberate and the document says so twice: descriptive, not a
compatibility contract; every surface may change in any release, including a
patch release. Four are moving in 1.3.1 itself and are given as before/after —
`bd dolt status --json`'s reshape (#6580) has landed and is described in its new
shape; the `bd migrate schema` refusal, the explicit sidecar `idle_timeout`, and
clean-backend-exit handling plus backend-probing adoption (#6651) are decided
but had not landed at d487b9796, so each states current behaviour as current. A
closing section ranks which surfaces are likelier to move, and a final one lists
the claims that would need a running proxy to confirm and were inferred from
source instead.

Four of the eleven pointers the request carried were off, and are corrected
here rather than copied:

- The loopback root/no-password fact is not in the proxy's connection handler
  at all. Only the byte-pump half lives there; the credentials come from
  newManagedProxiedServerUOWProvider passing "root"/"" in cmd/bd/uow_factory.go,
  over a generated sql-server config that binds 127.0.0.1 and declares no users.
- SetEventsJournalEnabled is not on the Storage interface and is not named in
  beads_cgo.go. It is storage.EventsJournalConfigurer, an optional interface in
  internal/storage/storage.go, which is not re-exported publicly — so the
  assertion has to be written against a locally declared method set.
- The shared-store gate's 30s default constant lives in
  internal/storage/uow/dolt_sql_provider.go, not in the provider that applies it.
- The argv pointer stopped at --config and missed --dolt-bin, --database and the
  four --external-* flags.

While verifying #8 a routing fact turned up that an embedder needs more than the
interface question: neither copy of OpenBestAvailable has a proxied arm, and
IsDoltServerMode and IsDoltProxiedServerMode are mutually exclusive, so on a
proxied workspace it falls through to an embedded open over .beads/dolt — the
same directory the proxy's sql-server is serving. Documented, with the
consequence of that open marked as untested here.

Filed under engdocs/ beside EXTENDING.md, which is already the entry point for
"not user-facing; for code that embeds bd", linked from it, and registered in
DOC_INVENTORY.md's Active Docs and Reference Freshness tables. The Last
reviewed / Freshness source markers match check-doc-freshness.sh's format but
the doc is deliberately NOT added to that script's enforced list: putting a
90-day tripwire on a release branch is a maintainer's call.

scripts/check-doc-flags.sh and scripts/check-doc-freshness.sh both pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(engdocs): describe the data-port capability generically

The prior wording named an integration shape rather than the capability. State
what the byte pump plus the generated config actually let an embedder do.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(engdocs): correct five factual claims and drop four promise leaks

Two adversarial reviews returned FIX_FIRST on the observed-surfaces doc.
Corrections, each re-verified against source:

- §8: the embedded fall-through does not open the directory the proxy is
  serving. embeddeddolt hardcodes <beadsDir>/embeddeddolt (newStore,
  cacheKey, HasRepository); the proxy serves the proxied root, default
  <beadsDir>/dolt. The hazard is a silently separate database — empty on a
  workspace born proxied, stale on one that was ever embedded, since no
  mode-migration verb removes that directory — not contention.
- §10: backend_running carries no omitempty, so five keys are always
  present, not four. The doc's own external example contradicted its rule.
- §3: neither readiness probe uses credentials. Both poll
  DatabaseServer.Dial, a bare TCP connect. root/"" belongs to bd's SQL open
  and to DoltServer's shutdown GC.
- §2: the --external-* flags need both conditions — external backend AND a
  set value — and ExternalDoltConfig.Validate makes host/port and socket
  mutually exclusive, so all four never appear together.
- §6: the proxied migrate payload is NOT the direct path's shape. Direct
  emits {status, applied, latest_version}; proxied drops applied and adds
  mode and note.
- §4: Handle.Kill is SIGKILL on macOS too, and the stop epoch advances once
  per call rather than per record.

Promise leaks removed: the invented "would break the same consumers twice"
maintainer policy, flat future tense on an unlanded warning, "safe for an
embedder to poll", and "least likely to move" as a stability signal.

check-doc-flags.sh and check-doc-freshness.sh both pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(engdocs): drop a Markdown-unsafe escaped quote from the §8 rewrite

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(engdocs): re-anchor to the rebase base and record the #6575 data-behind stop

Maintainer review fixup for #6652.

The doc landed marked `Read at: d487b9796`, but the branch merges into
`e1e1158dd`, and five of the sources it names as its freshness basis drifted
in between — including §7's sole source. By the doc's own rule that makes the
marker wrong, not merely old.

- Re-anchor `Read at:`/`Last reviewed:` and the four in-body read-commit
  references to `e1e1158dd`, and add the sources the re-read reached:
  `smart_remote_migrate_gate.go`, `internal/storage/embeddeddolt/`,
  `cmd/bd/remote_migrate_gate.go`, `cmd/bd/store_factory.go`,
  `internal/storage/dolt/store.go`.
- §7: record #6575's data-behind stop — trigger, its reporting ahead of
  `shared-store`, the collapse to a single `pull-first` option, the exported
  `IsDataBehind()`/`DataBehindRemedyCommand` an embedder classifies on, and
  the lenient `OpenForRemoteSync` carve-out for the remedy.
- §7: scope the `OpenForRemoteSync` carve-out to the CLI. Both that function
  and the `dolt.Config.RemoteSyncOpen` field live under `internal/`, and none
  of the public open paths takes an option that could request the lenient open,
  so an embedder cannot replicate the remedy in-process: it runs `bd dolt pull`
  out of process, outside proxied mode, and re-opens.
- §7: scope that stop's reachability to the call sites that wire the ancestry
  adopter, rather than asserting a proxied workspace meets it.
  `localDataBehind` reads `FastForwardAdopter.AheadBehind` and reports "not
  behind" when the adopter is nil; of the two production callers of
  `CheckSharedStoreMigrateGate`, only `internal/storage/dolt`'s server-mode
  open wires it. `internal/storage/uow/dolt_sql_provider.go` — the proxied CLI
  path and `bd serve`'s own provider, per `cmd/bd/uow_factory.go` — passes
  nil, so a proxied, remote-backed clone that is data-behind at schema parity
  routes to `smartAutoMigrate` and gets the shared-store refusal, never the
  pull-first one. Embedded mode reaches the stop by the other route,
  `CheckRemoteMigrateGateWithAdopt` with a fully-wired adopter. The proxied
  `dolt pull` observation is re-framed to match: the pull is still the
  precondition and proxied mode still refuses the verb, but the gate never
  names it there. The underlying gap is base behaviour at this commit.
- §7: the trigger is `behind >= 1` whatever `ahead` is, not the narrower
  strict-ancestor relation — `localDataBehind` states that restricting the
  stop to `ahead == 0` "would leave the larger half of the affected cohort
  unprotected". The `DataDiverged` bullet now names `ahead >= 1` as the shape,
  which is why that pull merges rather than fast-forwards.
- §7's "adds two refusals" is deliberately kept. That count is the shared
  form's delta over the remote-backed flow and mirrors the source comment on
  `CheckSharedStoreMigrateGate`; the data-behind stop lives in
  `checkRemoteMigrateGate` underneath, so raising it to three would introduce
  a new error. The section now says so in place.
- §8: four join sites, not three — name `openReadOnly` and scope the
  create-rather-than-fail claim to the read-write path.
- §3: carry the "not verified by running" marker inline beside the MySQL
  client claim, as §11 already does.
- §6: scope the migrate-verb consent to the arm that reads it. The headline
  and the consent bullet said the verb migrates on a proxied workspace
  unconditionally, contradicting §7's own already-correct wording.
  `sharedMigrateConsent` has exactly one non-test read site,
  `sharedNoRemoteGate`, reached only from `checkRemoteMigrateGate`'s
  `if !hasRemote` branch; the comment there scopes it deliberately, because
  with a remote configured #4259's cross-clone fork risk still demands the
  stronger designated-migrator confirmation. A remote-backed shared or proxied
  database consults only `--force` / `BD_ALLOW_REMOTE_MIGRATE` and otherwise
  refuses the pending main-lane migration at the store open. §7's
  `SharedConsentCommand` hedge is deliberately unchanged.
- §6: qualify the `--force` parenthetical in that same consent bullet.
  `bd migrate schema --force` trips `isForcedMigrate`, but the bare
  `bd migrate --force` never gets that far on a proxied workspace:
  `validateProxyMaintenanceBeforeProvider` runs inside the proxied-mode block
  of the root `PersistentPreRunE`, ahead of
  `schema.SetForceAllowRemoteMigrate`, and its full-path lookup matches
  `migrate` and exits with `proxy.migrate.unsupported` before any store opens
  — the refusal §6's own second paragraph already states. `bd migrate schema`
  escapes only because its command path contains a space and returns nil
  first. The clause now scopes the bare verb instead of offering it as an
  unlock on the one workspace that refuses it.
- §6: name the `migrate sync`/`migrate-personal`/`migrate-issues` rows and
  the history-capability gate that runs before the multi-word fall-through.
- Update the "Four of the eleven" count and the `DOC_INVENTORY` freshness row
  to match.

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-23 21:59:27 -07:00
Julian Knutsen
e1e1158dd9
release/1.3.0: stop the smart gate auto-migrating a data-behind clone (#6575) (#6659)
* fix(schema): stop the smart gate auto-migrating a data-behind clone (#6575)

Release-branch counterpart of the main-line fix. The four source files are
byte-identical to the main commit; only the CHANGELOG placement differs (a
1.3.1 "Fixed" bullet instead of Unreleased).

The smart migrate gate's first-mover verdict was computed from schema facts
alone: equal content hashes against the cached remote ref, equal max version,
and at-or-above the convergence floor. None of those say anything about where
the clone's branch sits relative to the ref the hashes came from, so a clone
that was level with the remote on SCHEMA but behind it in unpulled DATA commits
satisfied every precondition and was classified a safe first-mover.

It then migrated in place, minting local-only schema commits on a HEAD missing
the remote's data commits. When the pending batch moves a tracked table onto
the dolt_ignore plane (0062's events), every subsequent `bd dolt pull` refuses
to merge (#6368) and the clone can no longer fetch the very commits it was
already behind on. v1.3.0's upgrade audience is largely 1.1-era databases, which
is exactly the cohort reaching this state — this is being field-hit now, which
is why rc.2 is held for it.

The decisive fact was already wired: routeSmartGate's remote-ahead branch
consults adopt.IsStrictAncestor (ahead == 0 && behind >= 1) via
routeAdoptFastForward, and both production call sites supply it. The
equal-version path simply never read it. Read it there too, before granting the
automatic migrate, and stop with a new data-behind fallback reason naming the
one-command remedy.

The predicate does the narrowing for free: a level clone (ahead 0, behind 0) and
a clone with unpushed local commits (ahead > 0) both read false and still
auto-migrate, so only a strictly-behind clone is refused. An inconclusive
ancestry read degrades to the blunt #4515 block rather than assuming level,
matching the file's contract that no fallback is less safe than the blunt gate.
Below-floor outcomes are untouched — the check sits inside the floor arm.

Patch-line discipline: no new schema migration, no new feature surface. The stop
reuses the existing blunt RemoteMigrateGateError with an empty Decision, so
there is no change to the JSON or agent contract — no new Error()/userBody()/
AgentDirective/Options arms. Both shipped escape hatches still work unchanged:
--force/BD_ALLOW_REMOTE_MIGRATE=1 are consulted before the smart gate, and
BD_SMART_GATE=0 still yields the blunt block. Both stay in the release notes.

S0 capability matrix: no cell flips, so no same-commit matrix change is needed.
Verified two independent ways. No matrix fixture configures a Dolt remote — the
direct `dolt push` cell asserts "No remote is configured" and `dolt remote list`
asserts an empty listing — so checkRemoteMigrateGate returns at the hasRemote
check before the smart gate, making routeSmartGate (the only function whose
outcome changes) unreachable in every cell. Independently, matrix fixtures are
created by the binary under test, so schema is at latest and the gate exits
earlier still at len(pending) == 0. The one migrate probe, the `migrate schema`
row, therefore never reaches the changed code.

Regression test builds a genuinely data-behind clone against a real Dolt
server rather than stubbing the fact the bug is about, and adapts to this
branch's own LatestVersion (which lacks 0067). Verified failing at d487b9796
and passing here.

Fixes #6575

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(schema): give the data-behind stop a working remedy, and widen it

Review follow-up on the #6575 fix. The stop was right; what it told the
operator to do was not reachable, and it protected the rarer half of the
cohort.

F1 (blocker): the refusal prescribed `bd dolt pull`, and `bd dolt pull` was
refused by it. Measured on a real data-behind embedded clone (ahead=0,
behind=1, clean working set) at the previous head: the pull exited 1 printing
"Run `bd dolt pull` first, then retry"; `bd sync` and `bd init --reinit-local`
exited 1 the same way; `bd bootstrap` reported "Database already exists …
Nothing to do." and exited 0; `bd migrate schema --force` then `bd dolt push`
left ahead=1 behind=1 with the push rejected non-fast-forward. The only thing
that moved the clone was BD_ALLOW_REMOTE_MIGRATE=1 — performing the migration
the stop exists to prevent. An embedded workspace has no external `dolt` binary
either, so that was a fence with no gate.

It is the #4566 deadlock one refusal over, so it takes #4566's shape of fix:
a lenient open for the command whose whole purpose is to clear the refused
precondition. Narrower than #4566's, though — the remote-sync open tolerates
ONE gate reason (RemoteMigrateGateError.IsDataBehind) and nothing else. A pull
cannot resolve a fork skew, a below-floor database, a shared-store consent
decision or an opted-out blunt block, so waving it through those would buy
nothing and hide them; the dirty-table and dependency-re-key refusals stay
fatal on this open too. Broadening the existing LenientOpen classification
instead would have granted all of that in one line.

Verified end to end on both shapes, exit codes real: `bd dolt pull` 0
(0,1 -> 0,0), retrying the refused write auto-migrates as a true first-mover,
`bd dolt push` 0. On a diverged clone the pull merges: 0 when it can, 1 with
"merge conflicts in config require operator resolution; merge aborted and
working set restored" when it cannot, and `bd dolt pull --strategy theirs`
then 0 — which is why the diverged guidance names it.

F2 (high): LocalIsStrictAncestorOf is ahead == 0 && behind >= 1, so a clone
with any local commit of its own read "not behind" and still auto-migrated.
Measured at the previous head with ahead=1, behind=1: "safe first-mover", and
the migration ran. bd auto-commits every write, so behind-AND-ahead is the
ORDINARY multi-machine state and the shape the fix protected was the narrower
one. It reaches the identical wedge — the migration lands on a history missing
the remote's commits either way — so the predicate is now behind >= 1 whatever
ahead is, read from LocalAheadBehind (the counts LocalIsStrictAncestorOf was
already computing and discarding). A level clone and a purely-ahead clone have
nothing to pull and still auto-migrate, verified through the CLI.

The remedy differs by shape even though the command does not, so the two stay
separate verdicts all the way out to the message, the agent directive and the
JSON: one is told its pull fast-forwards, the other that it merges and how to
resolve conflicts. An adopter that wires only the older callback keeps the
narrower (pre-widening) reading rather than losing the stop.

F3 (medium): with data-behind outranking fallbackReasonSharedStore, a shared
store's refusal rendered with neither "co-resident" nor "#5920" anywhere —
Options()' sharedRisk only ever decorated the adopt option. The #5920
consequence and the `bd migrate schema` consent step the retry needs there now
travel with this reason, on every surface.

F4 (medium): --json emitted only fallback_reason: "data-behind" while
observed/expected/options stayed the blunt default, whose option 1 is
["bd migrate --force", "bd dolt push"] — the bug followed by a push that is
guaranteed rejected while the clone is still behind — and whose option 2
no-ops. The pull-first remedy lived only in prose --json never emitted.
observed/expected now describe this stop, options is the single pull-first
option, and data_behind_shape says which pull to expect. decision stays absent
and fallback_reason unchanged, so the key agents match on does not move.

The blunt body is REPLACED for this reason rather than decorated: both of its
options were measured wrong here, and leaving them under a note saying "pull
first" is what sent the last round back into the wedge. Error() is deliberately
untouched — the headline stays the blunt #4259 line, and the body's first
sentence accounts for it.

Both escape hatches are unchanged and re-measured: `bd migrate --force` and
BD_ALLOW_REMOTE_MIGRATE=1 are still consulted before the smart gate (exit 0),
and BD_SMART_GATE=0 still yields the blunt gate unconditionally — including
for `bd dolt pull`, which is what opting out means. The two corrections from
the first round are preserved: the "proceeds on its own" promise is still
gated on !e.Shared, and the unparseable-BD_SMART_GATE carve-out still lets
data-behind outrank an env complaint (BD_SMART_GATE=maybe re-measured).

Tests cover both shapes at three levels. The schema routing table pins the
widened predicate, the shape split, the error degradation, the
IsStrictAncestor fallback, and every remedy surface including IsDataBehind's
narrowness; neutralizing the widening fails three of its subtests. The
real-Dolt regression test now runs both shapes over the same two-clone
file:// fixture, measuring ahead/behind rather than stubbing it and asserting
that the strict-ancestor relation is false exactly where the diverged shape
needs the widening. A new embedded test builds a genuinely data-behind
embedded store, proves OpenForRemoteSync gets through the refusal without
migrating, and proves BD_SMART_GATE=0 on the same fixture does NOT.

No S0 matrix cells flip. No matrix fixture configures a Dolt remote, so
routeSmartGate stays unreachable; the only `dolt pull` probes are the
proxied-mode typed refusals, which are classified in historyCapabilityMatrix
before any store opens and are untouched.

This is the release/1.3.0 counterpart of the main-line change, code-identical
to it. Two differences, both from the base: the CHANGELOG entry is the expanded
form of the existing #6575 bullet inside `## [1.3.1] - 2026-09-16`'s `### Fixed`
(same position the bullet already held, so the #6653 CHANGELOG non-conflict is
preserved), and the dolt.Config literal in cmd/bd/main.go has no
PoolReadTimeoutFallback field on this base. The shipped `## [1.3.0]` section is
byte-identical: sha256 798a2ee0b0f0b7a3f0fc017ae01c919807740348a34f5ea8719b82a008533d00,
9169 lines, and the only CHANGELOG hunk is above its header.

This branch's own matrix (cmd/bd/topology_capability_matrix_test.go, absent on
main) was re-checked after the widening: no cell flips. No fixture configures a
Dolt remote (the direct `dolt push` cell asserts "No remote is configured" and
the direct `sync` cell asserts "status": "no-remote"), so routeSmartGate stays
unreachable, and there is no `dolt pull` probe row at all.

Refs #6575
Refs #6368
Refs #4566

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(schema): retarget the shared data-behind consent verb under --global

Self-review catch on the previous commit's own new text. The #5920 consent verb
the shared data-behind guidance names is TARGET-SCOPED: under --global the
refused open aimed at beads_global, so the project-scoped `bd migrate schema`
would consent the wrong database and leave the refusal in place. The existing
shared-no-remote arm already handles this (printGlobalDatabaseConsentHint and
the JSON retarget), and the new arm had to as well.

The JSON retarget could not simply reuse the Decision test: this stop reaches
the renderer through the default empty-Decision arm, keyed on the fallback
reason, so `e.Decision == "shared-no-remote"` misses it. The human body now
names the --global variant beside the project-scoped one, exactly as the
shared-no-remote body does. The pull itself is target-agnostic and is
deliberately NOT rewritten.

Refs #6575

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(schema): give the data-behind read path the pull remedy too

Round 2 fixed the write path and the agent payload, but left the two
lenient embedded opens rendering the blunt #4259 coordination block. Those
opens do not fail on this refusal - they warn and carry on - so the warning
IS the whole contract for `bd list`, `bd ready`, `bd show`
(openReadOnlyCommand) and `bd dolt commit` (openWorkingSetReconcile). Both
printed `gateErr` (Error(), the one-line summary) followed by the unchanged
sharedGuidance bullets, so on a data-behind clone the first thing bd said
was:

    • designated migrator (only ONE machine): bd migrate --force && bd dolt push
    • every other clone (another already migrated): bd bootstrap

Measured on a fast-forward clone at the previous head: that migrate lands
v67 on a history the clone is still behind on, and the `bd dolt push` after
it exits 1, rejected non-fast-forward - the #6575 state, reached by
following bd's own instruction, from the same clone whose write path says
in capitals not to run it. `bd bootstrap` no-ops against an existing
workspace. `bd list` is the first thing a 1.1-era upgrader runs and what
agents run constantly, so this was the most-read surface of the whole stop.

Both arms now branch on gateErr.IsDataBehind() and print
gateErr.UserMessage(), which is where the shape-branched pull-first body
already lives - the same thing server mode's warnLenientOpenRefusal has
printed all along. The intent framing is kept rather than replaced: the
command in hand is still succeeding against the old schema, which the
body (written for the fatal refusal) does not say. Refusals that are not
the data-behind stop keep the coordination bullets, which are right for
them; a second test pins that so the new body cannot swallow them.

Verified by running, not asserting - `bd list` and `bd dolt commit` on real
data-behind clones of both shapes, then `bd dolt pull` and a re-run, which
migrates.

Also fixes the agent payload contradicting itself. For data-behind,
AgentDirective calls `bd dolt pull` the single option, Options annotates it
`when: always, for this stop` and `risk: none - a pure fast-forward`, yet
human_decision_required stayed hard-coded true, so an agent keying on that
field stalled for approval of a step the same payload calls unconditional
and riskless - and the cost of that stall is reaching for
`bd migrate --force`. It is now false for exactly that arm. It stays true
when DataDiverged (the pull merges and can need conflict resolution and a
--strategy choice) and when Shared (the payload's second option needs an
operator who can confirm every co-resident client is upgraded, #5920);
getting either backwards would be worse than the contradiction. The `when`
string is deliberately unchanged for both shapes - the pull is the only way
forward either way; it is the risk, not the applicability, that diverging
changes.

Refs #6575

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 02:49:16 -07:00
Julian Knutsen
d0063ac894
release/1.3.0: eleven cherry-picks for 1.3.1-rc.2 (#6653)
* fix(storage): include custom active-category statuses in bd ready (#5831) (#5918)

bd ready pins WorkFilter.Status to StatusOpen. BuildReadyWorkWhere treated
that pin as an exact match, so issues in a custom status with category
active never appeared — even though bd statuses --help, the ready_issues
view (migration 0025), and ClaimableSourceStatusesInTx all treat that
category as ready-eligible.

Widen the singular StatusOpen clause to the same predicate the view uses:

  status = ? OR status IN (SELECT name FROM custom_statuses WHERE category = 'active')

Non-open singular statuses stay exact. Built-in open still matches. Custom
wip/done/frozen/unspecified statuses stay out, matching claim's GH-3570
anti-steal set.

Reported by Justin Clemens (@justin-candor).

Addresses #5831

(cherry picked from commit 66aa73bb99)

* fix(cli): `bd list --wisp-type` cannot match a row — register the plane knob it needs (#6098)

`bd list --wisp-type heartbeat` returns an empty listing for EVERY input, and
`bd list` exposes no flag that changes that.

ListRequest.WispType is a predicate, not a plane selector — its own doc says
so, and RunReaderListWispTypeNarrowsTheAdmittedPlaneRatherThanAdmittingIt pins
it. That contract is right and this does not touch it. The doc also names the
way out:

    The combination that answers with rows is IncludeEphemeral (or
    IncludeInfra) plus this, and it is lawful rather than refused.

`bd list` registers neither `--include-ephemeral` nor `--all-types`. So of the
two combinations the doc names, the CLI can express only IncludeInfra — which
admits the plane AND lifts the infra-type exclusions AND changes the template
treatment, three decisions a caller who wanted one classification did not ask
for. The narrow knob the doc names FIRST has no flag at all.

That is the whole defect: the API composes correctly, and the CLI is missing
the other half of the pair.

## What this does

1. Registers `--include-ephemeral` on `bd list`, wired to
   `ListRequest.IncludeEphemeral` — the plane knob alone, off by default, so
   the default listing is byte-identical.

2. Refuses `--wisp-type` when no plane is admitted, with the fix in the hint,
   instead of printing an empty listing.

The refusal is at the CLI layer ONLY. At the API layer the combination stays
lawful and still composes to an empty page: that is the pinned contract, and a
programmatic caller composing filters may legitimately land on it. A human
typing `--wisp-type heartbeat` cannot have meant "prove to me that durable rows
carry no classification", so the CLI is where the guess is safe to make.

An explicit `--type` is deliberately left alone: an infra type routes to the
plane by itself, so the request may well be satisfiable, and this layer cannot
tell which types those are without loading the workspace's infra vocabulary.
Refusing there would reject lawful, answerable requests.

## Verification

    --- PASS: TestListRegistersIncludeEphemeral
    --- PASS: TestGatherListInput_WispTypeWithoutAPlaneIsRefused
    --- PASS: TestGatherListInput_WispTypeWithAPlaneIsAccepted (3 subtests)
    --- PASS: TestGatherListInput_IncludeEphemeralReachesTheRequest

The pair discriminates rather than being trivially green: a guard that refused
every `--wisp-type` would pass the refusal test and fail all three acceptance
subtests, one per route that admits the plane.

`ok github.com/steveyegge/beads/cmd/bd`, `ok
github.com/steveyegge/beads/internal/workapi`, `go build ./...` and `go vet`
clean. `internal/workapi/list.go` and the golden corpus are untouched.

docs/CLI_REFERENCE.md is not regenerated here: the docs pipeline builds from
the release tag in docs/cli-docs.pin (v1.2.2), not from this checkout, so the
new flag appears at the next release bump.

Claude-Session: https://claude.ai/code/session_01X1jMLQTSrCwtzFRS1xeUC6
(cherry picked from commit cbf84cb1c0)

* fix(list): honor --status when combined with --ready (#5924)

* fix(list): honor --status when combined with --ready (#5832)

`bd list --status X --ready` silently dropped --status and returned the
unfiltered ready set (typically open issues). BuildListFilter pinned
StatusOpen whenever ReadyFlag was set, and ReadyFilterFromIssueFilter
hard-coded the same pin, so a custom status or in_progress selector
never reached GetReadyWork.

--ready without --status still defaults to open. An explicit --status
is now the ready-work status selector, matching how other list filters
already compose with --ready. `--status all` remains the no-filter
spelling and keeps the open default.

* fix(list): status-aware --ready footer and honor-path contract docs (#5832)

The query intersection from the prior commit is unchanged. Round-1
review asked the ReadyFlag/Statuses contract comments and the text
footer to describe the honor path: default --ready is still open,
an explicit --status is named instead of "excludes in_progress".

(cherry picked from commit f5a20fb66b)

* fix(doctor): ignore the generated dolt-server-config.yaml (#5978)

doltserver.Start() writes .beads/dolt-server-config.yaml when the resolved
dolt binary supports auto_gc_behavior.archive_level. Its own doc comment
says the file "lives alongside the other gitignored server state files in
beadsDir", but the hyphenated name falls outside the "dolt-server." prefix
shared by the other five entries, so both GitignoreTemplate and
requiredPatterns missed it.

The file holds an absolute cfg_dir and a per-machine port, so committing it
breaks every other clone -- the same reason the template already gives for
'redirect'. It shows up as untracked in every consumer repo whose dolt
supports archive_level. This repo does not see it because its own root
.gitignore has a blanket .beads/* rule.

Add the pattern to requiredPatterns as well as the template: the template
only helps repos initialised after this change, while requiredPatterns is
what missingGitignorePatterns() iterates, so it is what lets bd doctor --fix
append the rule to an existing .beads/.gitignore.

Co-authored-by: Adam Spiers <ai@adamspiers.org>
(cherry picked from commit 671db6560d)

* fix(storage): stop recommending an inert config.yaml key for a missing prefix (#5936)

ReadConfigPrefix gates on the database's config table row `issue_prefix`.
When that row is absent its error told the operator that, "if using
config.yaml, use key 'issue-prefix', not 'issue_prefix'" — but this gate
never consults config.yaml. The YAML value is read one line above the
error solely to populate a debug.Logf diagnostic; it is discarded, so
setting `issue-prefix` in config.yaml leaves the gate failing exactly as
before. Following the advice produces a tracked config field that changes
nothing and misleads the next reader.

Point the message at what actually writes the row — `bd init --prefix` or
`bd bootstrap`, both of which it already named — and say plainly that the
check reads the database's config table so the config.yaml key does not
satisfy it. No resolution behavior changes; this is the error text only.

Reported-by: @ncljesus
Closes #5916

(cherry picked from commit 61ec85181f)

* fix(create): say --file is one issue per ## heading (#5921)

bd create --file/-f is a batch-import route: it creates one issue per
H2 ("##") heading, and ### subsections attach fields to that issue.
The old Usage was "Create multiple issues from markdown file", which
never named those semantics or --body-file. Callers who wanted "one
issue, description loaded from a file" reached for the shortest flag
and got a silent bulk import instead -- reported by @seanmartinsmith
with a 3-section briefing file (## Problem / ## Context / ##
Acceptance Criteria) that became 3 issues instead of one.

gatherCreateInput already rejects a positional title combined with
--file. That is the reporter's literal repro, so this keeps the
rejection and adds a --body-file hint on the error they actually
see. The remaining trap -- --file used alone on a section-headed
file -- is unchanged, because bd cannot tell that apart from a
genuine batch file by content.

Tests: parseMarkdownFile reproduces the trap file; gatherCreateInput
locks in the title+--file rejection and --body-file hint; flag Usage
names the per-heading behavior. The existing TestCreateFromMarkdownFile
binary path already covers well-formed --file creates.

(cherry picked from commit 67b066b58e)

* fix(list): stop truncation hint padding a blank TTY line (#5927)

printTruncationHint fed surrounding newlines through ui.RenderWarn.
lipgloss treats that as a block, pads the blank lines to the widest-line
width (alignTextHorizontal shortAmount = widestLine - lineWidth), and
drops the trailing newline (GH#5685). The next shell prompt then prints
on the same line as a run of spaces.

Keep the newlines outside RenderWarn so the hint is one colored line
with a real trailing newline. Tests construct an explicitly styled
lipgloss Style so the padded blank-line shape fails if the helper is
reverted.

Fixes #5685.

(cherry picked from commit 766c0bd15a)

* fix(setup/claude): keep settings.json's trailing newline and skip no-op rewrites (#5944)

* fix(setup/claude): keep settings.json's trailing newline and skip no-op rewrites (#5693)

bd setup claude (and bd init, which calls it) marshalled the Claude settings
map with json.MarshalIndent and wrote it unconditionally. MarshalIndent emits
no trailing newline, so every run stripped the one Claude Code's own writes
leave behind, and re-wrote the file even when no hook changed. Because bd init
git-adds .claude/settings.json, that surfaced as a staged diff with no
semantic content.

The same marshal-then-write pattern appears at four call sites in claude.go:
installClaude's settings write and its settings.local.json migration, and
removeClaude's settings write and its settings.local.json cleanup. Fixing one
would have left the bug live in the other three, so both halves are now shared
helpers -- marshalSettings appends the newline, writeSettingsIfChanged compares
against the bytes already on disk and returns early when they match -- and all
four sites go through them.

Reported by @maphew.

* chore(setup/claude): use the repo spelling "marshaled" in the new comments

The misspell linter flags British "marshalled"; CI pins golangci-lint
v2.10.1 and runs it with --new-from-merge-base, so both new comment lines
are in scope. Comment text only, no behaviour change.

(cherry picked from commit cad7e17d70)

* fix(gate): evaluate cross-rig bead gates via prefix routes (#5859)

* fix(gate): route cross-rig bead checks (#5857)

Evaluate historical rig:bead gate targets through the current read-only prefix routing seam in direct and proxied-server modes. Preserve local bead gates, reject malformed cross-rig values, and cover the real two-store route with a Dolt integration test.

Agent-Signature: codex-unknown-model-unknown-reasoning on behalf of Klas Hesselman

* fix(gate): address cross-rig review feedback (#5857)

Preserve the original local not-found error when prefix routing is unavailable, document the user-visible behavior, and lock the proxied error contract with a regression test.

Agent-Signature: codex-unknown-model-unknown-reasoning on behalf of Klas Hesselman
(cherry picked from commit cbfc505e39)

* fix(storage/uow): retry transient ping failures during openDB bootstrap (#6003)

* test(uow): red — pingWithRetry does not exist yet for openDB's boot-time ping

Adds TestPingWithRetryRecoversFromATransientBadConn (be-x49l6): a fake
pinger exercising three cases — transient error retries then recovers,
non-transient error fails without retrying, and an already-cancelled
context fails promptly. Fails to compile until pingWithRetry/pinger
are added to dolt_sql_provider.go.

* feat: green — Fix: unretried ping in uow openDB turns a transient Dolt connection drop into a hard CI failure (refs be-x49l6)

* refactor: drop what-comment on pingWithRetry (self-review, refs be-x49l6)

Self-review flagged it as restating the function's own signature/behavior
rather than explaining a non-obvious why; the pinger and
isTransientPingError comments stay since they carry rationale the code
doesn't otherwise convey.

* test(uow): red — a hung boot ping is not bounded per attempt

Adds the two behaviours review #6003 asked for, both failing:

  - a_hung_ping_is_capped_per_attempt_and_retried: blockingPinger stalls
    until its context is cancelled. backoff.Retry bounds only the gap
    between attempts, so with the caller's context handed straight to
    PingContext the call never returns at all. The subtest runs the call
    off-goroutine so this reports as "never returned" instead of a
    package timeout.
  - connection-level_net_error_retries_then_recovers: a *net.OpError
    (connection refused / reset / broken pipe) is currently classified
    non-transient and fails the boot ping outright.

the_caller's_own_deadline_fails_without_retrying passes already and is
kept as the regression guard for the trap #6000 fell into: making
context.DeadlineExceeded retryable must not make the caller's own expiry
retryable too.

pingWithRetry takes attemptTimeout here but does not honour it yet, so
the red is behavioural rather than a compile error.

Refs be-g1i7n.

* fix(uow): bound each boot ping attempt and widen the transient classifier

Review #6003, point 1. backoff.Retry bounds the gap between attempts but
cannot interrupt one in flight, and the DSN sets a dial Timeout (5s) with
no ReadTimeout — so a server that accepts TCP and then stalls
mid-handshake blocked for the caller's entire context, which is the exact
scenario the PR summary claims to fix.

Each attempt now runs under its own context.WithTimeout
(pingAttemptTimeout, 10s — above the 5s dial timeout so a real dial
timeout still surfaces as itself), and context.DeadlineExceeded is
classified transient so the retry loop actually continues.

pingWithRetry checks the caller's context *before* classifying. That is
what keeps the retryable DeadlineExceeded from swallowing the caller's
own expiry — the inverse of the regression #6000 introduced by capping
each attempt and then treating the resulting DeadlineExceeded as
permanent. Covered from both sides:
a_hung_ping_is_capped_per_attempt_and_retried and
the_caller's_own_deadline_fails_without_retrying.

Review #6003, point 2. isTransientPingError stays separate from
internal/storage/dolt's isRetryableError, and now says why in full: that
one is a query-time classifier matching on error text, admitting
migration-lock, read-only and MySQL-1105 shapes a boot ping cannot be in
because nothing has executed on the connection yet. The coverage gap the
review named is closed on this side instead — *net.OpError is transient,
which is refused/reset/broken-pipe portably and by type rather than by
substring, with permanent DNS failures excluded so an unresolvable host
still fails fast instead of spending the whole budget.

Refs be-g1i7n.

(cherry picked from commit c0d8da42de)

* fix(deps): bump dolt/go past upstream manifest-missing-chunk defense (#4070) (#5931)

* fix(deps): bump dolt/go past upstream manifest-missing-chunk defense (#4070)

Pin github.com/dolthub/dolt/go to 796d074977417da931df65202a79e0a7f532a3db.
That hop includes:

- 23ccbf9442275166f168939277a5b4a348a63c9d — reject a file manifest
  update that references a missing table file (the defense itself)
- 796d074977417da931df65202a79e0a7f532a3db — doc/test follow-up to the
  defense commit (no production-semantics change)

A non-atomic backup sync can leave the backup manifest ahead of chunk
files; subsequent syncs then fail with "table file not found" and stay
broken. The upstream defense turns that silent corruption into a loud
failed sync. Beads' previous pin (a6690826d767, 2026-07-15) predates
both commits.

Minimal-churn pin: do not bump to today's dolt tip. go mod tidy did not
force a later version.

This is a mitigation, not a root-cause fix: backup file+manifest publish
remains non-atomic, and backups already in the manifest-ahead state are
not repaired by this change.

Mitigates #4070

* fix(nix): update vendorHash for the dolt/go bump

The go.mod/go.sum bump in this PR invalidates the pinned vendorHash, so
`nix build .#default` fails with a fixed-output hash mismatch. Update it to
the value CI computed:

  specified: sha256-D+KDoLFJHpt9D9rCrtE3NMfL4fgK7UxpdKlCxp5yz5Y=
  got:       sha256-wDU1tw/4t2CetwQl4+zUhlDI70dSasLLI2Gy66ZyhQQ=

The repo documents this coupling in .github/dependabot.yml; the existing
"Update vendorHash for dependabot Go bumps" workflow only fires for
dependabot PRs, so a manual bump is needed here.

(cherry picked from commit 851aa2f20a)

* docs(changelog): record the 1.3.1 cherry-pick behaviour deltas

Documents all eleven picks under the existing `## [1.3.1]` heading. The
six behaviour deltas go under Changed, including the two that are not
pure wins and that a user is most likely to hit without knowing why:

  - bd doctor now warns on every pre-existing workspace until --fix
    appends the new .beads/dolt-server-config.yaml gitignore rule.
  - opening a store against a dead server takes up to ~30s to fail
    instead of failing instantly, because the boot ping is retried.

Also called out as non-obvious: the ready set grows where custom
active-category statuses exist, bare --wisp-type becomes a refusal
rather than an empty success, and the Dolt bump converts a quietly
corrupting backup sync into a loud failing one without repairing
backups already in that state.

The dated `## [1.3.0]` section is shipped and is left byte-identical:
the diff is 165 insertions and 0 deletions, and the [1.3.0]-to-EOF
region still hashes to 798a2ee0b0f0b7a3f0fc017ae01c919807740348a34f5ea8719b82a008533d00.
The `## [1.3.1]` date is left for a later release prep to restamp.

* fix(nix): recompute vendorHash for the release-branch dependency set

The #5931 cherry-pick (510675948) bumps four dolt module pins, which
invalidates the pinned vendorHash. Neither side's value was usable: the
release branch already carried its own dependency bump (d594092eb), so
this pick lands on a vendor set that has existed on neither release/1.3.0
nor main, and #5931's own hash was computed against main's graph.

Taken from the `got:` value the nix-build lane reported for this branch:

  specified: sha256-wDU1tw/4t2CetwQl4+zUhlDI70dSasLLI2Gy66ZyhQQ=
  got:       sha256-DQdauEx5g48Xbxrz4wGLx4vkrQoYQX3FUx+7N/Y6YV4=

go mod tidy after the pick was a no-op, and the dependency delta against
the release tip is exactly the four intended pins, so this hash covers
that change and nothing else.

* docs(changelog): scope the #6003 open-latency entry and correct its bound

The 1.3.1 entry for the openDB bootstrap-ping retry said "up to ~30s" and
named no topology. Both were misleading:

- 30s is the retry BUDGET, not the wall-clock bound. backoff stops
  scheduling new attempts at 30s (MaxElapsedTime, dolt_sql_provider.go)
  but cannot cancel one in flight, and pingAttemptTimeout caps an attempt
  at 10s — so a single open can take ~40s. openAndInitSchema pings twice,
  each with a fresh budget, so the narrow case where the backend satisfies
  the first ping and the schema init and is then unreachable for the
  second reaches ~80s.

- Only unit-of-work provider construction takes that ping, which is a
  minority of topologies: proxied-server (local and external) on every
  command, plus `bd serve` in server/external-server/shared-server
  workspaces, which funnels through newSQLServerUOWProvider. Embedded
  never reaches it (bd serve refuses embedded outright), and an ordinary
  CLI command in a server or shared-server workspace opens a DoltStore
  that takes no such ping. An embedded reader of the old entry would have
  triaged a slowdown that cannot affect them.

CHANGELOG only; the dated [1.3.0] section is unchanged (verified
byte-identical, sha256 798a2ee0…, 9169 lines).

---------

Co-authored-by: Vishnu J <vishnuj81093@gmail.com>
Co-authored-by: Karel Bourgois <karel@voxist.com>
Co-authored-by: Adam Spiers <github@adamspiers.org>
Co-authored-by: Adam Spiers <ai@adamspiers.org>
Co-authored-by: swedeinasia-flow <klas@flownetworks.io>
Co-authored-by: Jim Wordelman <jim@wordelman.name>
2026-09-21 00:23:37 -07:00
Julian Knutsen
d487b9796e
release: prep v1.3.1-rc.1 (#6593)
* release: prep v1.3.1-rc.1

Sanctioned RC bump per RELEASING.md "Cut an RC", on the #6298 model:
./scripts/update-versions.sh 1.3.1-rc.1, which carries the stamp into
version.go, the three plugin.json manifests, marketplace.json, the npm
package.json, the MCP pyproject.toml/__init__.py/uv.lock, default.nix,
the ten .githooks managed-section markers and the winres strings.
scripts/check-versions.sh passes all 24 gates at 1.3.1-rc.1.

Unlike the 1.3.0 RCs, this bump moves the BASE version, so
cmd/bd/winres/manifest.xml changes too (1.3.0.0 -> 1.3.1.0) along with
the winres numeric file_version/product_version (1.3.0 -> 1.3.1). Those
PE fields must be purely numeric; the FileVersion/ProductVersion strings
carry the full 1.3.1-rc.1, and uv.lock carries the PEP 440 normalization
1.3.1rc1 written by `uv lock`, never by hand.

This has to land before the tag: release.yml's verify-version-consistency
compares ${GITHUB_REF_NAME#v} byte-for-byte against the Version string in
cmd/bd/version.go, and every stamp on this branch still read 1.3.0.
Simulated against the working tree with the workflow's own grep/sed
pipeline: the extracted string is exactly "1.3.1-rc.1", on a single
matching line. The tag must be spelled v1.3.1-rc.1.

CHANGELOG: creates the [1.3.1] section dated 2026-09-16 and leaves
[Unreleased] empty but present, which is what #6038 (b3ef65c85) did when
it created [1.3.0] at branch-cut, and what #6298's fixup established for
an RC tag — an entry parked under [Unreleased] ships in no release by
Keep-a-Changelog semantics, yet the RC demonstrably ships it. The three
Fixed bullets already on the branch (#6580 x2, #6578) move under [1.3.1]
by the rename alone; their wording is untouched, and the shipped
[1.3.0] section and everything below it is byte-identical (sha256 of the
[1.3.0]-to-EOF region is unchanged across this commit).

The 2026-09-16 date is provisional. The final 1.3.1 prep must hand-restamp
it to the real release date rather than rerun the beads-release formula's
stamp-changelog step, which sed-inserts a fresh header under [Unreleased]
and never re-dates an existing section — running it against an already
dated [1.3.1] duplicates the heading. Same trap #6298 documented and #6564
then worked around.

cmd/bd/info.go: adds the 1.3.1-rc.1 digest at index 0 of versionChanges,
dated 2026-09-16 so the array stays newest-first with monotonic dates for
TestGetVersionsSinceOrder. It leads with the no-migration note (a 1.3.0
user's upgrade is a binary swap) and then digests the two #6580 changes and
the two #6578 ones. Per the #6298 lesson this key can only reach rc.1 users
by shipping inside the rc.1 binary; omit it and `bd upgrade review` dumps
the whole history at them.

docs/cli-docs.pin is still v1.2.2 on this branch — 1.3.0's docs-pin step
never happened. check-versions.sh explicitly excludes it, so it is not
tag-blocking and is deliberately left for the post-tag docs step.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(release): reclassify 1.3.1 behaviour changes and document the config migration

Documentation-only amendment to the v1.3.1-rc.1 prep. No version stamp is
touched; ./scripts/check-versions.sh stays 24/24 at 1.3.1-rc.1.

Three corrections, all inside the `## [1.3.1]` section and its `cmd/bd/info.go`
`versionChanges` twin.

1. The flat->nested config migration is now documented (#6594). #6578 made
   `bd config set <dotted.key>` write a nested mapping, and where a flat
   top-level key of the same literal name exists it deletes that entry and
   re-emits the value nested (`updateNestedYamlKey`). `.beads/config.yaml` is
   not exclusively bd's, so another writer that reads its dotted keys flat
   stops seeing any value migrated this way — and if it re-adds the flat key,
   bd's own readers disagree: Viper-backed reads return the flat value while
   GetStringFromDir returns the nested one. Verified both halves empirically
   against this tree (dual-spelling probe: viper="flatvalue",
   GetStringFromDir="nestedvalue", independent of document order; migration
   probe: `dolt.host` flat entry deleted, sibling `dolt.port` and `other.thing`
   byte-intact). Realistic collisions are `dolt.*`, `export.auto`,
   `backup.enabled`.

2. Two genuine behaviour changes moved out of `### Fixed` into `### Changed`,
   following the 1.3.0-rc.2 precedent in c1e5e49e3: the `bd dolt status --json`
   shape change (#6580), which a parser of the old payload meets on upgrade,
   and the two `bd config set` success->failure cases (#6578). The fix content
   stays in `Fixed` with a pointer; neither statement appears in both sections.

3. `backend_endpoint` added to the documented key list in both CHANGELOG.md and
   info.go. It is a real `omitempty` field on `proxiedDoltStatus`
   (cmd/bd/dolt_proxied_lifecycle.go:63), set only when the sidecar reports an
   external backend — the one topology where `backend_managed` is false and
   nothing else names the server. Both surfaces now carry the same 11 keys as
   the struct.

Validated: `## [1.3.0]`->EOF is byte-identical before and after
(sha256 798a2ee0b0f0b7a3f0fc017ae01c919807740348a34f5ea8719b82a008533d00);
exactly one `## [1.3.1]` heading, `## [Unreleased]` present and empty;
check-versions.sh 24/24; go build/vet ./...; go test ./cmd/bd -run
'TestGetVersionsSinceOrder|TestVersionChangesStructure|TestVersionChangesCoverage|TestVersionChangesJSON|TestGetVersionsSince|TestDisplayVersion'
all PASS, no skips; scripts/ci/pr-lint.sh and scripts/ci/pr-policy.sh green;
`bd info --whats-new` surfaces both amendments end-to-end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-18 17:38:56 -07:00
Julian Knutsen
fa95439006
test(topology): front-door capability matrix across storage topologies (proxied-parity S0) [release/1.3.0] (#6579)
* test(topology): front-door capability matrix across storage topologies (S0)

Characterization test for the proxied-parity work. Records what bd does
TODAY across embedded, direct-local-server, direct-external-server,
proxied-local and proxied-external-tcp — including the behavior that is
wrong — so every later slice flips named rows and the flip is the review
artifact.

18 command probes x 5 topologies = 90 cells. Outcomes are classified so a
reader can tell the classes apart: REFUSED_TYPED carries reason=design
(permanent policy) or reason=unimplemented (a gap a later slice closes),
separately from WRONG_ANSWER, DEGRADED, ERROR and HONORED. Cells that
record a bug carry a knownBad string naming it.

Refusal rows additionally assert the two side-effect invariants from the
existing history matrix: no proxy pidfile materializes (the provider was
never constructed) and durable artifacts are byte-identical.

Findings this matrix pins down beyond the design inventory:
- `bd doctor` exits 0 on EMBEDDED having run no checks, not just proxied.
- root `bd compact` is HONORED proxied; its refusal row is unreachable
  because the gate short-circuits when the command has no --dolt flag.
- `bd dolt status` is correct on both direct server topologies; proxied is
  the sole outlier (running=false, pid 0, while the proxy serves CRUD).

Reuses the existing fixtures rather than adding a harness: bdInit,
newServerModeProject, bdManagedLocalInit, newSharedProxiedProject,
buildEmbeddedBD, runCommandBuffers and snapshotHistoryArtifacts. The only
new fixture is direct-local-server, which had no named helper.

Gating: named TestProxiedServer* so proxied-test-shard.sh discovers it,
which lands it in pr-risk.yml's test-proxied-cmd lane — a lane that runs
on pull_request, not only push-to-main. managed-local is gated on
BEADS_TEST_PROXIED_LOCAL, which only the proxied-local smoke lane sets, so
it gets a second entry point named/filed to match that lane's filters.

No production code changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test(topology): tell the post-#6580 truth about proxied dolt start/status

#6580 makes `bd dolt status` truthful on a proxied workspace and turns
`bd dolt start` there into a typed refusal. This matrix still encoded the
pre-#6580 behaviour, so the two PRs are individually green and jointly red:
merged together, `dolt status` on both proxied topologies fails the
`"running": false` marker this table asserted.

- flip the proxied `dolt status` cell from WRONG_ANSWER/`"running": false`
  to HONORED/`"running": true` and drop its knownBad — the defect is fixed,
  not deferred
- add the `dolt start` row the stale deliberatelyNotProbed entry promised:
  REFUSED_TYPED `proxy.dolt_start.conflict` on both proxied topologies,
  REFUSED_UNTYPED on embedded (same command, no code a consumer can branch
  on), HONORED on direct-local where bd really does own the server
- delete deliberatelyNotProbed["dolt start"], which described the hazard
  #6580 fixed as if it were current
- add probe.skipOn so one row can be excused from one topology with the
  reason printed under the table; direct-external is excused from
  `dolt start` because running it there would leave a bd-owned sql-server
  the fixture has no teardown for

This commit depends on #6580. Against a base that lacks it the flipped
cells fail, because there `bd dolt status` still lies.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Julian Knutsen <julian@gastownhall.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-16 02:53:27 -07:00
Julian Knutsen
76860ebdfb
fix(config): dotted keys round-trip through SetYamlConfigInDir/UnsetYamlConfig (bd-zj95, 1.3.1) [release/1.3.0] (#6578)
* fix(config): make a dotted key round-trip through SetYamlConfigInDir (bd-zj95)

SetYamlConfigInDir writes dotted keys; GetStringFromDir reads them by splitting
on the dot and walking nested mappings; UnsetYamlConfig removes them. Those are
three directions of ONE round-trip property, and set/get was broken in two ways,
both reachable from ordinary files:

  - An empty or comment-only config.yaml has no mapping node, so the nested
    writer declined and the caller appended a literal 'dolt.host: ...' line — a
    key whose NAME contains a dot. Nothing that splits on the dot can ever find
    it.
  - A file that already carried such a flat key had it updated in place, which
    preserved the unreadable shape forever.

So a caller could write a value and immediately be unable to read it back. Two
consumers found it the hard way: bd's ownership handoff, whose commit write-set
refused itself on dolt.auto-start, and a Gas City managed city, whose
.beads/config.yaml is entirely flat dotted keys.

Six shipped call sites write a dotted key through this path, and every one of
them is a write into a .beads/config.yaml that may be empty or comment-only —
exactly the shape that produced the unreadable spelling:

  cmd/bd/bootstrap.go:1108         sync.remote
  cmd/bd/dolt.go:481               sync.remote
  cmd/bd/init.go:3386, :3394       sync.remote
  cmd/bd/migrate_dolt_mode.go:810  dolt.shared-server
  cmd/bd/migrate_dolt_mode.go:1168 dolt.shared-server

An empty document now gets a mapping made for it, and a flat key of the name
being written is migrated to the nested form rather than updated in place. Only
the key being written is touched: a dotted key this call does not own belongs to
someone else and is left exactly as they wrote it.

Table test over nine file shapes — absent, empty, comment-only, flat, flat
commented, existing section, unrelated nested, unrelated flat, and mixed — each
asserting both that every key reads back and that no unreadable flat spelling
survives.

(cherry picked from commit cbe9bd6ca03416a76441e560bdec9fa67add99c5)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(config): unset a dotted key in the shape the writer produces

Writing a dotted key nested and then being unable to unset it is the same
round-trip break in the other direction. Set, get and unset are three directions
of ONE property, and all three have to agree on the shape: UnsetYamlConfig
comments out the line matching the key, and its pattern only ever matched a FLAT
'sync.remote:' line. Once the writer nests, an unset silently does nothing and
the value stays live — for sync.remote that means bd keeps a remote the operator
asked it to forget.

commentOutYamlKey now walks the nesting, tracking indentation per segment so a
key is commented only when it sits under its OWN parents rather than under some
other section sharing a leaf name. The flat spelling is still handled, because
files written by older bds carry it.

This is what closes the loop for the shipped unset paths — cmd/bd/config.go:578
('bd config unset'), cmd/bd/dolt.go:1761 and
cmd/bd/dolt_remote_proxied_server.go:34 — against the six writers the previous
commit nests: sync.remote at cmd/bd/bootstrap.go:1108, cmd/bd/dolt.go:481 and
cmd/bd/init.go:3386/:3394, and dolt.shared-server at
cmd/bd/migrate_dolt_mode.go:810/:1168.

TestFinalizeSyncedBootstrapWritesConfigFiles moves with it. It required a
literal 'sync.remote: ' line — a key whose name contains a dot, the one shape
GetStringFromDir and viper can never find, because both split on the dot and
walk nested mappings. That assertion passed for exactly as long as the value was
unreadable and failed the moment it became readable, so it now asserts what
bootstrap actually owes its caller: a remote that reads back.

(cherry picked from the internal/config half of commit
7f1ec4799a3e8af0a89b8f97c28ec30082fedbb7)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* test(cmd/bd): assert the sync.remote round trip, not a YAML spelling

Six cmd/bd test sites baked the flat spelling. They passed BECAUSE the bug was
present, and that is the part worth recording.

Viper finds a literal dotted key as well as a nested one; GetStringFromDir does
not, because it splits on the dot and walks mappings. So these tests exercised
config.yaml through ONE reader while the value was invisible to the other. They
were green for exactly as long as the value was unreadable, and
TestFinalizeSyncedBootstrapWritesConfigFiles failed on macOS and Linux CI the
moment it became readable. A test that only passes while a bug is live does not
merely fail to catch it — it defends it.

  bootstrap_guard_test.go:84        seed
  bootstrap_test.go:358, :410       seed
  bootstrap_test.go:1330            assert (accepted 'sync.remote: ' OR
                                    'sync-remote: ', neither readable)
  dolt_worktree_remote_test.go:55   assert
  init_remote_test.go:128           seed

All six now assert the round trip through GetStringFromDir, or the caller's own
observable, rather than any YAML text — flat or nested. Asserting the nested
spelling instead would have been the same mistake facing the other way.

The three seeds go through config.SetYamlConfigInDir, the real writer, via a
shared seedSyncRemote helper that asserts the read-back. A fixture can no longer
hand bd a config.yaml that bd itself would never have written.

These are the tests standing over the shipped writers this series fixes:
sync.remote at cmd/bd/bootstrap.go:1108, cmd/bd/dolt.go:481 and
cmd/bd/init.go:3386/:3394, and dolt.shared-server at
cmd/bd/migrate_dolt_mode.go:810/:1168.

(cherry picked from commit b0df00b59d2d68ee5fee313c05dc2300ad66fcef)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(config): close the dotted-key round trip the rest of the way

Review of the first three commits found the round trip still open in two
places, both reachable from ordinary files.

An empty or comment-only config.yaml parses to no YAML nodes at all, and
yaml.v3 keeps no trace of its text either — not even the comments. The
writer fabricated a mapping for that case and marshalled it, so the file
it wrote back was the new key and nothing else. `bd init` writes a
template that is comments and nothing else and then persists sync.remote
into it, so every remote-connected init shipped a config.yaml with its
whole documentation deleted. config.yaml is git-tracked: the operator
sees that as a committed diff they did not make. Append the rendered key
to the existing text instead, so nothing already in the file is parsed,
re-emitted or reformatted, and it survives byte for byte.

An unset comments the leaf out and leaves the section holding nothing —
`sync:` and no more. A null is not a mapping, so the next set refused it,
fell through to the flat writer, and put a literal `sync.remote:` back
into the file: the unreadable shape, re-created one command after being
fixed, with bd reporting success while GetStringFromDir saw nothing. A
section with no value under it has nothing to lose, so treat it as the
empty mapping it looks like.

Two shapes that are genuinely unwritable now say so instead of writing
the flat key and claiming success: a parent that already holds a value
(`sync: enabled`), and a file whose top level is not a mapping. Both
returned nil and produced a value no reader could see.

Unset also matched lines inside literal block scalars, so unsetting
sync.remote rewrote text the operator had written under a `notes: |`.
Skip a block scalar's body: it is data, not structure.

Finally, drop normalizeYamlKey and its empty keyAliases map. It has been
an identity function whose comment claimed it renamed keys.

* docs(changelog): record the dotted config key fix under Unreleased

It is the most user-visible fix in 1.3.1 and it was not in the changelog,
so it would not have reached the release notes or `bd upgrade review`.

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 02:52:51 -07:00
Julian Knutsen
87c7375d5f
fix(dolt): contain bd dolt start on proxied workspaces; make bd dolt status truthful [release/1.3.0] (#6580)
* Align proxied-local-smoke Dolt CLI pin with measured 2.2.0 (refs be-egcj2.3) (#6002)

* test(feat): red — Align dolt-sql-server test container version with host DOLT_VERSION pin (refs be-egcj2.3)

* feat: green — Align dolt-sql-server test container version with host DOLT_VERSION pin (refs be-egcj2.3)

* chore(ci): retrigger CI after transient golangci-lint schema-fetch timeout (refs be-fjj0i)

(cherry picked from commit ea89b160fb)

* fix(dolt): contain `bd dolt start` on proxied workspaces; make `bd dolt status` truthful

`bd dolt start` knew nothing about proxied-server mode, and the default
proxied root IS `.beads/dolt` (internal/doltserver/physical_root.go:113-127).
With the proxy tree down it launched an unsupervised `dolt sql-server`
directly over that root; the next ordinary bd command then failed with
`invalid connection` because the relaunched proxy found a foreign server on
its port. With the tree up it adopted the proxy's own dolt child into bd's
classic PID/port records, leaving two managers for one process.

`bd dolt status` read the classic pidfile, which proxied mode never writes,
and reported "not running" against a healthy backend — the wrong answer that
sent operators to `bd dolt start` in the first place.

start is now a typed refusal (`proxy.dolt_start.conflict`): the proxy owns
its child's lifecycle, and an idle reaper means a "started" postcondition bd
could not honor beyond the idle window. status reads the proxy's own records
and reports the proxy and its backend separately, starting nothing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-16 01:13:07 -07:00
Julian Knutsen
f62cc4f072
fix(scripts): make check-doc-flags portable to BSD grep and fail loud on grep errors (#6026) (#6581)
(cherry picked from commit 4c4be78b5c)

Co-authored-by: postoso <postoso@gmail.com>
Co-authored-by: postoso <postoso@users.noreply.github.com>
2026-09-16 01:12:57 -07:00
2597 changed files with 27169 additions and 405225 deletions

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

View file

@ -9,7 +9,7 @@
"name": "beads",
"source": "./plugins/beads",
"description": "AI-supervised issue tracker for coding workflows",
"version": "1.3.0"
"version": "1.3.2-rc.2"
}
]
}

View file

@ -201,8 +201,7 @@ document what the pinned release does, never main-only features. See
## 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),
The short list: `go test ./test/docsync` (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`.

View file

@ -39,9 +39,8 @@ don't measure that work by the word delta.
*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`.
6. **Gates:** `go test ./test/docsync`, 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.

View file

@ -8,7 +8,7 @@ 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
`AGENTS.md`, `AGENT_INSTRUCTIONS.md`, 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.

View file

@ -8,7 +8,7 @@ Run these before considering docs work complete. Ordered cheapest-first.
# 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
go test ./test/docsync
# 2. Generated CLI docs freshness: regenerates from the live command tree
# and diffs docs/CLI_REFERENCE.md, docs/cli-reference/, and the CLI
@ -55,7 +55,7 @@ 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/,
README.md, AGENTS.md, AGENT_INSTRUCTIONS.md, 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

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/embeddeddolt/...
# 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: `engdocs/TESTING.md`
- Current broken tests: See GH issues #355, #356

View file

@ -1,5 +1,5 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.3.0 ---
# --- BEGIN BEADS INTEGRATION v1.3.2-rc.2 ---
# 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
@ -19,7 +19,7 @@ if command -v bd >/dev/null 2>&1; then
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 ;;
"timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
@ -56,4 +56,4 @@ if command -v bd >/dev/null 2>&1; then
fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.3.0 ---
# --- END BEADS INTEGRATION v1.3.2-rc.2 ---

View file

@ -1,5 +1,5 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.3.0 ---
# --- BEGIN BEADS INTEGRATION v1.3.2-rc.2 ---
# 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
@ -19,7 +19,7 @@ if command -v bd >/dev/null 2>&1; then
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 ;;
"timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
@ -56,4 +56,4 @@ if command -v bd >/dev/null 2>&1; then
fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.3.0 ---
# --- END BEADS INTEGRATION v1.3.2-rc.2 ---

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Pre-commit hook: auto-format with gofmt, then lint and vet with nogo.
# Pre-commit hook: auto-format with gofmt and lint with golangci-lint.
# Installed via: git config core.hooksPath .githooks
# See also: make install (sets hooksPath automatically)
@ -9,24 +9,38 @@ set -euo pipefail
# 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
# Build golangci-lint from source so it is never a stale global binary, and
# pin the version to the one CI uses (.github/workflows/{pr,main}.yml).
GOLANGCI_LINT="go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1"
# Build it with the repo's own Go, the way CI does. In CI, actions/setup-go
# installs the go.mod version and exports GOTOOLCHAIN=local. Locally
# GOTOOLCHAIN defaults to "auto", and for a pkg@version build that honours
# golangci-lint's own toolchain directive instead: it downgrades to
# go1.25.12, which then refuses this repo's newer go directive at config
# load ("the Go language version (go1.25) used to build golangci-lint is
# lower than the targeted Go version") and fails every Go commit. Pinning to
# the go directive reproduces CI's resolution on any host toolchain.
go_toolchain="go$(awk '$1 == "go" { print $2; exit }' go.mod)"
if [ "$go_toolchain" = "go" ]; then
echo >&2 "pre-commit: no go directive in go.mod; cannot pin the lint toolchain"
exit 1
fi
# Auto-format and re-stage
echo "$staged_go_files" | xargs gofmt -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
# Lint changed code with auto-fix; block on remaining issues.
# CGO_ENABLED=0 avoids typecheck failures from CGO-only dependencies
# (e.g., dolthub/go-icu-regex) that require system headers not always present.
CGO_ENABLED=0 GOTOOLCHAIN="$go_toolchain" $GOLANGCI_LINT run --new-from-rev=HEAD --fix || exit 1
# Re-stage any auto-fixes from the linter
echo "$staged_go_files" | xargs git add
fi
# --- BEGIN BEADS INTEGRATION v1.3.0 ---
# --- BEGIN BEADS INTEGRATION v1.3.2-rc.2 ---
# 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
@ -46,7 +60,7 @@ if command -v bd >/dev/null 2>&1; then
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 ;;
"timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
@ -83,4 +97,4 @@ if command -v bd >/dev/null 2>&1; then
fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.3.0 ---
# --- END BEADS INTEGRATION v1.3.2-rc.2 ---

View file

@ -1,10 +1,8 @@
#!/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.
# Pre-push hook: when pushing a release tag (refs/tags/v*), refuse the push if
# version constants disagree. This 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)
@ -28,71 +26,20 @@ 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"
echo "Release tag push detected — verifying version consistency..."
if ! (cd "$repo_root" && ./scripts/check-versions.sh); then
echo ""
echo "❌ Refusing to push release tag: versions are inconsistent." >&2
echo " Fix with: scripts/update-versions.sh <version>" >&2
echo " Override with --no-verify only if you know what you are doing." >&2
exit 1
fi
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 ---
# --- BEGIN BEADS INTEGRATION v1.3.2-rc.2 ---
# 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
@ -112,7 +59,7 @@ if command -v bd >/dev/null 2>&1; then
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 ;;
"timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
@ -149,4 +96,4 @@ if command -v bd >/dev/null 2>&1; then
fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.3.0 ---
# --- END BEADS INTEGRATION v1.3.2-rc.2 ---

View file

@ -1,5 +1,5 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.3.0 ---
# --- BEGIN BEADS INTEGRATION v1.3.2-rc.2 ---
# 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
@ -19,7 +19,7 @@ if command -v bd >/dev/null 2>&1; then
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 ;;
"timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
@ -56,4 +56,4 @@ if command -v bd >/dev/null 2>&1; then
fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.3.0 ---
# --- END BEADS INTEGRATION v1.3.2-rc.2 ---

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 +1,16 @@
<!--
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.
This is a starting scaffold to help reviewers (human and agent) parse intent before diff.
Replace, expand, or delete sections freely. CONTRIBUTING.md has the full hygiene rules.
-->
Closes #
## What
## What changed
<!-- One or two plain-language sentences: what does this change do? -->
<!-- One or two plain-language sentences. -->
## Why
## Evidence it works
<!-- The problem this solves, the motivation, or a link to the issue: e.g. "Fixes #123" -->
<!-- Commands a reviewer can run and what they show, end to end.
"Unit tests pass" alone is not evidence. -->
## Verification
## 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.
<!-- How you tested. Commands a reviewer can run to confirm. -->

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,138 @@
# 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 Dolt-powered issue tracker designed for AI-supervised coding workflows. Git integration is optional. 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 via Dolt-native replication
- AI-optimized CLI with JSON output
- Dolt server mode for background operations
- MCP server integration for Claude and other AI assistants
## Tech Stack
- **Language**: Go 1.21+
- **Storage**: Dolt (version-controlled SQL database)
- **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 `t.TempDir() in Go tests` to avoid polluting production database
- Run `go test -short ./...` before committing
- Never create test issues in production DB (use temporary DB)
### Code Style
- Run `make ci-pr-lint` before committing changes to Go or lint-controlled files
- 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
- Install git hooks: `bd hooks install`
- Use `bd dolt push` / `bd dolt pull` for remote sync
- Before implementing related work, opening a PR, or merging/closing a PR, run:
`scripts/pr-preflight.sh --search "<topic>" --repo gastownhall/beads` or
`scripts/pr-preflight.sh <pr-number> --repo gastownhall/beads`
- External contributor PRs have priority: build on them when possible, preserve
tests and attribution, and never close or replace them silently.
## 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> --claim --json
bd close <id> --reason "Done" --json
# Search
bd list --status open --priority 1 --json
bd show <id> --json
# Sync (if remote configured)
bd dolt push # Push to Dolt remote
bd dolt pull # Pull from Dolt remote
```
### Workflow
1. **Check ready work**: `bd ready --json`
2. **Claim task**: `bd update <id> --claim`
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 dolt push` (push to Dolt remote if configured)
**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
│ └── dolt/ # Dolt implementation
├── integrations/
│ └── beads-mcp/ # MCP server (Python)
├── examples/ # Integration examples
├── docs/ # Documentation
└── .beads/
└── dolt/ # Dolt database (source of truth)
```
## 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
- ✅ Use `bd dolt push` / `bd dolt pull` for remote sync
- ✅ Test with `t.TempDir() in Go tests`
- ❌ Do NOT create markdown TODO lists
- ❌ Do NOT create test issues in production DB
- ❌ Do NOT manually modify `.beads/dolt/`
---
**For detailed workflows and advanced features, see [AGENTS.md](../AGENTS.md)**

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

163
.github/scripts/ci-capability-selector.sh vendored Executable file
View file

@ -0,0 +1,163 @@
#!/usr/bin/env bash
# Report candidate PR Risk capabilities without changing the current gates.
set -euo pipefail
embedded_cli=false
proxied_cli=false
embedded_storage=false
embedded_conformance=false
server_conformance=false
full=false
reason=""
diff_file=""
cleanup() {
if [[ -n "$diff_file" ]]; then
rm -f "$diff_file"
fi
}
trap cleanup EXIT
set_full() {
embedded_cli=true
proxied_cli=true
embedded_storage=true
embedded_conformance=true
server_conformance=true
full=true
reason="$1"
}
emit() {
local lines=(
"embedded_cli=$embedded_cli"
"proxied_cli=$proxied_cli"
"embedded_storage=$embedded_storage"
"embedded_conformance=$embedded_conformance"
"server_conformance=$server_conformance"
"full=$full"
"reason=$reason"
)
printf '%s\n' "${lines[@]}"
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
printf '%s\n' "${lines[@]}" >> "$GITHUB_OUTPUT"
fi
}
event_name="${GITHUB_EVENT_NAME:-}"
base_sha="${PR_BASE_SHA:-}"
head_sha="${PR_HEAD_SHA:-}"
case "$event_name" in
pull_request) ;;
push) set_full "push"; emit; exit 0 ;;
merge_group) set_full "merge_group"; emit; exit 0 ;;
*) set_full "unsupported_event"; emit; exit 0 ;;
esac
if [[ -z "$base_sha" || -z "$head_sha" ]]; then
set_full "missing_bounds"
emit
exit 0
fi
diff_file=$(mktemp)
if ! git diff --no-ext-diff --find-renames --name-status -z "$base_sha" "$head_sha" -- > "$diff_file"; then
set_full "diff_failed"
emit
exit 0
fi
saw_path=false
saw_cmd=false
saw_embedded=false
saw_server=false
saw_conformance=false
while :; do
status=""
if ! IFS= read -r -d '' status <&3; then
if [[ -n "$status" ]]; then
set_full "malformed_record"
fi
break
fi
if [[ "$status" != "A" && "$status" != "M" ]]; then
set_full "unsafe_status"
break
fi
path=""
if ! IFS= read -r -d '' path <&3; then
set_full "malformed_record"
break
fi
saw_path=true
if [[ -z "$path" || "$path" == /* || "/$path/" == *"/../"* || "$path" == . || "$path" == .. || "$path" == ./* ]]; then
set_full "unsafe_path"
break
fi
case "$path" in
.github/workflows/*|.github/scripts/*)
set_full "unsafe_control"
break
;;
.buildflags|go.mod|go.sum|Makefile|default.nix|flake.nix|flake.lock|overlay.nix|packages.nix)
set_full "build_input"
break
;;
cmd/bd/*)
embedded_cli=true
proxied_cli=true
saw_cmd=true
;;
internal/storage/embeddeddolt/*)
embedded_cli=true
embedded_storage=true
embedded_conformance=true
saw_embedded=true
;;
internal/storage/dolt/*)
proxied_cli=true
server_conformance=true
saw_server=true
;;
backend/conformance/*|test/conformance/*)
embedded_conformance=true
server_conformance=true
saw_conformance=true
;;
internal/storage/*|backend/*|schema/*)
set_full "cross_cutting_storage"
break
;;
docs/*.md|docs/*.mdx|docs/*.png|docs/*.jpg|docs/*.jpeg|docs/*.gif|docs/*.svg|docs/*.webp|docs/*.avif|engdocs/*.md|engdocs/*.mdx|engdocs/*.png|engdocs/*.jpg|engdocs/*.jpeg|engdocs/*.gif|engdocs/*.svg|engdocs/*.webp|engdocs/*.avif|README.md|CHANGELOG.md|ARTICLES.md|BENCHMARKS.md|NEWSLETTER.md)
;;
*)
set_full "unowned_path"
break
;;
esac
done 3< "$diff_file"
if [[ "$full" != true ]]; then
if [[ "$embedded_cli" == true && "$proxied_cli" == true && "$embedded_storage" == true && "$embedded_conformance" == true && "$server_conformance" == true ]]; then
full=true
reason="full"
elif [[ "$saw_path" != true ]]; then
reason="empty_diff"
elif [[ "$saw_cmd" == true && "$saw_embedded" != true && "$saw_server" != true && "$saw_conformance" != true ]]; then
reason="cmd_bd"
elif [[ "$saw_embedded" == true && "$saw_cmd" != true && "$saw_server" != true && "$saw_conformance" != true ]]; then
reason="embedded_storage"
elif [[ "$saw_server" == true && "$saw_cmd" != true && "$saw_embedded" != true && "$saw_conformance" != true ]]; then
reason="server_storage"
elif [[ "$saw_conformance" == true && "$saw_cmd" != true && "$saw_embedded" != true && "$saw_server" != true ]]; then
reason="shared_conformance"
elif [[ "$saw_cmd" == false && "$saw_embedded" == false && "$saw_server" == false && "$saw_conformance" == false ]]; then
reason="docs_only"
else
reason="mixed"
fi
fi
emit

103
.github/scripts/ci-embedded-tier.sh vendored Executable file
View file

@ -0,0 +1,103 @@
#!/usr/bin/env bash
# Decide whether CI should run the full embedded Dolt build/storage/cmd matrix.
set -euo pipefail
event_name="${GITHUB_EVENT_NAME:-}"
base_sha="${PR_BASE_SHA:-}"
head_sha="${PR_HEAD_SHA:-}"
full_embedded=false
reason=""
changed_files=""
write_outputs() {
if [ -n "${GITHUB_OUTPUT:-}" ]; then
{
echo "full_embedded=$full_embedded"
echo "reason=$reason"
} >> "$GITHUB_OUTPUT"
fi
}
case "$event_name" in
push)
full_embedded=true
reason="push to main runs full embedded Dolt coverage"
write_outputs
echo "$reason"
exit 0
;;
merge_group)
full_embedded=true
reason="merge queue runs full embedded Dolt coverage"
write_outputs
echo "$reason"
exit 0
;;
esac
if [ "$event_name" != "pull_request" ]; then
full_embedded=true
reason="non-PR event runs full embedded Dolt coverage"
write_outputs
echo "$reason"
exit 0
fi
if [ -z "$base_sha" ] || [ -z "$head_sha" ]; then
full_embedded=true
reason="PR diff bounds unavailable; defaulting to full embedded Dolt coverage"
write_outputs
echo "$reason"
exit 0
fi
if ! changed_files="$(git diff --name-only "$base_sha" "$head_sha")"; then
full_embedded=true
reason="PR diff failed; defaulting to full embedded Dolt coverage"
write_outputs
echo "$reason"
exit 0
fi
if [ -z "$changed_files" ]; then
reason="no changed files detected; skipping embedded Dolt matrix"
write_outputs
echo "$reason"
exit 0
fi
while IFS= read -r path; do
case "$path" in
cmd/*|internal/*|tests/*|scripts/*|.github/scripts/*|.github/workflows/*)
full_embedded=true
reason="changed $path"
break
;;
*.go|go.mod|go.sum|Makefile|default.nix|flake.nix|flake.lock|packages.nix)
full_embedded=true
reason="changed $path"
break
;;
AGENTS.md|AGENT_INSTRUCTIONS.md|CONTRIBUTING.md|RELEASING.md)
full_embedded=true
reason="changed $path"
break
;;
esac
done <<< "$changed_files"
if [ "$full_embedded" = true ]; then
reason="risk path detected: $reason; running full embedded Dolt coverage"
else
reason="docs/metadata-only PR; skipping embedded Dolt storage/cmd matrix"
fi
write_outputs
echo "$reason"
echo "Changed files:"
while IFS= read -r path; do
printf ' %s\n' "$path"
done <<< "$changed_files"

View file

@ -1,545 +1,154 @@
# Embedded-Dolt cmd/bd test shard manifest.
# Embedded cmd 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
# There is no committed recent duration artifact for these tests. This manifest
# pins a conservative even split for the 20-shard CI matrix while
# embedded-test-shard.sh continues to hash-distribute newly-added tests that are
# not listed here.
20 1 TestEmbeddedBackup
20 2 TestEmbeddedBackupConcurrent
20 3 TestEmbeddedBlocked
20 4 TestEmbeddedBlockedConcurrent
20 5 TestEmbeddedBootstrap
20 6 TestEmbeddedBootstrapConcurrent
20 7 TestEmbeddedBranch
20 8 TestEmbeddedBranchConcurrent
20 9 TestEmbeddedChildren
20 10 TestEmbeddedChildrenConcurrent
20 11 TestEmbeddedClose
20 12 TestEmbeddedCloseConcurrent
20 13 TestEmbeddedComments
20 14 TestEmbeddedCommentsCLI
20 15 TestEmbeddedCommentsCLIConcurrent
20 16 TestEmbeddedCompact
20 17 TestEmbeddedCompactConcurrent
20 18 TestEmbeddedConfig
20 19 TestEmbeddedConfigConcurrent
20 20 TestEmbeddedConfigNoWorkspaceStoreFreeCommands
20 1 TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout
20 2 TestEmbeddedContext
20 3 TestEmbeddedContextConcurrent
20 4 TestEmbeddedContributorCreate
20 5 TestEmbeddedCount
20 6 TestEmbeddedCountConcurrent
20 7 TestEmbeddedCreate
20 8 TestEmbeddedCreateCommitPending
20 9 TestEmbeddedCreateConcurrent
20 10 TestEmbeddedCreateCrossRepo
20 11 TestEmbeddedCreateCrossRepoUninit
20 12 TestEmbeddedCreateCrossRepoWithParent
20 13 TestEmbeddedCreateWithGitRemote
20 14 TestEmbeddedDefer
20 15 TestEmbeddedDeferConcurrent
20 16 TestEmbeddedDelete
20 17 TestEmbeddedDep
20 18 TestEmbeddedDepConcurrent
20 19 TestEmbeddedDiff
20 20 TestEmbeddedDiffConcurrent
20 1 TestEmbeddedDolt
20 2 TestEmbeddedDoltConcurrent
20 3 TestEmbeddedDuplicate
20 4 TestEmbeddedDuplicateConcurrent
20 5 TestEmbeddedDuplicates
20 6 TestEmbeddedDuplicatesConcurrent
20 7 TestEmbeddedEpic
20 8 TestEmbeddedEpicConcurrent
20 9 TestEmbeddedExport
20 10 TestEmbeddedExportConcurrent
20 11 TestEmbeddedFederation
20 12 TestEmbeddedFederationConcurrent
20 13 TestEmbeddedFindDuplicates
20 14 TestEmbeddedFindDuplicatesConcurrent
20 15 TestEmbeddedFlatten
20 16 TestEmbeddedFlattenConcurrent
20 17 TestEmbeddedGC
20 18 TestEmbeddedGCConcurrent
20 19 TestEmbeddedGate
20 20 TestEmbeddedGateConcurrent
20 1 TestEmbeddedGateCreate
20 2 TestEmbeddedGetDependencies
20 3 TestEmbeddedGraph
20 4 TestEmbeddedGraphConcurrent
20 5 TestEmbeddedHistory
20 6 TestEmbeddedHistoryConcurrent
20 7 TestEmbeddedHooks
20 8 TestEmbeddedHooksConcurrent
20 9 TestEmbeddedHuman
20 10 TestEmbeddedHumanConcurrent
20 11 TestEmbeddedImport
20 12 TestEmbeddedImportConcurrent
20 13 TestEmbeddedInfo
20 14 TestEmbeddedInfoConcurrent
20 15 TestEmbeddedInit
20 16 TestEmbeddedInitConcurrent
20 17 TestEmbeddedKV
20 18 TestEmbeddedKVConcurrent
20 19 TestEmbeddedLabel
20 20 TestEmbeddedLabelConcurrent
20 1 TestEmbeddedLint
20 2 TestEmbeddedLintConcurrent
20 3 TestEmbeddedList
20 4 TestEmbeddedListConcurrent
20 5 TestEmbeddedMemory
20 6 TestEmbeddedMemoryConcurrent
20 7 TestEmbeddedMigrate
20 8 TestEmbeddedMigrateConcurrent
20 9 TestEmbeddedOnboard
20 10 TestEmbeddedOnboardConcurrent
20 11 TestEmbeddedOrphans
20 12 TestEmbeddedOrphansConcurrent
20 13 TestEmbeddedPrime
20 14 TestEmbeddedPrimeConcurrent
20 15 TestEmbeddedPromote
20 16 TestEmbeddedPromoteCLI
20 17 TestEmbeddedPromoteCLIConcurrent
20 18 TestEmbeddedPrune
20 19 TestEmbeddedPurge
20 20 TestEmbeddedPurgeConcurrent
20 1 TestEmbeddedQuery
20 2 TestEmbeddedQueryConcurrent
20 3 TestEmbeddedQuick
20 4 TestEmbeddedQuickConcurrent
20 5 TestEmbeddedQuickstart
20 6 TestEmbeddedQuickstartConcurrent
20 7 TestEmbeddedReady
20 8 TestEmbeddedReadyConcurrent
20 9 TestEmbeddedRenamePrefix
20 10 TestEmbeddedRenamePrefixConcurrent
20 11 TestEmbeddedReopen
20 12 TestEmbeddedReopenConcurrent
20 13 TestEmbeddedRestore
20 14 TestEmbeddedRestoreConcurrent
20 15 TestEmbeddedSearch
20 16 TestEmbeddedSearchConcurrent
20 17 TestEmbeddedSetup
20 18 TestEmbeddedSetupConcurrent
20 19 TestEmbeddedShip
20 20 TestEmbeddedShipConcurrent
20 1 TestEmbeddedShow
20 2 TestEmbeddedShowConcurrent
20 3 TestEmbeddedStale
20 4 TestEmbeddedStaleConcurrent
20 5 TestEmbeddedState
20 6 TestEmbeddedStateConcurrent
20 7 TestEmbeddedStatus
20 8 TestEmbeddedStatusConcurrent
20 9 TestEmbeddedSupersede
20 10 TestEmbeddedSupersedeConcurrent
20 11 TestEmbeddedSwarm
20 12 TestEmbeddedSwarmConcurrent
20 13 TestEmbeddedTodo
20 14 TestEmbeddedTodoConcurrent
20 15 TestEmbeddedTypes
20 16 TestEmbeddedTypesConcurrent
20 17 TestEmbeddedUndefer
20 18 TestEmbeddedUndeferConcurrent
20 19 TestEmbeddedUpdate
20 20 TestEmbeddedUpdateConcurrent
20 1 TestEmbeddedVC
20 2 TestEmbeddedVCConcurrent
20 3 TestEmbeddedVersion
20 4 TestEmbeddedVersionConcurrent
20 5 TestEmbeddedWhere
20 6 TestEmbeddedWhereConcurrent

View file

@ -140,17 +140,13 @@ 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 \
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=gms_pure_go -v -race -count=1 -timeout 20m \
exec go test -tags=gms_pure_go -v -race -count=1 -timeout 15m \
-run "$RUN_REGEX" \
"$@" \
./internal/storage/embeddeddolt/

View file

@ -15,27 +15,10 @@
# 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
@ -90,10 +73,6 @@
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
@ -109,500 +88,3 @@
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

@ -3,7 +3,7 @@
#
# Usage: embedded-test-shard.sh <shard_number> <total_shards>
#
# Discovers all TestEmbedded* top-level functions in cmd/bd/*_test.go.
# Discovers all TestEmbedded* top-level functions from cmd/bd/*_embedded_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
@ -33,12 +33,8 @@ 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 \
# Discover all top-level TestEmbedded* functions.
ALL_TESTS=$(grep -rh '^func TestEmbedded' cmd/bd/*_embedded_test.go \
| sed 's/func \(TestEmbedded[A-Za-z0-9_]*\).*/\1/' \
| sort -u)

View file

@ -2,287 +2,151 @@
#
# 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).
# 15-shard split, bin-packed longest-processing-time-first by
# estimated cost (bd-init count; per-init migration chains dominate).
# Regenerate with scripts/ci/gen_proxied_shard_manifest.py after adding,
# splitting, or reweighting TestProxiedServer* functions. Newly-added
# tests not listed here hash-distribute via proxied-test-shard.sh.
#
# This file is generated: notes added here are erased by the next
# regeneration. Add them to the generator or the durations file
# instead.
# `bd serve`'s two suites are listed at the shard the hash fallback was
# already giving them, so this records the assignment without reshuffling
# the other 100. TestProxiedServerServeReadParity is the CLI/HTTP read parity
# oracle — the behavioural half of the anti-drift claim — so it being IN this
# lane, and this lane being required by PR Risk's CI gate, is the thing that
# makes that claim enforced on PRs rather than asserted in a doc comment.
#
# TestProxiedServerListSortRetiresTheWalk is listed the same way, at the shard
# `cksum` was already giving it. It is the most expensive entry in the file —
# it seeds 1400 rows and walks the listing three ways — and it is here for the
# same reason as the parity oracle: it is the measurement behind the claim that
# `sort=priority` retires the client-side walk, so it has to run on PRs.
34 1 TestProxiedServerDep2
34 1 TestProxiedServerMolProgress
34 1 TestProxiedServerReadyClaimConcurrent
34 1 TestProxiedServerServeActivatesTheEventsJournal
34 1 TestProxiedServerServeRelease
15 1 TestProxiedServerCount
15 1 TestProxiedServerDelete
15 1 TestProxiedServerDoltRemoteRemove
15 1 TestProxiedServerExport
15 1 TestProxiedServerGateLifecycle
15 1 TestProxiedServerListSortRetiresTheWalk
15 1 TestProxiedServerMolCurrent
15 1 TestProxiedServerPathHelpers
15 1 TestProxiedServerTodo
15 1 TestProxiedServerUpdateConcurrentAppendNotes
34 2 TestProxiedServerDepListSingleIDWarnsOnDroppedExternalEdge
34 2 TestProxiedServerGateList
34 2 TestProxiedServerList
34 2 TestProxiedServerServeRemoveDependency
34 2 TestProxiedServerUpdateC
15 2 TestProxiedServerCountIncludeInfra
15 2 TestProxiedServerMolBurn
15 2 TestProxiedServerPing
15 2 TestProxiedServerUpdate
15 2 TestProxiedServerUpdateConcurrentClaim
15 2 TestProxiedServerUpdateIfGuards
15 2 TestProxiedServerWispGC
34 3 TestProxiedServerAutoPrune
34 3 TestProxiedServerClose2B
34 3 TestProxiedServerEventsJournalOffByDefault
34 3 TestProxiedServerIfRevisionCloseMismatchRefuses
34 3 TestProxiedServerMolLastActivity
34 3 TestProxiedServerPurgeWispsPlaneRetention
34 3 TestProxiedServerServeLifecycle
34 3 TestProxiedServerStatuses
15 3 TestProxiedServerBlocked
15 3 TestProxiedServerChildren
15 3 TestProxiedServerDeferUndefer
15 3 TestProxiedServerMolSquash
15 3 TestProxiedServerPour
15 3 TestProxiedServerPriority
15 3 TestProxiedServerUpdate2
15 3 TestProxiedServerUpdateConcurrentMetadata
34 4 TestProxiedServerMolStale
34 4 TestProxiedServerReadyConcurrent
34 4 TestProxiedServerServeRelatedIssues
34 4 TestProxiedServerServeSettingsWrites
34 4 TestProxiedServerShow2
34 4 TestServerModeServeSkipsPostRunMaintenance
15 4 TestProxiedServerCascadeParity
15 4 TestProxiedServerClose2
15 4 TestProxiedServerDeleteConcurrent
15 4 TestProxiedServerDuplicates
15 4 TestProxiedServerMolBond
15 4 TestProxiedServerQuery
15 4 TestProxiedServerUnclaimIfAssigneeParity
15 4 TestProxiedServerWispCreate
34 5 TestProxiedServerHistoryRemoteRefusalFrontDoorMatrix
34 5 TestProxiedServerInfo
34 5 TestProxiedServerNote
34 5 TestProxiedServerOutageReconnectAcceptanceMatrix
34 5 TestProxiedServerUpdate3
34 5 TestServerModeDeferAutoWake
15 5 TestProxiedServerCreate2
15 5 TestProxiedServerDepConcurrent
15 5 TestProxiedServerFindDuplicates
15 5 TestProxiedServerMolReadyGated
15 5 TestProxiedServerReadyClaimConcurrent
15 5 TestProxiedServerWispList
34 6 TestProxiedServerPing
34 6 TestProxiedServerQuick
34 6 TestProxiedServerServeReadsTheJournalItJustWrote
34 6 TestProxiedServerSwarm
34 6 TestProxiedServerUpdate2B
34 6 TestProxiedServerVersionedHistorySwitchRefusesAnUnrecordableGateTimeout
34 6 TestProxiedServerWispList
15 6 TestProxiedServerAssign
15 6 TestProxiedServerCleanDatabases
15 6 TestProxiedServerEdit
15 6 TestProxiedServerLink
15 6 TestProxiedServerPrime
15 6 TestProxiedServerReady2
15 6 TestProxiedServerReadyConcurrent
15 6 TestProxiedServerState
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
15 7 TestProxiedServerClose
15 7 TestProxiedServerCloseConcurrent
15 7 TestProxiedServerExternalCreate
15 7 TestProxiedServerHeartbeat
15 7 TestProxiedServerMolStale
15 7 TestProxiedServerReadyWisp
15 7 TestProxiedServerReclaim
15 7 TestProxiedServerRelate
34 8 TestProxiedServerClose2
34 8 TestProxiedServerDeleteWisp
34 8 TestProxiedServerExport
34 8 TestProxiedServerFindDuplicates
34 8 TestProxiedServerGateCheck
34 8 TestProxiedServerServeReadParity
15 8 TestProxiedServerCreate
15 8 TestProxiedServerGC
15 8 TestProxiedServerGateCheck
15 8 TestProxiedServerMolLastActivity
15 8 TestProxiedServerPromote
15 8 TestProxiedServerQuick
15 8 TestProxiedServerReopenConcurrent
15 8 TestProxiedServerServeClaim
15 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
15 9 TestProxiedServerBatchParity
15 9 TestProxiedServerDep2
15 9 TestProxiedServerGraph
15 9 TestProxiedServerMolProgress
15 9 TestProxiedServerPrune
15 9 TestProxiedServerSQL
15 9 TestProxiedServerStatus
34 10 TestProxiedServerContext
34 10 TestProxiedServerCreate2B
34 10 TestProxiedServerGateCheckB
34 10 TestProxiedServerServeRefusesAStreamOnADisabledJournal
34 10 TestProxiedServerTypes
34 10 TestProxiedServerUpdate2C
15 10 TestProxiedServerCompactDolt
15 10 TestProxiedServerConfigSetMany
15 10 TestProxiedServerHistory
15 10 TestProxiedServerLabel
15 10 TestProxiedServerList
15 10 TestProxiedServerSQLDatabaseFlag
15 10 TestProxiedServerSwarm
15 10 TestProxiedServerUpdateWisp
34 11 TestProxiedServerBatchParity
34 11 TestProxiedServerCompactHistory
34 11 TestProxiedServerPour
34 11 TestProxiedServerQuery
34 11 TestProxiedServerReady
34 11 TestProxiedServerServeAddDependencies
15 11 TestProxiedServerCompactHistory
15 11 TestProxiedServerDeleteWisp
15 11 TestProxiedServerEpic
15 11 TestProxiedServerHuman
15 11 TestProxiedServerInfo
15 11 TestProxiedServerMolDistill
15 11 TestProxiedServerReady
15 11 TestProxiedServerSetState
34 12 TestProxiedServerBlocked
34 12 TestProxiedServerChildren
34 12 TestProxiedServerCleanDatabases
34 12 TestProxiedServerReadyB
34 12 TestProxiedServerReadyWisp
34 12 TestProxiedServerReclaim
34 12 TestProxiedServerShowCommentsTail
34 12 TestProxiedServerUnclaim
15 12 TestProxiedServerDep
15 12 TestProxiedServerLint
15 12 TestProxiedServerServeLifecycle
15 12 TestProxiedServerServeModeGate
15 12 TestProxiedServerShow3
15 12 TestProxiedServerStale
15 12 TestProxiedServerTag
34 13 TestProxiedServerCompactDolt
34 13 TestProxiedServerCreate2
34 13 TestProxiedServerGraph
34 13 TestProxiedServerHistoryRemoteSupportedDirectParity
34 13 TestProxiedServerMolSquash
34 13 TestProxiedServerPromote
34 13 TestProxiedServerServeRefusesAStaleCheckpointWithGone
15 13 TestProxiedServerConfig
15 13 TestProxiedServerConfigConcurrent
15 13 TestProxiedServerGateList
15 13 TestProxiedServerMemory
15 13 TestProxiedServerMultiStatementSQL
15 13 TestProxiedServerReopen
15 13 TestProxiedServerStatuses
34 14 TestProxiedServerAssign
34 14 TestProxiedServerCloseB
34 14 TestProxiedServerDuplicates
34 14 TestProxiedServerHeartbeat
34 14 TestProxiedServerIfRevisionCloseReplaysMoleculeAutoClose
34 14 TestProxiedServerInitIfMissing
34 14 TestProxiedServerMolReadyGated
15 14 TestProxiedServerComment
15 14 TestProxiedServerContext
15 14 TestProxiedServerKV
15 14 TestProxiedServerNote
15 14 TestProxiedServerSearch
15 14 TestProxiedServerShow
15 14 TestProxiedServerTypes
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
15 15 TestProxiedServerMolShow
15 15 TestProxiedServerOrphans
15 15 TestProxiedServerRecomputeBlocked
15 15 TestProxiedServerShow2
15 15 TestProxiedServerUnclaim
15 15 TestProxiedServerUpdate3
15 15 TestProxiedServerUpdateHooks

View file

@ -3,24 +3,13 @@
#
# 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).
# Discovers all TestProxiedServer* top-level functions across cmd/bd/*_test.go
# (the proxied integration suites plus TestProxiedServerExternalCreate and the
# TestProxiedServerPathHelpers unit test, matching the lane's historical
# `-run '^TestProxiedServer'`). 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)
@ -47,17 +36,16 @@ 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/' \
# Discover all top-level TestProxiedServer* functions across every cmd/bd test
# file (integration suites live in *_proxied_integration_test.go, but
# TestProxiedServerExternalCreate and TestProxiedServerPathHelpers do not, so
# match by name rather than by file glob).
ALL_TESTS=$(grep -rh '^func TestProxiedServer' cmd/bd/*_test.go \
| sed 's/func \(TestProxiedServer[A-Za-z0-9_]*\).*/\1/' \
| sort -u)
if [ -z "$ALL_TESTS" ]; then
echo "No TestProxiedServer*/TestServerMode* functions found" >&2
echo "No TestProxiedServer* functions found" >&2
exit 1
fi
@ -74,7 +62,7 @@ if [ -f "$MANIFEST" ]; then
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
if [ -n "${extra:-}" ] || ! [[ "$manifest_total" =~ ^[0-9]+$ ]] || ! [[ "$manifest_shard" =~ ^[0-9]+$ ]] || ! [[ "$test_name" =~ ^TestProxiedServer[A-Za-z0-9_]+$ ]]; then
echo "Invalid shard manifest line: $line" >&2
exit 1
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

@ -2,10 +2,13 @@
#
# 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
# Unlike the embedded manifest, per-test timing is known for the tests
# pinned below (see be-extn's investigation of CI job 95616282508):
# TestCloudAuthCLIRouting alone costs ~9.5 minutes -- its 16 subtests each
# call openCloudAuthTestStore, which does CREATE DATABASE + the full
# migration chain + dolt init + dolt remote add + DROP DATABASE, and the
# test uses t.Setenv so it can never run t.Parallel. It is pinned alone on
# shard 1 so no other test shares its runtime. The remaining pins below
# (TestCloudAuthCLIRoutingStructural, TestCreateGuard_* (9 tests),
# TestFederationPeerCredentialLifecycleLazyKeyInit,
# TestConcurrentWorkQueueDrain, TestHighContentionStress,

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

File diff suppressed because it is too large Load diff

766
.github/workflows/ci-measurements.yml vendored Normal file
View file

@ -0,0 +1,766 @@
name: CI Measurements
on:
workflow_call:
inputs:
suite:
description: "Suite to measure"
required: true
type: string
smoke_version:
description: "Optional previous release for cross-version-smoke"
required: false
type: string
default: ""
workflow_dispatch:
inputs:
suite:
description: "Suite to measure"
required: true
type: choice
default: pr-linux
options:
- pr-linux
- macos-short
- macos-candidates
- linux-integration
- linux-integration-sharded
- linux-integration-hybrid-sharded
- linux-integration-hybrid-16-sharded
- linux-integration-hybrid-prebuilt-sharded
- linux-integration-coverage
- cross-version-smoke
- nix
- mcp-package
- npm-package
smoke_version:
description: "Optional previous release for cross-version-smoke"
required: false
default: ""
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.suite }}
cancel-in-progress: false
env:
BD_DISABLE_METRICS: "1"
BD_DISABLE_EVENT_FLUSH: "1"
jobs:
pr-linux:
name: Measure PR Linux commands
if: ${{ inputs.suite == 'pr-linux' }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure commands
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
source ./.buildflags
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
ci_time "install golangci-lint" -- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1
status=0
ci_time "pr-policy wrapper" -- make ci-pr-policy || status=$?
# -timeout=30m keeps this in step with the lane it measures
# (scripts/ci/pr-core.sh). Without it ./cmd/bd can die on `go test`'s
# 10m default and the measurement reports a panic instead of a duration.
ci_time "pr-core gotestsum" -- gotestsum --junitfile artifacts/pr-core-junit.xml --format testdox -- -race -short -timeout=30m -skip '^TestEmbedded' ./... || status=$?
ci_time "pr-lint wrapper" -- make ci-pr-lint || status=$?
exit "$status"
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-pr-linux
path: artifacts/
retention-days: 7
if-no-files-found: ignore
macos-short:
name: Measure macOS short Go tests
if: ${{ inputs.suite == 'macos-short' }}
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure commands
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
source ./.buildflags
# -timeout=30m matches the macOS lanes this measures (pr.yml, main.yml).
# This is the job that produced the ./cmd/bd duration distribution, and
# at 10m it clips its own longest samples into timeout panics.
ci_time "macos short go test" -- go test -v -race -short -timeout=30m -skip '^TestEmbedded' ./...
macos-candidates:
name: Measure macOS no-short candidates
if: ${{ inputs.suite == 'macos-candidates' }}
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure commands
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
status=0
ci_time "macos no-short go test" -- go test -tags=gms_pure_go -v -race -timeout=30m -skip '^TestEmbedded' ./... || status=$?
ci_time "macos integration go test" -- go test -tags=integration,gms_pure_go -v -race -timeout=30m -skip '^TestEmbedded' ./... || status=$?
exit "$status"
linux-integration:
name: Measure Linux integration tests
if: ${{ inputs.suite == 'linux-integration' }}
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure commands
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
ci_time "linux integration go test" -- env BEADS_TEST_SKIP=dolt gotestsum --junitfile artifacts/linux-integration-junit.xml --format testdox -- -v -race -tags=integration,gms_pure_go -timeout=30m ./...
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-sharded:
name: Measure Linux integration shard ${{ matrix.shard }}/6
if: ${{ inputs.suite == 'linux-integration-sharded' }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure shard
env:
SHARD: ${{ matrix.shard }}
TOTAL_SHARDS: 6
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
mapfile -t packages < <(
GO_TEST_SHARD_TAGS=integration,gms_pure_go \
scripts/ci/go-test-shard-packages.sh "$SHARD" "$TOTAL_SHARDS"
)
package_manifest="artifacts/linux-integration-packages-${SHARD}-of-${TOTAL_SHARDS}.txt"
printf '%s\n' "${packages[@]}" | tee "$package_manifest"
if [[ "${#packages[@]}" -eq 0 ]]; then
echo "No packages assigned to shard ${SHARD}/${TOTAL_SHARDS}; skipping go test"
exit 0
fi
ci_time "linux integration shard ${SHARD}/${TOTAL_SHARDS} go test" -- \
env BEADS_TEST_SKIP=dolt gotestsum \
--junitfile "artifacts/linux-integration-shard-${SHARD}-of-${TOTAL_SHARDS}.xml" \
--format testdox \
-- -v -race -tags=integration,gms_pure_go -timeout=30m "${packages[@]}"
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-shard-${{ matrix.shard }}-of-6
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-hybrid-packages:
name: Measure Linux integration package shard ${{ matrix.shard }}/6 (no cmd/bd)
if: ${{ inputs.suite == 'linux-integration-hybrid-sharded' || inputs.suite == 'linux-integration-hybrid-16-sharded' || inputs.suite == 'linux-integration-hybrid-prebuilt-sharded' }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure shard
env:
SHARD: ${{ matrix.shard }}
TOTAL_SHARDS: 6
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
package_manifest="artifacts/linux-integration-hybrid-packages-${SHARD}-of-${TOTAL_SHARDS}.txt"
write_package_manifest() {
GO_TEST_SHARD_TAGS=integration,gms_pure_go \
GO_TEST_SHARD_EXCLUDE_REGEX="^github.com/steveyegge/beads/cmd/bd$" \
scripts/ci/go-test-shard-packages.sh "$SHARD" "$TOTAL_SHARDS" > "$package_manifest"
}
ci_time "list integration package shard ${SHARD}/${TOTAL_SHARDS}" -- write_package_manifest
cat "$package_manifest"
mapfile -t packages < "$package_manifest"
if [[ "${#packages[@]}" -eq 0 ]]; then
echo "No packages assigned to shard ${SHARD}/${TOTAL_SHARDS}; skipping go test"
exit 0
fi
ci_time "linux integration package shard ${SHARD}/${TOTAL_SHARDS} go test" -- \
env BEADS_TEST_SKIP=dolt gotestsum \
--junitfile "artifacts/linux-integration-hybrid-packages-${SHARD}-of-${TOTAL_SHARDS}.xml" \
--format testdox \
-- -v -race -tags=integration,gms_pure_go -timeout=30m "${packages[@]}"
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-hybrid-packages-${{ matrix.shard }}-of-6
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-hybrid-cmd-bd:
name: Measure Linux integration cmd/bd shard ${{ matrix.shard }}/8
if: ${{ inputs.suite == 'linux-integration-hybrid-sharded' }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure shard
env:
SHARD: ${{ matrix.shard }}
TOTAL_SHARDS: 8
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
test_manifest="artifacts/linux-integration-cmd-bd-tests-${SHARD}-of-${TOTAL_SHARDS}.txt"
write_test_manifest() {
GO_TEST_SHARD_TAGS=integration,gms_pure_go \
scripts/ci/go-test-shard-names.sh "$SHARD" "$TOTAL_SHARDS" ./cmd/bd > "$test_manifest"
}
ci_time "list cmd/bd test shard ${SHARD}/${TOTAL_SHARDS}" -- write_test_manifest
cat "$test_manifest"
mapfile -t tests < "$test_manifest"
if [[ "${#tests[@]}" -eq 0 ]]; then
echo "No tests assigned to shard ${SHARD}/${TOTAL_SHARDS}; skipping go test"
exit 0
fi
run_regex="^($(IFS='|'; echo "${tests[*]}"))$"
ci_time "linux integration cmd/bd shard ${SHARD}/${TOTAL_SHARDS} go test" -- \
env BEADS_TEST_SKIP=dolt gotestsum \
--junitfile "artifacts/linux-integration-cmd-bd-${SHARD}-of-${TOTAL_SHARDS}.xml" \
--format testdox \
-- -v -race -tags=integration,gms_pure_go -timeout=30m -run "$run_regex" ./cmd/bd
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-cmd-bd-${{ matrix.shard }}-of-8
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-hybrid-16-cmd-bd:
name: Measure Linux integration cmd/bd shard ${{ matrix.shard }}/16
if: ${{ inputs.suite == 'linux-integration-hybrid-16-sharded' }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure shard
env:
SHARD: ${{ matrix.shard }}
TOTAL_SHARDS: 16
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
test_manifest="artifacts/linux-integration-cmd-bd-tests-${SHARD}-of-${TOTAL_SHARDS}.txt"
write_test_manifest() {
GO_TEST_SHARD_TAGS=integration,gms_pure_go \
scripts/ci/go-test-shard-names.sh "$SHARD" "$TOTAL_SHARDS" ./cmd/bd > "$test_manifest"
}
ci_time "list cmd/bd test shard ${SHARD}/${TOTAL_SHARDS}" -- write_test_manifest
cat "$test_manifest"
mapfile -t tests < "$test_manifest"
if [[ "${#tests[@]}" -eq 0 ]]; then
echo "No tests assigned to shard ${SHARD}/${TOTAL_SHARDS}; skipping go test"
exit 0
fi
run_regex="^($(IFS='|'; echo "${tests[*]}"))$"
ci_time "linux integration cmd/bd shard ${SHARD}/${TOTAL_SHARDS} go test" -- \
env BEADS_TEST_SKIP=dolt gotestsum \
--junitfile "artifacts/linux-integration-cmd-bd-${SHARD}-of-${TOTAL_SHARDS}.xml" \
--format testdox \
-- -v -race -tags=integration,gms_pure_go -timeout=30m -run "$run_regex" ./cmd/bd
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-cmd-bd-${{ matrix.shard }}-of-16
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-hybrid-prebuilt-bd:
name: Measure Linux integration prebuild cmd/bd binary
if: ${{ inputs.suite == 'linux-integration-hybrid-prebuilt-sharded' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Measure build
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
source ./.buildflags
ci_time "build cmd/bd subprocess binary" -- go build -tags "$BEADS_BUILD_TAGS" -o artifacts/bd ./cmd/bd
- name: Upload prebuilt bd
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-prebuilt-bd
path: artifacts/bd
retention-days: 7
if-no-files-found: error
linux-integration-hybrid-prebuilt-cmd-bd:
name: Measure Linux integration prebuilt cmd/bd shard ${{ matrix.shard }}/8
if: ${{ inputs.suite == 'linux-integration-hybrid-prebuilt-sharded' }}
needs: linux-integration-hybrid-prebuilt-bd
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Download prebuilt bd
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ci-measure-linux-integration-prebuilt-bd
path: prebuilt-bd
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure shard
env:
SHARD: ${{ matrix.shard }}
TOTAL_SHARDS: 8
BEADS_TEST_BD_BINARY: ${{ github.workspace }}/prebuilt-bd/bd
run: |
set -euo pipefail
mkdir -p artifacts
chmod +x "$BEADS_TEST_BD_BINARY"
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
test_manifest="artifacts/linux-integration-cmd-bd-tests-${SHARD}-of-${TOTAL_SHARDS}.txt"
write_test_manifest() {
GO_TEST_SHARD_TAGS=integration,gms_pure_go \
scripts/ci/go-test-shard-names.sh "$SHARD" "$TOTAL_SHARDS" ./cmd/bd > "$test_manifest"
}
ci_time "list cmd/bd test shard ${SHARD}/${TOTAL_SHARDS}" -- write_test_manifest
cat "$test_manifest"
mapfile -t tests < "$test_manifest"
if [[ "${#tests[@]}" -eq 0 ]]; then
echo "No tests assigned to shard ${SHARD}/${TOTAL_SHARDS}; skipping go test"
exit 0
fi
run_regex="^($(IFS='|'; echo "${tests[*]}"))$"
ci_time "linux integration prebuilt cmd/bd shard ${SHARD}/${TOTAL_SHARDS} go test" -- \
env BEADS_TEST_SKIP=dolt gotestsum \
--junitfile "artifacts/linux-integration-prebuilt-cmd-bd-${SHARD}-of-${TOTAL_SHARDS}.xml" \
--format testdox \
-- -v -race -tags=integration,gms_pure_go -timeout=30m -run "$run_regex" ./cmd/bd
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-prebuilt-cmd-bd-${{ matrix.shard }}-of-8
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-coverage:
name: Measure Linux integration coverage
if: ${{ inputs.suite == 'linux-integration-coverage' }}
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure commands
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
status=0
ci_time "linux integration coverage go test" -- env BEADS_TEST_SKIP=dolt gotestsum --junitfile artifacts/linux-integration-coverage-junit.xml --format testdox -- -v -race -tags=integration,gms_pure_go -coverprofile=artifacts/coverage.out -timeout=30m ./... || status=$?
if [[ -f artifacts/coverage.out ]]; then
ci_time "coverage summary" -- go tool cover -func=artifacts/coverage.out || status=$?
else
echo "coverage.out was not generated; skipping coverage summary"
fi
exit "$status"
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-coverage
path: artifacts/
retention-days: 7
if-no-files-found: ignore
cross-version-smoke:
name: Measure cross-version smoke
if: ${{ inputs.suite == 'cross-version-smoke' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Cache previous release binaries
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ~/.cache/beads-regression
key: smoke-binaries-measure-${{ runner.os }}
- name: Measure commands
env:
GH_TOKEN: ${{ github.token }}
SMOKE_VERSION: ${{ inputs.smoke_version }}
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
source ./.buildflags
ci_time "build candidate binary" -- go build -o /tmp/bd-candidate ./cmd/bd
export CANDIDATE_BIN=/tmp/bd-candidate
if [[ -z "$SMOKE_VERSION" ]]; then
SMOKE_VERSION="$(gh release list --repo "$GITHUB_REPOSITORY" --limit 1 --json tagName --jq '.[0].tagName')"
fi
if [[ -z "$SMOKE_VERSION" ]]; then
echo "Could not resolve a previous release tag for cross-version smoke"
exit 1
fi
ci_time "upgrade smoke ${SMOKE_VERSION}" -- ./scripts/upgrade-smoke-test.sh "$SMOKE_VERSION"
nix:
name: Measure nix build
if: ${{ inputs.suite == 'nix' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Install Nix
uses: DeterminateSystems/determinate-nix-action@61cbfe2efc2d4e7a8a6d56967c3c1058e846c858 # v3
- name: Measure commands
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
ci_time "nix build .#default" -- nix build .#default --print-build-logs
mcp-package:
name: Measure MCP package checks
if: ${{ inputs.suite == 'mcp-package' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.14'
- name: Measure commands
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
ci_time "install uv" -- pip install uv==0.11.16
ci_time "mcp package gate" -- make ci-package-mcp
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-mcp-package
path: integrations/beads-mcp/dist/
retention-days: 7
if-no-files-found: ignore
npm-package:
name: Measure npm package checks
if: ${{ inputs.suite == 'npm-package' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
with:
node-version: '24'
- name: Measure commands
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
ci_time "npm package gate" -- make ci-package-npm
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-npm-package
path: artifacts/
retention-days: 7
if-no-files-found: ignore

View file

@ -1,99 +0,0 @@
name: Close stale needs-info / needs-repro issues
on:
schedule:
- cron: '37 9 * * *'
workflow_dispatch:
permissions: {}
jobs:
close-needs-info:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Close stale needs-info issues (14 days)
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
const labels = ['status/needs-info', 'status/needs-repro'];
const days = 14;
const cutoff = new Date(Date.now() - days * 24 * 60 * 60 * 1000);
for (const label of labels) {
const issues = await github.paginate(github.rest.issues.listForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
labels: label,
per_page: 100,
});
for (const issue of issues) {
if (issue.pull_request) continue;
const events = await github.paginate(github.rest.issues.listEvents, {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
per_page: 100,
});
const labelEvents = events
.filter(e => e.event === 'labeled' && e.label?.name === label);
if (labelEvents.length === 0) continue;
const labeledAt = new Date(Math.max(
...labelEvents.map(e => new Date(e.created_at).getTime())
));
const comments = await github.paginate(github.rest.issues.listComments, {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
since: labeledAt.toISOString(),
per_page: 100,
});
const visibleRequest = comments.find(c => {
if (c.user?.login === issue.user?.login) return false;
const lower = (c.body || '').toLowerCase();
if (lower.includes('closing')) return false;
if (!/14\s*-?\s*days?/.test(lower)) return false;
if (!lower.includes('reply') && !lower.includes('respond')) return false;
if (label === 'status/needs-repro') return lower.includes('repro') || lower.includes('reproduction');
return lower.includes('info') || lower.includes('information') || lower.includes('details');
});
if (!visibleRequest) {
console.log(`No visible request for #${issue.number} (${label}), skipping.`);
continue;
}
const requestAt = new Date(visibleRequest.created_at);
if (requestAt > cutoff) continue;
const authorReplied = comments.some(c =>
c.user?.login === issue.user?.login &&
new Date(c.created_at) > requestAt
);
if (authorReplied) continue;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: `Closing — this was marked \`${label}\` and a response was requested 14 or more days ago with no reply.\n\nIf this is still relevant, please reply with the requested details and we'll reopen.`,
});
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed',
state_reason: 'not_planned',
});
console.log(`Closed #${issue.number} (${label}, requested ${requestAt.toISOString()})`);
}
}

33
.github/workflows/conformance.yml vendored Normal file
View file

@ -0,0 +1,33 @@
name: Conformance
# Runs the same two-tier storage conformance suite developers run locally:
# the in-process store corpus and the real-binary CLI harness.
on:
pull_request:
branches: [ main, 'release/**', 'hotfix/**' ]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
BD_DISABLE_METRICS: "1"
BD_DISABLE_EVENT_FLUSH: "1"
jobs:
conformance:
name: Storage backend conformance (embedded Dolt oracle)
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Run conformance (embedded Dolt oracle)
run: ./scripts/conformance.sh

View file

@ -0,0 +1,90 @@
name: Cross-Version Smoke Tests
on:
# On tag push (release gate): test the last 30 releases for broad regression coverage
push:
tags:
- 'v*'
# On PR to main or a release branch: test only the last 5 releases for fast
# feedback. Release-targeted PRs are exactly the ones where cross-version
# upgrade breakage is most expensive to discover at tag time.
pull_request:
branches: [ main, 'release/**', 'hotfix/**' ]
# Allow manual trigger with custom version count
workflow_dispatch:
inputs:
version_count:
description: 'Number of previous releases to test against'
required: false
default: '5'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
BD_DISABLE_METRICS: "1"
BD_DISABLE_EVENT_FLUSH: "1"
jobs:
smoke:
name: Upgrade smoke (${{ matrix.prev_version }} → candidate)
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
prev_version: ${{ fromJson(needs.versions.outputs.matrix) }}
needs: versions
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Cache previous release binaries
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ~/.cache/beads-regression
key: smoke-binaries-${{ matrix.prev_version }}-${{ runner.os }}
- name: Build candidate binary
run: go build -tags gms_pure_go -o /tmp/bd-candidate ./cmd/bd
- name: Run upgrade smoke tests
env:
CANDIDATE_BIN: /tmp/bd-candidate
run: ./scripts/upgrade-smoke-test.sh ${{ matrix.prev_version }}
versions:
name: Resolve versions to test
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.resolve.outputs.matrix }}
steps:
- name: Resolve release versions
id: resolve
env:
GH_TOKEN: ${{ github.token }}
# Tag push and manual dispatch test more versions; PRs test fewer for speed
VERSION_COUNT: ${{ (github.event_name == 'push' && '30') || (github.event_name == 'workflow_dispatch' && inputs.version_count) || '5' }}
run: |
VERSIONS=$(gh release list \
--repo gastownhall/beads \
--limit "$VERSION_COUNT" \
--json tagName \
--jq '[.[].tagName]')
echo "matrix=$VERSIONS" >> "$GITHUB_OUTPUT"
echo "Testing versions: $VERSIONS"

View file

@ -11,27 +11,16 @@
# never checks out or executes PR code. It checks out the base default branch
# for scripts, and treats the artifact strictly as data: every path in the
# patch must match an anchored generated-docs allowlist (single path segment,
# no traversal), mode/symlink/rename/copy/binary hunks are refused, and the
# patch is applied to an index in a bare clone and re-checked once staged
# (scripts/docs-autofix-push.sh), so a hostile patch can at most rewrite
# generated doc files 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.
#
# CONCURRENCY: job-level, shared with bazel-autofix.yml per head branch and
# without cancel-in-progress, so the two bots queue instead of racing on one
# branch (see bazel-autofix.yml).
# no traversal, no symlink modes) and `git apply --index` supplies the
# underlying escape guards (scripts/docs-autofix-push.sh), so a hostile patch
# can at most rewrite generated doc files on its own PR branch.
#
# 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.
# checks. Configure a DOCS_AUTOFIX_TOKEN repo secret (fine-grained PAT or
# GitHub App token with contents:write on this repo) for fully hands-off
# operation on same-repo PRs; without it the pushed fix still lands but
# checks need a manual re-run. Fork PRs always get the apply-recipe comment -
# no token we hold can push to a fork.
name: Docs Autofix
@ -45,6 +34,10 @@ permissions:
pull-requests: write
actions: read
concurrency:
group: docs-autofix-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
jobs:
autofix:
name: Apply CLI docs regeneration to PR
@ -52,22 +45,9 @@ jobs:
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'failure'
runs-on: ubuntu-latest
# Bounded: a hung run would hold the shared group for the default 6h.
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 bazel-autofix.yml; queue, never cancel.
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.
# Trusted side only: base repo default branch, never the PR head.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
persist-credentials: false
- name: Download docs freshness patch (if any)
id: patch
@ -83,40 +63,11 @@ jobs:
echo "found=false" >> "$GITHUB_OUTPUT"
exit 0
fi
dir="${RUNNER_TEMP}/docs-patch"
mkdir -p "$dir"
gh api "repos/${GITHUB_REPOSITORY}/actions/artifacts/${artifact_id}/zip" > "${RUNNER_TEMP}/docs-patch.zip"
# Extract only the expected name, and only as a regular file.
unzip -o "${RUNNER_TEMP}/docs-patch.zip" cli-docs-freshness.patch -d "$dir" || true
ls -la "$dir"
f="$dir/cli-docs-freshness.patch"
if [ -L "$f" ] || { [ -e "$f" ] && [ ! -f "$f" ]; }; then
echo "::error::artifact entry cli-docs-freshness.patch is not a regular file"
exit 1
fi
if [ ! -f "$f" ]; then
echo "Artifact has no cli-docs-freshness.patch; nothing to do."
echo "found=false" >> "$GITHUB_OUTPUT"
exit 0
fi
gh api "repos/${GITHUB_REPOSITORY}/actions/artifacts/${artifact_id}/zip" > patch.zip
unzip -o patch.zip -d "${RUNNER_TEMP}/docs-patch"
ls -la "${RUNNER_TEMP}/docs-patch"
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 regen commit or leave apply recipe
if: steps.patch.outputs.found == 'true'
env:
@ -129,9 +80,9 @@ jobs:
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
# optional PAT 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' }}
PUSH_TOKEN: ${{ secrets.DOCS_AUTOFIX_TOKEN || github.token }}
AUTOFIX_TOKEN_KIND: ${{ secrets.DOCS_AUTOFIX_TOKEN && 'pat' || 'default' }}
run: ./scripts/docs-autofix-push.sh

View file

@ -3,15 +3,22 @@ name: Docs (Mintlify) checks
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# The Mintlify site and the check itself. The docsync guard (docs nav,
# links and agent-instruction routing over docs/, engdocs/ and the root
# markdown) is //test/docsync:docsync_test, which bazel.yml's --config=ci
# lane runs on every PR; this workflow keeps only Mintlify's own
# broken-link check, which needs the network (npx mint) and the base
# branch's history.
paths:
# The docsync guard also validates engdocs/** and the curated root
# markdown files (rootDocFiles in test/docsync/docsync_test.go) — keep
# this filter in sync with that list, or a docs-breaking PR merges
# green and turns main red at the full test run.
- 'docs/**'
- 'engdocs/**'
- 'test/docsync/**'
- 'mint.sh'
- 'README.md'
- 'AGENTS.md'
- 'AGENT_INSTRUCTIONS.md'
- 'CONTRIBUTING.md'
- 'CLAUDE.md'
- 'RELEASING.md'
- 'PR_MAINTAINER_GUIDELINES.md'
- '.github/scripts/docs-render-check.sh'
- '.github/workflows/docs-mintlify.yml'
@ -23,10 +30,24 @@ concurrency:
cancel-in-progress: true
jobs:
docsync:
name: Docs nav/link sync (docsync guard)
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Run docsync guard
run: go test -tags=gms_pure_go ./test/docsync
broken-links:
name: Mintlify broken-links (baseline-aware)
runs-on: ${{ (github.event_name == 'merge_group' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
timeout-minutes: 10
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6

File diff suppressed because it is too large Load diff

150
.github/workflows/migration-test.yml vendored Normal file
View file

@ -0,0 +1,150 @@
name: Migration Test Harness
on:
pull_request:
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'website/**'
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: read
env:
BD_DISABLE_METRICS: "1"
BD_DISABLE_EVENT_FLUSH: "1"
DOLT_TEST_RUNTIME_VERSION: v2.1.8
DOLT_TEST_RUNTIME_SHA256: f66318f08ed66e409fc39363ae0fff8ce6fbf6dba9f5bac632b91527b9632a74
jobs:
historical-upgrades:
name: Historical ${{ matrix.version }} → candidate
# v0.55.4 is dynamically linked against the ICU version shipped here.
# Pin the image so a runner alias update cannot invalidate the fixture.
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- version: v0.9.1
cache-identity: v0.9.1-source-e3c8554fa2c3e4b9caf7e296e9c8abbe24211a72-go1.25.0-cgo1
- version: v0.17.0
cache-identity: v0.17.0-d4d08617a324c85b45c9628bc519d659a9ff9c7c37da67aa48727e0af7f19a75
- version: v0.49.6
cache-identity: v0.49.6-8546dc9a47e11dc31ac2bc9a0224a9c690975e91850932cbb62623053fbb7db8
- version: v0.50.3
cache-identity: v0.50.3-e94b09e0b6a9324bbc0e81ea36bccaaa42172a926bfedfb389e9a26dedb63184
- version: v0.55.4
cache-identity: v0.55.4-e0fa25456dd82890230eef17653448a0bf995104c78864be91c5ed84426a5f49
- version: v0.56.1
cache-identity: v0.56.1-4f9f6cc44465a11613ff529009901eaaf841c6b1f91c15e002b0ecda2015a15c
- version: v0.57.0
cache-identity: v0.57.0-f8629d5627bed7d25f06f92334addc171d679f9aed9d08c5d42a9684205dc04b
- version: v0.62.0
cache-identity: v0.62.0-4cca7265b22e5c3ca8d62ab0b9752bec31f68b7f5fa636282a4c7e5454c35535
- version: v0.63.3
cache-identity: v0.63.3-5f4efd2e010209b3f381dbcd783b2a3a652f50ea72f40ef04c8ba434d408bf9e
- version: v1.0.0
cache-identity: v1.0.0-7057db1e92428fcf5c08d5dc6b07ead57e588b262cba78b9a26893d55bd29fdb
- version: v1.0.1
cache-identity: v1.0.1-1d2364d5d7083a4634a9e734ca87822fb79c2b6625988f9f791e3376313b1b77
- version: v1.1.0
cache-identity: v1.1.0-b0f3dd607c3fb989ee08d0a6854fba80d0402971eb108f9af6170bc14d491a34
- version: v1.1.2
cache-identity: v1.1.2-a72d71ed374955dc9f83a0f90b54bd7b6a0016709dd1676ae2e368651ed401c2
# The v1.1.2 tree re-tagged by the recovery release, so it adds no new
# storage regime — but it is the tag field upgrades actually start
# from, and it was never in this corpus.
- version: v1.2.2
cache-identity: v1.2.2-8140098a51d3b81d5548d1c5e6db1a2d9930e5d141efe2a4bff7d079c4d321e8
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install test dependencies
# Backstop for a hang that escapes the inner `timeout` calls, so it has
# to sit ABOVE what those calls can legitimately consume: 3 update
# attempts x 120s + 2 backoffs x 10s + 180s install = 560s worst case.
# 11m leaves ~100s of headroom and stays under the job's 15m budget, so
# a stuck step fails as a step instead of cancelling the whole job.
timeout-minutes: 11
run: |
updated=""
for attempt in 1 2 3; do
if sudo timeout 120 apt-get \
-o Acquire::Retries=3 \
-o Acquire::http::Timeout=30 \
-o Acquire::https::Timeout=30 \
update; then
updated=yes
break
fi
echo "::warning::apt-get update attempt $attempt failed or timed out"
# No backoff after the final attempt - there is nothing left to wait for.
if [ "$attempt" -lt 3 ]; then
sleep 10
fi
done
# Deliberate best-effort: a stale index still installs these packages
# from the runner image cache far more often than not, and failing the
# job here would turn a transient mirror outage into a red build. The
# warning is what makes the degraded path visible in the job log.
if [ -z "$updated" ]; then
echo "::warning::apt-get update failed after 3 attempts; proceeding with cached index"
fi
sudo timeout 180 apt-get install -y jq libicu74
- name: Install Dolt test runtime
# v0.55.4-v0.62.0 host their fixture on this server; v1.0.1-v1.1.2 use
# the same pinned binary as a read-only oracle over the wisp plane,
# which has no `bd dolt sql` equivalent.
if: contains(fromJSON('["v0.55.4","v0.56.1","v0.57.0","v0.62.0","v1.0.1","v1.1.0","v1.1.2","v1.2.2"]'), matrix.version)
run: |
archive="$RUNNER_TEMP/dolt-linux-amd64.tar.gz"
runtime="$RUNNER_TEMP/dolt-runtime"
install_root="$GITHUB_WORKSPACE/.tools/dolt"
curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 \
"https://github.com/dolthub/dolt/releases/download/${DOLT_TEST_RUNTIME_VERSION}/dolt-linux-amd64.tar.gz" \
-o "$archive"
echo "${DOLT_TEST_RUNTIME_SHA256} $archive" | sha256sum -c -
mkdir -p "$runtime" "$install_root/bin"
tar -xzf "$archive" -C "$runtime"
install -m 0755 "$runtime/dolt-linux-amd64/bin/dolt" "$install_root/bin/dolt"
"$install_root/bin/dolt" version
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Cache pinned historical release
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/beads-regression
key: historical-dolt-${{ matrix.cache-identity }}-${{ runner.os }}-${{ runner.arch }}
- name: Build candidate
run: make build
- name: Set up Go 1.25 for v0.9.1 source build
if: matrix.version == 'v0.9.1'
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: '1.25.0'
- name: Verify explicit historical upgrade
env:
CANDIDATE_BIN: ./bd
GIT_CONFIG_NOSYSTEM: "1"
DOLT_BIN: ${{ github.workspace }}/.tools/dolt/bin/dolt
HISTORICAL_VERSION: ${{ matrix.version }}
run: |
./scripts/migration-test/run.sh --version "$HISTORICAL_VERSION"

View file

@ -1,91 +1,104 @@
name: Nightly
name: Nightly Full Tests
# Every nightly test runs under Bazel on rbe-west: the `bazel` call below is
# the full suite with no cached test results. Nothing here runs go test on a
# runner (ga-96smfk.22).
on:
schedule:
# Run at 2am UTC daily
- cron: '0 2 * * *'
workflow_dispatch:
permissions:
contents: read
inputs:
suite:
description: "Nightly suite or measurement suite"
required: true
type: choice
default: full-test
options:
- full-test
- pr-linux
- macos-short
- macos-candidates
- linux-integration
- linux-integration-sharded
- linux-integration-hybrid-sharded
- linux-integration-hybrid-16-sharded
- linux-integration-hybrid-prebuilt-sharded
- linux-integration-coverage
- cross-version-smoke
- nix
- mcp-package
- npm-package
smoke_version:
description: "Optional previous release for cross-version-smoke"
required: false
default: ""
env:
BD_DISABLE_METRICS: "1"
BD_DISABLE_EVENT_FLUSH: "1"
jobs:
# Bazel lane with the full equivalence listing (package and test-name sets;
# PRs gate on it through pr.yml). Remote execution when the repo secrets
# are present; bazel.yml gets the four RBE secrets plus rbe-prewarm's
# bazel-allocator app private key (same-repo/scheduled trigger only, so
# pre-warming is safe here - see bazel.yml's "rbe-west Pre-warm" header and
# engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md).
bazel:
name: Bazel (fresh, full detail)
# 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). rrc-verify runs here (its alert issue);
# rrc-seed never does, 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
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 }}
RBE_POOL_APP_PRIVATE_KEY: ${{ secrets.RBE_POOL_APP_PRIVATE_KEY }}
measure:
name: Measure selected CI suite
if: ${{ github.event_name == 'workflow_dispatch' && inputs.suite != 'full-test' }}
uses: ./.github/workflows/ci-measurements.yml
with:
details: true
# The one run that re-executes every test (no cached test results):
# PRs, merge groups and pushes to main reuse unchanged tests' PASSes,
# so this keeps sampling flaky and -race failures every night.
fresh-test-results: true
suite: ${{ inputs.suite }}
smoke_version: ${{ inputs.smoke_version }}
# rbe-west's pool workers are gascity's and advertise the sha256 of
# gascity's worker-env manifest; beads' tools/rbe/worker-env.txt is a
# byte-for-byte copy and platforms/BUILD.bazel carries the same pin. A copy
# that falls behind queues every remote action (bazel.yml's rbe job runs
# the same check before each remote run and fails it fast), so check every
# night and, out of step, open or update a ci/infra issue with the diff and
# the pin to commit (tools/rbe/worker-env-sync-issue). The only job here
# with issues: write, and only its last step uses the token. gascity
# unreachable (exit 2) fails the job without an issue.
rbe-worker-env-sync:
name: rbe worker-env in step with gascity
full-test:
name: Full Test Suite
if: ${{ github.event_name == 'schedule' || inputs.suite == 'full-test' }}
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
issues: write
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
persist-credentials: false
go-version-file: 'go.mod'
- name: Compare the worker-env manifest and pin with gascity's main
id: sync
env:
WORKER_ENV_SYNC_REPORT: ${{ runner.temp }}/worker-env-sync.md
- name: Install Dolt
run: |
rc=0
tools/rbe/worker-env-sync main || rc=$?
echo "rc=$rc" >> "$GITHUB_OUTPUT"
exit "$rc"
./scripts/ci/install-dolt.sh
- name: Open or update the out-of-step issue
if: ${{ failure() && steps.sync.outputs.rc == '1' }}
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Build
run: go build -v -tags gms_pure_go ./cmd/bd
- name: Full Test Suite (including integration tests)
env:
GH_TOKEN: ${{ github.token }}
REPORT: ${{ runner.temp }}/worker-env-sync.md
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: tools/rbe/worker-env-sync-issue "$REPORT" "$RUN_URL"
# Skip Docker-based Dolt testcontainer tests — they hang in
# GitHub Actions (known issue, see scripts/repro-dolt-hang/).
# Non-Docker integration tests still run via the installed dolt binary.
BEADS_TEST_SKIP: dolt
run: go test -v -race -tags=integration,gms_pure_go -coverprofile=coverage.out -timeout=30m ./...
- name: Check coverage threshold
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
echo "Coverage: $COVERAGE%"
# Threshold is lower (30%) because Docker-based Dolt integration
# tests are skipped in CI (BEADS_TEST_SKIP=dolt). With Docker
# tests included, coverage would be ~50%+.
if (( $(echo "$COVERAGE < 30" | bc -l) )); then
echo "❌ Coverage is below 30% threshold"
exit 1
elif (( $(echo "$COVERAGE < 40" | bc -l) )); then
echo "⚠️ Coverage is below 40% (warning threshold)"
else
echo "✅ Coverage meets threshold"
fi
- name: Upload coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6
if: success()
continue-on-error: true
with:
file: ./coverage.out
fail_ci_if_error: false

View file

@ -1,12 +1,15 @@
name: nix build
on:
# No pull_request trigger: pr-risk.yml's required `test-nix` job already
# runs `nix run .#default` plus `nix flake check -L` on every PR, a strict
# superset of the `nix build .#default` this workflow exercises here. This
# workflow still runs on push to main (and workflow_dispatch) so the plain
# `nix build` path itself stays covered without duplicating a PR-blocking
# job that never adds coverage pr-risk.yml doesn't already have.
pull_request:
paths:
- 'go.mod'
- 'go.sum'
- 'default.nix'
- 'flake.nix'
- 'flake.lock'
- 'overlay.nix'
- 'packages.nix'
push:
branches: [main]
paths:
@ -32,6 +35,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Install Nix
uses: DeterminateSystems/determinate-nix-action@527f17dd63d2d60d3e5552934bc84b9a33a14d11 # v3
uses: DeterminateSystems/determinate-nix-action@61cbfe2efc2d4e7a8a6d56967c3c1058e846c858 # v3
- name: Build
run: nix build .#default --print-build-logs

View file

@ -3,15 +3,7 @@ name: PR Risk
on:
pull_request:
branches: [ main, 'release/**', 'hotfix/**' ]
# Merge queue (engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md, "Merge Queue"):
# the ruleset's required gate must also report on each queue entry's
# merge-group commit, or a queued PR waits until the queue times it out.
# checks_requested is the queue asking for those checks; pinned
# explicitly (scripts/ci_merge_queue_test.go). The concurrency group
# below keys a merge group on its own gh-readonly-queue/* ref, so queue
# runs never cancel each other or a PR's own runs.
merge_group:
types: [ checks_requested ]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
@ -21,38 +13,423 @@ env:
BD_DISABLE_METRICS: "1"
BD_DISABLE_EVENT_FLUSH: "1"
# The legacy Go test tiers this workflow used to run (embedded Dolt storage,
# conformance and cmd shards; proxied-server cmd shards; server-Dolt storage
# and full suite) are pr.yml's Bazel lanes on rbe-west now: `embedded Dolt
# tier`, `proxied-server tier` (`dolt-race`, with the dolt-server lane, in
# mode remote) and `server-Dolt storage tier` (bazel.yml), which pr.yml's `CI Gate / Required` requires to have run remotely and
# passed on every pull_request and merge group, fork and Dependabot PRs
# included (ga-96smfk.22). What remains is the Nix packaging check, which no
# Bazel target can stand in for: it builds the package Nix users install.
jobs:
detect-ci-tier:
name: Detect CI tier
runs-on: ubuntu-latest
outputs:
full_embedded: ${{ steps.tier.outputs.full_embedded }}
reason: ${{ steps.tier.outputs.reason }}
shadow_embedded_cli: ${{ steps.shadow-selector.outputs.embedded_cli }}
shadow_proxied_cli: ${{ steps.shadow-selector.outputs.proxied_cli }}
shadow_embedded_storage: ${{ steps.shadow-selector.outputs.embedded_storage }}
shadow_embedded_conformance: ${{ steps.shadow-selector.outputs.embedded_conformance }}
shadow_server_conformance: ${{ steps.shadow-selector.outputs.server_conformance }}
shadow_full: ${{ steps.shadow-selector.outputs.full }}
shadow_reason: ${{ steps.shadow-selector.outputs.reason }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
fetch-depth: 0
- name: Decide embedded Dolt coverage
id: tier
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: bash .github/scripts/ci-embedded-tier.sh
- name: Shadow CI capability selector
id: shadow-selector
continue-on-error: true
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -o pipefail
selection="$(bash .github/scripts/ci-capability-selector.sh)"
printf '%s\n' "$selection"
{
echo '### Shadow CI capability selector'
printf '%s\n' "$selection" | sed 's/^/- `/' | sed 's/$/`/'
} >> "$GITHUB_STEP_SUMMARY"
# End-to-end coverage for proxied-server CLI subcommands, sharded across the
# CI matrix. Each sub-test drives the bd CLI subprocess against a real dolt
# sql-server started via testcontainers by the shared proxied harness
# (cmd/bd/*_proxied_integration_test.go).
#
# Reuses the cmd/bd test binary compiled once by build-embedded: the proxied
# tests live in the same package and are gated at runtime by
# BEADS_TEST_PROXIED_SERVER=1, so no separate build is needed. Shard
# assignment is committed in .github/scripts/proxied-cmd-test-shards.txt;
# newly-added TestProxiedServer* tests hash-distribute until listed there.
test-proxied-cmd:
name: Test (Proxied Dolt Cmd ${{ matrix.shard }}/${{ strategy.job-total }})
needs: [detect-ci-tier, build-embedded]
if: needs.detect-ci-tier.outputs.full_embedded == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Download binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: embedded-test-binaries
path: /tmp/
- name: Fix permissions
run: chmod +x /tmp/bd-proxied /tmp/bd-cmd-test
- name: Install Dolt CLI
# TestProxiedServerExternalCreate needs the dolt binary on PATH; the
# shared harness itself uses the dolt sql-server container image.
run: ./scripts/ci/install-dolt.sh
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Pull Dolt sql-server image
# The shared proxied harness requires the image cached locally
# (isDoltImageCached); without it every proxied test self-skips. Keep the
# tag in sync with internal/testutil/testdoltcommon.go:DoltDockerImage.
run: ./scripts/ci/pull-dolt-image.sh
- name: Test proxied-server cmd shard
env:
BEADS_TEST_PROXIED_SERVER: "1"
BEADS_TEST_BD_BINARY: /tmp/bd-proxied
BEADS_TEST_CMD_BINARY: /tmp/bd-cmd-test
run: bash .github/scripts/proxied-test-shard.sh ${{ matrix.shard }} 15
# Embedded Dolt tests - test the in-process Dolt engine (no server required)
#
# Split into: build → storage tests + parallel cmd test shards.
# cmd/bd embedded tests use a committed shard manifest; newly-added tests
# still auto-distribute via hash fallback until the manifest is updated.
build-embedded:
name: Build (Embedded Dolt)
needs: detect-ci-tier
if: needs.detect-ci-tier.outputs.full_embedded == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
id: setup-go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
cache: false
- name: Restore Go module cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/go/pkg/mod
key: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
restore-keys: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-
- name: Restore race Go build cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ runner.temp }}/go-cache/race
key: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-race-${{ github.sha }}
restore-keys: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-race-
- name: Restore non-race Go build cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ runner.temp }}/go-cache/non-race
key: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-non-race-${{ github.sha }}
restore-keys: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-non-race-
- name: Build embedded bd binary
env:
GOCACHE: ${{ runner.temp }}/go-cache/race
run: go build -tags gms_pure_go -race -o /tmp/bd-embedded-test ./cmd/bd/
- name: Build embedded storage test binary
env:
GOCACHE: ${{ runner.temp }}/go-cache/race
run: go test -tags gms_pure_go -race -c -o /tmp/embeddeddolt-test ./internal/storage/embeddeddolt/
- name: Build embedded cmd test binary
env:
GOCACHE: ${{ runner.temp }}/go-cache/race
run: go test -tags gms_pure_go -race -c -o /tmp/bd-cmd-test ./cmd/bd/
# Non-race bd used as the proxied-server test subprocess. The proxied
# tests spawn bd many times per sub-test; a -race subprocess would slow
# every invocation, so build a plain binary for BEADS_TEST_BD_BINARY.
- name: Build proxied bd subprocess binary
env:
GOCACHE: ${{ runner.temp }}/go-cache/non-race
run: go build -tags gms_pure_go -o /tmp/bd-proxied ./cmd/bd/
# Server-Dolt conformance binary. No -race: the Dolt server runs
# out-of-process in a container, and omitting it keeps the run inside the
# job's timeout. The dolt package self-skips without the docker image, so
# the binary is harmless if its job is gated off.
- name: Build server Dolt conformance test binary
env:
GOCACHE: ${{ runner.temp }}/go-cache/non-race
run: go test -tags=integration,gms_pure_go -c -o /tmp/dolt-conformance-test ./internal/storage/dolt/
- name: Upload binaries
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: embedded-test-binaries
path: |
/tmp/bd-embedded-test
/tmp/embeddeddolt-test
/tmp/bd-cmd-test
/tmp/bd-proxied
/tmp/dolt-conformance-test
retention-days: 1
test-embedded-storage:
name: Test (Embedded Dolt Storage ${{ matrix.shard }}/${{ strategy.job-total }})
needs: [detect-ci-tier, build-embedded]
if: needs.detect-ci-tier.outputs.full_embedded == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Download binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: embedded-test-binaries
path: /tmp/
- name: Fix permissions
run: chmod +x /tmp/embeddeddolt-test
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Test
env:
BEADS_TEST_EMBEDDED_DOLT: "1"
BEADS_TEST_EMBEDDED_TEST_BINARY: /tmp/embeddeddolt-test
# Manifest-driven shard of the storage suite (mirrors test-embedded-cmd
# / embedded-test-shard.sh). Conformance runs separately in the
# dedicated test-embedded-conformance job; embedded-storage-test-shard.sh
# excludes TestConformance from discovery, so it never lands in one of
# these shards.
run: bash .github/scripts/embedded-storage-test-shard.sh ${{ matrix.shard }} 5
test-embedded-conformance:
name: Test (Embedded Dolt Conformance - ${{ matrix.partition }})
needs: [detect-ci-tier, build-embedded]
if: needs.detect-ci-tier.outputs.full_embedded == 'true'
runs-on: ubuntu-latest
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
partition: [core, audit]
env:
BEADS_TEST_EMBEDDED_DOLT: "1"
BEADS_TEST_EMBEDDED_TEST_BINARY: /tmp/embeddeddolt-test
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Download binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: embedded-test-binaries
path: /tmp/
- name: Fix permissions
run: chmod +x /tmp/embeddeddolt-test
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Test core conformance
if: matrix.partition == 'core'
# RunAll has a natural Audit seam. Run everything except Audit in the
# core shard and Audit alone in the other shard. The combined suite has
# exceeded 30m under runner variance; each half currently takes ~15m.
# Keep the Go timeout below the job timeout so a real stall still emits
# a diagnostic goroutine dump before Actions stops the job.
run: /tmp/embeddeddolt-test -test.v -test.count=1 -test.timeout=30m -test.run '^TestConformance$' -test.skip '^TestConformance$/^Audit$'
- name: Test audit conformance
if: matrix.partition == 'audit'
run: /tmp/embeddeddolt-test -test.v -test.count=1 -test.timeout=30m -test.run '^TestConformance$/^Audit$'
test-server-storage:
name: Test (Server Dolt Conformance)
needs: [detect-ci-tier, build-embedded]
if: needs.detect-ci-tier.outputs.full_embedded == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Download binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: embedded-test-binaries
path: /tmp/
- name: Fix permissions
run: chmod +x /tmp/dolt-conformance-test
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Dolt
run: |
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
dolt version
- name: Pull Dolt sql-server image
# Presence of this image flips isDoltImageCached() true, so the suite
# exercises server Dolt instead of self-skipping. Keep the tag in sync
# with internal/testutil/testdoltcommon.go:DoltDockerImage.
run: ./scripts/ci/pull-dolt-image.sh
- name: Test
# Server twin of test-embedded-conformance: same conformance.RunAll, but
# against the container-backed server-mode Dolt backend. No -short / no
# BEADS_TEST_SKIP=dolt, so TestMain starts the shared server and the
# suite runs instead of self-skipping.
run: /tmp/dolt-conformance-test -test.v -test.count=1 -test.timeout=15m -test.run '^TestConformance$'
test-server-storage-full:
name: Test (Server Dolt Full Suite ${{ matrix.shard }}/${{ strategy.job-total }})
needs: [detect-ci-tier, build-embedded]
if: needs.detect-ci-tier.outputs.full_embedded == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Download binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: embedded-test-binaries
path: /tmp/
- name: Fix permissions
run: chmod +x /tmp/dolt-conformance-test
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Dolt
run: |
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
dolt version
- name: Pull Dolt sql-server image
# Presence of this image flips isDoltImageCached() true, so the suite
# exercises server Dolt instead of self-skipping. Keep the tag in sync
# with internal/testutil/testdoltcommon.go:DoltDockerImage.
run: ./scripts/ci/pull-dolt-image.sh
- name: Test
# build-embedded's dolt-conformance-test binary compiles every
# top-level test in internal/storage/dolt, not just conformance --
# test-server-storage above only ever runs the ^TestConformance$
# subset. Everything else in that binary (TestCreateGuard_*,
# federation/create-guard/concurrent suites, and diff-owned tests such
# as TestBenchDBPurgeDoesNotLeak on PR #5792) was reached by no
# PR-triggered lane and silently SKIPped for lack of a live server.
# This sibling job reuses the same artifact and server setup and runs
# everything else instead, so a SKIP there gets a real PASS/FAIL.
#
# Manifest-driven shard of the full suite (mirrors test-embedded-storage
# / server-storage-test-shard.sh): 1126 tests in one 15m-Go-timeout job
# never finished (job 95616282508 died at 256/1126 tests, 15m28s in,
# zero failures -- it just ran out of time). server-storage-test-shard.sh
# excludes TestConformance from discovery, so it never lands in one of
# these shards.
env:
BEADS_TEST_ENV_RUN_DOLT: "1"
run: bash .github/scripts/server-storage-test-shard.sh ${{ matrix.shard }} 16
test-embedded-cmd:
name: Test (Embedded Dolt Cmd ${{ matrix.shard }}/${{ strategy.job-total }})
needs: [detect-ci-tier, build-embedded]
if: needs.detect-ci-tier.outputs.full_embedded == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Download binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: embedded-test-binaries
path: /tmp/
- name: Fix permissions
run: chmod +x /tmp/bd-embedded-test /tmp/embeddeddolt-test /tmp/bd-cmd-test
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Test
env:
BEADS_TEST_EMBEDDED_DOLT: "1"
BEADS_TEST_BD_BINARY: /tmp/bd-embedded-test
run: bash .github/scripts/embedded-test-shard.sh ${{ matrix.shard }} 20
test-nix:
name: Test Nix Flake
# F7a: cache-free (no GitHub-saved cache restored/saved here) same-repo
# job moved onto Blacksmith at 4 vCPU; forks, Dependabot and any other
# event stay GitHub-hosted. Must match TestSameRepoBlacksmithRunners.
runs-on: ${{ (github.event_name == 'merge_group' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- uses: DeterminateSystems/determinate-nix-action@527f17dd63d2d60d3e5552934bc84b9a33a14d11 # v3
- uses: DeterminateSystems/determinate-nix-action@61cbfe2efc2d4e7a8a6d56967c3c1058e846c858 # v3
- name: Run bd help via Nix
id: nix_help
run: |
nix run .#default -- --help > help.txt
# A packaging check, not a test: evaluates every flake output (packages,
# apps, devShells, overlay) for every system the flake declares. The
# flake has no `checks`: its one check, hook-timeout-backends, runs
# under Bazel as //tests/hook_timeout_backends:hook_timeout_backends_test
# in bazel.yml's PR-core lane.
- name: Run the flake checks
run: |
nix flake check -L
- name: Verify help text
if: steps.nix_help.outcome == 'success'
run: |
@ -67,18 +444,17 @@ jobs:
echo "Help text first line is correct"
ci-gate:
name: PR Risk Gate / Required
# F3: same-repo PRs and merge_group get the org's Blacksmith pool; forks,
# Dependabot and any other event stay GitHub-hosted. This job restores no
# GitHub-saved cache. Must match the TestSameRepoBlacksmithRunners pin;
# the gate's NAME must never change (ruleset requires exactly "PR Risk
# Gate / Required").
runs-on: ${{ (github.event_name == 'merge_group' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
# F3: now on Blacksmith for same-repo PRs; a hang used to burn only the
# default 360 minutes of a free GitHub-hosted runner, now Blacksmith
# minutes too.
timeout-minutes: 10
name: CI Gate / Required
runs-on: ubuntu-latest
needs:
- detect-ci-tier
- build-embedded
- test-embedded-storage
- test-embedded-conformance
- test-server-storage
- test-server-storage-full
- test-embedded-cmd
- test-proxied-cmd
- test-nix
if: ${{ always() }}
steps:
@ -88,6 +464,29 @@ jobs:
env:
CI_GATE_NAME: PR risk gate
CI_GATE_REQUIRED: >-
DETECT_CI_TIER
BUILD_EMBEDDED
TEST_EMBEDDED_STORAGE
TEST_EMBEDDED_CONFORMANCE
TEST_SERVER_STORAGE
TEST_SERVER_STORAGE_FULL
TEST_EMBEDDED_CMD
TEST_PROXIED_CMD
TEST_NIX
FULL_EMBEDDED: ${{ needs.detect-ci-tier.outputs.full_embedded }}
DETECT_CI_TIER: ${{ needs.detect-ci-tier.result }}
BUILD_EMBEDDED: ${{ needs.build-embedded.result }}
TEST_EMBEDDED_STORAGE: ${{ needs.test-embedded-storage.result }}
TEST_EMBEDDED_CONFORMANCE: ${{ needs.test-embedded-conformance.result }}
TEST_SERVER_STORAGE: ${{ needs.test-server-storage.result }}
TEST_SERVER_STORAGE_FULL: ${{ needs.test-server-storage-full.result }}
TEST_EMBEDDED_CMD: ${{ needs.test-embedded-cmd.result }}
TEST_PROXIED_CMD: ${{ needs.test-proxied-cmd.result }}
TEST_NIX: ${{ needs.test-nix.result }}
run: bash .github/scripts/ci-gate.sh
run: |
skipped_ok=""
if [[ "$FULL_EMBEDDED" != "true" ]]; then
skipped_ok="BUILD_EMBEDDED TEST_EMBEDDED_STORAGE TEST_EMBEDDED_CONFORMANCE TEST_SERVER_STORAGE TEST_SERVER_STORAGE_FULL TEST_EMBEDDED_CMD TEST_PROXIED_CMD"
fi
export CI_GATE_SKIPPED_OK="$skipped_ok"
bash .github/scripts/ci-gate.sh

2098
.github/workflows/pr.yml vendored

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,150 @@
# Managed-local proxied lifecycle lane.
#
# The proxied shards in main.yml exercise command behavior against an
# EXTERNALLY managed Dolt testcontainer. This lane covers the production
# local-first path those shards cannot: bd launches its own loopback proxy,
# the proxy launches a locally installed `dolt sql-server`, and the whole
# lifecycle (create/read, loopback-only listeners, idle shutdown,
# transparent restart with persistence), identity failures, orphan recovery,
# and start/stop convergence run INSIDE a network namespace with only
# loopback up — proving no outbound network is needed once the binaries are
# installed. Linux first; the test lane defines Windows/macOS parity but does
# not implement those OS-specific observation helpers yet.
name: Proxied Local Lifecycle
on:
workflow_dispatch:
merge_group:
push:
branches: [main]
paths:
- 'cmd/bd/proxied_local_*'
- 'cmd/bd/proxied_server*.go'
- 'cmd/bd/dolt*.go'
- 'cmd/bd/*_proxied_server.go'
- 'cmd/bd/backup*.go'
- 'cmd/bd/purge*.go'
- 'cmd/bd/db_proxy_child.go'
- 'cmd/bd/init*.go'
- 'cmd/bd/proxied_integration_helpers_test.go'
- 'cmd/bd/store_factory*.go'
- 'cmd/bd/test_dolt_server_cgo_test.go'
- 'cmd/bd/uow_factory.go'
- 'internal/configfile/**'
- 'internal/doltserver/**'
- 'internal/storage/dbproxy/**'
- 'internal/storage/uow/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/proxied-local-smoke.yml'
pull_request:
paths:
- 'cmd/bd/proxied_local_*'
- 'cmd/bd/proxied_server*.go'
- 'cmd/bd/dolt*.go'
- 'cmd/bd/*_proxied_server.go'
- 'cmd/bd/backup*.go'
- 'cmd/bd/purge*.go'
- 'cmd/bd/db_proxy_child.go'
- 'cmd/bd/init*.go'
- 'cmd/bd/proxied_integration_helpers_test.go'
- 'cmd/bd/store_factory*.go'
- 'cmd/bd/test_dolt_server_cgo_test.go'
- 'cmd/bd/uow_factory.go'
- 'internal/configfile/**'
- 'internal/doltserver/**'
- 'internal/storage/dbproxy/**'
- 'internal/storage/uow/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/proxied-local-smoke.yml'
permissions:
contents: read
jobs:
managed-local-smoke:
name: Managed-local proxied lifecycle (Linux, offline)
runs-on: ubuntu-latest
timeout-minutes: 25
env:
CGO_ENABLED: "1"
# Pinned so the lane tests a known dolt CLI, not whatever the installer
# resolves on a given day. Bump deliberately, and only in lockstep with
# the measured pin in scripts/ci/install-dolt.sh (see "Which Dolt
# version to install" in docs/architecture/dolt.md).
DOLT_VERSION: 2.2.0
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install pinned Dolt CLI
run: |
curl -fsSL "https://github.com/dolthub/dolt/releases/download/v${DOLT_VERSION}/dolt-linux-amd64.tar.gz" -o /tmp/dolt.tar.gz
tar -xzf /tmp/dolt.tar.gz -C /tmp
sudo install /tmp/dolt-linux-amd64/bin/dolt /usr/local/bin/dolt
dolt version
- name: Build bd and compile the test binary (online)
run: |
go build -tags gms_pure_go -o /tmp/bd-under-test ./cmd/bd
go test -tags gms_pure_go -c -o /tmp/proxied-local-smoke.test ./cmd/bd
- name: Assert the managed-local lifecycle tests are compiled in
run: |
listed="$(
BEADS_TEST_PROXIED_LOCAL=1 \
BEADS_TEST_SKIP=dolt \
/tmp/proxied-local-smoke.test \
-test.list '^TestManagedLocalProxied'
)"
for test_name in \
TestManagedLocalProxiedLifecycleSmoke \
TestManagedLocalProxiedForeignListenerNotAdopted \
TestManagedLocalProxiedReusedPidNeverKilled \
TestManagedLocalProxiedLegacyRecordFailClosed \
TestManagedLocalProxiedOrphanBackendReaped \
TestManagedLocalProxiedNProcessColdStartConvergence \
TestManagedLocalProxiedStopStartInterleave \
TestManagedLocalProxiedDoltStatusReportsLiveTopology \
TestManagedLocalProxiedDoltStartRefusesOverLiveProxy \
TestManagedLocalProxiedDoltStartRefusesWithProxyDown \
TestManagedLocalProxiedDoltLifecycleLeavesOtherTopologiesAlone \
TestManagedLocalProxiedPurgeWispsPlaneRetention \
TestManagedLocalProxiedCapabilityMatrix \
TestManagedLocalProxiedBackupRoundTrip \
TestManagedLocalProxiedAutoBackup \
TestManagedLocalProxiedBackupRestoreRefusedWhileAttached \
TestManagedLocalProxiedBackendCleanExitRetiresProxy
do
if ! grep -qx "$test_name" <<<"$listed"; then
echo "managed-local lifecycle test $test_name is missing; got: '$listed'" >&2
exit 1
fi
done
- name: Run managed-local lifecycle lane offline (loopback-only netns)
run: |
sudo env \
"PATH=$PATH" \
BEADS_TEST_PROXIED_LOCAL=1 \
BEADS_TEST_SKIP=dolt \
BEADS_TEST_BD_BINARY=/tmp/bd-under-test \
unshare --net -- bash -euxc '
ip link set lo up
# Prove the namespace really has no outbound network before
# trusting anything the test reports.
if timeout 3 bash -c "exec 3<>/dev/tcp/1.1.1.1/443" 2>/dev/null; then
echo "outbound network unexpectedly available inside the netns" >&2
exit 1
fi
cd cmd/bd
/tmp/proxied-local-smoke.test \
-test.run "^TestManagedLocalProxied" \
-test.v -test.timeout 15m
'

121
.github/workflows/regression.yml vendored Normal file
View file

@ -0,0 +1,121 @@
name: Regression Tests
on:
# Run on merges to main
push:
branches: [main]
pull_request:
branches: [main, 'release/**', 'hotfix/**']
# Allow manual trigger
workflow_dispatch:
env:
BD_DISABLE_METRICS: "1"
BD_DISABLE_EVENT_FLUSH: "1"
jobs:
detect-regression-need:
name: Detect regression need
runs-on: ubuntu-latest
outputs:
run_regression: ${{ steps.detect.outputs.run_regression }}
reason: ${{ steps.detect.outputs.reason }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
fetch-depth: 0
- name: Decide whether to run differential regression tests
id: detect
env:
EVENT_NAME: ${{ github.event_name }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -euo pipefail
if [[ "$EVENT_NAME" != "pull_request" ]]; then
echo "run_regression=true" >> "$GITHUB_OUTPUT"
echo "reason=$EVENT_NAME event always runs regression tests" >> "$GITHUB_OUTPUT"
exit 0
fi
labels="$(jq -r '.pull_request.labels[].name // empty' "$GITHUB_EVENT_PATH")"
if grep -Fxq "run-regression" <<<"$labels"; then
echo "run_regression=true" >> "$GITHUB_OUTPUT"
echo "reason=run-regression label present" >> "$GITHUB_OUTPUT"
exit 0
fi
if grep -Fxq "skip-regression" <<<"$labels"; then
echo "run_regression=false" >> "$GITHUB_OUTPUT"
echo "reason=skip-regression label present" >> "$GITHUB_OUTPUT"
exit 0
fi
changed="$(git diff --name-only "$PR_BASE_SHA" "$PR_HEAD_SHA")"
echo "Changed files:"
printf '%s\n' "$changed"
regression_candidates="$(
printf '%s\n' "$changed" |
grep -Ev '^(cmd/bd|internal/storage|internal/types)/.*_test\.go$' ||
true
)"
risky_pattern='^(\.github/workflows/regression\.yml|Makefile|go\.(mod|sum)|cmd/bd/|internal/storage/|internal/types/|tests/regression/)'
if grep -Eq "$risky_pattern" <<<"$regression_candidates"; then
echo "run_regression=true" >> "$GITHUB_OUTPUT"
echo "reason=PR changes CLI, storage, types, regression, or build inputs" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "run_regression=false" >> "$GITHUB_OUTPUT"
echo "reason=PR does not touch regression-sensitive paths" >> "$GITHUB_OUTPUT"
regression:
name: Differential Regression (v0.49.6 baseline)
needs: detect-regression-need
if: needs.detect-regression-need.outputs.run_regression == 'true'
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Show regression trigger reason
run: echo "${{ needs.detect-regression-need.outputs.reason }}"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Dolt
run: |
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
dolt version
- name: Pull Dolt sql-server image
# Without this, isDoltImageCached() returns false in TestMain and the
# regression suite falls back to embedded Dolt with HOME=<tmpdir>, which
# has a known cleanup race (see beads issue: TestCreateWithParentFlag
# TempDir RemoveAll "directory not empty" flake). Keep the tag in sync
# with internal/testutil/testdoltcommon.go:DoltDockerImage.
run: ./scripts/ci/pull-dolt-image.sh
- name: Cache baseline binary
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ~/.cache/beads-regression
key: regression-baseline-${{ hashFiles('tests/regression/BASELINE_VERSION') }}
- name: Run regression tests
run: go test -tags=regression,gms_pure_go -timeout=20m -v ./tests/regression/...

View file

@ -35,14 +35,18 @@ jobs:
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
cache: false
- name: Verify tag matches version.go
run: |
tag_version="${GITHUB_REF_NAME#v}"
code_version="$(grep 'Version = ' cmd/bd/version.go | sed 's/.*"\(.*\)".*/\1/')"
if [ "$tag_version" != "$code_version" ]; then
echo "ERROR: tag v$tag_version does not match cmd/bd/version.go ($code_version)" >&2
exit 1
fi
echo "OK: tag and version.go agree on $code_version"
- name: Verify tag and released versions
run: ./scripts/check-versions.sh --expect "${GITHUB_REF_NAME#v}"
- name: Check version consistency
run: ./scripts/check-versions.sh
release-package-mcp:
name: Release Package Gate (MCP)
@ -57,10 +61,6 @@ jobs:
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
# Never restore a cache into release builds: setup-go's key is
# predictable and falls back to main's cache, whose module and build
# caches are not re-verified before binaries are built and signed.
cache: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
@ -94,10 +94,6 @@ jobs:
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
# Never restore a cache into release builds: setup-go's key is
# predictable and falls back to main's cache, whose module and build
# caches are not re-verified before binaries are built and signed.
cache: false
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
@ -125,10 +121,6 @@ jobs:
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
# Never restore a cache into release builds: setup-go's key is
# predictable and falls back to main's cache, whose module and build
# caches are not re-verified before binaries are built and signed.
cache: false
- name: Install cross-compilation toolchains and signing tools
# Backstop for a hang that escapes the inner `timeout` calls, so it has
@ -237,10 +229,6 @@ jobs:
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
# Never restore a cache into release builds: setup-go's key is
# predictable and falls back to main's cache, whose module and build
# caches are not re-verified before binaries are built and signed.
cache: false
- name: Extract version from tag
id: version

View file

@ -1,65 +0,0 @@
name: Remove needs-info on author response
on:
issue_comment:
types: [created]
pull_request_target:
types: [synchronize]
permissions: {}
jobs:
# pull_request_target is safe here because this job never checks out or runs
# pull request code; it only removes labels from the issue/PR metadata.
remove-label:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Remove needs-info / needs-repro on author response
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
const labels = ['status/needs-info', 'status/needs-repro'];
let number, author;
if (context.eventName === 'issue_comment') {
number = context.payload.issue.number;
author = context.payload.issue.user.login;
if (context.payload.comment.user.login !== author) return;
} else {
number = context.payload.pull_request.number;
author = context.payload.pull_request.user.login;
if (context.payload.sender.login !== author) return;
}
const current = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: number,
});
const currentNames = current.data.map(l => l.name);
for (const label of labels) {
if (!currentNames.includes(label)) continue;
// Idempotent removal: concurrent triggers can race to remove the
// same label, leaving the loser with a 404 "Label does not
// exist". Treat an already-absent label as success rather than
// failing the job.
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: number,
name: label,
});
console.log(`Removed '${label}' from #${number}`);
} catch (err) {
if (err.status === 404) {
console.log(`'${label}' already absent from #${number} (concurrent removal); nothing to do`);
continue;
}
throw err;
}
}

View file

@ -1,61 +0,0 @@
name: Remove needs-triage when triaged
on:
issues:
types: [labeled]
pull_request_target:
types: [labeled]
permissions: {}
jobs:
# pull_request_target is safe here because this job never checks out or runs
# pull request code; it only removes labels from the issue/PR metadata.
remove-triage-label:
# Olivia owns label, comment, and inbox removal as one recoverable transaction.
if: github.event.sender.login != 'gascityinc-sarah[bot]'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Remove needs-triage when a non-status label is added
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
const added = context.payload.label.name;
if (added.startsWith('status/')) return;
const number = context.issue?.number || context.payload.pull_request?.number;
const target = 'status/needs-triage';
const current = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: number,
});
if (!current.data.some(l => l.name === target)) return;
// The check above narrows a race but cannot close it: adding
// several non-status labels at once fires one `labeled` event
// (and one job) each, and they run concurrently. Every run sees
// the label present here, then all race to remove it. The winner
// gets 204; the losers get 404 "Label does not exist". Treat an
// already-absent label as success so a benign lost race does not
// paint a red X on the PR's checks.
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: number,
name: target,
});
console.log(`Removed '${target}' from #${number} (triaged with '${added}')`);
} catch (err) {
if (err.status === 404) {
console.log(`'${target}' already absent from #${number} (concurrent removal); nothing to do`);
return;
}
throw err;
}

View file

@ -1,82 +0,0 @@
name: Request repro or info from reporter
on:
issues:
types: [labeled]
permissions: {}
jobs:
post-request:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Post visible request comment for needs-repro or needs-info
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
const needsLabels = ['status/needs-info', 'status/needs-repro'];
const label = context.payload.label?.name;
if (!needsLabels.includes(label)) return;
const number = context.payload.issue?.number;
if (!number) {
core.setFailed('Unable to determine issue number');
return;
}
const owner = context.repo.owner;
const repo = context.repo.repo;
const reporter = context.payload.issue?.user?.login;
const events = await github.paginate(github.rest.issues.listEvents, {
owner,
repo,
issue_number: number,
per_page: 100,
});
const labelEvents = events.filter(e => e.event === 'labeled' && e.label?.name === label);
const labeledAt = labelEvents.length
? new Date(Math.max(...labelEvents.map(e => new Date(e.created_at).getTime())))
: null;
const existingComments = await github.paginate(github.rest.issues.listComments, {
owner,
repo,
issue_number: number,
...(labeledAt ? { since: labeledAt.toISOString() } : {}),
per_page: 100,
});
const hasVisibleRequest = existingComments.some(c => {
if (reporter && c.user?.login === reporter) return false;
const lower = (c.body || '').toLowerCase();
if (lower.includes('closing')) return false;
if (!/14\s*-?\s*days?/.test(lower)) return false;
if (!lower.includes('reply') && !lower.includes('respond')) return false;
if (label === 'status/needs-repro') return lower.includes('repro') || lower.includes('reproduction');
return lower.includes('info') || lower.includes('information') || lower.includes('details');
});
if (hasVisibleRequest) {
console.log(`Visible request already exists for #${number}, skipping.`);
return;
}
const requestBodies = {
'status/needs-repro':
'Thanks for the report! To help us investigate, please reply with a minimal reproduction within 14 days.\n\n' +
'If there is no response in that window, this issue may be closed — but you are welcome to respond or reopen it at any time.',
'status/needs-info':
'Thanks for the report! To help us investigate, please reply with the requested information or details within 14 days.\n\n' +
'If there is no response in that window, this issue may be closed — but you are welcome to respond or reopen it at any time.',
};
await github.rest.issues.createComment({
owner,
repo,
issue_number: number,
body: requestBodies[label],
});
console.log(`Posted needs request for #${number} (${label})`);

View file

@ -1,41 +0,0 @@
name: Auto-label new issues and PRs
on:
issues:
types: [opened, reopened]
pull_request_target:
types: [opened, reopened, ready_for_review]
permissions: {}
jobs:
# pull_request_target is safe here because this job never checks out or runs
# pull request code; it only labels the issue/PR from event metadata.
add-triage-label:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Add needs-triage label
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
const pullRequest = context.payload.pull_request;
if (pullRequest?.draft) {
console.log(`Skipping draft PR #${pullRequest.number}`);
return;
}
const number = context.issue?.number || pullRequest?.number;
if (!number) {
core.setFailed('Unable to determine issue or PR number');
return;
}
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: number,
labels: ['status/needs-triage']
});

View file

@ -30,7 +30,7 @@ jobs:
token: ${{ steps.flake-token.outputs.token }}
- name: Install Nix
uses: DeterminateSystems/determinate-nix-action@527f17dd63d2d60d3e5552934bc84b9a33a14d11 # v3
uses: DeterminateSystems/determinate-nix-action@61cbfe2efc2d4e7a8a6d56967c3c1058e846c858 # v3
- name: Update flake.lock
run: nix flake update

View file

@ -1,13 +1,10 @@
name: Update vendorHash for dependabot Go bumps
# Dependabot bumps to go.mod/go.sum invalidate the proxyVendor FOD hash in
# default.nix, which fails the required PR Risk `test-nix` gate (F7c,
# spec-f7.md §2.4: nix-build.yml itself no longer runs on pull_request, since
# test-nix's `nix run .#default` plus `nix flake check -L`, which evaluates
# every flake output, is a superset of plain `nix build .#default`). This workflow detects the drift, computes the
# new hash via scripts/update-nix-vendorhash.sh, and pushes the update back to
# the dependabot branch so the gate goes green without a maintainer
# round-trip.
# default.nix, which fails the nix-build CI gate. This workflow detects the
# drift, computes the new hash via scripts/update-nix-vendorhash.sh, and
# pushes the update back to the dependabot branch so the gate goes green
# without a maintainer round-trip.
#
# Tracked under beads-bz5.
#
@ -31,9 +28,9 @@ name: Update vendorHash for dependabot Go bumps
#
# Caveat:
# GitHub does not retrigger pull_request workflow runs for commits
# authored by GITHUB_TOKEN. After this workflow pushes, the existing PR Risk
# `test-nix` check on this PR will remain stuck on the pre-fix commit.
# Maintainers either re-run test-nix manually, or this workflow's own
# authored by GITHUB_TOKEN. After this workflow pushes, the existing
# nix-build.yml check on this PR will remain stuck on the pre-fix commit.
# Maintainers either re-run nix-build manually, or this workflow's own
# success acts as the green signal that the hash is correct.
on:
@ -69,7 +66,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Nix
uses: DeterminateSystems/determinate-nix-action@527f17dd63d2d60d3e5552934bc84b9a33a14d11 # v3
uses: DeterminateSystems/determinate-nix-action@61cbfe2efc2d4e7a8a6d56967c3c1058e846c858 # v3
- name: Capture pre-update vendorHash
id: pre
@ -82,14 +79,6 @@ jobs:
- name: Update vendorHash
run: ./scripts/update-nix-vendorhash.sh
- name: Verify the build independently of the script's exit status
# update-nix-vendorhash.sh's own verification build (its step 5) is
# internal to the script; this step re-derives the same signal from
# a source the workflow doesn't have to trust: a plain `nix build`
# that this job step fails on if it fails, regardless of what the
# script itself reported.
run: nix build .#default
- name: Detect whether hash changed
id: changed
run: |

View file

@ -1,196 +0,0 @@
# Keep beads' rbe worker-env pin in step with gastownhall/gascity main
# without the ~100-minute wait #7419 fixed by hand.
#
# rbe-west's OSS pool is gascity's: its workers advertise the sha256 of the
# toolchain manifest gascity's tools/rbe/worker-env measures, and the
# schedulers match //platforms:rbe_worker's worker-env exec property
# exactly. beads' tools/rbe/worker-env.txt and the platforms/BUILD.bazel pin
# are a byte-for-byte copy of gascity main's; when gascity moves the pin (a
# Go, dolt, or OS/library bump -- #7387 was a Go security release), every
# beads remote-execution run stops in bazel.yml's rbe-job preflight
# (tools/rbe/worker-env-sync) until the copy catches up. nightly.yml's
# rbe-worker-env-sync job already opens a ci/infra issue for a human to fix;
# this instead opens the fix itself, every 15 minutes, so the gap is
# minutes, not until someone reads the issue.
#
# tools/rbe/worker-env-sync only detects the mismatch (exit 1) or that it
# could not compare with gascity (exit 2, e.g. GitHub is briefly
# unreachable; the next run retries). The write half, tools/rbe/worker-env-
# sync-copy, runs only after that exit-1 detection, on a checkout already in
# hand -- so a transient gascity outage can turn "in step" into "unknown",
# never into an unwanted write.
#
# TWO TOKENS, ONE JOB EACH: GitHub never runs checks on a PR a plain
# GITHUB_TOKEN opens (its loop-prevention rule), so this needs a GitHub App
# token to open the PR. The gastownhall-autofix App (contents:write only on
# this repo) mints push-token and does the git push of the fixed branch
# (bot/worker-env-sync); it cannot open, label or merge a PR. The separate
# gascity-autofix App (pull-requests:write only, no contents) mints pr-token
# and does everything PR-shaped: create/update, the status/needs-review-auto
# label, and arming auto-merge. Splitting them means a bug in the PR-shaped
# half can never push a commit, and a bug in the push half can never touch a
# PR; neither token can do the other's job even by accident. Both Apps'
# credentials are secrets of the same `autofix` environment.
#
# peter-evans/create-pull-request takes one token for the whole push+PR
# flow, so it cannot honor this split; this uses plain git for the push and
# gh for the PR instead. Every `${{ }}` is resolved into a step's `env:`,
# never written inside a `run:` script, so a value that happened to look
# like shell (a title or body containing `` ` `` or `$`) is data to the
# shell, not something GitHub's expression syntax or the shell re-parses.
#
# SECURITY: schedule and workflow_dispatch are never fork events (no
# pull_request trigger here at all), so neither App's private key -- secrets
# of the `autofix` environment, whose deployment-branch policy allows only
# main -- is ever readable by a fork. The guard on github.repository is
# defense in depth for a fork of this repo, where the secrets would not
# exist anyway. Both mint steps run only once worker-env-sync has already
# found a real mismatch, so a run that is in step or can't compare asks
# neither App for a token. gh pr merge --auto only arms GitHub's native
# auto-merge (it still waits for every required check and the branch
# protection rule); it does not merge anything itself.
name: rbe worker-env autosync
on:
schedule:
- cron: "*/15 * * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
autosync:
name: Sync worker-env pin with gascity main
if: github.repository == 'gastownhall/beads'
runs-on: ubuntu-latest
timeout-minutes: 10
# Grants the job read access to this environment's secrets (both Apps'
# id and private key); its deployment-branch policy restricts that to
# jobs running on main, which schedule and workflow_dispatch on this
# repo always are.
environment: autofix
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
persist-credentials: false
# Never fails the step itself: rc is the signal every later step
# gates on (1, a real mismatch; 2, gascity unreachable -- the next
# scheduled run retries; 0, in step). A run every 15 minutes failing
# red for however long a mismatch takes to review and merge would be
# noise, not signal.
- name: Compare the worker-env manifest and pin with gascity's main
id: sync
run: |
rc=0
tools/rbe/worker-env-sync main || rc=$?
echo "rc=$rc" >> "$GITHUB_OUTPUT"
- name: Copy gascity main's worker-env manifest and pin
if: steps.sync.outputs.rc == '1'
run: tools/rbe/worker-env-sync-copy main
- name: Confirm only the worker-env files moved
if: steps.sync.outputs.rc == '1'
run: |
changed="$(git diff --name-only)"
untracked="$(git ls-files --others --exclude-standard)"
want=$'platforms/BUILD.bazel\ntools/rbe/worker-env.txt'
if [ -n "$untracked" ] || [ "$(printf '%s\n' "$changed" | sort)" != "$(printf '%s\n' "$want" | sort)" ]; then
echo "::error::worker-env-sync-copy touched more than platforms/BUILD.bazel and tools/rbe/worker-env.txt:"
printf '%s\n' "$changed" "$untracked"
exit 1
fi
# contents:write only, on this repo alone: all it can do is push
# bot/worker-env-sync. Minted only once a real mismatch needs a push.
- name: Mint push token (gastownhall-autofix)
id: push-token
if: steps.sync.outputs.rc == '1'
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
with:
app-id: ${{ secrets.AUTOFIX_APP_ID }}
private-key: ${{ secrets.AUTOFIX_APP_PRIVATE_KEY }}
owner: gastownhall
repositories: beads
permission-contents: write
# pull-requests:write only, on this repo alone: all it can do is
# open, label and arm auto-merge on a PR -- never push a commit.
- name: Mint PR token (gascity-autofix)
id: pr-token
if: steps.sync.outputs.rc == '1'
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
with:
app-id: ${{ secrets.GASCITY_AUTOFIX_APP_ID }}
private-key: ${{ secrets.GASCITY_AUTOFIX_APP_PRIVATE_KEY }}
owner: gastownhall
repositories: beads
permission-pull-requests: write
# push-token alone; it cannot see a PR exists, let alone touch one.
# Leased to the branch: a force-with-lease scoped to refs/heads/
# bot/worker-env-sync only, so a push can never move any other ref.
- name: Commit and push the sync branch
if: steps.sync.outputs.rc == '1'
env:
PUSH_TOKEN: ${{ steps.push-token.outputs.token }}
REPO: ${{ github.repository }}
BRANCH: bot/worker-env-sync
COMMIT_SUBJECT: "build(rbe): sync worker-env pin with gascity main"
GIT_AUTHOR_NAME: gastownhall-autofix[bot]
GIT_AUTHOR_EMAIL: gastownhall-autofix[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: gastownhall-autofix[bot]
GIT_COMMITTER_EMAIL: gastownhall-autofix[bot]@users.noreply.github.com
run: |
git checkout -B "$BRANCH"
git add platforms/BUILD.bazel tools/rbe/worker-env.txt
git commit -m "$COMMIT_SUBJECT"
git push "https://x-access-token:${PUSH_TOKEN}@github.com/${REPO}.git" \
"HEAD:refs/heads/$BRANCH" "--force-with-lease=refs/heads/$BRANCH"
# pr-token alone; it cannot push a commit, only act on the PR the
# step above already pushed.
- name: Open or update the sync PR
id: pr
if: steps.sync.outputs.rc == '1'
env:
GH_TOKEN: ${{ steps.pr-token.outputs.token }}
REPO: ${{ github.repository }}
BRANCH: bot/worker-env-sync
TITLE: "build(rbe): sync worker-env pin with gascity main"
LABEL: status/needs-review-auto
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
body="$(cat <<BODY
rbe-west's pool workers advertise gastownhall/gascity main's worker-env
pin; beads' copy (\`tools/rbe/worker-env.txt\` and the
\`platforms/BUILD.bazel\` pin) had fallen out of step, so beads' remote
actions were queueing on a pin no worker serves
(\`tools/rbe/worker-env-sync main\`, run $RUN_URL).
This copies gascity main's manifest and pin byte for byte, same as
#7419. Auto-merge is armed: it lands once the automated review and the
rest of the required checks are green.
BODY
)"
number="$(gh pr list --repo "$REPO" --head "$BRANCH" --base main --state open --json number --jq '.[0].number')"
if [ -n "$number" ]; then
gh pr edit "$number" --repo "$REPO" --title "$TITLE" --body "$body"
else
gh pr create --repo "$REPO" --base main --head "$BRANCH" --title "$TITLE" --body "$body"
number="$(gh pr list --repo "$REPO" --head "$BRANCH" --base main --state open --json number --jq '.[0].number')"
fi
gh pr edit "$number" --repo "$REPO" --add-label "$LABEL"
echo "number=$number" >> "$GITHUB_OUTPUT"
- name: Enable auto-merge
if: steps.sync.outputs.rc == '1' && steps.pr.outputs.number
env:
GH_TOKEN: ${{ steps.pr-token.outputs.token }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ steps.pr.outputs.number }}
run: gh pr merge --auto --squash --repo "$REPO" "$PR_NUMBER"

6
.gitignore vendored
View file

@ -255,9 +255,3 @@ tmp/build/cli-docs/where.md
tmp/build/cli-docs/worktree.md
tmp/docs/CLI_REFERENCE.md
*.gate.lock*
# Bazel: output symlinks and machine-local rc files (remote executor endpoint,
# TLS credentials). Never commit these.
/bazel-*
/.bazelrc.local
/user.bazelrc

View file

@ -1,9 +1,3 @@
# Lint policy for nogo (//tools/nogo), which runs these linters beside every
# Bazel Go compile: tools/nogo/internal/golangci embeds this file and applies
# it as golangci-lint v2.10.1 would (enabled linters, settings, run.tests,
# generated files, exclusion rules). Decoding is strict, so a key the nogo
# wrappers do not implement fails the build. golangci-lint itself still reads
# it (editors, ad-hoc runs), but CI gates on nogo; see engdocs/LINTING.md.
version: "2"
run:
@ -307,14 +301,6 @@ linters:
- pattern: '^types\.(IssueFilter|WorkFilter)$'
pkg: '^github\.com/steveyegge/beads/internal/types$'
msg: "do not write a filter here: take one back from a builder in internal/workapi, or pass the whole request to issueops.Reader. internal/httpapi may never name these types; cmd/bd denies them by default and lists the files that legitimately build their own, with the reason for each, in .golangci.yml - see issueops/reader.go"
- pattern: '^fmt\.Print(f|ln)?$'
pkg: '^fmt$'
# Keep the prefix in sync with the list/graph text exclusion below.
msg: "do not write list/graph output through process stdout: route format output through the command writer; mark an intentional non-format path locally"
- pattern: '^os\.Stdout$'
pkg: '^os$'
# Keep the prefix in sync with the list/graph text exclusion below.
msg: "do not write list/graph output through process stdout: route format output through the command writer; mark an intentional non-format path locally"
errcheck:
exclude-functions:
- (*database/sql.DB).Close
@ -341,10 +327,10 @@ linters:
exclusions:
rules:
# forbidigo holds four rules: filter construction, label-plane access,
# and the two process-stdout forms used by list/graph output. The entries
# from here to the test exemption define their scopes. This first one
# keeps every rule off the rest of the tree; the settings block says why.
# forbidigo holds TWO rules - the filter-construction guard and the
# label-plane guard - and the entries from here to the test exemption are
# their entire scope. This one keeps both off the rest of the tree; the
# settings block above says why.
#
# The previous version of this comment said there was exactly one rule and
# that a second "would need this widened or replaced". That came true, and
@ -357,15 +343,6 @@ linters:
- path-except: '^(internal/httpapi/|cmd/bd/)'
linters:
- forbidigo
# Process stdout is forbidden only across the list/graph file families.
# Existing non-format paths in those families carry local, reviewed
# exceptions; a new file or output site is denied by default. Scoping by
# the diagnostic text keeps the filter and label rules unchanged.
- path-except: '^cmd/bd/(list|graph).*\.go$'
# This prefix must match both fmt.Print and os.Stdout messages above.
text: 'do not write list/graph output through process stdout'
linters:
- forbidigo
#
# THE LABEL-PLANE RULE IS NOW PACKAGE-WIDE ACROSS cmd/bd (ga-2ltro.12).
# It used to be narrowed by a `path-except` to cmd/bd/label.go, the one
@ -467,28 +444,12 @@ linters:
# tests: false` means forbidigo never analyzes a test file at all, so that
# entry asserts nothing either way and scoping it would be the churn this
# comment just refused to write.
#
# `search` LEFT this list when all three of its routes moved onto
# issueops.Reader.List with issueops.SearchListRequest (cmd/bd/search.go);
# it builds no filter any more.
#
# `gate` LEFT it when `bd gate check` joined `bd gate list` on
# issueops.ListGates over the route's Querier: cmd/bd/gate.go and
# cmd/bd/gate_proxied_server.go name no filter type any more.
# `gate_discover` keeps its own hole below, since findPendingGates still
# asks SearchIssues for its gates.
- path: '^cmd/bd/(close|duplicates|find_duplicates|gc|graph|info|label|orphans|purge|todo|wisp|human)(_proxied_server)?\.go$'
- path: '^cmd/bd/(close|duplicates|find_duplicates|gate|gc|graph|info|label|orphans|purge|search|todo|wisp|human)(_proxied_server)?\.go$'
text: 'do not write a filter here'
linters:
- forbidigo
# Molecule reporting: each selects the members of one molecule.
#
# `mol current` and `mol progress` LEFT this list when their in_progress
# and hooked listings moved onto issueops.Reader.List (cmd/bd/mol_roles.go)
# so a remote backend answers them. The proxied route's in-transaction
# port still searches through the unit of work, and that filter lives in
# mol_port.go beside the port.
- path: '^cmd/bd/mol_(port|ready_gated|stale)\.go$'
- path: '^cmd/bd/mol_(current|port|progress|ready_gated|stale)\.go$'
text: 'do not write a filter here'
linters:
- forbidigo

View file

@ -1,15 +1,9 @@
repos:
# Lint and vet: nogo (//tools/nogo) over the changed files' Bazel packages,
# the analyzers CI gates on (go test's vet checks plus the golangci-lint
# linters .golangci.yml enables). Needs bazel or bazelisk on PATH.
- repo: local
- repo: https://github.com/golangci/golangci-lint
rev: v2.10.1
hooks:
- id: nogo
name: nogo (bazel)
entry: make lint-changed LINT_CHANGED_SCOPE=staged
language: system
types: [go]
pass_filenames: false
- id: golangci-lint
args: [--timeout=5m]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0

455
AGENTS.md
View file

@ -1,227 +1,290 @@
# Beads — Contributor Agent Instructions
# Agent Instructions
This file is for agents and humans **developing beads** (`bd`). If you are
using `bd` to track work in your own project, read the user docs instead:
[docs site](https://beads.gascity.com/) and
[IDE and agent setup](docs/getting-started/ide-setup.md).
<!-- bd-doctor-divergence: ok -->
<!-- Contributor-only file. Do not run `bd setup` or `bd init` against this
checkout: they would inject the end-user beads integration block here. -->
See [AGENT_INSTRUCTIONS.md](AGENT_INSTRUCTIONS.md) for full instructions.
Nested `AGENTS.md` files hold area-specific rules; the routing table at the
end lists them. `CLAUDE.md` files are symlinks to their sibling `AGENTS.md`.
This file exists for compatibility with tools that look for AGENTS.md.
## How work flows here
The marker above tells `bd doctor` that the intentional divergence between
this file and `CLAUDE.md` (different audiences, different reading orders) is
expected and should not be flagged.
GitHub Issues is the public tracker. Use an issue when it adds context
reviewers need: a user-visible bug, a behavior or design change worth
discussing, or work that spans several PRs. The issue carries the
reproduction, impact, and evidence for a bug, or the motivation, impact, risk,
and verification plan for a change. Small, self-explanatory changes (typos,
flaky tests, refactors, CI or docs tweaks) can go straight to a PR whose body
explains the why.
## Key Sections
1. If the change warrants an issue, find or file one with the bug or feature
form. It does not need maintainer approval first; file it before or
alongside the PR.
2. Work on a branch, open a PR against `main` (its body says
`Closes #<issue>` when there is one), and let CI and review run.
3. Maintainers triage issues with `status/needs-triage`, `status/needs-info`,
`status/needs-repro`, `status/needs-design`, and `status/accepted`
(confirmed); see [CONTRIBUTING.md](CONTRIBUTING.md).
- **Issue Tracking** - How to use bd for work management
- **Development Guidelines** - Code standards and testing
- **Project Scope** - Read [engdocs/PROJECT_CHARTER.md](engdocs/PROJECT_CHARTER.md) before adding new feature surface area
- **Visual Design System** - Status icons, colors, and semantic styling for CLI output
- **Contributor Protection** - Read [CONTRIBUTING.md](CONTRIBUTING.md) before handling external PRs
- **Maintainer PR Guidelines** - Read [PR_MAINTAINER_GUIDELINES.md](PR_MAINTAINER_GUIDELINES.md) before triaging, landing, or closing PRs
Maintainers also keep an internal bd ledger. It is optional for contributors
and not a substitute for the GitHub issue.
## Project Scope
## Agent contribution policy
Before adding new feature surface area, read
[engdocs/PROJECT_CHARTER.md](engdocs/PROJECT_CHARTER.md). Beads owns issue tracking
primitives and should not encode orchestration-layer policy, become a storage
engine, or casually expand the database schema when metadata would work.
- File an issue when the change warrants one (see above). When you do, use
the bug or feature form fields, fill each from evidence, and answer
`NOT_ENOUGH_INFO` where the evidence runs out.
- A human reviews and stands behind every issue and PR an agent drafts.
Evidence that the change works end-to-end is required; "unit tests pass"
alone is not evidence.
- Before implementing work, opening a PR, or merging/closing a PR, run the PR
preflight:
```bash
scripts/pr-preflight.sh --search "<topic keywords>" --repo gastownhall/beads
scripts/pr-preflight.sh <pr-number> --repo gastownhall/beads
```
The preflight is the agent gate for PR handling; do not rely on
auto-discovery of CONTRIBUTING.md.
- Use `gh` for GitHub issues and PRs, not browser tools. Write PR, issue,
comment, and review bodies to a file, run `scripts/gh-body-lint <body-file>`,
and pass the file with `gh ... --body-file`. Sign agent-written GitHub
comments and reviews per [engdocs/AGENT_SIGNING.md](engdocs/AGENT_SIGNING.md).
## PR Safety for Agents
## Contributor protection
External contributor PRs have priority. Read [CONTRIBUTING.md](CONTRIBUTING.md)
— it contains promises we've made to contributors — and, before triaging,
reviewing, landing, closing, or otherwise maintaining PRs,
Before triaging, reviewing, landing, closing, or otherwise maintaining PRs, read
[PR_MAINTAINER_GUIDELINES.md](PR_MAINTAINER_GUIDELINES.md). The maintainer
policy is to maximize community throughput: find useful contributor value,
absorb or transform it locally when practical, preserve attribution, and use
request-changes only as a last resort.
Before implementing any feature or fix, check for existing open PRs on the
same topic. If one exists:
1. **Review it first** — read the diff, understand the approach.
2. **Build on their work, don't rewrite it** — check out their branch,
fix/adapt as needed.
3. **Preserve their tests** — keep them unless they're wrong.
4. **Attribute properly** — `Co-authored-by:` in commits, reference their PR.
5. **Never close or supersede their PR silently.** If a rewrite is
unavoidable, explain why on the original PR and credit their design/tests.
## Scope: where a change belongs
Read [engdocs/PROJECT_CHARTER.md](engdocs/PROJECT_CHARTER.md) before adding
feature surface area. Beads owns issue tracking primitives and should not
encode orchestration-layer policy, become a storage engine, or casually expand
the database schema when metadata would work. Prefer, in order: issue
metadata over new fields, a flag on an existing command over a new command,
an integration or plugin over core, and leave orchestration policy to the
orchestration layer.
**Storage boundary.** Beads talks to storage through a driver interface
(`dolthub/driver` for Dolt). Do not add beads-side flocks, engine
introspection, storage-specific retry or crash-recovery logic, or public SDK
return types that leak driver internals. If the boundary is too narrow, widen
the interface or route the issue to the driver instead of patching around it
in beads. `bd doctor` support for embedded mode is enabled one subcommand at a
time, each human-vetted (GH#3794): do not lift the embedded-mode gate in
`cmd/bd/doctor.go` wholesale, and keep database-layer checks and fixes
server-gated until the driver interface covers them.
**Layering.** Schema → `internal/storage/issueops` → `cmd/bd`. Add new
primitives at the lowest layer first, one layer per PR, stacked when a fix
spans layers. See
[CONTRIBUTING_PR_GUIDELINES.md](CONTRIBUTING_PR_GUIDELINES.md).
## Build, test, lint
Bazel is the build and test system: CI gates on the `bazel test` lanes in
`.github/workflows/bazel.yml`, and nogo (lint + vet), gofmt and the repository
guards exist only as Bazel targets. Install
[Bazelisk](https://github.com/bazelbuild/bazelisk) as `bazel`; the pre-commit
and pre-push hooks need it.
Before implementing work, opening a PR, or merging/closing a PR, run the PR
preflight:
```bash
make test # bazel test //... --config=ci: the CI test lane (nogo, gofmt, guards, unit tests)
make check # testing.Short policy + make ci-pr-lint + make test
make ci-pr-lint # nogo lint + vet gate, native plus windows/darwin
make check-docs # bazel docsync + doc freshness, then the CLI flag check
make bazel-sync # after adding/removing/renaming Go files or changing imports/go.mod
make install # build and install bd to ~/.local/bin (canonical)
scripts/pr-preflight.sh --search "<topic keywords>" --repo gastownhall/beads
scripts/pr-preflight.sh <pr-number> --repo gastownhall/beads
```
- Each other tier has its own lane (`--config=integration`, `doltserver`,
`embedded`, ...); [engdocs/TESTING.md](engdocs/TESTING.md) lists the exact
command per lane and is the canonical source for test selection, design,
and PR-readiness gates.
- Where actions run: contributors add `--config=fork-cache` (rbe-west's
anonymous read-only cache; nothing is uploaded), maintainers with an rbe-west
certificate `--config=remote-exec`, agent hosts whose `~/.bazelrc` names the
executor neither. Make yours the default with a `build --config=...` line in
the gitignored `.bazelrc.local`, or pass `BAZEL_FLAGS=...` to make.
- Agents run tests only with `bazel test`, also while iterating on one
behavior:
External contributor PRs have priority. Review and build on their branch when
possible, preserve their tests and attribution, and never close or supersede
their PR silently. If a rewrite is unavoidable, explain why on the original PR
and credit their design/tests.
```bash
bazel test //cmd/bd:bd_test --config=ci --test_filter='^TestName$' --test_output=all
```
## Visual Design Anti-Patterns
A target also passes when the test never ran (a filter that matches
nothing, a skip, a file the configuration does not compile), so count a run
only when its log shows `--- PASS: TestName` and no `--- SKIP` for the test
or a `TestName/...` subtest: Go prints `--- PASS` for a test whose every
subtest skipped. "Check That the Test Ran" in
[engdocs/TESTING.md](engdocs/TESTING.md) names the tests `--config=ci` does
not run (Dolt-backed, `-short`-gated, integration-tagged, `TestEmbedded*`
and embedded-Dolt, files `BUILD.bazel` does not list) and the way into
each. An unchanged target returns its cached result, which is the same
evidence. Finish with `make test`.
- Agents do not run `go test` (`./scripts/test.sh`, `make test-go`): CI does
not enforce it, it skips nogo, gofmt and the guards, and agent hosts may
refuse it. It stays a convenience for humans working offline. The exception
is regenerating golden files (`make corpus-regen`, `make githooks-regen`,
`BD_UPDATE_GOLDEN=1`), which Bazel cannot do: see "Regenerating Golden
Files" in [engdocs/TESTING.md](engdocs/TESTING.md).
- **Do NOT** use `go build -o bd ./cmd/bd`, `go install ./cmd/bd`, or raw
`go run ./cmd/bd ...`: they bypass the canonical build path, leave stale
binaries, and raw `go run` misses the `gms_pure_go` tag. Use `make install`,
`./bd`, or `go run -tags gms_pure_go ./cmd/bd ...`.
- All new features need tests.
- **Never pollute a production database with test issues.** Use `t.TempDir()`
in Go tests and a disposable working directory for manual `bd` experiments.
- `make ci-pr-lint` must pass with zero issues; see
[engdocs/LINTING.md](engdocs/LINTING.md).
- If BUILD files are out of sync and you cannot run `make bazel-sync`, CI
syncs them: on same-repo PRs the bazel-autofix workflow pushes the fix to
your branch (pull before pushing again); fork PRs get a comment with an
apply recipe.
- If you changed behavior, update the user docs (`docs/`, via the
`beads-docs` skill) or README in the same PR.
**NEVER use emoji-style icons** (🔴🟠🟡🔵⚪) in CLI output. They cause cognitive overload.
## Commits and PRs
**ALWAYS use small Unicode symbols** with semantic colors (status uses symbols; priority uses labels):
- Status: `○ ◐ ● ✓ ❄`
- Priority: `P0`–`P4` label with color (no status glyph)
- Conventional Commits: `type(scope): summary` (`fix`, `feat`, `docs`,
`test`, `refactor`, `chore`, `ci`, `perf`).
- For agent-prepared commits, include the `Agent-Signature:` trailer described
in [engdocs/AGENT_SIGNING.md](engdocs/AGENT_SIGNING.md). Use
`unknown-model` or `unknown-reasoning` when reliable runtime metadata is
unavailable.
- Maintainers working from the internal ledger may also end the subject with
the bead ID, e.g. `(bd-abc)`, so `bd doctor` can detect orphaned issues.
- Work on a feature branch and open a PR against `main`; direct pushes to
`main` are reserved for releases and narrow operational fixes.
- When the user asks to bump the version, use `./scripts/bump-version.sh`; the
full release process is in [RELEASING.md](RELEASING.md).
See [AGENT_INSTRUCTIONS.md](AGENT_INSTRUCTIONS.md) for full development guidelines.
## Ending a session
## Storage Boundary
Do not push to `main`. Before handing off:
The canonical storage boundary is in
[engdocs/PROJECT_CHARTER.md](engdocs/PROJECT_CHARTER.md#storage-boundary). In short:
Beads talks to storage through a driver interface (`dolthub/driver` for Dolt).
Do not add beads-side flocks, engine introspection, storage-specific retry or
crash-recovery logic, or public SDK return types that leak driver internals.
If the boundary is too narrow, widen the interface or route the issue to the
driver instead of patching around it in beads.
1. Run the quality gates your change needs (`make test`, `make ci-pr-lint`,
and the other Bazel lanes [engdocs/TESTING.md](engdocs/TESTING.md)
selects). If gates are broken on `main`, report it as a P0 issue.
2. Record follow-up work as GitHub issues (or ledger beads, for maintainers).
3. Commit, push, or open a PR only when the person you are working for asked
you to. Report changed files, validation run, and anything left open.
A live application of this rule: `bd doctor` support for embedded mode is
enabled one subcommand at a time, each human-vetted (GH#3794). Do not lift the
embedded-mode gate in `cmd/bd/doctor.go` wholesale, and keep database-layer
checks and fixes server-gated until the driver interface covers them.
## CLI output
## Agent Warning: Interactive Commands
**NEVER use emoji-style icons** (🔴🟠🟡🔵⚪) in CLI output. **ALWAYS use small
Unicode symbols** with semantic colors: status `○ ◐ ● ✓ ❄`; priority as a
`P0`–`P4` label with color (no status glyph). The full visual design system
and CLI design principles are in
[engdocs/UI_PHILOSOPHY.md](engdocs/UI_PHILOSOPHY.md).
**DO NOT use `bd edit`** - it opens an interactive editor ($EDITOR) which AI agents cannot use.
## Non-interactive shell commands
Use `bd update` with flags instead:
```bash
bd update <id> --description "new description"
bd update <id> --title "new title"
bd update <id> --design "design notes"
bd update <id> --notes "additional notes"
bd update <id> --acceptance "acceptance criteria"
Agents cannot answer prompts. Use `cp -f`, `mv -f`, `rm -f`, `rm -rf`,
`cp -rf` (these may be aliased to `-i`); `scp`/`ssh -o BatchMode=yes`;
`apt-get -y`; `HOMEBREW_NO_AUTO_UPDATE=1 brew`. **DO NOT use `bd edit`** — it
opens `$EDITOR`; use `bd update <id> --title/--description/--design/--acceptance/--append-notes`
(pipe text with special characters via `--description=-`).
# Use stdin for descriptions with special characters (backticks, !, nested quotes)
echo 'Description with `backticks` and "quotes"' | bd create "Title" --description=-
echo 'Updated text' | bd update <id> --description=-
```
## Routing table
## Testing
| When you are touching… | Read first |
|---|---|
| `cmd/bd/` (commands, output, proxied-server routes) | [cmd/bd/AGENTS.md](cmd/bd/AGENTS.md) |
| `engdocs/` (contributor and internals docs) | [engdocs/AGENTS.md](engdocs/AGENTS.md) |
| `docs/` (the published user docs) | `.claude/skills/beads-docs/SKILL.md` |
| Any Go test | [engdocs/TESTING.md](engdocs/TESTING.md) |
| Lint failures or `.golangci.yml` | [engdocs/LINTING.md](engdocs/LINTING.md) |
| A new storage operation or issueops role | [engdocs/ADDING_AN_ISSUEOPS_ROLE.md](engdocs/ADDING_AN_ISSUEOPS_ROLE.md) |
| Schema migrations | [internal/storage/schema/migrations/README.md](internal/storage/schema/migrations/README.md) |
| Dolt concurrency, server vs embedded mode | [engdocs/design/dolt-concurrency.md](engdocs/design/dolt-concurrency.md) |
| Errors returned to users | [engdocs/ERROR_HANDLING.md](engdocs/ERROR_HANDLING.md) |
| The `bd serve` HTTP surface | [engdocs/SERVE_RUNBOOK.md](engdocs/SERVE_RUNBOOK.md) |
| A new example under `examples/` | `examples/README.md` — give the example its own README and link it there |
| Releases and version bumps | [RELEASING.md](RELEASING.md) |
| Scope questions | [engdocs/PROJECT_CHARTER.md](engdocs/PROJECT_CHARTER.md) |
| Planned work and priorities | [ROADMAP.md](ROADMAP.md) |
Use [engdocs/TESTING.md](engdocs/TESTING.md) for the canonical commands,
test-design guidance, and PR-readiness gates.
## Non-Interactive Shell Commands
**ALWAYS use non-interactive flags** with file operations to avoid hanging on confirmation prompts.
Shell commands like `cp`, `mv`, and `rm` may be aliased to include `-i` (interactive) mode on some systems, causing the agent to hang indefinitely waiting for y/n input.
**Use these forms instead:**
```bash
# Force overwrite without prompting
cp -f source dest # NOT: cp source dest
mv -f source dest # NOT: mv source dest
rm -f file # NOT: rm file
# For recursive operations
rm -rf directory # NOT: rm -r directory
cp -rf source dest # NOT: cp -r source dest
```
**Other commands that may prompt:**
- `scp` - use `-o BatchMode=yes` for non-interactive
- `ssh` - use `-o BatchMode=yes` to fail instead of prompting
- `apt-get` - use `-y` flag
- `brew` - use `HOMEBREW_NO_AUTO_UPDATE=1` env var
## Landing the Plane (Session Completion)
**When ending a work session** (or when the user says "let's land the
plane"), you MUST complete ALL steps below. Work is NOT complete until
`git push` succeeds.
**MANDATORY WORKFLOW:**
1. **File issues for remaining work** - Create issues for anything that needs follow-up
2. **Run quality gates** (if code changed):
- `make ci-pr-lint` (required zero-finding formatting and lint wrapper)
- `make test` (and `make test-icu-path` only if you intentionally need the ICU regex path)
- File a P0 issue if quality gates are broken
3. **Update issue status** - Close finished work, update in-progress items
4. **PUSH TO REMOTE** - This is MANDATORY:
```bash
git pull --rebase
git push
git status # MUST show "up to date with origin"
```
5. **Clean up**:
```bash
git stash clear # Remove old stashes
git remote prune origin # Clean up deleted remote branches
```
6. **Verify** - All changes committed AND pushed, no untracked files remain
7. **Hand off** - Choose a follow-up issue and give the user a prompt for
the next session, e.g. "Continue work on bd-X: [issue title]. [Brief
context about what's been done and what's next]"
**CRITICAL RULES:**
- Work is NOT complete until `git push` succeeds
- NEVER stop before pushing - that leaves work stranded locally
- NEVER say "ready to push when you are" - YOU must push
- If push fails, resolve and retry until it succeeds
Close with a summary for the user: what was completed this session, issues
filed for follow-up, quality-gate status, confirmation everything is pushed,
and the recommended prompt for the next session.
<!-- BEGIN BEADS INTEGRATION v:1 profile:full hash:bacef91e -->
## 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: Dolt-powered version control with native sync
- 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" --description="Detailed context" -t bug|feature|task -p 0-4 --json
bd create "Issue title" --description="What this issue is about" -p 1 --deps discovered-from:bd-123 --json
```
**Claim and update:**
```bash
bd update <id> --claim --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 atomically**: `bd update <id> --claim`
3. **Work on it**: Implement, test, document
4. **Discover new work?** Create linked issue:
- `bd create "Found bug" --description="Details about what was found" -p 1 --deps discovered-from:<parent-id>`
5. **Complete**: `bd close <id> --reason "Done"`
### Quality
- Use `--acceptance` and `--design` fields when creating issues
- Use `--validate` to check description completeness
### Lifecycle
- `bd defer <id>` / `bd supersede <id>` for issue management
- `bd stale` / `bd orphans` / `bd lint` for hygiene
- `bd human <id>` to flag for human decisions
- `bd formula list` / `bd mol pour <name>` for structured workflows
### Sync
bd stores issue history in Dolt:
- Each write auto-commits to Dolt history
- Use `bd dolt push`/`bd dolt pull` for remote sync
- Do not treat `.beads/issues.jsonl` as the sync protocol
**Architecture in one line:** issues live in a local Dolt DB; sync uses `refs/dolt/data` on your git remote; `.beads/issues.jsonl` is a passive export. See https://github.com/gastownhall/beads/blob/main/docs/core-concepts/sync-concepts.md for details and anti-patterns.
### 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?"
- ❌ Do NOT create markdown TODO lists
- ❌ Do NOT use external issue trackers
- ❌ Do NOT duplicate tracking systems
For more details, see README.md and https://github.com/gastownhall/beads/blob/main/docs/getting-started/quickstart.md.
## Agent Context Profiles
The managed Beads block is task-tracking guidance, not permission to override repository, user, or orchestrator instructions.
- **Conservative (default)**: Use `bd` for task tracking. Do not run git commits, git pushes, or Dolt remote sync unless explicitly asked. At handoff, report changed files, validation, and suggested next commands.
- **Minimal**: Keep tool instruction files as pointers to `bd prime`; use the same conservative git policy unless active instructions say otherwise.
- **Team-maintainer**: Only when the repository explicitly opts in, agents may close beads, run quality gates, commit, and push as part of session close. A current "do not commit" or "do not push" instruction still wins.
## Session Completion
This protocol applies when ending a Beads implementation workflow. It is subordinate to explicit user, repository, and orchestrator instructions.
1. **File issues for remaining work** - Create beads for anything that needs follow-up
2. **Run quality gates** (if code changed) - Tests, linters, builds
3. **Update issue status** - Close finished work, update in-progress items
4. **Handle git/sync by active profile**:
```bash
# Conservative/minimal/default: report status and proposed commands; wait for approval.
git status
# Team-maintainer opt-in only, unless current instructions forbid it:
git pull --rebase
bd dolt push
git push
git status
```
5. **Hand off** - Summarize changes, validation, issue status, and any blocked sync/commit/push step
**Critical rules:**
- Explicit user or orchestrator instructions override this Beads block.
- Do not commit or push without clear authority from the active profile or the current user request.
- If a required sync or push is blocked, stop and report the exact command and error.
<!-- END BEADS INTEGRATION -->

View file

@ -1,9 +1,531 @@
# Agent Instructions
# Detailed Agent Instructions for Beads Development
Contributor instructions for agents developing beads live in
[AGENTS.md](AGENTS.md). Area-specific rules live in nested `AGENTS.md` files
listed in its routing table.
**For project overview and quick start, see [AGENTS.md](AGENTS.md)**
If you are using `bd` to track work in your own project, see the user docs:
[IDE and agent setup](docs/getting-started/ide-setup.md) and
[https://beads.gascity.com/](https://beads.gascity.com/).
This document contains detailed operational instructions for AI agents working on beads development, testing, and releases.
## Development Guidelines
### Code Standards
- **Go version**: see `go.mod` for the required version (currently 1.26+)
- **Linting**: `make ci-pr-lint` must pass with zero issues; see
[engdocs/LINTING.md](engdocs/LINTING.md)
- **Testing**: All new features need tests; use [engdocs/TESTING.md](engdocs/TESTING.md) for command selection, test design, and PR readiness.
- **Documentation**: Update relevant .md files
### File Organization
```
beads/
├── cmd/bd/ # CLI commands
├── internal/
│ ├── types/ # Core data types
│ └── storage/ # Storage layer
│ └── dolt/ # Dolt implementation
├── examples/ # Integration examples
└── *.md # Documentation
```
### Testing Workflow
**IMPORTANT:** Never pollute the production database with test issues!
For test commands, tier selection, and test-design guidance, use the canonical
[engdocs/TESTING.md](engdocs/TESTING.md).
**For manual testing**, keep initialization and all experiments in a disposable
working directory. This safety example supplements the canonical testing guide:
```bash
beads_manual_dir="$(mktemp -d)"
(
set -e
cd "$beads_manual_dir"
bd init --quiet --prefix test --skip-hooks --skip-agents
bd create "Test issue" -p 1
)
rm -rf -- "$beads_manual_dir"
```
`BEADS_DB` alone does not redirect `bd init` workspace setup. Do not run manual
initialization from a production workspace even when selecting another database.
**For automated tests**, use `t.TempDir()` in Go tests:
```go
func TestMyFeature(t *testing.T) {
tmpDir := t.TempDir()
testDB := filepath.Join(tmpDir, ".beads", "beads.db")
s := newTestStore(t, testDB)
// ... test code
}
```
**Git test isolation:** For tests that create temporary git repos, force repo-local hooks:
```bash
git config core.hooksPath .git/hooks
```
Do not rely on the developer's global git config. Global `core.hooksPath` can leak
into temp repos and produce flaky test behavior.
**Warning:** bd will warn you when creating issues with a "Test" prefix in the
production database. The disposable working directory is the isolation
boundary for manual initialization and experiments.
**Tmpfs hosts:** the `cmd/bd` test suite creates an isolated `$HOME` and several
test binaries under `$TMPDIR`. They are normally cleaned by the test process,
but a SIGKILLed or OOMed run can leave orphans behind. On hosts where `/tmp`
is tmpfs (e.g. Fedora Atomic / Bluefin), run `make clean-test-tmp` between
test runs if `du -sh /tmp/beads-* /tmp/bd-*` shows accumulation. See bd-3q2u.
### Before Committing
1. **Run tests**: follow [engdocs/TESTING.md](engdocs/TESTING.md).
2. **Run the required lint contract when its code surface changed**:
`make ci-pr-lint`
3. **Update docs**: If you changed behavior, update README.md or other docs
4. **Commit**: With git hooks installed (`bd hooks install`), Dolt changes are auto-committed
### Commit Message Convention
When committing work for an issue, include the issue ID in parentheses at the end:
```bash
git commit -m "Fix auth validation bug (bd-abc)"
git commit -m "Add retry logic for database locks (bd-xyz)"
```
This enables `bd doctor` to detect **orphaned issues** - work that was committed but the issue wasn't closed. The doctor check cross-references open issues against git history to find these orphans.
For agent-prepared commits, also include the
`Agent-Signature:` trailer described in
[engdocs/AGENT_SIGNING.md](engdocs/AGENT_SIGNING.md). Use `unknown-model` or
`unknown-reasoning` when reliable runtime metadata is unavailable.
### Git Workflow
bd uses **Dolt** as its primary database. Changes are committed to Dolt history automatically (one Dolt commit per write command).
**Install git hooks** for commit integration and legacy fallback behavior:
```bash
bd hooks install
```
### Git Integration
**Dolt sync**: Dolt handles sync natively via `bd dolt push` / `bd dolt pull`. No export/import round-trip needed for normal sync.
**Protected branches**: Dolt stores data under `refs/dolt/data`, separate from standard Git refs. See [docs/reference/protected-branches.md](docs/reference/protected-branches.md).
**Git worktrees**: Work directly with Dolt — no special flags needed. See [docs/reference/advanced.md](docs/reference/advanced.md).
**Merge conflicts**: Rare with hash IDs. Dolt uses cell-level 3-way merge for conflict resolution.
## Git Workflow: PR by Default
Crew workers use a PR-based workflow. Beads is a dependency of a downstream consumer, so we
defer to the standard PR flow to keep changes reviewable.
- Work on a feature branch, push the branch, open a PR against `main`
- `gh pr create` is the normal path to land work
- Direct push to main is reserved for releases (tag + release commit) and
narrow operational fixes; prefer a PR when unsure
- When handling external contributor PRs, use fix-merge: checkout the PR
branch locally, fix/rebase onto main, merge via PR, then close the PR
### Maintainer PR Guidelines
Before triaging, reviewing, landing, closing, or otherwise maintaining PRs,
read [PR_MAINTAINER_GUIDELINES.md](PR_MAINTAINER_GUIDELINES.md). The
maintainer policy is to maximize community throughput: find useful contributor
value, absorb or transform it locally when practical, preserve attribution, and
use request-changes only as a last resort.
Sign agent-written GitHub comments and reviews using
[engdocs/AGENT_SIGNING.md](engdocs/AGENT_SIGNING.md).
### External Contributor PRs: Check Before You Build
**Read [CONTRIBUTING.md](CONTRIBUTING.md)** — it contains promises we've made to contributors. Violating them damages trust and community.
Run the read-only preflight before implementing related work, opening a PR, or
merging/closing a PR:
```bash
scripts/pr-preflight.sh --search "<topic keywords>" --repo gastownhall/beads
scripts/pr-preflight.sh <pr-number> --repo gastownhall/beads
```
**Before implementing any feature or fix, check for existing open PRs on the same topic:**
```bash
gh pr list --repo gastownhall/beads --state open --search "<topic keywords>" --json number,title,author,headRefName
```
**Contributor work gets priority.** If an external PR already exists:
1. **Review it first** — read the diff, understand the approach
2. **Build on their work, don't rewrite it** — checkout their branch, fix/adapt as needed
3. **Preserve their tests** — contributor tests are signal; keep them unless they're wrong
4. **Attribute properly** — use `Co-authored-by:` in commits, reference their PR number
5. **Never auto-close a contributor PR** by merging a rewrite — that discards their contribution silently
If you must rewrite (e.g., fundamentally different approach needed), explain why on the original PR and credit the contributor's design/tests in your commits.
Do not rely on auto-discovery of CONTRIBUTING.md; the preflight is the agent
gate for PR handling.
## Landing the Plane
See [AGENTS.md](AGENTS.md#landing-the-plane-session-completion) for the
canonical session-completion protocol (quality gates, mandatory `git push`,
cleanup, and next-session hand-off).
## Agent Session Workflow
**WARNING: DO NOT use `bd edit`** - it opens an interactive editor ($EDITOR) which AI agents cannot use. Use `bd update` with flags instead:
```bash
bd update <id> --description "new description"
bd update <id> --title "new title"
bd update <id> --design "design notes"
bd update <id> --notes "additional notes"
bd update <id> --acceptance "acceptance criteria"
```
**Read execution metadata before prose.** When enacting a bd issue, inspect the
structured metadata before using description or notes to choose execution mode,
delegation, model, reasoning level, or parallel group:
```bash
bd show <id> --json | jq '.[0] | {id,title,metadata,description,notes}'
```
The execution metadata keys are:
- `execution_agent_type`
- `execution_suggested_model`
- `execution_reasoning_effort`
- `execution_mode`
- `execution_parallel_group`
When these keys are present, treat them as the authoritative execution hints.
Use `description` for the work scope and `notes` for rationale or fallback
context. Parent/orchestrator agents must read these fields before spawning
subagents because a running subagent cannot change its model or reasoning effort
after launch.
**Use stdin for descriptions with special characters** (backticks, `!`, nested quotes):
```bash
# Pipe via stdin to avoid shell escaping issues
echo 'Description with `backticks` and "quotes"' | bd create "Title" --stdin
echo 'Updated description with $variables' | bd update <id> --description=-
# Or use --body-file for longer content
bd create "Title" --body-file=description.md
```
**GitHub body hygiene.** For GitHub PR, issue, comment, and review bodies,
write Markdown to a file and pass it with `gh ... --body-file`. Run
`scripts/gh-body-lint <body-file>` first to catch literal `\n` sequences and
non-linking `GH#123` references.
**Example agent session:**
```bash
# Make changes (each write auto-commits to Dolt)
bd create "Fix bug" -p 1
bd create "Add tests" -p 1
bd update bd-42 --claim
bd close bd-40 --reason "Completed"
# Push Dolt data to remote if configured
bd dolt push
# Now safe to end session
```
This installs:
- **pre-commit** — Commits pending Dolt changes
- **post-merge** — Runs chained hooks and a legacy JSONL import fallback only when no Dolt remote is configured
**Note:** Hooks are embedded in the bd binary and work for all bd users (not just source repo users).
## Common Development Tasks
### Visual Design System
When adding CLI output features, follow these design principles for consistent,
cognitively friendly visuals.
#### No Emoji-Style Icons
Do not use large colored emoji icons like red/orange/yellow/blue/white circles
for priorities or status. They cause cognitive overload and break visual
consistency.
Use small Unicode symbols with semantic colors applied via lipgloss:
- Status: `○ ◐ ● ✓ ❄`
- Priority: `P0`–`P4` label with color (no status glyph)
#### Status Icons
Use these symbols consistently across all commands:
```text
○ open - Available to work (white/default)
◐ in_progress - Currently being worked (yellow)
● blocked - Waiting on dependencies (red)
✓ closed - Completed (muted gray)
❄ deferred - Scheduled for later (blue/muted)
```
#### Priority Labels and Colors
Format priority as the P-label with color only (no status glyph — `●` is blocked status):
- `P0`: Red + bold (critical)
- `P1`: Orange (high)
- `P2`: Amber (elevated)
- `P3`–`P4`: Default text
#### Issue Type Colors
- `bug`: Red (problems need attention)
- `epic`: Purple (larger scope)
- Others: Default text
#### Design Principles
1. Small Unicode symbols only; avoid emoji blobs.
2. Semantic colors only for actionable items; do not color everything.
3. Closed items fade using muted gray.
4. Prefer icons over text labels for scanability.
5. Keep icons consistent across list, graph, show, and related commands.
6. Use tree connectors (`├──`, `└──`, `│`) for hierarchies.
7. Reduce cognitive noise; do not show `needs:1` when it is just the parent epic.
#### Semantic Styles
Use exported styles from `internal/ui/styles.go`:
```go
// Status styles
ui.StatusInProgressStyle // Yellow - active work
ui.StatusBlockedStyle // Red - needs attention
ui.StatusClosedStyle // Muted gray - done
// Priority styles
ui.PriorityP0Style // Red + bold
ui.PriorityP1Style // Orange
// Type styles
ui.TypeBugStyle // Red
ui.TypeEpicStyle // Purple
// General styles
ui.PassStyle, ui.WarnStyle, ui.FailStyle
ui.MutedStyle, ui.AccentStyle
ui.RenderMuted(text), ui.RenderAccent(text)
```
Example:
```go
switch issue.Status {
case types.StatusOpen:
icon = "○"
case types.StatusInProgress:
icon = ui.StatusInProgressStyle.Render("◐")
case types.StatusBlocked:
icon = ui.StatusBlockedStyle.Render("●")
case types.StatusClosed:
icon = ui.StatusClosedStyle.Render("✓")
}
```
### CLI Design Principles
**Minimize cognitive overload.** Every new command, flag, or option adds cognitive burden for users. Before adding anything:
1. **Recovery/fix operations → `bd doctor --fix`**: Don't create separate commands like `bd recover` or `bd repair`. Doctor already detects problems - let `--fix` handle remediation. This keeps all health-related operations in one discoverable place.
For git hook marker migration specifically: use `bd migrate hooks --dry-run` to preview operations, and `bd doctor --fix` for the standard apply path.
2. **Prefer flags on existing commands**: Before creating a new command, ask: "Can this be a flag on an existing command?" Example: `bd list --stale` instead of `bd stale`.
3. **Consolidate related operations**: Related operations should live together. Version control uses `bd vc {log,diff,commit}`, not separate top-level commands.
4. **Count the commands**: Run `bd --help` and count. If we're approaching 30+ commands, we have a discoverability problem. Consider subcommand grouping.
5. **New commands need strong justification**: A new command should represent a fundamentally different operation, not just a convenience wrapper.
### Adding a New Command
1. Create file in `cmd/bd/`
2. Add to root command in `cmd/bd/main.go`
3. Implement with Cobra framework
4. Add `--json` flag for agent use
5. Add tests in `cmd/bd/*_test.go`
6. Document in README.md
### Adding Storage Features
1. Add Dolt SQL schema changes in `internal/storage/dolt/`
2. Add migration if needed
3. Update `internal/types/types.go` if new types
4. Implement in `internal/storage/dolt/` (queries, issues, etc.)
5. Add tests
6. Update export/import in `cmd/bd/export.go` and `cmd/bd/import.go`
### Adding Examples
1. Create directory in `examples/`
2. Add README.md explaining the example
3. Include working code
4. Link from `examples/README.md`
5. Mention in main README.md
## Building
```bash
# Build and install bd to ~/.local/bin (the canonical location)
make install
# Verify installed binary
bd init --prefix test
bd create "Test issue" -p 1
bd ready
```
For testing commands, test design, and PR-readiness gates, use
[engdocs/TESTING.md](engdocs/TESTING.md).
> **WARNING**: Do NOT use `go build -o bd ./cmd/bd`, `go install ./cmd/bd`,
> or raw `go run ./cmd/bd ...`.
> These bypass the canonical build path, can create stale binaries in the
> working directory or `~/go/bin/`, and raw `go run` may miss the required
> `gms_pure_go` build tag. Always use `make install`, `./bd`, or
> `go run -tags gms_pure_go ./cmd/bd ...` when you explicitly need `go run`.
## Version Management
**IMPORTANT**: When the user asks to "bump the version" or mentions a new version number (e.g., "bump to 0.9.3"), use the version bump script:
```bash
# Preview changes (shows diff, doesn't commit)
./scripts/bump-version.sh 0.9.3
# Auto-commit the version bump
./scripts/bump-version.sh 0.9.3 --commit
git push origin main
```
**What it does:**
- Updates ALL version files (CLI, plugin, MCP server, docs) in one command
- Validates semantic versioning format
- Shows diff preview
- Verifies all versions match after update
- Creates standardized commit message
**User will typically say:**
- "Bump to 0.9.3"
- "Update version to 1.0.0"
- "Rev the project to 0.9.4"
- "Increment the version"
**You should:**
1. Run `./scripts/bump-version.sh <version> --commit`
2. Push to GitHub
3. Confirm all versions updated correctly
**Files updated automatically:**
- `cmd/bd/version.go` - CLI version
- `plugins/beads/.claude-plugin/plugin.json` - Claude plugin version
- `plugins/beads/.codex-plugin/plugin.json` - Codex plugin version
- `.claude-plugin/marketplace.json` - Claude marketplace version
- `integrations/beads-mcp/pyproject.toml` - MCP server version
- `README.md` - Documentation version
- `PLUGIN.md` - Version requirements
**Why this matters:** We had version mismatches (bd-66) when only `version.go` was updated. This script prevents that by updating all components atomically.
See `scripts/README.md` for more details.
## Release Process (Maintainers)
See [RELEASING.md](RELEASING.md) for the complete release process, including
the automated `./scripts/release.sh <version>` script and the manual,
step-by-step channel-by-channel instructions.
## Checking GitHub Issues and PRs
**IMPORTANT**: When asked to check GitHub issues or PRs, use command-line tools like `gh` instead of browser/playwright tools.
**Preferred approach:**
```bash
# List open issues with details
gh issue list --limit 30
# List open PRs
gh pr list --limit 30
# View specific issue
gh issue view 201
```
**Then provide an in-conversation summary** highlighting:
- Urgent/critical issues (regressions, bugs, broken builds)
- Common themes or patterns
- Feature requests with high engagement
- Items that need immediate attention
**Why this matters:**
- Browser tools consume more tokens and are slower
- CLI summaries are easier to scan and discuss
- Keeps the conversation focused and efficient
- Better for quick triage and prioritization
**Do NOT use:** `browser_navigate`, `browser_snapshot`, or other playwright tools for GitHub PR/issue reviews unless specifically requested by the user.
## Telemetry
`bd` collects anonymous command-usage metrics. Each event is a `cli_command`
record carrying only the command name; each batch also carries the bd version
and OS platform, keyed by a machine-derived, HMAC-protected distinct ID. No
email, repo path, remote URL, issue content, or user-supplied strings are
collected. Events are written under `~/.beads/eventsData` and POSTed to
`https://gastownhall-eventsapi.com/mp/collect`.
Metrics are enabled by default (opt-out). The friendliest way to see or change
them is `bd metrics` (`bd metrics on` / `bd metrics off` / `bd metrics example`),
which takes effect on the next command with no restart. `BD_DISABLE_METRICS=1`
still works as a one-off, shell-scoped override. The cross-tool
[`DO_NOT_TRACK`](https://donottrack.sh/) standard is honored as a disable-only
opt-out: `DO_NOT_TRACK=1` opts out, while a falsey or empty value
(`DO_NOT_TRACK=0`, `false`, or unset-but-present) falls through to your saved
`bd metrics` preference instead of forcing metrics back on. `BD_DISABLE_METRICS`
is the bidirectional override and takes precedence when both are set.
## Questions?
- Check existing issues: `bd list`
- Look at recent commits: `git log --oneline -20`
- Read the docs: README.md, ADVANCED.md, docs/reference/configuration.md
- Create an issue if unsure: `bd create "Question: ..." -t task -p 2`
## Important Files
- **README.md** - Main documentation (keep this updated!)
- **ADVANCED.md** - Advanced features (rename, merge, compaction)
- **CONTRIBUTING.md** - Contribution guidelines
- **SECURITY.md** - Security policy

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
AGENTS.md

23
CLAUDE.md Normal file
View file

@ -0,0 +1,23 @@
# Claude Code Entry Point for Beads
This file is intentionally short. Do not copy workflow, build, storage, or UI
rules here; those details drift quickly when repeated across agent entrypoints.
## Read First
- **Workflow and safety**: [AGENTS.md](AGENTS.md)
- **Detailed agent operations**: [AGENT_INSTRUCTIONS.md](AGENT_INSTRUCTIONS.md)
- **Architecture orientation**: [engdocs/CLAUDE.md](engdocs/CLAUDE.md)
- **PR maintenance policy**: [PR_MAINTAINER_GUIDELINES.md](PR_MAINTAINER_GUIDELINES.md)
## Current Ground Rules
- Run `bd prime` before doing tracked work.
- Follow `go.mod` and [AGENT_INSTRUCTIONS.md](AGENT_INSTRUCTIONS.md) for build
and test commands; do not hard-code toolchain versions here.
- Beads uses Dolt as the issue database. Use `bd dolt push` / `bd dolt pull`
for issue data sync; do not use export/import as a routine git workflow.
- The CLI Visual Design System lives in
[AGENT_INSTRUCTIONS.md](AGENT_INSTRUCTIONS.md#visual-design-system).
- If this file conflicts with a linked source, trust the linked source and fix
this file by removing the duplicate.

View file

@ -2,65 +2,14 @@
Thank you for your interest in contributing to bd! This document provides guidelines and instructions for contributing.
## Issues and pull requests
GitHub Issues is the public tracker. Use an issue when it adds context
reviewers need: a user-visible bug, a behavior or design change worth
discussing first, or work that spans several pull requests. The issue holds
why the change is needed, what it affects, and how we will know it works; file
it with the bug or feature form before or alongside your pull request, and it
does not need maintainer approval first. Small, self-explanatory changes
(typos, flaky tests, refactors, CI or docs tweaks) can go straight to a pull
request whose description explains the why.
### Triage labels
| Label | Meaning | Applied by |
|---|---|---|
| `status/needs-triage` | Awaiting initial triage. | Automation, on every new issue |
| `status/needs-info` | Waiting on essential information from the reporter. | Maintainers |
| `status/needs-repro` | Needs a reproducible bug report. | Maintainers |
| `status/needs-design` | The direction needs a design decision before work starts. | Maintainers |
| `status/accepted` | Confirmed and on our radar. | Maintainers |
Issues left in `status/needs-info` or `status/needs-repro` are closed after 14
days without a reply to the request; reply with the details and a
maintainer will reopen them.
Priority (`priority/p0`–`priority/p3`) and kind (`kind/bug`, `kind/feature`,
`kind/docs`, `kind/chore`) labels are set during triage.
### Pull request pipeline labels
These labels drive the maintainers' automated review and merge workflow. They
are applied by maintainers and automation; contributors don't need to set
them.
| Label | Meaning |
|---|---|
| `status/needs-review` | Request the PR review workflow. |
| `status/needs-review-auto` | Request the automated PR review workflow. |
| `status/reviewing` | The PR review workflow is running. |
| `status/review-failed` | The PR review workflow failed before merge-ready. |
| `status/merge-ready` | The PR is ready for the merge workflow. |
| `status/merge-queued` | Queued for deterministic PR-review merge. |
| `status/merge-failed` | The merge queue needs operator attention. |
| `status/needs-bugflow` | Request the bugflow investigation workflow. |
The current priorities are on the [roadmap](ROADMAP.md); work in a priority
area is reviewed first.
## Development Setup
### Prerequisites
- [Bazelisk](https://github.com/bazelbuild/bazelisk), installed as `bazel`
(it reads `.bazelversion`). **Required:** Bazel is the build and test system
CI gates on, and the pre-commit (nogo lint) and pre-push (test suite) hooks
run it.
- Go (see `go.mod` for the required version; currently 1.26+), for `make
install` and the `go test` inner loop
- Go (see `go.mod` for the required version; currently 1.26+)
- Git
- A C compiler (CGO is required for the embedded Dolt database)
- golangci-lint v2.10.1 for the required local lint gate
- ICU headers are **not required** for building -- see [engdocs/ICU-POLICY.md](engdocs/ICU-POLICY.md)
### Getting Started
@ -70,44 +19,16 @@ area is reviewed first.
git clone https://github.com/gastownhall/beads
cd beads
# Read rbe-west's anonymous, read-only cache: everything CI already built and
# tested is a cache hit, and nothing you build is uploaded.
echo 'build --config=fork-cache' >> .bazelrc.local
# Build the project (uses gms_pure_go tag via Makefile)
make build
# Run the test suite CI gates on (bazel test //... --config=ci)
# Run tests (uses correct build tags automatically)
make test
# Build and install bd to ~/.local/bin (also enables the git hooks)
# Build and install locally to ~/.local/bin
make install
```
### Building and Testing
Bazel is the gate: `.github/workflows/bazel.yml` runs every pull request's
tests as `bazel test` lanes, and nogo (lint + vet), gofmt and the repository
guards exist only as Bazel targets. The make targets run the same commands:
| Command | Runs |
|---|---|
| `make test` | `bazel test //... --config=ci`: the test lane (unit tests, nogo, gofmt, repository guards) |
| `make check` | the testing.Short policy, `make ci-pr-lint` and `make test` |
| `make ci-pr-lint` | nogo natively plus the windows/amd64 and darwin/arm64 passes |
| `make check-docs` | the Bazel docsync and doc-freshness tests, then the CLI flag check |
| `bazel test //... --config=integration` | the integration lane; [engdocs/TESTING.md](engdocs/TESTING.md) lists every other lane's command |
Where actions run is your choice, set in the gitignored `.bazelrc.local` (or
per command with `make test BAZEL_FLAGS=--config=...`):
- `--config=fork-cache` (contributors): reads the anonymous cache, runs misses
on your machine, uploads nothing.
- `--config=remote-exec` (maintainers with an rbe-west client certificate):
executes remotely; the executor and TLS lines stay in your `user.bazelrc` or
`.bazelrc.local`.
`go test` (`./scripts/test.sh`, or `make test-go` / `make check-go` /
`make check-docs-go`) still works as an inner-loop convenience, but CI does not
enforce it and it skips nogo, gofmt and the guards. Finish with `make test`.
## Project Structure
```
@ -117,7 +38,7 @@ beads/
│ ├── types/ # Core data types (Issue, Dependency, etc.)
│ └── storage/ # Storage interface and implementations
│ └── dolt/ # Dolt database backend
├── .golangci.yml # Linter configuration (applied by nogo, tools/nogo)
├── .golangci.yml # Linter configuration
└── .github/workflows/ # CI/CD pipelines
```
@ -140,24 +61,23 @@ We follow standard Go conventions:
### Linting
Lint and vet run as nogo under Bazel: go test's vet checks plus the
golangci-lint linters `.golangci.yml` enables, the same analyzers CI gates on.
Use the same pinned golangci-lint version and repository-owned wrapper as CI:
```bash
# Run the required lint and vet gate (native, windows and darwin)
make ci-pr-lint
# Install the version pinned by CI
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1
# Faster: only the Bazel packages of your changed Go files
make lint-changed
# Run the required formatting and lint contract
make ci-pr-lint
```
`make ci-pr-lint` must pass with zero issues. It analyzes the repository's
normal `gms_pure_go` build and cross-checks the Windows- and macOS-only
non-cgo code. Accepted intentional patterns are encoded narrowly in
`.golangci.yml`; do not ignore a failing baseline. See
[engdocs/LINTING.md](engdocs/LINTING.md) for the full policy.
`make ci-pr-lint` must pass with zero issues. It checks formatting, lints the
repository's normal `gms_pure_go` build, and cross-lints Windows-only non-CGO
code. Accepted intentional patterns are encoded narrowly in `.golangci.yml`;
do not ignore a failing baseline. See [engdocs/LINTING.md](engdocs/LINTING.md)
for the full policy.
CI runs the same analyzers on all pull requests, in the Bazel test lane.
CI runs the same required wrapper on all pull requests.
## Making Changes
@ -170,23 +90,21 @@ engine, or expand the database schema when issue metadata is sufficient.
### Workflow
1. If the change warrants one, find or file an issue (see [Issues and pull requests](#issues-and-pull-requests))
2. Fork the repository and create a feature branch (`git checkout -b feature/my-feature`)
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/my-feature`)
3. Make your changes
4. Add tests for new functionality
5. Run tests and linter locally
6. Commit your changes with clear messages
7. Push to your fork
8. Open a pull request that explains the change and says `Closes #<issue>` when there is one
8. Open a pull request
### Commit Messages
Use [Conventional Commits](https://www.conventionalcommits.org/):
`type(scope): summary`, where type is one of `fix`, `feat`, `docs`, `test`,
`refactor`, `chore`, `ci`, or `perf`.
Write clear, concise commit messages:
```
feat(dep): add cycle detection for dependency graphs
Add cycle detection for dependency graphs
- Implement recursive CTE-based cycle detection
- Add tests for simple and complex cycles
@ -197,10 +115,6 @@ feat(dep): add cycle detection for dependency graphs
**One issue per PR, and one PR per issue.** No piggybacking or riders — each PR should address exactly one thing.
Read [CONTRIBUTING_PR_GUIDELINES.md](CONTRIBUTING_PR_GUIDELINES.md) for the
layering rules (schema → storage/issueops → cmd/bd, one layer per PR) and the
repro and benchmark evidence reviewers expect.
- Keep PRs focused on a single feature or fix
- Do not include unrelated changes, cleanup, or "while I'm here" improvements
- Do not include `.beads/` data (database, JSONL) in your PR
@ -224,8 +138,7 @@ For test commands, test design, and PR-readiness gates, see the canonical
- Follow the proportional validation budget in
[engdocs/TESTING.md](engdocs/TESTING.md): docs-only changes use docs checks;
Go changes use focused and affected-package tests plus one final `make test`
(the Bazel test lane).
Go changes use focused and affected-package tests plus one final `make test`.
- If you hit a test failure unrelated to your change, don't silently skip
it -- check `.test-skip` and file an issue if it's not already tracked
(see [engdocs/TESTING.md](engdocs/TESTING.md#failures-skips-and-review)).
@ -265,12 +178,22 @@ round-trip paths should pattern-match on those tests.
## Feature Requests and Bug Reports
Use the issue forms: [bug report](https://github.com/gastownhall/beads/issues/new?template=bug_report.yml)
or [feature request](https://github.com/gastownhall/beads/issues/new?template=feature_request.yml).
The feature form asks for the motivation, impact, risk and compatibility,
and verification plan up front, so a maintainer can accept the issue without
a round trip. Questions go to
[Discussions](https://github.com/gastownhall/beads/discussions).
### Reporting Bugs
Include in your bug report:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Version of bd (`bd version` if implemented)
- Operating system and Go version
### Feature Requests
When proposing new features:
- Explain the use case
- Describe the proposed solution
- Consider backwards compatibility
- Discuss alternatives you've considered
## Your PR Will Not Be Overwritten
@ -368,7 +291,7 @@ docker run --rm -v $(pwd):/workspace -w /workspace nixos/nix \
If the build fails with a `vendorHash` mismatch, run `./scripts/update-nix-vendorhash.sh` to recompute and update `default.nix`, or update it manually with the `got:` hash from the error message and rebuild.
On a PR, this is covered by PR Risk's required `test-nix` job (`.github/workflows/pr-risk.yml`), which runs `nix run .#default -- --help` plus `nix flake check -L` (an evaluation of every flake output; the flake has no test checks) on every PR touching `go.mod`, `go.sum`, `default.nix`, `flake.nix`, or `flake.lock` -- a superset of plain `nix build .#default`. `.github/workflows/nix-build.yml` dropped its own `pull_request` trigger as redundant (F7c, spec-f7.md §2.4) and now only runs `nix build .#default` on push to `main` and on `workflow_dispatch`, so dependabot bumps that invalidate `vendorHash` still fail loudly post-merge instead of silently breaking Nix users on main. For dependabot Go-module bumps specifically, `.github/workflows/update-vendor-hash.yml` runs the same `update-nix-vendorhash.sh` script and pushes the hash bump back to the dependabot branch automatically (note: GitHub does not retrigger `pull_request` workflows for `GITHUB_TOKEN`-authored commits, so a maintainer may need to re-run PR Risk's `test-nix` once after the auto-fix push to mark the gate green).
The `nix build` CI job (`.github/workflows/nix-build.yml`) runs on any PR that touches `go.mod`, `go.sum`, `default.nix`, `flake.nix`, or `flake.lock`, so dependabot bumps that invalidate `vendorHash` fail loudly instead of silently breaking Nix users on main. For dependabot Go-module bumps specifically, `.github/workflows/update-vendor-hash.yml` runs the same `update-nix-vendorhash.sh` script and pushes the hash bump back to the dependabot branch automatically (note: GitHub does not retrigger `pull_request` workflows for `GITHUB_TOKEN`-authored commits, so a maintainer may need to re-run `nix build .#default` once after the auto-fix push to mark the gate green).
### Debugging
@ -386,15 +309,11 @@ dlv debug ./cmd/bd -- create "Test issue"
(For maintainers)
Follow [RELEASING.md](RELEASING.md); it is the canonical release process.
The pre-push version gate requires Go and validates each `v*` release tag
against the checkout's canonical version. A batch containing different release
versions is refused; push only the tag matching this checkout.
`bd preflight` finds the nearest Beads source module by walking ancestor
directories, checking both source markers and the module identity. Its version
check runs directly in Go; `scripts/check-versions.sh` remains a Bash entrypoint.
1. Update version in code
2. Update CHANGELOG.md
3. Tag release: `git tag v0.x.0`
4. Push tag: `git push origin v0.x.0`
5. GitHub Actions will build and publish
## Questions?

View file

@ -1,417 +0,0 @@
module(
name = "beads",
version = "0.0.0",
)
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "rules_go", version = "0.63.0")
# nogo honors //nolint directives through ast.CommentMap ranges, which differ
# from golangci-lint's (a comment trailing `func f(...) {` attaches to the
# body's first statement). This tree's directives were written against
# golangci-lint, so the patch adds golangci-lint's ranges as well.
single_version_override(
module_name = "rules_go",
patch_strip = 1,
patches = ["//third_party/patches:rules_go_nogo_golangci_nolint.patch"],
version = "0.63.0",
)
bazel_dep(name = "gazelle", version = "0.53.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "toolchains_llvm", version = "1.11.0")
# Loaded by @llvm_dist_linux_x86_64's BUILD file (toolchains_llvm's template).
bazel_dep(name = "rules_cc", version = "0.2.17")
# Hermetic C/C++ toolchain, ported from gastownhall/gascity. rules_go builds
# the Go stdlib under -race and every cgo package (mattn/go-sqlite3, gozstd,
# ...) with the registered C toolchain, and every Go compile depends on the
# stdlib, so a host-detected toolchain (local_config_cc: CC=/usr/bin/gcc,
# -fuse-ld=lld only where the CLIENT has lld, gcc-version-specific generated
# inputs) keys those actions to the machine that ran the analysis and fails
# remotely on workers without lld. Instead: LLVM pinned by sha256, plus a
# sysroot of pinned Ubuntu 24.04 packages (the RBE workers' release, so
# binaries load the same glibc and libstdc++ there), byte-identical on every
# Linux x86_64 host. No ICU: beads builds go-mysql-server with its pure-Go
# regex backend (engdocs/ICU-POLICY.md), so nothing may link libicu. .bazelrc
# turns host detection off so nothing falls back to the host compiler;
# scripts/bazel_hermetic_cc_test.go guards both.
deb_sysroot = use_repo_rule("//third_party/cc_toolchain:deb_sysroot.bzl", "deb_sysroot")
# Where every pinned Ubuntu 24.04 package below comes from, tried in order
# (the sha256 pins, not the source, decide what is accepted):
# - gascity's content-addressed mirror, a release holding each pinned
# .deb as <sha256>.deb (gascity's tools/cc_toolchain/mirror_debs.sh
# publishes it; gascity pins the same packages), so a cold fetch does not
# depend on Canonical's servers;
# - the snapshot these packages were pinned from (immutable, but a single
# host that returns 503 for minutes at a time);
# - Launchpad's librarian, which keeps every file ever published to the
# primary archive, superseded versions included;
# - archive.ubuntu.com, which drops superseded versions.
NOBLE_DEB_URLS = [
"https://github.com/gastownhall/gascity/releases/download/toolchain-noble-debs-20261001/{sha256}.deb",
"https://snapshot.ubuntu.com/ubuntu/20261001T000000Z/{path}",
"https://launchpad.net/ubuntu/+archive/primary/+files/{file}",
"https://archive.ubuntu.com/ubuntu/{path}",
]
deb_sysroot(
name = "cc_sysroot_noble_amd64",
packages = {
"pool/main/g/gcc-13/libgcc-13-dev_13.3.0-6ubuntu2~24.04.1_amd64.deb": "cd689db2691edaa10f37329307292796bb599e722e0505c79e14caaa1fe9a93a",
"pool/main/g/gcc-13/libstdc++-13-dev_13.3.0-6ubuntu2~24.04.1_amd64.deb": "ee5633e863e19c3381ed97842ce35ed32ede96a3d1ae4e94c051d3036fe21347",
"pool/main/g/gcc-14/libgcc-s1_14.2.0-4ubuntu2~24.04.1_amd64.deb": "aa7fadbe33b78bcf99885318040601c550c208929565b179891d9a3cc2aa68cd",
"pool/main/g/gcc-14/libstdc++6_14.2.0-4ubuntu2~24.04.1_amd64.deb": "a51f8de7829211db961a31f02158058ad1a95f92ac6d0a5dff6350e2821c54c0",
"pool/main/g/glibc/libc6-dev_2.39-0ubuntu8.9_amd64.deb": "e13d5fcc1b2a86f75bca8e0026a8e39f24fe97ca86e92be79991f8697eb1306f",
"pool/main/g/glibc/libc6_2.39-0ubuntu8.9_amd64.deb": "ff5557d99b51f761c4b7c92368b9cc45565eda17df9bf9eb4b134d09825008be",
"pool/main/l/linux/linux-libc-dev_6.8.0-146.146_amd64.deb": "1a7bb04132d01cd14bea3d615e5861096ca1f70c4659902eb14b36c21993cadc",
},
remove = [
"etc",
"usr/bin",
"usr/sbin",
"usr/share",
"usr/lib/x86_64-linux-gnu/gconv",
"usr/lib/gcc/x86_64-linux-gnu/13/crtoffload*",
"usr/lib/gcc/x86_64-linux-gnu/13/lib*san*",
"usr/lib/gcc/x86_64-linux-gnu/13/libatomic*",
"usr/lib/gcc/x86_64-linux-gnu/13/libbacktrace*",
"usr/lib/gcc/x86_64-linux-gnu/13/libgcov*",
"usr/lib/gcc/x86_64-linux-gnu/13/libgomp*",
"usr/lib/gcc/x86_64-linux-gnu/13/libitm*",
"usr/lib/gcc/x86_64-linux-gnu/13/libquadmath*",
"usr/lib/gcc/x86_64-linux-gnu/13/libstdc++*.a",
],
urls = NOBLE_DEB_URLS,
)
LLVM_VERSION = "22.1.8"
llvm_dist = use_repo_rule("//third_party/cc_toolchain:llvm_dist.bzl", "llvm_dist")
llvm_dist(
name = "llvm_dist_linux_x86_64",
llvm_version = LLVM_VERSION,
members = [
"bin/clang",
"bin/clang++",
"bin/clang-22",
"bin/clang-cpp",
"bin/ld.lld",
"bin/ld64.lld",
"bin/lld",
"bin/llvm-ar",
"bin/llvm-as",
"bin/llvm-cov",
"bin/llvm-install-name-tool",
"bin/llvm-nm",
"bin/llvm-objcopy",
"bin/llvm-objdump",
"bin/llvm-profdata",
"bin/llvm-ranlib",
"bin/llvm-readelf",
"bin/llvm-readobj",
"bin/llvm-strip",
"bin/llvm-symbolizer",
"bin/wasm-ld",
"include/c++",
"include/x86_64-unknown-linux-gnu",
"lib/clang/22/include",
"lib/clang/22/lib/x86_64-unknown-linux-gnu/clang_rt.crtbegin.o",
"lib/clang/22/lib/x86_64-unknown-linux-gnu/clang_rt.crtend.o",
"lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a",
# `bazel coverage` links cgo binaries with -fprofile-instr-generate,
# which pulls in compiler-rt's profile runtime (~170KB).
"lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.profile.a",
],
# LLVM-22.1.8-Linux-X64.tar.xz (sha256 df0e1ecf...0006384), sliced to the
# members above by tools/cc_toolchain/repack_llvm.sh: 149 MB instead of
# 1.94 GB, and no single-threaded xz pass on every cold runner. The files
# are byte-identical to the release's, so no action key changes.
# tools/cc_toolchain/llvm_members.txt must list the same members.
sha256 = "de6147773999137b70ef3d7bd8ecb1e5b91f2a161d02fd09aec591b84516bec5",
sliced = True,
stub_tools = [
"clang-format",
"clang-tidy",
"clangd",
"llvm-dwp",
],
# The sha256 pin, not the host, guarantees the bytes. gascity's release
# asset for now; a beads mirror of the same bytes can be listed first.
urls = [
"https://github.com/gastownhall/gascity/releases/download/toolchain-llvm-22.1.8-slice-1/LLVM-22.1.8-Linux-X64-slice.tar.zst",
],
)
# Every other host (macOS arm64, Linux arm64) runs toolchains_llvm's stock
# LLVM_VERSION release for its platform, pinned by sha256 in toolchains_llvm's
# distribution table and fetched only there. Once any toolchain_root is set,
# toolchains_llvm creates no stock distribution of its own and fails every
# build on a host no root covers. Not hermetic there: no sysroot, so cgo
# uses the host's headers and libraries, as before.
llvm_host_dist = use_repo_rule("@toolchains_llvm//toolchain:rules.bzl", "llvm")
llvm_host_dist(
name = "llvm_dist_host",
llvm_version = LLVM_VERSION,
# The bare rule reads the per-host dict; llvm_toolchain's macro would
# fill it in from llvm_version.
llvm_versions = {"": LLVM_VERSION},
)
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
name = "llvm_toolchain",
# Pair Darwin's host SDK with its native linker. LLVM 22.1.8's ld64.lld
# cannot parse the arm64e.x1 TAPI targets in the macOS 27 SDK. Keep the
# pinned Clang compiler; Linux keeps the bundled LLD and pinned sysroot.
linker = {
"darwin-aarch64": "auto",
"darwin-x86_64": "auto",
},
llvm_version = LLVM_VERSION,
# The sysroot's libstdc++, linked dynamically as host-gcc builds did.
stdlib = {"linux-x86_64": "dynamic-stdc++"},
)
llvm.toolchain_root(
name = "llvm_toolchain",
label = "@llvm_dist_linux_x86_64//:BUILD.bazel",
targets = ["linux-x86_64"],
)
llvm.toolchain_root(
name = "llvm_toolchain",
label = "@llvm_dist_host//:BUILD.bazel",
)
llvm.sysroot(
name = "llvm_toolchain",
label = "@cc_sysroot_noble_amd64//:sysroot",
targets = ["linux-x86_64"],
)
use_repo(llvm, "llvm_toolchain")
register_toolchains("@llvm_toolchain//:all")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(
name = "go_sdk",
version = "1.26.7",
)
use_repo(go_sdk, "go_sdk")
# nogo: //tools/nogo's analyzers (go test's vet checks plus the golangci-lint
# linters .golangci.yml enables) run beside every first-party Go compile, so
# a finding fails `bazel build`/`bazel test` wherever it executes (RBE
# included). External repos only feed analyzer facts; they are not validated.
go_sdk.nogo(
includes = ["//:__subpackages__"],
nogo = "//tools/nogo",
)
# gazelle compiles fetch_repo and gazelle, which every go_deps repository
# runs, with `go build` in a repository rule before any go_deps fetch can
# start (18-24 s of every CI lane's loading). This substitute serves those
# reproducible binaries from the repository cache by pinned sha256 and builds
# them from source on a miss (tools/bazel/go_repository_tools.bzl).
gazelle_non_module_deps = use_extension("@gazelle//internal/bzlmod:non_module_deps.bzl", "non_module_deps")
go_repository_tools = use_repo_rule("//tools/bazel:go_repository_tools.bzl", "go_repository_tools")
go_repository_tools(name = "gazelle_go_repository_tools")
override_repo(
gazelle_non_module_deps,
bazel_gazelle_go_repository_tools = "gazelle_go_repository_tools",
)
# gazelle.go.work joins the beads module and the nogo analyzers' module
# (tools/nogo/go.mod) into one dependency graph for Bazel only; `go build` in
# the repository root never reads it (it is not named go.work).
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_work = "//:gazelle.go.work")
# beads builds go-mysql-server with its stdlib-regex backend (ICU policy):
# gazelle must see gms_pure_go as satisfied so it selects regex_pure.go and
# drops the go-icu-regex (libicu, cgo) edge entirely.
go_deps.gazelle_override(
directives = [
"gazelle:build_tags gms_pure_go",
"gazelle:exclude internal/regex/regex_cgo.go",
],
path = "github.com/dolthub/go-mysql-server",
)
# protoc-gen-validate ships validate/validate.pb.go, so its Go library can
# compile from the checked-in code. Its own validate/BUILD instead makes the
# Go library a go_proto_library, so every lane built protoc from source just
# to regenerate that file: about 4.5k C++ compile, link and archive actions,
# each carrying the LLVM toolchain as inputs. The module reaches the graph
# only through grpc xds and the cloud SDKs. Gazelle regenerates its BUILD
# files with proto rules off; build_file_name makes it write BUILD.bazel (which
# Bazel prefers) rather than merge into the upstream BUILD files.
go_deps.gazelle_override(
build_file_generation = "on",
directives = [
"gazelle:build_file_name BUILD.bazel",
"gazelle:proto disable",
],
path = "github.com/envoyproxy/protoc-gen-validate",
)
go_deps.module_override(
patch_strip = 1,
patches = ["//third_party/patches:eventsapi_schema_build.patch"],
path = "github.com/dolthub/eventsapi_schema",
)
go_deps.module_override(
patch_strip = 1,
patches = ["//third_party/patches:flatbuffers_v23_importpath.patch"],
path = "github.com/dolthub/flatbuffers/v23",
)
go_deps.module_override(
patch_strip = 1,
patches = ["//third_party/patches:dolt_go_serial.patch"],
path = "github.com/dolthub/dolt/go",
)
# Pure-Go stubs so --config=pure can compile dolt's store/nbs (see the patch).
go_deps.module_override(
patch_strip = 1,
patches = ["//third_party/patches:gozstd_nocgo.patch"],
path = "github.com/dolthub/gozstd",
)
# nogo does not analyze the standard library, so ctrlflow has no noReturn
# facts for t.Fatal, log.Fatal, os.Exit, ...; buildssa (unparam) and the vet
# passes then treat them as returning, unlike golangci-lint and go vet. The
# patch makes ctrlflow know those standard-library functions intrinsically.
go_deps.module_override(
patch_strip = 1,
patches = ["//third_party/patches:x_tools_ctrlflow_stdlib_noreturn.patch"],
path = "golang.org/x/tools",
)
use_repo(go_deps, "cc_mvdan_unparam", "com_github_anthropics_anthropic_sdk_go", "com_github_ashanbrown_forbidigo_v2", "com_github_burntsushi_toml", "com_github_cenkalti_backoff_v4", "com_github_charmbracelet_x_ansi", "com_github_creack_pty", "com_github_data_dog_go_sqlmock", "com_github_dolthub_dolt_go", "com_github_dolthub_driver_v2", "com_github_dolthub_eventkit", "com_github_dolthub_go_mysql_server", "com_github_dolthub_vitess", "com_github_go_sql_driver_mysql", "com_github_golangci_misspell", "com_github_golangci_unconvert", "com_github_google_uuid", "com_github_gowebpki_jcs", "com_github_invopop_jsonschema", "com_github_johanneskaufmann_html_to_markdown_v2", "com_github_kisielk_errcheck", "com_github_mattn_go_sqlite3", "com_github_microcosm_cc_bluemonday", "com_github_oapi_codegen_oapi_codegen_v2", "com_github_olebedev_when", "com_github_openpeedeep_depguard_v2", "com_github_securego_gosec_v2", "com_github_spf13_cobra", "com_github_spf13_pflag", "com_github_spf13_viper", "com_github_stretchr_testify", "com_github_subosito_gotenv", "com_github_testcontainers_testcontainers_go", "com_github_testcontainers_testcontainers_go_modules_dolt", "com_github_yuin_goldmark", "in_gopkg_yaml_v3", "io_opentelemetry_go_otel", "io_opentelemetry_go_otel_exporters_otlp_otlpmetric_otlpmetrichttp", "io_opentelemetry_go_otel_exporters_stdout_stdoutmetric", "io_opentelemetry_go_otel_exporters_stdout_stdouttrace", "io_opentelemetry_go_otel_metric", "io_opentelemetry_go_otel_sdk", "io_opentelemetry_go_otel_sdk_metric", "io_opentelemetry_go_otel_trace", "io_rsc_script", "land_charm_glamour_v2", "land_charm_huh_v2", "land_charm_lipgloss_v2", "org_go_simpler_sloglint", "org_golang_x_mod", "org_golang_x_net", "org_golang_x_sync", "org_golang_x_sys", "org_golang_x_term", "org_golang_x_tools")
# Hermetic Dolt CLI for tests (tools/bazel/dolt.bzl pins the release to
# scripts/ci/install-dolt.sh). //tools/bazel:dolt selects the repository for
# the execution platform, so only that tarball is downloaded.
dolt_release = use_repo_rule("//tools/bazel:dolt.bzl", "dolt_release")
dolt_release(
name = "dolt_linux_amd64",
platform = "linux-amd64",
)
dolt_release(
name = "dolt_linux_arm64",
platform = "linux-arm64",
)
dolt_release(
name = "dolt_darwin_amd64",
platform = "darwin-amd64",
)
dolt_release(
name = "dolt_darwin_arm64",
platform = "darwin-arm64",
)
# The migration corpus's external Dolt runtime (scripts/migration-test/lib/
# versions.sh DOLT_TEST_RUNTIME_VERSION): an older release than DOLT_VERSION,
# deliberately, as the historical server-Dolt fixtures' host.
dolt_release(
name = "dolt_test_runtime_linux_amd64",
platform = "linux-amd64",
version = "2.1.8",
)
# The tracked release formula, for //scripts:shell_scripts_test and the
# whole-checkout guard //scripts/repochecks:go_install_guidance_test. .beads/
# also holds live bd data and is in .bazelignore, so no main-repo target can
# declare the formula; this local repository exposes only .beads/formulas.
new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
new_local_repository(
name = "beads_formulas",
build_file_content = """exports_files(
glob(["*.formula.toml"]),
visibility = [
"@@//scripts:__pkg__",
"@@//scripts/repochecks:__pkg__",
],
)
""",
path = ".beads/formulas",
)
# Historical bd releases for the regression, migration and cross-version
# suites (tools/bazel/bd_releases.bzl): one repository per release in the
# release catalog that records a linux_amd64 asset digest, behind the
# @bd_releases hub. Adding a release is a catalog change only.
bd_releases = use_extension("//tools/bazel:bd_releases.bzl", "bd_releases")
bd_releases.catalog(path = "//scripts:migration-test/release-catalog.json")
use_repo(bd_releases, "bd_releases")
# The source-tag SQLite release (v0.9.1) has no release asset: the migration
# corpus builds it from its module source with the Go release it was
# qualified on, offline (//tests/migration:bd_source_tag). The proxy files
# are pinned in tests/migration/source_tag_modules.json, the toolchain here.
go_module_proxy = use_repo_rule("//tools/bazel:go_module_proxy.bzl", "go_module_proxy")
go_module_proxy(
name = "bd_source_tag_goproxy",
lock = "//tests/migration:source_tag_modules.json",
)
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "go_1_25_0_linux_amd64",
build_file_content = """exports_files(
["go/bin/go"],
visibility = ["//visibility:public"],
)
filegroup(
name = "sdk",
srcs = glob(["go/**"]),
visibility = ["//visibility:public"],
)
""",
sha256 = "2852af0cb20a13139b3448992e69b868e50ed0f8a1e5940ee1de9e19a123b613",
urls = ["https://go.dev/dl/go1.25.0.linux-amd64.tar.gz"],
)
# The timeout implementations //tests/hook_timeout_backends runs the tracked
# git hook shims against (formerly checks.nix's hook-timeout-backends, which
# took them from nixpkgs): static x86_64 builds, so the test needs nothing
# from the executor beyond a shell, perl and GNU coreutils.
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
http_file(
name = "busybox_static",
executable = True,
sha256 = "6e123e7f3202a8c1e9b1f94d8941580a25135382b99e8d3e34fb858bba311348",
urls = ["https://busybox.net/downloads/binaries/1.35.0-x86_64-linux-musl/busybox"],
)
http_file(
name = "toybox_static",
executable = True,
sha256 = "38e03ffd8aead8ca26833e1e5c90a9ea7250f3719c29d779ebff7aa55c9d2dac",
urls = ["https://landley.net/toybox/downloads/binaries/0.8.15/toybox-x86_64"],
)
http_archive(
name = "uutils_coreutils",
build_file_content = """exports_files(
["coreutils"],
visibility = ["//visibility:public"],
)
""",
sha256 = "9b555b01457279bcc3e46753f0ef324fd3d02a0535111200a4632d1297263b54",
strip_prefix = "coreutils-0.12.0-x86_64-unknown-linux-musl",
urls = ["https://github.com/uutils/coreutils/releases/download/0.12.0/coreutils-0.12.0-x86_64-unknown-linux-musl.tar.gz"],
)

853
MODULE.bazel.lock generated
View file

@ -1,853 +0,0 @@
{
"lockFileVersion": 28,
"registryFileHashes": {
"https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497",
"https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2",
"https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589",
"https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0",
"https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb",
"https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16",
"https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915",
"https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed",
"https://bcr.bazel.build/modules/abseil-cpp/20240116.2/MODULE.bazel": "73939767a4686cd9a520d16af5ab440071ed75cec1a876bf2fcfaf1f71987a16",
"https://bcr.bazel.build/modules/abseil-cpp/20250127.1/MODULE.bazel": "c4a89e7ceb9bf1e25cf84a9f830ff6b817b72874088bf5141b314726e46a57c1",
"https://bcr.bazel.build/modules/abseil-cpp/20250512.1/MODULE.bazel": "d209fdb6f36ffaf61c509fcc81b19e81b411a999a934a032e10cd009a0226215",
"https://bcr.bazel.build/modules/abseil-cpp/20250814.1/MODULE.bazel": "51f2312901470cdab0dbdf3b88c40cd21c62a7ed58a3de45b365ddc5b11bcab2",
"https://bcr.bazel.build/modules/abseil-cpp/20250814.1/source.json": "cea3901d7e299da7320700abbaafe57a65d039f10d0d7ea601c4a66938ea4b0c",
"https://bcr.bazel.build/modules/apple_support/1.11.1/MODULE.bazel": "1843d7cd8a58369a444fc6000e7304425fba600ff641592161d9f15b179fb896",
"https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel": "a0556fefca0b1bb2de8567b8827518f94db6a6e7e7d632b4c48dc5f865bc7c85",
"https://bcr.bazel.build/modules/apple_support/1.21.0/MODULE.bazel": "ac1824ed5edf17dee2fdd4927ada30c9f8c3b520be1b5fd02a5da15bc10bff3e",
"https://bcr.bazel.build/modules/apple_support/1.21.1/MODULE.bazel": "5809fa3efab15d1f3c3c635af6974044bac8a4919c62238cce06acee8a8c11f1",
"https://bcr.bazel.build/modules/apple_support/2.5.2/MODULE.bazel": "bb1b7081e390a8d3885f642cb0073dfcf8e7a36525e079fa8f5835af7079c0fe",
"https://bcr.bazel.build/modules/apple_support/2.5.2/source.json": "dd51ee925a550e92b55eb41c4c809a967da311a2d2520241252a238a48b39c4c",
"https://bcr.bazel.build/modules/aspect_bazel_lib/2.14.0/MODULE.bazel": "2b31ffcc9bdc8295b2167e07a757dbbc9ac8906e7028e5170a3708cecaac119f",
"https://bcr.bazel.build/modules/aspect_bazel_lib/2.19.3/MODULE.bazel": "253d739ba126f62a5767d832765b12b59e9f8d2bc88cc1572f4a73e46eb298ca",
"https://bcr.bazel.build/modules/aspect_bazel_lib/2.19.3/source.json": "ffab9254c65ba945f8369297ad97ca0dec213d3adc6e07877e23a48624a8b456",
"https://bcr.bazel.build/modules/aspect_bazel_lib/2.8.1/MODULE.bazel": "812d2dd42f65dca362152101fbec418029cc8fd34cbad1a2fde905383d705838",
"https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd",
"https://bcr.bazel.build/modules/bazel_features/1.10.0/MODULE.bazel": "f75e8807570484a99be90abcd52b5e1f390362c258bcb73106f4544957a48101",
"https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8",
"https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d",
"https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d",
"https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a",
"https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58",
"https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b",
"https://bcr.bazel.build/modules/bazel_features/1.23.0/MODULE.bazel": "fd1ac84bc4e97a5a0816b7fd7d4d4f6d837b0047cf4cbd81652d616af3a6591a",
"https://bcr.bazel.build/modules/bazel_features/1.27.0/MODULE.bazel": "621eeee06c4458a9121d1f104efb80f39d34deff4984e778359c60eaf1a8cb65",
"https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d",
"https://bcr.bazel.build/modules/bazel_features/1.3.0/MODULE.bazel": "cdcafe83ec318cda34e02948e81d790aab8df7a929cec6f6969f13a489ccecd9",
"https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87",
"https://bcr.bazel.build/modules/bazel_features/1.33.0/MODULE.bazel": "8b8dc9d2a4c88609409c3191165bccec0e4cb044cd7a72ccbe826583303459f6",
"https://bcr.bazel.build/modules/bazel_features/1.34.0/MODULE.bazel": "e8475ad7c8965542e0c7aac8af68eb48c4af904be3d614b6aa6274c092c2ea1e",
"https://bcr.bazel.build/modules/bazel_features/1.36.0/MODULE.bazel": "596cb62090b039caf1cad1d52a8bc35cf188ca9a4e279a828005e7ee49a1bec3",
"https://bcr.bazel.build/modules/bazel_features/1.38.0/MODULE.bazel": "f9b8a9c890ebd216b4049fd12a31d3c2602e3403c7af636b04fbbd7453edc9c9",
"https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7",
"https://bcr.bazel.build/modules/bazel_features/1.42.1/MODULE.bazel": "275a59b5406ff18c01739860aa70ad7ccb3cfb474579411decca11c93b951080",
"https://bcr.bazel.build/modules/bazel_features/1.42.1/source.json": "fcd4396b2df85f64f2b3bb436ad870793ecf39180f1d796f913cc9276d355309",
"https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b",
"https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a",
"https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8",
"https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e",
"https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686",
"https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a",
"https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5",
"https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d",
"https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651",
"https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138",
"https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917",
"https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d",
"https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b",
"https://bcr.bazel.build/modules/bazel_skylib/1.8.1/MODULE.bazel": "88ade7293becda963e0e3ea33e7d54d3425127e0a326e0d17da085a5f1f03ff6",
"https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67",
"https://bcr.bazel.build/modules/bazel_skylib/1.8.2/source.json": "34a3c8bcf233b835eb74be9d628899bb32999d3e0eadef1947a0a562a2b16ffb",
"https://bcr.bazel.build/modules/buildozer/8.5.1/MODULE.bazel": "a35d9561b3fc5b18797c330793e99e3b834a473d5fbd3d7d7634aafc9bdb6f8f",
"https://bcr.bazel.build/modules/buildozer/8.5.1/source.json": "e3386e6ff4529f2442800dee47ad28d3e6487f36a1f75ae39ae56c70f0cd2fbd",
"https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/MODULE.bazel": "cdf8cbe5ee750db04b78878c9633cc76e80dcf4416cbe982ac3a9222f80713c8",
"https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/source.json": "fa7b512dfcb5eafd90ce3959cf42a2a6fe96144ebbb4b3b3928054895f2afac2",
"https://bcr.bazel.build/modules/gazelle/0.51.3/MODULE.bazel": "618a729142f66de1e2cb776d026413763be5b80d5e3d29ffb9d3d90c5defde90",
"https://bcr.bazel.build/modules/gazelle/0.53.0/MODULE.bazel": "76158efbaf12e35ae17af02f4a715bc6e7b3b410c693d34f422922ff4a56a925",
"https://bcr.bazel.build/modules/gazelle/0.53.0/source.json": "1f5a4dd0399e5a20e0daeaa3ba1f42391a1b909bc3d337f7a62d3216ddbdfad0",
"https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb",
"https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4",
"https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6",
"https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f",
"https://bcr.bazel.build/modules/googletest/1.15.2/MODULE.bazel": "6de1edc1d26cafb0ea1a6ab3f4d4192d91a312fd2d360b63adaa213cd00b2108",
"https://bcr.bazel.build/modules/googletest/1.17.0/MODULE.bazel": "dbec758171594a705933a29fcf69293d2468c49ec1f2ebca65c36f504d72df46",
"https://bcr.bazel.build/modules/googletest/1.17.0/source.json": "38e4454b25fc30f15439c0378e57909ab1fd0a443158aa35aec685da727cd713",
"https://bcr.bazel.build/modules/jq.bzl/0.1.0/MODULE.bazel": "2ce69b1af49952cd4121a9c3055faa679e748ce774c7f1fda9657f936cae902f",
"https://bcr.bazel.build/modules/jq.bzl/0.1.0/source.json": "746bf13cac0860f091df5e4911d0c593971cd8796b5ad4e809b2f8e133eee3d5",
"https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075",
"https://bcr.bazel.build/modules/jsoncpp/1.9.6/MODULE.bazel": "2f8d20d3b7d54143213c4dfc3d98225c42de7d666011528dc8fe91591e2e17b0",
"https://bcr.bazel.build/modules/jsoncpp/1.9.6/source.json": "a04756d367a2126c3541682864ecec52f92cdee80a35735a3cb249ce015ca000",
"https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902",
"https://bcr.bazel.build/modules/mboworks_bzl/0.5.1/MODULE.bazel": "20c921aded4f4e00a6128dad47a843371c196ba8987474c11c8ba7b9da8c16f1",
"https://bcr.bazel.build/modules/mboworks_bzl/0.5.1/source.json": "3d9086bb203475113a16afb0ca0c9b97fdb37fc6e5a62b604b60ffc2450dc8c5",
"https://bcr.bazel.build/modules/nlohmann_json/3.6.1/MODULE.bazel": "6f7b417dcc794d9add9e556673ad25cb3ba835224290f4f848f8e2db1e1fca74",
"https://bcr.bazel.build/modules/nlohmann_json/3.6.1/source.json": "f448c6e8963fdfa7eb831457df83ad63d3d6355018f6574fb017e8169deb43a9",
"https://bcr.bazel.build/modules/package_metadata/0.0.2/MODULE.bazel": "fb8d25550742674d63d7b250063d4580ca530499f045d70748b1b142081ebb92",
"https://bcr.bazel.build/modules/package_metadata/0.0.3/MODULE.bazel": "77890552ecea9e284b5424c9de827a58099348763a4359e975c359a83d4faa83",
"https://bcr.bazel.build/modules/package_metadata/0.0.5/MODULE.bazel": "ef4f9439e3270fdd6b9fd4dbc3d2f29d13888e44c529a1b243f7a31dfbc2e8e4",
"https://bcr.bazel.build/modules/package_metadata/0.0.5/source.json": "2326db2f6592578177751c3e1f74786b79382cd6008834c9d01ec865b9126a85",
"https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5",
"https://bcr.bazel.build/modules/platforms/0.0.11/MODULE.bazel": "0daefc49732e227caa8bfa834d65dc52e8cc18a2faf80df25e8caea151a9413f",
"https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee",
"https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37",
"https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615",
"https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814",
"https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d",
"https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc",
"https://bcr.bazel.build/modules/platforms/1.0.0/MODULE.bazel": "f05feb42b48f1b3c225e4ccf351f367be0371411a803198ec34a389fb22aa580",
"https://bcr.bazel.build/modules/platforms/1.1.0/MODULE.bazel": "1c0c09f5bdcf4b3f924720d2478a3711cb39f4977019ca5988685e5b7e18b3d2",
"https://bcr.bazel.build/modules/platforms/1.1.0/source.json": "fcf351c47596c939140ab0d333dfdd08ed1ea6ce33c2fe70c12493a301cf1344",
"https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7",
"https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c",
"https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d",
"https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df",
"https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92",
"https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e",
"https://bcr.bazel.build/modules/protobuf/29.1/MODULE.bazel": "557c3457560ff49e122ed76c0bc3397a64af9574691cb8201b4e46d4ab2ecb95",
"https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0",
"https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858",
"https://bcr.bazel.build/modules/protobuf/32.1/MODULE.bazel": "89cd2866a9cb07fee9ff74c41ceace11554f32e0d849de4e23ac55515cfada4d",
"https://bcr.bazel.build/modules/protobuf/33.4/MODULE.bazel": "114775b816b38b6d0ca620450d6b02550c60ceedfdc8d9a229833b34a223dc42",
"https://bcr.bazel.build/modules/protobuf/33.4/source.json": "555f8686b4c7d6b5ba731fbea13bf656b4bfd9a7ff629c1d9d3f6e1d6155de79",
"https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e",
"https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/MODULE.bazel": "e6f4c20442eaa7c90d7190d8dc539d0ab422f95c65a57cc59562170c58ae3d34",
"https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/source.json": "6900fdc8a9e95866b8c0d4ad4aba4d4236317b5c1cd04c502df3f0d33afed680",
"https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206",
"https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/MODULE.bazel": "b4963dda9b31080be1905ef085ecd7dd6cd47c05c79b9cdf83ade83ab2ab271a",
"https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/source.json": "2ff292be6ef3340325ce8a045ecc326e92cbfab47c7cbab4bd85d28971b97ac4",
"https://bcr.bazel.build/modules/re2/2024-07-02/MODULE.bazel": "0eadc4395959969297cbcf31a249ff457f2f1d456228c67719480205aa306daa",
"https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8",
"https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e",
"https://bcr.bazel.build/modules/rules_apple/3.16.0/MODULE.bazel": "0d1caf0b8375942ce98ea944be754a18874041e4e0459401d925577624d3a54a",
"https://bcr.bazel.build/modules/rules_apple/4.1.0/MODULE.bazel": "76e10fd4a48038d3fc7c5dc6e63b7063bbf5304a2e3bd42edda6ec660eebea68",
"https://bcr.bazel.build/modules/rules_apple/4.1.0/source.json": "8ee81e1708756f81b343a5eb2b2f0b953f1d25c4ab3d4a68dc02754872e80715",
"https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647",
"https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002",
"https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191",
"https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc",
"https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87",
"https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a",
"https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c",
"https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f",
"https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e",
"https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5",
"https://bcr.bazel.build/modules/rules_cc/0.1.1/MODULE.bazel": "2f0222a6f229f0bf44cd711dc13c858dad98c62d52bd51d8fc3a764a83125513",
"https://bcr.bazel.build/modules/rules_cc/0.1.2/MODULE.bazel": "557ddc3a96858ec0d465a87c0a931054d7dcfd6583af2c7ed3baf494407fd8d0",
"https://bcr.bazel.build/modules/rules_cc/0.1.5/MODULE.bazel": "88dfc9361e8b5ae1008ac38f7cdfd45ad738e4fa676a3ad67d19204f045a1fd8",
"https://bcr.bazel.build/modules/rules_cc/0.2.0/MODULE.bazel": "b5c17f90458caae90d2ccd114c81970062946f49f355610ed89bebf954f5783c",
"https://bcr.bazel.build/modules/rules_cc/0.2.13/MODULE.bazel": "eecdd666eda6be16a8d9dc15e44b5c75133405e820f620a234acc4b1fdc5aa37",
"https://bcr.bazel.build/modules/rules_cc/0.2.15/MODULE.bazel": "6a0a4a75a57aa6dc888300d848053a58c6b12a29f89d4304e1c41448514ec6e8",
"https://bcr.bazel.build/modules/rules_cc/0.2.17/MODULE.bazel": "1849602c86cb60da8613d2de887f9566a6d354a6df6d7009f9d04a14402f9a84",
"https://bcr.bazel.build/modules/rules_cc/0.2.17/source.json": "3832f45d145354049137c0090df04629d9c2b5493dc5c2bf46f1834040133a07",
"https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6",
"https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8",
"https://bcr.bazel.build/modules/rules_go/0.63.0/MODULE.bazel": "a2079e783a5d2715a90e6e2970ec8ffd717a487ff2aecb5f553e3975c5294a21",
"https://bcr.bazel.build/modules/rules_go/0.63.0/source.json": "5bf37b45c440ac03abad0cbfa8b8b8dd89cc4e82bc8305f468b8436fa58bae78",
"https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74",
"https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86",
"https://bcr.bazel.build/modules/rules_java/6.3.0/MODULE.bazel": "a97c7678c19f236a956ad260d59c86e10a463badb7eb2eda787490f4c969b963",
"https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31",
"https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a",
"https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6",
"https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab",
"https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe",
"https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017",
"https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939",
"https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2",
"https://bcr.bazel.build/modules/rules_java/9.1.0/MODULE.bazel": "ee63f27e36a3fada80342869361182f120a9819c74320e8e65b1e04ba0cd7a9d",
"https://bcr.bazel.build/modules/rules_java/9.1.0/source.json": "da589573c1dee2c9ac4a568b301269a2e8191110ff0345c1a959fa7ea6c4dfd6",
"https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7",
"https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909",
"https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036",
"https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0",
"https://bcr.bazel.build/modules/rules_jvm_external/6.7/MODULE.bazel": "e717beabc4d091ecb2c803c2d341b88590e9116b8bf7947915eeb33aab4f96dd",
"https://bcr.bazel.build/modules/rules_jvm_external/6.7/source.json": "5426f412d0a7fc6b611643376c7e4a82dec991491b9ce5cb1cfdd25fe2e92be4",
"https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3",
"https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5",
"https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0",
"https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d",
"https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c",
"https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb",
"https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc",
"https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff",
"https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a",
"https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06",
"https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7",
"https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "1e5b502e2e1a9e825eef74476a5a1ee524a92297085015a052510b09a1a09483",
"https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73",
"https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2",
"https://bcr.bazel.build/modules/rules_proto/7.1.0/MODULE.bazel": "002d62d9108f75bb807cd56245d45648f38275cb3a99dcd45dfb864c5d74cb96",
"https://bcr.bazel.build/modules/rules_proto/7.1.0/source.json": "39f89066c12c24097854e8f57ab8558929f9c8d474d34b2c00ac04630ad8940e",
"https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f",
"https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300",
"https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382",
"https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed",
"https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58",
"https://bcr.bazel.build/modules/rules_python/0.33.2/MODULE.bazel": "3e036c4ad8d804a4dad897d333d8dce200d943df4827cb849840055be8d2e937",
"https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c",
"https://bcr.bazel.build/modules/rules_python/1.3.0/MODULE.bazel": "8361d57eafb67c09b75bf4bbe6be360e1b8f4f18118ab48037f2bd50aa2ccb13",
"https://bcr.bazel.build/modules/rules_python/1.4.1/MODULE.bazel": "8991ad45bdc25018301d6b7e1d3626afc3c8af8aaf4bc04f23d0b99c938b73a6",
"https://bcr.bazel.build/modules/rules_python/1.6.0/MODULE.bazel": "7e04ad8f8d5bea40451cf80b1bd8262552aa73f841415d20db96b7241bd027d8",
"https://bcr.bazel.build/modules/rules_python/1.7.0/MODULE.bazel": "d01f995ecd137abf30238ad9ce97f8fc3ac57289c8b24bd0bf53324d937a14f8",
"https://bcr.bazel.build/modules/rules_python/1.7.0/source.json": "028a084b65dcf8f4dc4f82f8778dbe65df133f234b316828a82e060d81bdce32",
"https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c",
"https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b",
"https://bcr.bazel.build/modules/rules_shell/0.4.1/MODULE.bazel": "00e501db01bbf4e3e1dd1595959092c2fadf2087b2852d3f553b5370f5633592",
"https://bcr.bazel.build/modules/rules_shell/0.6.1/MODULE.bazel": "72e76b0eea4e81611ef5452aa82b3da34caca0c8b7b5c0c9584338aa93bae26b",
"https://bcr.bazel.build/modules/rules_shell/0.6.1/source.json": "20ec05cd5e592055e214b2da8ccb283c7f2a421ea0dc2acbf1aa792e11c03d0c",
"https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca",
"https://bcr.bazel.build/modules/rules_swift/2.1.1/MODULE.bazel": "494900a80f944fc7aa61500c2073d9729dff0b764f0e89b824eb746959bc1046",
"https://bcr.bazel.build/modules/rules_swift/2.4.0/MODULE.bazel": "1639617eb1ede28d774d967a738b4a68b0accb40650beadb57c21846beab5efd",
"https://bcr.bazel.build/modules/rules_swift/3.1.2/MODULE.bazel": "72c8f5cf9d26427cee6c76c8e3853eb46ce6b0412a081b2b6db6e8ad56267400",
"https://bcr.bazel.build/modules/rules_swift/3.1.2/source.json": "e85761f3098a6faf40b8187695e3de6d97944e98abd0d8ce579cb2daf6319a66",
"https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8",
"https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c",
"https://bcr.bazel.build/modules/stardoc/0.6.2/MODULE.bazel": "7060193196395f5dd668eda046ccbeacebfd98efc77fed418dbe2b82ffaa39fd",
"https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c",
"https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5",
"https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216",
"https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/MODULE.bazel": "5e463fbfba7b1701d957555ed45097d7f984211330106ccd1352c6e0af0dcf91",
"https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.2/MODULE.bazel": "75aab2373a4bbe2a1260b9bf2a1ebbdbf872d3bd36f80bff058dccd82e89422f",
"https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.2/source.json": "5fba48bbe0ba48761f9e9f75f92876cafb5d07c0ce059cc7a8027416de94a05b",
"https://bcr.bazel.build/modules/tar.bzl/0.2.1/MODULE.bazel": "52d1c00a80a8cc67acbd01649e83d8dd6a9dc426a6c0b754a04fe8c219c76468",
"https://bcr.bazel.build/modules/tar.bzl/0.6.0/MODULE.bazel": "a3584b4edcfafcabd9b0ef9819808f05b372957bbdff41601429d5fd0aac2e7c",
"https://bcr.bazel.build/modules/tar.bzl/0.6.0/source.json": "4a620381df075a16cb3a7ed57bd1d05f7480222394c64a20fa51bdb636fda658",
"https://bcr.bazel.build/modules/toolchains_llvm/1.11.0/MODULE.bazel": "c0b9c103deeaf0fc103934ff0a189273b4f9b82cc1622c59b67e1c3a83d6b5e6",
"https://bcr.bazel.build/modules/toolchains_llvm/1.11.0/source.json": "d06e53520101c3890a094e5849b0ff16dde3a6f6531f25c997f340ebff34d569",
"https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43",
"https://bcr.bazel.build/modules/yq.bzl/0.1.1/MODULE.bazel": "9039681f9bcb8958ee2c87ffc74bdafba9f4369096a2b5634b88abc0eaefa072",
"https://bcr.bazel.build/modules/yq.bzl/0.1.1/source.json": "2d2bad780a9f2b9195a4a370314d2c17ae95eaa745cefc2e12fbc49759b15aa3",
"https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0",
"https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27",
"https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "eec517b5bbe5492629466e11dae908d043364302283de25581e3eb944326c4ca",
"https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/source.json": "22bc55c47af97246cfc093d0acf683a7869377de362b5d1c552c2c2e16b7a806",
"https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198"
},
"selectedYankedVersions": {},
"moduleExtensions": {
"@@pybind11_bazel+//:internal_configure.bzl%internal_configure_extension": {
"general": {
"bzlTransitiveDigest": "BsgERqYptkJeeC8wFaLj251IoTZTSy/58WA6kVp0q8I=",
"usagesDigest": "D1r3lfzMuUBFxgG8V6o0bQTLMk3GkaGOaPzw53wrwyw=",
"recordedInputs": [
"REPO_MAPPING:pybind11_bazel+,bazel_tools bazel_tools",
"FILE:@@pybind11_bazel+//MODULE.bazel e6f4c20442eaa7c90d7190d8dc539d0ab422f95c65a57cc59562170c58ae3d34"
],
"generatedRepoSpecs": {
"pybind11": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"build_file": "@@pybind11_bazel+//:pybind11-BUILD.bazel",
"strip_prefix": "pybind11-2.12.0",
"urls": [
"https://github.com/pybind/pybind11/archive/v2.12.0.zip"
]
}
}
}
}
},
"@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": {
"general": {
"bzlTransitiveDigest": "WDuVCwqV73DvcHB5Of+02lhUZgPxr9MqtpvMRyUi0eQ=",
"usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=",
"recordedInputs": [
"REPO_MAPPING:rules_kotlin+,bazel_tools bazel_tools"
],
"generatedRepoSpecs": {
"com_github_jetbrains_kotlin_git": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository",
"attributes": {
"urls": [
"https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip"
],
"sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88"
}
},
"com_github_jetbrains_kotlin": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository",
"attributes": {
"git_repository_name": "com_github_jetbrains_kotlin_git",
"compiler_version": "1.9.23"
}
},
"com_github_google_ksp": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository",
"attributes": {
"urls": [
"https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip"
],
"sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d",
"strip_version": "1.9.23-1.0.20"
}
},
"com_github_pinterest_ktlint": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file",
"attributes": {
"sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985",
"urls": [
"https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint"
],
"executable": true
}
},
"rules_android": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
"strip_prefix": "rules_android-0.1.1",
"urls": [
"https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"
]
}
}
}
}
},
"@@rules_python+//python/extensions:config.bzl%config": {
"general": {
"bzlTransitiveDigest": "L+2ZCpb7GIJqvWaXpzkfk/80d916sIFVmSPzrSm6of8=",
"usagesDigest": "ZVSXMAGpD+xzVNPuvF1IoLBkty7TROO0+akMapt1pAg=",
"recordedInputs": [
"REPO_MAPPING:rules_python+,bazel_tools bazel_tools",
"REPO_MAPPING:rules_python+,pypi__build rules_python++config+pypi__build",
"REPO_MAPPING:rules_python+,pypi__click rules_python++config+pypi__click",
"REPO_MAPPING:rules_python+,pypi__colorama rules_python++config+pypi__colorama",
"REPO_MAPPING:rules_python+,pypi__importlib_metadata rules_python++config+pypi__importlib_metadata",
"REPO_MAPPING:rules_python+,pypi__installer rules_python++config+pypi__installer",
"REPO_MAPPING:rules_python+,pypi__more_itertools rules_python++config+pypi__more_itertools",
"REPO_MAPPING:rules_python+,pypi__packaging rules_python++config+pypi__packaging",
"REPO_MAPPING:rules_python+,pypi__pep517 rules_python++config+pypi__pep517",
"REPO_MAPPING:rules_python+,pypi__pip rules_python++config+pypi__pip",
"REPO_MAPPING:rules_python+,pypi__pip_tools rules_python++config+pypi__pip_tools",
"REPO_MAPPING:rules_python+,pypi__pyproject_hooks rules_python++config+pypi__pyproject_hooks",
"REPO_MAPPING:rules_python+,pypi__setuptools rules_python++config+pypi__setuptools",
"REPO_MAPPING:rules_python+,pypi__tomli rules_python++config+pypi__tomli",
"REPO_MAPPING:rules_python+,pypi__wheel rules_python++config+pypi__wheel",
"REPO_MAPPING:rules_python+,pypi__zipp rules_python++config+pypi__zipp"
],
"generatedRepoSpecs": {
"rules_python_internal": {
"repoRuleId": "@@rules_python+//python/private:internal_config_repo.bzl%internal_config_repo",
"attributes": {
"transition_setting_generators": {},
"transition_settings": []
}
},
"pypi__build": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/e2/03/f3c8ba0a6b6e30d7d18c40faab90807c9bb5e9a1e3b2fe2008af624a9c97/build-1.2.1-py3-none-any.whl",
"sha256": "75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__click": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl",
"sha256": "ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__colorama": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl",
"sha256": "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__importlib_metadata": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl",
"sha256": "30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__installer": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/e5/ca/1172b6638d52f2d6caa2dd262ec4c811ba59eee96d54a7701930726bce18/installer-0.7.0-py3-none-any.whl",
"sha256": "05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__more_itertools": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl",
"sha256": "686b06abe565edfab151cb8fd385a05651e1fdf8f0a14191e4439283421f8684",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__packaging": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl",
"sha256": "2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__pep517": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/25/6e/ca4a5434eb0e502210f591b97537d322546e4833dcb4d470a48c375c5540/pep517-0.13.1-py3-none-any.whl",
"sha256": "31b206f67165b3536dd577c5c3f1518e8fbaf38cbc57efff8369a392feff1721",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__pip": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl",
"sha256": "ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__pip_tools": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/0d/dc/38f4ce065e92c66f058ea7a368a9c5de4e702272b479c0992059f7693941/pip_tools-7.4.1-py3-none-any.whl",
"sha256": "4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__pyproject_hooks": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/ae/f3/431b9d5fe7d14af7a32340792ef43b8a714e7726f1d7b69cc4e8e7a3f1d7/pyproject_hooks-1.1.0-py3-none-any.whl",
"sha256": "7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__setuptools": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/90/99/158ad0609729111163fc1f674a5a42f2605371a4cf036d0441070e2f7455/setuptools-78.1.1-py3-none-any.whl",
"sha256": "c3a9c4211ff4c309edb8b8c4f1cbfa7ae324c4ba9f91ff254e3d305b9fd54561",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__tomli": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl",
"sha256": "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__wheel": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl",
"sha256": "55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__zipp": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/da/55/a03fd7240714916507e1fcf7ae355bd9d9ed2e6db492595f1a67f61681be/zipp-3.18.2-py3-none-any.whl",
"sha256": "dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
}
}
}
},
"@@rules_python+//python/uv:uv.bzl%uv": {
"general": {
"bzlTransitiveDigest": "IgkgxNrtlAec7OnaFrWoCC5NQhHcY/aIz4jsqcNMm8Y=",
"usagesDigest": "H8dQoNZcoqP+Mu0tHZTi4KHATzvNkM5ePuEqoQdklIU=",
"recordedInputs": [
"REPO_MAPPING:rules_python+,bazel_tools bazel_tools",
"REPO_MAPPING:rules_python+,platforms platforms"
],
"generatedRepoSpecs": {
"uv": {
"repoRuleId": "@@rules_python+//python/uv/private:uv_toolchains_repo.bzl%uv_toolchains_repo",
"attributes": {
"toolchain_type": "'@@rules_python+//python/uv:uv_toolchain_type'",
"toolchain_names": [
"none"
],
"toolchain_implementations": {
"none": "'@@rules_python+//python:none'"
},
"toolchain_compatible_with": {
"none": [
"@platforms//:incompatible"
]
},
"toolchain_target_settings": {}
}
}
}
}
},
"@@toolchains_llvm+//toolchain/extensions:distributions.bzl%llvm_distributions": {
"general": {
"bzlTransitiveDigest": "RfYsFLwRh0rVY8ReiYgbOEyr84zuBs7mbcHq3dPY3jI=",
"usagesDigest": "vl2VXD2E16aV3RG06i5tx7yyYASHiQFjvsiNZSDzQIg=",
"recordedInputs": [],
"generatedRepoSpecs": {
"llvm_distributions_data": {
"repoRuleId": "@@toolchains_llvm+//toolchain/internal:distributions_repo.bzl%llvm_distributions_repo",
"attributes": {
"srcs": [
"@@toolchains_llvm+//toolchain/distributions:pre_github.jsonc",
"@@toolchains_llvm+//toolchain/distributions:github_legacy.jsonc",
"@@toolchains_llvm+//toolchain/distributions:github.jsonc",
"@@toolchains_llvm+//toolchain/distributions:extra.jsonc"
]
}
}
}
}
}
},
"facts": {
"@@rules_go+//go:extensions.bzl%go_sdk": {
"1.25.0": {
"aix_ppc64": [
"go1.25.0.aix-ppc64.tar.gz",
"e5234a7dac67bc86c528fe9752fc9d63557918627707a733ab4cac1a6faed2d4"
],
"darwin_amd64": [
"go1.25.0.darwin-amd64.tar.gz",
"5bd60e823037062c2307c71e8111809865116714d6f6b410597cf5075dfd80ef"
],
"darwin_arm64": [
"go1.25.0.darwin-arm64.tar.gz",
"544932844156d8172f7a28f77f2ac9c15a23046698b6243f633b0a0b00c0749c"
],
"dragonfly_amd64": [
"go1.25.0.dragonfly-amd64.tar.gz",
"5ed3cf9a810a1483822538674f1336c06b51aa1b94d6d545a1a0319a48177120"
],
"freebsd_386": [
"go1.25.0.freebsd-386.tar.gz",
"abea5d5c6697e6b5c224731f2158fe87c602996a2a233ac0c4730cd57bf8374e"
],
"freebsd_amd64": [
"go1.25.0.freebsd-amd64.tar.gz",
"86e6fe0a29698d7601c4442052dac48bd58d532c51cccb8f1917df648138730b"
],
"freebsd_arm": [
"go1.25.0.freebsd-arm.tar.gz",
"d90b78e41921f72f30e8bbc81d9dec2cff7ff384a33d8d8debb24053e4336bfe"
],
"freebsd_arm64": [
"go1.25.0.freebsd-arm64.tar.gz",
"451d0da1affd886bfb291b7c63a6018527b269505db21ce6e14724f22ab0662e"
],
"freebsd_riscv64": [
"go1.25.0.freebsd-riscv64.tar.gz",
"7b565f76bd8bda46549eeaaefe0e53b251e644c230577290c0f66b1ecdb3cdbe"
],
"illumos_amd64": [
"go1.25.0.illumos-amd64.tar.gz",
"b1e1fdaab1ad25aa1c08d7a36c97d45d74b98b89c3f78c6d2145f77face54a2c"
],
"linux_386": [
"go1.25.0.linux-386.tar.gz",
"8c602dd9d99bc9453b3995d20ce4baf382cc50855900a0ece5de9929df4a993a"
],
"linux_amd64": [
"go1.25.0.linux-amd64.tar.gz",
"2852af0cb20a13139b3448992e69b868e50ed0f8a1e5940ee1de9e19a123b613"
],
"linux_arm64": [
"go1.25.0.linux-arm64.tar.gz",
"05de75d6994a2783699815ee553bd5a9327d8b79991de36e38b66862782f54ae"
],
"linux_armv6l": [
"go1.25.0.linux-armv6l.tar.gz",
"a5a8f8198fcf00e1e485b8ecef9ee020778bf32a408a4e8873371bfce458cd09"
],
"linux_loong64": [
"go1.25.0.linux-loong64.tar.gz",
"cab86b1cf761b1cb3bac86a8877cfc92e7b036fc0d3084123d77013d61432afc"
],
"linux_mips": [
"go1.25.0.linux-mips.tar.gz",
"d66b6fb74c3d91b9829dc95ec10ca1f047ef5e89332152f92e136cf0e2da5be1"
],
"linux_mips64": [
"go1.25.0.linux-mips64.tar.gz",
"4082e4381a8661bc2a839ff94ba3daf4f6cde20f8fb771b5b3d4762dc84198a2"
],
"linux_mips64le": [
"go1.25.0.linux-mips64le.tar.gz",
"70002c299ec7f7175ac2ef673b1b347eecfa54ae11f34416a6053c17f855afcc"
],
"linux_mipsle": [
"go1.25.0.linux-mipsle.tar.gz",
"b00a3a39eff099f6df9f1c7355bf28e4589d0586f42d7d4a394efb763d145a73"
],
"linux_ppc64": [
"go1.25.0.linux-ppc64.tar.gz",
"df166f33bd98160662560a72ff0b4ba731f969a80f088922bddcf566a88c1ec1"
],
"linux_ppc64le": [
"go1.25.0.linux-ppc64le.tar.gz",
"0f18a89e7576cf2c5fa0b487a1635d9bcbf843df5f110e9982c64df52a983ad0"
],
"linux_riscv64": [
"go1.25.0.linux-riscv64.tar.gz",
"c018ff74a2c48d55c8ca9b07c8e24163558ffec8bea08b326d6336905d956b67"
],
"linux_s390x": [
"go1.25.0.linux-s390x.tar.gz",
"34e5a2e19f2292fbaf8783e3a241e6e49689276aef6510a8060ea5ef54eee408"
],
"netbsd_386": [
"go1.25.0.netbsd-386.tar.gz",
"f8586cdb7aa855657609a5c5f6dbf523efa00c2bbd7c76d3936bec80aa6c0aba"
],
"netbsd_amd64": [
"go1.25.0.netbsd-amd64.tar.gz",
"ae8dc1469385b86a157a423bb56304ba45730de8a897615874f57dd096db2c2a"
],
"netbsd_arm": [
"go1.25.0.netbsd-arm.tar.gz",
"1ff7e4cc764425fc9dd6825eaee79d02b3c7cafffbb3691687c8d672ade76cb7"
],
"netbsd_arm64": [
"go1.25.0.netbsd-arm64.tar.gz",
"e1b310739f26724216aa6d7d7208c4031f9ff54c9b5b9a796ddc8bebcb4a5f16"
],
"openbsd_386": [
"go1.25.0.openbsd-386.tar.gz",
"4802a9b20e533da91adb84aab42e94aa56cfe3e5475d0550bed3385b182e69d8"
],
"openbsd_amd64": [
"go1.25.0.openbsd-amd64.tar.gz",
"c016cd984bebe317b19a4f297c4f50def120dc9788490540c89f28e42f1dabe1"
],
"openbsd_arm": [
"go1.25.0.openbsd-arm.tar.gz",
"a1e31d0bf22172ddde42edf5ec811ef81be43433df0948ece52fecb247ccfd8d"
],
"openbsd_arm64": [
"go1.25.0.openbsd-arm64.tar.gz",
"343ea8edd8c218196e15a859c6072d0dd3246fbbb168481ab665eb4c4140458d"
],
"openbsd_ppc64": [
"go1.25.0.openbsd-ppc64.tar.gz",
"694c14da1bcaeb5e3332d49bdc2b6d155067648f8fe1540c5de8f3cf8e157154"
],
"openbsd_riscv64": [
"go1.25.0.openbsd-riscv64.tar.gz",
"aa510ad25cf54c06cd9c70b6d80ded69cb20188ac6e1735655eef29ff7e7885f"
],
"plan9_386": [
"go1.25.0.plan9-386.tar.gz",
"46f8cef02086cf04bf186c5912776b56535178d4cb319cd19c9fdbdd29231986"
],
"plan9_amd64": [
"go1.25.0.plan9-amd64.tar.gz",
"29b34391d84095e44608a228f63f2f88113a37b74a79781353ec043dfbcb427b"
],
"plan9_arm": [
"go1.25.0.plan9-arm.tar.gz",
"0a047107d13ebe7943aaa6d54b1d7bbd2e45e68ce449b52915a818da715799c2"
],
"solaris_amd64": [
"go1.25.0.solaris-amd64.tar.gz",
"9977f9e4351984364a3b2b78f8b88bfd1d339812356d5237678514594b7d3611"
],
"windows_386": [
"go1.25.0.windows-386.zip",
"df9f39db82a803af0db639e3613a36681ab7a42866b1384b3f3a1045663961a7"
],
"windows_amd64": [
"go1.25.0.windows-amd64.zip",
"89efb4f9b30812eee083cc1770fdd2913c14d301064f6454851428f9707d190b"
],
"windows_arm64": [
"go1.25.0.windows-arm64.zip",
"27bab004c72b3d7bd05a69b6ec0fc54a309b4b78cc569dd963d8b3ec28bfdb8c"
]
},
"1.26.7": {
"aix_ppc64": [
"go1.26.7.aix-ppc64.tar.gz",
"e5aed98bc83f569a374dbfd79d632b058e5130192fbd4c4ee0d4f6e3d9c101bb"
],
"darwin_amd64": [
"go1.26.7.darwin-amd64.tar.gz",
"92e8b34bff3c89ab16404c595669ac8cb004cc2f676dcbd1f5b87a6b8def3b47"
],
"darwin_arm64": [
"go1.26.7.darwin-arm64.tar.gz",
"020a1e8224811be75163e920bc77e0926a1390a6aeea19bdcf23f74b9d749f6d"
],
"dragonfly_amd64": [
"go1.26.7.dragonfly-amd64.tar.gz",
"d980dc9ecc48de09b2fa1765886abb8c7b0ad738bf8cc483b76019facc2df4d1"
],
"freebsd_386": [
"go1.26.7.freebsd-386.tar.gz",
"7eecfa4d6c126bcdedb8e16583ec672857e607659c672c60a9d645f8957da117"
],
"freebsd_amd64": [
"go1.26.7.freebsd-amd64.tar.gz",
"2ad37146fa8449907716b494dd268aeae6f79592b875915525c28c8c337ad32a"
],
"freebsd_arm": [
"go1.26.7.freebsd-arm.tar.gz",
"bc56379ed419cd93cf7002dcb95f554b3e3a2bd58d804182f8873e313a870b70"
],
"freebsd_arm64": [
"go1.26.7.freebsd-arm64.tar.gz",
"23d425a3a51876df8bf050f080b1ae50340048def689fbcc44c939fa23485ce0"
],
"illumos_amd64": [
"go1.26.7.illumos-amd64.tar.gz",
"be51df2411786e1fa6325461e509224a94c5e8d001da8e4548d9e028a53a3c22"
],
"linux_386": [
"go1.26.7.linux-386.tar.gz",
"5b6fad4a7fe8fa230c935625b67450305be95e2f4f976b731623f76b88fc4821"
],
"linux_amd64": [
"go1.26.7.linux-amd64.tar.gz",
"ffb5f8de10c62550dfddab66b36b57030721e0a44a3218e9e1181d7b59f121ca"
],
"linux_arm64": [
"go1.26.7.linux-arm64.tar.gz",
"5a4ec883379d51ee9ce1040d5e87f8d35e20387574dd8c947feb01eabc3c1b37"
],
"linux_armv6l": [
"go1.26.7.linux-armv6l.tar.gz",
"6a41557335d1d9fa9bfc7439cedcfd0e4df2fc83d916175b5f3eae4685f5fe3f"
],
"linux_loong64": [
"go1.26.7.linux-loong64.tar.gz",
"89b5e92446e719719e23db447a41860d7d573252bab0704c9acb09ad97e9eca1"
],
"linux_mips": [
"go1.26.7.linux-mips.tar.gz",
"fbdbf78b04494843fde47b15150e12adb7e2c0e2289eacbc18e6629a99604620"
],
"linux_mips64": [
"go1.26.7.linux-mips64.tar.gz",
"93b1360a29f4a71dbb6995f149b9312f67f5ce52197fea0042e9c9423809a496"
],
"linux_mips64le": [
"go1.26.7.linux-mips64le.tar.gz",
"402dd2bd57fb4c982ef0eccbb4f7209ae98a753856e99baf962f1ac54493d65d"
],
"linux_mipsle": [
"go1.26.7.linux-mipsle.tar.gz",
"967da58e88c45c401593a8552be9beedaa989a3484a3105850d2beb6ca9ed698"
],
"linux_ppc64": [
"go1.26.7.linux-ppc64.tar.gz",
"8feee58b3fa8d270343519d10d66736150e627d39aee937e6e889ba5445c8be9"
],
"linux_ppc64le": [
"go1.26.7.linux-ppc64le.tar.gz",
"22d3b362d557175fd16b79651cab0cad64f8aaaedca745f66d16f44d56bc5de1"
],
"linux_riscv64": [
"go1.26.7.linux-riscv64.tar.gz",
"21e1dc0e2f7dd9f80e0e94613fc324f1f99403b99997f9d8c5f80f8132fc642b"
],
"linux_s390x": [
"go1.26.7.linux-s390x.tar.gz",
"bc3308e05e9397958ad4aac453e3dc4565ba6d548e9ace0a9b4b165feb6382f2"
],
"netbsd_386": [
"go1.26.7.netbsd-386.tar.gz",
"c0a28bd30d8c07966cf7bc43fc6936866fb1a0e84ab4e983d4e8ca15edc1a4d1"
],
"netbsd_amd64": [
"go1.26.7.netbsd-amd64.tar.gz",
"dff0b16d129f5e70f3bb38ed98d467404b5b130c7c8b3fe6b074601855f2bcd5"
],
"netbsd_arm": [
"go1.26.7.netbsd-arm.tar.gz",
"36d15f8c5c5a5a048251b39ce67ed5a7ae2d072f1aa5c301cbde110670e824b2"
],
"netbsd_arm64": [
"go1.26.7.netbsd-arm64.tar.gz",
"b75802b366e5b60aa6cfded871f0a72abadf297c5a68c523c5857822a5b92d34"
],
"openbsd_386": [
"go1.26.7.openbsd-386.tar.gz",
"c26201688339b2a10bf980be2d64adfd3a383b31a164377b0123ad78bde6979c"
],
"openbsd_amd64": [
"go1.26.7.openbsd-amd64.tar.gz",
"562de088b844764029f59ff52e82218711a4b585ab7ae175b88eff53e051a8df"
],
"openbsd_arm": [
"go1.26.7.openbsd-arm.tar.gz",
"646e19cd3449aec767bf75622d368b02c73d529a5478a25f2a7e21148b1a4cb6"
],
"openbsd_arm64": [
"go1.26.7.openbsd-arm64.tar.gz",
"2045303632e112290e939dfd4678401109f612f7913f459e2d7d079e750723f5"
],
"openbsd_ppc64": [
"go1.26.7.openbsd-ppc64.tar.gz",
"23e89de68225dc41dd981601602e67fab0c4ca87af8f70a25131c06a301f9000"
],
"openbsd_riscv64": [
"go1.26.7.openbsd-riscv64.tar.gz",
"c0de2c6c353a582ca7682ed5a550056a8b5d59649260da4d1e327cf96684c822"
],
"plan9_386": [
"go1.26.7.plan9-386.tar.gz",
"14ae7414a2ea05d26e1fc499d9b372c7f8f17726c49a5222fa9063b0f752a22c"
],
"plan9_amd64": [
"go1.26.7.plan9-amd64.tar.gz",
"f9459b8137bdb81621d4e0cdba4c849a617c89c11a3088083ad3a8c97467c6a5"
],
"plan9_arm": [
"go1.26.7.plan9-arm.tar.gz",
"4f444bd2e0f8a08ba8799131dd3531bea8723bf96b8ffa0e0948936a3c4aa8f0"
],
"solaris_amd64": [
"go1.26.7.solaris-amd64.tar.gz",
"04b5b280e0e0de1b91d7da5e34801dbf75e5621615f80cfd9935091d673f1238"
],
"windows_386": [
"go1.26.7.windows-386.zip",
"59cf0b9814c41c960d70df3cd5360fda0793e5d2230737d58e009392181fb636"
],
"windows_amd64": [
"go1.26.7.windows-amd64.zip",
"f4f534a486e4bc3387fa18f08208f2f854b7aaea8a08f2a2d829a914a05abb11"
],
"windows_arm64": [
"go1.26.7.windows-arm64.zip",
"6f1b08de9e2dd94f69c52e524ab6834737275253291e8fd7f1c12ed4eceeda89"
]
}
}
},
"factsVersions": {}
}

211
Makefile
View file

@ -43,35 +43,14 @@ export PATH := $(GIT_WINDOWS_ROOT)/usr/bin;$(PATH)
endif
endif
.PHONY: all build doctor-build test test-icu-path test-full-cgo test-regression test-upgrade test-cross-version test-migration corpus-regen githooks-regen bench bench-quick clean clean-test-tmp install install-force help check-up-to-date fmt fmt-check check-testing-short
.PHONY: lint lint-changed vet
.PHONY: check check-go test-go check-docs-go
.PHONY: ci-pr-core ci-pr-lint ci-complexity ci-complexity-diff ci-complexity-check ci-package-mcp ci-package-npm nogo-ownership
.PHONY: all build doctor-build test test-icu-path test-full-cgo test-regression test-upgrade test-cross-version test-migration corpus-regen bench bench-quick clean clean-test-tmp install install-force help check-up-to-date fmt fmt-check check-testing-short
.PHONY: ci-pr-core ci-pr-policy ci-pr-lint ci-package-mcp ci-package-npm
.PHONY: api-gen api-check
.PHONY: bazel-sync bazel-sync-check
# Default target
all: build
# Build and test engine. Bazel is what CI gates on: .github/workflows/bazel.yml
# runs `bazel test` lanes on rbe-west, and nogo (lint + vet), formatting and
# the repository guards are Bazel targets there. The primary targets (test,
# check, check-docs) run the same `bazel test` commands as those lanes, so a
# local run shares CI's action keys and its remote cache (engdocs/TESTING.md
# "Building and testing"). Each keeps a plain go twin under an explicit -go
# name (test-go, check-go, check-docs-go) for offline work and hosts Bazel does
# not serve; that twin is an inner-loop convenience, not what CI enforces.
# GitHub Actions jobs that still run Go-native suites call the -go names.
BAZEL ?= bazel
# Extra flags for every `bazel test` below: --config=fork-cache (contributors:
# the anonymous read-only cache) or --config=remote-exec (maintainers with an
# rbe-west client certificate). Hosts whose ~/.bazelrc names the executor need
# neither. Better: put `build --config=...` in the gitignored .bazelrc.local.
BAZEL_FLAGS ?=
BAZEL_TEST = $(BAZEL) test $(BAZEL_FLAGS)
BUILD_DIR := .
BD_BUILD_OUTPUT := $(BUILD_DIR)/bd$(if $(filter Windows_NT,$(OS)),.exe)
GIT_BUILD := $(shell git rev-parse --short HEAD)
ifeq ($(OS),Windows_NT)
INSTALL_DIR := $(USERPROFILE)/.local/bin
@ -124,21 +103,21 @@ build:
ifeq ($(OS),Windows_NT)
@if [ -n "$$CC" ]; then \
echo "Using CC=$$CC"; \
go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o "$(BD_BUILD_OUTPUT)" ./cmd/bd; \
go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o $(BUILD_DIR)/bd.exe ./cmd/bd; \
elif command -v gcc >/dev/null 2>&1; then \
CC=gcc go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o "$(BD_BUILD_OUTPUT)" ./cmd/bd; \
CC=gcc go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o $(BUILD_DIR)/bd.exe ./cmd/bd; \
elif command -v clang >/dev/null 2>&1 && clang -dumpmachine 2>/dev/null | grep -qi 'windows.*gnu'; then \
CC=clang go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o "$(BD_BUILD_OUTPUT)" ./cmd/bd; \
CC=clang go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o $(BUILD_DIR)/bd.exe ./cmd/bd; \
else \
for bin in $(WINDOWS_CGO_BINS); do \
if [ -x "$$bin/gcc.exe" ]; then \
echo "Using Windows CGO gcc from $$bin"; \
PATH="$$bin:$$PATH" CC=gcc go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o "$(BD_BUILD_OUTPUT)" ./cmd/bd; \
PATH="$$bin:$$PATH" CC=gcc go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o $(BUILD_DIR)/bd.exe ./cmd/bd; \
exit $$?; \
fi; \
if [ -x "$$bin/clang.exe" ] && "$$bin/clang.exe" -dumpmachine 2>/dev/null | grep -qi 'windows.*gnu'; then \
echo "Using Windows CGO clang from $$bin"; \
PATH="$$bin:$$PATH" CC=clang go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o "$(BD_BUILD_OUTPUT)" ./cmd/bd; \
PATH="$$bin:$$PATH" CC=clang go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o $(BUILD_DIR)/bd.exe ./cmd/bd; \
exit $$?; \
fi; \
done; \
@ -148,9 +127,9 @@ ifeq ($(OS),Windows_NT)
exit 1; \
fi
else
go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o "$(BD_BUILD_OUTPUT)" ./cmd/bd
go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o $(BUILD_DIR)/bd ./cmd/bd
ifeq ($(shell uname),Darwin)
@codesign -s - -f "$(BD_BUILD_OUTPUT)" 2>/dev/null || true
@codesign -s - -f $(BUILD_DIR)/bd 2>/dev/null || true
@echo "Signed bd for macOS"
endif
endif
@ -192,27 +171,11 @@ doctor-build:
echo " CGO_ENABLED=1 go build -tags gms_pure_go ./cmd/bd" ;; \
esac
# bazel.yml's test lane (`bazel test //... --config=ci`): every untagged
# go_test with PR Core's selection (race, -short, skips), plus nogo lint/vet,
# formatting and the repository guards. The other lanes' commands are in
# engdocs/TESTING.md "Building and testing".
# Run all tests (skips known broken tests listed in .test-skip)
test:
$(BAZEL_TEST) //... --config=ci
# Plain go test (skips known broken tests listed in .test-skip): an inner-loop
# convenience without Bazel; CI does not run it.
test-go:
@echo "Running tests..."
@TEST_COVER=1 ./scripts/test.sh
# Fast quality gates: the testing.Short policy, the full nogo lint gate
# (native plus the windows/darwin passes) and `make test`.
check: check-testing-short ci-pr-lint test
# The same gates without Bazel where they have a Go form: gofmt and go test.
# nogo has no go twin, so this is a convenience CI does not enforce.
check-go: fmt-check check-testing-short test-go
# Run the opt-in ICU regex path test suite (no skip list).
# This is a local developer workflow for intentionally exercising the leftover
# ICU path; it is not part of normal validation.
@ -229,70 +192,12 @@ test-full-cgo:
ci-pr-core:
@./scripts/ci/pr-core.sh
# Lint and vet are nogo (//tools/nogo): go test's vet checks plus the
# golangci-lint linters .golangci.yml enables, validated beside every Go
# compile, so any `bazel build`/`bazel test` (local or on rbe-west) fails on a
# finding. These targets ask Bazel for the analysis alone (.bazelrc's
# --config=nogo; nothing is linked).
ci-pr-policy:
@./scripts/ci/pr-policy.sh
ci-pr-lint:
@./scripts/ci/pr-lint.sh
# nogo-ownership is a dynamic, advisory cross-check (not part of the required
# //scripts static suite, which cannot shell out to Bazel): it asks real
# `bazel aquery` whether the nogo owner lane for each configuration group
# (today: race, bazel-test/--config=ci) really does validate every file a
# non-owner lane (embedded, doltserver, doltserver-proxied, dolt-race, which
# pass --norun_validations) compiles. See tools/bazel/nogo_ownership.py and
# scripts/nogo_lint_policy_test.go's nogoConfigurations table.
nogo-ownership:
@python3 tools/bazel/nogo_ownership.py
# The CI lint gate: native, plus //tools/bazel:release_cross for windows/amd64
# and darwin/arm64 (BD_LINT_TARGETS selects; scripts/pr-lint).
lint: ci-pr-lint
# go test's vet checks run inside nogo; same as lint.
vet: lint
# nogo over the Bazel packages of changed Go files, natively (the pre-commit
# hook's lint). LINT_CHANGED_SCOPE: staged, or worktree (changed against
# LINT_CHANGED_REF, staged, and untracked).
LINT_CHANGED_SCOPE ?= worktree
LINT_CHANGED_REF ?= HEAD
lint-changed:
@case "$(LINT_CHANGED_SCOPE)" in \
staged) files="$$(git diff --cached --name-only --diff-filter=ACMRT -- '*.go')" ;; \
worktree) files="$$( \
git diff --name-only --diff-filter=ACMRT "$(LINT_CHANGED_REF)" -- '*.go'; \
git diff --cached --name-only --diff-filter=ACMRT -- '*.go'; \
git ls-files --others --exclude-standard -- '*.go')" ;; \
*) echo "unknown LINT_CHANGED_SCOPE=$(LINT_CHANGED_SCOPE); expected staged or worktree" >&2; exit 2 ;; \
esac; \
packages=""; missing=""; \
for file in $$files; do \
dir="$$(dirname "$$file")"; \
case "/$$dir/" in */testdata/*) continue ;; esac; \
if [ -f "$$dir/BUILD.bazel" ]; then packages="$$packages //$${dir#.}:all"; else missing="$$missing $$dir"; fi; \
done; \
if [ -n "$$missing" ]; then \
echo "lint-changed: no BUILD.bazel in$$missing; run 'make bazel-sync'" >&2; exit 1; \
fi; \
packages="$$(printf '%s\n' $$packages | sort -u | sed 's#^///#//#; s#^//\.:#//:#')"; \
if [ -z "$$packages" ]; then echo "lint-changed: no changed Go packages"; exit 0; fi; \
echo "lint-changed:" $$packages; \
$(BAZEL) build --config=nogo -- $$packages
# Opt-in architecture experiment. Install gocyclo v0.6.0 first;
# report is advisory while check exercises the local baseline guard.
ci-complexity:
@./scripts/ci/complexity.sh report
ci-complexity-diff:
@./scripts/ci/complexity.sh diff
ci-complexity-check:
@./scripts/ci/complexity.sh check
# The generated half of the wire contract. The document is hand-written and is
# the source of truth; this file is its output.
API_GEN_FILE := internal/httpapi/apigen/types.gen.go
@ -302,8 +207,9 @@ api-gen:
go generate -tags "$(BUILD_TAGS)" ./internal/httpapi/apigen
# Two-part spec drift gate: regenerate and fail if regeneration CHANGED
# anything, then run the spec tests. CI runs the drift half as
# //scripts/repochecks:types_gen_drift_test.
# anything, then run the spec tests. Runs in the PR workflow's policy job
# (scripts/ci/pr-policy.sh), on every pull request, never only on
# push-to-main.
#
# The drift question is "do the checked-out types already match the checked-out
# spec", so the comparison is before-vs-after regeneration rather than
@ -346,7 +252,7 @@ test-regression:
# Override version: ./scripts/upgrade-smoke-test.sh v0.62.0
test-upgrade: build
@echo "Running upgrade smoke tests..."
@CANDIDATE_BIN="$(BD_BUILD_OUTPUT)" ./scripts/upgrade-smoke-test.sh
@CANDIDATE_BIN=./bd ./scripts/upgrade-smoke-test.sh
# Run cross-version smoke tests (last 30 tags → candidate).
@ -355,14 +261,14 @@ test-upgrade: build
# All from v0.30.0: ./scripts/cross-version-smoke-test.sh --from v0.30.0
test-cross-version: build
@echo "Running cross-version smoke tests..."
@CANDIDATE_BIN="$(BD_BUILD_OUTPUT)" ./scripts/cross-version-smoke-test.sh
@CANDIDATE_BIN=./bd ./scripts/cross-version-smoke-test.sh
# Run the authenticated historical upgrade corpus with strict fidelity checks.
# All qualified versions: ./scripts/migration-test/run.sh
# Single version: ./scripts/migration-test/run.sh --version v0.49.6
test-migration: build
@echo "Running migration test harness..."
@CANDIDATE_BIN="$(BD_BUILD_OUTPUT)" ./scripts/migration-test/run.sh
@CANDIDATE_BIN=./bd ./scripts/migration-test/run.sh
# Regenerate the golden-JSON contract corpus (cmd/bd/protocol/testdata/corpus/).
# Run after any deliberate bd --json wire change; review the diff, then commit.
@ -371,15 +277,6 @@ corpus-regen:
@echo "Regenerating contract corpus..."
go test -tags "$(BUILD_TAGS)" ./cmd/bd/protocol -run TestCorpusGolden -corpus.update -count=1
# The tracked .githooks/* carry the managed section cmd/bd/hooks.go generates;
# TestTrackedManagedHookSectionsMatchGenerator holds them byte-equal. Run this
# after changing the generator or after bumping Version in cmd/bd/version.go
# (the section markers carry the version), then commit the regenerated hooks
# alongside it.
githooks-regen:
@echo "Regenerating managed sections in .githooks/*..."
BD_UPDATE_HOOKS_GOLDEN=1 go test -tags "$(BUILD_TAGS)" ./cmd/bd -run TestTrackedManagedHookSectionsMatchGenerator -count=1
# Run performance benchmarks against Dolt storage backend
# Requires CGO and Dolt; generates CPU profile files
@ -425,21 +322,18 @@ endif
# The old rm-first shape added an ENOENT window on top. Same treatment for the
# beads symlink.
#
# On Git for Windows, `rm path/bd` can resolve and delete `path/bd.exe` when no
# literal extensionless entry exists. Replace bd.exe first, then enumerate real
# legacy aliases (including case variants and redirected install directories)
# so cleanup cannot remove the executable or weaken a failed install. Keep
# directories named bd; the Windows PATH above supplies MSYS find, not System32 find.
# find -H follows the install-directory argument; internal aliases are selected by
# ! -type d, without assuming how this find implementation classifies junctions.
# EXCEPTION — native Windows keeps the rm-first + cp shape: under Git for
# Windows' bash the staged tmp+rename leaves no bd.exe at the destination even
# though cp && mv exit 0 (caught by pr.yml's spaced-USERPROFILE install proof;
# root cause untraced). Restore Windows atomicity only with that proof green.
install install-force: build
@mkdir -p "$(INSTALL_DIR)"
ifeq ($(OS),Windows_NT)
@cp "$(BD_BUILD_OUTPUT)" "$(INSTALL_DIR)/.bd.exe.install.tmp.$$$$" && mv -f "$(INSTALL_DIR)/.bd.exe.install.tmp.$$$$" "$(INSTALL_DIR)/bd.exe"
@find -H "$(INSTALL_DIR)" -mindepth 1 -maxdepth 1 -iname bd ! -type d -exec rm -f -- {} +
@rm -f "$(INSTALL_DIR)/bd" "$(INSTALL_DIR)/bd.exe"
@cp "$(BUILD_DIR)/bd.exe" "$(INSTALL_DIR)/bd.exe"
@echo "Installed bd.exe to $(INSTALL_DIR)/bd.exe"
else
@cp "$(BD_BUILD_OUTPUT)" "$(INSTALL_DIR)/.bd.install.tmp.$$$$" && mv -f "$(INSTALL_DIR)/.bd.install.tmp.$$$$" "$(INSTALL_DIR)/bd"
@cp "$(BUILD_DIR)/bd" "$(INSTALL_DIR)/.bd.install.tmp.$$$$" && mv -f "$(INSTALL_DIR)/.bd.install.tmp.$$$$" "$(INSTALL_DIR)/bd"
@echo "Installed bd to $(INSTALL_DIR)/bd"
@ln -sfn bd "$(INSTALL_DIR)/.beads.install.tmp.$$$$" && mv -f "$(INSTALL_DIR)/.beads.install.tmp.$$$$" "$(INSTALL_DIR)/beads"
@echo "Created 'beads' alias -> bd"
@ -448,31 +342,21 @@ endif
install: check-up-to-date
# Format all Go files.
# Through the go.mod-pinned gofmt, never a bare PATH one: a newer local Go
# formats differently from CI, so a bare gofmt -w here rewrites files into a
# form CI's gofmt then rejects. See scripts/ci/gofmt-bin.sh.
# Format all Go files
fmt:
@echo "Formatting Go files..."
@gofmt_bin="$$(./scripts/ci/gofmt-bin.sh)" && "$$gofmt_bin" -w .
@gofmt -w .
@echo "Done"
# Check that all Go files are properly formatted (for CI)
fmt-check:
@./scripts/ci/fmt-check.sh
# Docs checks: docsync and doc freshness as bazel.yml's test lane runs them,
# then the CLI flag check, which validates against bd built from the release in
# docs/cli-docs.pin (so it stays a script, like pr.yml's check-doc-flags job).
# Validate documentation references against actual CLI flags
check-docs:
$(BAZEL_TEST) //test/docsync:docsync_test //scripts/repochecks:doc_freshness_test --config=ci
@./scripts/check-doc-flags.sh
# The same docs checks with plain go test and a go-built bd.
check-docs-go:
@echo "Building bd for docs checks..."
@CGO_ENABLED=0 go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o "$(BUILD_DIR)/bd" ./cmd/bd
@./scripts/check-doc-flags.sh "$(BUILD_DIR)/bd"
@CGO_ENABLED=0 go build -tags "$(BUILD_TAGS)" -ldflags="-X main.Build=$(GIT_BUILD)" -o $(BUILD_DIR)/bd ./cmd/bd
@./scripts/check-doc-flags.sh ./bd
@./scripts/check-doc-freshness.sh
@go test -tags=gms_pure_go ./test/docsync
@ -504,21 +388,6 @@ diagrams-excalidraw:
docs-dev:
./mint.sh dev
# Regenerate BUILD.bazel files with gazelle and refresh the MODULE.bazel
# use_repo list + MODULE.bazel.lock, then refresh the go_srcs filegroups that
# source-scanning tests declare as data (tools/bazel/go_srcs.py). Run after
# changing Go imports, go.mod, or packages.
bazel-sync:
$(BAZEL) run //:gazelle
python3 tools/bazel/go_srcs.py
$(BAZEL) mod tidy
# Fail (printing a diff) when a go_srcs block that tools/bazel/go_srcs.py
# manages is stale, e.g. after gazelle added a package under a scanned tree.
# Needs no Bazel; scripts/bazel_policy_test.go runs the same check.
bazel-sync-check:
python3 tools/bazel/go_srcs.py --check
# Ensure -short is not used as an implicit CI tier boundary.
check-testing-short:
@./scripts/check-testing-short.sh
@ -543,19 +412,12 @@ help:
@echo "Beads Makefile targets:"
@echo " make build - Build the bd binary"
@echo " make doctor-build - Diagnose build env (GOFLAGS/CGO/CC) for the ICU build trap"
@echo " make test - bazel test //... --config=ci (bazel.yml's test lane; BAZEL_FLAGS adds flags)"
@echo " make test-go - Plain go test via scripts/test.sh (inner loop; not what CI enforces)"
@echo " make check - testing.Short policy + nogo lint gate + make test"
@echo " make check-go - gofmt + testing.Short policy + make test-go (no Bazel)"
@echo " make test - Run all tests"
@echo " make test-icu-path - Run opt-in ICU regex path tests (maintainer-only)"
@echo " make test-full-cgo - Deprecated alias for make test-icu-path"
@echo " make ci-pr-core - Run required PR core Go test wrapper"
@echo " make ci-pr-lint - Run the required lint gate: nogo (vet + golangci-lint's linters) under Bazel, native + windows/darwin"
@echo " make lint - Same as ci-pr-lint (make vet too)"
@echo " make lint-changed - nogo over the Bazel packages of changed Go files (LINT_CHANGED_SCOPE=staged|worktree)"
@echo " make ci-complexity - Report production cyclomatic complexity (advisory)"
@echo " make ci-complexity-diff - Compare complexity with COMPLEXITY_BASE_REF"
@echo " make ci-complexity-check - Check complexity against the local baseline"
@echo " make ci-pr-policy - Run required PR policy wrapper"
@echo " make ci-pr-lint - Run required PR formatting and lint wrapper"
@echo " make ci-package-mcp - Run MCP Python package gate"
@echo " make ci-package-npm - Run npm package gate"
@echo " make test-regression - Run differential regression tests (baseline vs candidate)"
@ -568,12 +430,9 @@ help:
@echo " make install-force - Install bd, skipping the origin/main update check"
@echo " make fmt - Format all Go files with gofmt"
@echo " make fmt-check - Check Go formatting (for CI)"
@echo " make check-docs - Bazel docsync + doc freshness tests, then the CLI flag check"
@echo " make check-docs-go - The same docs checks with plain go test"
@echo " make check-docs - Validate docs against CLI flags"
@echo " make api-gen - Regenerate HTTP API types from the OpenAPI spec"
@echo " make api-check - OpenAPI drift gate (regenerate, diff-or-fail, spec tests)"
@echo " make bazel-sync - Regenerate Bazel BUILD files and tidy MODULE.bazel (gazelle + mod tidy)"
@echo " make bazel-sync-check - Fail if generated go_srcs Bazel filegroups are stale"
@echo " make clean - Remove build artifacts and profile files"
@echo " make clean-test-tmp - Sweep orphaned cmd/bd test temp dirs from \$$TMPDIR"
@echo " make help - Show this help message"

158
README.md
View file

@ -42,7 +42,7 @@ bd setup factory # Factory.ai Droid - creates/updates AGENTS.md
**Note:** Beads is a CLI tool you install once and use everywhere. You don't need to clone this repository into your project.
`bd init` creates or updates `AGENTS.md` by default so agents can discover the beads workflow, and also installs the project Claude Code, Codex, and Cursor integrations unless you pass `--skip-agents` or `--stealth`. Use `bd setup --list` to see supported integrations, including `bd setup codex`, `bd setup factory`, `bd setup claude`, `bd setup mux`, `bd setup cursor`, and more. See [Agent and IDE setup](docs/getting-started/ide-setup.md).
`bd init` creates or updates `AGENTS.md` by default so agents can discover the beads workflow, and also installs project Claude/Codex integrations unless you pass `--skip-agents` or `--stealth`. Use `bd setup --list` to see supported integrations, including `bd setup codex`, `bd setup factory`, `bd setup claude`, `bd setup mux`, `bd setup cursor`, and more. See [Agent and IDE setup](docs/getting-started/ide-setup.md).
Manual copy-paste is only for unsupported agents, existing projects where you cannot rerun `bd init`/`bd setup`, or custom instruction files. In those cases, run `bd onboard` and paste the printed snippet into the file your agent reads.
@ -53,7 +53,7 @@ This project uses bd (beads) for issue tracking.
- Run `bd prime` for workflow context and command guidance.
- Use `bd ready`, `bd show <id>`, `bd update <id> --claim`, and `bd close <id>`.
- Use `bd remember "insight"` for durable project facts; keep per-operator preferences in your harness's own memory.
- Use `bd remember "insight"` for persistent project memory; do not create MEMORY.md files.
- Do not use markdown TODO lists for task tracking.
```
@ -109,8 +109,8 @@ version: sync remote-backed databases with your current `bd`, back up with
`bd export --all`, upgrade the binary, then run `bd info --whats-new`,
`bd hooks install`, and `bd version`. If the upgrade crosses a schema
migration on a remote-backed database, exactly one designated clone runs
`bd migrate schema` and `bd dolt push`; other clones install the new
binary and run `bd bootstrap`. See the full
`bd migrate` and `bd dolt push`; other clones install the new binary
and run `bd bootstrap`. See the full
[upgrade guide](https://beads.gascity.com/getting-started/upgrading)
or [docs/getting-started/installation.md](docs/getting-started/installation.md#updating-bd).
@ -175,153 +175,6 @@ are unaffected.
the guard with a warning on stderr. Use this only if you know the forward
migrations are additive and safe for your specific workload.
## 🔌 HTTP Backend (experimental)
A workspace can also talk to a remote `bd serve` over HTTP instead of opening
a local Dolt database — useful for a thin client against a shared server, or
for embedding beads in another program as a library.
```bash
# Point this workspace at a server (verifies the server first; writes nothing on failure)
bd connect https://bd.example.com --expect-project-id my-project
# The everyday commands work the same way: create, show, list, update, close,
# dependencies (including `bd dep tree`), comments, ready/count queries, and
# batch apply all round-trip over the wire with the same semantics as a local
# database. So does `bd ready --claim`, except against an older server or while
# any issue holds an unsatisfied external ref: then it lists and claims in two
# steps rather than one transaction (ledger row L14, linked below).
bd create "Fix auth bug" -p 1 -t bug
bd ready --json
bd close bd-a1b2 "Fixed"
# Loopback needs no TLS
bd connect http://127.0.0.1:8080
# Forget the server and restore this workspace's previous backend selection
bd connect --clear
```
HTTP mode is not a byte-for-byte mirror of local mode, though: some
operations are knowingly refused (the wire has no way to express them) or
degrade to a different-but-not-misreadable behavior (for example, a few
unbounded listing shapes lose single-query snapshot isolation and instead
walk the server page by page). Every one of these is a deliberate, tested
row, never a silent gap — see
[`engdocs/design/http-divergence-ledger.md`](engdocs/design/http-divergence-ledger.md)
for the full, generated list of what differs and why before depending on an
HTTP-backed workspace for a workflow you haven't checked against it. One
refusal to know up front: `bd close --claim-next` closes nothing over HTTP,
because the wire's batch close cannot carry the claim. Close without it, then
run `bd ready --claim`.
[Cross-repo dependencies](docs/core-concepts/dependencies.md#cross-repo-dependencies)
keep their policy over HTTP. The client resolves each `external:` reference
against its own `external_projects` configuration. `bd dep tree` shows the
reference as a leaf, and while it is unsatisfied the issue stays out of
`bd ready` and `bd ready --claim`, and `bd close` refuses it without
`--force`. A server that advertises enforcing that policy itself is trusted
to do so instead.
Three CLI-level differences are worth knowing up front:
- IDs resolve exactly: an abbreviated id is not expanded (the wire has no
substring search), and a missing id is reported as not found after one
lookup.
- `bd update -s closed` does not record `closed_by_session` (from `--session`
or `CLAUDE_SESSION_ID`), because the wire's update cannot carry it; the
close itself happens as usual. `bd close` does record the session. `bd
reopen`'s history entry carries the server's own label.
- Contributor auto-routing (`routing.*` settings) is read from local
`config.yaml` / environment only, never from the server's settings: its
targets are local paths.
`bd connect` writes two things on success: `.beads/metadata.json` gets
`"backend": "http"`, and a per-user, never-git-tracked sidecar
(`.beads/http_target.json`) records the server URL and pinned project id. It
never writes a credential to disk. A bearer credential, if the server
requires one, comes from `BEADS_HTTP_TOKEN=host[:port]=<token>`, then
`BEADS_HTTP_TOKEN_COMMAND=host[:port]=<command>` (a helper that prints a
token), then the credentials file, then no credential at all. Both variables
must name the server they are for (a pattern without a port matches that
host on any port); a bare value is refused, because it would be sent to
whatever server the workspace's `http_target.json` names. Connecting to a
non-loopback server over plain `http://` is refused by default (a bearer
credential would cross the network unencrypted) — pass `--allow-plaintext` to
override, or use `https://`. Switching a workspace that already selects a
different backend needs `--force`.
Each read (a GET, or the POST batch get) gives its first attempt 15s, from
when the request is sent, to get the server's response headers
(`BEADS_HTTP_RESPONSE_HEADER_TIMEOUT`: a duration such as `30s`, a number of
seconds, or `off`). A read whose headers do not arrive in time, or whose
connection is reset, is retried once on another connection, and each retry
is logged to stderr with its count. The retry has no header timer, but it
runs on what is left of the 60s bound on the whole request, counted from
when the first attempt was sent: a slow but healthy read still finishes if
the retry's headers and body together fit in that remainder (about 45s after
a header timeout), and one that needs longer now fails at 60s. The header
timer never cuts off a body that is still streaming; the 60s bound still
does. The events:watch stream's connect gets neither the header timer nor
the retry. On Windows a reset connection is retried only when it surfaces as
an early EOF, because the check matches the Unix reset error (`ECONNRESET`),
which a Windows reset (`WSAECONNRESET`) is not. A write gets no
header timer (the server answers a write only after it commits, so a large
one can be slow and healthy) and is never retried; if the 60s bound expires
after it was sent but before its headers, it fails with an error naming the
server's host, because it may or may not have been applied. A batch apply of
more than 100 items (a large `bd create --graph` plan, say) gets 6 minutes
instead of 60s, because `bd serve` gives such a request its
`--large-apply-ceiling` (5 minutes by default) and finishes it even after the
client has given up. A server whose ceiling is raised past about 5m15s can
still outlast the client. A dial or TLS timeout stays a plain connection
error, since the server never saw the request, and a connect that fails says
so: it names the address that refused the connection (nothing listening) or
never answered (a filtered port or a down host, after the dialer's 30s), or
the host name that did not resolve. `off` turns off only the
header timer: a reset read is still retried, and a write's timeout is still
reported as above.
Whether the server applies bd's external-dependency policy itself (the
`policy.external_dependencies` capability) is remembered for 5 minutes per
server URL and pinned project, in `beads/http-policy/` under the user cache
directory, so `bd ready` does not fetch the server's context before every
listing just to learn it. `BEADS_HTTP_POLICY_CACHE_TTL` sets that window (a
duration such as `1m`, a number of seconds, or `off`); a server restarted
with a different composition is seen once it passes. Claims and closes never
use the cached answer: they ask the server, since a stale one could skip the
client-side refusal of externally blocked work. A workspace connected without
a project pin is not cached.
`bd search`, `bd show --current` and `bd recompute-blocked` work over HTTP
too, each in its own way. `bd search` asks the server's listing with its text (`q`, behind the `issues.list.search` capability) and
refuses before dialing against a server that does not advertise it. `bd list
--no-assignee`, `--title` and `--id` likewise ride the listing's
`no_assignee`, `title` and repeatable `id`, each behind its own capability
(`issues.list.noAssignee`, `issues.list.title`, `issues.list.ids`), and the
rest of `bd list`'s filters (`--updated-*`, `--closed-*`, `--defer-*`,
`--due-*`, `--priority*`, the text and external-ref matches, `--spec`,
`--label-pattern`/`--label-regex`, `--exclude-type`, `--no-parent`,
`--no-labels`, `--empty-description`, `--pinned`/`--no-pinned`,
`--deferred`, `--overdue`, `--mol-type`, `--wisp-type`) ride it behind one
capability, `issues.list.filters`. Time bounds are resolved on the client as
they are locally; `--overdue` compares against the server's clock. The
default `--parent` tree view does not carry those filters yet and refuses one
rather than drop it; `--flat` or `--json` applies them to the parent's direct
children (not its whole subtree).
`bd show --current` finds the actor's in-progress or hooked issue through the
server's boolean query. `bd recompute-blocked` is a no-op that exits 0: the
server maintains `is_blocked` on every write, and repairing a stale flag is
done in the server's own workspace (`--json` reports
`{"rows_corrected": 0, "maintained_by": "server"}`).
An embedding program that links beads as a library rather than running
`cmd/bd` registers this backend itself through the public
[`backend/http`](backend/http) package (`bdhttp.Register`), and can open a
workspace with a credential scoped to one caller via
`beads.OpenBestAvailableWith` — see that package's doc comment for the
multi-tenant case. This surface is EXPERIMENTAL: pin an exact beads version.
## 🌐 Community Tools
See [docs/community-tools.md](docs/community-tools.md) for a curated list of community-built UIs, extensions, and integrations—including terminal interfaces, web UIs, editor extensions, and native apps.
@ -358,6 +211,5 @@ This is useful for:
## 📝 Documentation
* [Documentation site](https://beads.gascity.com/) | [Installing](docs/getting-started/installation.md) | [Sync Concepts](docs/core-concepts/sync-concepts.md) | [Agent Setup](docs/getting-started/ide-setup.md) | [Copilot CLI Setup](docs/integrations/copilot-cli.md) | [Copilot VS Code MCP](docs/integrations/github-copilot.md) | [Articles](ARTICLES.md) | [Sync Branch Mode](docs/reference/protected-branches.md) | [Troubleshooting](docs/reference/troubleshooting.md) | [FAQ](docs/reference/faq.md)
* Contributing: [CONTRIBUTING.md](CONTRIBUTING.md) (Bazel builds and tests beads: install [Bazelisk](https://github.com/bazelbuild/bazelisk), then `make test`) | [Roadmap](ROADMAP.md) | [Contributor agent instructions](AGENTS.md)
* [Documentation site](https://beads.gascity.com/) | [Installing](docs/getting-started/installation.md) | [Sync Concepts](docs/core-concepts/sync-concepts.md) | [Agent Workflow](AGENT_INSTRUCTIONS.md) | [Copilot CLI Setup](docs/integrations/copilot-cli.md) | [Copilot VS Code MCP](docs/integrations/github-copilot.md) | [Articles](ARTICLES.md) | [Sync Branch Mode](docs/reference/protected-branches.md) | [Troubleshooting](docs/reference/troubleshooting.md) | [FAQ](docs/reference/faq.md)
* [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/gastownhall/beads)

View file

@ -94,19 +94,15 @@ release-critical gates do not all run on every PR, so "tag the tip of main"
means tagging a SHA nobody has fully tested. A burned tag is never reused
(the v1.1.1 and v1.2.0 precedents), so that gamble is expensive.
**Cut the branch from a SHA that is green on `Bazel`, `Main` and
`Nightly`.** The `Bazel` workflow (every Linux test lane, on rbe-west) and
the `Main` workflow (the macOS and Windows jobs) run on push to `main`, and
the `Nightly` workflow (the full Bazel suite with no cached test results)
runs on a 2am UTC schedule, so the newest SHA with all three is usually a
few hours behind the tip:
**Cut the branch from a SHA that is green on both `Main` and
`Nightly Full Tests`.** The `Main` workflow runs on push to `main` and the
`Nightly Full Tests` workflow runs on a 2am UTC schedule, so the newest SHA
with both is usually a few hours behind the tip:
```bash
gh run list --workflow Bazel --branch main --event push --status success --limit 5 \
--json headSha,conclusion,createdAt
gh run list --workflow Main --branch main --status success --limit 5 \
--json headSha,conclusion,createdAt
gh run list --workflow Nightly --status success --limit 3 \
gh run list --workflow "Nightly Full Tests" --status success --limit 3 \
--json headSha,conclusion,createdAt
git fetch origin
@ -140,17 +136,16 @@ git log --oneline main..release/1.3.0
Before starting a release:
- [ ] `release/x.y.z` branch cut from a SHA green on `Bazel`, `Main` **and**
`Nightly` (see [Release Branches](#release-branches))
- [ ] All tests passing (`make test`, the Bazel test lane)
- [ ] `release/x.y.z` branch cut from a SHA green on `Main` **and**
`Nightly Full Tests` (see [Release Branches](#release-branches))
- [ ] All tests passing (`go test ./...`)
- [ ] npm package tests passing (`cd npm-package && npm run test:all`)
- [ ] **Upgrade smoke tests pass** (`make test-upgrade`) — see [Release Stability Gate](engdocs/RELEASE-STABILITY-GATE.md)
- [ ] **Regression tests pass**
(`bazel test //tests/regression:regression_test --config=doltserver-cmd`)
- [ ] **Regression tests pass** (`make test-regression`)
- [ ] **Every release target cross-compiles** — see
[Cross-compile before tagging](#cross-compile-before-tagging). PR CI
builds them only with cgo off, and a target that fails at tag time
burns the tag.
[Cross-compile before tagging](#cross-compile-before-tagging). PR CI does
not build them ([#5662](https://github.com/gastownhall/beads/issues/5662)),
and a target that fails at tag time burns the tag.
- [ ] **CHANGELOG.md updated with release notes** (see format below)
- [ ] **CHANGELOG rollup checked** — nothing left under `[Unreleased]` that
belongs in this release, and nothing filed under a *previous* release's
@ -168,15 +163,12 @@ Before starting a release:
### Cross-compile before tagging
`.goreleaser.yml` builds darwin, linux, windows **and freebsd**; the v1.2.0
tag burned on a freebsd compilation failure no pre-tag gate caught
([#5661](https://github.com/gastownhall/beads/pull/5661),
[#5662](https://github.com/gastownhall/beads/issues/5662)). PR CI now builds
the whole tree for every target in `scripts/ci/release-targets.txt` with Bazel
(`scripts/ci/bazel-release-cross-compile.sh`, in bazel.yml's pure-Go lane),
but with cgo off, while linux/amd64, linux/arm64, windows/amd64 and the darwin
pair ship with `CGO_ENABLED=1`. Build the real release configuration by hand
before tagging:
`.goreleaser.yml` builds darwin, linux, windows **and freebsd**, but PR CI
builds none of the cross targets — the v1.2.0 tag burned on a freebsd
compilation failure that no pre-tag gate could have caught
([#5661](https://github.com/gastownhall/beads/pull/5661) fixed the break,
[#5662](https://github.com/gastownhall/beads/issues/5662) tracks the CI gap).
Until that gap is closed, build them by hand before tagging:
```bash
goreleaser build --snapshot --clean

View file

@ -1,71 +0,0 @@
# Beads Roadmap
Last updated: 2026-10-05 · Owner: [@julianknutsen](https://github.com/julianknutsen)
This page lists the areas the maintainers are prioritizing. It reflects
current thinking, not commitments or dates: priorities change as we learn,
and the live state of each item is its tracking issue on GitHub.
## How this roadmap is used
- **Priority areas get expedited review.** Issues and PRs that advance a
priority area below are triaged and reviewed first.
- **Propose work with an issue when it warrants discussion.** For work
inside or outside a priority area that needs context or a design decision,
open an issue with the feature form, before or alongside your PR; small,
self-explanatory changes can go straight to a PR. See
[CONTRIBUTING.md](CONTRIBUTING.md#issues-and-pull-requests).
- **Scope.** Proposals must fit the product boundary in
[engdocs/PROJECT_CHARTER.md](engdocs/PROJECT_CHARTER.md).
- **Updates.** The owner rewrites this page at each minor release; the date
above says when it was last reviewed.
## Priority areas for 1.4
### Versioned beads and history
- **Goal:** every change to a bead is recorded as a version. Users can read
a bead's history and past versions, and writers can use `expectedRevision`
compare-and-swap to avoid lost updates. Everything ships behind a flag, off
by default, until the conformance suite and a production-corpus soak say
otherwise.
- **This period:** all six phases, enabled from the CLI by the end of the
period: conformance suite
([#6133](https://github.com/gastownhall/beads/issues/6133)), additive
schema ([#6134](https://github.com/gastownhall/beads/issues/6134)),
dual-write history behind a flag
([#6135](https://github.com/gastownhall/beads/issues/6135)), versioned
reads and CAS ([#6136](https://github.com/gastownhall/beads/issues/6136)),
production-corpus validation
([#6137](https://github.com/gastownhall/beads/issues/6137)), and CLI
surfacing and enablement
([#6138](https://github.com/gastownhall/beads/issues/6138)).
- **Tracking issue:** [#6132](https://github.com/gastownhall/beads/issues/6132);
design discussion stays on
[#5898](https://github.com/gastownhall/beads/issues/5898).
### Beads Graph Preview 2
- **Goal:** ship Beads Graph Preview 2, the next public checkpoint for the
generic Bead-and-Link graph model: a coherent daily-use CLI journey in
graph mode that behaves like ordinary `bd`, backed by a complete,
reviewable CLI specification.
- **This period:** the reviewed graph CLI specification, a complete
daily-use Issue journey proven through the installed CLI on embedded and
shared-server Dolt, and editing around that Issue (labels, notes, Memory
and Link edits).
- **Tracking issue:** [#7170](https://github.com/gastownhall/beads/issues/7170)
### Contributor onboarding
- **Goal:** a new contributor, human or agent, finds the rules for the code
they are changing next to that code, understands its intent and
invariants, and lands a well-explained PR, backed by an issue when the
change warrants one.
- **This period:** contributor-only agent instructions and documented-issue
intake ([#7223](https://github.com/gastownhall/beads/pull/7223));
per-package `AGENTS.md` files for the storage packages, naming their
guard tests and lint rules; a package-doc linter and package docs for the
packages that have none; and a curated set of `help wanted` starter
issues.
- **Tracking issue:** [#7228](https://github.com/gastownhall/beads/issues/7228)

View file

@ -1,156 +0,0 @@
# Versioned Beads: issue-plane write paths and their Phase 2 disposition
This document has two parts. **Dispositions at this head** is the current inventory: every row whose disposition changed after the completeness fix a14f48b17 (merged as 5098ec85f), the seam's call sites at this head, and notes that are true now. **As found at 321a79278** is the review artifact this PR started from — the table donnabox's item 5 on #6358 asked for, derived before the completeness fix — kept verbatim under a dated heading because it is the record of what the review found. Wherever the two parts differ, the current part wins; a reader citing a row number should cite it from the current part.
## Dispositions at this head
Status after a14f48b17 (merged as 5098ec85f on `deploy/be-764ey-gate`): the table below was derived from the tree at 321a79278, before the completeness fix, and is kept as the record of what the review found. Since that commit the following rows changed disposition:
- Rows 17-23, 25 and 27 (close, reopen, claim, unclaim/release, lease reclaim, defer wake, label add/remove, promote, persistence move) are now **VERSIONED**: each mints once, after its row write and event, gated on a row actually changing.
- Rows 14-16 (legacy `AddDependency`/`RemoveDependency` verbs, the uow dependency repository, batch-apply structural adds) are now **VERSIONED** through the lowest-level helpers `addDependencyInTx`/`removeDependencyInTx` (mint gated on the row insert/delete); the publicops editor's own mint call was removed so no leg double-mints.
- Ordering: `ExecuteUpdate` mints once, after field, label, parent and persistence patches; batch create mints per issue after its creation-time edges are persisted, so the first version carries the outgoing edge set.
- `version_completeness_test.go` (46 must-mint entry points, exemption table with reasons, never-mints inverse guard) and `embeddeddolt/version_completeness_behaviour_test.go` pin the set at runtime.
The seam is `issueops.RecordVersionInTx` in internal/storage/issueops/version_history.go (line 87 at 321a79278; cite the function rather than a line at later heads, since comment edits move it), which sits beside the events-journal seam `issueops.RecordEventInTx` (journal.go:309). At 321a79278 it was reached from exactly six call sites: create.go:196, update.go:547, dependency_editor.go:181 and :272, and domain/db/issue.go:87/:102 (`Insert`) and :339 (`Update`); after a14f48b17 it is reached from 27 (18 in issueops, 9 in domain/db), listed in the section "Seam call sites after the completeness fix" below. Dispositions: **VERSIONED** = reaches `RecordVersionInTx` and mints an `issue_versions` row plus the `current_revision` bump; **NO-OP** = discarded before the seam (`DiscardNoopIssueUpdates`, the dependency editor's `eventWritten` gate, create's early returns, or the wisp exclusion); **OUT OF CONTRACT** = mutates an issue-plane row (issues, wisps, dependencies, labels, comments and wisp_* twins) without ever calling the seam. Paths are under `internal/storage/` unless they start with `cmd/`, `internal/compact/` or `backend/`. Checkout: /var/tmp/mayor-beads-phase2 @ deploy/be-764ey-gate; all line numbers are against commit 321a79278, the HEAD when this inventory was read (see the last note on drift).
### Rows whose disposition changed after a14f48b17
Row numbers are the historical table's. Line numbers in this table are against the Go tree at this head (unchanged since 5098ec85f).
| # | Path | Version seam at this head | Disposition | Mechanism |
|---|---|---|---|---|
| 13 | any of rows 1-8 whose target row is a wisp **or a promoted no-history bead** | no | NO-OP (a flagged issues-table create is stamped, not versioned) | The table that holds the row decides its plane, not its flags. A row in the wisps table mints and stamps nothing, whatever its flags say (FR-8). An update-shaped call on a flagged wisp returns on `IsWisp`, which is `Ephemeral \|\| NoHistory` (helpers.go:36-41). Every other wisps-table row is excluded by the seam's read of `participation_generation` from the issues table, which finds no row and returns: a flagged wisp's create-shaped call, and an unflagged row (bd mol squash's in-place flag clear, import's `wisp_plane` marker), which passes `IsWisp`. An issues-table row carrying `NoHistory` (a promoted no-history bead, bd-r9uce) is never versioned while it says so, because no-history means no history: an update-shaped call returns on `IsWisp`. A create-shaped call on such a row, with the flag on, still stamps `participation_generation` and mints nothing, so the row is not legacy once `bd update --persistent` repairs the flag in place. |
| 14 | dependencies.go:`addDependencyInTx` via `AddDependencyInTx` from the store verbs, `ApplyParentPatch`, `applyBatchRun.applyDepAdd` | yes | VERSIONED | mint moved into `addDependencyInTx` (`mintDependencyVersion`, dependencies.go:393), gated on the row insert rather than on `eventWritten`; the publicops editor's own mint call was removed so no leg double-mints |
| 15 | domain/db/dependency.go:`dependencySQLRepositoryImpl.Insert` (uow `AddDependencies`, create-time edges) | yes | VERSIONED | seam at dependency.go:228 and :240 after the insert |
| 16 | dependencies.go:`removeDependencyInTx` via `RemoveDependencyInTx` and domain/db/dependency.go:`Delete` | yes | VERSIONED | gated on the row delete; dependency.go:409 on the uow leg |
| 17 | close.go:`closeIssueInTx` (all close variants; `ExecuteCloseBatch` loops it; domain/db `Close`/`CloseChecked`) | yes | VERSIONED | close.go:394, after the row write and event, gated on the row changing |
| 18 | reopen.go:`reopenIssueInTx` | yes | VERSIONED | reopen.go:126 |
| 19 | claim.go:`claimIssueInTx` and domain/db/issue.go:`Claim` | yes | VERSIONED | claim.go:239 and issue.go:551; `ExecuteUpdate`'s Claim flag passes `mintVersion=false` and mints once at its own end |
| 20 | unclaim.go:`finishUnclaimInTx` (unclaim, release) | yes | VERSIONED | unclaim.go:137 |
| 21 | lease.go:`ReclaimExpiredLeasesInTx` | yes | VERSIONED | lease.go:786 |
| 22 | wake_defers.go:`wakeExpiredDefersInTable` | yes | VERSIONED | wake_defers.go:143 |
| 23 | labels.go:`addLabelInTx` / `removeLabelInTx` and domain/db/label.go:`Insert` / `Delete` | yes | VERSIONED | labels.go:190 and :239 gated on `RowsAffected() > 0`; label.go:91 and :130; `applyLabelPatch` (aggregate.go:360) mints only when called outside `ExecuteUpdate` |
| 25 | promote.go:`PromoteFromEphemeralInTx` | yes | VERSIONED | promote.go:141, after the label, dependency and comment copies |
| 27 | persistence.go:`moveIssuePersistenceInTx` | yes | VERSIONED | persistence.go:76 and :153; `ExecuteUpdate` passes `mintVersion=false` and mints once at its own end |
| 34 | batch_apply.go:`applyBatchRun` | yes, per item | VERSIONED | its create/update/close items reach rows 1/2, 5/6 and 17; its dep-add items reach `addDependencyInTx`, which now mints (row 14) |
Rows not listed keep the disposition shown in the historical table: rows 1-8 VERSIONED; rows 9-12 NO-OP gates inside them; rows 24, 26, 28-33 and 35-39 OUT OF CONTRACT; row 40 writes no issue-plane row; row 41 is Phase 3.
### Counts at this head
Of the 34 live issue-plane write paths (rows 1-8 and 14-39), **21 are VERSIONED** (rows 1-8, 14-23, 25, 27, 34) and **13 are OUT OF CONTRACT** (rows 24, 26, 28-33, 35-39); rows 9-13 are the no-op gates inside the versioned ones. The out-of-contract set is what the design puts out of contract: comments (not part of the snapshot), is_blocked flips, delete, rename and demote (Phase 3's deleted-Versioned-Bead guarantee), compaction bookkeeping and restore, migrations, merge-settle, doctor fixes and raw SQL.
### Still deferred
Still true and deliberately out of contract or deferred: an unchanged re-import of an existing row mints a version (create has no field-level no-op gate — and the journal seam sits in the same position: `RecordEventInTx(EventCreate)` at create.go:207 runs on every accepted upsert, only the events-table write behind the `isNew` gate at create.go:171 is skipped, so a no-op gate belongs in front of both seams, not the version seam alone); the uow leg mints per repository write, so a domain create with N labels and M edges yields 1+N+M versions where the direct legs yield one (each a distinct accepted state; follow-up); demote-to-wisp and delete/rename strand version rows because `issue_versions` has no FK to `issues` (Phase 3's deleted-Versioned-Bead guarantee); compaction bookkeeping, restore, migrations, merge-settle, doctor fixes and `bd sql` remain out of contract by design. The flag-off contract is behaviourally a no-op at the seam (`RecordVersionInTx` returns before any query) but not literally zero added work: labels.go's `RowsAffected` gate and the per-transaction `sync.Map` entry run with the flag off; the differential harness that would prove the stronger claim is not in this PR. The items that become live the first time the flag is on — the uow leg's 1+N+M, the re-import no-op gate on both seams, duplicate-key metadata, the single-writer allocator, and the `attribution_status` vocabulary being enforced only in Go — are tracked together in gastownhall/beads#6379.
### Seam call sites at this head
Verified with `grep -rn 'RecordVersionInTx(' internal/ --include='*.go'` over non-test files at d484b809d (the Go tree is unchanged between the merge of a14f48b17 as 5098ec85f and this note): **27 call sites** reach the seam, 18 on the direct legs in `issueops/` and 9 on the uow leg in `domain/db/`. The figure of 29 quoted in the PR thread was an over-count; this table is the correction. Line numbers are against that tree. The 46 "must-mint entry points" pinned by `version_completeness_test.go` are a different count by design: they are the public entry functions whose call graph must reach the seam, not the seam's own call sites.
Direct legs, `internal/storage/issueops/` (18):
| File:line | Function | Mutation |
|---|---|---|
| aggregate.go:360 | `applyLabelPatch` | label patch (mints only when used outside `ExecuteUpdate`, which passes `mintVersion=false`) |
| aggregate.go:423 | `applyParentPatch` | parent patch (same rule) |
| claim.go:239 | `claimIssueInTx` | claim |
| close.go:394 | `closeIssueInTx` | close, all variants; `ExecuteCloseBatch` loops it |
| create.go:216 | `CreateIssueInTxWithResult` | singular create and import upsert |
| create.go:384 | `CreateIssuesInTxWithContext` | batch create, per issue, after its creation-time edges (`DeferVersionMint`) |
| dependencies.go:393 | `mintDependencyVersion` | from `addDependencyInTx` / `removeDependencyInTx`: legacy verbs, the publicops editor, batch-apply |
| execution.go:269 | `ExecuteUpdate` | once, after field, label, parent and persistence patches |
| labels.go:190 | `addLabelInTx` | label add |
| labels.go:239 | `removeLabelInTx` | label remove |
| lease.go:786 | `ReclaimExpiredLeasesInTx` | lease reclaim |
| persistence.go:76, :153 | `moveIssuePersistenceInTx` | persistence move (two sites in the one function) |
| promote.go:141 | `PromoteFromEphemeralInTx` | promote from ephemeral |
| reopen.go:126 | `reopenIssueInTx` | reopen |
| unclaim.go:137 | `finishUnclaimInTx` | unclaim / release |
| update.go:555 | `updateIssueInTx` | update |
| wake_defers.go:143 | `wakeExpiredDefersInTable` | defer wake |
uow leg, `internal/storage/domain/db/` (9):
| File:line | Method | Mutation |
|---|---|---|
| issue.go:87, :102 | issue repository `Insert` | create (two sites in the one method) |
| issue.go:339 | issue repository `Update` | update |
| issue.go:551 | issue repository `Claim` | claim |
| label.go:91 | label repository `Insert` | label add |
| label.go:130 | label repository `Delete` | label remove |
| dependency.go:228, :240 | dependency repository `Insert` | edge add (two sites in the one method) |
| dependency.go:409 | dependency repository `Delete` | edge remove |
### Notes at this head
- **What actually versions:** every accepted issue-plane mutation on every leg — create (singular, batch, import), update (and everything that reaches `updateIssueInTx`: metadata merge/delete/CAS, deleted-reference rewrite, compaction's content rewrite), dependency add and remove (editor, legacy verbs, uow repository, batch-apply), close, reopen, claim, unclaim/release, lease reclaim, defer wake, label add and remove, promote, persistence move. `version_completeness_test.go` pins 46 must-mint entry points with an exemption table (a reason per row) and an inverse never-mints guard; `embeddeddolt/version_completeness_behaviour_test.go` pins the runtime deltas.
- **Cross-leg symmetry on dependencies:** resolved. The dolt and embeddeddolt editors, the legacy store verbs and the uow repository all reach the seam through `addDependencyInTx` / `removeDependencyInTx`, gated on the row insert or delete.
- **Ordering inside a versioned call:** the mint is the last durable-state write. `ExecuteUpdate` mints once after its field, label, parent and persistence patches; batch create mints per issue after `PersistDependenciesWithOptionsResult`, so the first version carries the creation-time edge set.
- **Count vs design:** 21 VERSIONED, 13 OUT OF CONTRACT, 5 no-op gates (see Counts at this head). The design's "eighteen" is still not reconcilable item by item from this checkout.
- **Import upsert:** an unchanged re-import of an existing row still mints, and it also journals — `RecordEventInTx(EventCreate)` at create.go:207 runs on every accepted upsert — so the no-op gate belongs in front of both seams (gastownhall/beads#6379, item 2).
- **No FK from issue_versions to issues** (0067), so delete, rename and demote strand version rows under ids that no longer exist in `issues` — Phase 3 (gastownhall/beads#6379, item 6).
- **Non-canonicalizable snapshots fail the mutation** by policy: duplicate keys in an issue's `metadata` (a `json.RawMessage`) make `canonicalDurableState` return an error and abort the transaction with the flag on (gastownhall/beads#6379, item 3).
- **Single writer means one writer at a time per store,** not merely one clone: `MAX(revision)+1` is not a safe allocator for two concurrent transactions in one store either, and no contract case runs concurrent writers (gastownhall/beads#6379, item 4).
- **Exemption tables that name the seam:** journal_completeness_test.go `beadDMLExemptions` and row_lock_guard_test.go `funcNameExemptions` both list `RecordVersionInTx` as bookkeeping for an already-journaled mutation; unchanged.
## As found at 321a79278 (historical; superseded above wherever the two parts differ)
The table and notes below are the inventory as derived from the tree at 321a79278, the HEAD when it was read, and all line numbers in this part are against that commit. It is kept verbatim as the record of what the review found. Rows 13-23, 25, 27 and 34 are superseded by the current table above; the notes below that contradict the notes above are superseded too.
| # | Path (file:function) | Writes | Events seam | Version seam | Disposition | Why |
|---|---|---|---|---|---|---|
| 1 | issueops/create.go:`CreateIssueInTxWithResult` (`CreateIssueInTx`; execution.go:`ExecuteCreate`; dolt/issues.go:`createIssue`; dolt/transaction.go and embeddeddolt/transaction.go `CreateIssue`) | issues or wisps row via `InsertIssueIfNew` (ON DUPLICATE KEY UPDATE upsert) + labels + comments | yes | yes | VERSIONED | both seams run once after labels/comments persist (create.go:193-197); an existing-row upsert (`isNew=false`) still mints — create has no field-level no-op gate |
| 2 | domain/db/issue.go:`issueSQLRepositoryImpl.Insert` (`InsertBatch` loops it; domain `IssueUseCase.CreateIssue`/`CreateWisp` from uow/issue_operations.go, uow/batch_creator.go, uow/batch_applier.go) | issues or wisps via `issueops.InsertIssueStrictInTx` | yes | yes | VERSIONED | uow leg; `RecordVersionInTx` directly after `RecordEventInTx` in both branches (issue.go:84-87, 99-102) |
| 3 | issueops/create.go:`CreateIssuesInTxWithContext` / `CreateIssuesInTxWithResult` (create_batch.go:`ExecuteCreateBatch`; store `CreateIssuesWithFullOptions` on both direct legs) | row 1 per issue, then `PersistDependenciesWithOptionsResult` | yes (per issue, plus dep events) | yes (per issue) | VERSIONED | per-issue loop (create.go:309); creation-time edges are inserted AFTER each issue's version row, so they are neither in that row's `durable_state` nor versioned themselves |
| 4 | Import: uow/importer.go:`importer.ImportBatch`; embeddeddolt/store.go:`ImportJSONLData`; embeddeddolt/transaction.go:`CreateIssueImport`; cmd/bd/import_shared.go via `store.CreateIssuesWithFullOptions` | as row 3 | yes | yes | VERSIONED | import is not a separate write path — it funnels into rows 1/3; at 321a79278 rows get `attribution_status` supplied/undetermined and `imported` is only reserved (version_history.go:57-61); 56b2199d4, which landed mid-session, collapses the values to claimed/unknown with no `imported` at all |
| 5 | issueops/update.go:`updateIssueInTx` (`UpdateIssueInTx`, `UpdateIssueWithoutEventInTx`; execution.go:`ExecuteUpdate`; metadata.go:`writeMergedMetadataInTx` from `MergeMetadataInTx`/`DeleteMetadataInTx`/metadata_cas.go:`CompareAndSetMetadataKeyInTx`; delete_role.go:`RewriteDeletedReferencesInTx`; compaction's content rewrite via `store.UpdateIssue`) | UPDATE issues or wisps SET fields, row_lock | yes | yes | VERSIONED | seams at update.go:544-547, after `DiscardNoopIssueUpdates` (:391) and NOT inside `if recordEvent` — `UpdateIssueWithoutEventInTx` still versions |
| 6 | domain/db/issue.go:`issueSQLRepositoryImpl.Update` (domain `IssueUseCase.ApplyUpdate` from uow/issue_operations.go, uow/batch_applier.go) | UPDATE issues or wisps | yes | yes | VERSIONED | uow leg; same no-op gate (issue.go:212-219), seams at :336-339 |
| 7 | issueops/dependency_editor.go:`addDependencyEdgeInTx` (`ExecuteAddDependencies` from dolt/dependency_editor.go, embeddeddolt/dependency_editor.go) | INSERT dependencies or wisp_dependencies via `AddDependencyInTx` (+ is_blocked marks) | yes (`RecordDepEventInTx` inside `addDependencyInTx`) | yes, iff `eventWritten` | VERSIONED | versions the referencing (source) issue only when a row was recorded (dependency_editor.go:180-183) |
| 8 | issueops/dependency_editor.go:`ExecuteRemoveDependency` (from dolt/dependency_editor.go, embeddeddolt/dependency_editor.go) | DELETE dependencies or wisp_dependencies via `RemoveDependencyInTx` | yes | yes, iff `eventWritten` | VERSIONED | returns `Removed:false` before the seam when no row matched (:263-274) |
| 9 | update.go:`updateIssueInTx` / domain/db/issue.go:`Update` when `DiscardNoopIssueUpdates` leaves no field | nothing | no | no | NO-OP | returns before the UPDATE (update.go:391-397; issue.go:212-219) — the FR-2 contract case |
| 10 | dependency_editor.go:`addDependencyEdgeInTx` on a same-type re-add | UPDATE dependencies SET metadata (dependencies.go:274) | yes (dependencies.go:281) | no | NO-OP | `addDependencyInTx` returns `eventWritten=false` on the existing-edge branch, so the seam is skipped although metadata is rewritten and journaled |
| 11 | dependency_editor.go:`ExecuteRemoveDependency` on an absent edge | nothing | no | no | NO-OP | `removeDependencyInTx` reports `eventWritten=false`; editor returns at :267 |
| 12 | create.go:`CreateIssueInTxWithResult` on collision-skip, `ConflictSkip` or `RejectStaleUpserts` hit | nothing | no | no | NO-OP | early returns at create.go:126-128, 135-143 precede both seams |
| 13 | any of rows 1-8 whose target row is a wisp | as per row | yes | no | NO-OP | `RecordVersionInTx` returns nil on `IsWisp` (version_history.go:96, FR-8); wisps.current_revision stays at its default |
| 14 | dependencies.go:`addDependencyInTx` via `AddDependencyInTx` from the store verbs — dolt/dependencies.go:`addDependencyWithOptions`, dolt/transaction.go and embeddeddolt/transaction.go `AddDependencyWithOptions`, embeddeddolt/dependencies.go, dolt/wisps.go:`addWispDependency`, batch_apply.go:`applyBatchRun.applyDepAdd`, aggregate.go:`ApplyParentPatch` | INSERT dependencies or wisp_dependencies | yes | no | OUT OF CONTRACT | same DML as row 7 but no caller invokes `RecordVersionInTx`; only the publicops editor role versions |
| 15 | domain/db/dependency.go:`dependencySQLRepositoryImpl.Insert` (domain `DependencyUseCase.AddDependencies` from uow/dependency_editor.go and uow/batch_applier.go; `IssueUseCase` create-time edges, domain/issue.go:980,1041,1053) | INSERT dependencies or wisp_dependencies | yes | no | OUT OF CONTRACT | the uow leg's dependency add never reaches the seam — only `Insert`/`Update` in domain/db/issue.go do |
| 16 | dependencies.go:`removeDependencyInTx` via `RemoveDependencyInTx` from store verbs (dolt/dependencies.go and both transactions `RemoveDependencyWithOptions`, `ApplyParentPatch`) and domain/db/dependency.go:`Delete` (uow `RemoveDependencyBySource`) | DELETE dependencies or wisp_dependencies | yes (when EmitEvent) | no | OUT OF CONTRACT | as row 14 |
| 17 | close.go:`closeIssueInTx` (`CloseIssueInTx`, `CloseIssueWithoutEventInTx`, `CloseIssueCheckedInTx`; execution.go:`ExecuteClose`; close_batch.go:`ExecuteCloseBatch` loops `ExecuteClose`; domain/db `Close`/`CloseChecked`) | UPDATE issues or wisps SET status, closed_at, close_reason, closed_by_session, row_lock (close.go:340) | yes (EventClose, close.go:387, not gated by `recordEvent`) | no | OUT OF CONTRACT | direct UPDATE; never calls `RecordVersionInTx`, so a close is invisible to issue_versions |
| 18 | reopen.go:`reopenIssueInTx` (`ReopenIssueInTx`; execution.go:`ExecuteReopen`; domain/db `Reopen`) | UPDATE status/closed_at (reopen.go:64) | yes | no | OUT OF CONTRACT | as row 17 |
| 19 | claim.go:`ClaimIssueInTx` (public_claim.go:`ExecuteClaim`; `ClaimReadyIssueInTx` from claim_next.go:`ExecuteClaimNext`; `ExecuteUpdate`'s Claim flag) and domain/db/issue.go:`Claim` (uow) | UPDATE assignee/status/started_at (claim.go:115,124; issue.go:478,488) | yes | no | OUT OF CONTRACT | a claim-only request mints nothing; `ExecuteUpdate` versions only if other fields also change (execution.go: `ClaimIssueInTx` then `if len(updates) > 0`) |
| 20 | unclaim.go:`UnclaimIssueInTx` / `UnclaimIssueIfAssigneeInTx` via `finishUnclaimInTx`; release_role.go:`ReleaseIssueInTx` wraps them (domain/db `UnclaimIssue`/`ReleaseIssue`) | UPDATE assignee/status (unclaim.go:80,197) | yes | no | OUT OF CONTRACT | direct UPDATE |
| 21 | lease.go:`ReclaimExpiredLeasesInTx` (dolt/issues.go:473, embeddeddolt/issues.go:134, domain/db `ReclaimExpiredLeases`) | UPDATE issues assignee/status revert (lease.go:758) + DELETE leases | yes | no | OUT OF CONTRACT | `HeartbeatIssueInTx` writes only `leases` and is not an issue-record write |
| 22 | wake_defers.go:`wakeExpiredDefersInTable` (`WakeExpiredDefersInTx`; dolt/queries.go:63, embeddeddolt/queries.go:33, domain/db `WakeExpiredDefers`) | UPDATE status (wake_defers.go:116) | yes (actor `DeferWakeActor`) | no | OUT OF CONTRACT | scheduled status flip outside the seam |
| 23 | labels.go:`AddLabelInTx` / `RemoveLabelInTx` (dolt/labels.go, embeddeddolt/labels.go, both transactions, aggregate.go:`ApplyLabelPatch` from `ExecuteUpdate`) and domain/db/label.go:`Insert` / `Delete` (uow `LabelUseCase`) | INSERT IGNORE / DELETE labels or wisp_labels | yes (EventUpdate) | no | OUT OF CONTRACT | labels ARE in `durable_state` (get_issue.go:59 hydrates them) but a label change mints nothing; in `ExecuteUpdate` the label patch runs after `UpdateIssueInTx`'s mint, so a same-call field+label edit records the old label set |
| 24 | comments.go:`addIssueCommentInTx` (`AddIssueCommentInTx`, `ImportIssueCommentInTx`, commenter.go:`ExecuteAddComment`); dolt/transaction.go:`AddComment` / `ImportIssueComment` (`InsertDerivedEventReturningID` / `InsertDerivedComment`); domain/db/comment.go:`InsertRecord` (uow `CommentUseCase`); create.go:`PersistComments` | INSERT comments or wisp_comments (dolt tx `AddComment` writes an events-table comment row) | yes (`RecordCommentEventInTx`) | no | OUT OF CONTRACT | comments are not in `durable_state` either (`GetIssueInTx` joins labels, not comments) |
| 25 | promote.go:`PromoteFromEphemeralInTx` (dolt/ephemeral_routing.go:205, embeddeddolt/store.go:1003, domain/db `PromoteFromEphemeral`) | INSERT issues (+ label/dep/comment copies), DELETE wisps | yes | no | OUT OF CONTRACT | promoted row lands with current_revision default 1 and no version row |
| 26 | dolt/ephemeral_routing.go:`DoltStore.demoteToWispInTx` | `UpdateIssueWithoutEventInTx` (row 5), then raw aux copies + DELETE FROM issues (:303) | yes | yes (update half only) | OUT OF CONTRACT | mints a version row for an issue the same tx then deletes; issue_versions has no FK to issues (0067), so the row strands |
| 27 | persistence.go:`MoveIssuePersistenceInTx` (`ExecuteUpdate` persistence patch; domain/db `MovePersistence`) | `InsertIssueStrictInTx` into the target plane, copy aux, DELETE source (persistence.go:70,106) | yes (twice) | no | OUT OF CONTRACT | plane move bypasses both the create and update seams |
| 28 | delete.go:`deleteIssueRowInTx` / `DeleteIssuesInTx` / `DeleteResolvedSetInTx`; delete_role.go:`DeleteInTx`; sweep.go:`SweepInTx`; dolt/wisps.go:`deleteWisp` / `deleteWispBatchTx`; domain/db/issue.go:`Delete` / `DeleteByIDs` (+ label/dependency/events `DeleteAllForIDs`, domain/issue_delete.go) | DELETE issues or wisps + aux + leases | yes (`RecordDeleteInTx`) | no | OUT OF CONTRACT | no surviving row; the deleted-Versioned-Bead guarantee is Phase 3 (PR #6358); orphaned issue_versions rows remain. delete_role.go:`RewriteDeletedReferencesInTx` then goes through row 5, so neighbours DO mint versions |
| 29 | bulk_ops.go:`DeleteIssuesBySourceRepoInTx` (dolt/issues.go:946, embeddeddolt/store.go:987) | bulk DELETE issues WHERE source_repo = ? | yes (per id) | no | OUT OF CONTRACT | bulk path |
| 30 | bulk_ops.go:`UpdateIssueIDInTx` via `updateIssueIDInTx` / `updateWispIDInTx` (dolt/rename.go:14, embeddeddolt/store.go:995) | UPDATE issues SET id = ? + dependency rekey | yes (dep-remove, delete old, create new, dep-add via `recordRenameInJournal`) | no | OUT OF CONTRACT | history stays keyed to the old issue_id; the new id carries current_revision with no matching rows |
| 31 | compaction.go:`ApplyCompactionInTx` (dolt/compact.go:52, embeddeddolt/store.go:1179) | UPDATE issues SET compaction_level, compacted_at, compacted_at_commit, original_size, updated_at | no (`beadDMLExemptions`) | no | OUT OF CONTRACT | the content rewrite that precedes it (internal/compact/compactor.go:147, cmd/bd/compact.go:702 via `store.UpdateIssue`) IS row 5, so compaction mints exactly one version for the summary while its own columns land unversioned |
| 32 | compaction.go:`RestoreFromSnapshotInTx` (dolt/compact.go:82, embeddeddolt/store.go:1203) | UPDATE issues content from snapshot (compaction.go:173,181) | no | no | OUT OF CONTRACT | restore's CAS composition is Phase 3 (PR #6358) |
| 33 | blocked_state.go mark/unmark templates via `RecomputeIsBlocked*` / `MarkIsBlockedInTx`; dependencies.go:`markDirectBlockingDependencySourceInTx`; domain/db/dependency.go:`markDirectBlockedSource` | UPDATE issues or wisps SET is_blocked | yes, flips only (journal.go:`recordBlockedJournalChanges`, actorless) | no | OUT OF CONTRACT | derived state; is_blocked is not hydrated into `durable_state` |
| 34 | batch_apply.go:`applyBatchRun` (`ApplyBatch`; uow/batch_applier.go) | per item: create rows 1/2, update rows 5/6, close row 17, dep add rows 14/15 | per item | per item | OUT OF CONTRACT (mixed) | dep-add items call `AddDependencyInTx` / `DependencyUseCase.AddDependencies`, never the versioned editor |
| 35 | schema/cli_migrations.go:`cliMigration0053RepairRigWisps` (INSERT IGNORE INTO issues, UPDATE issues, DELETE FROM wisps); schema/migration_repairs.go and schema/wisp_dep_forward_repair.go (dependencies rewrites) | migration DML | no | no | OUT OF CONTRACT | 0067/0068 themselves are DDL only (ADD COLUMN ... DEFAULT 1; no row backfill) |
| 36 | versioncontrolops/automerge.go:`resolveIssuesFieldMerge` (UPDATE `issues`); versioncontrolops/mergesettle.go:`TryRepairFKCascadeViolations` (`fkCascadeRepairDeletes` on dependencies/labels/comments) | merge-settle rewrites and orphan deletes | no | no | OUT OF CONTRACT | raw connection during merge settlement |
| 37 | dolt/federation.go:`deleteExcludedIssues` (from `stageFilteredBranch`) | DELETE FROM issues WHERE ephemeral = 1 / issue_type = ? on the staging branch | no | no | OUT OF CONTRACT | raw conn on a filtered-push branch |
| 38 | cmd/bd/doctor/fix/validation.go:`OrphanedDependencies` / `ChildParentDependencies` / `CrossTableDuplicates` | `tx.Exec` DELETE FROM dependencies / issues | no | no | OUT OF CONTRACT | raw doctor fixes |
| 39 | cmd/bd/sql.go (`storage.RawDBAccessor.UnderlyingDB` then `db.ExecContext`); cmd/bd/sql_proxied_server.go via uow `RawSQLUseCase().Exec` to domain/db/raw_sql.go | arbitrary SQL | no | no | OUT OF CONTRACT | the proxied variant runs inside a uow tx with the version scope bound (uow/dolt_sql_provider.go:178) but raw SQL never calls the seam |
| 40 | issueops/bootstrap.go:`BootstrapInTx` (uow/bootstrapper.go, hook_bootstrapper.go) | config + metadata tables only (`SetConfigInTx`, `SetMetadataInTx`) | no | no | OUT OF CONTRACT (n/a) | writes no issue-plane row at all |
| 41 | PLANNED 18th: `fk_dep_issue_target` ON DELETE CASCADE (schema/cli_migrations.go:284,311; migrations 0041/0043) | DB-level cascade deleting dependencies rows when their target issues row is deleted; no Go call site | no | no | Phase 3 (planned) | PR #6358 body: "Phase 3 items by design: the `fk_dep_issue_target` cascade (the 18th path)"; today it fires silently underneath rows 28-29 |
### Notes as found at 321a79278
- **Count vs design.** Grouping by leaf mutation function, the code has **34 live issue-plane write paths** (rows 1-8 and 14-39; row 40 excluded because it writes no issue row; rows 9-13 are gates inside rows 1-8) plus the planned FK cascade — not eighteen. Of the 34, **8 are VERSIONED, 26 OUT OF CONTRACT**, and 5 NO-OP gates sit inside the versioned ones. The design's own list (be-hs42e.3) is not resolvable from this checkout or `bd show`; only PR #6358's "the 18th path" line was found, so the eighteen could not be reconciled item by item.
- **What actually versions:** create, update (and their uow twins in domain/db/issue.go) and the publicops dependency editor. Every other journaled mutation — close, reopen, claim, unclaim/release, lease reclaim, defer wake, labels, comments, promote, persistence move, delete, rename — reaches `RecordEventInTx` but never `RecordVersionInTx`, even though version_history.go:20-27 describes the seam as living "inside the same already-short-circuited functions that call RecordEventInTx". journal_completeness_test.go pins 57 `mutationEntryPoints` for the journal; the version seam is wired into 3 of them, and no equivalent completeness test exists for it.
- **Cross-leg asymmetry on dependencies:** the dolt and embeddeddolt DependencyEditor roles version (rows 7-8); the uow DependencyEditor role goes through domain/db dependency `Insert`/`Delete` and does not (rows 15-16). The legacy store verbs `AddDependency`/`RemoveDependency` do not on any leg (rows 14, 16).
- **Versioned only via a helper:** `MergeMetadataInTx`, `DeleteMetadataInTx`, `CompareAndSetMetadataKeyInTx`, `RewriteDeletedReferencesInTx`, compaction's content rewrite and `demoteToWispInTx` version solely because they call `UpdateIssueInTx` / `UpdateIssueWithoutEventInTx`.
- **Per-issue loops:** batch create, import, uow `InsertBatch` (versioned per issue); `ExecuteCloseBatch` loops `ExecuteClose` (row 17, unversioned per issue); `DeleteIssuesInTx` (unversioned).
- **Ordering inside a versioned call:** batch-create edges (row 3) and `ExecuteUpdate`'s label/parent patches (rows 23, 14) land after the mint, so the minted `durable_state` predates them.
- **Import upsert:** an unchanged re-import of an existing row (`isNew=false`, stale check not tripped) mints a version because create has no field-level no-op gate — unlike update's FR-2 behaviour (row 9).
- **No FK from issue_versions to issues** (migration 0067 creates the table without one), so delete, rename and demote (rows 26, 28, 30) strand version rows under ids that no longer exist in issues.
- **Exemption tables that name the seam:** journal_completeness_test.go `beadDMLExemptions` and row_lock_guard_test.go `funcNameExemptions` both list `RecordVersionInTx` as bookkeeping for an already-journaled mutation.
- **Drift during this session (2026-09-07 13:31-13:33):** the branch advanced to 56b2199d4 (`attribution_status` renamed to claimed|unknown, ordinals documented as local) and the working tree then carried further uncommitted edits by another agent — version_history.go (RFC 8785 canonical `durable_state` via `jcs`, with go.mod/go.sum), cli_migrations.go, the 0068 up/down SQL, three schema tests and an untracked version_history_durable_state_test.go. Neither adds or removes a `RecordVersionInTx` call site (the six above were re-verified against 321a79278 and the live tree) and no disposition changes; this inventory is against 321a79278 and does not cover them.

View file

@ -1,106 +0,0 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "backend",
srcs = [
"backend.go",
"errors.go",
"types.go",
],
importpath = "github.com/steveyegge/beads/backend",
visibility = ["//visibility:public"],
deps = [
"//internal/storage",
"//internal/storage/backends",
"//internal/types",
],
)
go_test(
name = "backend_test",
srcs = [
"completeness_test.go",
"errors_test.go",
],
data = [":go_srcs"],
deps = [
":backend",
"//backend/conformance",
"//internal/storage",
"//internal/testutil/bazeltest",
],
)
# --- begin go_srcs (managed by tools/bazel/go_srcs.py; run `make bazel-sync`) ---
filegroup(
name = "go_srcs",
srcs = glob(
["**/*.go"],
allow_empty = True,
),
visibility = ["//:__subpackages__"],
)
# --- end go_srcs ---
# --- begin repo_files (managed by tools/bazel/go_srcs.py; run `make bazel-sync`) ---
filegroup(
name = "repo_doc_files",
srcs = glob(
[
"**/*.md",
"**/*.mdx",
],
allow_empty = True,
exclude = ["**/node_modules/**"],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_go_srcs",
srcs = glob(
["**/*.go"],
allow_empty = True,
exclude = [
"**/*_test.go",
"**/node_modules/**",
],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_go_test_srcs",
srcs = glob(
["**/*_test.go"],
allow_empty = True,
exclude = ["**/node_modules/**"],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_other_files",
srcs = glob(
["**"],
exclude = [
"**/*.db",
"**/*.exe",
"**/*.go",
"**/*.md",
"**/*.mdx",
"**/*.out",
"**/*.prof",
"**/*.pyc",
"**/*.test",
"**/__pycache__/**",
"**/node_modules/**",
],
),
visibility = ["//:__subpackages__"],
)
# --- end repo_files ---

View file

@ -140,37 +140,6 @@ type VCStatus = storage.Status
// store. See the field docs on the aliased struct.
type Backend = backends.Backend
// OpenOptions carries per-open injections (Credential, HTTPClient,
// UserAgent) that Backend.OpenWith may use. See the field docs on the
// aliased struct.
type OpenOptions = backends.OpenOptions
// Credential is the opaque per-open credential marker OpenOptions.Credential
// carries. A backend that needs one declares its own narrower interface and
// type-asserts the value its OpenWith receives. See the aliased type's docs.
type Credential = backends.Credential
// ErrCredentialWithoutOpenWith is returned by Backend.OpenWithOptions when
// OpenOptions.Credential is set but the backend has no OpenWith to honor it.
var ErrCredentialWithoutOpenWith = backends.ErrCredentialWithoutOpenWith
// ErrHTTPClientWithoutOpenWith is returned by Backend.OpenWithOptions when
// OpenOptions.HTTPClient is set but the backend has no OpenWith to honor it.
// Same fail-closed family as ErrCredentialWithoutOpenWith.
var ErrHTTPClientWithoutOpenWith = backends.ErrHTTPClientWithoutOpenWith
// ErrUserAgentWithoutOpenWith is returned by Backend.OpenWithOptions when
// OpenOptions.UserAgent is set but the backend has no OpenWith to honor it.
// Same fail-closed family as ErrCredentialWithoutOpenWith.
var ErrUserAgentWithoutOpenWith = backends.ErrUserAgentWithoutOpenWith
// ErrUnsupportedCredential is the typed refusal an OpenWith implementation
// MUST return (directly or wrapped, so errors.Is still matches) when it
// receives a non-nil Credential that does not type-assert to the narrower
// credential interface that backend's OpenWith expects. See the aliased
// error's docs in internal/storage/backends for the full contract.
var ErrUnsupportedCredential = backends.ErrUnsupportedCredential
// Register adds a backend under name. It is process-start wiring: call it
// once during initialization (typically from a registrant package's init that
// the embedding binary blank-imports), before any concurrent store access.
@ -202,12 +171,6 @@ func WorkspaceIsBeadsDir(name string) bool {
return backends.WorkspaceIsBeadsDir(name)
}
// IsRemote reports whether name is a registered backend that is a pure
// network client of a bd serve with no local database (see Backend.Remote).
func IsRemote(name string) bool {
return backends.IsRemote(name)
}
// Iter is the streaming-read cursor returned by the Iter* methods.
type Iter[T any] = storage.Iter[T]

View file

@ -5,6 +5,7 @@ import (
"go/parser"
"go/token"
"io/fs"
"path/filepath"
"reflect"
"runtime"
"sort"
@ -13,7 +14,6 @@ import (
"github.com/steveyegge/beads/backend"
"github.com/steveyegge/beads/backend/conformance"
"github.com/steveyegge/beads/internal/testutil/bazeltest"
)
const internalPrefix = "github.com/steveyegge/beads/internal/"
@ -77,7 +77,7 @@ func publicAliases(t *testing.T) map[string]bool {
if !ok {
t.Fatal("runtime.Caller failed")
}
dir := bazeltest.CallerDir(thisFile, "backend")
dir := filepath.Dir(thisFile)
fset := token.NewFileSet()
pkgs, err := parser.ParseDir(fset, dir, func(fi fs.FileInfo) bool {
return !strings.HasSuffix(fi.Name(), "_test.go")

View file

@ -1,184 +0,0 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "conformance",
srcs = [
"audit.go",
"audit_config_metadata_slots_repomtime.go",
"audit_dependencies_readiness.go",
"audit_issue-lifecycle.go",
"audit_labels-comments-events.go",
"audit_molecule_wisp_batch_iter.go",
"audit_search-counts-stats.go",
"batch_apply_contract.go",
"batch_apply_gate_contract.go",
"batch_closer_contract.go",
"batch_creator_contract.go",
"batch_getter_contract.go",
"blocked_lister_contract.go",
"blocked_state.go",
"blocking_annotator_contract.go",
"bootstrapper_contract.go",
"claim.go",
"claimer_contract.go",
"commenter_contract.go",
"conformance.go",
"counter_contract.go",
"cross_record_invariant_contract.go",
"cycle_detector_contract.go",
"deleter_contract.go",
"dependency_editor_contract.go",
"dualwrite_history_contract.go",
"dualwrite_participation_generation_contract.go",
"edge_reader_contract.go",
"expected_revision_contract.go",
"graph_counter_contract.go",
"heartbeater_contract.go",
"history_matching.go",
"importer_contract.go",
"issue_operations_contract.go",
"issue_operations_staging.go",
"journal_contract.go",
"lease_reclaimer_contract.go",
"lifecycle_close_reopen_contract.go",
"lifecycle_create_contract.go",
"lifecycle_create_gate_contract.go",
"lifecycle_update_contract.go",
"lifecycle_update_gate_contract.go",
"memories_contract.go",
"metadata_cas_contract.go",
"molecule_contract.go",
"portable.go",
"querier_contract.go",
"reader_contract.go",
"ready_claimer_contract.go",
"ready_counter_contract.go",
"reclaim_scope.go",
"relations_contract.go",
"releaser_contract.go",
"retention_epoch_contract.go",
"role_bundle.go",
"role_bundle_cases.go",
"search_paging.go",
"stats_reporter_contract.go",
"sweeper_contract.go",
"transaction_parity.go",
"tree_walker_contract.go",
"version_reconciler_contract.go",
"versioned_read_contract.go",
"workspaceconfig_contract.go",
],
importpath = "github.com/steveyegge/beads/backend/conformance",
visibility = ["//visibility:public"],
deps = [
"//internal/hooks",
"//internal/storage",
"//internal/storage/issueops",
"//internal/storage/kvkeys",
"//internal/storage/sqlbuild",
"//internal/types",
"//issueops",
"//journalops",
"//memoryops",
],
)
go_test(
name = "conformance_test",
srcs = [
"role_bundle_test.go",
"role_coverage_gate_test.go",
"role_coverage_scan_test.go",
"versioned_history_wiring_test.go",
],
data = [
":go_srcs",
"//beadserrors:go_srcs",
"//internal/types:go_srcs",
"//issueops:go_srcs",
"//journalops:go_srcs",
"//memoryops:go_srcs",
],
embed = [":conformance"],
deps = [
"//internal/storage",
"//internal/testutil/bazeltest",
"//issueops",
"//journalops",
"//memoryops",
],
)
# --- begin go_srcs (managed by tools/bazel/go_srcs.py; run `make bazel-sync`) ---
filegroup(
name = "go_srcs",
srcs = glob(
["**/*.go"],
allow_empty = True,
),
visibility = ["//:__subpackages__"],
)
# --- end go_srcs ---
# --- begin repo_files (managed by tools/bazel/go_srcs.py; run `make bazel-sync`) ---
filegroup(
name = "repo_doc_files",
srcs = glob(
[
"**/*.md",
"**/*.mdx",
],
allow_empty = True,
exclude = ["**/node_modules/**"],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_go_srcs",
srcs = glob(
["**/*.go"],
allow_empty = True,
exclude = [
"**/*_test.go",
"**/node_modules/**",
],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_go_test_srcs",
srcs = glob(
["**/*_test.go"],
allow_empty = True,
exclude = ["**/node_modules/**"],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_other_files",
srcs = glob(
["**"],
exclude = [
"**/*.db",
"**/*.exe",
"**/*.go",
"**/*.md",
"**/*.mdx",
"**/*.out",
"**/*.prof",
"**/*.pyc",
"**/*.test",
"**/__pycache__/**",
"**/node_modules/**",
],
),
visibility = ["//:__subpackages__"],
)
# --- end repo_files ---

View file

@ -113,12 +113,11 @@ func testAuditLabelEventNonIdempotent(t *testing.T, f Factory) {
}
}
// testAuditCountCommentsWispParity pins that CountIssueComments wisp-routes the
// same way GetIssueComments does: a wisp's structured comments live in
// `wisp_comments`, and the count must agree with the rows (GH#5565 — the count
// used to query only `comments` and report 0, so `bd show` showed comment_count 0
// on a wisp that had comments).
func testAuditCountCommentsWispParity(t *testing.T, f Factory) {
// testAuditCountCommentsWispAsymmetry pins the intentional route asymmetry:
// GetIssueComments wisp-routes, but CountIssueComments always queries `comments`.
// A wisp with structured comments returns them from GetIssueComments but reports 0
// from CountIssueComments.
func testAuditCountCommentsWispAsymmetry(t *testing.T, f Factory) {
s := f(t)
c := ctx()
must(t, s.CreateIssue(c, withDefaults(&types.Issue{ID: "test-w", Title: "wisp", Ephemeral: true}), "a"))
@ -134,8 +133,8 @@ func testAuditCountCommentsWispParity(t *testing.T, f Factory) {
}
n, err := s.CountIssueComments(c, "test-w")
must(t, err)
if n != int64(len(got)) {
t.Errorf("CountIssueComments(wisp) = %d, want %d (must wisp-route like GetIssueComments)", n, len(got))
if n != 0 {
t.Errorf("CountIssueComments(wisp) = %d, want 0 (queries only `comments`, never wisp-routed)", n)
}
}
@ -298,7 +297,7 @@ func RunAudit_labels_comments_events(t *testing.T, f Factory) {
t.Helper()
t.Run("EventValueNullability", func(t *testing.T) { testAuditEventValueNullability(t, f) })
t.Run("LabelEventNonIdempotent", func(t *testing.T) { testAuditLabelEventNonIdempotent(t, f) })
t.Run("CountCommentsWispParity", func(t *testing.T) { testAuditCountCommentsWispParity(t, f) })
t.Run("CountCommentsWispAsymmetry", func(t *testing.T) { testAuditCountCommentsWispAsymmetry(t, f) })
t.Run("LabelCollationOrder", func(t *testing.T) { testAuditLabelCollationOrder(t, f) })
t.Run("EventsSinceStrictBoundary", func(t *testing.T) { testAuditEventsSinceStrictBoundary(t, f) })
t.Run("EventsLimitAndAll", func(t *testing.T) { testAuditEventsLimitAndAll(t, f) })

View file

@ -501,13 +501,9 @@ func testAuditCreateAllWispsInlineDependencies(t *testing.T, f Factory) {
}
}
// A mixed regular+wisp batch with a cross-bucket edge is rejected before insert
// (the strict plane rule, issueops.ValidateCreateIssuesMixedBucketDependencies);
// with SkipDependencyValidationErrors — the import mode — both issues persist
// AND the edge is wired: every row of both planes is written on the one
// transaction before the dependency pass, which resolves the target on its own
// plane. Until wy-a648lq the tolerant arm dropped the edge instead, and a
// re-import could never backfill it.
// A mixed regular+wisp batch with a cross-bucket edge is rejected before insert;
// with SkipDependencyValidationErrors the edge is dropped and both issues persist
// (create.go:288-361).
func testAuditCreateCrossBucketDependency(t *testing.T, f Factory) {
s := f(t)
c := ctx()
@ -524,7 +520,7 @@ func testAuditCreateCrossBucketDependency(t *testing.T, f Factory) {
t.Errorf("(a) test-a persisted despite rejected batch: %v", err)
}
// (b) With skip: both persist, and the cross-bucket edge is wired.
// (b) With skip: both persist, edge dropped.
must(t, s.CreateIssuesWithFullOptions(c, []*types.Issue{
withDefaults(&types.Issue{ID: "test-c", Title: "C"}),
withDefaults(&types.Issue{ID: "test-d", Title: "D", Ephemeral: true, Dependencies: []*types.Dependency{{IssueID: "test-d", DependsOnID: "test-c", Type: types.DepBlocks}}}),
@ -536,8 +532,8 @@ func testAuditCreateCrossBucketDependency(t *testing.T, f Factory) {
t.Errorf("(b) test-d missing: %v", err)
}
recs, _ := s.GetAllDependencyRecords(c)
if got := auditDepTargets(recs["test-d"]); !slices.Equal(got, []string{"test-c"}) {
t.Errorf("(b) test-d deps = %v, want [test-c] (in-batch cross-bucket edge wired, not dropped)", got)
if len(recs["test-d"]) != 0 {
t.Errorf("(b) cross-bucket edge not dropped: %v", auditDepTargets(recs["test-d"]))
}
}

View file

@ -653,9 +653,7 @@ func testAuditStaleStatusOverride(t *testing.T, f Factory) {
}
// Epics with ZERO children are silently skipped; epics WITH children are returned
// with Total/Closed counts and EligibleForClose = (Total == completing-closed).
// A child closed for a non-completing reason (duplicate/wontfix/superseded/…)
// counts toward Closed but not toward eligibility (GH#5026).
// with Total/Closed counts and EligibleForClose = (Total>0 && Total==Closed).
func testAuditEpicsEligiblePartial(t *testing.T, f Factory) {
s := f(t)
c := ctx()
@ -665,12 +663,9 @@ func testAuditEpicsEligiblePartial(t *testing.T, f Factory) {
must(t, s.CreateIssue(c, withDefaults(&types.Issue{ID: "ee-2", Title: "E2", IssueType: types.TypeEpic, Status: types.StatusOpen}), "a"))
must(t, s.CreateIssue(c, withDefaults(&types.Issue{ID: "ee-2a", Title: "c", Status: types.StatusClosed}), "a"))
must(t, s.CreateIssue(c, withDefaults(&types.Issue{ID: "ee-3", Title: "E3", IssueType: types.TypeEpic, Status: types.StatusOpen}), "a"))
must(t, s.CreateIssue(c, withDefaults(&types.Issue{ID: "ee-4", Title: "E4", IssueType: types.TypeEpic, Status: types.StatusOpen}), "a"))
must(t, s.CreateIssue(c, withDefaults(&types.Issue{ID: "ee-4a", Title: "c", Status: types.StatusClosed, CloseReason: "duplicate of ee-1"}), "a"))
must(t, s.AddDependency(c, &types.Dependency{IssueID: "ee-1a", DependsOnID: "ee-1", Type: types.DepParentChild}, "a"))
must(t, s.AddDependency(c, &types.Dependency{IssueID: "ee-1b", DependsOnID: "ee-1", Type: types.DepParentChild}, "a"))
must(t, s.AddDependency(c, &types.Dependency{IssueID: "ee-2a", DependsOnID: "ee-2", Type: types.DepParentChild}, "a"))
must(t, s.AddDependency(c, &types.Dependency{IssueID: "ee-4a", DependsOnID: "ee-4", Type: types.DepParentChild}, "a"))
epics, err := s.GetEpicsEligibleForClosure(c)
must(t, err)
@ -700,17 +695,6 @@ func testAuditEpicsEligiblePartial(t *testing.T, f Factory) {
if _, present := byID["ee-3"]; present {
t.Error("ee-3 (zero children) must be ABSENT (silent skip)")
}
// dcr-tf2 / GH#5026: a single child closed as a duplicate still counts as
// Closed (raw close count), but must NOT count toward EligibleForClose —
// the epic's real scope is unfinished, not done.
e4 := byID["ee-4"]
if e4 == nil {
t.Fatal("ee-4 missing (has children, must be returned)")
}
if e4.TotalChildren != 1 || e4.ClosedChildren != 1 || e4.EligibleForClose {
t.Errorf("ee-4 = {Total:%d Closed:%d Eligible:%v}, want {1 1 false} (duplicate close is non-completing)", e4.TotalChildren, e4.ClosedChildren, e4.EligibleForClose)
}
}
// GetIssuesByLabel unions wisp_labels: an ephemeral (wisp) issue sharing the label

View file

@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"reflect"
"strings"
"testing"
"github.com/steveyegge/beads/internal/types"
@ -171,12 +170,6 @@ func RunBatchApplyAppliesEveryItemInDeclarationOrder(t *testing.T, ctx context.C
if got := batchApplyColumn(t, ctx, fixture, "status", blocked); got == string(types.StatusClosed) {
t.Errorf("%s was closed by a request that only asked to close %s", blocked, blocker)
}
// Neither create item names a creator, so each defaults to the request's actor.
for _, id := range []string{blocked, blocker} {
if got := batchApplyColumn(t, ctx, fixture, "created_by", id); got != "apply-writer" {
t.Errorf("%s created_by = %q, want the request's actor %q", id, got, "apply-writer")
}
}
}
// RunBatchApplyBindsEachNamedKeyToItsMintedID pins ApplyBatchResult.Keys: it is
@ -888,12 +881,9 @@ func RunBatchApplyEvaluatesExpectedAssigneeAsModified(t *testing.T, ctx context.
// close it. The refusal is the assertion; the rollback of the parent it created
// is what says the refusal took the request with it.
//
// POSITIVE HALF: the identical request with Force lands, and that is the proof
// the refusal was the policy rather than the shape. Force "bypasses blocker and
// open-child close policy, the pin and the assignee fence, and never the
// template guard" (batchapplier.go), and the parent trips no guard — the
// unforced half reached the policy, which the guards run before — so the
// policy is the only refusal Force had to waive.
// POSITIVE HALF: the identical request with Force lands, which is the whole of
// what Force does ("bypasses blocker and open-child close policy, and nothing
// else") and the proof that the refusal was the policy rather than the shape.
func RunBatchApplyClosePolicyEvaluatesAtTheCloseItem(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
parent := fixture.IssuePrefix + "-closepolicy-parent"
@ -933,7 +923,7 @@ func RunBatchApplyClosePolicyEvaluatesAtTheCloseItem(t *testing.T, ctx context.C
t.Errorf("%s status = %q under Force, want %q", parent, got, types.StatusClosed)
}
if got := batchApplyColumn(t, ctx, fixture, "status", child); got != string(types.StatusOpen) {
t.Errorf("%s status = %q, want %q: Force waives the parent's close policy, it does not close the child", child, got, types.StatusOpen)
t.Errorf("%s status = %q, want %q: Force bypasses the close policy and nothing else", child, got, types.StatusOpen)
}
assertBatchApplyTypedEdgeCount(t, ctx, fixture, child, parent, string(publicops.DepParentChild), 1)
}
@ -1531,215 +1521,6 @@ func RunBatchApplyNormalizesTheWaitsForGate(t *testing.T, ctx context.Context, f
})
}
// RunBatchApplyStampsSpawnerIDOnlyWhenNamed is the S11 review fix-up
// regression for HIGH-2: a waits-for DepAddItem must only acquire
// metadata.spawner_id when the caller explicitly named a spawner
// (HasSpawner=true, which bd create --graph sets when the plan declares
// edges[].spawner_key/spawner_id, as does an embedder lowering such a plan
// onto this role). An edge with no named spawner must keep its gate-only
// metadata untouched — stamping it unconditionally from the resolved target
// caused unnecessary rewrite/version churn when gc re-applies the same edge
// (see CHANGELOG.md).
func RunBatchApplyStampsSpawnerIDOnlyWhenNamed(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
spawner := fixture.IssuePrefix + "-spawner-named"
waiter := fixture.IssuePrefix + "-waiter-named"
batchApplySeedIssue(t, ctx, fixture, spawner, types.StatusOpen)
batchApplySeedIssue(t, ctx, fixture, waiter, types.StatusOpen)
batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{
Actor: "apply-writer",
Items: []publicops.ApplyItem{
{Kind: publicops.ItemDepAdd, DepAdd: &publicops.DepAddItem{
Source: publicops.Ref{ID: waiter},
Target: publicops.Ref{ID: spawner},
Type: publicops.DepWaitsFor,
Metadata: `{"gate":"any-children"}`,
HasSpawner: true,
}},
},
})
stored := batchApplyEdgeMetadata(t, ctx, fixture, waiter, spawner)
var meta types.WaitsForMeta
if err := json.Unmarshal([]byte(stored), &meta); err != nil {
t.Fatalf("stored named-spawner metadata %q: %v", stored, err)
}
if meta.SpawnerID != spawner {
t.Errorf("named-spawner edge spawner_id = %q, want %q (metadata %q)", meta.SpawnerID, spawner, stored)
}
spawner2 := fixture.IssuePrefix + "-spawner-unnamed"
waiter2 := fixture.IssuePrefix + "-waiter-unnamed"
batchApplySeedIssue(t, ctx, fixture, spawner2, types.StatusOpen)
batchApplySeedIssue(t, ctx, fixture, waiter2, types.StatusOpen)
batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{
Actor: "apply-writer",
Items: []publicops.ApplyItem{
batchApplyDepAdd(publicops.Ref{ID: waiter2}, publicops.Ref{ID: spawner2}, publicops.DepWaitsFor, `{"gate":"any-children"}`),
},
})
stored2 := batchApplyEdgeMetadata(t, ctx, fixture, waiter2, spawner2)
var meta2 types.WaitsForMeta
if err := json.Unmarshal([]byte(stored2), &meta2); err != nil {
t.Fatalf("stored unnamed-spawner metadata %q: %v", stored2, err)
}
if meta2.SpawnerID != "" {
t.Errorf("unnamed-spawner edge must not stamp spawner_id, got %q (metadata %q)", meta2.SpawnerID, stored2)
}
}
// RunBatchApplyCarriesThreadIDOntoTheStoredEdge pins DepAddItem.ThreadID
// (the 2026-10 Opus-review HIGH-2 finding): a conversation-threading id named
// on a dep_add item must land on the stored dependency row's own thread_id
// column, and an item that names none must store none. ThreadID is a plain
// column read independently of HasSpawner/Metadata, so this is its own case
// rather than a clause folded onto the spawner one above.
//
// Wired onto the http leg this exercises BOTH halves of the wire at once: the
// client's applyDepAddItemBody encode (batchapplier.go) and the server's
// applyDepAddItemMembers decode (internal/httpapi/batch_apply.go) must each
// carry the field, because either one silently dropping it leaves the stored
// column blank and fails the assertion below.
func RunBatchApplyCarriesThreadIDOntoTheStoredEdge(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
source := fixture.IssuePrefix + "-thread-source"
target := fixture.IssuePrefix + "-thread-target"
batchApplySeedIssue(t, ctx, fixture, source, types.StatusOpen)
batchApplySeedIssue(t, ctx, fixture, target, types.StatusOpen)
const thread = "thread-conv-1"
batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{
Actor: "apply-writer",
Items: []publicops.ApplyItem{
{Kind: publicops.ItemDepAdd, DepAdd: &publicops.DepAddItem{
Source: publicops.Ref{ID: source}, Target: publicops.Ref{ID: target},
Type: publicops.DepBlocks, ThreadID: thread,
}},
},
})
if got := batchApplyEdgeThreadID(t, ctx, fixture, source, target); got != thread {
t.Errorf("stored edge thread_id = %q, want %q", got, thread)
}
source2 := fixture.IssuePrefix + "-thread-none-source"
target2 := fixture.IssuePrefix + "-thread-none-target"
batchApplySeedIssue(t, ctx, fixture, source2, types.StatusOpen)
batchApplySeedIssue(t, ctx, fixture, target2, types.StatusOpen)
batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{
Actor: "apply-writer",
Items: []publicops.ApplyItem{
batchApplyDepAdd(publicops.Ref{ID: source2}, publicops.Ref{ID: target2}, publicops.DepBlocks, ""),
},
})
if got := batchApplyEdgeThreadID(t, ctx, fixture, source2, target2); got != "" {
t.Errorf("an edge naming no thread must not stamp thread_id, got %q", got)
}
}
// RunBatchApplyCarriesThreadIDOntoAnExistingEdge pins DepAddItem.ThreadID on
// the re-add arm: a dep_add naming an edge that already exists with the same
// type is the idempotent re-add, and a thread it names still has to reach the
// stored row. That arm once compared and rewrote metadata alone, so a
// thread-only re-add was a silent no-op and a re-add moving both landed the
// metadata and dropped the thread — on the very path gc re-applies its plans
// through.
//
// The steps run on ONE edge, each from the state the step before it left: a
// thread-only re-add puts a thread on an edge that had none, a re-add moving
// the gate and the thread lands both, and a re-add naming no thread keeps the
// stored one, because an empty ThreadID names no thread rather than asking for
// none.
func RunBatchApplyCarriesThreadIDOntoAnExistingEdge(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
source := fixture.IssuePrefix + "-rethread-source"
spawner := fixture.IssuePrefix + "-rethread-spawner"
batchApplySeedIssue(t, ctx, fixture, source, types.StatusOpen)
batchApplySeedIssue(t, ctx, fixture, spawner, types.StatusOpen)
add := func(gate, thread string) {
t.Helper()
batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{
Actor: "apply-writer",
Items: []publicops.ApplyItem{
{Kind: publicops.ItemDepAdd, DepAdd: &publicops.DepAddItem{
Source: publicops.Ref{ID: source}, Target: publicops.Ref{ID: spawner},
Type: publicops.DepWaitsFor, Metadata: `{"gate":"` + gate + `"}`, ThreadID: thread,
}},
},
})
}
assertEdge := func(step, wantGate, wantThread string) {
t.Helper()
assertBatchApplyEdgeCount(t, ctx, fixture, source, spawner, 1)
stored := batchApplyEdgeMetadata(t, ctx, fixture, source, spawner)
var meta types.WaitsForMeta
if err := json.Unmarshal([]byte(stored), &meta); err != nil {
t.Fatalf("%s: stored waits-for metadata %q is not a gate object: %v", step, stored, err)
}
if meta.Gate != wantGate {
t.Errorf("%s: stored gate = %q (metadata %q), want %q", step, meta.Gate, stored, wantGate)
}
if got := batchApplyEdgeThreadID(t, ctx, fixture, source, spawner); got != wantThread {
t.Errorf("%s: stored edge thread_id = %q, want %q", step, got, wantThread)
}
}
add(types.WaitsForAllChildren, "")
assertEdge("the first add, naming no thread", types.WaitsForAllChildren, "")
add(types.WaitsForAllChildren, "thread-conv-1")
assertEdge("a re-add moving the thread alone", types.WaitsForAllChildren, "thread-conv-1")
add(types.WaitsForAnyChildren, "thread-conv-2")
assertEdge("a re-add moving the gate and the thread", types.WaitsForAnyChildren, "thread-conv-2")
add(types.WaitsForAnyChildren, "")
assertEdge("a re-add naming no thread", types.WaitsForAnyChildren, "thread-conv-2")
}
// RunBatchApplyRefusesAThreadIDLongerThanItsColumn pins the bound on
// DepAddItem.ThreadID: one longer than the thread_id column holds is
// ErrValidation and writes no edge, on every leg alike. The http leg's decode
// refused it as a typed 400 while the local legs carried it to the write, where
// it failed as whatever storage error the column raised, mid-transaction — two
// error classes for one request. The shared plan bounds it now, before any
// database work.
//
// The positive half is the same edge with a thread exactly at the bound, which
// lands whole; without it, a role refusing every thread id satisfies the
// refusal.
func RunBatchApplyRefusesAThreadIDLongerThanItsColumn(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
source := fixture.IssuePrefix + "-longthread-source"
target := fixture.IssuePrefix + "-longthread-target"
batchApplySeedIssue(t, ctx, fixture, source, types.StatusOpen)
batchApplySeedIssue(t, ctx, fixture, target, types.StatusOpen)
request := func(thread string) publicops.ApplyBatchRequest {
return publicops.ApplyBatchRequest{
Actor: "apply-writer",
Items: []publicops.ApplyItem{
{Kind: publicops.ItemDepAdd, DepAdd: &publicops.DepAddItem{
Source: publicops.Ref{ID: source}, Target: publicops.Ref{ID: target},
Type: publicops.DepBlocks, ThreadID: thread,
}},
},
}
}
tooLong := strings.Repeat("t", types.MaxFieldLen+1)
if _, err := fixture.BatchApplier.ApplyBatch(ctx, request(tooLong)); !errors.Is(err, publicops.ErrValidation) {
t.Fatalf("a %d-character thread_id: error = %v, want ErrValidation", len(tooLong), err)
}
assertBatchApplyEdgeCount(t, ctx, fixture, source, target, 0)
atBound := strings.Repeat("t", types.MaxFieldLen)
batchApplyMust(t, ctx, fixture, request(atBound))
if got := batchApplyEdgeThreadID(t, ctx, fixture, source, target); got != atBound {
t.Errorf("a %d-character thread_id stored as %d characters, want it whole", len(atBound), len(got))
}
}
// RunBatchApplySplicesAForwardMetadataRef pins the one exception to the
// backward-only rule (CreateItem.MetadataRefs): "IT IS THE ONE PLACE A KEY MAY
// REACH FORWARD … Every id is minted before any splice is applied, so the
@ -2001,56 +1782,21 @@ func RunBatchApplyLandsAnIdempotencyRecordWithItsWork(t *testing.T, ctx context.
// alone is satisfied by a bound one step away.
func RunBatchApplyBoundsTheItemCount(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
RunBatchApplyBoundsTheItemCountAtScale(t, ctx, fixture, publicops.MaxApplyBatchItems)
}
// RunBatchApplyBoundsTheItemCountAtScale is RunBatchApplyBoundsTheItemCount
// with the "at bound" half's REAL applied count overridable to fewer than
// issueops.MaxApplyBatchItems, for a backend whose real engine makes
// applying a full MaxApplyBatchItems batch prohibitively slow in one CI
// configuration (embedded-dolt under the race detector: this subtest alone
// measured 903-945s there, because the in-process Dolt engine's own
// goroutine/lock machinery runs inside the instrumented binary).
//
// This does NOT weaken the boundary this contract pins. The production
// bound itself — exactly issueops.MaxApplyBatchItems accepted, one more
// refused — is independent of atBoundItems and is NOT re-derived from a
// real apply here: every backend's ApplyBatch calls the SAME
// storage.PlanApplyBatch to decide accept-vs-refuse, before touching
// storage at all (batch_applier.go: "VALIDATION HAPPENS BEFORE THE
// TRANSACTION"), and that shared function's own boundary is independently
// pinned, for real, pure and sub-millisecond, by
// TestPlanApplyBatchAcceptsTheBoundary and its "too many items" sibling in
// internal/storage/batch_apply_test.go — run on every `go test`, every
// backend, every PR, unaffected by atBoundItems. The refusing half below is
// UNCHANGED regardless of atBoundItems: it still sends the true
// MaxApplyBatchItems+1 count, because that half is already O(1) (the same
// pre-transaction length check, no backend ever reaches a write). Only the
// "at bound" half's REAL applied count is adjustable, to prove a backend's
// own write body does not drop, double or truncate a large accepted batch
// without paying for the full MaxApplyBatchItems every time one backend's
// real engine makes that unusually expensive.
func RunBatchApplyBoundsTheItemCountAtScale(t *testing.T, ctx context.Context, fixture BatchApplyFixture, atBoundItems int) {
t.Helper()
if atBoundItems < 1 || atBoundItems > publicops.MaxApplyBatchItems {
t.Fatalf("atBoundItems = %d, want 1..%d (the production bound this contract pins)", atBoundItems, publicops.MaxApplyBatchItems)
}
const accepted = "batch apply at the item bound"
const refused = "batch apply over the item bound"
atBound := make([]publicops.ApplyItem, atBoundItems)
atBound := make([]publicops.ApplyItem, publicops.MaxApplyBatchItems)
for i := range atBound {
atBound[i] = batchApplyCreate("", batchApplyMintedIssue(accepted))
}
result := batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{Actor: "apply-writer", Items: atBound})
if len(result.Items) != atBoundItems {
t.Fatalf("a request of %d items returned %d item results, want %d", atBoundItems, len(result.Items), atBoundItems)
if len(result.Items) != publicops.MaxApplyBatchItems {
t.Fatalf("a request of exactly MaxApplyBatchItems returned %d item results, want %d", len(result.Items), publicops.MaxApplyBatchItems)
}
if got := batchApplyCount(t, ctx, fixture, "SELECT COUNT(*) FROM issues WHERE title = ?", []any{accepted}); got != atBoundItems {
t.Errorf("%d row(s) landed for a request of %d items, want %d", got, atBoundItems, atBoundItems)
if got := batchApplyCount(t, ctx, fixture, "SELECT COUNT(*) FROM issues WHERE title = ?", []any{accepted}); got != publicops.MaxApplyBatchItems {
t.Errorf("%d row(s) landed for a request of exactly MaxApplyBatchItems, want %d", got, publicops.MaxApplyBatchItems)
}
// Unchanged: the true production bound, regardless of atBoundItems.
overBound := make([]publicops.ApplyItem, publicops.MaxApplyBatchItems+1)
for i := range overBound {
overBound[i] = batchApplyCreate("", batchApplyMintedIssue(refused))
@ -2403,20 +2149,6 @@ func batchApplyEdgeMetadata(t *testing.T, ctx context.Context, fixture BatchAppl
return blob
}
// batchApplyEdgeThreadID reads the stored thread_id column of one edge, which
// is where DepAddItem.ThreadID has to be visible — a plain column, independent
// of the type-specific Metadata blob batchApplyEdgeMetadata reads.
func batchApplyEdgeThreadID(t *testing.T, ctx context.Context, fixture BatchApplyFixture, source, target string) string {
t.Helper()
var value string
const query = "SELECT COALESCE(thread_id, '') FROM dependencies WHERE issue_id = ?" +
" AND COALESCE(depends_on_issue_id, depends_on_wisp_id, depends_on_external) = ?"
if err := fixture.QueryScalar(ctx, query, []any{source, target}, &value); err != nil {
t.Fatalf("reading edge thread_id for %s -> %s: %v", source, target, err)
}
return value
}
// batchApplyMetadataKey reads the WHOLE metadata blob off a row and reports one
// key's raw bytes. The whole blob is read rather than a JSON path extract,
// because that is what lets a case see an absent key and a null one as the
@ -2501,287 +2233,3 @@ func batchApplyHistoryMatching(t *testing.T, ctx context.Context, fixture BatchA
}
return count
}
// RunBatchApplyUpdateItemsRefuseATemplate pins that an update item answers to
// Lifecycle.Update's template guard: an item targeting a template refuses with
// an *ItemError carrying *TemplateReadOnlyError, whatever force flags it
// carries, and the request is all or nothing, so the create ahead of it does
// not land and the template is untouched.
func RunBatchApplyUpdateItemsRefuseATemplate(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
template := fixture.IssuePrefix + "-tmplupd-template"
bystander := fixture.IssuePrefix + "-tmplupd-bystander"
seeded := batchApplyIssue(template, "a template")
seeded.IsTemplate = true
if err := fixture.CreateIssue(ctx, seeded, "seed"); err != nil {
t.Fatalf("seed %s: %v", template, err)
}
update := batchApplyUpdate(publicops.Ref{ID: template}, publicops.IssuePatch{
Title: publicops.Field[string]{Set: true, Value: "edited"},
Status: publicops.Field[publicops.Status]{Set: true, Value: types.StatusClosed},
})
update.Update.ForceClosePolicy = true
_, err := fixture.BatchApplier.ApplyBatch(ctx, publicops.ApplyBatchRequest{
Actor: "apply-writer",
ForceIDPrefix: true,
Items: []publicops.ApplyItem{
batchApplyCreate("bystander", batchApplyIssue(bystander, "must not land beside a refusal")),
update,
},
})
var itemErr *publicops.ItemError
if !errors.As(err, &itemErr) {
t.Fatalf("an update item on template %s: error = %v, want an *ItemError", template, err)
}
if itemErr.Kind != publicops.ItemUpdate || itemErr.Index != 1 {
t.Errorf("ItemError = %#v, want the update item at index 1", itemErr)
}
var refusal *publicops.TemplateReadOnlyError
if !errors.As(err, &refusal) || refusal.IssueID != template {
t.Errorf("update item on template = %v, want *TemplateReadOnlyError naming %s", err, template)
}
assertBatchApplyRowCount(t, ctx, fixture, "issues", bystander, 0)
if got := batchApplyColumn(t, ctx, fixture, "title", template); got != "a template" {
t.Errorf("%s title after the refusal = %q, want it untouched", template, got)
}
if got := batchApplyColumn(t, ctx, fixture, "status", template); got != string(types.StatusOpen) {
t.Errorf("%s status after the refusal = %q, want it untouched", template, got)
}
}
// RunBatchApplySplicesTheMetadataOfATemplateItCreates is the template guard's
// boundary: the one write a template legitimately takes inside a batch is a
// CREATE item that makes it and asks for a metadata splice. The splice runs as
// an update of the row the request itself is creating, after every id exists,
// and it must land — the template is being written, not modified — so a guard
// placed where the splice reaches it would refuse a template's own creation.
func RunBatchApplySplicesTheMetadataOfATemplateItCreates(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
created := fixture.IssuePrefix + "-tmplsplice-created"
fresh := batchApplyIssue(created, "a template this request creates")
fresh.IsTemplate = true
item := batchApplyCreate("created", fresh)
item.Create.MetadataRefs = map[string]publicops.Ref{"gc.self": {Key: "created"}}
batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{
Actor: "apply-writer", ForceIDPrefix: true, Items: []publicops.ApplyItem{item},
})
if _, ok := batchApplyMetadataKey(t, ctx, fixture, created, "gc.self"); !ok {
t.Errorf("%s carries no gc.self key: the splice that finishes a template's own create must land", created)
}
}
// RunBatchApplyCloseItemsAnswerToTheCloseGuards pins that a close item answers
// to the close guards Lifecycle.Close states, under CloseRequest's rules: a
// template refuses forced or not, a pin and another actor's bead refuse unless
// the item's Force is set. A refusal is the item's *ItemError carrying the
// guard's typed error, and the request is all or nothing, so the create item
// ahead of it does not land.
//
// The assignee case is AS-MODIFIED: the holder is set by an update item of the
// same request, so a guard that read the row before the request began — or not
// at all — closes it.
func RunBatchApplyCloseItemsAnswerToTheCloseGuards(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
template := fixture.IssuePrefix + "-closeguard-template"
pinned := fixture.IssuePrefix + "-closeguard-pinned"
held := fixture.IssuePrefix + "-closeguard-held"
bystander := fixture.IssuePrefix + "-closeguard-bystander"
for _, issue := range []*types.Issue{
{ID: template, IsTemplate: true},
{ID: pinned, Pinned: true},
{ID: held},
} {
issue.Title, issue.Status, issue.Priority, issue.IssueType = issue.ID, types.StatusOpen, 2, types.TypeTask
if err := fixture.CreateIssue(ctx, issue, "seed"); err != nil {
t.Fatalf("seed %s: %v", issue.ID, err)
}
}
plan := func(target string, force bool, extra ...publicops.ApplyItem) publicops.ApplyBatchRequest {
closeItem := batchApplyClose(publicops.Ref{ID: target})
closeItem.Close.Force = force
items := []publicops.ApplyItem{batchApplyCreate("bystander", batchApplyIssue(bystander, "must not land beside a refusal"))}
items = append(items, extra...)
return publicops.ApplyBatchRequest{Actor: "apply-closer", ForceIDPrefix: true, Items: append(items, closeItem)}
}
refused := func(label string, request publicops.ApplyBatchRequest, check func(error)) {
t.Helper()
_, err := fixture.BatchApplier.ApplyBatch(ctx, request)
var itemErr *publicops.ItemError
if !errors.As(err, &itemErr) {
t.Fatalf("%s: error = %v, want an *ItemError", label, err)
}
if itemErr.Kind != publicops.ItemClose || itemErr.Index != len(request.Items)-1 {
t.Errorf("%s: ItemError = %#v, want the close item at index %d", label, itemErr, len(request.Items)-1)
}
check(err)
assertBatchApplyRowCount(t, ctx, fixture, "issues", bystander, 0)
}
for _, force := range []bool{false, true} {
refused("template close item", plan(template, force), func(err error) {
var refusal *publicops.TemplateReadOnlyError
if !errors.As(err, &refusal) || refusal.IssueID != template {
t.Errorf("template close item (force=%v) = %v, want *TemplateReadOnlyError naming %s", force, err, template)
}
})
}
refused("pinned close item", plan(pinned, false), func(err error) {
var refusal *publicops.PinnedError
if !errors.As(err, &refusal) || refusal.IssueID != pinned {
t.Errorf("pinned close item = %v, want *PinnedError naming %s", err, pinned)
}
})
assign := batchApplyUpdate(publicops.Ref{ID: held}, publicops.IssuePatch{Assignee: publicops.Field[string]{Set: true, Value: "holder"}})
refused("held close item", plan(held, false, assign), func(err error) {
var refusal *publicops.CloseNotAssigneeError
if !errors.As(err, &refusal) {
t.Errorf("close item on a bead an earlier item assigned away = %v, want *CloseNotAssigneeError", err)
return
}
if refusal.IssueID != held || refusal.Assignee != "holder" || refusal.Actor != "apply-closer" {
t.Errorf("assignee refusal = %#v, want IssueID %q, Assignee holder, Actor apply-closer", refusal, held)
}
})
for _, id := range []string{template, pinned, held} {
if got := batchApplyColumn(t, ctx, fixture, "status", id); got != string(types.StatusOpen) {
t.Errorf("%s status after the refusals = %q, want it still open", id, got)
}
}
// The item's Force waives the pin and the assignee fence.
forcedPin := plan(pinned, true)
forcedPin.Items = forcedPin.Items[1:]
batchApplyMust(t, ctx, fixture, forcedPin)
forcedHeld := plan(held, true, assign)
forcedHeld.Items = forcedHeld.Items[1:]
batchApplyMust(t, ctx, fixture, forcedHeld)
for _, id := range []string{pinned, held} {
if got := batchApplyColumn(t, ctx, fixture, "status", id); got != string(types.StatusClosed) {
t.Errorf("%s status under the item's Force = %q, want %q", id, got, types.StatusClosed)
}
}
}
// RunBatchApplyRefusesADottedChildGatedOnItsOwnParent pins the dotted-id
// hierarchy rule (publicops.CheckDottedChildDependency) on a dep_add item: an
// edge from a dotted-id child to its own ancestor is refused with an
// *ItemError naming the edge, and the whole request rolls back. The rule is
// applied to the RESOLVED ids, so a key bound to a dotted child this request
// creates — the `bd create --graph` shape — is refused like a stored id.
//
// POSITIVE HALF: the parent-child edge to the immediate dotted parent lands.
//
// WITH THE HIERARCHY STORED: once that edge exists (the shape `bd create
// --parent` leaves), a blocking edge on the same pair is still this validation
// refusal, not the hierarchy conflict the stored edge would raise (which does
// not match ErrValidation) — the rule reads only the resolved ids, so it
// answers first — and the stored edge survives.
func RunBatchApplyRefusesADottedChildGatedOnItsOwnParent(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
parent := fixture.IssuePrefix + "-dotted"
child := parent + ".1"
minted := parent + ".2"
batchApplySeedIssue(t, ctx, fixture, parent, types.StatusOpen)
batchApplySeedIssue(t, ctx, fixture, child, types.StatusOpen)
for _, refused := range []struct {
name string
items []publicops.ApplyItem
index int
}{
{"a stored child blocking on its parent", []publicops.ApplyItem{
batchApplyDepAdd(publicops.Ref{ID: child}, publicops.Ref{ID: parent}, publicops.DepBlocks, ""),
}, 0},
{"a child this request creates blocking on its parent", []publicops.ApplyItem{
batchApplyCreate("child", batchApplyIssue(minted, "the new child")),
batchApplyDepAdd(publicops.Ref{Key: "child"}, publicops.Ref{ID: parent}, publicops.DepBlocks, ""),
}, 1},
} {
_, err := fixture.BatchApplier.ApplyBatch(ctx, publicops.ApplyBatchRequest{
Actor: "apply-writer",
ForceIDPrefix: true,
Items: refused.items,
})
if !errors.Is(err, publicops.ErrValidation) {
t.Errorf("%s: error = %v, want ErrValidation", refused.name, err)
continue
}
var itemErr *publicops.ItemError
if !errors.As(err, &itemErr) {
t.Errorf("%s: error = %v, want an *ItemError naming the edge item", refused.name, err)
continue
}
if itemErr.Index != refused.index || itemErr.Kind != publicops.ItemDepAdd {
t.Errorf("%s: ItemError = %#v, want Index %d and Kind %q", refused.name, itemErr, refused.index, publicops.ItemDepAdd)
}
}
assertBatchApplyEdgeCount(t, ctx, fixture, child, parent, 0)
assertBatchApplyRowCount(t, ctx, fixture, "issues", minted, 0)
batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{
Actor: "apply-writer",
Items: []publicops.ApplyItem{
batchApplyDepAdd(publicops.Ref{ID: child}, publicops.Ref{ID: parent}, publicops.DepParentChild, ""),
},
})
assertBatchApplyEdgeCount(t, ctx, fixture, child, parent, 1)
_, err := fixture.BatchApplier.ApplyBatch(ctx, publicops.ApplyBatchRequest{
Actor: "apply-writer",
Items: []publicops.ApplyItem{
batchApplyDepAdd(publicops.Ref{ID: child}, publicops.Ref{ID: parent}, publicops.DepBlocks, ""),
},
})
var itemErr *publicops.ItemError
if !errors.Is(err, publicops.ErrValidation) || !errors.As(err, &itemErr) {
t.Errorf("blocks on a parent whose parent-child edge is stored: error = %v, want an *ItemError matching ErrValidation", err)
}
assertBatchApplyEdgeCount(t, ctx, fixture, child, parent, 1)
}
// RunBatchApplyAppliesTheDefaultPriority pins CreateItem.DefaultPriority: a
// create item that asks for the default stores publicops.DefaultCreatePriority,
// and one naming priority 0 stores P0. `bd create --graph` sends a node without
// a priority this way, and so does an HTTP batch apply create item without one.
// A create item asking for the default while naming a priority is
// ErrValidation and writes nothing, as it is for Lifecycle.Create.
func RunBatchApplyAppliesTheDefaultPriority(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
unset := batchApplyMintedIssue("defaulted")
unset.Priority = 0
zero := batchApplyMintedIssue("critical")
zero.Priority = 0
result := batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{
Actor: "apply-writer",
Items: []publicops.ApplyItem{
{Kind: publicops.ItemCreate, Create: &publicops.CreateItem{Key: "d", Issue: unset, DefaultPriority: true}},
{Kind: publicops.ItemCreate, Create: &publicops.CreateItem{Key: "z", Issue: zero}},
},
})
for key, want := range map[string]int{"d": publicops.DefaultCreatePriority, "z": 0} {
id := result.Keys[key]
if id == "" {
t.Fatalf("key %q bound no id: %v", key, result.Keys)
}
if got := batchApplyCount(t, ctx, fixture, "SELECT priority FROM issues WHERE id = ?", []any{id}); got != want {
t.Errorf("stored priority of %s (%s) = %d, want %d", key, id, got, want)
}
}
conflict := fixture.IssuePrefix + "-prio-conflict"
clash := batchApplyIssue(conflict, conflict)
clash.Priority = 3
_, err := fixture.BatchApplier.ApplyBatch(ctx, publicops.ApplyBatchRequest{
Actor: "apply-writer",
ForceIDPrefix: true,
Items: []publicops.ApplyItem{
{Kind: publicops.ItemCreate, Create: &publicops.CreateItem{Key: "c", Issue: clash, DefaultPriority: true}},
},
})
if !errors.Is(err, publicops.ErrValidation) {
t.Fatalf("DefaultPriority with priority 3: err = %v, want ErrValidation", err)
}
assertBatchApplyRowCount(t, ctx, fixture, "issues", conflict, 0)
}

View file

@ -1,145 +0,0 @@
package conformance
import (
"context"
"encoding/json"
"errors"
"slices"
"testing"
"time"
"github.com/steveyegge/beads/internal/types"
publicops "github.com/steveyegge/beads/issueops"
)
// The BatchApplier half of the gate-member clauses; see
// lifecycle_create_gate_contract.go.
// RunBatchApplyCarriesTheGateMembers pins the gate members through
// BatchApplier: a create item stores all four, an update item replaces the
// waiter list of an existing row whole, a clear through an update item stores
// the empty list `[]`, and a create or update item past a bound refuses the
// WHOLE request as ErrValidation naming its member (on its *ItemError for the
// update item), so the earlier item rolls back with it.
func RunBatchApplyCarriesTheGateMembers(t *testing.T, ctx context.Context, fixture BatchApplyFixture) {
t.Helper()
gate := fixture.IssuePrefix + "-bag-gate"
existing := fixture.IssuePrefix + "-bag-existing"
batchApplySeedIssue(t, ctx, fixture, existing, types.StatusOpen)
issue := batchApplyIssue(gate, "a gate made by a plan")
issue.IssueType = types.TypeGate
issue.AwaitType = "timer"
issue.AwaitID = "await-plan"
issue.Timeout = 2 * time.Hour
issue.Waiters = []string{"a", "a", "b"}
batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{
Actor: "apply-writer",
ForceIDPrefix: true,
Items: []publicops.ApplyItem{
batchApplyCreate("gate", issue),
batchApplyUpdate(publicops.Ref{ID: existing}, publicops.IssuePatch{
AwaitID: publicops.Field[string]{Set: true, Value: "bead:" + gate},
Waiters: publicops.Field[[]string]{Set: true, Value: []string{"x", "y"}},
}),
},
})
assertBatchApplyGateColumns(t, ctx, fixture, gate, "timer", "await-plan", 2*time.Hour, []string{"a", "a", "b"})
assertBatchApplyGateColumns(t, ctx, fixture, existing, "", "bead:"+gate, 0, []string{"x", "y"})
// A clear through an update item stores the empty JSON list, not NULL and
// not the JSON null: the column is read raw here because every reader
// above treats the three alike.
batchApplyMust(t, ctx, fixture, publicops.ApplyBatchRequest{
Actor: "apply-writer",
Items: []publicops.ApplyItem{
batchApplyUpdate(publicops.Ref{ID: existing}, publicops.IssuePatch{
AwaitID: publicops.Field[string]{Set: true},
Waiters: publicops.Field[[]string]{Set: true},
}),
},
})
assertBatchApplyGateColumns(t, ctx, fixture, existing, "", "", 0, nil)
var clearedWaiters string
if err := fixture.QueryScalar(ctx, "SELECT COALESCE(waiters, '<NULL>') FROM issues WHERE id = ?", []any{existing}, &clearedWaiters); err != nil {
t.Fatalf("read the waiters column of %s: %v", existing, err)
}
if clearedWaiters != "[]" {
t.Errorf("%s waiters column after a clear = %q, want the stored empty list %q", existing, clearedWaiters, "[]")
}
first := fixture.IssuePrefix + "-bag-rolledback"
refused := batchApplyIssue(fixture.IssuePrefix+"-bag-refused", "past the bound")
refused.AwaitType = gateFieldAtBoundAwaitType + "x"
_, err := fixture.BatchApplier.ApplyBatch(ctx, publicops.ApplyBatchRequest{
Actor: "apply-writer",
ForceIDPrefix: true,
Items: []publicops.ApplyItem{
batchApplyCreate("first", batchApplyIssue(first, "rolls back with the refusal")),
batchApplyCreate("refused", refused),
},
})
assertGateFieldError(t, err, "a create item with await_type past its bound", publicops.GateFieldAwaitType)
assertBatchApplyRowCount(t, ctx, fixture, "issues", first, 0)
// An update item past a bound refuses the same way, named on its own
// item: the earlier create rolls back, and the target keeps its columns.
firstOfUpdate := fixture.IssuePrefix + "-bag-rolledback-upd"
_, err = fixture.BatchApplier.ApplyBatch(ctx, publicops.ApplyBatchRequest{
Actor: "apply-writer",
ForceIDPrefix: true,
Items: []publicops.ApplyItem{
batchApplyCreate("first", batchApplyIssue(firstOfUpdate, "rolls back with the refusal")),
batchApplyUpdate(publicops.Ref{ID: gate}, publicops.IssuePatch{
Title: publicops.Field[string]{Set: true, Value: "must not land"},
AwaitID: publicops.Field[string]{Set: true, Value: gateFieldAtBoundAwaitID + "x"},
}),
},
})
assertGateFieldError(t, err, "an update item with await_id past its bound", publicops.GateFieldAwaitID)
var itemErr *publicops.ItemError
if !errors.As(err, &itemErr) {
t.Fatalf("an update item with await_id past its bound: error = %v, want an *ItemError naming the item", err)
}
if itemErr.Index != 1 || itemErr.Kind != publicops.ItemUpdate {
t.Errorf("ItemError = %#v, want Index 1 and Kind %q", itemErr, publicops.ItemUpdate)
}
assertBatchApplyRowCount(t, ctx, fixture, "issues", firstOfUpdate, 0)
assertBatchApplyGateColumns(t, ctx, fixture, gate, "timer", "await-plan", 2*time.Hour, []string{"a", "a", "b"})
if got := batchApplyColumn(t, ctx, fixture, "title", gate); got != "a gate made by a plan" {
t.Errorf("%s title = %q, want the created title: a refused item writes nothing", gate, got)
}
}
// assertBatchApplyGateColumns reads the four gate columns of one durable row
// raw, so neither side of the comparison comes from the role.
func assertBatchApplyGateColumns(t *testing.T, ctx context.Context, fixture BatchApplyFixture, id, awaitType, awaitID string, timeout time.Duration, waiters []string) {
t.Helper()
var gotType, gotID, gotWaiters string
var gotTimeout int64
if err := fixture.QueryScalar(ctx,
"SELECT COALESCE(await_type, ''), COALESCE(await_id, ''), COALESCE(timeout_ns, 0), COALESCE(waiters, '') FROM issues WHERE id = ?",
[]any{id}, &gotType, &gotID, &gotTimeout, &gotWaiters); err != nil {
t.Fatalf("read the gate columns of %s: %v", id, err)
}
if gotType != awaitType || gotID != awaitID || time.Duration(gotTimeout) != timeout {
t.Errorf("%s gate columns = (%q, %q, %s), want (%q, %q, %s)", id, gotType, gotID, time.Duration(gotTimeout), awaitType, awaitID, timeout)
}
if stored := parseGateWaiters(gotWaiters); !slices.Equal(stored, waiters) {
t.Errorf("%s waiters column = %q (%q), want %q", id, gotWaiters, stored, waiters)
}
}
// parseGateWaiters reads the waiters TEXT column's JSON array, treating the
// empty string, `null` and `[]` as the one empty list they all mean.
func parseGateWaiters(raw string) []string {
if raw == "" || raw == "null" || raw == "[]" {
return nil
}
var out []string
if err := json.Unmarshal([]byte(raw), &out); err != nil {
return []string{"<unparseable: " + err.Error() + ">"}
}
return out
}

View file

@ -39,10 +39,9 @@ import (
// still reports OpenChildren (batchcloser.go:81-86); a duplicated id is one
// of those at its own index, and the first occurrence's reason is what the
// row keeps (batchcloser.go:28-33).
// - Force is request-wide and bypasses blocker and open-child policy, the
// pin and the assignee fence, never the template guard; the per-item
// precondition its clause also names is a category the request type keeps
// EMPTY (batchcloser.go:43-55).
// - Force is request-wide and bypasses only blocker and open-child policy;
// the per-item precondition its clause also names is a category the request
// type keeps EMPTY (batchcloser.go:43-53).
// - ClaimNext runs after the closes, inside the same transaction, and only
// when at least one item closed (batchcloser.go:55-70, 100-103, 143-146).
// - LANDED means CHANGED: an all-idempotent batch earns no claim and records
@ -1398,96 +1397,3 @@ func requireBatchCloserWisps(t *testing.T, fixture BatchCloserFixture) {
t.Skipf("fixture has no CreateWisp: this backend cannot seed the ephemeral plane, so the ephemeral rules are UNPINNED here")
}
}
// RunBatchCloserItemsAnswerToTheCloseGuards pins that every item of a batch
// answers to the close guards Lifecycle.Close states — template, pin, assignee
// — as a PER-ITEM refusal carrying the same typed error, while the survivors
// still commit; and that the request-wide Force waives the pin and the
// assignee fence and never the template.
//
// The guarded items sit between two plain ones, so an implementation that
// aborted the batch on a guard, or skipped the guard for items after the
// first, fails here rather than in `bd close a b c`.
func RunBatchCloserItemsAnswerToTheCloseGuards(t *testing.T, ctx context.Context, fixture BatchCloserFixture) {
t.Helper()
first := fixture.IssuePrefix + "-guard-first"
template := fixture.IssuePrefix + "-guard-template"
pinned := fixture.IssuePrefix + "-guard-pinned"
held := fixture.IssuePrefix + "-guard-held"
last := fixture.IssuePrefix + "-guard-last"
seedBatchCloserIssue(t, ctx, fixture, first)
seedBatchCloserIssue(t, ctx, fixture, last)
for _, issue := range []*types.Issue{
{ID: template, IsTemplate: true},
{ID: pinned, Status: types.StatusPinned},
{ID: held, Assignee: "holder"},
} {
issue.Title, issue.Priority, issue.IssueType = issue.ID, 2, types.TypeTask
if issue.Status == "" {
issue.Status = types.StatusOpen
}
if err := fixture.CreateIssue(ctx, issue, "seed"); err != nil {
t.Fatalf("seed %s: %v", issue.ID, err)
}
}
result, err := fixture.Closer.CloseBatch(ctx, publicops.CloseBatchRequest{
Actor: "closer",
Items: []publicops.BatchCloseItem{{IssueID: first}, {IssueID: template}, {IssueID: pinned}, {IssueID: held}, {IssueID: last}},
})
if err != nil {
t.Fatalf("CloseBatch over guarded items: %v, want per-item refusals", err)
}
if len(result.Outcomes) != 5 {
t.Fatalf("outcomes = %d, want 5", len(result.Outcomes))
}
for _, i := range []int{0, 4} {
if result.Outcomes[i].Err != nil || !result.Outcomes[i].Changed {
t.Errorf("outcome %d (%s) = %+v, want the plain item to land", i, result.Outcomes[i].IssueID, result.Outcomes[i])
}
}
var templateRefusal *publicops.TemplateReadOnlyError
if !errors.As(result.Outcomes[1].Err, &templateRefusal) || templateRefusal.IssueID != template {
t.Errorf("template item = %v, want *TemplateReadOnlyError naming %s", result.Outcomes[1].Err, template)
}
var pinRefusal *publicops.PinnedError
if !errors.As(result.Outcomes[2].Err, &pinRefusal) || pinRefusal.IssueID != pinned {
t.Errorf("pinned item = %v, want *PinnedError naming %s", result.Outcomes[2].Err, pinned)
}
var assigneeRefusal *publicops.CloseNotAssigneeError
if !errors.As(result.Outcomes[3].Err, &assigneeRefusal) {
t.Errorf("held item = %v, want *CloseNotAssigneeError", result.Outcomes[3].Err)
} else if assigneeRefusal.IssueID != held || assigneeRefusal.Assignee != "holder" || assigneeRefusal.Actor != "closer" {
t.Errorf("held item refusal = %#v, want IssueID %q, Assignee holder, Actor closer", assigneeRefusal, held)
}
for _, i := range []int{1, 2, 3} {
if result.Outcomes[i].Issue != nil {
t.Errorf("refused outcome %d carries an Issue snapshot, want nil beside Err", i)
}
}
assertBatchCloserStatus(t, ctx, fixture, first, types.StatusClosed)
assertBatchCloserStatus(t, ctx, fixture, last, types.StatusClosed)
assertBatchCloserStatus(t, ctx, fixture, template, types.StatusOpen)
assertBatchCloserStatus(t, ctx, fixture, pinned, types.StatusPinned)
assertBatchCloserStatus(t, ctx, fixture, held, types.StatusOpen)
forced, err := fixture.Closer.CloseBatch(ctx, publicops.CloseBatchRequest{
Actor: "closer",
Items: []publicops.BatchCloseItem{{IssueID: template}, {IssueID: pinned}, {IssueID: held}},
Force: true,
})
if err != nil {
t.Fatalf("forced CloseBatch over guarded items: %v", err)
}
if !errors.Is(forced.Outcomes[0].Err, publicops.ErrTemplateReadOnly) {
t.Errorf("forced template item = %v, want ErrTemplateReadOnly: force never waives read-only", forced.Outcomes[0].Err)
}
for _, i := range []int{1, 2} {
if forced.Outcomes[i].Err != nil || !forced.Outcomes[i].Changed {
t.Errorf("forced outcome %d (%s) = %+v, want force to bypass the guard", i, forced.Outcomes[i].IssueID, forced.Outcomes[i])
}
}
assertBatchCloserStatus(t, ctx, fixture, template, types.StatusOpen)
assertBatchCloserStatus(t, ctx, fixture, pinned, types.StatusClosed)
assertBatchCloserStatus(t, ctx, fixture, held, types.StatusClosed)
}

View file

@ -97,14 +97,6 @@ func RunBatchCreatorCreatesEveryItemAsOneAct(t *testing.T, ctx context.Context,
}
seen[issue.ID] = true
assertBatchCreatorRowCount(t, ctx, fixture, "issues", issue.ID, 1)
// No item names a creator, so each defaults to the batch's actor.
var createdBy string
if err := fixture.QueryScalar(ctx, "SELECT COALESCE(created_by, '') FROM issues WHERE id = ?", []any{issue.ID}, &createdBy); err != nil {
t.Fatalf("read created_by for %s: %v", issue.ID, err)
}
if createdBy != request.Actor || issue.CreatedBy != request.Actor {
t.Errorf("item %d created_by = %q (result %q), want the request's actor %q", i, createdBy, issue.CreatedBy, request.Actor)
}
}
if labels := result.Issues[0].Labels; len(labels) != 1 || labels[0] != "alpha" {
t.Errorf("result issue 0 labels = %v, want [alpha]: the snapshot is promised hydrated with labels", labels)
@ -697,63 +689,3 @@ func batchCreatorHistoryCount(t *testing.T, ctx context.Context, fixture BatchCr
}
return entries
}
// RunBatchCreatorAppliesTheDefaultPriority pins BatchCreateItem.DefaultPriority:
// an item that asks for the default stores publicops.DefaultCreatePriority, and
// an item naming priority 0 stores P0 in the same batch. The default is
// Lifecycle.Create's, applied in the shared preparation, so an HTTP
// batchCreate without `priority` and a `bd create --file` template without one
// land the same row. An item asking for the default while naming a priority is
// ErrValidation and writes nothing, as it is for Lifecycle.Create.
func RunBatchCreatorAppliesTheDefaultPriority(t *testing.T, ctx context.Context, fixture BatchCreatorFixture) {
t.Helper()
// Minted ids and an unset status, so the case asks nothing of the items
// but their priority — the http wire's batch item has no id or status slot.
unset := &types.Issue{Title: fixture.IssuePrefix + " defaulted", IssueType: types.TypeTask}
zero := &types.Issue{Title: fixture.IssuePrefix + " critical", IssueType: types.TypeTask}
result, err := fixture.BatchCreator.CreateBatch(ctx, publicops.CreateBatchRequest{
Actor: "batch-writer",
Items: []publicops.BatchCreateItem{
{Issue: unset, DefaultPriority: true},
{Issue: zero},
},
})
if err != nil {
t.Fatalf("CreateBatch: %v", err)
}
if len(result.Issues) != 2 || result.Issues[0] == nil || result.Issues[1] == nil {
t.Fatalf("result = %v, want two created issues", result.Issues)
}
for i, want := range []int{publicops.DefaultCreatePriority, 0} {
created := result.Issues[i]
if created.Priority != want {
t.Errorf("item %d result priority = %d, want %d", i, created.Priority, want)
}
var got int
if err := fixture.QueryScalar(ctx, "SELECT priority FROM issues WHERE id = ?", []any{created.ID}, &got); err != nil {
t.Fatalf("read priority of %s: %v", created.ID, err)
}
if got != want {
t.Errorf("item %d stored priority = %d, want %d", i, got, want)
}
}
conflict := fixture.IssuePrefix + " conflicting"
_, err = fixture.BatchCreator.CreateBatch(ctx, publicops.CreateBatchRequest{
Actor: "batch-writer",
Items: []publicops.BatchCreateItem{
{Issue: &types.Issue{Title: conflict, Priority: 3, IssueType: types.TypeTask}, DefaultPriority: true},
},
})
if !errors.Is(err, storage.ErrValidation) {
t.Fatalf("DefaultPriority with priority 3: err = %v, want ErrValidation", err)
}
var stored int
if err := fixture.QueryScalar(ctx, "SELECT COUNT(*) FROM issues WHERE title = ?", []any{conflict}, &stored); err != nil {
t.Fatalf("count issues titled %q: %v", conflict, err)
}
if stored != 0 {
t.Errorf("issues titled %q after the conflicting priority batch = %d, want 0", conflict, stored)
}
}

View file

@ -1,443 +0,0 @@
package conformance
import (
"context"
"errors"
"fmt"
"testing"
"github.com/steveyegge/beads/internal/types"
publicops "github.com/steveyegge/beads/issueops"
)
// This file holds the contract every implementation of publicops.BatchGetter
// must satisfy. Each case asserts what issueops/batchgetter.go PROMISES, cited
// by symbol; a backend that disagrees is parked at its own wiring site with
// skipKnownDivergence so the case still runs on the ones that agree.
//
// THREE LEGS, ONE BODY, GraphCounterFixture's reason: all three reach the same
// storage/issueops.ExecuteGetMany, which itself reaches GetIssuesByIDsInTx for
// the actual read. The two stores wrap it in their own read transaction, and
// the unit-of-work provider reaches it through the domain repository, whose
// runner publishes exactly the DBTX method set that function takes. So a
// three-leg run here is ONE READING plus two engine checks and three wrapper
// checks, and the cases are written for that: they assert the result's shape
// and order rather than message text, so a wrapper that loses the request,
// drops ordering or breaks errors.Is is what a per-leg failure would actually
// be.
//
// EVERY CASE NAMES THE EXACT IDS IT SEEDED, GraphCounterFixture's reason: the
// three fixtures share one database per suite and the two store fixtures share
// it with every other role's cases.
type BatchGetterFixture struct {
// IssuePrefix namespaces the ids each assertion seeds, so several of them
// can share one database.
IssuePrefix string
BatchGetter publicops.BatchGetter
// CreateIssue seeds a durable issue in the issues plane.
CreateIssue func(context.Context, *types.Issue, string) error
// CreateIssues seeds many durable issues in one call. Optional: only
// RunBatchGetterAcceptsExactlyTheCap uses it, to seed its MaxGetManyIDs
// issues in one write instead of MaxGetManyIDs single-row commits (about
// 200s of the embedded suites' race runs); nil falls back to CreateIssue
// per row. The seeded rows are the same either way, and the case asserts
// only on the GetMany read.
CreateIssues func(context.Context, []*types.Issue, string) error
// CreateWisp seeds an ephemeral issue in the wisps plane. It is a separate
// field rather than an Ephemeral flag on CreateIssue because the three
// adapters reach the two planes through different verbs.
CreateWisp func(context.Context, *types.Issue, string) error
// CountHistory reports how many history entries the fixture's branch has.
// A nil hook means "this backend cannot observe history", and the case that
// needs it SKIPS rather than passing quietly.
CountHistory func(context.Context) (int, error)
}
// RunBatchGetterFindsRequestedIssues pins the found half of GetManyResult: an
// id a GetManyRequest names and the store holds comes back hydrated, with the
// id that resolved it.
func RunBatchGetterFindsRequestedIssues(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
first := fixture.IssuePrefix + "-found-a"
second := fixture.IssuePrefix + "-found-b"
seedBatchGetterIssues(t, ctx, fixture, first, second)
result := getMany(t, ctx, fixture, publicops.GetManyRequest{IDs: []string{first, second}})
assertBatchGetterIssueIDs(t, result, first, second)
assertBatchGetterMissingIDs(t, result)
}
// RunBatchGetterReportsMissingIDs pins GetManyResult.Missing: an id naming no
// stored row is reported there, beside whatever else resolved, rather than
// refusing the whole call. The ghost sits BETWEEN two real ids, the same
// placement RunGraphCounterDistinguishesNoEdgesFromNoAnchor uses, so a body
// that short-circuited on the first miss cannot pass by accident.
func RunBatchGetterReportsMissingIDs(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
first := fixture.IssuePrefix + "-missing-real1"
ghost := fixture.IssuePrefix + "-missing-ghost"
second := fixture.IssuePrefix + "-missing-real2"
seedBatchGetterIssues(t, ctx, fixture, first, second)
result := getMany(t, ctx, fixture, publicops.GetManyRequest{IDs: []string{first, ghost, second}})
assertBatchGetterIssueIDs(t, result, first, second)
assertBatchGetterMissingIDs(t, result, ghost)
}
// RunBatchGetterCollapsesRepeatedIDs pins GetManyRequest.IDs's repeats clause:
// an id named twice is one entry, at the position of its first mention. The
// repeat is placed AFTER a different id, RunGraphCounterCollapsesRepeatedAnchors'
// reason: a body that de-duplicated by sorting rather than by first mention
// would answer b, a instead of a, b.
func RunBatchGetterCollapsesRepeatedIDs(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
first := fixture.IssuePrefix + "-dup-b"
second := fixture.IssuePrefix + "-dup-a"
seedBatchGetterIssues(t, ctx, fixture, first, second)
result := getMany(t, ctx, fixture, publicops.GetManyRequest{
IDs: []string{first, second, first, second, first},
})
assertBatchGetterIssueIDs(t, result, first, second)
}
// RunBatchGetterAnswersInRequestOrder pins GetManyResult.Issues' ordering
// clause: the answer comes back in the REQUEST's order, never the storage
// engine's natural order. The ids are seeded in the opposite order from the one
// requested, so a body that forwarded the storage engine's order would fail.
func RunBatchGetterAnswersInRequestOrder(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
first := fixture.IssuePrefix + "-order-c"
second := fixture.IssuePrefix + "-order-b"
third := fixture.IssuePrefix + "-order-a"
// Seeded in storage order third, second, first — the reverse of the
// request below — so a body that forwarded insertion order would fail.
seedBatchGetterIssues(t, ctx, fixture, third, second, first)
result := getMany(t, ctx, fixture, publicops.GetManyRequest{IDs: []string{first, second, third}})
assertBatchGetterIssueIDs(t, result, first, second, third)
}
// RunBatchGetterResolvesIDsExactly pins the exactness GetManyRequest.IDs
// documents: a prefix of a real id and a real id padded with whitespace are
// both reported Missing rather than resolved, the same exactness
// RunGraphCounterResolvesIDsExactly pins for EdgeCountRequest.IDs.
func RunBatchGetterResolvesIDsExactly(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
real := fixture.IssuePrefix + "-exact-real"
seedBatchGetterIssues(t, ctx, fixture, real)
prefix := real[:len(real)-2]
spaced := " " + real + " "
result := getMany(t, ctx, fixture, publicops.GetManyRequest{IDs: []string{real, prefix, spaced}})
assertBatchGetterIssueIDs(t, result, real)
assertBatchGetterMissingIDs(t, result, prefix, spaced)
}
// RunBatchGetterAnswersAnEmptyRequest pins GetManyRequest.IDs's empty-slice
// clause: no ids is not an error, it is an answer with no issues — and both
// slices are never nil, so a front door that marshals them emits [] rather
// than null.
func RunBatchGetterAnswersAnEmptyRequest(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
result, err := fixture.BatchGetter.GetMany(ctx, publicops.GetManyRequest{})
if err != nil {
t.Fatalf("GetMany with no ids = %v, want an empty answer", err)
}
if len(result.Issues) != 0 {
t.Fatalf("GetMany with no ids returned %d issues, want none", len(result.Issues))
}
if result.Issues == nil {
t.Error("Issues is nil; the contract promises it is never nil for a successful call")
}
if result.Missing == nil {
t.Error("Missing is nil; the contract promises it is never nil for a successful call")
}
}
// RunBatchGetterRefusesAnUnusableRequest pins the request vocabulary
// ValidateGetManyRequest applies: an empty-string id is refused with
// ErrValidation.
func RunBatchGetterRefusesAnUnusableRequest(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
real := fixture.IssuePrefix + "-refuse-real"
seedBatchGetterIssues(t, ctx, fixture, real)
_, err := fixture.BatchGetter.GetMany(ctx, publicops.GetManyRequest{IDs: []string{real, ""}})
if !errors.Is(err, publicops.ErrValidation) {
t.Errorf("GetMany with an empty id beside a real one = %v, want ErrValidation", err)
}
}
// RunBatchGetterRefusesOverTheCap pins MaxGetManyIDs: a request naming more
// ids than the cap is refused with a *publicops.TooManyIDsError that wraps
// ErrValidation, counted on the request as sent, BEFORE deduplication — the
// request below repeats one id past the cap, so a body that checked the
// deduplicated count would wrongly let it through.
func RunBatchGetterRefusesOverTheCap(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
real := fixture.IssuePrefix + "-cap-real"
seedBatchGetterIssues(t, ctx, fixture, real)
ids := make([]string, publicops.MaxGetManyIDs+1)
for i := range ids {
ids[i] = real
}
_, err := fixture.BatchGetter.GetMany(ctx, publicops.GetManyRequest{IDs: ids})
var tooMany *publicops.TooManyIDsError
if !errors.As(err, &tooMany) {
t.Fatalf("GetMany over the cap = %v, want *publicops.TooManyIDsError", err)
}
if tooMany.Requested != len(ids) {
t.Errorf("TooManyIDsError.Requested = %d, want %d (the count before deduplication)", tooMany.Requested, len(ids))
}
if tooMany.Cap != publicops.MaxGetManyIDs {
t.Errorf("TooManyIDsError.Cap = %d, want %d", tooMany.Cap, publicops.MaxGetManyIDs)
}
if !errors.Is(err, publicops.ErrValidation) {
t.Errorf("GetMany over the cap = %v, want it to also match ErrValidation", err)
}
}
// RunBatchGetterAcceptsExactlyTheCap pins the boundary MaxGetManyIDs draws:
// a request naming EXACTLY the cap's worth of distinct ids is accepted and
// answered in full, not refused. RunBatchGetterRefusesOverTheCap pins the
// cap+1 side of this line; without this case a `>` to `>=` mutation on the
// comparison would still refuse a one-over request (cap+1 is still > cap-1)
// and pass that case while silently refusing every legitimate cap-sized
// request.
func RunBatchGetterAcceptsExactlyTheCap(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
ids := make([]string, publicops.MaxGetManyIDs)
for i := range ids {
ids[i] = fmt.Sprintf("%s-atcap-%d", fixture.IssuePrefix, i)
}
seedBatchGetterIssuesInBulk(t, ctx, fixture, ids...)
result := getMany(t, ctx, fixture, publicops.GetManyRequest{IDs: ids})
if len(result.Issues) != publicops.MaxGetManyIDs {
t.Fatalf("GetMany with exactly MaxGetManyIDs (%d) ids returned %d issues, want %d",
publicops.MaxGetManyIDs, len(result.Issues), publicops.MaxGetManyIDs)
}
assertBatchGetterMissingIDs(t, result)
}
// RunBatchGetterHydratesLabels pins that a resolved issue's Labels come back
// populated: hydration for this role is LABELS ONLY (no dependencies,
// dependents or comments — issueops.GetManyResult.Issues documents the
// scope), so Labels is the one piece of relational data a regression here
// could silently drop without any other case noticing.
func RunBatchGetterHydratesLabels(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
id := fixture.IssuePrefix + "-labels-a"
seed := batchGetterSeed(id, false)
seed.Labels = []string{"alpha", "beta"}
if err := fixture.CreateIssue(ctx, seed, "batch-getter-seed"); err != nil {
t.Fatalf("seed issue %s: %v", id, err)
}
result := getMany(t, ctx, fixture, publicops.GetManyRequest{IDs: []string{id}})
assertBatchGetterIssueIDs(t, result, id)
got := result.Issues[0].Labels
want := []string{"alpha", "beta"}
if len(got) != len(want) {
t.Fatalf("GetMany(%s).Labels = %v, want %v", id, got, want)
}
seen := make(map[string]bool, len(got))
for _, l := range got {
seen[l] = true
}
for _, l := range want {
if !seen[l] {
t.Errorf("GetMany(%s).Labels = %v, want it to include %q", id, got, l)
}
}
}
// RunBatchGetterLeavesTheRequestAlone pins the no-mutation clause on
// BatchGetter: IDs is the one member a body could write through to the caller
// — de-duplication is exactly the step that would — and the contract says a
// body de-duplicates into its own copy.
func RunBatchGetterLeavesTheRequestAlone(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
first := fixture.IssuePrefix + "-immutable-a"
second := fixture.IssuePrefix + "-immutable-b"
seedBatchGetterIssues(t, ctx, fixture, first, second)
ids := []string{first, first, second}
getMany(t, ctx, fixture, publicops.GetManyRequest{IDs: ids})
if len(ids) != 3 || ids[0] != first || ids[1] != first || ids[2] != second {
t.Errorf("the request's IDs slice is now %v; the contract says a body de-duplicates into its own copy", ids)
}
}
// RunBatchGetterSharesOneReadStructurally pins the STRUCTURAL half of the
// one-snapshot clause on BatchGetter.GetMany: the existence check and the
// hydration are one call answering one found id and one missing id together
// against a STATIC fixture, which is consistent with — but does not by
// itself PROVE — the two sharing one transaction under a concurrent writer.
// A body that split the probe from the hydration into two round trips could
// still pass this case against a fixture nothing else is mutating, so it
// checks both halves of one GetManyResult instead of asserting on two
// separate calls the way RunBatchGetterFindsRequestedIssues and
// RunBatchGetterReportsMissingIDs do, but it is NOT a concurrency test: no
// writer races the read here.
//
// Renamed from RunBatchGetterReadsOneSnapshot, which overclaimed an
// atomicity guarantee this case alone does not empirically demonstrate. A
// real interleaving test — a concurrent writer racing GetMany's transaction
// so the case can show a found id and a racing create or delete resolve
// consistently with ONE snapshot boundary — needs a synchronization hook
// (e.g. "pause this leg's read transaction after its query, before it
// returns, so a second goroutine can write and commit") that roleFixtureKit
// does not expose today; that kit is FROZEN (see role_fixture_kit_test.go)
// and a role slice does not edit it. Adding the hook is tracked as follow-up
// work rather than done here, so this case stays honestly structural.
func RunBatchGetterSharesOneReadStructurally(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
present := fixture.IssuePrefix + "-snapshot-present"
ghost := fixture.IssuePrefix + "-snapshot-ghost"
seedBatchGetterIssues(t, ctx, fixture, present)
result := getMany(t, ctx, fixture, publicops.GetManyRequest{IDs: []string{present, ghost}})
if len(result.Issues) != 1 || len(result.Missing) != 1 {
t.Fatalf("GetMany([%s, %s]) = %d issues, %d missing; want exactly one of each from the same read",
present, ghost, len(result.Issues), len(result.Missing))
}
assertBatchGetterIssueIDs(t, result, present)
assertBatchGetterMissingIDs(t, result, ghost)
}
// RunBatchGetterCrossesBothPlanes pins that GetMany resolves ids regardless of
// which dependency plane stores them: a durable issue and an ephemeral wisp
// named in the same request both come back hydrated.
func RunBatchGetterCrossesBothPlanes(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
issue := fixture.IssuePrefix + "-plane-issue"
wisp := fixture.IssuePrefix + "-plane-wisp"
seedBatchGetterIssues(t, ctx, fixture, issue)
seedBatchGetterWisp(t, ctx, fixture, wisp)
result := getMany(t, ctx, fixture, publicops.GetManyRequest{IDs: []string{issue, wisp}})
assertBatchGetterIssueIDs(t, result, issue, wisp)
}
// RunBatchGetterWritesNothing pins BatchGetter's read clause: a GetMany
// records no history entry. The delta is taken around the calls rather than as
// an absolute count, RunGraphCounterWritesNothing's reason: the seeds above it
// are versioned writes of their own.
func RunBatchGetterWritesNothing(t *testing.T, ctx context.Context, fixture BatchGetterFixture) {
t.Helper()
if fixture.CountHistory == nil {
t.Skip("this backend cannot observe history, so the writes-nothing clause cannot be checked here")
}
real := fixture.IssuePrefix + "-quiet-real"
ghost := fixture.IssuePrefix + "-quiet-ghost"
seedBatchGetterIssues(t, ctx, fixture, real)
before, err := fixture.CountHistory(ctx)
if err != nil {
t.Fatalf("CountHistory before: %v", err)
}
getMany(t, ctx, fixture, publicops.GetManyRequest{IDs: []string{real, ghost}})
// A refusal changes nothing either, so the same delta covers both.
_, _ = fixture.BatchGetter.GetMany(ctx, publicops.GetManyRequest{IDs: []string{""}})
after, err := fixture.CountHistory(ctx)
if err != nil {
t.Fatalf("CountHistory after: %v", err)
}
if after != before {
t.Fatalf("history entries went %d -> %d across two GetMany calls, want no change", before, after)
}
}
func getMany(t *testing.T, ctx context.Context, fixture BatchGetterFixture, request publicops.GetManyRequest) publicops.GetManyResult {
t.Helper()
result, err := fixture.BatchGetter.GetMany(ctx, request)
if err != nil {
t.Fatalf("GetMany(%v): %v", request.IDs, err)
}
return result
}
func seedBatchGetterIssues(t *testing.T, ctx context.Context, fixture BatchGetterFixture, ids ...string) {
t.Helper()
for _, id := range ids {
if err := fixture.CreateIssue(ctx, batchGetterSeed(id, false), "batch-getter-seed"); err != nil {
t.Fatalf("seed issue %s: %v", id, err)
}
}
}
// seedBatchGetterIssuesInBulk seeds the same rows as seedBatchGetterIssues,
// through the fixture's CreateIssues hook when it has one.
func seedBatchGetterIssuesInBulk(t *testing.T, ctx context.Context, fixture BatchGetterFixture, ids ...string) {
t.Helper()
if fixture.CreateIssues == nil {
seedBatchGetterIssues(t, ctx, fixture, ids...)
return
}
issues := make([]*types.Issue, len(ids))
for i, id := range ids {
issues[i] = batchGetterSeed(id, false)
}
if err := fixture.CreateIssues(ctx, issues, "batch-getter-seed"); err != nil {
t.Fatalf("seed %d issues: %v", len(issues), err)
}
}
func seedBatchGetterWisp(t *testing.T, ctx context.Context, fixture BatchGetterFixture, id string) {
t.Helper()
if err := fixture.CreateWisp(ctx, batchGetterSeed(id, true), "batch-getter-seed"); err != nil {
t.Fatalf("seed wisp %s: %v", id, err)
}
}
func batchGetterSeed(id string, ephemeral bool) *types.Issue {
return &types.Issue{
ID: id,
Title: id,
Status: types.StatusOpen,
Priority: 2,
IssueType: types.TypeTask,
Ephemeral: ephemeral,
}
}
func batchGetterIssueIDs(result publicops.GetManyResult) []string {
out := make([]string, 0, len(result.Issues))
for _, issue := range result.Issues {
out = append(out, issue.ID)
}
return out
}
func assertBatchGetterIssueIDs(t *testing.T, result publicops.GetManyResult, want ...string) {
t.Helper()
got := batchGetterIssueIDs(result)
if len(got) != len(want) {
t.Fatalf("issues = %v, want %v", got, want)
}
for i := range want {
if got[i] != want[i] {
t.Fatalf("issues = %v, want %v", got, want)
}
}
}
func assertBatchGetterMissingIDs(t *testing.T, result publicops.GetManyResult, want ...string) {
t.Helper()
got := result.Missing
if len(got) != len(want) {
t.Fatalf("missing = %v, want %v", got, want)
}
for i := range want {
if got[i] != want[i] {
t.Fatalf("missing = %v, want %v", got, want)
}
}
if got == nil {
t.Error("Missing is nil; the contract promises it is never nil for a successful call")
}
}

View file

@ -1,426 +0,0 @@
package conformance
import (
"context"
"fmt"
"reflect"
"slices"
"testing"
"time"
"github.com/steveyegge/beads/internal/types"
publicops "github.com/steveyegge/beads/issueops"
)
// This file holds the semantic contract every implementation of
// publicops.BlockedLister must satisfy: what issueops/blockedlister.go
// promises, asserted on every leg (dolt, embedded dolt, unit of work, and the
// served HTTP client) so `bd blocked` answers one listing whichever route it
// takes.
//
// EVERY CASE IS SCOPED BY A LABEL: the blocked set is a property of the whole
// database, not of an id prefix, so a row seeded by one case is inside the
// next one's answer unless each asks through Labels.
// BlockedListerFixture supplies adapter-specific storage access for the
// blocked-listing assertions.
type BlockedListerFixture struct {
// IssuePrefix namespaces the ids each case seeds, so several cases can
// share one database.
IssuePrefix string
// BlockedLister is the surface under test.
BlockedLister publicops.BlockedLister
// CreateIssue seeds a durable issue in the issues plane.
CreateIssue func(context.Context, *types.Issue, string) error
// CreateWisp seeds an ephemeral issue in the wisps plane.
CreateWisp func(context.Context, *types.Issue, string) error
// AddDependency seeds ONE edge, recomputing the stored blocked flag the
// way every dependency write does.
AddDependency func(context.Context, *types.Dependency, string) error
// MarkBlocked sets the stored is_blocked flag on one durable issue
// directly, without the edge that would justify it: the stale flag `bd
// recompute-blocked` exists to repair. It must fail unless exactly one row
// changed. A nil hook means this leg cannot write the column, and the case
// that needs it skips with that reason.
MarkBlocked func(context.Context, string) error
}
// RunBlockedLister runs every blocked-listing case as a subtest of t.
func RunBlockedLister(t *testing.T, ctx context.Context, fixture BlockedListerFixture) {
t.Helper()
t.Run("NamesADirectBlocker", func(t *testing.T) { runBlockedNamesADirectBlocker(t, ctx, fixture) })
t.Run("AttributesAChildToItsBlockedParent", func(t *testing.T) { runBlockedAttributesAChildToItsParent(t, ctx, fixture) })
t.Run("ClosedBlockerDoesNotBlock", func(t *testing.T) { runBlockedClosedBlockerDoesNotBlock(t, ctx, fixture) })
t.Run("IncludesTheWispPlane", func(t *testing.T) { runBlockedIncludesTheWispPlane(t, ctx, fixture) })
t.Run("ExcludesThePinnedStatus", func(t *testing.T) { runBlockedExcludesThePinnedStatus(t, ctx, fixture) })
t.Run("ParentFilter", func(t *testing.T) { runBlockedParentFilter(t, ctx, fixture) })
t.Run("LabelFilters", func(t *testing.T) { runBlockedLabelFilters(t, ctx, fixture) })
t.Run("Order", func(t *testing.T) { runBlockedOrder(t, ctx, fixture) })
t.Run("NamesWaitsForAndConditionalBlockers", func(t *testing.T) { runBlockedNamesWaitsForAndConditionalBlockers(t, ctx, fixture) })
t.Run("OmitsAStaleFlagWithNoNameableBlocker", func(t *testing.T) { runBlockedOmitsAStaleFlag(t, ctx, fixture) })
t.Run("HasNoTypeExclusions", func(t *testing.T) { runBlockedHasNoTypeExclusions(t, ctx, fixture) })
t.Run("EmptyIsAnEmptySlice", func(t *testing.T) { runBlockedEmptyIsAnEmptySlice(t, ctx, fixture) })
t.Run("DoesNotMutateTheCallerRequest", func(t *testing.T) { runBlockedDoesNotMutateTheRequest(t, ctx, fixture) })
}
// runBlockedNamesADirectBlocker: an issue with an open `blocks` target is
// listed with that target as its one blocker; the target itself is not.
func runBlockedNamesADirectBlocker(t *testing.T, ctx context.Context, f BlockedListerFixture) {
label := f.IssuePrefix + "-bl-direct"
blocked, blocker := blListerID(f, "direct-src"), blListerID(f, "direct-dst")
blListerSeedIssue(t, ctx, f, blListerIssue(blocked, 1, label))
blListerSeedIssue(t, ctx, f, blListerIssue(blocker, 1, label))
blListerSeedEdge(t, ctx, f, blocked, blocker, types.DepBlocks)
items := blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{label}})
blListerAssertRows(t, items, map[string][]string{blocked: {blocker}})
}
// runBlockedAttributesAChildToItsParent: a child of a blocked parent, with no
// blocker of its own, is listed with its parent named as the blocker.
func runBlockedAttributesAChildToItsParent(t *testing.T, ctx context.Context, f BlockedListerFixture) {
label := f.IssuePrefix + "-bl-child"
parent, child, blocker := blListerID(f, "child-parent"), blListerID(f, "child-child"), blListerID(f, "child-blocker")
blListerSeedIssue(t, ctx, f, blListerIssue(parent, 1, label))
blListerSeedIssue(t, ctx, f, blListerIssue(blocker, 1, label+"-other"))
blListerSeedIssue(t, ctx, f, blListerIssue(child, 1, label))
blListerSeedEdge(t, ctx, f, child, parent, types.DepParentChild)
blListerSeedEdge(t, ctx, f, parent, blocker, types.DepBlocks)
items := blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{label}})
blListerAssertRows(t, items, map[string][]string{parent: {blocker}, child: {parent}})
}
// runBlockedClosedBlockerDoesNotBlock: a `blocks` edge onto a closed target
// names no blocker, so the source is not listed.
func runBlockedClosedBlockerDoesNotBlock(t *testing.T, ctx context.Context, f BlockedListerFixture) {
label := f.IssuePrefix + "-bl-closed"
src, dst := blListerID(f, "closed-src"), blListerID(f, "closed-dst")
blListerSeedIssue(t, ctx, f, blListerIssue(src, 1, label))
closed := blListerIssue(dst, 1, label)
closed.Status = types.StatusClosed
blListerSeedIssue(t, ctx, f, closed)
blListerSeedEdge(t, ctx, f, src, dst, types.DepBlocks)
items := blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{label}})
blListerAssertRows(t, items, map[string][]string{})
}
// runBlockedIncludesTheWispPlane: a blocked wisp is listed beside the issues.
func runBlockedIncludesTheWispPlane(t *testing.T, ctx context.Context, f BlockedListerFixture) {
label := f.IssuePrefix + "-bl-wisp"
wisp, blocker := blListerID(f, "wisp-src"), blListerID(f, "wisp-dst")
w := blListerIssue(wisp, 1, label)
w.Ephemeral = true
if err := f.CreateWisp(ctx, w, "seed"); err != nil {
t.Fatalf("seed wisp %s: %v", wisp, err)
}
b := blListerIssue(blocker, 1, label)
b.Ephemeral = true
if err := f.CreateWisp(ctx, b, "seed"); err != nil {
t.Fatalf("seed wisp %s: %v", blocker, err)
}
blListerSeedEdge(t, ctx, f, wisp, blocker, types.DepBlocks)
items := blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{label}})
blListerAssertRows(t, items, map[string][]string{wisp: {blocker}})
}
// runBlockedExcludesThePinnedStatus: a row whose status is pinned is never
// listed, whatever blocks it.
func runBlockedExcludesThePinnedStatus(t *testing.T, ctx context.Context, f BlockedListerFixture) {
label := f.IssuePrefix + "-bl-pinned"
pinned, open, blocker := blListerID(f, "pinned-src"), blListerID(f, "pinned-open"), blListerID(f, "pinned-dst")
p := blListerIssue(pinned, 1, label)
p.Status = types.StatusPinned
blListerSeedIssue(t, ctx, f, p)
blListerSeedIssue(t, ctx, f, blListerIssue(open, 1, label))
blListerSeedIssue(t, ctx, f, blListerIssue(blocker, 1, label+"-other"))
blListerSeedEdge(t, ctx, f, pinned, blocker, types.DepBlocks)
blListerSeedEdge(t, ctx, f, open, blocker, types.DepBlocks)
items := blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{label}})
blListerAssertRows(t, items, map[string][]string{open: {blocker}})
}
// runBlockedParentFilter: ParentID narrows to the parent's direct children.
func runBlockedParentFilter(t *testing.T, ctx context.Context, f BlockedListerFixture) {
label := f.IssuePrefix + "-bl-parent"
parent, kid, stranger, blocker := blListerID(f, "pf-parent"), blListerID(f, "pf-kid"), blListerID(f, "pf-stranger"), blListerID(f, "pf-blocker")
blListerSeedIssue(t, ctx, f, blListerIssue(parent, 1, label+"-other"))
blListerSeedIssue(t, ctx, f, blListerIssue(blocker, 1, label+"-other"))
blListerSeedIssue(t, ctx, f, blListerIssue(kid, 1, label))
blListerSeedIssue(t, ctx, f, blListerIssue(stranger, 1, label))
blListerSeedEdge(t, ctx, f, kid, parent, types.DepParentChild)
blListerSeedEdge(t, ctx, f, kid, blocker, types.DepBlocks)
blListerSeedEdge(t, ctx, f, stranger, blocker, types.DepBlocks)
all := blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{label}})
blListerAssertRows(t, all, map[string][]string{kid: {blocker}, stranger: {blocker}})
narrowed := blListerList(t, ctx, f, publicops.BlockedRequest{ParentID: parent, Labels: []string{label}})
blListerAssertRows(t, narrowed, map[string][]string{kid: {blocker}})
}
// runBlockedLabelFilters: Labels is AND, LabelsAny is OR, ExcludeLabels
// removes, and every value is trimmed with blanks dropped.
func runBlockedLabelFilters(t *testing.T, ctx context.Context, f BlockedListerFixture) {
base := f.IssuePrefix + "-bl-lab"
red, blue := base+"-red", base+"-blue"
both, onlyRed, onlyBlue, blocker := blListerID(f, "lab-both"), blListerID(f, "lab-red"), blListerID(f, "lab-blue"), blListerID(f, "lab-blocker")
blListerSeedIssue(t, ctx, f, blListerIssue(both, 1, base, red, blue))
blListerSeedIssue(t, ctx, f, blListerIssue(onlyRed, 1, base, red))
blListerSeedIssue(t, ctx, f, blListerIssue(onlyBlue, 1, base, blue))
blListerSeedIssue(t, ctx, f, blListerIssue(blocker, 1, base+"-other"))
for _, id := range []string{both, onlyRed, onlyBlue} {
blListerSeedEdge(t, ctx, f, id, blocker, types.DepBlocks)
}
want := func(ids ...string) map[string][]string {
m := map[string][]string{}
for _, id := range ids {
m[id] = []string{blocker}
}
return m
}
blListerAssertRows(t, blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{" " + red + " ", "", blue}}), want(both))
blListerAssertRows(t, blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{base}, LabelsAny: []string{red, blue}}), want(both, onlyRed, onlyBlue))
blListerAssertRows(t, blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{base}, ExcludeLabels: []string{" " + blue}}), want(onlyRed))
}
// runBlockedOrder: priority ascending, then created_at descending, then id.
//
// The created_at values are seeded explicitly, so every key decides at least
// one pair: two rows share a priority and differ in created_at (newest first),
// and five share both priority and created_at (the id breaks the tie). The
// expected order is written out rather than recomputed from the answer.
func runBlockedOrder(t *testing.T, ctx context.Context, f BlockedListerFixture) {
label := f.IssuePrefix + "-bl-order"
blocker := blListerID(f, "order-blocker")
blListerSeedIssue(t, ctx, f, blListerIssue(blocker, 1, label+"-other"))
older := time.Date(2026, 1, 1, 10, 0, 0, 0, time.UTC)
newer := older.Add(time.Hour)
// Two of the five tied rows are wisps. The store body assembles rows
// issues-plane first, each plane in id order, so the ids alone would put
// the tied run in the wrong order (b, d, e, then a, c); only the id
// tiebreak puts it right.
rows := []struct {
name string
priority int
created time.Time
wisp bool
}{
{"order-p3", 3, newer, false},
{"order-p0-older", 0, older, false},
{"order-p0-newer-e", 0, newer, false},
{"order-p0-newer-c", 0, newer, true},
{"order-p0-newer-a", 0, newer, true},
{"order-p0-newer-d", 0, newer, false},
{"order-p0-newer-b", 0, newer, false},
{"order-p1", 1, older, false},
}
for _, row := range rows {
issue := blListerIssue(blListerID(f, row.name), row.priority, label)
issue.CreatedAt = row.created
issue.UpdatedAt = row.created
if row.wisp {
issue.Ephemeral = true
if err := f.CreateWisp(ctx, issue, "seed"); err != nil {
t.Fatalf("seed wisp %s: %v", issue.ID, err)
}
} else {
blListerSeedIssue(t, ctx, f, issue)
}
blListerSeedEdge(t, ctx, f, issue.ID, blocker, types.DepBlocks)
}
want := []string{
blListerID(f, "order-p0-newer-a"),
blListerID(f, "order-p0-newer-b"),
blListerID(f, "order-p0-newer-c"),
blListerID(f, "order-p0-newer-d"),
blListerID(f, "order-p0-newer-e"),
blListerID(f, "order-p0-older"),
blListerID(f, "order-p1"),
blListerID(f, "order-p3"),
}
got := blListerIDs(blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{label}}))
if !slices.Equal(got, want) {
t.Errorf("listing order = %v, want %v (priority ascending, created_at descending, id)", got, want)
}
}
// runBlockedNamesWaitsForAndConditionalBlockers: a waits-for onto a spawner
// whose child is still open, and a conditional-blocks onto an open target,
// each name their target, as a blocks edge does.
func runBlockedNamesWaitsForAndConditionalBlockers(t *testing.T, ctx context.Context, f BlockedListerFixture) {
label := f.IssuePrefix + "-bl-wf"
spawner, spawned := blListerID(f, "wf-spawner"), blListerID(f, "wf-spawned")
waiter := blListerID(f, "wf-waiter")
target, conditional := blListerID(f, "cb-target"), blListerID(f, "cb-src")
blListerSeedIssue(t, ctx, f, blListerIssue(spawner, 1, label+"-other"))
blListerSeedIssue(t, ctx, f, blListerIssue(spawned, 1, label+"-other"))
blListerSeedIssue(t, ctx, f, blListerIssue(target, 1, label+"-other"))
blListerSeedIssue(t, ctx, f, blListerIssue(waiter, 1, label))
blListerSeedIssue(t, ctx, f, blListerIssue(conditional, 1, label))
blListerSeedEdge(t, ctx, f, spawned, spawner, types.DepParentChild)
blListerSeedEdge(t, ctx, f, waiter, spawner, types.DepWaitsFor)
blListerSeedEdge(t, ctx, f, conditional, target, types.DepConditionalBlocks)
items := blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{label}})
blListerAssertRows(t, items, map[string][]string{waiter: {spawner}, conditional: {target}})
}
// runBlockedOmitsAStaleFlag: a row whose stored flag says blocked but which
// has no active blocker and no parent names no blocker, so it is not listed.
// This is the narrowing gc's readiness projection documents relying on.
func runBlockedOmitsAStaleFlag(t *testing.T, ctx context.Context, f BlockedListerFixture) {
if f.MarkBlocked == nil {
t.Skip("this leg cannot write the stored is_blocked flag directly")
}
label := f.IssuePrefix + "-bl-stale"
stale, real, blocker := blListerID(f, "stale-src"), blListerID(f, "stale-real"), blListerID(f, "stale-blocker")
blListerSeedIssue(t, ctx, f, blListerIssue(stale, 1, label))
blListerSeedIssue(t, ctx, f, blListerIssue(real, 1, label))
blListerSeedIssue(t, ctx, f, blListerIssue(blocker, 1, label+"-other"))
blListerSeedEdge(t, ctx, f, real, blocker, types.DepBlocks)
if err := f.MarkBlocked(ctx, stale); err != nil {
t.Fatalf("mark %s blocked: %v", stale, err)
}
items := blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{label}})
blListerAssertRows(t, items, map[string][]string{real: {blocker}})
}
// runBlockedHasNoTypeExclusions: a gate is listed like any other row; the
// blocked door excludes no issue type (unlike the ready front).
func runBlockedHasNoTypeExclusions(t *testing.T, ctx context.Context, f BlockedListerFixture) {
label := f.IssuePrefix + "-bl-type"
gate, epic, blocker := blListerID(f, "type-gate"), blListerID(f, "type-epic"), blListerID(f, "type-blocker")
g := blListerIssue(gate, 1, label)
g.IssueType = types.TypeGate
g.AwaitType = "human"
blListerSeedIssue(t, ctx, f, g)
e := blListerIssue(epic, 1, label)
e.IssueType = types.TypeEpic
blListerSeedIssue(t, ctx, f, e)
blListerSeedIssue(t, ctx, f, blListerIssue(blocker, 1, label+"-other"))
blListerSeedEdge(t, ctx, f, gate, blocker, types.DepBlocks)
blListerSeedEdge(t, ctx, f, epic, blocker, types.DepBlocks)
items := blListerList(t, ctx, f, publicops.BlockedRequest{Labels: []string{label}})
blListerAssertRows(t, items, map[string][]string{gate: {blocker}, epic: {blocker}})
}
// runBlockedEmptyIsAnEmptySlice: nothing blocked is an empty, non-nil slice
// and a nil error.
func runBlockedEmptyIsAnEmptySlice(t *testing.T, ctx context.Context, f BlockedListerFixture) {
result, err := f.BlockedLister.ListBlocked(ctx, publicops.BlockedRequest{Labels: []string{f.IssuePrefix + "-bl-nothing"}})
if err != nil {
t.Fatalf("ListBlocked: %v", err)
}
if result.Items == nil || len(result.Items) != 0 {
t.Fatalf("Items = %#v, want an empty non-nil slice", result.Items)
}
}
// runBlockedDoesNotMutateTheRequest: the caller's label slices come back as
// they were sent, normalization notwithstanding.
func runBlockedDoesNotMutateTheRequest(t *testing.T, ctx context.Context, f BlockedListerFixture) {
req := publicops.BlockedRequest{
ParentID: " ",
Labels: []string{" a ", "", "a"},
LabelsAny: []string{" b"},
ExcludeLabels: []string{"c "},
}
before := publicops.BlockedRequest{
ParentID: req.ParentID,
Labels: slices.Clone(req.Labels),
LabelsAny: slices.Clone(req.LabelsAny),
ExcludeLabels: slices.Clone(req.ExcludeLabels),
}
if _, err := f.BlockedLister.ListBlocked(ctx, req); err != nil {
t.Fatalf("ListBlocked: %v", err)
}
if !reflect.DeepEqual(req, before) {
t.Errorf("request after = %#v, before = %#v", req, before)
}
}
func blListerID(f BlockedListerFixture, name string) string {
return fmt.Sprintf("%s-%s", f.IssuePrefix, name)
}
func blListerIssue(id string, priority int, labels ...string) *types.Issue {
return &types.Issue{
ID: id,
Title: id,
Status: types.StatusOpen,
Priority: priority,
IssueType: types.TypeTask,
Labels: labels,
}
}
func blListerSeedIssue(t *testing.T, ctx context.Context, f BlockedListerFixture, issue *types.Issue) {
t.Helper()
if err := f.CreateIssue(ctx, issue, "seed"); err != nil {
t.Fatalf("seed issue %s: %v", issue.ID, err)
}
}
func blListerSeedEdge(t *testing.T, ctx context.Context, f BlockedListerFixture, from, to string, kind types.DependencyType) {
t.Helper()
if err := f.AddDependency(ctx, &types.Dependency{IssueID: from, DependsOnID: to, Type: kind}, "seed"); err != nil {
t.Fatalf("seed %s edge %s -> %s: %v", kind, from, to, err)
}
}
func blListerList(t *testing.T, ctx context.Context, f BlockedListerFixture, req publicops.BlockedRequest) []*types.BlockedIssue {
t.Helper()
result, err := f.BlockedLister.ListBlocked(ctx, req)
if err != nil {
t.Fatalf("ListBlocked(%+v): %v", req, err)
}
if result.Items == nil {
t.Fatalf("ListBlocked(%+v) Items is nil; the role promises a non-nil slice", req)
}
return result.Items
}
func blListerIDs(items []*types.BlockedIssue) []string {
ids := make([]string, 0, len(items))
for _, item := range items {
ids = append(ids, item.ID)
}
return ids
}
// assertBlockedRows requires the listing to be exactly want: the same ids,
// each naming exactly the blockers want gives it (in any order), with
// BlockedByCount equal to their number.
func blListerAssertRows(t *testing.T, items []*types.BlockedIssue, want map[string][]string) {
t.Helper()
got := map[string][]string{}
for _, item := range items {
if item == nil {
t.Fatalf("listing carries a nil row")
}
if _, dup := got[item.ID]; dup {
t.Errorf("row %s listed twice", item.ID)
}
blockers := slices.Clone(item.BlockedBy)
slices.Sort(blockers)
got[item.ID] = blockers
if item.BlockedByCount != len(item.BlockedBy) {
t.Errorf("row %s: BlockedByCount = %d, len(BlockedBy) = %d", item.ID, item.BlockedByCount, len(item.BlockedBy))
}
}
normalized := map[string][]string{}
for id, blockers := range want {
b := slices.Clone(blockers)
slices.Sort(b)
normalized[id] = b
}
if !reflect.DeepEqual(got, normalized) {
t.Errorf("listing = %v, want %v", got, normalized)
}
}

View file

@ -546,65 +546,3 @@ func assertParent(t *testing.T, result publicops.BlockingResult, id, want string
t.Errorf("entry %s parent = %q, want %q", id, got, want)
}
}
// RunBlockingAnnotatorReportsTheTransitiveBlockedFlag pins
// BlockingRequest.IncludeIsBlocked and IssueBlocking.IsBlocked: asked, each id
// with a row carries its STORED TRANSITIVE is_blocked flag — a child of a
// blocked parent is blocked with no blocking edge of its own, which BlockedBy
// alone would read as free — and an id naming no row carries none. Unasked,
// no item carries a flag. This is the read issueops.BlockedFlags (storage's
// IsBlockedBatch on a role-served backend) is built on.
func RunBlockingAnnotatorReportsTheTransitiveBlockedFlag(t *testing.T, ctx context.Context, fixture BlockingAnnotatorFixture) {
t.Helper()
blocker := fixture.IssuePrefix + "-flag-blocker"
blocked := fixture.IssuePrefix + "-flag-blocked"
child := fixture.IssuePrefix + "-flag-child"
free := fixture.IssuePrefix + "-flag-free"
ghost := fixture.IssuePrefix + "-flag-ghost"
seedBlockingIssues(t, ctx, fixture, blocker, blocked, child, free)
seedBlockingEdge(t, ctx, fixture, child, blocked, types.DepParentChild)
seedBlockingEdge(t, ctx, fixture, blocked, blocker, types.DepBlocks)
ids := []string{blocked, child, free, ghost}
unasked := annotateBlocking(t, ctx, fixture, publicops.BlockingRequest{IDs: ids})
for _, item := range unasked.Items {
if item.IsBlocked != nil {
t.Errorf("unasked: %s carries IsBlocked=%v, want no flag", item.ID, *item.IsBlocked)
}
}
asked := annotateBlocking(t, ctx, fixture, publicops.BlockingRequest{IDs: ids, IncludeIsBlocked: true})
want := map[string]*bool{blocked: new(true), child: new(true), free: new(false), ghost: nil}
if len(asked.Items) != len(ids) {
t.Fatalf("asked: %d items, want %d", len(asked.Items), len(ids))
}
for _, item := range asked.Items {
w, ok := want[item.ID]
if !ok {
t.Errorf("asked: unexpected item %s", item.ID)
continue
}
switch {
case w == nil && item.IsBlocked != nil:
t.Errorf("asked: %s (no row) IsBlocked=%v, want no flag", item.ID, *item.IsBlocked)
case w != nil && item.IsBlocked == nil:
t.Errorf("asked: %s IsBlocked absent, want %v", item.ID, *w)
case w != nil && *item.IsBlocked != *w:
t.Errorf("asked: %s IsBlocked=%v, want %v", item.ID, *item.IsBlocked, *w)
}
}
flags, err := publicops.BlockedFlags(ctx, fixture.Annotator, append(ids, blocked, ""))
if err != nil {
t.Fatalf("BlockedFlags: %v", err)
}
wantFlags := map[string]bool{blocked: true, child: true, free: false}
if len(flags) != len(wantFlags) {
t.Errorf("BlockedFlags = %v, want %v (no entry for the ghost or the blank id)", flags, wantFlags)
}
for id, w := range wantFlags {
if got, ok := flags[id]; !ok || got != w {
t.Errorf("BlockedFlags[%s] = %v (present %v), want %v", id, got, ok, w)
}
}
}

View file

@ -57,19 +57,6 @@ type CounterFixture struct {
// A nil hook means "this backend cannot observe history", and the case
// that needs it SKIPS rather than passing quietly.
CountHistory func(context.Context) (int, error)
// AddDependency seeds one dependency edge, the same hook
// ReaderFixture/DependencyEditorFixture take it from (role_fixture_kit's
// shared AddDependency). It exists here only for the ParentID/NoParent
// scope cases (S8): NoParent excludes by PARENT-CHILD EDGE alone
// (sqlbuild/filter.go), unlike ParentID's dotted-id-prefix fallback, so
// pinning it needs a real edge and not just a naming convention.
AddDependency func(context.Context, *types.Dependency, string) error
// List runs the List role's query directly (the store's IssueReader), so
// the storage-level parity cases below (S8 review, follow-up #5) can
// compare Count's answer against len(List's rows) for the same scope
// without going through a second builder. A nil hook skips those cases
// rather than failing: not every backend wiring has a Reader to hand.
List func(context.Context, publicops.ListRequest) (publicops.IssuePage, error)
}
// RunCounterCountsTheDurablePlaneByDefault pins counter.go:123-126 from the
@ -189,323 +176,6 @@ func RunCounterAnUnknownStatusMatchesNothing(t *testing.T, ctx context.Context,
assertCounterTotal(t, ctx, fixture, scope, 0)
}
// RunCounterParentIDScopesToChildren pins CountRequest.ParentID (counter.go,
// S8): restricted to ONE issue's children, reached two ways at once, exactly
// as ListRequest.ParentID is (sqlbuild/filter.go) — a parent-child dependency
// edge, OR (for a row with no such edge) a dotted-id prefix match. The parent
// itself, an unrelated row and a same-prefix DECOY (sibling id with no
// separator, e.g. "parent2") are all seeded so neither arm can pass by
// over-matching.
func RunCounterParentIDScopesToChildren(t *testing.T, ctx context.Context, fixture CounterFixture) {
t.Helper()
parent := fixture.IssuePrefix + "-parentid-parent"
byEdge := fixture.IssuePrefix + "-parentid-byedge"
byDotted := parent + ".1"
decoy := parent + "x"
unrelated := fixture.IssuePrefix + "-parentid-unrelated"
for _, id := range []string{parent, byEdge, byDotted, decoy, unrelated} {
seedCounterIssue(t, ctx, fixture, counterSeed(id))
}
requireCounterAddDependency(t, fixture)
if err := fixture.AddDependency(ctx, &types.Dependency{
IssueID: byEdge, DependsOnID: parent, Type: types.DepParentChild,
}, "seed"); err != nil {
t.Fatalf("seed edge %s -> %s: %v", byEdge, parent, err)
}
scope := counterScope(parent, byEdge, byDotted, decoy, unrelated)
scope.ParentID = parent
// Both children count; the parent, the decoy and the unrelated row do not.
assertCounterTotal(t, ctx, fixture, scope, 2)
}
// RunCounterNoParentExcludesChildren pins CountRequest.NoParent
// (counter.go, S8): restricted to rows with NO parent-child edge.
//
// Unlike ParentID, NoParent's SQL clause (sqlbuild/filter.go) checks ONLY the
// parent-child dependency table, not the dotted-id convention — a row that is
// a dotted-id child with no edge at all still passes NoParent. That asymmetry
// is exactly what the "byDotted" row below pins: it is excluded from
// ParentID's answer by nothing (RunCounterParentIDScopesToChildren already
// admits it), but NoParent admits it too, because it carries no edge.
func RunCounterNoParentExcludesChildren(t *testing.T, ctx context.Context, fixture CounterFixture) {
t.Helper()
parent := fixture.IssuePrefix + "-noparent-parent"
child := fixture.IssuePrefix + "-noparent-child"
byDotted := parent + ".1"
for _, id := range []string{parent, child, byDotted} {
seedCounterIssue(t, ctx, fixture, counterSeed(id))
}
requireCounterAddDependency(t, fixture)
if err := fixture.AddDependency(ctx, &types.Dependency{
IssueID: child, DependsOnID: parent, Type: types.DepParentChild,
}, "seed"); err != nil {
t.Fatalf("seed edge %s -> %s: %v", child, parent, err)
}
scope := counterScope(parent, child, byDotted)
assertCounterTotal(t, ctx, fixture, scope, 3)
scope.NoParent = true
// child is excluded (has an edge); parent and byDotted remain (neither
// carries a parent-child edge, and NoParent does not consult the dotted
// naming convention at all).
assertCounterTotal(t, ctx, fixture, scope, 2)
}
// RunCounterExcludeTypesNarrowsThePredicate pins CountRequest.ExcludeTypes
// (counter.go, S8): named types are excluded from the count, composing with
// (rather than replacing) IncludeInfra's own "gate" exclusion.
func RunCounterExcludeTypesNarrowsThePredicate(t *testing.T, ctx context.Context, fixture CounterFixture) {
t.Helper()
task := fixture.IssuePrefix + "-extype-task"
chore := fixture.IssuePrefix + "-extype-chore"
gate := fixture.IssuePrefix + "-extype-gate"
seedCounterIssue(t, ctx, fixture, counterSeed(task))
choreSeed := counterSeed(chore)
choreSeed.IssueType = types.TypeChore
seedCounterIssue(t, ctx, fixture, choreSeed)
gateSeed := counterSeed(gate)
gateSeed.IssueType = types.IssueType("gate")
seedCounterIssue(t, ctx, fixture, gateSeed)
scope := counterScope(task, chore, gate)
assertCounterTotal(t, ctx, fixture, scope, 3)
scope.ExcludeTypes = []string{"chore"}
assertCounterTotal(t, ctx, fixture, scope, 2)
// Composes with IncludeInfra's own default gate exclusion: both the
// explicit chore exclusion and the include-infra gate exclusion apply at
// once, leaving only task.
scope.IncludeInfra = true
assertCounterTotal(t, ctx, fixture, scope, 1)
}
// RunCounterExcludeStatusNarrowsThePredicate pins CountRequest.ExcludeStatus
// (counter.go, S8): a Count-only field with no List counterpart. Named
// statuses are excluded, and — UNLIKE Status — an unrecognized name is
// refused as ErrValidation rather than excluding nothing, because a typo
// would silently overcount (counter.go).
func RunCounterExcludeStatusNarrowsThePredicate(t *testing.T, ctx context.Context, fixture CounterFixture) {
t.Helper()
open := fixture.IssuePrefix + "-exstatus-open"
closed := fixture.IssuePrefix + "-exstatus-closed"
seedCounterIssue(t, ctx, fixture, counterSeed(open))
closedSeed := counterSeed(closed)
closedSeed.Status = types.StatusClosed
seedCounterIssue(t, ctx, fixture, closedSeed)
scope := counterScope(open, closed)
assertCounterTotal(t, ctx, fixture, scope, 2)
scope.ExcludeStatus = []string{"closed"}
assertCounterTotal(t, ctx, fixture, scope, 1)
// Unlike Status and IssueType, ExcludeStatus IS validated (S8 review,
// follow-up #3): a misspelled entry would silently exclude nothing and
// OVERCOUNT, so an unrecognized name is refused as ErrValidation instead
// of treated as a no-op.
scope.ExcludeStatus = []string{"no-such-status"}
if _, err := fixture.Counter.Count(ctx, scope); !errors.Is(err, publicops.ErrValidation) {
t.Errorf("Count with an unrecognized exclude-status = %v, want ErrValidation", err)
}
}
// requireCounterAddDependency skips a case that needs a real parent-child
// edge when the fixture offers no way to create one, rather than failing with
// a nil-pointer call — mirroring counterHistoryCount's optional-hook pattern.
func requireCounterAddDependency(t *testing.T, fixture CounterFixture) {
t.Helper()
if fixture.AddDependency == nil {
t.Skip("fixture cannot seed a dependency edge: AddDependency is nil")
}
}
// requireCounterList skips a case that needs the List role when the fixture
// offers no way to reach it, mirroring requireCounterAddDependency.
func requireCounterList(t *testing.T, fixture CounterFixture) {
t.Helper()
if fixture.List == nil {
t.Skip("fixture cannot run the List role: List is nil")
}
}
// assertCounterMatchesList compares Count's Total against len(List's rows)
// for the same scope, with List's AllFlag and IncludeAllTypes both set so
// List's own default exclusions (status, pinned, template, gate, infra-plane)
// are lifted exactly as far as Count's own default lifts none of them
// (workapi.BuildCountFilter's doc, count.go) — the one combination that
// makes the two cardinalities comparable at all for an arbitrary scope.
//
// This is a DIFFERENT check than
// TestBuildCountFilterParentFieldsMatchListFilter
// (internal/workapi/count_test.go), which compares the two FILTERS a shared
// request builds without touching a store; this one runs both roles against
// a real backend and compares what they actually return (S8 review, follow-up
// #5).
func assertCounterMatchesList(t *testing.T, ctx context.Context, fixture CounterFixture, idFilter, parentID string, noParent bool, excludeTypes []string) {
t.Helper()
countReq := publicops.CountRequest{
IDFilter: idFilter,
ParentID: parentID,
NoParent: noParent,
ExcludeTypes: excludeTypes,
}
total := counterTotal(t, ctx, fixture, countReq)
listReq := publicops.ListRequest{
IDFilter: idFilter,
ParentID: parentID,
NoParent: noParent,
ExcludeTypes: excludeTypes,
AllFlag: true,
IncludeAllTypes: true,
}
page, err := fixture.List(ctx, listReq)
if err != nil {
t.Fatalf("List(%+v): %v", listReq, err)
}
if got := int64(len(page.Items)); got != total {
t.Errorf("Count(%+v) = %d, len(List(%+v).Items) = %d, want equal", countReq, total, listReq, got)
}
}
// RunCounterParentIDMatchesListCardinality pins the storage-level half of
// CountRequest.ParentID's promise (S8 review, follow-up #5a): for one scope,
// Count's Total equals len(List's rows) for the equivalent ParentID scope.
func RunCounterParentIDMatchesListCardinality(t *testing.T, ctx context.Context, fixture CounterFixture) {
t.Helper()
requireCounterList(t, fixture)
requireCounterAddDependency(t, fixture)
parent := fixture.IssuePrefix + "-parity-parentid-parent"
byEdge := fixture.IssuePrefix + "-parity-parentid-byedge"
byDotted := parent + ".1"
unrelated := fixture.IssuePrefix + "-parity-parentid-unrelated"
for _, id := range []string{parent, byEdge, byDotted, unrelated} {
seedCounterIssue(t, ctx, fixture, counterSeed(id))
}
if err := fixture.AddDependency(ctx, &types.Dependency{
IssueID: byEdge, DependsOnID: parent, Type: types.DepParentChild,
}, "seed"); err != nil {
t.Fatalf("seed edge %s -> %s: %v", byEdge, parent, err)
}
idFilter := counterScope(parent, byEdge, byDotted, unrelated).IDFilter
assertCounterMatchesList(t, ctx, fixture, idFilter, parent, false, nil)
}
// RunCounterNoParentMatchesListCardinality pins the storage-level half of
// CountRequest.NoParent's promise (S8 review, follow-up #5a).
func RunCounterNoParentMatchesListCardinality(t *testing.T, ctx context.Context, fixture CounterFixture) {
t.Helper()
requireCounterList(t, fixture)
requireCounterAddDependency(t, fixture)
parent := fixture.IssuePrefix + "-parity-noparent-parent"
child := fixture.IssuePrefix + "-parity-noparent-child"
byDotted := parent + ".1"
for _, id := range []string{parent, child, byDotted} {
seedCounterIssue(t, ctx, fixture, counterSeed(id))
}
if err := fixture.AddDependency(ctx, &types.Dependency{
IssueID: child, DependsOnID: parent, Type: types.DepParentChild,
}, "seed"); err != nil {
t.Fatalf("seed edge %s -> %s: %v", child, parent, err)
}
idFilter := counterScope(parent, child, byDotted).IDFilter
assertCounterMatchesList(t, ctx, fixture, idFilter, "", true, nil)
}
// RunCounterExcludeTypesMatchesListCardinality pins the storage-level half of
// CountRequest.ExcludeTypes' promise (S8 review, follow-up #5a). ExcludeStatus
// has no List counterpart (counter.go) so it is not part of this parity
// family; RunCounterExcludeStatusNarrowsThePredicate above is its only
// coverage.
func RunCounterExcludeTypesMatchesListCardinality(t *testing.T, ctx context.Context, fixture CounterFixture) {
t.Helper()
requireCounterList(t, fixture)
task := fixture.IssuePrefix + "-parity-extype-task"
chore := fixture.IssuePrefix + "-parity-extype-chore"
seedCounterIssue(t, ctx, fixture, counterSeed(task))
choreSeed := counterSeed(chore)
choreSeed.IssueType = types.TypeChore
seedCounterIssue(t, ctx, fixture, choreSeed)
idFilter := counterScope(task, chore).IDFilter
assertCounterMatchesList(t, ctx, fixture, idFilter, "", false, []string{"chore"})
}
// RunCounterParentIDIncludesAWispChild pins that ParentID's edge match reaches
// into the wisp tier exactly as IncludeInfra's merge does (S8 review,
// follow-up #5b): a child seeded in the ephemeral/wisp tier, linked to its
// parent by the same parent-child edge ParentID matches on, is invisible to
// Count's durable-only default and counted once IncludeInfra merges the wisps
// table in.
func RunCounterParentIDIncludesAWispChild(t *testing.T, ctx context.Context, fixture CounterFixture) {
t.Helper()
requireCounterAddDependency(t, fixture)
parent := fixture.IssuePrefix + "-wispchild-parent"
wispChild := fixture.IssuePrefix + "-wispchild-child"
seedCounterIssue(t, ctx, fixture, counterSeed(parent))
seedCounterWisp(t, ctx, fixture, counterSeed(wispChild))
if err := fixture.AddDependency(ctx, &types.Dependency{
IssueID: wispChild, DependsOnID: parent, Type: types.DepParentChild,
}, "seed"); err != nil {
t.Fatalf("seed edge %s -> %s: %v", wispChild, parent, err)
}
scope := counterScope(parent, wispChild)
scope.ParentID = parent
// Durable-only default (counter.go, RunCounterCountsTheDurablePlaneByDefault):
// the wisp child is invisible without IncludeInfra.
assertCounterTotal(t, ctx, fixture, scope, 0)
scope.IncludeInfra = true
assertCounterTotal(t, ctx, fixture, scope, 1)
}
// RunCounterParentIDAndExcludeStatusComposeOnAClosedChild pins that ParentID
// and ExcludeStatus apply as a conjunction, not alternatives (S8 review,
// follow-up #5b): a closed child under its parent is counted by ParentID
// alone (Count hides nothing by default), and excluded once ExcludeStatus
// names its status, leaving only the open child.
func RunCounterParentIDAndExcludeStatusComposeOnAClosedChild(t *testing.T, ctx context.Context, fixture CounterFixture) {
t.Helper()
requireCounterAddDependency(t, fixture)
parent := fixture.IssuePrefix + "-closedchild-parent"
openChild := fixture.IssuePrefix + "-closedchild-open"
closedChild := fixture.IssuePrefix + "-closedchild-closed"
seedCounterIssue(t, ctx, fixture, counterSeed(parent))
seedCounterIssue(t, ctx, fixture, counterSeed(openChild))
closedSeed := counterSeed(closedChild)
closedSeed.Status = types.StatusClosed
seedCounterIssue(t, ctx, fixture, closedSeed)
for _, child := range []string{openChild, closedChild} {
if err := fixture.AddDependency(ctx, &types.Dependency{
IssueID: child, DependsOnID: parent, Type: types.DepParentChild,
}, "seed"); err != nil {
t.Fatalf("seed edge %s -> %s: %v", child, parent, err)
}
}
scope := counterScope(parent, openChild, closedChild)
scope.ParentID = parent
assertCounterTotal(t, ctx, fixture, scope, 2)
scope.ExcludeStatus = []string{"closed"}
assertCounterTotal(t, ctx, fixture, scope, 1)
}
// RunCounterGroupsPartitionTheScalarSet pins counter.go:168-169 and :244-245
// for a dimension whose buckets do NOT overlap: the grouped Total is the same
// number a scalar Count returns, and the buckets partition it exactly.

View file

@ -1,372 +0,0 @@
package conformance
import (
"context"
"testing"
"time"
)
// This file holds the contract for R16.1 (gastownhall/beads#6133,
// be-hs42e.1 §5-§7, FR-02, FR-03): enforcement that spans more than one
// record, which ExpectedRevisionFixture's per-record CompareAndSetVersion
// structurally cannot see.
//
// GuardedWrite AND ExpectedRevisionFixture.CompareAndSetVersion SHARE THE
// EXACT SAME TYPE, PerRecordCASWrite, declared once in
// expected_revision_contract.go. R16.1-a's boundary claim is literally that
// the second is the first, called twice against records that individually
// pass but jointly violate a store invariant — sharing the type makes that
// claim structural, checked by the compiler, rather than merely asserted in
// a doc comment.
//
// TWO CONCRETE SUBJECTS ARE REQUIRED BY FR-02 RATHER THAN INVENTED HERE:
// Memory key/alias uniqueness (#5877 R2) and graph-edge
// MaximumEndpointMultiplicity. MemoryKeyAliasWrite and GraphEdgeWrite exist
// so the cases named for them construct a REAL joint violation in each
// subject's own vocabulary, rather than a synthetic one this file made up.
//
// EVERY HOOK BELOW IS INDEPENDENTLY NILABLE — see the package-level note in
// expected_revision_contract.go. Every case nil-checks every hook it uses
// and SKIPS BY NAME when one is missing.
// RecordWrite is one record's half of a multi-record write submitted to
// EnforceCrossRecordInvariant.
type RecordWrite struct {
ID string
Expected *Address
Patch map[string]any
}
// InvariantResult is the outcome of a call to EnforceCrossRecordInvariant.
type InvariantResult struct {
Accepted bool
InvariantRefusal *InvariantRefusal
}
// InvariantRefusal names the specific store invariant a multi-record write
// violated (R16.1-c) — never a bare boolean, so a caller (and a test) can
// tell which invariant fired.
type InvariantRefusal struct {
InvariantName string
}
// LeaseHandle is an advisory lease over subject. It is observed by
// convention only (FR-03): holding one does not, by itself, change what any
// per-record or invariant-enforcing write accepts.
type LeaseHandle struct {
Subject string
ExpiresAt time.Time
// Release ends the lease early. A nil Release means the fixture expects
// the lease to simply expire; cases treat a nil Release as optional
// cleanup, not a required call.
Release func(ctx context.Context) error
}
// CrossRecordInvariantFixture supplies the capabilities under test for
// R16.1: enforcement that spans more than one record, and the advisory
// lease primitive FR-03 says is insufficient on its own to provide it.
type CrossRecordInvariantFixture struct {
IssuePrefix string
// GuardedWrite is a per-record CAS write over the SAME type as
// ExpectedRevisionFixture.CompareAndSetVersion (PerRecordCASWrite) — see
// this file's package doc comment for why. A nil hook means this
// backend exposes no per-record guard to construct the boundary case
// against, and cases that need one skip with that reason.
GuardedWrite PerRecordCASWrite
// EnforceCrossRecordInvariant evaluates writes as one joint operation
// and refuses the whole batch, with a named InvariantRefusal, if
// accepting it would violate a store invariant spanning more than one
// of the given records. A nil hook means this backend has not wired
// store-invariant enforcement yet, and cases that need one skip with
// that reason.
EnforceCrossRecordInvariant func(ctx context.Context, writes []RecordWrite) (InvariantResult, error)
// AcquireAdvisoryLease acquires a convention-only lease over subject for
// up to ttl. A nil hook means this backend has no lease primitive to
// test as an insufficient guard, and cases that need one skip with that
// reason.
AcquireAdvisoryLease func(ctx context.Context, subject string, ttl time.Duration) (LeaseHandle, error)
// CountHistoryForSubject reports how many durable history entries exist
// for subject. A nil hook means this backend cannot observe history by
// subject, and cases that need one skip with that reason.
CountHistoryForSubject func(ctx context.Context, subject string) (int, error)
// MemoryKeyAliasWrite writes memoryID's key/alias pair unconditionally,
// in the shape of a per-record write (FR-02's first named subject,
// #5877 R2). A nil hook means this backend exposes no Memory key/alias
// write to probe, and the case that needs it skips with that reason.
MemoryKeyAliasWrite func(ctx context.Context, memoryID, key, alias string) (ExpectedRevisionResult, error)
// GraphEdgeWrite writes a graph edge unconditionally, in the shape of a
// per-record write (FR-02's second named subject,
// MaximumEndpointMultiplicity). A nil hook means this backend exposes no
// graph edge write to probe, and the case that needs it skips with that
// reason.
GraphEdgeWrite func(ctx context.Context, fromID, toID, edgeType string) (ExpectedRevisionResult, error)
}
// RunCrossRecordInvariantSurvivesTwoPassingPerRecordGuards pins R16.1-a's
// boundary claim directly: two writes, each individually valid under
// GuardedWrite (== CompareAndSetVersion), that JOINTLY violate a store
// invariant neither call's own precondition can see. Both must be Accepted
// through GuardedWrite alone — the whole point of R16.1 is that this
// per-record guard cannot catch what only spans records.
func RunCrossRecordInvariantSurvivesTwoPassingPerRecordGuards(t *testing.T, ctx context.Context, fixture CrossRecordInvariantFixture) {
t.Helper()
if fixture.GuardedWrite == nil {
t.Skip("this backend exposes no per-record guard to construct the boundary case against (GuardedWrite is nil)")
}
shared := fixture.IssuePrefix + "-crossrec-shared-alias"
first, err := fixture.GuardedWrite(ctx, fixture.IssuePrefix+"-crossrec-a", nil, map[string]any{"alias": shared})
if err != nil {
t.Fatalf("GuardedWrite(a): %v", err)
}
if !first.Accepted {
t.Fatalf("GuardedWrite(a) claiming alias %q was refused (Refusal=%+v), want Accepted: a per-record guard cannot see a joint violation", shared, first.Refusal)
}
second, err := fixture.GuardedWrite(ctx, fixture.IssuePrefix+"-crossrec-b", nil, map[string]any{"alias": shared})
if err != nil {
t.Fatalf("GuardedWrite(b): %v", err)
}
if !second.Accepted {
t.Fatalf("GuardedWrite(b) claiming the SAME alias %q was refused (Refusal=%+v), want Accepted (R16.1-a: per-record CAS structurally cannot catch a cross-record conflict)", shared, second.Refusal)
}
}
// RunStoreInvariantTransactionScopesExactlyTheSpanningRecords pins R16.1-b:
// EnforceCrossRecordInvariant refuses a batch that jointly violates an
// invariant, and — checked against an unrelated, non-conflicting write in
// the same call shape — must not refuse more broadly than the records that
// actually span the violation.
func RunStoreInvariantTransactionScopesExactlyTheSpanningRecords(t *testing.T, ctx context.Context, fixture CrossRecordInvariantFixture) {
t.Helper()
if fixture.EnforceCrossRecordInvariant == nil {
t.Skip("this backend has not wired store-invariant enforcement yet (EnforceCrossRecordInvariant is nil)")
}
shared := fixture.IssuePrefix + "-crossrec-scope-alias"
spanning := []RecordWrite{
{ID: fixture.IssuePrefix + "-crossrec-scope-a", Patch: map[string]any{"alias": shared}},
{ID: fixture.IssuePrefix + "-crossrec-scope-b", Patch: map[string]any{"alias": shared}},
}
var beforeA, beforeB int
if fixture.CountHistoryForSubject != nil {
var err error
beforeA, err = fixture.CountHistoryForSubject(ctx, spanning[0].ID)
if err != nil {
t.Fatalf("CountHistoryForSubject(%s) before the refused batch: %v", spanning[0].ID, err)
}
beforeB, err = fixture.CountHistoryForSubject(ctx, spanning[1].ID)
if err != nil {
t.Fatalf("CountHistoryForSubject(%s) before the refused batch: %v", spanning[1].ID, err)
}
} else {
t.Logf("this backend cannot observe history by subject (CountHistoryForSubject is nil): the before-batch history counts for %s and %s go uncaptured", spanning[0].ID, spanning[1].ID)
}
result, err := fixture.EnforceCrossRecordInvariant(ctx, spanning)
if err != nil {
t.Fatalf("EnforceCrossRecordInvariant(spanning): %v", err)
}
if result.Accepted {
t.Fatal("EnforceCrossRecordInvariant accepted two writes that jointly violate the shared-alias invariant")
}
if fixture.CountHistoryForSubject != nil {
afterA, err := fixture.CountHistoryForSubject(ctx, spanning[0].ID)
if err != nil {
t.Fatalf("CountHistoryForSubject(%s) after the refused batch: %v", spanning[0].ID, err)
}
afterB, err := fixture.CountHistoryForSubject(ctx, spanning[1].ID)
if err != nil {
t.Fatalf("CountHistoryForSubject(%s) after the refused batch: %v", spanning[1].ID, err)
}
if afterA != beforeA || afterB != beforeB {
t.Errorf("a refused batch left a trace: history count for %s went %d->%d, for %s went %d->%d; a refusal must be atomic — the whole batch takes no effect, not just the record that individually triggered it", spanning[0].ID, beforeA, afterA, spanning[1].ID, beforeB, afterB)
}
} else {
t.Logf("this backend cannot observe history by subject (CountHistoryForSubject is nil): the refused batch's atomicity (no partial trace left behind for %s or %s) goes unverified", spanning[0].ID, spanning[1].ID)
}
unrelated := []RecordWrite{
{ID: fixture.IssuePrefix + "-crossrec-scope-unrelated", Patch: map[string]any{"alias": fixture.IssuePrefix + "-crossrec-scope-unrelated-alias"}},
}
independent, err := fixture.EnforceCrossRecordInvariant(ctx, unrelated)
if err != nil {
t.Fatalf("EnforceCrossRecordInvariant(unrelated): %v", err)
}
if !independent.Accepted {
t.Fatalf("EnforceCrossRecordInvariant refused an unrelated, non-conflicting write (InvariantRefusal=%+v); the invariant transaction must scope exactly the spanning records, not more", independent.InvariantRefusal)
}
}
// RunInvariantRefusalNamesTheViolatedInvariant pins R16.1-c: a refused batch
// carries an InvariantRefusal naming the specific invariant that fired, not
// a bare boolean.
func RunInvariantRefusalNamesTheViolatedInvariant(t *testing.T, ctx context.Context, fixture CrossRecordInvariantFixture) {
t.Helper()
if fixture.EnforceCrossRecordInvariant == nil {
t.Skip("this backend has not wired store-invariant enforcement yet (EnforceCrossRecordInvariant is nil)")
}
shared := fixture.IssuePrefix + "-crossrec-named-alias"
result, err := fixture.EnforceCrossRecordInvariant(ctx, []RecordWrite{
{ID: fixture.IssuePrefix + "-crossrec-named-a", Patch: map[string]any{"alias": shared}},
{ID: fixture.IssuePrefix + "-crossrec-named-b", Patch: map[string]any{"alias": shared}},
})
if err != nil {
t.Fatalf("EnforceCrossRecordInvariant: %v", err)
}
if result.Accepted {
t.Fatal("EnforceCrossRecordInvariant accepted a joint violation; cannot check the refusal's InvariantName")
}
if result.InvariantRefusal == nil {
t.Fatal("InvariantRefusal = nil on a non-accepted result")
}
if result.InvariantRefusal.InvariantName == "" {
t.Error("InvariantRefusal.InvariantName is empty, want a specific invariant name (R16.1-c)")
}
}
// RunMemoryKeyAliasUniquenessIsAStoreInvariantNotACAS pins FR-02's first
// required subject: Memory key/alias uniqueness (#5877 R2) is a STORE
// invariant, not row-level CAS, so two memories independently claiming the
// same alias each succeed when checked one at a time through a
// per-record-shaped call.
func RunMemoryKeyAliasUniquenessIsAStoreInvariantNotACAS(t *testing.T, ctx context.Context, fixture CrossRecordInvariantFixture) {
t.Helper()
if fixture.MemoryKeyAliasWrite == nil {
t.Skip("this backend exposes no Memory key/alias write to probe (MemoryKeyAliasWrite is nil)")
}
alias := fixture.IssuePrefix + "-crossrec-memalias"
first, err := fixture.MemoryKeyAliasWrite(ctx, fixture.IssuePrefix+"-crossrec-mem-a", "key-a", alias)
if err != nil {
t.Fatalf("MemoryKeyAliasWrite(a): %v", err)
}
if !first.Accepted {
t.Fatalf("MemoryKeyAliasWrite(a) was refused (Refusal=%+v), want Accepted", first.Refusal)
}
second, err := fixture.MemoryKeyAliasWrite(ctx, fixture.IssuePrefix+"-crossrec-mem-b", "key-b", alias)
if err != nil {
t.Fatalf("MemoryKeyAliasWrite(b): %v", err)
}
if !second.Accepted {
t.Fatalf("MemoryKeyAliasWrite(b) claiming the SAME alias %q was refused (Refusal=%+v); alias uniqueness (#5877 R2) is a store invariant, so a per-record write cannot enforce it and must be Accepted here", alias, second.Refusal)
}
}
// RunMaximumEndpointMultiplicityIsAStoreInvariantNotACAS pins FR-02's second
// required subject: MaximumEndpointMultiplicity is a STORE invariant, not
// row-level CAS, so two edges independently claiming the same endpoint each
// succeed when checked one at a time through a per-record-shaped call.
func RunMaximumEndpointMultiplicityIsAStoreInvariantNotACAS(t *testing.T, ctx context.Context, fixture CrossRecordInvariantFixture) {
t.Helper()
if fixture.GraphEdgeWrite == nil {
t.Skip("this backend exposes no graph edge write to probe (GraphEdgeWrite is nil)")
}
from := fixture.IssuePrefix + "-crossrec-edge-from"
first, err := fixture.GraphEdgeWrite(ctx, from, fixture.IssuePrefix+"-crossrec-edge-to-a", "depends-on")
if err != nil {
t.Fatalf("GraphEdgeWrite(a): %v", err)
}
if !first.Accepted {
t.Fatalf("GraphEdgeWrite(a) was refused (Refusal=%+v), want Accepted", first.Refusal)
}
second, err := fixture.GraphEdgeWrite(ctx, from, fixture.IssuePrefix+"-crossrec-edge-to-b", "depends-on")
if err != nil {
t.Fatalf("GraphEdgeWrite(b): %v", err)
}
if !second.Accepted {
t.Fatalf("GraphEdgeWrite(b) from the SAME endpoint %q was refused (Refusal=%+v); MaximumEndpointMultiplicity is a store invariant, so a per-record write cannot enforce it and must be Accepted here", from, second.Refusal)
}
}
// RunAdvisoryLeaseAloneDoesNotPreventTheInvariantViolation pins FR-03's
// negative case: an advisory lease is observed BY CONVENTION ONLY, so
// holding one over the shared subject does not, by itself, stop the same
// per-record violation RunCrossRecordInvariantSurvivesTwoPassingPerRecordGuards
// constructs.
func RunAdvisoryLeaseAloneDoesNotPreventTheInvariantViolation(t *testing.T, ctx context.Context, fixture CrossRecordInvariantFixture) {
t.Helper()
if fixture.AcquireAdvisoryLease == nil {
t.Skip("this backend has no lease primitive to test as an insufficient guard (AcquireAdvisoryLease is nil)")
}
if fixture.GuardedWrite == nil {
t.Skip("this backend exposes no per-record guard to construct the boundary case against (GuardedWrite is nil)")
}
shared := fixture.IssuePrefix + "-crossrec-leased-alias"
crossRecordInvariantAcquireLease(t, ctx, fixture, shared, time.Minute)
first, err := fixture.GuardedWrite(ctx, fixture.IssuePrefix+"-crossrec-leased-a", nil, map[string]any{"alias": shared})
if err != nil {
t.Fatalf("GuardedWrite(a) under a held lease: %v", err)
}
second, err := fixture.GuardedWrite(ctx, fixture.IssuePrefix+"-crossrec-leased-b", nil, map[string]any{"alias": shared})
if err != nil {
t.Fatalf("GuardedWrite(b) under a held lease: %v", err)
}
if !first.Accepted || !second.Accepted {
t.Fatalf("holding an advisory lease changed a per-record GuardedWrite's own verdict (first.Accepted=%v second.Accepted=%v); the lease is observed by convention only and GuardedWrite must not consult it (FR-03)", first.Accepted, second.Accepted)
}
}
// RunLeaseAcquisitionRecordsNoHistoryEntry mirrors
// RunMetadataCASAWispSwapRecordsNoDurableHistory's delta-around-the-call
// shape (metadata_cas_contract.go, history_matching.go): acquiring an
// advisory lease is bookkeeping, not a durable state change, so it must
// record no history entry for its subject.
func RunLeaseAcquisitionRecordsNoHistoryEntry(t *testing.T, ctx context.Context, fixture CrossRecordInvariantFixture) {
t.Helper()
if fixture.AcquireAdvisoryLease == nil {
t.Skip("this backend has no lease primitive to test (AcquireAdvisoryLease is nil)")
}
if fixture.CountHistoryForSubject == nil {
t.Skip("this backend cannot observe history by subject (CountHistoryForSubject is nil)")
}
subject := fixture.IssuePrefix + "-crossrec-lease-history"
before, err := fixture.CountHistoryForSubject(ctx, subject)
if err != nil {
t.Fatalf("CountHistoryForSubject(before): %v", err)
}
crossRecordInvariantAcquireLease(t, ctx, fixture, subject, time.Minute)
after, err := fixture.CountHistoryForSubject(ctx, subject)
if err != nil {
t.Fatalf("CountHistoryForSubject(after): %v", err)
}
if got := after - before; got != 0 {
t.Errorf("acquiring an advisory lease recorded %d history entries for %q, want none", got, subject)
}
}
// --- fixture helpers -------------------------------------------------------
// crossRecordInvariantAcquireLease acquires an advisory lease and registers
// its Release (when the fixture provides one) as a test cleanup, so a case
// does not have to thread a defer through its own body. No caller needs the
// handle itself — both cases only need a lease held over the subject — so
// this does not return one.
func crossRecordInvariantAcquireLease(t *testing.T, ctx context.Context, fixture CrossRecordInvariantFixture, subject string, ttl time.Duration) {
t.Helper()
lease, err := fixture.AcquireAdvisoryLease(ctx, subject, ttl)
if err != nil {
t.Fatalf("AcquireAdvisoryLease(%s): %v", subject, err)
}
if lease.Release != nil {
t.Cleanup(func() {
if err := lease.Release(ctx); err != nil {
t.Errorf("releasing the advisory lease on %q: %v", subject, err)
}
})
}
}

View file

@ -75,11 +75,11 @@ type SQLStatement struct {
Args []any
}
// RunCycleDetectorReportsNoCycleForAnAcyclicSubgraph pins cycledetector.go:171
// RunCycleDetectorReportsNoCycleForAnAcyclicSubgraph pins cycledetector.go:135
// from the empty side: an acyclic graph is an empty report and a nil error,
// with no ErrNotFound to classify. The nil-slice half IS asserted globally —
// that one is a property of the answer, not of the workspace
// (cycledetector.go:108).
// (cycledetector.go:78).
func RunCycleDetectorReportsNoCycleForAnAcyclicSubgraph(t *testing.T, ctx context.Context, fixture CycleDetectorFixture) {
t.Helper()
first := fixture.IssuePrefix + "-acyclic-a"
@ -98,10 +98,10 @@ func RunCycleDetectorReportsNoCycleForAnAcyclicSubgraph(t *testing.T, ctx contex
}
// RunCycleDetectorFindsADurableCycleRotatedToItsLowestID pins the shape of a
// found cycle: members in EDGE ORDER (cycledetector.go:78-80), rotated so the
// lowest id comes first (cycledetector.go:82-88), the closing edge implied
// found cycle: members in EDGE ORDER (cycledetector.go:48-50), rotated so the
// lowest id comes first (cycledetector.go:52-58), the closing edge implied
// rather than repeated, and Partial false when every member was described
// (cycledetector.go:93).
// (cycledetector.go:63).
//
// The three ids are seeded so that the edge order and the sorted order are NOT
// the same sequence, which is what makes the rotation assertion say something.
@ -138,8 +138,8 @@ func RunCycleDetectorFindsADurableCycleRotatedToItsLowestID(t *testing.T, ctx co
}
}
// RunCycleDetectorReportsTheSameCyclesEveryRun pins cycledetector.go:82-88 and
// :126-127: two calls against an unchanged database must agree, id for id and
// RunCycleDetectorReportsTheSameCyclesEveryRun pins cycledetector.go:52-58 and
// :91-92: two calls against an unchanged database must agree, id for id and
// cycle for cycle.
//
// It compares the WHOLE report rather than the case's own cycle: the walk used
@ -175,7 +175,7 @@ func RunCycleDetectorReportsTheSameCyclesEveryRun(t *testing.T, ctx context.Cont
}
// RunCycleDetectorMergesTheDurableAndEphemeralPlanes pins
// cycledetector.go:156-158: the two dependency planes are one graph, so a cycle
// cycledetector.go:120-122: the two dependency planes are one graph, so a cycle
// that runs issue → wisp → issue is found. This is the clause a single-table
// read passes every other case and fails here.
func RunCycleDetectorMergesTheDurableAndEphemeralPlanes(t *testing.T, ctx context.Context, fixture CycleDetectorFixture) {
@ -198,12 +198,10 @@ func RunCycleDetectorMergesTheDurableAndEphemeralPlanes(t *testing.T, ctx contex
}
}
// RunCycleDetectorFollowsOnlyBlockingEdges pins cycledetector.go:145-154: the
// RunCycleDetectorFollowsOnlyBlockingEdges pins cycledetector.go:110-119: the
// walk follows `blocks` and `conditional-blocks`, and nothing else — not
// `waits-for`, whose gate semantics make a mutual wait legitimate, not
// `parent-child`, which the ADD-time gate does walk, and not `tracks`, on the
// DEFAULT (zero-value) request. IncludeTracks's own widened walk is pinned
// separately by RunCycleDetectorIncludeTracks*, below.
// `waits-for`, whose gate semantics make a mutual wait legitimate, and not
// `parent-child`, which the ADD-time gate does walk.
//
// The conditional-blocks half is asserted in the same case as the exclusions on
// purpose: a body narrowed to `blocks` alone would pass an exclusion-only case,
@ -219,7 +217,6 @@ func RunCycleDetectorFollowsOnlyBlockingEdges(t *testing.T, ctx context.Context,
{types.DepWaitsFor, "wait", false},
{types.DepParentChild, "kid", false},
{types.DepRelated, "rel", false},
{types.DepTracks, "trk", false},
} {
first := fmt.Sprintf("%s-edge-%s-a", fixture.IssuePrefix, test.slug)
second := fmt.Sprintf("%s-edge-%s-b", fixture.IssuePrefix, test.slug)
@ -239,87 +236,8 @@ func RunCycleDetectorFollowsOnlyBlockingEdges(t *testing.T, ctx context.Context,
}
}
// RunCycleDetectorIncludeTracksIgnoresAPureTracksLoop pins
// DetectCyclesRequest.IncludeTracks's own guard: widening the walk to `tracks`
// must not resurrect the PR #4933 false-positive shape, where ordinary
// convoy/tracking topology with no scheduling edge at all got reported as a
// cycle. A loop made entirely of `tracks` edges stays silent even with
// IncludeTracks set.
func RunCycleDetectorIncludeTracksIgnoresAPureTracksLoop(t *testing.T, ctx context.Context, fixture CycleDetectorFixture) {
t.Helper()
first := fixture.IssuePrefix + "-trkloop-a"
second := fixture.IssuePrefix + "-trkloop-b"
seedCycleDetectorIssue(t, ctx, fixture, first)
seedCycleDetectorIssue(t, ctx, fixture, second)
seedCycleDetectorEdges(t, ctx, fixture, false,
cycleDetectorEdge{Source: first, Target: second, Type: types.DepTracks},
cycleDetectorEdge{Source: second, Target: first, Type: types.DepTracks})
report := cycleDetectorReportIncludingTracks(t, ctx, fixture)
if found := cycleDetectorTouching(report, first, second); len(found) > 0 {
t.Errorf("a mutual tracks-only pair produced %v under IncludeTracks, want none: a cycle needs at least one scheduling edge", found)
}
}
// RunCycleDetectorIncludeTracksFindsTheMoleculeRootShape pins the gc-818bx
// deadlock this option exists to surface: a molecule root that
// blocks-depends on its own entry step, which tracks-depends back to the
// root. Neither edge alone is a cycle; the shape only closes across both edge
// types, which is exactly what the default (blocks-only) walk cannot see.
func RunCycleDetectorIncludeTracksFindsTheMoleculeRootShape(t *testing.T, ctx context.Context, fixture CycleDetectorFixture) {
t.Helper()
root := fixture.IssuePrefix + "-molroot"
step := fixture.IssuePrefix + "-molstep"
seedCycleDetectorIssue(t, ctx, fixture, root)
seedCycleDetectorIssue(t, ctx, fixture, step)
seedCycleDetectorEdges(t, ctx, fixture, false,
cycleDetectorEdge{Source: root, Target: step, Type: types.DepBlocks},
cycleDetectorEdge{Source: step, Target: root, Type: types.DepTracks})
// The default request must still see nothing: the closing edge is a
// tracks edge, outside the base walk.
if found := cycleDetectorTouching(cycleDetectorReport(t, ctx, fixture), root, step); len(found) > 0 {
t.Errorf("the default request reported %v; IncludeTracks defaults to false and must leave the base walk unchanged", found)
}
cycle := cycleDetectorFind(t, cycleDetectorReportIncludingTracks(t, ctx, fixture), root, step)
assertCycleDetectorPath(t, cycle, root, step)
}
// RunCycleDetectorIncludeTracksWalksEachEdgeInItsStoredDirection pins the
// direction of the widened graph, which the two-node cases above cannot: a
// two-node cycle reads the same reversed once it is rotated to its lowest id.
// This loop has three nodes in edge order a, c, b. Reversed it is a, b, c, the
// same member set in the other order, so a graph builder that stored
// depends_on_id -> issue_id would still find exactly one cycle here and fail
// only on the path.
//
// The blocks edge sits in the middle of the loop and the closing edges are
// tracks, so the default request must see nothing.
func RunCycleDetectorIncludeTracksWalksEachEdgeInItsStoredDirection(t *testing.T, ctx context.Context, fixture CycleDetectorFixture) {
t.Helper()
a := fixture.IssuePrefix + "-trkdir-a"
b := fixture.IssuePrefix + "-trkdir-b"
c := fixture.IssuePrefix + "-trkdir-c"
for _, id := range []string{a, b, c} {
seedCycleDetectorIssue(t, ctx, fixture, id)
}
// a -> c -> b -> a.
seedCycleDetectorEdges(t, ctx, fixture, false,
cycleDetectorEdge{Source: a, Target: c, Type: types.DepTracks},
cycleDetectorEdge{Source: c, Target: b, Type: types.DepBlocks},
cycleDetectorEdge{Source: b, Target: a, Type: types.DepTracks})
if found := cycleDetectorTouching(cycleDetectorReport(t, ctx, fixture), a, b, c); len(found) > 0 {
t.Errorf("the default request reported %v; two of the three edges are tracks, outside the base walk", found)
}
cycle := cycleDetectorFind(t, cycleDetectorReportIncludingTracks(t, ctx, fixture), a, b, c)
assertCycleDetectorPath(t, cycle, a, c, b)
}
// RunCycleDetectorReportsAnHonestPartial pins cycledetector.go:176-180 and
// :54-63 against real storage: a member the database cannot describe keeps its
// RunCycleDetectorReportsAnHonestPartial pins cycledetector.go:140-144 and
// :24-33 against real storage: a member the database cannot describe keeps its
// place on the path, carries no issue, and marks the cycle. The previous body
// dropped the member, so this three-node cycle came back as a TWO-node cycle and
// looked complete.
@ -354,7 +272,7 @@ func RunCycleDetectorReportsAnHonestPartial(t *testing.T, ctx context.Context, f
}
}
// RunCycleDetectorCountsAWhollyUndescribableCycle pins cycledetector.go:111-115:
// RunCycleDetectorCountsAWhollyUndescribableCycle pins cycledetector.go:81-85:
// a cycle no member of which can be described is still IN the report, so the
// count cannot shrink because rows went missing. Under the previous body this
// cycle produced nothing at all, so `bd dep cycles` printed a smaller number and
@ -379,7 +297,7 @@ func RunCycleDetectorCountsAWhollyUndescribableCycle(t *testing.T, ctx context.C
}
}
// RunCycleDetectorWritesNothing pins cycledetector.go:166-167: detecting is a
// RunCycleDetectorWritesNothing pins cycledetector.go:130-131: detecting is a
// read. It is asserted on the history log rather than on a row read-back
// because every versioned unit of work in this tree ends in a Dolt commit, so a
// sweep that took a write transaction would show up here even when it changed
@ -515,17 +433,6 @@ func cycleDetectorReport(t *testing.T, ctx context.Context, fixture CycleDetecto
return report
}
// cycleDetectorReportIncludingTracks is cycleDetectorReport with
// IncludeTracks set, for the cases pinning that option's own widened walk.
func cycleDetectorReportIncludingTracks(t *testing.T, ctx context.Context, fixture CycleDetectorFixture) publicops.CycleReport {
t.Helper()
report, err := fixture.Detector.DetectCycles(ctx, publicops.DetectCyclesRequest{IncludeTracks: true})
if err != nil {
t.Fatalf("DetectCycles: %v", err)
}
return report
}
// cycleDetectorPaths renders a report as id paths, which is what the
// determinism case compares.
func cycleDetectorPaths(report publicops.CycleReport) [][]string {

View file

@ -2,12 +2,10 @@ package conformance
import (
"context"
"encoding/json"
"errors"
"fmt"
"testing"
storeops "github.com/steveyegge/beads/internal/storage/issueops"
"github.com/steveyegge/beads/internal/types"
publicops "github.com/steveyegge/beads/issueops"
)
@ -62,33 +60,6 @@ type DependencyEditorFixture struct {
// the cases that need it then skip with that reason rather than pass
// quietly. It is non-nil on all three backends today.
CountHistory func(context.Context) (int, error)
// SetJournalEnabled turns on durable journaling for the workspace under
// test (storage.EventsJournalConfigurer) — the same operator switch
// JournalFixture.SetJournalEnabled wires, and off by default for the same
// reason: a workspace that never opted in records nothing in
// bd_events_journal while every other write still succeeds normally.
//
// The idempotency cases need it on because bd_events_journal has no
// deduplication of its own (issueops.RecordDepEventInTx always inserts):
// a same-type re-add or an absent removal is a no-op only if nothing
// downstream of the role recorded a change, and the journal is the one
// place that is not otherwise observable through this fixture. It is
// non-nil on all three backends.
SetJournalEnabled func(enabled bool)
// SetVersionedHistoryEnabled turns on dual-write issue-version history
// (storage.VersionedHistoryConfigurer) — off by default for the same
// reason SetJournalEnabled is.
//
// It exists for one case: the metadata-changed re-add, which can only be
// driven through AddDependency (the role's own request type carries no
// metadata). That hook writes through the backend's raw store path rather
// than the role's transaction wrapper, and on at least one backend only
// the latter issues the underlying VCS commit CountHistory observes — so
// a case reached through AddDependency cannot tell a mint happened by
// watching CountHistory the way the role-driven history cases do. It has
// to read issue_versions directly instead, which only advances when this
// switch is on. It is non-nil on all three backends.
SetVersionedHistoryEnabled func(enabled bool)
}
// RunDependencyEditorRoutesWispSourcedEdgeToTheWispPlane is the regression pin
@ -281,18 +252,8 @@ func RunDependencyEditorAddedEchoesTheRequestOrder(t *testing.T, ctx context.Con
// promises a dependency_added entry for a GENUINELY NEW edge, so a backend
// that re-emitted on the no-op would leave a history of work that did not
// happen even where the row count could not tell.
//
// bd_events_journal is the fourth, and the one none of the others catch:
// unlike the events table it has no deduplication of its own
// (issueops.RecordDepEventInTx always inserts), so a same-type re-add that
// gates on TYPE alone — never the stored metadata VALUE — journals a change
// that never happened even while the row count, the events table and the
// history delta all read as a clean no-op. This is #5898's R3 case: a
// change-free write must create no version and must not journal one either.
func RunDependencyEditorSameTypeReAddIsIdempotent(t *testing.T, ctx context.Context, fixture DependencyEditorFixture) {
t.Helper()
fixture.SetJournalEnabled(true)
t.Cleanup(func() { fixture.SetJournalEnabled(false) })
source := fixture.IssuePrefix + "-idem-source"
target := fixture.IssuePrefix + "-idem-target"
seedDependencyEditorIssue(t, ctx, fixture, source)
@ -306,7 +267,6 @@ func RunDependencyEditorSameTypeReAddIsIdempotent(t *testing.T, ctx context.Cont
t.Fatalf("AddDependencies first: %v", err)
}
assertDependencyEditorEventCount(t, ctx, fixture, "events", source, types.EventDependencyAdded, 1)
assertDependencyEditorJournalCountIsOne(t, ctx, fixture, source, string(storeops.EventDepAdd))
assertHistoryDelta := dependencyEditorHistoryProbe(t, ctx, fixture)
result, err := fixture.Editor.AddDependencies(ctx, request)
@ -319,308 +279,9 @@ func RunDependencyEditorSameTypeReAddIsIdempotent(t *testing.T, ctx context.Cont
assertDependencyEditorOutgoingCount(t, ctx, fixture, "dependencies", source, 1)
assertDependencyEdgeTypedCount(t, ctx, fixture, "dependencies", source, target, string(publicops.DepBlocks), 1)
assertDependencyEditorEventCount(t, ctx, fixture, "events", source, types.EventDependencyAdded, 1)
assertDependencyEditorJournalCountIsOne(t, ctx, fixture, source, string(storeops.EventDepAdd))
assertHistoryDelta(0, "every edge of the request already existed with the requested type, so nothing was written and nothing is versioned")
}
// RunDependencyEditorSameTypeReAddWithChangedMetadataMintsOneVersion pins the
// other half of the same-type re-add clause from
// RunDependencyEditorSameTypeReAddIsIdempotent: same TYPE is not the whole
// idempotency test, because the row also carries metadata, and a re-add that
// changes it is a real mutation of the source issue rather than a no-op that
// happens to share a type. The leaf updates the stored metadata and mints
// EXACTLY ONE version carrying the new state — the same terms as a genuinely
// new edge — because from the source issue's point of view a metadata change
// is as real as the edge appearing in the first place (#5898 leg 2).
//
// It drives the re-add through fixture.AddDependency rather than
// fixture.Editor.AddDependencies because publicops.DependencyEdge carries no
// metadata for the role API to change — the same reason
// RunDependencyEditorClosedChildAddSatisfiesAnAnyChildrenGate reaches past
// the role for a waits-for gate.
//
// bd_events_journal is asserted at TWO, not one: unlike the change-free
// re-add, this path still calls issueops.RecordDepEventInTx — dependencies.go
// calls it "an observable graph mutation" and journals the complete
// replacement edge for replay — so the second write adds its own journal
// entry even though it adds no second row to "dependencies" and no second
// dependency_added row to "events", because those two describe the STORED
// ROW and the AUDIT TRAIL, neither of which duplicates on a metadata-only
// change.
func RunDependencyEditorSameTypeReAddWithChangedMetadataMintsOneVersion(t *testing.T, ctx context.Context, fixture DependencyEditorFixture) {
t.Helper()
if fixture.AddDependency == nil {
t.Skip("fixture has no AddDependency hook: metadata is not settable through publicops.DependencyEdge")
}
fixture.SetJournalEnabled(true)
t.Cleanup(func() { fixture.SetJournalEnabled(false) })
fixture.SetVersionedHistoryEnabled(true)
t.Cleanup(func() { fixture.SetVersionedHistoryEnabled(false) })
source := fixture.IssuePrefix + "-idemmeta-source"
target := fixture.IssuePrefix + "-idemmeta-target"
seedDependencyEditorIssue(t, ctx, fixture, source)
seedDependencyEditorIssue(t, ctx, fixture, target)
first := &types.Dependency{IssueID: source, DependsOnID: target, Type: types.DepBlocks, Metadata: `{"note":"v1"}`}
if err := fixture.AddDependency(ctx, first, "writer"); err != nil {
t.Fatalf("AddDependency first: %v", err)
}
assertDependencyEditorOutgoingCount(t, ctx, fixture, "dependencies", source, 1)
assertDependencyEdgeTypedCount(t, ctx, fixture, "dependencies", source, target, string(types.DepBlocks), 1)
assertDependencyEditorEventCount(t, ctx, fixture, "events", source, types.EventDependencyAdded, 1)
assertDependencyEditorJournalCountIsOne(t, ctx, fixture, source, string(storeops.EventDepAdd))
versionsBefore := countDependencyEditorIssueVersions(t, ctx, fixture, source)
second := &types.Dependency{IssueID: source, DependsOnID: target, Type: types.DepBlocks, Metadata: `{"note":"v2"}`}
if err := fixture.AddDependency(ctx, second, "writer"); err != nil {
t.Fatalf("re-adding the same edge with changed metadata refused: %v", err)
}
assertDependencyEditorOutgoingCount(t, ctx, fixture, "dependencies", source, 1)
assertDependencyEdgeTypedCount(t, ctx, fixture, "dependencies", source, target, string(types.DepBlocks), 1)
assertDependencyEditorEventCount(t, ctx, fixture, "events", source, types.EventDependencyAdded, 1)
var journalCount int
if err := fixture.QueryScalar(ctx,
"SELECT COUNT(*) FROM bd_events_journal WHERE issue_id = ? AND op = ?",
[]any{source, string(storeops.EventDepAdd)}, &journalCount); err != nil {
t.Fatalf("count bd_events_journal dep_add rows for %s: %v", source, err)
}
if journalCount != 2 {
t.Errorf("bd_events_journal dep_add rows for %s = %d, want 2: the metadata-changed re-add must journal its own replacement-edge entry", source, journalCount)
}
var storedMetadata string
if err := fixture.QueryScalar(ctx,
"SELECT metadata FROM dependencies WHERE issue_id = ? AND COALESCE(depends_on_issue_id, depends_on_wisp_id, depends_on_external) = ?",
[]any{source, target}, &storedMetadata); err != nil {
t.Fatalf("read stored metadata for %s -> %s: %v", source, target, err)
}
// Compared after re-encoding rather than byte-for-byte: a native JSON
// column is free to re-canonicalize what it stores (e.g. inserting the
// space after ':' Dolt's does), and that is not the thing this case is
// about. canonicalizeForContract has no numeric blind spot here because
// this fixture's metadata values never carry a bare JSON number.
storedCanon, err := canonicalizeForContract(json.RawMessage(storedMetadata))
if err != nil {
t.Fatalf("canonicalize stored metadata for %s -> %s: %v", source, target, err)
}
wantCanon, err := canonicalizeForContract(json.RawMessage(second.Metadata))
if err != nil {
t.Fatalf("canonicalize want metadata for %s -> %s: %v", source, target, err)
}
if storedCanon != wantCanon {
t.Errorf("stored metadata = %s, want %s: the re-add must persist the NEW metadata, not keep the old", storedCanon, wantCanon)
}
// Not dependencyEditorHistoryProbe/CountHistory: AddDependency seeds this
// edge out of band of the role, through the backend's raw store path, and
// on at least one backend that path never issues the version-control
// commit CountHistory counts — only the role's own transaction wrapper
// does. issue_versions is the seam both paths mint through, so it is the
// one signal that is meaningful for a write reached this way.
if delta := countDependencyEditorIssueVersions(t, ctx, fixture, source) - versionsBefore; delta != 1 {
t.Errorf("issue_versions rows for %s went %d -> %d (delta %d), want a delta of 1: the metadata genuinely changed, so the re-add is a real mutation of the source issue and must mint exactly one version (#5898 leg 2)", source, versionsBefore, versionsBefore+delta, delta)
}
}
// countDependencyEditorIssueVersions reports how many issue_versions rows
// exist for the given issue. Shared by every case here that asserts a
// version DELTA rather than an absolute count: the fixture's issues accrue
// versions from more than this one seam, so the relative change across an
// operation is the only thing a case can rely on.
func countDependencyEditorIssueVersions(t *testing.T, ctx context.Context, fixture DependencyEditorFixture, id string) int {
t.Helper()
var count int
if err := fixture.QueryScalar(ctx, "SELECT COUNT(*) FROM issue_versions WHERE issue_id = ?", []any{id}, &count); err != nil {
t.Fatalf("count issue_versions rows for %s: %v", id, err)
}
return count
}
// RunDependencyEditorSameTypeReAddWithIdenticalMetadataIsANoOp pins the leg of
// the same-type re-add clause that
// RunDependencyEditorSameTypeReAddWithChangedMetadataMintsOneVersion
// deliberately does not cover: metadata that is byte-different but
// SEMANTICALLY IDENTICAL to what is already stored. A native JSON column is
// free to re-canonicalize what it persists — Dolt's inserts a space after
// ':', sorts object keys, and narrows a bare integral float to an int — so a
// comparison written against the raw bytes the caller last sent, rather than
// a canonical form of what is actually stored, reports a change that never
// happened and mints a version for a write that changed nothing (#6650).
//
// Two sub-cases pin the two distinct ways "byte-different" can still mean
// "the same value", using the same real-world shape
// (internal/types.WaitsForMeta, which is what a waits-for edge's metadata
// actually is):
// - CompactSpelling re-adds the exact compact spelling
// json.Marshal(types.WaitsForMeta{Gate: "any-children"}) already
// produced. The caller sends identical bytes both times; only Dolt's own
// storage-side renormalization of the FIRST write can make the stored
// form disagree with them.
// - ReorderedKeys re-adds the same fields with their keys spelled in a
// different order — a caller-side difference no byte comparison
// survives, but the same JSON value all the same.
//
// Both must be a no-op by the same signals
// RunDependencyEditorSameTypeReAddWithChangedMetadataMintsOneVersion checks
// for a real change: the stored row, the events table, the journal, and the
// issue_versions delta all have to read as "nothing happened."
func RunDependencyEditorSameTypeReAddWithIdenticalMetadataIsANoOp(t *testing.T, ctx context.Context, fixture DependencyEditorFixture) {
t.Helper()
if fixture.AddDependency == nil {
t.Skip("fixture has no AddDependency hook: metadata is not settable through publicops.DependencyEdge")
}
compact, err := json.Marshal(types.WaitsForMeta{Gate: "any-children"})
if err != nil {
t.Fatalf("marshal compact WaitsForMeta: %v", err)
}
for _, sub := range []struct {
name string
tag string
first string
readd string
}{
{
name: "CompactSpelling",
tag: "idemmetasame-compact",
first: string(compact),
readd: string(compact),
},
{
name: "ReorderedKeys",
tag: "idemmetasame-reorder",
first: `{"gate":"any-children","spawner_id":"src-1"}`,
readd: `{"spawner_id":"src-1","gate":"any-children"}`,
},
} {
t.Run(sub.name, func(t *testing.T) {
fixture.SetJournalEnabled(true)
t.Cleanup(func() { fixture.SetJournalEnabled(false) })
fixture.SetVersionedHistoryEnabled(true)
t.Cleanup(func() { fixture.SetVersionedHistoryEnabled(false) })
source := fixture.IssuePrefix + "-" + sub.tag + "-source"
target := fixture.IssuePrefix + "-" + sub.tag + "-target"
seedDependencyEditorIssue(t, ctx, fixture, source)
seedDependencyEditorIssue(t, ctx, fixture, target)
first := &types.Dependency{IssueID: source, DependsOnID: target, Type: types.DepBlocks, Metadata: sub.first}
if err := fixture.AddDependency(ctx, first, "writer"); err != nil {
t.Fatalf("AddDependency first: %v", err)
}
assertDependencyEditorOutgoingCount(t, ctx, fixture, "dependencies", source, 1)
assertDependencyEdgeTypedCount(t, ctx, fixture, "dependencies", source, target, string(types.DepBlocks), 1)
assertDependencyEditorEventCount(t, ctx, fixture, "events", source, types.EventDependencyAdded, 1)
assertDependencyEditorJournalCountIsOne(t, ctx, fixture, source, string(storeops.EventDepAdd))
versionsBefore := countDependencyEditorIssueVersions(t, ctx, fixture, source)
second := &types.Dependency{IssueID: source, DependsOnID: target, Type: types.DepBlocks, Metadata: sub.readd}
if err := fixture.AddDependency(ctx, second, "writer"); err != nil {
t.Fatalf("re-adding the same edge with semantically identical metadata refused: %v", err)
}
assertDependencyEditorOutgoingCount(t, ctx, fixture, "dependencies", source, 1)
assertDependencyEdgeTypedCount(t, ctx, fixture, "dependencies", source, target, string(types.DepBlocks), 1)
assertDependencyEditorEventCount(t, ctx, fixture, "events", source, types.EventDependencyAdded, 1)
assertDependencyEditorJournalCountIsOne(t, ctx, fixture, source, string(storeops.EventDepAdd))
if delta := countDependencyEditorIssueVersions(t, ctx, fixture, source) - versionsBefore; delta != 0 {
t.Errorf("issue_versions rows for %s went %d -> %d (delta %d), want a delta of 0: the re-add's metadata is semantically identical to what is already stored (byte differences aside), so nothing changed and nothing should be versioned (#6650)", source, versionsBefore, versionsBefore+delta, delta)
}
})
}
}
// RunDependencyEditorSameTypeReAddWithChangedThreadMintsOneVersion is the
// thread_id twin of
// RunDependencyEditorSameTypeReAddWithChangedMetadataMintsOneVersion. The row
// carries a thread as well as metadata, and the source issue's version snapshot
// carries each edge's thread_id, so a same-type re-add naming a thread the row
// does not carry is a real mutation on the same terms as a metadata change:
// the leaf updates the row in place, journals the replacement edge, and mints
// EXACTLY ONE version (#5898 leg 2). The re-add arm once compared metadata
// alone, which read that re-add as change-free and dropped the thread.
//
// The metadata is identical across every write, so the thread is the only
// thing that moves. A last re-add names no thread, and is the change-free
// no-op: an empty thread names none rather than asking for none, which is
// what keeps the callers that never carry a thread from erasing one.
//
// It drives the writes through fixture.AddDependency for the reason the
// metadata case gives: publicops.DependencyEdge carries no thread either.
func RunDependencyEditorSameTypeReAddWithChangedThreadMintsOneVersion(t *testing.T, ctx context.Context, fixture DependencyEditorFixture) {
t.Helper()
if fixture.AddDependency == nil {
t.Skip("fixture has no AddDependency hook: a thread is not settable through publicops.DependencyEdge")
}
fixture.SetJournalEnabled(true)
t.Cleanup(func() { fixture.SetJournalEnabled(false) })
fixture.SetVersionedHistoryEnabled(true)
t.Cleanup(func() { fixture.SetVersionedHistoryEnabled(false) })
source := fixture.IssuePrefix + "-idemthread-source"
target := fixture.IssuePrefix + "-idemthread-target"
seedDependencyEditorIssue(t, ctx, fixture, source)
seedDependencyEditorIssue(t, ctx, fixture, target)
const metadata = `{"note":"v1"}`
add := func(thread, refusal string) {
t.Helper()
dep := &types.Dependency{IssueID: source, DependsOnID: target, Type: types.DepBlocks, Metadata: metadata, ThreadID: thread}
if err := fixture.AddDependency(ctx, dep, "writer"); err != nil {
t.Fatalf("%s: %v", refusal, err)
}
assertDependencyEdgeTypedCount(t, ctx, fixture, "dependencies", source, target, string(types.DepBlocks), 1)
assertDependencyEditorEventCount(t, ctx, fixture, "events", source, types.EventDependencyAdded, 1)
}
storedThread := func() string {
t.Helper()
var thread string
if err := fixture.QueryScalar(ctx,
"SELECT COALESCE(thread_id, '') FROM dependencies WHERE issue_id = ? AND COALESCE(depends_on_issue_id, depends_on_wisp_id, depends_on_external) = ?",
[]any{source, target}, &thread); err != nil {
t.Fatalf("read stored thread_id for %s -> %s: %v", source, target, err)
}
return thread
}
journalCount := func() int {
t.Helper()
var count int
if err := fixture.QueryScalar(ctx,
"SELECT COUNT(*) FROM bd_events_journal WHERE issue_id = ? AND op = ?",
[]any{source, string(storeops.EventDepAdd)}, &count); err != nil {
t.Fatalf("count bd_events_journal dep_add rows for %s: %v", source, err)
}
return count
}
add("", "AddDependency first")
assertDependencyEditorJournalCountIsOne(t, ctx, fixture, source, string(storeops.EventDepAdd))
versionsBefore := countDependencyEditorIssueVersions(t, ctx, fixture, source)
add("thread-conv-1", "re-adding the same edge with a new thread refused")
if got := storedThread(); got != "thread-conv-1" {
t.Errorf("stored thread_id = %q, want %q: the re-add must persist the new thread, not keep the old", got, "thread-conv-1")
}
if got := journalCount(); got != 2 {
t.Errorf("bd_events_journal dep_add rows for %s = %d, want 2: the thread-changed re-add must journal its own replacement-edge entry", source, got)
}
if delta := countDependencyEditorIssueVersions(t, ctx, fixture, source) - versionsBefore; delta != 1 {
t.Errorf("issue_versions rows for %s went %d -> %d (delta %d), want a delta of 1: the thread genuinely changed, so the re-add is a real mutation of the source issue and must mint exactly one version (#5898 leg 2)", source, versionsBefore, versionsBefore+delta, delta)
}
versionsBefore = countDependencyEditorIssueVersions(t, ctx, fixture, source)
add("", "re-adding the same edge naming no thread refused")
if got := storedThread(); got != "thread-conv-1" {
t.Errorf("stored thread_id after a re-add naming no thread = %q, want %q kept", got, "thread-conv-1")
}
if got := journalCount(); got != 2 {
t.Errorf("bd_events_journal dep_add rows for %s = %d after a change-free re-add, want 2 still", source, got)
}
if delta := countDependencyEditorIssueVersions(t, ctx, fixture, source) - versionsBefore; delta != 0 {
t.Errorf("issue_versions rows for %s went %d -> %d (delta %d) on a re-add naming no thread, want a delta of 0: it keeps the stored thread, so nothing changed (#5898 R3)", source, versionsBefore, versionsBefore+delta, delta)
}
}
// RunDependencyEditorRepeatsWithinOneRequestCollapse pins the clause that
// answers a request naming ONE PAIR TWICE. The same-type re-add rule is stated
// for the pair rather than for the call, so the second occurrence inside a
@ -793,17 +454,8 @@ func RunDependencyEditorRefusalWritesNothing(t *testing.T, ctx context.Context,
// missing edge is Removed false with a NIL error, not ErrNotFound, because an
// agent replaying its own teardown should not have to classify an error to
// discover it already ran.
// bd_events_journal is checked alongside the events table for the same
// reason RunDependencyEditorSameTypeReAddIsIdempotent checks it: the journal
// has no deduplication of its own, so a removal that finds nothing must not
// journal a dep_remove either. This side of #5898's R3 case is expected to
// already hold — RemoveDependencyInTx only records when it actually deleted a
// row — but it is pinned here so a future regression on this leg is caught
// alongside the add-side one rather than only on the leg that is broken today.
func RunDependencyEditorRemoveIsIdempotent(t *testing.T, ctx context.Context, fixture DependencyEditorFixture) {
t.Helper()
fixture.SetJournalEnabled(true)
t.Cleanup(func() { fixture.SetJournalEnabled(false) })
source := fixture.IssuePrefix + "-rm-source"
target := fixture.IssuePrefix + "-rm-target"
seedDependencyEditorIssue(t, ctx, fixture, source)
@ -826,7 +478,6 @@ func RunDependencyEditorRemoveIsIdempotent(t *testing.T, ctx context.Context, fi
}
assertDependencyEditorOutgoingCount(t, ctx, fixture, "dependencies", source, 0)
assertDependencyEditorEventCount(t, ctx, fixture, "events", source, types.EventDependencyRemoved, 1)
assertDependencyEditorJournalCountIsOne(t, ctx, fixture, source, string(storeops.EventDepRemove))
removed, err = fixture.Editor.RemoveDependency(ctx, request)
if err != nil {
@ -836,7 +487,6 @@ func RunDependencyEditorRemoveIsIdempotent(t *testing.T, ctx context.Context, fi
t.Error("Removed = true, want false for an edge that was already gone")
}
assertDependencyEditorEventCount(t, ctx, fixture, "events", source, types.EventDependencyRemoved, 1)
assertDependencyEditorJournalCountIsOne(t, ctx, fixture, source, string(storeops.EventDepRemove))
}
// RunDependencyEditorAppliesParentChildBeforeBlockingEdges pins
@ -2529,26 +2179,6 @@ func assertDependencyEditorEventCount(t *testing.T, ctx context.Context, fixture
}
}
// assertDependencyEditorJournalCountIsOne asserts exactly one bd_events_journal
// row exists for one issue and op — the same shape as
// assertDependencyEditorEventCount, against the table that has no
// deduplication of its own and so is the one an unconditional journal write on
// a no-op would actually show up in. Every call site pins the count at one
// (the single genuine write); there is no idempotency case that expects zero
// or more than one, so unlike assertDependencyEditorEventCount this does not
// take a want.
func assertDependencyEditorJournalCountIsOne(t *testing.T, ctx context.Context, fixture DependencyEditorFixture, issueID, op string) {
t.Helper()
var got int
query := "SELECT COUNT(*) FROM bd_events_journal WHERE issue_id = ? AND op = ?"
if err := fixture.QueryScalar(ctx, query, []any{issueID, op}, &got); err != nil {
t.Fatalf("count bd_events_journal %s rows for %s: %v", op, issueID, err)
}
if got != 1 {
t.Errorf("bd_events_journal %s rows for %s = %d, want 1", op, issueID, got)
}
}
// assertDependencyEditorEventActor reads the actor off the one event of a
// given type for one issue. It reads the DURABLE stream only: the attribution
// clause is about who is recorded, and the plane that record lands in is
@ -2631,82 +2261,3 @@ func dependencyEditorHistoryProbe(t *testing.T, ctx context.Context, fixture Dep
assertDependencyEditorHistoryDelta(t, ctx, fixture, before, want, why)
}
}
// RunDependencyEditorRefusesADottedChildGatedOnItsOwnParent pins
// publicops.CheckDottedChildDependency on the role: an explicit edge from a
// dotted-id child to its own ancestor is refused as a
// *DottedChildDependencyError (ErrValidation) on every leg, and nothing is
// written. (It is decided before any per-edge probe, so the probe-skipped
// spelling, which the wire does not publish, adds nothing here.) It used to be
// enforced only by the CLI ahead of the role, so an HTTP or embedded caller
// could gate bd-abc.1 on bd-abc.
//
// POSITIVE HALF: the hierarchy itself — a parent-child edge to the IMMEDIATE
// dotted parent — is allowed, and so is an edge between siblings. A body that
// refused every edge touching a dotted id would satisfy the refusals alone.
//
// WITH THE HIERARCHY STORED: once that parent-child edge exists (the shape
// `bd create --parent` leaves), a blocking edge on the same pair is still this
// refusal, not the type or hierarchy conflict the stored edge would raise — the
// rule reads nothing, so it answers first — and the stored edge survives.
func RunDependencyEditorRefusesADottedChildGatedOnItsOwnParent(t *testing.T, ctx context.Context, fixture DependencyEditorFixture) {
t.Helper()
parent := fixture.IssuePrefix + "-dotted"
child := parent + ".1"
grandchild := child + ".2"
sibling := parent + ".3"
for _, id := range []string{parent, child, grandchild, sibling} {
seedDependencyEditorIssue(t, ctx, fixture, id)
}
for _, refused := range []struct {
name string
edge publicops.DependencyEdge
}{
{"child blocks on its parent", publicops.DependencyEdge{IssueID: child, DependsOnID: parent, Type: publicops.DepBlocks}},
{"grandchild blocks on its grandparent", publicops.DependencyEdge{IssueID: grandchild, DependsOnID: parent, Type: publicops.DepBlocks}},
{"grandchild parent-child to its grandparent", publicops.DependencyEdge{IssueID: grandchild, DependsOnID: parent, Type: publicops.DepParentChild}},
{"child relates to its parent", publicops.DependencyEdge{IssueID: child, DependsOnID: parent, Type: publicops.DepRelated}},
} {
_, err := fixture.Editor.AddDependencies(ctx, publicops.AddDependenciesRequest{
Actor: "writer",
Edges: []publicops.DependencyEdge{refused.edge},
})
var dotted *publicops.DottedChildDependencyError
if !errors.As(err, &dotted) {
t.Errorf("%s: error = %v, want *DottedChildDependencyError", refused.name, err)
continue
}
if !errors.Is(err, publicops.ErrValidation) {
t.Errorf("%s: error = %v, want it to match ErrValidation", refused.name, err)
}
if dotted.IssueID != refused.edge.IssueID || dotted.DependsOnID != refused.edge.DependsOnID {
t.Errorf("%s: refusal names %s -> %s, want %s -> %s", refused.name,
dotted.IssueID, dotted.DependsOnID, refused.edge.IssueID, refused.edge.DependsOnID)
}
}
assertDependencyEditorNoEdgesFrom(t, ctx, fixture, child, grandchild)
if _, err := fixture.Editor.AddDependencies(ctx, publicops.AddDependenciesRequest{
Actor: "writer",
Edges: []publicops.DependencyEdge{
{IssueID: grandchild, DependsOnID: child, Type: publicops.DepParentChild},
{IssueID: sibling, DependsOnID: child, Type: publicops.DepBlocks},
},
}); err != nil {
t.Fatalf("the immediate parent-child edge and a sibling edge: %v", err)
}
assertDependencyEdgeTypedCount(t, ctx, fixture, "dependencies", grandchild, child, string(publicops.DepParentChild), 1)
assertDependencyEdgeCount(t, ctx, fixture, "dependencies", sibling, child, 1)
_, err := fixture.Editor.AddDependencies(ctx, publicops.AddDependenciesRequest{
Actor: "writer",
Edges: []publicops.DependencyEdge{{IssueID: grandchild, DependsOnID: child, Type: publicops.DepBlocks}},
})
var dotted *publicops.DottedChildDependencyError
if !errors.As(err, &dotted) || !errors.Is(err, publicops.ErrValidation) {
t.Errorf("blocks on a parent whose parent-child edge is stored: error = %v, want *DottedChildDependencyError matching ErrValidation", err)
}
assertDependencyEdgeTypedCount(t, ctx, fixture, "dependencies", grandchild, child, string(publicops.DepParentChild), 1)
assertDependencyEdgeCount(t, ctx, fixture, "dependencies", grandchild, child, 1)
}

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