beads/.github/scripts
Jim Wordelman 9d646fc887
fix(dolt): server-mode bd ready never wakes expired defers (re-proposes #6082) (#6424)
* 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>
2026-09-30 15:53:22 -07:00
..
bazel-farm-authorize.sh ci(bazel): remote-execution Bazel lanes for allowlisted fork authors (advisory) (#6994) 2026-09-30 14:54:06 -07:00
bazel-gate.sh ci: gate PRs on the Bazel lanes, alongside the legacy jobs (D1) (#6941) 2026-09-29 03:33:20 -07:00
ci-capability-selector.sh ci: shadow PR Risk capability ownership (bd-8yjq8.1) (#5324) 2026-08-03 20:06:16 -07:00
ci-embedded-tier.sh Tier embedded Dolt CI for PRs (bd-0gz) (#3459) 2026-04-24 07:53:23 -07:00
ci-gate.sh Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
docs-render-check.sh chore: purge deleted docs-pipeline references from release tooling, CI, and repo plumbing 2026-07-12 11:07:26 -07:00
embedded-cmd-test-shards.txt Rebalance embedded cmd CI shards (bd-8zg) (#3499) 2026-04-25 17:58:51 -07:00
embedded-storage-test-shard.sh ci: shard Embedded Dolt Storage into 5 manifest-driven shards (#5117) 2026-07-28 22:16:48 -07:00
embedded-storage-test-shards.txt test(storage): demote the duplicated keyset and max-rows backend tests 2026-08-07 20:32:19 +00:00
embedded-test-shard.sh Rebalance embedded cmd CI shards (bd-8zg) (#3499) 2026-04-25 17:58:51 -07:00
proxied-cmd-test-shards.txt fix(dolt): server-mode bd ready never wakes expired defers (re-proposes #6082) (#6424) 2026-09-30 15:53:22 -07:00
proxied-test-shard.sh fix(dolt): server-mode bd ready never wakes expired defers (re-proposes #6082) (#6424) 2026-09-30 15:53:22 -07:00
server-storage-test-shard.sh ci: PR-CI lane runs the full internal/storage/dolt suite against a live Dolt server (#5836) 2026-08-19 20:39:38 -07:00
server-storage-test-shards.txt docs(ci): update shared cloud routing shard rationale (#6432) 2026-09-27 01:57:07 -07:00