Commit graph

128 commits

Author SHA1 Message Date
matt wilkie
df2078b56f
fix(ci): collapse multiline expression in cross-version-smoke workflow (#3189)
* fix(ci): collapse multiline expression in cross-version-smoke workflow

Multi-line plain YAML scalars are invalid — the ${{ }} expression
spanning multiple lines caused GitHub to reject the workflow file
immediately (0s, "workflow file issue") on every push to main.

Collapse to a single-line expression; semantics are unchanged.

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

* fix(ci): fix smoke test CWD, mode check, --silent compat, and prefix dots

Three independent bugs causing all 5 upgrade smoke scenarios to fail:

1. Smoke test CWD (root cause of most failures)
   - All `bd` invocations ran from the test script's CWD (the beads repo
     checkout), not from the isolated workspace $WS. This caused:
     * bd init to detect the beads repo's `origin` remote (has
       refs/dolt/data) and clone the entire beads Dolt database into $WS,
       corrupting the upgrade scenario and wasting minutes on chunk downloads.
     * `git config beads.role` to be written to the beads repo's git config
       instead of $WS's, so scenario 4's role check always failed.
   - Fix: add `prev()` and `cand()` helpers that cd into $WS before running.

2. `create --silent` not in binaries older than ~v1.1.0
   - --silent was added after the v1.0.0 release; calling it with older
     binaries silently failed (error to stderr, empty stdout), making every
     create attempt look like an init failure.
   - Fix: `prev_create()` helper tries --silent first, falls back to
     parsing any ID-like token from plain create output.

3. Mode preservation check used wrong path
   - Embedded Dolt stores data in `.beads/embeddeddolt/` (a directory).
     The test checked for `.beads/beads.db` (a file), which never exists
     in embedded mode, so the "DB exists before/after upgrade" assertions
     always failed.
   - Fix: `embedded_db_exists()` checks for either the directory
     (current embedded mode) or the legacy SQLite file.

Also fix issue_prefix dot sanitization in init.go (TestEmbeddedInit/
prefix_dot_sanitized): when a prefix like "GPUPolynomials.jl" is used,
`issue_prefix` stored in the DB must have dots replaced with underscores
(matching DoltDatabase sanitization), otherwise issue IDs contain dots.

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

* fix(ci): handle embedded-mode edge cases in upgrade smoke test

Three remaining failures after the CWD fix:

1. `storage.mode (not set)` treated as failure
   The `config get storage.mode` output includes the key name and "(not set)"
   when the config key doesn't exist. Embedded mode is the default and doesn't
   require an explicit setting, so any "not set" output should be accepted.
   Also accept the empty-string case that can arise with older config formats.

2. Embedded DB check too strict for v0.63.x
   v0.63.x was the first embedded-mode release; its init installed hooks and
   set beads.role correctly but may not have fully initialized the embeddeddolt/
   directory in CI due to early-release bugs. Changed the pre-upgrade check to
   verify `.beads/` directory exists (init ran) rather than the specific
   embeddeddolt/ subdirectory.

3. Create failures in old binaries treated as hard failures
   When an old binary cannot create issues (e.g. v0.63.x embedded init bug),
   the test now skips the data-migration and mutation checks with a `pass`
   (annotated as "skipped") rather than failing. The role-preservation and
   doctor checks still run.

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

* fix(ci): handle pre-embedded (server-mode) releases in smoke test scenario 3

v0.60.0-v0.62.0 used server mode and required an external Dolt server
to initialize. Without a running server in CI, their init installs hooks
but cannot create .beads/. The mode-preservation scenario was treating
this as a failure.

