Commit Graph

1843 Commits

Author SHA1 Message Date
Steve Yegge
9e9db62954 Fix daemon exiting after 5s on macOS due to PID 1 parent monitoring (GH #278)
Amp-Thread-ID: https://ampcode.com/threads/T-87e6732c-f7bf-4e8d-9ebc-f778ac6f0c40
Co-authored-by: Amp <amp@ampcode.com>
2025-11-10 10:22:03 -08:00
Steve Yegge
811eb46b03 Merge remote changes
Amp-Thread-ID: https://ampcode.com/threads/T-87e6732c-f7bf-4e8d-9ebc-f778ac6f0c40
Co-authored-by: Amp <amp@ampcode.com>
2025-11-10 10:21:46 -08:00
Steve Yegge
6d1c594c82 bd sync: 2025-11-10 10:21:27 2025-11-10 10:21:27 -08:00
Steve Yegge
b49f9b730e File bd-77gm: Import command reports misleading count
Misleading '0 created, 0 updated' message when actually importing
all issues on fresh database. Discovered during VC database sync.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 16:26:35 -08:00
Steve Yegge
deaa463d29 Update bd JSONL
Amp-Thread-ID: https://ampcode.com/threads/T-5dad0ca8-ac77-4ae0-8de6-208b23ea47af
Co-authored-by: Amp <amp@ampcode.com>
2025-11-09 16:17:08 -08:00
Steve Yegge
4de9f015d6 Support local-only git repos without remote origin (bd-biwp)
- Add hasGitRemote() helper to detect if any remote exists
- Gracefully skip git pull/push when no remote configured
- Daemon now works in local-only mode (RPC, auto-flush, JSONL export)
- Add comprehensive test coverage for local-only workflows
- Fixes GH#279: daemon crash on repos without origin remote

Amp-Thread-ID: https://ampcode.com/threads/T-5dad0ca8-ac77-4ae0-8de6-208b23ea47af
Co-authored-by: Amp <amp@ampcode.com>
2025-11-09 16:16:45 -08:00
Steve Yegge
23fce6ea49 fix: add version marker to post-checkout hook and include in CheckGitHooks
The post-checkout hook was missing the bd-hooks-version marker that the other
hooks have, and it wasn't being checked by CheckGitHooks(). This caused
version mismatch issues during hook status checks.

Changes:
- Added 'bd-hooks-version: 0.23.1' marker to post-checkout hook
- Updated CheckGitHooks() to include post-checkout in the list of hooks to check

This ensures all four git hooks (pre-commit, post-merge, pre-push, post-checkout)
have consistent version tracking.

Fixes bd-kb4g

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 14:58:03 -08:00
Steve Yegge
ad2154ba66 Fix prefix detection to only use first hyphen (bd-fasa)
- Changed ExtractIssuePrefix to use strings.Index (first hyphen)
- IDs like 'vc-baseline-test' now correctly use prefix 'vc'
- Fixes false prefix mismatch errors for hyphenated suffixes
- Added comprehensive tests for multi-part ID handling
2025-11-09 14:54:18 -08:00
Steve Yegge
83472aca3d bd sync: 2025-11-09 14:53:59 2025-11-09 14:53:59 -08:00
Steve Yegge
d482d9ea6e bd sync: 2025-11-09 14:13:48 2025-11-09 14:13:48 -08:00
Steve Yegge
052255a2e8 bd sync: 2025-11-09 12:55:37 2025-11-09 12:55:37 -08:00
Steve Yegge
1fc9bf629f Fix parallel test deadlock by removing t.Parallel() from TestCLI_* tests
Tests now complete successfully without -short flag.

Also updated git hook templates to version 0.23.1.

Fixes bd-82dv
2025-11-09 12:55:14 -08:00
Yashwanth Reddy
8f37904c9c Add auto-detection of issue prefix from git history (#277)
- Check existing JSONL issues before falling back to directory name on initialization
- Implement readFirstIssueFromJSONL() to extract prefix from first issue
- Added tests for readFirstIssueFromJSONL
2025-11-09 11:22:12 -08:00
Steve Yegge
77dcf5595c Fix Homebrew formula update in release workflow 2025-11-08 23:14:43 -08:00
Steve Yegge
77ba8b1c56 Add go.mod to go-agent example to fix goreleaser 2025-11-08 23:10:53 -08:00
Steve Yegge
b02743c5ba chore: Bump version to 0.23.1
Updated all component versions:
- bd CLI: 0.23.0 → 0.23.1
- Plugin: 0.23.0 → 0.23.1
- MCP server: 0.23.0 → 0.23.1
- npm package: 0.23.0 → 0.23.1
- Documentation: 0.23.0 → 0.23.1

Generated by scripts/bump-version.sh
2025-11-08 22:59:00 -08:00
Steve Yegge
b56527d101 Use -short flag in release.sh to avoid test deadlock (bd-82dv) 2025-11-08 22:58:43 -08:00
Steve Yegge
98f2e85618 Fix version test error message assertion 2025-11-08 22:57:49 -08:00
Steve Yegge
05b9fb4808 Close bd-auf1 2025-11-08 22:48:20 -08:00
Steve Yegge
f015f45419 bd sync: 2025-11-08 22:47:57 2025-11-08 22:47:57 -08:00
Steve Yegge
9a280e0f60 Clean up snapshot files after successful merge (bd-auf1)
Amp-Thread-ID: https://ampcode.com/threads/T-15e8dbc1-4706-4640-883e-6830a8e79fe8
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 22:45:36 -08:00
Steve Yegge
0ecf94143c bd sync: 2025-11-08 22:42:14 2025-11-08 22:42:14 -08:00
Steve Yegge
5e92720dc7 Merge branch 'main' of github.com:steveyegge/beads 2025-11-08 22:42:04 -08:00
Steve Yegge
0131eda09d Optimize CLI tests with in-process testing (bd-ky74)
- Convert exec.Command() tests to in-process rootCmd.Execute()
- Achieve ~10x speedup (3.8s vs 40s for 17 tests)
- Add mutex serialization for thread safety
- Implement manual temp dir cleanup with retries
- Reset global state between tests to prevent contamination
- Keep TestCLI_EndToEnd for binary validation
2025-11-08 22:42:02 -08:00
Steve Yegge
75d91c665f bd sync: Close bd-6221bdcd 2025-11-08 22:41:27 -08:00
Steve Yegge
7d17ad5d77 bd sync: 2025-11-08 19:33:18 2025-11-08 19:33:34 -08:00
Steve Yegge
4fd9e1c9cc Add Go agent example with Agent Mail support
Amp-Thread-ID: https://ampcode.com/threads/T-b50a2f5e-cad0-43f0-b3ec-afe9bd5fa654
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 19:33:33 -08:00
Steve Yegge
6ca26ed71b Improve cmd/bd test coverage from 20.2% to 23.3%
- Fixed TestCLI_Create to handle warning messages before JSON output
- Added tests for formatDependencyType (show.go)
- Added tests for truncateForBox and gitRevParse (worktree.go)
- Added comprehensive CLI tests for labels, priority formats, and reopen
- All tests passing in short mode

Addresses bd-6221bdcd
2025-11-08 18:22:28 -08:00
Steve Yegge
734579b1a2 Remove version field from metadata.json
- Removes noisy version mismatch warnings on every bd upgrade
- Version field in metadata.json was redundant with daemon version checking via RPC
- Daemon version mismatches still detected via HealthResponse
- Removes checkVersionMismatch() function and related test file
- Updates .beads/.gitignore to properly ignore merge artifacts

Amp-Thread-ID: https://ampcode.com/threads/T-7ba8aff2-97a0-4d0c-9008-e858bdfadd61
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 18:16:39 -08:00
Steve Yegge
384a369acf Sync beads database 2025-11-08 15:58:51 -08:00
Steve Yegge
52d356a49d bd sync: 2025-11-08 15:58:40 2025-11-08 15:58:40 -08:00
Steve Yegge
3fbeccce58 bd sync: 2025-11-08 15:56:01 2025-11-08 15:56:01 -08:00
Steve Yegge
f027de93b6 Add schema compatibility probe to prevent silent migration failures (bd-ckvw)
- Implement comprehensive schema probe in sqlite.New() that verifies all
  expected tables and columns after migrations
- Add retry logic: if probe fails, retry migrations once
- Return clear fatal error with missing schema elements if probe still fails
- Enhance daemon version gating: refuse RPC if client has newer minor version
- Improve checkVersionMismatch messaging: verify schema before claiming upgrade
- Add schema compatibility check to bd doctor command
- Add comprehensive tests for schema probing

This prevents the silent migration failure bug where:
1. Migrations fail silently
2. Database queries fail with 'no such column' errors
3. Import logic misinterprets as 'not found' and tries INSERT
4. Results in cryptic UNIQUE constraint errors

Fixes #262

Amp-Thread-ID: https://ampcode.com/threads/T-0d7ae2c0-9f12-4f9b-85d1-1291488af150
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 15:40:19 -08:00
Steve Yegge
54702b59a2 Fix #264 and #262: Remove stale --resolve-collisions references
- Update examples/git-hooks README to use 'bd hooks install' instead of non-existent install.sh
- Fix post-merge hook error message to not suggest --resolve-collisions flag (removed in v0.20)
- Clean up all doc references to --resolve-collisions (flag removed, hash IDs prevent collisions)

Fixes #264 (git hooks installer missing)
Fixes #262 (misleading error message)

Amp-Thread-ID: https://ampcode.com/threads/T-c9f0e4cb-fba2-4db2-a3d5-36dc1892be9d
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 13:18:50 -08:00
Steve Yegge
c3a701fe8e Implement message system improvements (bd-6uix)
- Add 30s HTTP client timeout to prevent hangs (bd-de0h)
- Implement full message reading with body display (bd-8mfn)
- Add validation for --importance flag (bd-bdhn)
- Refactor duplicated error messages into constant (bd-s1xn)
- Fix inefficient client-side filtering, use server-side (bd-ri6d)
- Improve type safety with typed Message struct (bd-p0zr)

Amp-Thread-ID: https://ampcode.com/threads/T-ee20cc86-a866-4789-9d4d-4d14e1a6d6f4
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 13:16:53 -08:00
Steve Yegge
dba6090046 Update beads.jsonl - closed bd-17d5 2025-11-08 13:10:10 -08:00
Steve Yegge
0b28bfec7a Fix bd-17d5: conflict marker false positives on JSON-encoded content
- import.go: Check raw bytes before JSON decoding using bytes.HasPrefix
- validate.go: Use bytes.Split and bytes.HasPrefix on raw data
- Added regression test TestAutoImportConflictMarkerFalsePositive
- Verified with vc-85 issue that triggered the bug

Amp-Thread-ID: https://ampcode.com/threads/T-3f81e22a-14b9-435b-8932-5641aadb7d31
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 13:09:42 -08:00
Matteo Landi
53c9e9bf89 fix: Add 'file:' prefix to SQLite URIs in doctor.go (#261)
Without the 'file:' URI scheme prefix, SQLite treats query parameters
like '?mode=ro' as part of the filename instead of connection options.
This caused:
- Creation of bogus files named 'beads.db?mode=ro'
- Failure to read database version from metadata table
- bd doctor incorrectly reporting 'version pre-0.17.5 (very old)'

Fixed two sql.Open() calls in doctor.go:
- Line 317 (checkIssueIDs function)
- Line 403 (getDatabaseVersionFromPath function)

Now uses 'file:'+dbPath+'?mode=ro' pattern consistent with migrate.go.

Fixes #260

Amp-Thread-ID: https://ampcode.com/threads/T-ac9832d6-15e4-4e25-8027-5e8b640b190b

Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 11:36:42 -08:00
Matteo Landi
4bca2067ff fix(import): Update database mtime after import to prevent bd doctor false warnings (#263)
When 'bd sync --import-only' completes, it imports JSONL changes into
the database but doesn't update the database file's modification time.
This causes 'bd doctor' to incorrectly warn that 'JSONL is newer than
database' even when they're in sync.

Root cause: SQLite in WAL mode writes to beads.db-wal; the main beads.db
mtime often doesn't change until a checkpoint. bd doctor compares JSONL
mtime to beads.db mtime, so it can misfire without an mtime bump.

The fix adds touchDatabaseFile() that:
- Only runs when import actually made changes (not dry-run, not unchanged)
- Sets DB mtime to max(JSONL mtime, now) + 1ns to handle clock skew
- Is best-effort (logs warning on failure, doesn't fail import)
- Includes tests for basic touch and clock skew scenarios

Fixes: bd-g3ey
2025-11-08 11:36:05 -08:00
Steve Yegge
9300c0d7cf Add .envrc to .gitignore (direnv local config) 2025-11-08 11:34:50 -08:00
Steve Yegge
346a599242 Update AGENTS.md to highlight automated release.sh script 2025-11-08 04:17:28 -08:00
Steve Yegge
005e822978 Merge branch 'main' of github.com:steveyegge/beads 2025-11-08 04:16:47 -08:00
Steve Yegge
bbe73d54bc Add Agent Mail multi-workspace deployment guide and scripts
- docs/AGENT_MAIL_DEPLOYMENT.md: 10-step deployment plan for 13 workspaces
- docs/AGENT_MAIL_MULTI_WORKSPACE_SETUP.md: Architecture and configuration guide
- scripts/setup-agent-mail-workspace.sh: Auto-configure .envrc per workspace
- scripts/start-agent-mail-server.sh: Start Agent Mail server
- scripts/stop-agent-mail-server.sh: Stop Agent Mail server
- scripts/agent-mail-status.sh: Monitor server and all channels

Supports 3-channel setup: beads.dev, vc.dev, wyvern.dev
Ready for 0.23.0 deployment with Agent Mail integration

Amp-Thread-ID: https://ampcode.com/threads/T-bc960efb-3ddc-4635-8c8e-a42a6e9e67d9
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 04:16:44 -08:00
Steve Yegge
77f91c3ad1 Document update-homebrew.sh script and v0.23.0 fix 2025-11-08 04:15:16 -08:00
Steve Yegge
90f57a7a40 Remove obsolete 10s wait from release.sh (update-homebrew.sh handles waiting) 2025-11-08 04:14:34 -08:00
Steve Yegge
f7d4eb0318 Fix update-homebrew.sh: Use GoReleaser checksums instead of source tarball 2025-11-08 04:14:14 -08:00
Steve Yegge
9c5bf2c1eb Fix RELEASING.md: Homebrew formula uses GoReleaser artifacts, not source tarball 2025-11-08 03:59:59 -08:00
Steve Yegge
367bf077e1 Update hook templates and whats-new data to v0.23.0 2025-11-08 03:56:08 -08:00
Steve Yegge
f12004c7ab Add Agent Mail 98.5% git traffic reduction metric to changelog and README 2025-11-08 03:54:28 -08:00
Steve Yegge
789f74a047 chore: Bump version to 0.23.0
Updated all component versions:
- bd CLI: 0.22.1 → 0.23.0
- Plugin: 0.22.1 → 0.23.0
- MCP server: 0.22.1 → 0.23.0
- npm package: 0.22.1 → 0.23.0
- Documentation: 0.22.1 → 0.23.0

Generated by scripts/bump-version.sh
2025-11-08 03:53:18 -08:00