* test(dolt): red — defer auto-wake must run for classified-read-only server-mode opens (be-vbhpf)
TestServerModeDeferAutoWake exercises the same defer/wake contract as the
embedded and proxied-server variants, against a real dolt sql-server. Today
the sweep (DoltStore.wakeExpiredDefers) unconditionally skips whenever the
store is opened read-only — including when that read-only-ness comes purely
from command classification (bd ready/bd list are read-only for the CURRENT
project), which is indistinguishable, before the fix, from a strict
--readonly or foreign-project open that must never sweep.
RED: expired_dated_defer_wakes_on_ready and expired_dated_defer_wakes_on_list_ready
fail (issue never returns to open). dateless_defer_never_wakes and
future_dated_defer_stays_hidden pass today too, trivially (no sweep runs at
all pre-fix) — kept as regression guards for the GREEN step, which is where a
unit test proving classifiedRead=false still does NOT sweep belongs, since
that distinction doesn't exist yet at RED.
* feat: green — defer auto-wake runs for classified-read-only server-mode opens (refs be-vbhpf)
bd ready/bd list on a dolt-sql-server-backed store open with the store
classified read-only for command purposes; the lazy defer-wake sweep
silently early-returned before ever running, so expired defers never
woke unless something else opened the store writable first.
Threads a new ClassifiedRead flag through dolt.Config -> DoltStore,
set at the call site to exactly "read-only because of command
classification, not strict --readonly/preview/foreign-project"
(policy.readOnly && !readonlyMode && !previewMode in main.go).
wakeExpiredDefers's guard now delegates to a small extracted
predicate, deferWakeSweepEligible(readOnly, classifiedRead), so the
truth table can be unit-tested without a live store.
* chore: release gate PASS for be-6iglh-gate
* docs(release-gates): record the be-5fjqh rebase onto current main
origin/main advanced 6 commits past this branch's base and PR #6082 went
CONFLICTING; hourly pr-audit filed be-5fjqh. The branch is now rebased onto
0efe0adf5.
The only conflict was cmd/bd/main.go: this branch and e05000d64 (wy-sbgucn)
each append a field to the same dolt.Config literal at the same anchor line.
Resolved keep-both -- PoolReadTimeoutFallback and ClassifiedRead drive
disjoint code paths.
The addendum records the new base and SHAs, patch-id equivalence for the five
files that did not conflict, what was re-verified at the new base (build plus
the diff-owned tests, container-backed), and what was NOT re-run (the
full-suite and ci-pr-policy lanes still refer to the old base).
Agent-Signature: claude-code-claude-opus-5[1m]-unknown-reasoning on behalf of Jim Wordelman
* docs(release-gates): record the be-qjern re-propose rebase and full re-gate
PR #6082 was closed and its branch deleted 2026-09-01 by an unknown actor
under the shared quad341 identity. Operator ruling 2026-09-08: accidental,
not a rejection — re-proposing. This addendum records a second self-rebase
onto current origin/main (zero conflicts this time), the full-suite and
ci-pr-policy re-gate the 09-01 addendum left outstanding (0 FAIL, policy
FAIL attributed to pre-existing be-mrl6j), and re-verification of both
diff-owned container-backed tests at the new HEAD.
refs be-qjern
* test(feat): red — add strict --readonly server-mode subtest to TestServerModeDeferAutoWake (refs be-acsyx)
* docs(release-gates): green — reword container-backed evidence claims, add nit-3 comment (refs be-acsyx)
bee-ghosttrack nit 2: TestDeferWakeSweepEligibleHonorsClassifiedRead is a
pure-function table test, not container-backed like TestServerModeDeferAutoWake
— reworded release-gates/be-6iglh-gate.md criteria 2(4) and 3 accordingly, and
attributed the preview/foreign-project claim to code structure at
cmd/bd/main.go:1485 rather than to that test. PR #6424 body reworded to match
(not part of this commit; edited via gh pr edit).
bee-ghosttrack nit 3 (optional): one-line comment on the unreachable
"classifiedRead without readOnly" table case explaining it documents totality,
not a reachable state.
Full suite: 0 FAIL. Targeted re-verification (TESTCONTAINERS_RYUK_DISABLED=true
to dodge host-load reaper flakiness): TestServerModeDeferAutoWake 5/5 subtests
PASS (12.427s), TestDeferWakeSweepEligibleHonorsClassifiedRead 4/4 subtests
PASS (5.957s).
* chore: remove leaked internal release-gate doc from PR branch
release-gates/be-6iglh-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
* ci(proxied-shard): discover TestServerMode* entry points
Review finding (major, Test Evidence Quality): TestServerModeDeferAutoWake —
this PR's only end-to-end guard for the classified-read defer-wake fix — was
selected by no CI lane. The two lanes that set BEADS_TEST_PROXIED_SERVER=1
both shard through proxied-test-shard.sh, whose discovery grep matched only
`^func TestProxiedServer`, so the wiring lines at cmd/bd/main.go:1675 and
internal/storage/dolt/store.go:2136 had zero CI-executed coverage: the one
CI-reachable new test pins the pure predicate and cannot catch a mis-wired
flag.
Widen discovery to `^func Test(ProxiedServer|ServerMode)` in the shard script
and in scripts/ci/gen_proxied_shard_manifest.py so the two discovery patterns
stay in step, and widen the shard script's manifest-name validation to match.
That last part is load-bearing, not cosmetic: without it a regenerated
manifest containing a TestServerMode* row is rejected outright ("Invalid
shard manifest line") and the whole lane exits 1.
This also rescues the two pre-existing TestServerModeServe* suites, which
share the identical requireSharedProxiedServer gate and the same shared dolt
sql-server harness and were equally invisible — the unclosed class this PR
was following.
Verified: discovery goes 151 -> 154; a 15-shard BEADS_TEST_SHARD_LIST_ONLY=1
dry run assigns each of the 154 to exactly one shard with no pre-existing
test moved (the three land on shards 4/13/15 via hash fallback); the
pre-change script selects none of the three.
Also clarifies the reviewers' nit: the "foreign-project" exclusion named in
the new comments is not tested at the guard or in the policy expression —
those opens build their own dolt.Config and leave ClassifiedRead false, so
the guarantee is fail-closed by default.
Iteration-2 review (two minors, both non-gating): the fixup's own new prose
asserted two universals that measurement falsifies — the same class as the
nit above, reintroduced in the CI files this fixup added.
* proxied-test-shard.sh claimed "Both families gate on
requireSharedProxiedServer", contradicted two lines earlier by its own
mention of the TestProxiedServerPathHelpers unit test. Transitive gate
census over the 154 discovered entry points: 143 reach
requireSharedProxiedServer, 10 reach the different helper
requireProxiedServerEnv, and TestProxiedServerPathHelpers
(cmd/bd/proxied_server_test.go, bare `package main`, three assert.Equal
calls on path helpers) has no gate and no build tag, so it also runs in
every ordinary `go test ./cmd/bd/` lane. Now scoped to the
TestServerMode* family, which does gate uniformly (3/3), and the
TestProxiedServer* side is described as mixed rather than generalized
over.
* main.yml claimed TestServerMode* discovery means "neither family can be
silently left out of CI". Discovery is a non-recursive cmd/bd/*_test.go
glob: 154 top-level matches versus 156 recursive, the difference being
cmd/bd/doctor/database_test.go:60 and cmd/bd/doctor/dolt_test.go:126.
Now scoped to the top-level entry points, and the comment names the
residual hazard (a container-gated suite added under cmd/bd/<subpkg>/ is
still never selected here) instead of implying it cannot happen.
Both edits are comment-only and behaviorally inert: non-comment lines are
byte-identical in both files, and the 15-shard BEADS_TEST_SHARD_LIST_ONLY=1
sweep is byte-identical before and after (154 assignments, 0 duplicates,
assigned set == discovered set, the three TestServerMode* still at 4/13/15).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* ci(bazel): add defer_wake_server_test.go to cmd/bd go_test srcs
Maintainer CI repair, generated by `make bazel-sync` (gazelle).
`cmd/bd/BUILD.bazel`'s `go_test` srcs is an explicit list, not a glob, so the
new `cmd/bd/defer_wake_server_test.go` was never compiled or run by the Bazel
lane. `Bazel / test` failed two required steps on the pushed head
`0a3f5e0047`:
Go test equivalence:
go test: 105 packages, 8988 top-level tests
bazel: 107 go_test targets, 106 tested; 8987 top-level tests seen
tests go test runs that Bazel did not (1):
cmd/bd TestServerModeDeferAutoWake
EQUIVALENCE: FAIL
BUILD files in sync (gazelle, go_srcs, MODULE.bazel): out of sync
`BAZEL_TEST` is listed in `CI_GATE_REQUIRED` for `CI Gate / Required`
(.github/workflows/pr.yml), so this is a required-lane red, not advisory.
That the missing test is this PR's own headline guard makes the repair squarely
in scope: the PR exists to close exactly this "no CI lane runs it" gap, and its
review fixup closed it for the proxied shard lane. The Bazel lane had the same
gap for a different reason.
Attribution: main's Bazel run at this PR's exact base 43a526b828 concluded
success, so the red is this branch's, not inherited.
Validation:
- `make bazel-sync` produces exactly this one line; a second run is a no-op
(gazelle idempotent, md5 7d1d0549fcd466159451c02181661c78).
- Byte-identical to CI's own `bazel-sync-patch` artifact for this head
(blob pair efec974..6dd76e3).
- srcs-only change: gazelle added no deps entry, so every import the new file
needs was already declared.
- `bazel build //cmd/bd:bd_test` succeeds, and the generated
`bd_test_/testmain.go` now enumerates TestServerModeDeferAutoWake, which is
the row the equivalence check reported missing.
- `tools/bazel/go_srcs.py --check` was already clean, and `bazel mod tidy`
produced no MODULE.bazel drift, so this single line is the whole repair.
No contributor commit is modified and no Go source changes.
---------
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* ci(bazel): remote Bazel lanes for allowlisted fork authors (advisory)
Add bazel-farm.yml, a pull_request_target caller of bazel.yml. It gives the
RBE farm to fork PRs to main whose author and triggering user (sender: the
pusher on synchronize) are both on .github/bazel-farm-allowlist.txt, which
is read from the base commit. The list has julianknutsen, quad341, sjarmak
and csells, the same as gascity's blacksmith allowlist.
- authorize job: sparse checkout of github.sha that holds only the
allowlist and .github/scripts/bazel-farm-authorize.sh; no token on disk,
no secrets, event facts through env only. The script also checks fork vs
base repo, the default branch, the action, and a 40-hex head SHA.
- farm job: calls bazel.yml with contents: read, exactly the four RBE
secrets, checkout-sha pinned to the event's head SHA, and
fork-farm: authorized.
- bazel.yml: new checkout-sha and fork-farm inputs (no-ops for pr.yml and
nightly.yml). Every lane checks out inputs.checkout-sha with
persist-credentials: false. The rbe job runs a fork remotely only for an
authorized pull_request_target call, and then remote or skip, never
local. PR concurrency also cancels on pull_request_target. The
bazel-sync-patch upload is skipped on pull_request_target.
Advisory only: pr.yml is unchanged, so every fork PR still runs the local
Bazel lanes inside the enforced CI Gate / Required.
Policy tests pin the trigger and types, both jobs' conditions, the
allowlist source and contents, the pinned checkout, read-only permissions,
where secrets appear, no expressions in run scripts, per-PR concurrency,
the timeout, and that no workflow_run consumer can pick up a farm run.
TestBazelLaneIsGatedAlongsideLegacy now allows pull_request_target on a
bazel.yml caller for bazel-farm.yml only. 26 mutations were each caught
by these tests (sender check dropped, allowlist read from the PR head,
write permission added, event data interpolated into run, SHA pin dropped,
and others).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(ci): trusted-author fork PR farm design and threat model
Document bazel-farm.yml in the required-check topology:
- the design, and why it is advisory rather than part of the enforced
gate;
- the gate options considered;
- the threat model: allowlist spoofing, sender vs. author, TOCTOU with the
pinned SHA, workflow-file edits, script, label and comment injection,
token scope, artifact poisoning, and farm and Actions cache poisoning;
- what can only be verified on GitHub.
The one capability a listed author gets beyond a same-repo PR is called
out as an accepted risk, with mitigations: pull_request_target runs use
the default branch's Actions cache scope.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): opt the farm's lane checkouts into fork-head checkout (F1)
actions/checkout@3d3c42e5 is v7.0.1, not v6, and v7 refuses to check out
a fork PR's head SHA on pull_request_target unless
allow-unsafe-pr-checkout is true. Every lane of an authorized farm run
therefore failed at checkout.
- Each bazel.yml lane checkout now sets allow-unsafe-pr-checkout to
inputs.fork-farm == 'authorized' && github.event_name ==
'pull_request_target'. That is false for every other caller and event.
- TestBazelWorkflowForkFarmInputs pins that exact expression. It also
fails if the key appears anywhere else in the workflows (so never a
literal true, and never on the authorize checkout).
- Relabel the checkout pin as # v7.0.1 in bazel.yml and bazel-farm.yml.
- Add the opt-in to the engdoc's design section and to the
verify-on-GitHub list.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): verify everything restored from caches in Bazel lanes (F3)
A farm run executes PR code in the default branch's cache scope. GitHub's
own cache is read-only for pull_request_target: GitHub issues a read-only
token, and cache-mode defaults to read. Whether Blacksmith's colocated
cache enforces the same is unverified. So trusted runs no longer execute
anything they restore without verifying it first:
- setup-bazel: Bazelisk's home moves out of the runner cache to a fresh
$RUNNER_TEMP/bazelisk-home, so the Bazel binary is never restored from
a cache. BAZELISK_VERIFY_SHA256 is set to the release sha256 pinned for
the .bazelversion version on each arch (9.2.0 amd64 and arm64). The
wrapper step then re-checks every Bazel binary in that home.
- write-bazelrc.sh: add common --repo_contents_cache=. The repo contents
cache holds extracted repos that Bazel never re-verifies. The
content-addressable repository cache stays, since Bazel re-hashes it on
every hit.
- Runner cache key bumped to bazel-repo-v3 (the content changed).
- bazel-test runs `go mod verify` right after the Go module cache restore.
- Policy tests:
- cache-mode may only be read or none in bazel-farm.yml, bazel.yml and
setup-bazel;
- bazel.yml permissions are exactly contents: read;
- the Bazel sha pin matches .bazelversion, and Bazelisk's home is
outside the cache;
- the binary is verified after download;
- go mod verify follows every module cache restore;
- the rc disables the repo contents cache.
- Engdoc and bazel-farm.yml header: corrected about GitHub's read-only
cache, noted Blacksmith as unknown, and listed the full blast radius
(release.yml hardening tracked separately). The canary design is in the
rollout notes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): farm runs only the author's own fork, on opened/synchronize (F4)
"The sender is listed" did not prove that a listed user chose the head
commit:
- A listed author could open a PR whose head is a third party's fork, and
that fork's owner could push between the author's review and "Create".
- A collaborator on a listed author's fork could push while the PR was
closed or a draft (that push is skipped), and the author's later
"Reopen" or "Ready for review" click would run it with secrets.
Changes:
- The authorize script requires the head repository owner's numeric id to
equal the PR author's (HEAD_OWNER_ID, PR_AUTHOR_ID, passed via env).
- Drop the reopened and ready_for_review triggers, and the script now
refuses those actions too. Drafts already run on opened and
synchronize.
- Tests pin the trigger types and the new env, and add script cases:
- cross-fork head, missing or non-numeric owner id;
- reopened and ready_for_review refused;
- unanchored action (xopenedx);
- base-repo prefix (gastownhall/beads-evil). This covers two mutations
the reviewer found surviving.
- Engdoc: the new checks, and the residual that stays the listed author's
responsibility (commits pushed by fork collaborators).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): match the farm allowlist on numeric user ids (F5)
Logins are mutable: after a rename, anyone can register the old login,
and before this change they would then be listed as both author and
sender.
- The allowlist now holds one numeric user id per line, with the login as
a comment. The ids were looked up with gh api users/<login> --jq .id.
- The authorize script matches PR_AUTHOR_ID and SENDER_ID
(github.event.pull_request.user.id, github.event.sender.id). Logins are
now used only in the log. An allowlist entry that is not a numeric id
fails the job.
- Tests pin the id-to-login table and the SENDER_ID env. Script cases:
- a renamed login re-registered with a new id (author and sender);
- id prefix, suffix and leading zero;
- an id that appears only in a comment;
- listed ids with unlisted logins;
- a PR from another listed user's fork;
- broken allowlists (a login entry, a signed id).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(ci): farm re-run semantics and the add/remove-user procedure (F6)
A re-run replays the original event. It checks out the same pinned head
SHA, which is fine. It also reads the allowlist at the original base
commit, so a user removed from the list still gets the RBE secrets when
one of their old runs is re-run. Only users with write access can
re-run.
- Engdoc: how to add a user.
- Engdoc: how to remove a user. Merge the removal, then cancel and delete
their farm runs (a gh api query by head-repository owner id). For
cause, rotate RBE_TLS_CERT/KEY and have the farm revoke the old
certificate; rotating also closes the re-run window.
- bazel-farm.yml header: points to the procedure.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): name the farm call "Bazel Farm", not "Bazel" (F7)
The farm's check runs were named "Bazel / <lane>", the same as pr.yml's.
Farm results are PR-controlled: PR code runs setup-bazel and can make a
lane exit 0. If a ruleset ever required a "Bazel / ..." check, a farm run
could satisfy it. The farm's checks are now "Bazel Farm / <lane>", and a
test pins the name and requires it to differ from pr.yml's bazel job.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): run the farm authorize script in the C locale (F8)
Bash bracket ranges and ${v,,} depend on the locale. In en_US.UTF-8,
[0-9], [0-9a-f] and [A-Za-z] match some non-ASCII characters, and the
Kelvin sign lowercases to "k". This is not exploitable (GitHub ids,
logins and SHAs are ASCII, and the allowlist is maintainer-controlled),
but the script now exports LC_ALL=C.
The script tests now run under en_US.UTF-8 and add cases with non-ASCII
digits in ids and a non-ASCII character in the SHA. Without the export,
the SHA case fails, so the tests catch its removal.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ci): farm authorize script runs on bash 3.2 (macOS)
${v,,} is bash >= 4; macOS runners' /bin/bash is 3.2, so the script's
tests failed there. Lowercase with tr under LC_ALL=C (ASCII only, as before).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): gate the Bazel lane alongside the legacy jobs (D1)
pr.yml now calls bazel.yml (workflow_call) as its `bazel` job, and its
CI Gate / Required requires the call's aggregate (BAZEL) plus each gated
lane's result (BAZEL_TEST, BAZEL_PURE, BAZEL_EMBEDDED, BAZEL_DOLTSERVER).
No legacy job is removed: PR Core, build-artifacts, the pure-Go/js-wasm
check, domain+uow, contract corpus and pr-risk.yml's embedded tier stay
required (D2 is separate).
- bazel.yml drops its own pull_request/merge_group triggers, so a PR runs
the lane once; push to main, workflow_dispatch and workflow_call stay.
- Every lane records job.status in an always() last step and exports it
as a workflow_call output named after the job, next to the rbe job's
rbe-mode / rbe-enabled.
- .github/scripts/bazel-gate.sh reads the call's rbe-mode/rbe-enabled and
never re-derives the variable/fork/secret condition: mode skip allows
every Bazel id to skip, local only the remote-only BAZEL_EMBEDDED,
remote none; a missing or inconsistent mode fails the gate.
- bazel-integration runs in the PR call but stays advisory (its legacy
counterparts in main.yml run only on push to main): no gate id, and the
gate script excuses the aggregate failure only when that lane reported
failure or cancelled in remote mode; the gated lanes are still checked
on their own ids.
- Callers (pr.yml, nightly.yml) pass exactly the four RBE secrets that
bazel.yml now declares, never `secrets: inherit`.
- Inside pr.yml's run the Bazel bd artifact is bazel-ci-build-artifacts,
so it cannot collide with build-artifacts' ci-build-artifacts upload.
- bazel-autofix.yml now triggers on workflow "PR": the bazel-sync-patch
artifact is uploaded inside the PR run, and "Bazel" runs are no longer
PR events. Its security model is unchanged (base-branch checkout only,
artifact read from the triggering run id, data-only patch).
- Policy tests (review D1 F3/F4/F7):
- TestBazelLaneIsGatedAlongsideLegacy: every bazel.yml job is the rbe
job, a gated lane (bazelLaneGateIDs) or an advisory lane with a
reason; gate ids, env expressions and outputs are derived from that
map; no re-derivation in the gate step or script.
- TestBazelGateSimulation runs pr.yml's actual gate step over mode in
{remote, local, skip} (pull_request and merge_group): the script's
skips equal the ids whose job `if:` is false, and for each lane that
should run, it alone skipped, failed or cancelled turns the gate red
whatever the aggregate says; advisory, aggregate and invalid-mode
cases too.
- TestBazelArtifactNamesUniqueInCallerRuns: no artifact name collides
within a pr.yml or nightly.yml run, following local workflow calls.
- Autofix: workflow_run on "PR", which must upload bazel-sync-patch
itself or through an unconditional local call.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): keep integration out of the PR call; pin the call's inputs (D1 review v2)
- N1: bazel.yml gains a string workflow_call input `integration`
(default "on"); bazel-integration runs only when remote and
`inputs.integration != 'off'`. A string, not a boolean: on push and
dispatch the input is null, and null == false would silently stop the
lane on main. pr.yml passes integration: "off" (main.yml's integration
jobs, its legacy counterpart, run only on push to main). The gate no
longer reads bazel-integration and bazel-gate.sh no longer excuses an
aggregate failure: BAZEL is the call's result, red on a missing or
inconsistent rbe mode.
- N3: pr.yml's call passes exactly build-artifact-name and
integration: "off" (no rbe or other override).
- N4: bazel.yml's concurrency group never uses github.workflow (the
caller's name in a call) and differs from each caller's group for every
event, so the call cannot deadlock against pr.yml.
- N5: no caller of bazel.yml (pr.yml, nightly.yml) may have a
pull_request_target or workflow_run trigger.
- Simulation: lanes' run modes are evaluated with pr.yml's call inputs;
advisory lanes must not run in the PR call, gated lanes must run when
remote.
- engdocs: runbook for main BUILD drift, a farm outage or the RBE cert
expiry (~2027-09-27): fix main / renew, or unset RBE_WEST_WORKERS.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(ci): record the enforced required-gates ruleset and PR Risk's renamed gate
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(bazel): gate the proxied-server and server-Dolt storage lanes
bazel-proxied and bazel-server-storage (remote-only, #6940) join the
gated lanes like bazel-embedded: pr.yml's ci-gate requires
BAZEL_PROXIED and BAZEL_SERVER_STORAGE, each read from the lane's
job.status output (always() recorder step, workflow_call output named
after the job). Both run in pr.yml's call (no integration switch).
bazel-gate.sh allows them to skip in mode local (forks, Dependabot:
pr-risk.yml's legacy tiers cover those PRs) and in mode skip, never in
mode remote. The gate simulation derives this from the jobs' ifs, so
each lane skipped, failed or cancelled in remote mode turns the gate
red. Jobs are renamed "proxied-server tier" / "server-Dolt storage tier"
(shown as "Bazel / ..." under pr.yml's call).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(dolt): verify shared cloud auth fixture without a time limit (saa-cgh.107)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* test(dolt): require cloud routing server in the opted-in full suite (saa-cgh.107)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* test(dolt): count successfully registered cloud auth cases (saa-cgh.107)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* test: describe current shared cloud-auth shard fixture (saa-cgh.119)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* ci(proxied-cmd): green — give the proxied-shard job its own step timeout, refresh manifest (refs be-bruke)
The job-level timeout-minutes was the only backstop for the "Test
proxied-server cmd shard" step, and it counts the "Download binaries"
step too — so a slow download alone could exhaust the job budget and
kill an otherwise-healthy shard's test run with no way to tell the two
failure modes apart. Give the test step its own 16m timeout inside the
existing 30m job budget, and regenerate the bin-packed shard manifest
via scripts/ci/gen_proxied_shard_manifest.py so it stays in sync with
the current TestProxiedServer* set (0 drift, all 15 shards fallback:0).
* ci(proxied-cmd): mirror the shard timeouts onto the main lane, regen the manifest at the adoption base
Adoption review of #6689, iteration 1 — three minor findings, applied here
rather than deferred.
main.yml's `test-proxied-cmd` is the same job as pr-risk.yml's twin — same
proxied-test-shard.sh, same manifest, same total 15 — behind a
download/verify step inside a 20m budget with no step timeout, so the exact
ambiguous-timeout failure mode this PR removes from the PR lane survived on
the post-merge lane, which is where triage happens with nobody watching.
Mirror both edits (job 20m -> 30m, step 16m) and record the ordering at the
step, since it is not obvious from the site that 16m is deliberately below
the script's own -test.timeout=15m plus setup.
The manifest's only record of the cost proxy's two known blind spots lived
in a hand-written comment block the regeneration deleted:
TestProxiedServerListSortRetiresTheWalk seeds 1400 rows and walks the
listing three ways off a single init, and TestProxiedServerServeReadParity
is the CLI/HTTP read-parity oracle whose presence in this gate-required lane
is what makes the anti-drift claim enforced. Re-adding prose to a generated
file would just be deleted again, so it moves into the generator's emitted
header.
Base drift since authoring left the refreshed manifest one test stale —
#6584 added TestProxiedServerBackupRefusedOnExternalTopology, which
hash-distributed to shard 14 — so "0 drift, all 15 shards fallback:0" was
already false on the merge base. Benign (unlisted tests hash-distribute and
still run, and drift removed no name, so the strict parser's stale-entry
hard-fail was unreachable), but the stated deliverable did not hold.
Regenerated at the adoption base: 149 of 149 discovered tests listed,
fallback:0 on every shard, peak load unchanged at 39 estimated inits. That
figure is a point-in-time measurement, not an invariant: nothing in CI diffs
the committed manifest against a regeneration, so it re-drifts the moment
the next TestProxiedServer* lands. A freshness step
(`gen_proxied_shard_manifest.py 15 | diff - <manifest>`) on a lane already
triggered by .github/scripts/* would make it one; that is follow-up scope.
Verified: the generator reproduces the committed manifest byte-identically;
BEADS_TEST_SHARD_LIST_ONLY=1 across all 15 shards assigns all 149 discovered
TestProxiedServer* functions exactly once with no duplicates or orphans;
actionlint clean on both workflows.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* feat(httpapi): serve `bd list`'s order with `sort` on listIssues
The issue listing served one order, `(created_at DESC, id ASC)`, because the
cursor is a keyset position in it. The spec stated the constraint in its own
words: "the sort order is welded to the cursor contract, and a new order needs
new surface." That welding put the cost on every client wanting `bd list`'s
ordering — the only way to get it was to page the whole result set and sort
locally, which is the one cost on this surface that grows with the project.
Measured against a real `bd serve` over 1400 rows at the 200-row page an HTTP
client actually uses: walk-and-sort is 7 requests plus a client-side
comparator, `?sort=priority` is 1. Both are checked against `bd list --json`
row for row, because the claim that matters is not "fewer requests" but "the
same order".
`sort` takes `created` and `priority` and nothing else. Each value is a keyset
contract — a position shape, a strictly-after predicate, an index — not a
display preference, and both keys are provably total (priority and created_at
are non-null, id is unique) so a page boundary inside a run of equal keys
resolves on id. The seven other orders `bd list --sort` takes have no such key:
`id` is natural-numeric and no database expresses it, `updated` moves on every
write, `closed` is nullable, and status/title/type/assignee are mutable and
unindexed. `priority` here is (priority ASC, created_at DESC, id ASC), which is
both `bd list`'s flagless order and what `--sort priority` produces — a stable
priority sort over the created order is the same sequence — so one served order
retires the walk for both.
Absent `sort` still means `created`, permanently: it is the compatibility
contract for every client written before the parameter existed.
THE CURSOR NOW CARRIES ITS ORDER. This is the half that makes the parameter
safe rather than merely useful, and the obvious implementation gets it wrong.
The token was base64 of `{t,i}` with no binding, so a created-order cursor
replayed under `sort=priority` decoded perfectly and was read as a position in
a different total order — a page that skips and duplicates rows, served with a
200, undetectable by the client. Tokens are now `v2` with an explicit order
member, and decode takes the wanted order as a parameter so a mismatch is
unrepresentable at the seam rather than merely detectable past it. Outstanding
`v1` tokens stay readable as the created-order positions they are, so no
traversal in flight has to restart. This does not contradict "the token carries
no filters": filters select the set, the order decides what the position means.
Storage grows one field. IssueFilter.AfterPriority extends the existing
position; the predicate nests the created one rather than restating it, because
the created/id comparison is only reachable at the cursor's own priority.
Flattening it the way the created predicate's leading-bound trick invites looks
equivalent and is not — it re-delivers rows at the cursor's priority created
after it, which the new conformance walk catches against real Dolt.
NO INDEX MIGRATION, by measurement rather than by omission. A composite
(priority, created_at, id) index was tried on Dolt 2.2.0 against the production
predicate, in both the plain ascending and the mixed-direction spelling Dolt's
DDL accepts: the plan is byte-identical in all three cases, keeping the
single-column priority seek and the TopN. It would have bought write
amplification on every insert and every priority update for no measured change.
The sargability guard pins what is achieved — an IndexedTableAccess range on
idx_issues_priority — and records the measurement to redo if Dolt learns to
stream the composite.
Agent-Signature: claude-opus-5
Co-authored-by: CI Bot <ci@beads.test>
* fix(changelog): drop leftover diff3 conflict marker in sort entry
The rebased adopt-PR head left a stray '|||||||' merge-base marker on the first line of the new `sort` CHANGELOG entry (CHANGELOG.md:381), which `git diff --check` flagged as a leftover conflict marker. Remove only the marker line; the resolved entry content is unchanged. Maintainer fixup for PR #5666 adoption review.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: CI Bot <ci@beads.test>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* test(ci): red — gastownhall/beads: no PR-CI lane runs TestBenchDBPurgeDoesNotLeak against a live Dolt server (checkDolt SKIP) (refs be-aiy5)
* feat(ci): green — gastownhall/beads: no PR-CI lane runs TestBenchDBPurgeDoesNotLeak against a live Dolt server (checkDolt SKIP) (refs be-aiy5)
Add test-server-storage-full as a sibling job to test-server-storage in
pr-risk.yml. build-embedded already compiles every top-level test in
internal/storage/dolt into one binary (embedded-test-binaries); the
existing job only ever runs -test.run '^TestConformance$' against it.
The new job reuses that same artifact and live-server setup with no new
build step, and runs everything else via -test.skip '^TestConformance$'
so previously-stranded tests (TestCreateGuard_*, federation/concurrent
suites, and diff-owned tests such as TestBenchDBPurgeDoesNotLeak on PR
#5792) get a real PASS/FAIL instead of a silent SKIP. Sets
BEADS_TEST_ENV_RUN_DOLT=1 so federation_test.go's own live-server check
fails loudly rather than skipping if this job's setup ever regresses.
Wired into ci-gate: added to needs, CI_GATE_REQUIRED, and the
tier-gated skipped_ok fallback (mirrors test-server-storage's existing
treatment in each).
Also updates two pre-existing meta-tests over pr-risk.yml that pinned
exact snapshots of the file this job necessarily changes:
scripts/ci_capability_selector_test.go's ci-gate authority snapshot,
and scripts/pull_dolt_image_test.go's retry-helper call count
(pr-risk.yml: 2 -> 3, the new job's own Dolt-image-pull step).
* chore: release gate PASS for be-pp7e (PR-CI lane for TestBenchDBPurgeDoesNotLeak)
Deploy gate record for be-pp7e, gating be-aiy5's PR-CI lane addition
(runs TestBenchDBPurgeDoesNotLeak against a live Dolt server instead of
letting checkDolt SKIP it). Review: be-w90n, verdict pass. All 7 gate
criteria PASS; two pre-existing/unrelated failures encountered during
evaluation (be-jy56, be-vf95) were attributed and excluded from the
verdict.
* test(ci): red — shard test-server-storage-full across 16 matrix jobs (refs be-yy25)
TestPRRiskGateReachesFullServerDoltStorageSuite now asserts
pr-risk.yml's test-server-storage-full job is a fail-fast:false matrix
over shard 1..16, with the Test step invoking
server-storage-test-shard.sh, instead of pinning the old single-job
unsharded command. Fails against the current workflow, which still
runs all 1126 tests unsharded in one 15m job (be-extn).
* feat(ci): green — shard test-server-storage-full across 16 matrix jobs (refs be-yy25)
Adds .github/scripts/server-storage-test-shard.sh (mirrors
embedded-storage-test-shard.sh: discovers internal/storage/dolt/*_test.go,
excludes TestConformance, manifest-plus-hash-fallback shard assignment) and
its shard manifest .github/scripts/server-storage-test-shards.txt, pinning
TestCloudAuthCLIRouting (~9.5m) alone on shard 1 and spreading the other
known 10-20s-heavy tests across the rest.
pr-risk.yml's test-server-storage-full job becomes a fail-fast:false matrix
over shard 1..16, Test step now runs server-storage-test-shard.sh instead of
the old unsharded single-job command that died at 256/1126 tests after
15m28s with zero failures (job 95616282508).
Documents the new lane in engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md alongside the
existing embedded matrix description.
TestPRRiskGateReachesFullServerDoltStorageSuite now passes. Offline shard
partition verified disjoint and complete across all 1125 discovered tests
(BEADS_TEST_SHARD_LIST_ONLY=1 for i=1..16). (be-extn)
* test(feat): red — Fix: sharded lane runs prebuilt test binary from repo root, breaking ../schema/migrations and ../issueops (6 tests) (refs be-gepv)
* feat: green — Fix: sharded lane runs prebuilt test binary from repo root, breaking ../schema/migrations and ../issueops (6 tests) (refs be-gepv)
* chore: release gate PASS for be-23f3
Extends deploy/be-pp7e-gate (PR gastownhall/beads#5836) with be-gepv's
fix rather than cutting a fresh isolated branch: be-gepv's own bead
text and be-extn's precedent both establish this fix belongs on the
already-open PR. All 7 gate criteria PASS; two repo-wide lint/policy
failures attributed to already-tracked pre-existing issues (be-vf95,
be-jy56), confirmed untouched by this PR lineage.
be-gepv, be-6yo1, be-23f3
* fix(dolt): federation test isolation + panic (be-3c78s)
TestFederationDatabaseIsolation and TestFederationVersionControlAPIs are
federation-prototype tests that predate the suite's shared-server,
branch-per-test isolation architecture (setupTestStore/StartTestBranch)
and were never updated to account for it.
- setupFederationStore hardcoded Database: "beads" for both towns. New()
always connects in server mode against one shared Dolt server for the
whole test binary (TestMain), so Path alone doesn't isolate two stores
— Database does. Both towns silently shared one database, so Alpha
could read Beta's issues and vice versa. Give each town its own
database (beads_test_federation_<prefix>, matching the beads_test AD-01
cleanup-firewall prefix).
- TestFederationDatabaseIsolation's not-found assertions assumed GetIssue
returns (nil, nil) on a miss. It never does — issueops.GetIssueInTx
always returns a wrapped storage.ErrNotFound. Switched to
errors.Is(err, storage.ErrNotFound).
- TestFederationVersionControlAPIs hardcoded Checkout(ctx, "main") to
return to its "starting" branch, but setupTestStore already checks out
a private branch (test-<name>-<hex>) — "main" is a branch shared by
every parallel test in the binary and never has vc-001. That mismatch
is what produced the nil-pointer panic (GetIssue's error was discarded
via `_`, and the resulting nil issue was dereferenced). Capture the
real starting branch via CurrentBranch() right after setupTestStore()
and check both previously-discarded GetIssue errors before
dereferencing.
Neither bug is a production security issue: New(), Checkout(), and
GetIssue() all behave exactly as specified. Both bugs are confined to
this prototype test file's own setup/assertions, which hadn't caught up
to the isolation model the rest of the suite already uses correctly.
Verified via `go build`/`go vet`/`go test -c` (all clean) and running the
compiled binary, which now reaches and cleanly SKIPs both tests (no
Docker locally) instead of the previous isolation failure / panic
surfacing at compile-adjacent runtime. Full GREEN confirmation is via
CI, which has a working Dolt/Docker environment.
Refs be-3c78s
* chore: release gate PASS for be-42tlj
RunSearchPaging now owns these behaviors in the shared suite, and both
backends run it through their own TestConformance -> RunAll. Keeping the
backend-local copies would leave the same scenario asserted at two layers.
The deletions ride the same PR as the block that supersedes them, so no
window exists where a behavior has zero owning proofs.
The five retired embeddeddolt tests also leave the CI shard manifest
(.github/scripts/embedded-storage-test-shards.txt), which is why that file
moves in this commit rather than a follow-up: embedded-storage-test-shard.sh
validates every manifest entry against the discovered test set and exits 1
on a miss, and it does so for every shard, not only the shards owning the
stale names. Nothing is re-added — the script hash-distributes tests that
are not listed, and the manifest's own comment stops citing the retired
TestSearchIssues_MaxRows_* family as a spreading example.
Every retired assertion and its new owner, all under
backend/conformance RunSearchPaging:
internal/storage/dolt/keyset_search_test.go (partial; file kept)
TestSearchIssuesKeysetSameSecondOverflow
one-shot (created_at DESC, id ASC) order
-> KeysetWalkLosesNothingAndRepeatsNothing, one-shot leg
page-size-2 walk: nothing dropped, no id twice, page within Limit
-> KeysetWalkLosesNothingAndRepeatsNothing, walk leg
resume after k-a3 = [k-a4 k-a5 k-older]
-> KeysetResumeAnswersTheStrictlyAfterRows, mid-group leg
ksIDs / ksEqual helpers -> conformance orderedIDs + reflect.DeepEqual
TestSearchIssuesKeysetPlanIsIndexed -> KEPT. EXPLAIN sargability is Dolt
planner residue, outside the observable contract, and cannot move.
internal/storage/embeddeddolt/keyset_search_test.go (file deleted)
TestSearchIssuesKeysetEmbedded — the same two assertions as the dolt
twin above, same owners, reached on this backend through RunAll.
internal/storage/dolt/search_max_rows_test.go (file deleted)
MaxRows_NotExceeded (rows under cap -> all rows, nil)
-> MaxRowsAnswersTheTypedRefusal/UnderTheCapIsAnOrdinaryResult
Exceeded/FlagSource (errors.As, Found>3, Cap=3, Source "--max-rows")
-> .../OverTheCapAnswersTheTypedRefusal/cap3
Exceeded/EnvSource (Cap=2, Source "BEADS_MAX_ROWS")
-> .../OverTheCapAnswersTheTypedRefusal/cap2
MaxRows_Zero_NoCap -> .../ZeroDisablesTheCap
WithLimit/LimitUnderCap_NoError
-> .../ALimitAtOrUnderTheCapCannotFireIt/limit3_cap100
WithLimit/LimitEqualsCap_NoError
-> .../ALimitAtOrUnderTheCapCannotFireIt/limit3_cap3
WithLimit/LimitOverCap_FiresCap -> .../ALimitOverTheCapStillFiresIt
WithLimit/OnlyCap_FiresOnOverage
-> .../OverTheCapAnswersTheTypedRefusal/cap4
internal/storage/embeddeddolt/search_max_rows_test.go (file deleted)
The same eight assertions as its dolt twin, same owners, reached on this
backend through RunAll.
The shared cases are stronger than what they retire on three counts: the
retired cap tests asserted only len(results), where the new legs assert the
whole id set; the at-the-cap boundary (cap == matching rows) was never
covered; and the AfterID:"" group start and filter composition had no
backend-local copy at all.
Co-Authored-By: Claude Fable <noreply@anthropic.com>
Slice 1 of a test-deduplication pass against the conformance contracts. Net
-295 LOC: 8 test functions deleted, 4 files removed, 3 cases ported into
contracts, and — after adversarial review — one residue kept that the deletion
should not have taken.
Every deletion is backed by an assertion-targeted mutation showing the
contract goes red on the same break: blocker refusal, open-children refusal,
CheckVersionInTx on close and update, assignee guard, status guard, LabelPatch
ordering, ParentID replace-all, configured-done resolution, priority-range
validation. update_guards_test.go was additionally found partly cannot-fail —
its only ptr("") leg runs against a fresh unassigned issue and asserts
success, so it could not fail if ptr("") degraded to no guard.
Three cases ported to three legs. The first is the find of the slice: the
Lifecycle contract was green on three backends while EVERY case seeded a
DIRECT blocker, so a guard reading the denormalized is_blocked column instead
of the live blocker list passed all of them. That is 903cbe031, the Deleter
defect, verbatim in another contract.
An adversarial review council then found three things no gate could see — go
build, go vet, go test and golangci-lint were green over all of them:
The deletion orphaned five entries in the CI shard manifest, and the shard
script hard-fails on any entry that no longer matches a discovered test.
All five embedded-storage shard jobs would have exited 1 at startup.
The deletion removed the only observers of a public-API wrapper route.
EmbeddedDoltStore.{Update,Close}IssueChecked are a separate composition of
the shared bodies; disabling the wrapper's CAS branch failed the deleted
test and passed all 136 contract cases. A narrow wrapper-routing residue is
restored, verified red against that mutant.
The metadata port did not pin the Merge<Set order its own name leads with.
Its only Merge/Set collision was also in Unset, so a reordered body produced
an identical document and passed all 74 Update cases. Fixed with one key
written by both stages and removed by neither.
Kept deliberately: comments_page (live seam with no role — a uow provider is
not a DoltStorage), counts_wisp (Counter asks a different question),
reopen_category (seeds the wisp plane and the normalized custom_statuses
table), create_issue (defines newTestEnv/skipUnlessEmbeddedDolt for 58
siblings including all 26 conformance runners), and
issue_operations_persistence (the only file with no skipUnlessEmbeddedDolt
gate).
From lion's #5361 review: formatMemoriesForPrime called
ensureStoreActiveForPrime with no proxied gate — the bd-m7zzd direct-store
seam class, in a read-only limb. prime sits in noDbCommands, so no UOW
provider was ever opened; the lazy direct open then hit the store factory's
proxied refusal and the silent-skip contract swallowed it, meaning proxied
prime never carried memories at all.
The memory read now routes through the proxied plane (routing chosen over
skipping — the surface exists: ConfigUseCase().GetAllConfig on one
read-only UOW, same verb as the bd memories proxied dual), via a provider
opened scoped to the read and closed after. Prime's contracts are
preserved: silent skip when the plane is unavailable, the timeout banner on
a deadline, and memories rendered through a tail now shared with the
classic path (renderPrimeMemoriesFromAllConfig) so the two cannot drift.
Tests: TestProxiedServerPrime journey suite on the shared testcontainers
harness — memories-only and full prime carry the remembered key/content
(red before this fix: proxied prime printed 'No memories stored'), the read
lands zero Dolt commits, no embedded store dir materializes, and a corrupt
sidecar degrades to exit-0 silent skip. Shard manifest entry added at the
hash-fallback shard (6).
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* feat(unclaim): port --if-assignee to proxied-server mode (bd-tb0yi)
`bd unclaim --if-assignee` was refused outright under
BEADS_DOLT_PROXIED_SERVER ("not supported in proxied-server mode"); it now
runs the compare-and-swap release, and runs the SAME one the embedded
backend runs.
No new SQL is written for this port, and that is what holds the bar. The
conditional release reaches the classic implementation exactly as the
unconditional one already does: domain.IssueUseCase.UnclaimIfAssignee ->
IssueSQLRepository.UnclaimIssueIfAssignee ->
issueops.UnclaimIssueIfAssigneeInTx, the twin of the Unclaim ->
UnclaimIssue -> UnclaimIssueInTx chain beside it. So a conditional release
applies the same transition (assignee cleared, status reopened, started_at
cleared, lease row dropped, row_lock rewritten), records the same
"unclaimed" event, routes a wisp's claim to the wisp tables the same way,
and refuses with the same storage.ErrAssigneeMismatch naming the current
holder. Routing it instead through Lifecycle.Update + ExpectedAssignee
would have written the row correctly but recorded a generic update event
in place of the release, and diverged from the unconditional path inside
the same command.
The CLI passes the expectation as a plain string because the flag has only
two states here: `--if-assignee ""` is rejected in unclaim.go before any
issue is touched (an unset shell variable must never silently downgrade a
CAS to an unconditional release), so empty unambiguously means
unconditional.
EXIT CONTRACT, unchanged and deliberately not "improved": a mismatched
holder writes nothing and exits 1 on BOTH paths. `bd unclaim` has never had
`bd update`'s ExitGuardMismatch (13) verdict — its help says so outright
("1 when any release failed (including an --if-assignee mismatch)") — and
minting one on the proxied path only would be the exact divergence this
lane exists to prevent. If unclaim should adopt 13, it adopts it in both
modes, as its own change.
TestProxiedServerUnclaimIfAssigneeParity is the cross-mode oracle: six
steps (stale guard, matching guard, repeat release, `--if-assignee ""`
rejection, --force/--if-assignee rejection) run against an embedded
workspace and a proxied one, and every observable — exit code, post-step
row state, whether the refusal names the holder — must match, with each
mode also checked against the contract itself so parity with a shared bug
still fails. It rides a new cross-mode harness
(cross_mode_parity_harness_test.go): one initialized workspace per backend,
the same argv against both, outcomes compared field by field and never by
id.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014zUQg5iF119KbGeYuhXQ5Y
* feat(batch): port bd batch to proxied-server mode (bd-tb0yi)
`bd batch` was refused outright under BEADS_DOLT_PROXIED_SERVER; it now
runs, with the property that is its entire reason to exist intact: N
operations, ONE transaction, ONE commit, and whole-batch rollback on the
first failing line.
The split between the modes is exactly the command's own seam. The
grammar, the tokenizer, the arity checks, the dry-run echo, the
empty-input no-op, the default commit message and every byte of output
stay shared in batch.go — a batch script means the same thing whichever
backend runs it, and a script the parser rejects is rejected before either
backend is reached. What is per-mode is the transaction primitive and the
verbs the ops dispatch against: uow.RunTxResult + the unit of work's use
cases here, `transact` + storage.Transaction there. runBatchOpUOW mirrors
runBatchOp op for op, including its error strings.
RunTxResult, not RunTxEphemeral: a batch writes versioned tables, and the
ephemeral form commits with no Dolt commit (its whole point for the leases
table), which would persist these writes while bypassing Dolt history. The
retry it brings redoes the WHOLE batch in a fresh unit of work on a
serialization failure — re-executed against the winner's committed rows,
never re-committed on a session the server already rolled back — and the
per-attempt result slice means a retried batch reports the attempt that
actually committed.
Plane routing is explicit because it has to be: the classic transaction
methods route an id to the issues or wisps tables themselves, while the
domain exposes the planes as separate verbs. close/update resolve through
workapi.GetIssueOrWisp inside the transaction and call the matching verb;
dep add/remove use the source-routed AddDependencies /
RemoveDependencyBySource, which land each edge in the plane its own source
lives in. `close` is deliberately the UNCHECKED close, matching the classic
batch: `close <id>` in a batch applies no close policy, while an `update`
that crosses into done does — an asymmetry the command's help documents.
TestProxiedServerBatchParity is the cross-mode oracle, on the F0-style
harness: the same script runs against an embedded workspace and a proxied
one, and exit codes, the summary line, the per-line report, and the rows
left behind must match — including the two transactional cases that are
the point (a failing last line undoing the successful lines before it, and
a grammar error writing nothing at all).
TWO KNOWN DIVERGENCES are named at their sites and left for their own
change, because neither changes the rows a batch lands and both are
classic-batch inconsistencies with the CLI verbs rather than artifacts of
the port: an out-of-range `priority=5` is written by the classic batch and
refused by the proxied one (the domain update funnel validates the range,
issueops' transaction path does not; `bd update --priority 5` is refused on
both), and a batched `dep add`/`dep remove` records a dependency history
event here and not there (every domain edge verb emits, the classic batch's
bare transaction method does not — and `bd dep add` at the CLI emits on
both backends, which is what makes the classic batch the outlier).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014zUQg5iF119KbGeYuhXQ5Y
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* feat(recompute-blocked): port to proxied-server mode (bd-04vav)
`bd recompute-blocked` stops refusing proxied-server mode. It is the
mode-independent repair for a stale is_blocked column (bd-6dnrw.37) and
wh-bridge-sync's remedy after a cross-machine merge, so a constellation
running on the proxied plane without it has no way to repair the flag
`bd ready` trusts.
Parity is by construction rather than by assertion: the whole
in-transaction body (dirty-graph guard + fixpoint recompute), the commit
message, and the staging set now live in ONE place,
versioncontrolops.GuardedRecomputeAllBlockedInTx /
BlockedRecomputeCommitMsg / BlockedRecomputeStagedTables, which the
embedded store, the server store and the new proxied route all call. The
CLI's two rendered branches are likewise one function shared by both
routes. Nothing about the repair's semantics is restated per mode; what
differs is only how each mode gets its connection.
The proxied route runs on a PINNED non-transactional connection
(uow.MaintenanceProvider, as compact/gc already do) rather than through
uow.RunTx*, for two reasons specific to this command: the post-commit
DOLT_ADD/DOLT_COMMIT are stored procedures Dolt refuses inside an
explicit transaction, and the uow commit path stages with '-Am' while
this repair must stage `issues` ALONE — a commit whose entire content is
a derived flag has no business sweeping an unrelated dirty working set,
which is the very thing the read-side guard exists to prevent.
StageAndCommit grows an empty-author form for that call: proxied-mode
commits are unauthored by design (uow.Tx.Commit passes no --author), and
an empty '--author' argument would be malformed rather than
unattributed.
admin cleanup stays gated. The 2026-08-04 recon on bd-04vav found it has
no wheelhouse call sites, so porting it would be untested surface area
bought for nobody.
TestProxiedServerRecomputeBlocked is a cross-mode oracle: the same
corrupt-then-repair scenario is replayed against a classic embedded
workspace and a proxied one, and every observable — both rendered
branches and the corrected-row count — must match, with the shared
values additionally pinned so a symmetric regression in both modes still
fails. It also covers what wh-bridge-sync actually depends on
(idempotency, honest exit codes), that a no-op repair mints no Dolt
commit, and that the dirty-graph refusal survived the port.
Part of bd-vxavz (proxied-server capability parity).
* test(delete/prune/purge): cross-mode cascade parity, and a data-loss divergence (bd-04vav)
The verification half of F7. Proxied `bd delete` "always cascades"
(--cascade is refused outright) while classic cascades only when asked,
so the question the constellation needs answered before cutover is not
"is the flag there" but "does the cascade reach anything classic would
have left alone" — on the shapes the wheelhouse actually runs.
TestProxiedServerCascadeParity replays three of them against a classic
embedded workspace AND a proxied one and compares the outcomes, so a
difference is reported as a difference rather than as one mode's test
failing alone: wh-gate-sweep's delivery-ledger purge, the wisp-decay
close + `purge --pattern '*' --force` pair, and a reference-aware durable
`prune` sweep.
FINDING — proxied delete of a gate destroys the bead it gated.
`bd gate create --blocks <target>` records the edge as target
DEPENDS-ON gate, so the gated bead is a DEPENDENT of the gate row. On the
proxied plane wh-gate-sweep's `bd delete <gate> --force` therefore
deletes the target and everything downstream of it; classic leaves both
standing. Measured, not inferred: proxied {gateGone:true,
targetSurvives:false, siblingSurvives:false} vs classic {true, true,
true}. This is a shared-server cutover blocker, and the fix is a design
call on what --cascade should mean in proxied mode (three existing
proxied delete suites deliberately pin today's unconditional cascade), so
it is filed rather than smuggled in here.
The subtest CHARACTERIZES the defect: the classic half pins the correct
behavior, the proxied half pins exactly today's blast radius, and the
comparison is logged loudly. The suite stays green while the divergence
is open and fails the moment the damage changes in EITHER direction —
including when it is fixed, at which point the expectation is flipped to
match classic and the paragraph explaining it goes away.
Wisp decay and prune agree across modes with no divergence: the closed
wisp is reclaimed while a durable closed bead and an open wisp survive
(purge is ephemeral-only and closed-only), and prune protects a closed
bead an open bead still cites.
Part of bd-vxavz (proxied-server capability parity).
Two P1-1 residual proxied-mode seams from the bd-6dnrw.44 re-verification,
both PORTED (each was genuinely small):
- bd dep relate/unrelate: no usesProxiedServer() branch meant an opaque
"cannot resolve issue ID: storage is nil" death. Now routed through new
runRelate/UnrelateProxiedServer duals: one RunTx with a real commit
message per invocation (both directed relates-to edges in one Dolt
commit for relate; both removals in one for unrelate, empty-message
no-op when neither edge existed), classic "issue not found" /
self-relate refusals preserved. Exact canonical ids only, like every
other proxied dep verb.
- bd human list/respond/dismiss/stats: each called ensureStoreActive(),
which in proxied mode lazily opened a DIRECT store, silently bypassing
the proxy. Root cause: "human" sits in noDbCommands for its bare help
screen, so its DB-backed subcommands skipped store init entirely and
direct mode papered over it lazily. The subcommands now fall through to
store init (needsStoreHumanSubcommands, dolt-subcommand pattern) and
branch to proxied duals before the direct-store path: reads on one
read-only UOW, respond/dismiss each ONE RunTxResult (existence +
already-closed preflight, comment + close in the same transaction)
under "bd: human respond/dismiss <id>" commit messages. human moves to
the forbidigo proxied-twin family in .golangci.yml (same filter built
on both routes).
Tests: TestProxiedServerRelate + TestProxiedServerHuman journey suites on
the shared testcontainers harness, incl. dolt_log assertions that each
write invocation lands exactly one commit with its own message, and that
the "storage is nil" death is gone; shard manifest entries added at the
hash-fallback shards (7, 11).
Claude-Session: https://claude.ai/code/session_01JtAkNTf8DGzP1AF3FMuGmm
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Both commands are pure computed reads (epic progress; ready fronts +
cycle detection), so they route through one read-only unit of work via
uow.RunTxRead — no commit message, no Dolt commit, no commandDidWrite —
with the existing uowMolReader adapter satisfying the SwarmStorage seam
(and utils.PartialIDResolverStore) over the UOW use-cases. All traversal
and rendering code is shared with the classic route unchanged.
swarm create and swarm list stay gated with their existing refusals
(no downstream consumer).
TestProxiedServerSwarm builds an identical explicit-ID epic DAG (one
closed, one in_progress+assignee, one ready, one blocked child) in a
proxied project and a classic embedded project, and asserts status +
validate human output byte-for-byte and --json deep-equal across modes,
a planted-cycle validate failure (proxied-only: classic embedded has no
bd sql and dep add cycle-gates, so there is no classic door to plant
one), the create/list refusals, and that the reads advance no Dolt HEAD.
Claude-Session: https://claude.ai/code/session_01JtAkNTf8DGzP1AF3FMuGmm
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* feat(export): port bd export to proxied-server mode (bd-o58fz)
Remove the proxied-server gate from bd export and route the command's
storage reads through an exportSource seam:
- storeExportSource preserves the classic (embedded/direct/server) call
pattern over the store global, verbatim.
- uowExportSource reads through the proxied unit of work's domain use
cases, with the whole read set inside ONE uow.RunTxRead transaction
(read-only, never committed) so the export is a consistent snapshot.
Plane-pinned use cases are re-partitioned to match the classic bulk
loaders: labels/comments partition by the row's own Ephemeral/NoHistory
flags; dependency records already partition internally; dependency
counts sum both planes for every id, as classic does.
Everything downstream of the reads (filtering, sanitizeZeroTime, record
shaping, marshal order, atomicfile, stderr summary) is shared code, which
is what holds the byte-identical cross-mode output bar. Ordering parity
holds because both stacks render ORDER BY from the same sqlbuild.SortDefs
(priority ASC, created_at DESC, id ASC; labels by issue_id,label;
comments by created_at,id; memories sort.Strings).
TestProxiedServerExport builds a rich fixture through the proxied CLI and
asserts flag semantics plus the acceptance oracle: proxied export,
imported into a fresh classic embedded workspace and re-exported, is
byte-identical (default shape and --include-memories shape).
buildOwnerExcludeSet's export_auto.go call site is adapted to the new
seam signature (classic source over the same store global); auto-export
behavior is unchanged and its proxied port stays a separate bead.
export_source.go joins the bulk-movement forbidigo family in
.golangci.yml (it carries export.go's filter, it does not build one).
The import half is NOT in this change.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018YmpYVCa5eN6JtG26dJLMs
* fix(export): classify relation planes by table membership, not row flags (bd-o58fz)
Review items on #5351:
1. LoadExportRelations queried the wisp plane for any row carrying
Ephemeral or NoHistory — but a promoted no-history wisp is a durable
issues-table row still flagged NoHistory (promote clears only
Ephemeral), so its durable-plane labels/comments were silently
dropped. Both planes are now queried with the full ID set and merged
(ID-disjointness per the GH#4455 cross-table guard), matching what
the dep-counts leg already did; wisp-plane reads tolerate
IsTableNotExist like that leg too.
2. The byte-identity oracle is blind to symmetric omissions, so the
suite now asserts seeded content directly (labels, comment texts,
comment_count, dependencies, blocks-only dep counts) and adds a
promoted no-history fixture row in its own project. That shape stays
out of the round-trip fixture deliberately: classic IMPORT routes by
the same flag heuristic (issueops.IsWisp) and re-planes the row into
the wisps table, a pre-existing export/import infidelity filed as
bd-r9uce.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NvU6bUda8oQjvG3zoa4uyX
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
bd promote stops refusing proxied-server mode and routes through the UOW
plane via a new cross-plane domain verb: IssueUseCase.PromoteWisp ->
IssueSQLRepository.PromoteFromEphemeral -> the exact classic
issueops.PromoteFromEphemeralInTx body, widened from *sql.Tx to DBTX so
both modes share one implementation (same id preserved, wisp_type
retained, labels/deps/events/comments carried across, inbound
wisp-targeted edges retargeted, blocked state recomputed). The widening
replaces the NewBatchContext call (which needs *sql.Tx) with the same
two config reads it performed internally (ResolveCustomStatusesDetailedInTx
+ CustomStatusNames, ResolveCustomTypesInTx) — verified semantically
identical composition.
Commit semantics: exactly ONE Dolt commit per invocation ("bd: promote
<id>", the classic message), pinned by the journey test. The wisp-side
deletes touch dolt_ignored tables; the one transaction still makes the
wisp delete and issues insert atomic.
One deliberate tightening vs classic (documented divergence): the
promotion comment shares the promote's transaction, so a failed comment
write rolls the promote back instead of degrading to a stderr warning —
atomic beats warn-and-continue.
Success output (text + --json best-effort re-read) extracted into shared
printPromoteResult/promotionComment so the two routes cannot drift.
Journey test TestProxiedServerPromote (4 subtests, sharded 15/8):
row-rewritten-in-place with edges/comments preserved and dolt-commit
count == 1; --json shape vs classic; one-way (purge no longer reclaims,
prune does); non-wisp and missing-id error contracts.
Verification note: TestRecomputeAllBlocked_AllowsDirtyWisps
(internal/storage/dolt) fails identically on the unpatched origin/main
baseline on this machine (FAIL-set diff empty; filed bd-7xtsq) — not
attributable to this diff.
Claude-Session: https://claude.ai/code/session_01JtAkNTf8DGzP1AF3FMuGmm
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
bd heartbeat stops refusing proxied-server mode and routes through the UOW
plane. The port preserves the two properties that define heartbeat:
- ZERO Dolt commits per invocation (bd-lrgn1). The lease write lands in the
dolt_ignored leases table under a new uow.RunTxEphemeral helper, which
commits the transaction with a plain SQL COMMIT (Tx.Commit with an empty
message) instead of CALL DOLT_COMMIT — the proxied analog of the classic
DoltStore.withRetryTx commit discipline. RunTx/RunTxResult semantics are
unchanged (they never call Commit on an empty message); serialization
losers (heartbeat vs reclaim/close on the same lease row) replay exactly
like RunTxResult.
- Timestamp/classification parity with classic mode. The new repo verb
IssueSQLRepository.HeartbeatIssue delegates to the identical classic body,
issueops.HeartbeatIssueInTx — same clock (time.Now().UTC()), same TTL
resolution (issueops.LeaseTTL), same only-current-owner classification
(ErrAlreadyClaimed / ErrNotClaimable), same lease re-arm for hand-doled
claims, same wisp refusal — so classic bd reclaim staleness semantics see
proxied heartbeats identically.
Success output (text + the {"id","status":"heartbeat","owner"} --json shape)
is extracted into renderHeartbeatSuccess and shared by both routes, so the
worker-facing contract cannot drift between modes. Exit code remains the
contract: rc 0 = lease refreshed, nonzero = the lease is gone and the worker
should stop. --actor overrides the ownership-check source in both modes.
Journey test TestProxiedServerHeartbeat (shared testcontainers server,
database-per-test) covers: stale-lease rescue with lease_expires_at /
heartbeat_at advanced and dolt_log count unchanged; reclaim ignoring a
just-heartbeaten lease; --json shape; wrong-owner / unclaimed / closed /
missing refusals; and the lease re-arm INSERT path, also under the
zero-Dolt-commit assertion. Sharded at 15/7 in the proxied test manifest.
No behavioral divergences from classic mode. (Failure-message prefixes gain
the domain-layer wrapping other proxied ports carry; classification
sentinels and exit codes are identical.)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* feat(gate): port create/add-waiter/resolve/show to proxied-server mode (bd-v50ru)
Four gate subcommands stop refusing proxied-server mode and route through
the UOW provider, following the conventions gate check/list already set in
cmd/bd/gate_proxied_server.go:
- gate create: ONE RunTxResult doing target lookup + CreateIssue +
AddDependency under a single commit message ("bd: create gate <id>
blocking <target>") — the direct route's create + add-dep + explicit
store.Commit collapse into one Dolt commit per invocation.
- gate add-waiter: one transaction; an already-registered waiter returns an
empty commit message (deliberate no-commit no-op). Fires the on_update
hook post-commit.
- gate resolve: one transaction (type check + CloseIssue), then audit
LogFieldChange + close hooks post-commit, mirroring gate check's closes.
- gate show: read-only UOW; not-found and read-failure exit nonzero with
distinct messages (fail-closed: an unreachable server is not "no gate").
Output parity is enforced structurally: the direct route's renderers and
gate-create input/issue construction are extracted (renderGateShow,
renderGateCreated, renderGateResolved, renderGateWaiterAdded/Already,
gatherGateCreateInput, buildGateIssue) and both routes call the same code,
so the text downstream scripts parse cannot drift.
gate discover keeps its proxied-mode refusal: it interleaves GitHub CLI
queries with per-gate writes and incremental output, so it is not the pure
routing this port covers.
Also fixes the latent domain/db bug the new journey test caught: the
proxied repository's normalizeUpdateValue never serialized "waiters", so
any waiters update through the proxied backend failed at the SQL driver
("unsupported type []string"). It now JSON-marshals the value exactly as
the embedded path (issueops.updateIssueInTx) always has, with a unit test
pinning the behavior.
New journey test TestProxiedServerGateLifecycle covers the wheelhouse
consumer shapes (gate-id parsing from create output, wh-park bead-gate
create, show markers, list --all --json fields, rc-only resolve,
fail-closed error paths) and is listed in the proxied shard manifest.
Part of bd-vxavz (proxied-server capability parity).
* fix(ci): drop stray duplicate TestProxiedServerDelete shard line (bd-v50ru)
Review blocker on #5346: the duplicate tripped proxied-test-shard.sh's
duplicate check and failed all 15 Proxied Dolt Cmd shards, so
TestProxiedServerGateLifecycle never ran in CI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NvU6bUda8oQjvG3zoa4uyX
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Remove the "not supported in proxied-server mode" gates from bd kv
(set/get/clear/list) and the memory surface (remember/memories/forget/
recall). Both are thin prefix layers (kv.* / kv.memory.*) over the config
table, so the handlers mirror config_proxied_server.go: one RunTx per
write invocation with a real commit message ("bd: kv set <key>",
"bd: kv clear <key>", "bd: remember <key>", "bd: forget <key>"), reads
via RunTxRead. The proxied path never touches ensureDirectMode; the
classic path keeps it.
Presentation and namespace filtering are extracted into helpers shared
by both paths (printKV*, kvPairsFromConfig, printRemember*/printForget*/
printRecall*, memoriesFromConfig, rememberBareKeyPath), so output —
including the kv list --json shape that the wyvern wheelhouse mail
transport parses — cannot drift between modes. Key validation and the
remember desire-path/command-word guards run before dispatch and behave
identically in both modes. Storage errors pass through %v unmodified so
callers can keep retrying on the 'Merge conflict detected' /
'constraint violation, transaction rolled back' substrings.
Journey tests: TestProxiedServerKV (byte-preserving multi-line/JSON
envelope round-trip, list --json shape + classic-vs-proxied comparison,
idempotent clear, invalid-key refusal, one-Dolt-commit-per-write) and
TestProxiedServerMemory (remember → memories → recall → forget journey,
kv.memory.<key> storage-key check, bare-key desire path, command-word
guard, one-commit-per-remember). Manifest entries added at the shards
the hash fallback already assigns (13/14), so nothing reshuffles.
Refs bd-dnzjy, program bd-vxavz.
Record fail-closed candidate lane selection without changing which PR Risk jobs execute. This creates replayable evidence for capability-owned admission while branch protection and historical validation are still pending.
Agent-Signature: codex-unknown-model-unknown-reasoning on behalf of CI Bot
Co-authored-by: CI Bot <ci@beads.test>
The audit read TestProxiedServerServeReadParity as unenforced on PRs because it
does not appear in pr.yml. It is enforced, in the other PR-time workflow:
pr-risk.yml's test-proxied-cmd job runs `on: pull_request`, discovers every
`^func TestProxiedServer` in cmd/bd/*_test.go, and feeds TEST_PROXIED_CMD into
that workflow's "CI Gate / Required". Its concurrency group is keyed on the PR
number, so it is not the perpetually-cancelled Main workflow. Verified by running
the lane's own discovery across all fifteen shards: the oracle appears in exactly
one.
What was true is that it appeared there by HASH FALLBACK. The manifest header
asks for a regenerate after adding a TestProxiedServer* function, and neither
`bd serve` suite was ever added, so the assignment was incidental rather than
reviewed and nothing in the file said the parity oracle was in the lane at all.
Both suites are listed at the shard the hash was already choosing (8), which is
zero behaviour change and avoids reshuffling the other 100 entries — a full
regenerate rewrites 202 lines across tests this branch never touched. Verified:
shard 8 now reports `manifest: 8, fallback: 0`.
Two further tests remain unlisted (TestProxiedServerCleanDatabasesPurgeDropped,
TestProxiedServerReassignFence). They are not from this branch and still
distribute by hash, which is the supported path; a cost-rebalancing regenerate
is the change that should pick them up.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The first slice that runs a server. Proxied-server workspaces go live; the
read and claim operations are registered as transitional 501 stubs so route
and spec parity can be proved all at once instead of growing a hole per slice.
`bd serve --addr 127.0.0.1:0 [--allow-non-loopback]`, and no other flags in
v0. The bound address is stdout's first line, because under the ephemeral
default it is the only way to find the port. Shutdown rides the signal context
the root command already installs. No lock file, pid file or discovery file:
serve is operator-invoked and the TCP bind IS the mutual exclusion — dbproxy
needs that machinery only because clients race to auto-spawn it.
The mode gate says two different things, deliberately. Embedded is a PERMANENT
typed storage.ErrUnsupported: there is no unit-of-work provider for that
backend. Dolt server mode is STAGED — the provider construction exists and is
tested, it just is not wired in yet — so the text names what works today and
says this does not, rather than reading as an architectural limit that would
send an operator off to change their topology for nothing.
One unit of work per request, closed through a DETACHED context. The
transaction layer poisons the pinned connection when a ROLLBACK send fails
(doltserver_tx.go), so closing with the request's own canceled context would
burn a session on every client disconnect.
Front-tier hardening lands here, not later, because without it a hung Dolt
becomes a silently growing black hole: slots fill with immortal queries,
/healthz stays green because it never touches the database, and recovery
produces a thundering herd. So: a Host-header allowlist (DNS-rebinding defense
for an unauthenticated, browser-reachable loopback service), a
netutil.LimitListener connection cap (Go spawns a goroutine per connection, so
the database semaphore alone does not bound what is accepted), a database
semaphore with a BOUNDED 10s wait mapping to the already-documented 503 busy,
a 60s per-request deadline, and explicit pool limits on the provider's *sql.DB
via a new uow.PoolTuner knob — openDB set none, and database/sql's default is
unlimited.
/v0/beads/context serializes an explicit ten-field allowlist and nothing else.
SyncRemote is hard-excluded in this and every future version: it is populated
unconditionally from config sync.remote, and remote URLs routinely embed
credentials. The database bind endpoint and the remaining absolute host paths
are excluded too. `capabilities` is derived from IMPLEMENTED handlers only, so
a release cut between this slice and the endpoint slices advertises only what
actually works.
The observability floor is an acceptance criterion, not a convention: one
structured stderr line per request (method, path, status, problem code,
duration, semaphore wait, unit-of-work acquire), startup and shutdown lines, a
semaphore-saturation event, and a request_id on every problem response. That
last one required documenting request_id on the spec's Problem schema — the
only spec edit here, additive, with types regenerated.
Decisions implemented as given: hooks do not fire (a user-controlled
subprocess per mutation is an unbounded latency multiplier and an orphaned
child at shutdown); the per-command auto-commit globals are never touched
(nothing to exclude — proxied PersistentPostRunE only closes the provider);
and actor on an HTTP request stays caller-asserted provenance, which the
context and capabilities wording does not contradict.
Tests: TestSpecRouteParity asserts set equality between the route table and
the document's paths, and builds the real mux so a pattern ServeMux would
refuse fails here rather than on the first request.
TestSpecStatusCodesMatchHandlerTable carries a commented, enumerated 501
exemption that is self-deleting — it fails if the route table and the list
disagree, and fails again if the list outlives the last stub. The context
allowlist is enforced from the handler out, over a body built from a snapshot
with every field populated and a credential-bearing sync remote.
TestWithUOWClosesWithADetachedContext records the close context's state AT
close time, which is the only moment it says anything.
Verified: build, vet and golangci-lint clean (the two gosec findings in
cmd/bd/main.go pre-date this change); internal/httpapi green under -race;
protocol corpus byte-identical with BEADS_PROTOCOL_REQUIRE_DOLT=1; and a real
server started against a proxied workspace, answered both endpoints, refused
a foreign Host, an unknown query key and a second bind, and drained to exit 0
on SIGTERM.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Test (Embedded Dolt Storage) ran the ~84-function internal/storage/embeddeddolt
suite (minus TestConformance) as a single unsharded job, ~24.3min and the
longest pole in every Main/PR-Risk run per engdocs/CI_CLEANUP_PLAN.md and
mybd-t8l8; it timeout-red'd upstream main at its 30m suite budget twice on
2026-07-28 (mybd-jobt).
Extends the existing test-embedded-cmd manifest-driven scheme
(embedded-test-shard.sh + embedded-cmd-test-shards.txt, already 20-way) to the
storage job: new embedded-storage-test-shard.sh discovers top-level Test*
functions in internal/storage/embeddeddolt/*_test.go (excluding
TestConformance, which stays in its own job), consults a committed manifest
(embedded-storage-test-shards.txt) for balance, and hash-falls-back for
newly-added tests. No per-test timing data exists for this suite, so the
manifest assigns the 83 discovered tests round-robin over the alphabetically
sorted list for 5 shards (17/17/17/16/16), which spreads related families
(the 7 TestEmbeddedMergeAndSettle*, ~11 TestEmbeddedMigrat(e|ion)*, 4
TestSearchIssues_MaxRows_*) across shards instead of clustering them.
test-embedded-storage becomes a 5-way matrix job in both main.yml and
pr-risk.yml, per-shard timeout-minutes: 15 and -test.timeout=15m (half the
old 30m budget, matching that each shard carries roughly 1/5 of the tests and
~2-3 of the ~11 migration-chain tests that motivated the original 20m/30m
budget per bd-lrgn1). Job id test-embedded-storage and its BEADS_TEST_EMBEDDED_DOLT
env stay the same, so pr-risk.yml's ci-gate needs/CI_GATE_REQUIRED wiring
(TEST_EMBEDDED_STORAGE) is unaffected by the matrix split; only the job's
display name changes shape, from "Test (Embedded Dolt Storage)" to
"Test (Embedded Dolt Storage N/5)". Updated the two required-check-name
references to that in engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md and
engdocs/CI_TEST_SURFACE_AUDIT.md.
Conformance (core/audit, ~14min each, mybd-ae0n) is left alone: TestConformance
is sharded by sub-test path via -test.run '^TestConformance$/^Audit$', a
different mechanism from this manifest's exact top-level function-name
matching, so it does not extend naturally in this commit.
Agent-Signature: claude-fable-5-high on behalf of maphew
Adds the 14 new TestProxiedServer{MolShow,MolCurrent,MolProgress,
MolLastActivity,MolStale,MolReadyGated,MolDistill,Pour,MolBond,
MolSquash,MolBurn,WispCreate,WispList,WispGC} entry points to the
committed 15-shard manifest via scripts/ci/gen_proxied_shard_manifest.py,
so they run with pinned, cost-balanced shard assignments in the
test-proxied-cmd CI job (main.yml and pr-risk.yml) instead of falling
back to hash-based distribution. Verified via
`proxied-test-shard.sh <N> 15` with BEADS_TEST_SHARD_LIST_ONLY=1 across
all 15 shards: every test resolves via the manifest with zero fallback
and no validation errors.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The proxied cmd lane is init-bound: each subtest's bd init runs the full
migration chain, so a shard's wall-time tracks its total init count. The six
heaviest suites (Update 56 inits, Show 47, Create/Close 41, Dep 36, Ready 34)
were each a single top-level function, and a function is the atomic unit of
sharding — so no shard split could pull the worst shard below Update's ~169s
(local), which is what kept brushing the 15m budget on CI.
Split each of the six into 2-3 top-level functions (Update/Show ->3, the rest
->2), balanced by init count, by inserting function boundaries between the
already-independent per-subtest blocks — no test logic moves, every t.Run set
is byte-identical to before. Regenerate the 15-shard manifest by greedily
bin-packing every TestProxiedServer* function by init count
(scripts/ci/gen_proxied_shard_manifest.py); the heaviest shard drops from ~56
to ~31 estimated inits, roughly halving the long pole.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The proxied suites are init-bound (each per-subtest project runs the full
migration chain), so the heaviest shards were brushing the 15m budget and
occasionally timing out. Widen the matrix from 8 to 15 shards in both the
main and pr-risk workflows and rebalance the committed manifest, greedily
bin-packing by estimated cost so the six heaviest suites (Update, Show,
Create, Close, Dep, Ready) each own a shard and the rest pack evenly.
Estimated worst shard ~600s, comfortably under the 900s timeout.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The per-subtest project split multiplied bd init calls (each runs the full
migration chain on a fresh DB): epic 2->8, set-state 1->4, unclaim 2->9,
defer 1->7. That is added, not saved, wall-clock on already-saturated
shards and pushed shard 4/8 over the 15m budget. Revert those five suites
to one shared project per test function (the read-suite pattern), and move
the pre-existing heaviest suite (Ready: 36 subtests / 34 inits) off the
overloaded shard 4 onto the near-idle shard 8.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- beads-release formula: drop the snapshot-docs step (ran the deleted
scripts/snapshot-release-docs.sh on the critical needs-chain); stamp-
changelog now needs update-vendorhash
- update-versions.sh: remove the mangled --skip-docs/docs-snapshot logic
and garbled usage text left by mid-line deletions
- pre-push hook: drop the snapshot-script remediation hint
- release.yml: collapse the prerelease branch; BEADS_REQUIRE_RELEASE_DOCS
has no consumer since check-docs-version.sh was deleted
- RELEASING.md / scripts/docs.md: describe the current pipeline (no
--versioned, no website/ outputs, no check-docs-version.sh)
- docs-mintlify.yml: paths filter now includes engdocs/** and the curated
root markdown files the docsync guard validates
- docs-render-check.sh: pin mint@4.2.687, fail closed when mint dies
without producing a broken-links report, parse report lines only, drop
dead extract_page_links(), fix the stale jq requirement; mint.sh pins
the same version
- nightly.yml: remove the deleted website measurement suite option
- CODEOWNERS: init-safety ADR gate follows the file to engdocs/adr/
- beads-docs skill: align with settled decision 6 — no pointer stubs,
moved pages get docs.json redirects; bd's printed paths are fixed at
the source
- CHANGELOG (edited line), FEDERATION-SETUP, README, examples, oracle-a,
.buildflags, gh-issue-to-pr formula: retarget moved-file references;
anchor the build/ gitignore pattern
- mint.sh + make docs-dev: local preview of the docs/ Mintlify site
(Node 22 handling modeled on the Gas City wrapper).
- test/docsync: Go guard keeping docs/ and docs.json in exact
correspondence — every nav entry has a file, every page is in the nav
(tiny stub allowlist for paths released bd binaries print), published
pages use root-relative extensionless links that resolve, and engdocs/
plus curated root markdown keep exact GitHub-style paths. Wired into
make check-docs.
- .github/workflows/docs-mintlify.yml: docsync + baseline-aware
mint broken-links check on PRs touching docs/**.
- Retire scripts/sync-website-docs.sh and its mirror-drift gate: the six
mirrored files now live once in the Mintlify site; the committed
Docusaurus mirrors stay frozen so the parallel-run site keeps building.
- Repoint inbound links to moved docs across README, guides, examples,
npm-package, plugin resources, and Go comments; add docs/SYNC_CONCEPTS.md
pointer stub (bd's agent templates print that path). Runtime strings in
cmd/bd (prime.go, store_factory_nocgo.go, init_git_hooks.go) still print
old paths — covered by stubs, flagged in the PR.
Converges the sprinkle of -tags=gms_pure_go fixes into a single source plus a source-time CI guard. .buildflags is now canonical (exports GOFLAGS, CGO_ENABLED), scripts source it, scripts/check-build-tags.sh runs in CI to catch bare go commands. Fixes 5 latent bugs the guard caught (regression.yml, Makefile bench/test-regression, devcontainer, embedded-test-shard fallback, smoke-test scripts).