Change the pre-upgrade check in scenario 3 to skip gracefully when
.beads/ doesn't exist (old binary requires external server). The scenario
still runs candidate init and verifies the candidate defaults to embedded
mode — which is the meaningful test.

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 10:34:02 -07:00
matt wilkie
a61911f65b merge: resolve conflicts with main for PR #3146
- cross-version-smoke.yml: keep PR's matrix/PR-gate design over main's simpler version
- Makefile: incorporate main's test-cross-version and test-migration targets
- upgrade-smoke-test.sh: keep PR's Scenario 5 (mutation), SMOKE_VERSIONS multi-version mode, and gastownhall URL fix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 11:30:03 -07:00
sahtechie-png
b599839bbb
fix: handle release archives that extract into a subdirectory (#3167)
Thanks @sahtechie-png for the thorough issue report and fix!
2026-04-10 11:05:30 -07:00
matt wilkie
9035839bc4 fix: smoke test mutations + add PR gate trigger (GH-2968)
Extends upgrade-smoke-test.sh with a mutation scenario (Scenario 5)
that runs bd update --notes after a version upgrade and verifies the
change persists. Adds cross-version-smoke.yml workflow with a
pull_request trigger (last 5 releases) for PR-time regression detection,
plus the existing tag-push trigger testing last 30 releases. Also fixes
the release download URL from steveyegge/beads to gastownhall/beads and
adds SMOKE_VERSIONS env var support for multi-version runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 10:37:46 -07:00
matt wilkie
164e25195e
fix: remove unsupported stepping-stone migration paths (#3073) (#3110)
Multi-hop upgrade paths through old releases are inherently broken
because intermediate binaries have bugs that cannot be patched
retroactively. Users should upgrade directly to the latest release.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:56:56 -07:00
matt wilkie
7916e029bc
fix: remove ICU runtime dependency from release binaries (#3066)
The gms_pure_go build tag already tells go-mysql-server to use Go's
stdlib regex instead of ICU-backed go-icu-regex. However, .buildflags
and the Makefile were unconditionally injecting ICU linker flags
(including -licui18n -licuuc -licudata on Linux), which re-introduced
the ICU shared-library dependency at link time.

This caused release binaries to require a specific ICU version
(e.g., libicui18n.so.74), making them non-portable across Linux distros
with different ICU versions.

Changes:
- .buildflags: Remove ICU flag injection; only export CGO_ENABLED=1
- Makefile: Replace ICU4C detection block with BUILD_TAGS := gms_pure_go;
  use the tag for all platforms (not just Windows)
- scripts/verify-cgo.sh: Add readelf check to fail if ICU shared-library
  dependency is present in ELF binaries
- scripts/install.sh: Add -tags gms_pure_go to build_from_source()

CGO remains enabled for embedded Dolt support. Only the ICU regex
backend is swapped for Go's stdlib regex, which is sufficient since
bd does not use SQL REGEXP functions.

Amp-Thread-ID: https://ampcode.com/threads/T-019d6450-7b10-77ee-b3d0-58e9474e61da

Co-authored-by: Amp <amp@ampcode.com>
2026-04-07 09:48:44 -07:00
Isaac Karrer
7f0a165f4e
feat(docs): version Docusaurus site and align llms-full with snapshots (#3033)
* feat(docs): version Docusaurus site and align llms-full with snapshots

Add docs version 1.0.0, version dropdown, lastVersion defaulting to stable,
merged markdown config, and RELEASING steps for future doc snapshots.
generate-llms-full.sh reads the latest entry in versions.json.

README links the published documentation site.

Closes #2644

Made-with: Cursor

* fix(docs): update org URLs to gastownhall and refresh 1.0.0 snapshot

- Update default orgName in docusaurus.config.ts from steveyegge to
  gastownhall to match the repo's new home
- Update hardcoded steveyegge URLs in generate-llms-full.sh
- Refresh versioned_docs 1.0.0 snapshot to include quickstart changes
  from #3032 which merged after the original snapshot was taken
- Regenerate llms-full.txt with corrected URLs and updated content

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

---------

Co-authored-by: matt wilkie <maphew@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 21:12:54 -07:00
matt wilkie
1c19151eba
docs: add cross-era migration instructions to upgrading guide (#3081)
docs: add cross-era migration instructions to upgrading guide
2026-04-06 20:11:00 -07:00
matt wilkie
8d94fafd0c
fix: preserve dependencies and labels in SQLite-era JSONL migration (#3079) (#3082)
All three test plan items verified:
- Migration harness: 0 fidelity violations, deps and labels replayed correctly
- Graceful skip for absent tables confirmed
- Unit tests pass (unrelated /tmp disk quota failures only)
2026-04-06 20:08:55 -07:00
Dustin Brown
b84ab143c8
Merge pull request #3074 from coffeegoddd/db/shared-schema
fix(dolt,embeddeddolt): unify schema between stores, optimize ignored tables schema recreation
2026-04-06 16:54:23 -07:00
matt wilkie
4fc0459740
fix: unblock v0.62.0 migration test by allowing Dolt auto-start (#3072) (#3076)
BEADS_TEST_MODE=1 disables Dolt server auto-start and forces port 1,
which makes every bd command fail for server-era versions (v0.50-v0.62).
Change default to 0 since the harness runs in isolated temp-dir
workspaces.  Also make epic creation non-fatal with task fallback.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 16:02:13 -07:00
matt wilkie
af12d6f720
fix: export data before clearing metadata in server→embedded migration (#3075)
The server_to_embedded recipe deleted metadata.json before attempting to
export data via the old binary. Without metadata.json, the old binary
couldn't locate its Dolt server configuration and returned empty results.
The candidate's init then created a fresh empty database, silently losing
all data.

Reorder the recipe to: (1) export via old binary while metadata.json is
still present, (2) clear metadata, (3) init with candidate, (4) verify
data exists, and (5) reimport from JSONL if the candidate DB is empty.

Fixes #3071

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 16:02:09 -07:00
matt wilkie
0537368b01
fix: unblock SQLite-era migration by clearing old DB before init (#3070) (#3077)
The sqlite_to_current recipe was blocked because the candidate binary's
init --from-jsonl refused to run when .beads/beads.db already existed
(checkExistingBeadsData guard). Fix by renaming old SQLite artifacts
(.beads/beads.db, metadata.json, config.json) to .pre-migration before
calling init.

Also switch sqlite3 extraction from -json flag to .mode json for
broader compatibility with older sqlite3 builds.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 16:02:06 -07:00
coffeegoddd☕️✨
fef1d1898c /{cmd,internal,scripts}: use dsn helpers 2026-04-06 15:56:37 -07:00
matt wilkie
e4fca03f6b
feat: add migration test harness for cross-era upgrade fidelity (#3067)
* wip: add migration test harness for cross-era upgrade fidelity

Rich dataset generator, field-level fidelity checker, and migration
recipes for SQLite/Dolt-server/embedded-Dolt eras. Addresses GH#2938
upgrade pain by testing and documenting working upgrade paths.

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

* fix: snapshot JSON format handling and self-test mode

- show --json returns array, not object — use jq array concatenation
- Field is issue_type not type in bd JSON output
- Normalize empty comment_count to 0 (show vs list field differences)
- Add --self-test flag for harness validation without old binaries
- Fix local variable outside function in self-test block

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

* ci: re-trigger Kilo Code Review

* address review: timeouts, env var docs, quoting

- Add BD_OP_TIMEOUT (30s) for bd operations via timeout(1)
- Add DOWNLOAD_TIMEOUT (60s) for curl binary downloads
- Document all environment variables in run.sh header
- Convert init_flags from word-split string to proper bash array

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

* fix: fall back to source build when release binary has missing shared libs

Downloaded release binaries dynamically link ICU (libicui18n.so.74),
which isn't available on all systems. Now download_binary verifies the
binary actually runs, and falls back to building from source with
gms_pure_go tag when it doesn't. Also applies gms_pure_go to
build_candidate for consistency.

Ref: gastownhall/beads#3065

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

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 14:30:35 -07:00
matt wilkie
a3923edf41 fix: narrow cross-version smoke CI triggers and warn on high skip rate
Remove push-to-main and PR triggers from cross-version smoke test
workflow — 30-45 min runtime is too costly for every push. Keep tag
pushes (releases/RCs) and manual dispatch.

Add a visible warning when >80% of tested versions are skipped, printed
to stderr and GitHub step summary. Prevents silent "all passed" when
nearly nothing actually ran.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 23:17:34 -07:00
Dmitry Verkhoturov
05734b2979
fix: commit test data and use --from-jsonl for JSONL recovery in smoke test
Pre-embeddeddolt versions only populate issues.jsonl via git hooks on
commit. Without committing, the JSONL stays empty and recovery is
impossible.

- Add git commit after creating test data with the old binary
- Use bd init --from-jsonl when candidate suggests bd init and JSONL
  has data, enabling recovery from SQLite/server-mode eras
- Fix bash 3.x compatibility (${array[-1]} not supported on macOS)

This turns v0.50.x from FAIL to PASS (recovered via init --from-jsonl).
2026-04-05 03:28:51 +02:00
Dmitry Verkhoturov
6686e1d69e
fix: remove set -e to prevent dolt server crashes killing the script
The dolt-server-era binaries (v0.57-v0.62) start background processes
that cause set -e to trigger on non-zero exits deep in subshells.
set -uo pipefail is sufficient for error detection.

Also kill auto-started candidate dolt servers after verify, and use
pkill by workspace path for thorough cleanup.
2026-04-04 17:47:39 +00:00
Dmitry Verkhoturov
c99cf4b32a
add bd init fallback when candidate suggests it
When direct read fails and the candidate tells the user to
"run bd init", follow that advice and retest. This is fair play
since the user would see and follow the hint.

Catches additional bugs:
- dash in prefix breaks embedded Dolt database naming
- auto-import from issues.jsonl doesn't fire after bd init
2026-04-04 16:54:25 +00:00
Dmitry Verkhoturov
5e6e5ede96
remove migration fallback — candidate doesn't suggest it to users
The candidate says "no beads database found" without mentioning
init --from-jsonl or any migration path. Testing a path that no
user would discover makes the test dishonest.
2026-04-04 16:50:55 +00:00
Dmitry Verkhoturov
149938ac0d
add migration fallback and prefix with special chars
When direct read fails but old version exported issues.jsonl,
retry with candidate's init --from-jsonl. Reports "passed (after
migration)" to distinguish from direct compatibility.

Also use prefix with underscore and dash (sm-o_ke) to catch
special character issues in issue IDs.
2026-04-04 16:48:35 +00:00
Dmitry Verkhoturov
65f75215e0
fix: use bd daemon/dolt stop for reliable server cleanup
Instead of raw kill, use the old binary's own stop commands
(bd daemon stop, bd dolt stop) for clean shutdown. Falls back
to pid files only if the commands fail.
2026-04-04 16:46:19 +00:00
Dmitry Verkhoturov
23bfd058e3
fix: parse create output for versions without --silent flag
Versions before ~v0.30.0 don't have --silent. Fall back to parsing
the "Created issue: <id>" line from verbose output.
2026-04-04 16:28:12 +00:00
Dmitry Verkhoturov
f7007967cb
fix: proper failure reporting for cross-version smoke test
- run old binaries from workspace cwd (not --db flag, breaks old versions)
- install dolt in CI for server-mode versions (v0.56-v0.62)
- fix pipefail handling that silently killed the script mid-run
- add results table output and GitHub Actions step summary
- report real failures instead of silently skipping broken upgrades
2026-04-04 16:05:40 +00:00
Dmitry Verkhoturov
48f611ab65
add cross-version smoke test for upgrade compatibility (GH#2968)
Tests that data created with old bd versions (epic, issues, dependencies)
is readable after upgrading to the candidate binary. Covers the last 30
release tags by default, with --from flag for broader sweeps.
2026-04-04 15:23:24 +00:00
matt wilkie
8e9120fad5 Add release stability gate for upgrade safety (GH#2951) (#2963)
- Add docs/RELEASE-STABILITY-GATE.md defining the upgrade matrix,
  verification criteria, and sign-off process
- Add scripts/upgrade-smoke-test.sh that tests data preservation,
  mode preservation, role preservation, and doctor health across
  upgrade scenarios (embedded maintainer, contributor, mode flip)
- Add 'make test-upgrade' target
- Update RELEASING.md checklist with upgrade smoke tests, regression
  tests, and breaking-change documentation requirements
- Links to #2764, #2765, #2949, #2950 for related test gap work

Amp-Thread-ID: https://ampcode.com/threads/T-019d4a99-63c8-779f-bb8e-ee8522b61cdf

Co-authored-by: Amp <amp@ampcode.com>
2026-04-01 17:21:17 -07:00
matt wilkie
21910a8994 [codex] Fix installer ICU/CGO fallback handling (#2965)
* Fix shared-server init mode selection

* Warn on shared-server embedded metadata mismatch

* Fix installer ICU/CGO fallback handling
2026-04-01 17:21:17 -07:00
matt wilkie
9d7882c049
Add release stability gate for upgrade safety (GH#2951) (#2963)
- Add docs/RELEASE-STABILITY-GATE.md defining the upgrade matrix,
  verification criteria, and sign-off process
- Add scripts/upgrade-smoke-test.sh that tests data preservation,
  mode preservation, role preservation, and doctor health across
  upgrade scenarios (embedded maintainer, contributor, mode flip)
- Add 'make test-upgrade' target
- Update RELEASING.md checklist with upgrade smoke tests, regression
  tests, and breaking-change documentation requirements
- Links to #2764, #2765, #2949, #2950 for related test gap work

Amp-Thread-ID: https://ampcode.com/threads/T-019d4a99-63c8-779f-bb8e-ee8522b61cdf

Co-authored-by: Amp <amp@ampcode.com>
2026-04-01 17:00:25 -07:00
matt wilkie
dbcc2db0a9
[codex] Fix installer ICU/CGO fallback handling (#2965)
* Fix shared-server init mode selection

* Warn on shared-server embedded metadata mismatch

* Fix installer ICU/CGO fallback handling
2026-04-01 16:52:53 -07:00
eitsupi
41001f7a07 fix(install): redirect log functions to stderr to fix WSL platform detection
log_info, log_success, and log_warning wrote to stdout, while only
log_error wrote to stderr. Inside detect_platform(), which is called
via command substitution `platform=$(detect_platform)`, the WSL
warning messages were captured into the platform variable, producing
a malformed download URL like:
  beads_0.62.0_==> WSL (Windows Subsystem for Linux) detected...linux_amd64.tar.gz

Fix by redirecting all log functions to stderr, consistent with
log_error and standard shell convention (stdout = data, stderr = diagnostics).
Also redirect bare echo calls inside detect_platform to stderr.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 06:59:14 +00:00
Harry
a82d500129 cleanup: remove remaining Gas Town terminology from help text, docs, and comments
Replace Gas Town-specific terminology with generic equivalents across
user-facing help text, documentation, code comments, MCP integration,
and scripts.

Terminology replacements:
- polecat → agent/worker
- witness → observer
- deacon → patrol system
- refinery → processor
- mayor → coordinator
- crew → assistant
- gt (command) → bd
- Gas Town role lists → generic role descriptions

Changes by category:
- User-facing help text (7 files): create.go, state.go, mol_bond.go,
  gate.go, mol_ready_gated.go, memory.go, swarm.go
- Documentation (5 files): dolt-concurrency.md (reframed for standalone
  beads), MOLECULES.md, LABELS.md, CLI_REFERENCE.md,
  CONTRIBUTOR_NAMESPACE_ISOLATION.md
- Code comments (5 files): dolt.go, doctor/artifacts.go,
  fix/artifacts.go, store.go, queries.go, formula/types.go
- MCP integration (2 files): tools.py comments, test docstring
- Scripts (1 file): release.sh

Backwards compatibility: Doctor artifact detection patterns for
polecats/crew/refinery directories are retained with updated comments
noting they exist for orchestrator backwards compatibility. MCP redirect
test paths also retained for the same reason.

Fixes #2758

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-22 13:27:43 -07:00
garnet
3dae6bb3df refactor: remove gastown/Gas Town string references from beads code and docs (bd-1ue8)
Replace gastown-specific references with generic alternatives throughout
the codebase:

- Rename --gastown flag to --orchestrator in bd doctor
- Rename gastownMode/gastownThreshold params to orchestratorMode/orchestratorThreshold
- Rename isGasTownTownRoot() to isOrchestratorRoot()
- Replace "gastown" in CLI examples with generic rig names (my-project, other-project)
- Update comments replacing "Gas Town" with "orchestrator" or "multi-agent workspace"
- Update active docs (DOLT.md, CONFIG.md, ADVANCED.md, etc.)
- Update test data to use generic names instead of "gastown"
- Update role templates (deacon, witness, refinery) to use generic language

Preserved as historical (not changed):
- CHANGELOG.md entries (historical record)
- ARTICLES.md (links to real published articles)
- info.go version notes (historical release notes)
- gastown/ file path references in dolt-concurrency.md (point to actual repo)
2026-03-20 18:39:50 -07:00
amber
6468766523 fix: remove hardcoded ~/gt/ paths from beads codebase (bd-h615)
Replace ~/gt/ and ~/hop/ hardcoded paths with generic placeholders:
- routes.go comments: use <town-root> and <town> placeholders
- routing_test.go comments: use <town> placeholder
- deacon.md.tmpl: use {{ .TownRoot }} template variable
- witness.md.tmpl: use {{ .TownRoot }} template variable
- docs/DOLT.md: use <town-root> placeholder in example
- scripts/release.sh: reference docs by name, not path
- federation_test.go: reference HOP docs by name, not path

CHANGELOG.md entries left unchanged (historical records).
2026-03-20 18:31:13 -07:00
maphew
4d23a6cc7e harden installers and docs for transparent trust model (GH#1857)
Amp-Thread-ID: https://ampcode.com/threads/T-019cf2b7-8afa-717c-abda-e7a8000e1b9b
Co-authored-by: Amp <amp@ampcode.com>
2026-03-15 12:02:56 -07:00
cwalv
e31428f053 docs: replace "git-backed" with "Dolt-powered", add git-free usage guide
Beads' storage backend is Dolt, not git. Git integration (hooks, repo
discovery, identity) is optional — `BEADS_DIR` + `--stealth` provides
fully functional git-free operation with zero git calls.

Changes across 15 files:
- Replace all "git-backed" references with "Dolt-powered" or "Dolt-backed"
- Add "Git-Free Usage" section to README.md documenting BEADS_DIR + --stealth
- Fix stale "JSONL" storage reference in llms-full.txt
- Update SKILL.md to mark git as optional prerequisite

Complements GH#2522 (stale command cleanup) — that PR fixed removed
commands, this one fixes misleading storage backend framing.
2026-03-13 11:44:50 -07:00
Amp
a333dcaa75 fix(docs): purge stale bd sync/import/--branch refs + add CI doc validation (GH#2522)
Systematic cleanup of stale documentation references left over from the
Dolt migration:

- Replace all 'bd sync' → 'bd dolt push' / 'bd dolt pull' across 40+ files
- Replace all 'bd import' → 'bd init --from-jsonl' or remove
- Replace 'bd init --branch' → note about refs/dolt/data separation
- Fix AGENT_INSTRUCTIONS.md (highest impact: agents read this directly)
- Fix npm-package, claude-plugin, integrations, examples, website docs

Add scripts/check-doc-flags.sh to catch stale doc references:
- Checks for removed commands (bd sync, bd import)
- Checks for removed flags (bd init --branch)
- Warns on legacy SQLite/beads.db references
- Compares CLI_REFERENCE.md against bd help --all

Add CI job (check-doc-flags) and Makefile target (check-docs) to gate
PRs against doc freshness.

Prior art: feat/help-doc-generator branch has bd help --doc/--list for
generating docs FROM CLI output. This script validates docs AGAINST CLI
output — complementary approaches.

Amp-Thread-ID: https://ampcode.com/threads/T-019cde77-0722-7353-b63a-1779a5773ca6
Co-authored-by: Amp <amp@ampcode.com>
2026-03-11 13:25:40 -07:00
matt wilkie
b515661f7d fix: skip sleep in CI/non-interactive environments 2026-03-06 14:42:03 -07:00
matt wilkie
fbbaa5ecc0 fix: detect WSL and MINGW/MSYS/CYGWIN in install.sh
When users run install.sh from Git Bash, MSYS2, or Cygwin on Windows,
the script now detects these environments and directs them to use
install.ps1 instead of silently installing a Linux binary.

When running under WSL, the script warns that the install will only be
usable inside WSL and suggests install.ps1 for native Windows use,
then continues after a 5-second pause.

Fixes #1980

Amp-Thread-ID: https://ampcode.com/threads/T-019cc486-ad63-76ea-9f02-2901e2430428
Co-authored-by: Amp <amp@ampcode.com>
2026-03-06 12:06:37 -07:00
beads/crew/darcy
02e177b1d0 feat: add JSONL-to-Dolt migration script (GH#2276)
Provides a standalone bash tool for users whose `bd migrate --to-dolt`
failed, leaving them with only JSONL exports. Reads JSONL files from
`bd export` and loads them into Dolt via MySQL protocol.

Supports all 6 table types (issues, labels, dependencies, events,
comments, config), dry-run mode, orphan-dep filtering, and auto-commits
the imported data to the Dolt branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 22:05:38 -08:00
gastown/crew/mel
5e834bff6a fix: remove deprecated commands, dead SQLite code, and legacy scripts
Remove Beads Classic remnants that are no longer needed now that
the system is pure Dolt:

- Delete deprecated commands: sync, template (cmds only), thanks (cmd
  only), detect-pollution (cmd only), admin aliases, comment alias
- Remove dead sqliteBackendWarning() and all 7 unreachable call sites
  (GetBackend() always returns "dolt")
- Remove sqliteIntegrityRecovery() from fix package
- Delete legacy test scripts: test_wsl2_wal.sh, test_issue_gh1224.sh,
  migrate-audit.sh
- Remove SQLite-specific test functions from doctor tests

Utility functions shared with active code are preserved (e.g.,
TemplateSubgraph, isTestIssue, printThanksPage).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 14:08:18 -08:00
Aaron Lippold
fd2047d0ec fix: gofmt formatting and remove stale hook template version checks
- Run gofmt on files that drifted from canonical formatting
- Remove hook template file checks from check-versions.sh and
  update-versions.sh — hooks are now generated dynamically by
  cmd/bd/hooks.go using the Version constant from version.go
- Fix check-versions.sh error message to reference update-versions.sh
  instead of deprecated bump-version.sh

Authored by: Aaron Lippold<lippold@gmail.com>

Signed-off-by: Aaron Lippold <lippold@gmail.com>

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-03-01 14:41:32 -08:00
maphew
ba08e97a39 fix: update version scripts for section markers, suppress unused param lint
Amp-Thread-ID: https://ampcode.com/threads/T-019ca7b3-8137-7218-8707-b7ae93c31ab5
Co-authored-by: Amp <amp@ampcode.com>
2026-02-28 21:59:12 -07:00
Aaron Lippold
49aed46c85
fix: harden SQLite→Dolt migration safety, old-schema compat, and doctor recovery (#2156)
* fix(configfile): respect backend field in metadata.json

GetBackend() was hardcoded to always return "dolt", ignoring the
backend field in metadata.json. This forced all SQLite users onto
Dolt with no migration path and no way to opt out.

- Add BackendSQLite constant and case-insensitive normalization
- GetBackend() reads backend field: sqlite → sqlite, empty/dolt → dolt
- DatabasePath() routes to SQLite or Dolt path based on backend
- BEADS_BACKEND env var override as escape hatch for corrupted configs
- CapabilitiesForBackend handles sqlite backend
- Warning on unrecognized BEADS_BACKEND values
- 55 tests covering all paths including env var, case normalization,
  roundtrip persistence, and DatabasePath routing

Fixes #2016.

Authored by: Aaron Lippold<lippold@gmail.com>

* feat(migrate): add shared migration safety functions

Extract reusable safety functions for SQLite→Dolt migration:
- backupSQLite: file copy with O_EXCL + 0600 permissions
- verifyServerTarget: TCP + SQL check to prevent wrong-server writes
- verifyMigrationCounts: source vs target count verification
- finalizeMigration: atomic metadata update (last step only)
- rollbackMetadata: restore original config on failure

22 unit tests covering all functions including counter overflow,
non-MySQL server detection, deps-only mismatch, nil config rollback,
server config preservation, and no-metadata scenarios.

Authored by: Aaron Lippold<lippold@gmail.com>

* refactor(migrate): use safety functions in auto-migration

Refactor both CGO and non-CGO auto-migration paths to use shared
safety functions instead of inline logic:

Phase 1 (pre-flight):
- Always backup SQLite before any migration attempt
- Verify server target to prevent writing to wrong Dolt server
- Skip migration when backend explicitly set to sqlite (GH#2016)
- Use GetBackend() for SQLite guard, strings.EqualFold for Dolt
  stale-leftover detection (preserves legacy empty-backend migration)

Phase 2 (import):
- Unchanged: extract from SQLite, create Dolt store, import data

Phase 3 (verify + finalize):
- Verify issue counts match before updating metadata
- Atomic finalization via finalizeMigration (metadata last)
- Rollback with warning on failure (not silent discard)

Clear, actionable error messages at every failure point showing
backup path. 13 unit tests including new SQLite backend guard test.

Authored by: Aaron Lippold<lippold@gmail.com>

* fix(main): clear error when SQLite backend detected

When GetBackend() returns "sqlite" (user opted to stay on SQLite or
migration was skipped), print a clear error with migration instructions
instead of falling through to dolt.New() which produces a confusing
Dolt connection failure.

Fixes #2016.

Authored by: Aaron Lippold<lippold@gmail.com>

* feat(doctor): detect and fix broken migration states

Add three new doctor checks for migration-related issues:

CheckBrokenMigrationState: detects metadata claiming Dolt backend
but no Dolt directory present (with server-mode awareness). Offers
bd doctor --fix to restore SQLite backend from beads.db or
beads.db.migrated files.

CheckSQLiteResidue: detects leftover beads.db after successful
migration. Fix renames to .migrated (with backend guard to prevent
accidentally renaming active SQLite database).

CheckEmbeddedModeConcurrency: detects embedded mode with lock
contention indicators (dolt-access.lock, noms LOCK files).
Recommends switching to server mode for multi-agent workflows.
Addresses #2086.

19 doctor tests covering all detection paths including server mode,
backup file detection, .migrated-only recovery, zero-byte files,
concurrent access with access locks and noms locks.

Fixes #2086.

Authored by: Aaron Lippold<lippold@gmail.com>

* test(migrate): add integration tests for migration safety

8 integration tests covering key business flows:
- Full migration lifecycle (SQLite → backup → Dolt → bd list works)
- Failed migration recovery (corrupt SQLite → backup exists → intact)
- Doctor detects broken state and fix restores SQLite backend
- Doctor fixes beads.db.migrated rename-back recovery
- Idempotent retry (second migration is no-op)
- SQLite guard prevents auto-migration (data intact, no backup)
- Backup content matches source byte-for-byte
- Metadata JSON valid with all required fields after migration

Authored by: Aaron Lippold<lippold@gmail.com>

* feat(scripts): add migrate-audit.sh for batch SQLite→Dolt migration

Utility script to audit and batch-migrate beads boards:
- Scans all .beads/ directories under a configurable root
- Reports backend state, issue count, and schema version for each board
- --dry-run: shows what --migrate would do without changes
- --migrate: batch converts eligible SQLite boards to Dolt
- --exclude PATTERN: skip projects matching regex (e.g., "backup|test")
- --port/--host: target a specific Dolt server

Safety features:
- Backs up metadata.json before modifying each board
- Restores original metadata.json on migration failure
- Skips boards with old schema (missing owner column)
- bd binary handles SQLite backup, server verification, count verification
- Uses jq for JSON (consistent with existing scripts, no python dependency)

Companion tool for the migration safety PR (GH#2016, GH#2086).

Authored by: Aaron Lippold<lippold@gmail.com>

* fix(migrate): handle all schema versions in SQLite extract

Databases from older beads versions are missing columns added over time
(owner, created_by, crystallizes, mol_type, work_type, quality_score,
source_system, and others). The extract functions hardcoded COALESCE
for all columns, causing "no such column" errors.

Fix: make ALL non-id columns use sqliteOptionalTextExpr via a DRY
opt() helper in both CGO extract and shim extract paths. Missing
columns default to empty/zero/null. Also adds empty/corrupt beads.db
handling to the migrate-audit.sh script.

Tested against 12 real-world databases spanning multiple beads versions,
from the earliest (~30 columns) to the current schema (50+ columns).
All 28 boards migrated successfully.

Authored by: Aaron Lippold<lippold@gmail.com>
2026-02-26 15:48:47 -08:00
darcy
fb8ca5fc90 fix: resolve gofmt and golangci-lint CI failures
- gofmt: 7 files had formatting issues (dolt.go, close_guard_test.go,
  init_hooks_test.go, discovery_test.go, types.go, metadata_schema_test.go,
  testdoltserver.go)
- gosec G304: suppress false positives for os.ReadFile on trusted paths
  (daemon PID files, test cleanup)
- gosec G104: handle Close() return values with _ = pattern
- errcheck: wrap os.RemoveAll in defer closure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 13:31:06 -08:00
beads/crew/emma
982164a481 feat(testutil): reuse existing Dolt server via BEADS_DOLT_PORT (L1)
StartTestDoltServer now checks BEADS_DOLT_PORT before spawning a new
server. If the env var is set and the server is reachable, it returns a
lightweight handle with no-op cleanup. Falls through with a warning if
the port is stale.

scripts/test.sh gains BEADS_TEST_SHARED_SERVER=1 mode that pre-starts
a single server and exports the port for all test packages.

Closes: bd--sxnz

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 16:16:56 -08:00
mayor
f625c95946 fix: remove redundant tx.Commit() after DOLT_COMMIT in transactions
Per Tim Sehn (Dolt CEO): DOLT_COMMIT() implicitly commits the SQL
transaction, so calling tx.Commit() afterward is redundant and "adds
raciness." Under high concurrent load (~20 agents), this raciness
may have contributed to a complete server hang that bricked the town.

The fix: after DOLT_COMMIT succeeds, return immediately without calling
tx.Commit(). When no DOLT_COMMIT is requested (empty commitMsg), the
explicit tx.Commit() is still used.

Also adds a repro script (scripts/repro-dolt-hang/) that compares the
old (with tx.Commit) vs new (without) patterns under concurrent load,
plus an incident report documenting the 2026-02-23 server hang.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 19:13:02 -08:00
topaz
062aedbed7 docs: remove stale daemon references from all documentation (GH#1982)
Sweep 65 markdown files across docs/, website/, claude-plugin/, examples/,
integrations/, and root to replace removed `bd daemon` references with
current Dolt server mode equivalents. CHANGELOG.md preserved per policy.

Key replacements:
- `bd daemon start/stop/status` → `bd dolt start/stop` / `bd doctor`
- `bd daemons killall/health/logs` → `bd dolt stop` / `bd doctor`
- `--no-daemon` flag → removed (embedded mode is default)
- `BEADS_NO_DAEMON` / `BEADS_DAEMON_MODE` env vars → removed
- `.beads/bd.sock` → removed
- "daemon mode" / "direct mode" → "server mode" / "embedded mode"
- daemon.pid/daemon.log → .beads/dolt/sql-server.pid/.log

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

Executed-By: beads/polecats/topaz
Rig: beads
Role: polecats
2026-02-22 17:57:53 -08:00
beads/crew/emma
bd68c87b00 fix: remove stale embedded Dolt references after server-only migration
Delete broken store_nocgo_test.go (references undefined errNoCGO),
remove dead bootstrapEmbeddedDolt/hasDoltSubdir functions, and clean up
stale comments and docs that still referenced embedded mode, CGO
requirements, or in-process Dolt across 20 files.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-21 16:59:44 -08:00
zenchantlive
55f06f9856
fix(release): prevent non-CGO bd binaries from shipping (#1870)
* fix(release): prevent non-CGO bd binaries from shipping

* fix: make verify-cgo.sh executable

GoReleaser invokes this as ./scripts/verify-cgo.sh which requires +x.

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

---------

Co-authored-by: beads/crew/collins <steve.yegge@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:21:22 -08:00
Steve Yegge
2b1d3d9466
Merge pull request #1871 from zenchantlive/fix/remove-daemon-refs-1819
docs: remove stale daemon command references (fix #1819)
2026-02-21 13:14:46 -08:00