Bumps github.com/dolthub/driver from 1.86.4 to 1.88.1 and includes CI repair for the Nix vendor hash plus generated CLI docs.\n\n_codex-gpt-5-medium on behalf of CI Bot_
Reverts PR #3498 / commit 0fffa44a2302a496dfa4ffa838843b3bbf0ee122.\n\nPR #3498 added BEADS_DOLT_CLI_DIR routing without a confirmed reproduction and introduced an external-server push/pull regression. Remove that override and its docs/tests so main no longer requires a local CLI database directory in external-server mode.\n\n_codex-gpt-5- on behalf of CI Bot_
* test(cmd/bd): use t.Chdir in drift tests to fix chdir race (GH#3729-followup)
The TestCheckHooksDrift/Server/Remote tests in config_drift_test.go were
using the manual os.Chdir + defer os.Chdir(origDir) pattern, which is
not race-safe when other tests in the same package call t.Parallel and
share the process cwd.
t.Chdir (Go 1.24+) restores cwd via t.Cleanup and refuses to run if the
test (or any ancestor) is parallel — both eliminating the race window
and surfacing future misuse loudly.
Fixes flaky TestCheckHooksDriftNotGitRepo identified as a pre-existing
chdir race during PR #3716 review (mybd-j2s).
Verified: go test -count=20 -run '^TestCheckHooksDriftNotGitRepo$' passes.
Amp-Thread-ID: https://ampcode.com/threads/T-019dfe19-17ae-713e-bc3a-d7c9da6a117d
Co-authored-by: Amp <amp@ampcode.com>
* test(cmd/bd): accept embedded Dolt lock output
---------
Co-authored-by: CI Bot <ci@beads.test>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: upgrade-test <test@beads.test>
* fix(auto-import): restore top-level emptiness guard in maybeAutoImportJSONL (#2)
* fix(auto-import): restore top-level emptiness guard in maybeAutoImportJSONL
PR #3630 introduced jsonlImporter as a single-transaction fast-path for embedded mode and moved the TotalIssues>0 emptiness check inside that path. Stores that don't implement jsonlImporter (server-mode dolt store) fall through to the fallback multi-call path — which has no emptiness guard, so every bd command unconditionally runs importFromLocalJSONLFull on a non-empty Dolt.
importFromLocalJSONLFull's underlying ON DUPLICATE KEY UPDATE semantics in InsertIssueIntoTable then re-impose the (often stale) JSONL field values on top of live Dolt rows. Combined with the auto-export's debounce/commit-watermark gating in export_auto.go, partial-field bd updates (e.g. --append-notes alone, --priority=N alone) get clobbered: the next command's auto-import overwrites the just-written field with whatever the JSONL last had.
Restore the top-level GetStatistics+TotalIssues>0 guard that v1.0.3 had, before the path-fork. The embedded jsonlImporter retains its own atomic in-tx check (defense in depth against concurrent-writer races, which was the legitimate intent of #3630). The fallback path is now once again a true upgrade-recovery path: it only fires when the database is actually empty.
Reproducer (server mode):
1. bd update X --priority=2 --notes="X"
2. bd update X --append-notes "; appended"
3. bd update X --priority=3
Pre-fix: step 3 leaves notes='X' (the '; appended' is silently lost) and step 2 may revert priority to JSONL's stale value.
Post-fix: each single-field update preserves the unspecified fields from Dolt.
Test coverage gap: existing auto_import_upgrade_test.go is //go:build cgo and only exercises the embedded path. A non-CGO server-mode integration test would prevent reintroduction; left as a follow-up.
* test(auto-import): add server-mode fallback regression test for empty-DB guard
Adds two unit tests covering the server-mode fallback path of maybeAutoImportJSONL. Existing tests in auto_import_upgrade_test.go are //go:build cgo and exercise only the embedded jsonlImporter branch — leaving the fallback path (the actual location of the data-clobber regression) uncovered by CI.
Test design: a small testability seam exposes importFromLocalJSONLFull as a package-level 'fallbackImporter' var that tests can substitute. A minimal stub storage.DoltStorage embeds the interface (nil) and overrides only GetStatistics; any other method call panics, which is correct since the function under test should not invoke them after the emptiness guard short-circuits.
TestMaybeAutoImportJSONL_ServerModeFallback_SkipsWhenNonEmpty fails on the buggy code (substituted importer is invoked when it shouldn't be) and passes after the guard is restored. TestMaybeAutoImportJSONL_ServerModeFallback_RunsWhenEmpty is the negative control — guards against a future change that always short-circuits and would let the regression test pass vacuously.
* fix(test): TestEmbeddedAutoImportJSONLNoExplicitCommit — use write command to trigger auto-import (#3)
* fix(test): use a write command to trigger auto-import in TestEmbeddedAutoImportJSONLNoExplicitCommit
The test was added in PR #3630 with a comment claiming bd list 'triggers maybeAutoImportJSONL in pre-run'. This is incorrect: bd list is registered in cmd/bd/main.go's readOnlyCommands map, and the dispatcher at main.go:1023 explicitly skips maybeAutoImportJSONL for read-only commands (a guard added 2026-04-14 in fa87dd2bd to avoid opening a writable handle for read commands per GH#804).
The test consequently asserted on a 0-issue empty store, failed with 'expected 3 imported issues, got 0', and shipped broken. CI did not catch this because the test is gated behind BEADS_TEST_EMBEDDED_DOLT=1 and t.Skips otherwise; the embedded suite must not have been enabled in the PR's pipeline.
Fix: use bd create (a write command) to trigger auto-import in pre-run. bd create's own write coalesces with the auto-import via PersistentPostRun's maybeAutoCommit — exactly the deferred-commit flow the test was designed to verify. The post-import marker also brings the asserted total to 4.
The original commitCount > 2 assertion was a brittle proxy for 'auto-import didn't issue its own DOLT_COMMIT'. Replace it with a direct check: forbid the 'auto-import: ... (upgrade recovery, GH#2994)' commit message that the function only emits when it calls s.Commit explicitly (the fallback path). Its absence is the actual property under test.
Verified: passes locally with BEADS_TEST_EMBEDDED_DOLT=1; the four sibling auto-import tests in the same file continue to pass.
* docs(test): correct commit path attribution per PR #3 review
Copilot reviewer noted the previous comment incorrectly attributed the coalesced Dolt commit to PersistentPostRun's maybeAutoCommit. The actual commit path: bd create itself calls store.Commit at cmd/bd/create.go:676 (gated on isEmbeddedMode || postCreateWrites). The auto-import stages writes into the Dolt working set and bd create's own commit picks them up alongside its create write; PersistentPostRun's maybeAutoCommit is then a no-op.
* fix(auto-import): handle nil statistics guard
Incorporates the defensive nil-statistics behavior from #3690 by realies, while keeping #3691 as the broader tested fix.
Co-authored-by: realies <5107843+realies@users.noreply.github.com>
---------
Co-authored-by: maphew <486200+maphew@users.noreply.github.com>
Co-authored-by: realies <5107843+realies@users.noreply.github.com>
Complete mybd-pnm docs evidence review.\n\n- Add verified docs disposition inventory and canonical seams.\n- Stage stale duplicate docs under docs/staged-for-removal with a manifest.\n- Refresh generated CLI docs and harden the generator for CRLF/stdin handling.\n\nFollow-up: mybd-xfr for automated docs freshness checks.
Fixes Gemini CLI hook integration by emitting the required SessionStart JSON envelope. Extends the same standard to Claude Code hooks (documented spec, not just tolerated raw text). Adds legacy detection in bd setup gemini --check.
- Add `--hook-json` flag to `bd prime` wrapping output in the cross-CLI `hookSpecificOutput.additionalContext` JSON envelope (Claude Code, Gemini CLI, and Codex all share this contract)
- Update `bd setup gemini` to register `bd prime --hook-json` on SessionStart; remove PreCompress registration (advisory-only, no additionalContext support per Gemini docs v0.40.1)
- Update `bd setup claude` to register `bd prime --hook-json` on SessionStart and PreCompact (JSON form is the documented spec; raw text was merely tolerated)
- Migration sweeps in both setup commands so re-running upgrades bare-command installs cleanly
- `bd setup gemini --check` distinguishes current (`--hook-json`) from legacy (bare `bd prime`) installs and emits upgrade advisory for legacy
- Fix `removeHookCommand` bug: previously dropped entire hook entry on first command match, silently deleting sibling commands; now filters only the matching command and drops the entry only when empty
- Refresh docs and recipes to reflect SessionStart-only Gemini hook behavior
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Route bd dolt status through the SQL probe when dolt_mode=server points at a local host but bd auto-start is disabled. In that configuration bd is not the server lifecycle owner, so the PID-file path can report a false negative even though the configured sql-server is reachable.
Keep the bd-managed local PID-file status path unchanged and covered with rendering tests. Document the observable JSON shape change for affected automation in the Unreleased changelog.
Fixes be-0eyj.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>