* test(feat): red — cmd/bd capture helpers leak os.Stdout on t.Fatal (refs be-leuf)
Add TestCaptureCycleStdoutRestoresOnFatal (dep_cycles_test.go) and the
package-wide TestZZStdioNotLeaked guard (zz_stdio_leak_guard_test.go).
Both express the be-gh02 acceptance criteria before any fix: a capture
helper that restores os.Stdout/os.Stderr on the happy path only leaks
the global when its callback exits via runtime.Goexit (t.Fatal/panic).
RED confirmed: TestCaptureCycleStdoutRestoresOnFatal fails with
"captureCycleStdout leaked os.Stdout after a Goexit"; go vet clean;
0 broken-pipe collateral (the new test restores os.Stdout itself
before failing, so it doesn't poison later tests).
* fix(feat): green — cmd/bd capture helpers leak os.Stdout on t.Fatal (refs be-leuf)
Move every bare stdio-restore in cmd/bd's capture helpers into a defer
registered immediately after assignment, so a callback that exits via
runtime.Goexit (t.Fatal) or panic can no longer leave os.Stdout/os.Stderr
pointed at an orphaned pipe.
- captureCycleStdout (dep_cycles_test.go): restore moved into a defer,
drain moved to a goroutine so a >64KiB write can't deadlock.
- Both inline os.Stderr captures in dep_cycles_test.go: deferred.
- captureStdout/captureStderr (test_helpers_pure_test.go): deferred,
stdioMutex discipline unchanged.
- TestCaptureCycleStdoutRestoresOnFatal: drives the leaking callback via
a goroutine + runtime.Goexit so the suite stays fully green (the fix
spec's stated alternative to the failing-subtest shape).
- 19-site mechanical sweep across 11 more files: same bare-restore ->
defer transform, no other restructuring, per spec item 6.
GREEN confirmed: go vet ./cmd/bd/... clean. go test -v -count=1
./cmd/bd/... via scripts/test.sh (beads_test_env_enter,
BEADS_TEST_SKIP=dolt) — EXIT_CODE=0, 0 'broken pipe' occurrences (was
3), 0 FAIL lines, all packages ok. TestRunSyncCommandExitCodeMapping
passes (all 3 subtests), TestZZStdioNotLeaked passes,
TestCaptureCycleStdoutRestoresOnFatal passes. The two dep-cycles tests
(TestDepCyclesNamesTheMembersItCannotDescribe,
TestDepCyclesSaysNothingIsWrongForACleanWorkspace) also pass in this
run — their arming precondition is order/environment-dependent per the
fix spec, so this is not required and does not indicate the fix works
only by coincidentally fixing them; the decoupling is structural.
* docs(release-gates): add be-sr7a gate record — PASS
Review be-1kxq passed; independently re-verified diff-owned tests
(TestCaptureCycleStdoutRestoresOnFatal, TestZZStdioNotLeaked,
TestRunSyncCommandExitCodeMapping) and full ./cmd/bd/... suite
(2389 PASS, 0 FAIL, 0 broken pipe/EPIPE occurrences), plus the
ci-pr-policy lane. .githooks/commit-msg false-failure root-caused
as a local gc-rig worktree shim (same finding as be-3b4e) and
remediated reversibly rather than waived.
* fix: prefer bootstrap for missing database recovery
Executed-By: beads/crew/emma
* fix: align doctor recovery guidance with bootstrap
Executed-By: beads/crew/emma
* fix: let bootstrap recover missing server databases
Executed-By: beads/crew/emma
* fix: bootstrap missing server databases safely
Executed-By: beads/crew/emma
* fix: fail closed on bootstrap server probe errors
Executed-By: beads/crew/emma
* fix: honor runtime server config in bootstrap
Executed-By: beads/crew/emma
* docs: soften bootstrap-first recovery wording
Executed-By: beads/crew/emma
* fix: report resolved bootstrap server port
Executed-By: beads/crew/emma
* fix: repair test failures from build tag mismatch and mode detection
Three issues causing CI failures on macOS and Ubuntu:
1. detectBootstrapAction used isEmbeddedMode() (global state) to choose
the database path, but tests set cfg.DoltMode without updating the
global serverMode flag. Switch to cfg.GetDoltMode() so the detection
logic respects the config object passed by the caller.
2. TestDetectBootstrapAction_NoneWhenDatabaseExists created a "dolt"
directory but default (embedded) config looks for "embeddeddolt".
Fix the test to create the correct directory.
3. embeddeddolt/slots.go and new_methods_test.go used //go:build
embeddeddolt tag while all other files in the package use cgo,
causing interface satisfaction failures. Also fix undefined
isEmbeddedDolt reference (should be isEmbeddedMode()).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Executed-By: beads/crew/emma
---------
Co-authored-by: mayor <thalia.geraghty@fiserv.com>
Co-authored-by: beads/crew/emma <steve.yegge@gmail.com>