Commit Graph

1092 Commits

Author SHA1 Message Date
Steve Yegge
95560dc6e8 Add refactoring issues for sqlite.go and daemon.go 2025-11-01 11:41:29 -07:00
Steve Yegge
a4b4778ced test: improve coverage for importer and sqlite utils
- Fix TestImportIssues_Update by adding timestamps to test issue
- Add comprehensive tests for sqlite utility functions (IsUniqueConstraintError, QueryContext, BeginTx, ExecInTransaction)
- Coverage improvements: sqlite util.go 0% -> 95%, sqlite package 56.4% -> 57.1%

Amp-Thread-ID: https://ampcode.com/threads/T-17e6a3e4-f881-4f53-b670-bdd796d58f68
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 11:35:31 -07:00
Steve Yegge
48469585b4 Close bd-2530 and bd-373c 2025-11-01 11:16:25 -07:00
Steve Yegge
69e2144e88 Improve cmd/bd test coverage to 42.9%
- Add epic_test.go with 3 tests for epic functionality
- Enhance compact_test.go with dry-run scenario tests
- Test epic-child relationships via dependencies
- All tests passing

Closes bd-27ea

Amp-Thread-ID: https://ampcode.com/threads/T-d88e08a0-f082-47a3-82dd-0a9b9117ecbf
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 11:11:20 -07:00
Steve Yegge
be109512ad Merge branch 'main' of github.com:steveyegge/beads 2025-11-01 11:07:44 -07:00
Steve Yegge
d163b797e0 bd sync: 2025-11-01 11:07:43 2025-11-01 11:07:43 -07:00
goreleaserbot
a49a341832 Brew formula update for beads version v0.21.2 2025-11-01 18:07:10 +00:00
Steve Yegge
edf6008f63 Fix GoReleaser homebrew config: use 'directory' not 'folder' 2025-11-01 11:04:09 -07:00
Steve Yegge
77819ff63c chore: Bump version to 0.21.2 2025-11-01 10:43:38 -07:00
Steve Yegge
e05c898987 Update CHANGELOG for 0.21.2 2025-11-01 10:43:12 -07:00
Steve Yegge
0c9a6ab72a Configure GoReleaser to publish Homebrew formula in main repo 2025-11-01 10:42:07 -07:00
Steve Yegge
731ab31dc6 chore: Bump version to 0.21.1 2025-10-31 23:47:20 -07:00
Steve Yegge
fc2213dfe4 Auto-sync beads database 2025-10-31 23:46:56 -07:00
Steve Yegge
6e0dee17d2 Update CHANGELOG for 0.21.1 2025-10-31 23:46:50 -07:00
Steve Yegge
5d64c09237 bd sync: 2025-10-31 23:04:08 2025-10-31 23:04:08 -07:00
Steve Yegge
cc7918daf4 Implement bd stale command (bd-c01f, closes #184)
- Add bd stale command to find abandoned/forgotten issues
- Support --days (default 30), --status, --limit, --json flags
- Implement GetStaleIssues in SQLite and Memory storage
- Add full RPC/daemon support
- Comprehensive test suite (6 tests, all passing)
- Update AGENTS.md documentation

Resolves GitHub issue #184

Amp-Thread-ID: https://ampcode.com/threads/T-f021ddb8-54e3-41bf-ba7a-071749663c1d
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 23:03:56 -07:00
Steve Yegge
645af0b72d bd daemon sync: 2025-10-31 22:58:01 2025-10-31 22:58:01 -07:00
Steve Yegge
2d6a32a7db Merge branch 'main' of github.com:steveyegge/beads 2025-10-31 22:39:54 -07:00
Steve Yegge
acb731a4ec bd sync: 2025-10-31 22:39:53 2025-10-31 22:39:53 -07:00
Steve Yegge
727aaf910e Add --json flag to delete command
Amp-Thread-ID: https://ampcode.com/threads/T-91803e1e-9e64-431e-87d8-d868ddab71d4
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 22:38:39 -07:00
Steve Yegge
c2d3ad2d63 Update issues 2025-10-31 22:08:32 -07:00
Steve Yegge
fbd3997a0e bd sync: 2025-10-31 22:08:18 2025-10-31 22:08:32 -07:00
Steve Yegge
079effdaeb Fix bd-373c: Surface daemon errors when multiple .db files exist
When daemon detects multiple .db files (after filtering .backup and vc.db),
it now writes detailed error to .beads/daemon-error file before exiting.

The error file is checked and displayed when:
- Daemon discovery fails to connect
- Auto-start fails to yield a running daemon
- User runs 'bd daemons list'

This makes the error immediately visible without requiring users to check
daemon logs.

Changes:
- cmd/bd/daemon.go: Write daemon-error file on multiple .db detection
- internal/daemon/discovery.go: Read and surface daemon-error in DaemonInfo.Error
- cmd/bd/main.go: Display daemon-error when auto-start fails

Amp-Thread-ID: https://ampcode.com/threads/T-1005a8d1-7a5a-4844-ad2d-2b8a6145825f
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 22:01:45 -07:00
Steve Yegge
31a936a4b4 bd sync: 2025-10-31 22:01:19 2025-10-31 22:01:45 -07:00
Steve Yegge
520af76234 Add comprehensive tests for create.go functionality
- Add 10 test cases covering basic creation, descriptions, design/acceptance
- Test labels, dependencies, discovered-from, explicit IDs, assignees
- Test all issue types and multiple dependencies
- All tests passing
- Maintains 27.6% coverage in cmd/bd

Amp-Thread-ID: https://ampcode.com/threads/T-2925a09a-b56d-4a2e-b79f-2d467c76feb2
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 21:51:54 -07:00
Steve Yegge
5a7e1b7c75 Fix bd sync git pull command to be explicit about remote and branch 2025-10-31 21:34:34 -07:00
Steve Yegge
816e7d5bfc bd sync: 2025-10-31 21:33:25 2025-10-31 21:33:25 -07:00
Steve Yegge
58609b2611 Update JSONL with closed issues 2025-10-31 21:27:33 -07:00
Steve Yegge
0b852f52d9 Remove obsolete renumber and stale commands, fix test
- Remove renumber.go: Hash IDs eliminated need for ID compaction
- Remove stale.go: Executor/heartbeat tables were never implemented
- Fix TestListCommand: duplicate dependency constraint violation
- Update comments removing references to removed commands

Amp-Thread-ID: https://ampcode.com/threads/T-3dcd8681-c7d3-4fe1-9750-b38279b56cdb
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 21:27:33 -07:00
Steve Yegge
af517b4b10 Enhance bd doctor with operational health checks (bd-40a0) 2025-10-31 21:27:05 -07:00
Steve Yegge
56cf62c538 bd sync: 2025-10-31 21:26:59 2025-10-31 21:26:59 -07:00
Steve Yegge
b138704179 bd sync: 2025-10-31 21:18:50 2025-10-31 21:18:50 -07:00
Steve Yegge
31fcb06059 Fix daemon crash when backup/vc.db files exist
- Changed backup file filtering from checking file extension (.backup) to checking if filename contains '.backup'
- This now properly filters files like 'beads.backup-pre-hash-20251030-171258.db'
- Also exclude vc.db from database detection
- Add strings import to beads.go
- Improve error message to suggest manual removal

Fixes bd-373c
2025-10-31 21:18:08 -07:00
Steve Yegge
2e21398982 bd sync: 2025-10-31 21:16:53 2025-10-31 21:16:53 -07:00
Steve Yegge
da48cdd841 bd sync: 2025-10-31 21:08:14 2025-10-31 21:08:14 -07:00
Steve Yegge
537b646968 bd sync: 2025-10-31 20:41:33 2025-10-31 20:41:34 -07:00
Steve Yegge
77142e9db3 Improve cmd/bd test coverage from 21% to 26.2%
- Add test for runCompactStats function (both JSON and regular output)
- Add tests for outputDotFormat and outputFormattedList functions
- Test dot format, digraph preset, custom templates, and error cases
- Coverage increased from 21.0% to 26.2% (5.2 percentage points)

Part of bd-27ea (multi-session effort to reach 40% coverage)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 20:40:04 -07:00
Steve Yegge
dedf3c5f3a bd sync: 2025-10-31 20:36:51 2025-10-31 20:36:51 -07:00
Steve Yegge
fbc95bcf11 bd sync: 2025-10-31 20:35:20 2025-10-31 20:35:20 -07:00
Steve Yegge
ebda4b4e6a Merge: accept remote JSONL 2025-10-31 20:35:20 -07:00
Steve Yegge
366ad6204e bd sync: 2025-10-31 20:35:08 2025-10-31 20:35:08 -07:00
Steve Yegge
c840ba50bc Add comprehensive tests for show.go commands (bd-12c2)
Added test coverage for show, update, close, and edit commands in
cmd/bd/show_test.go:

- TestShowCommand (6 subtests): single/multiple issues, JSON output,
  dependencies, labels, compaction
- TestUpdateCommand (11 subtests): status, priority, title, assignee,
  description, design, notes, acceptance criteria, multiple fields/issues
- TestCloseCommand (4 subtests): single/multiple issues, JSON output,
  with/without reason
- TestEditCommand (1 subtest): argument validation

Key improvements:
- Properly sets global store variable to avoid "no issue found" errors
- Uses direct mode (BEADS_NO_DAEMON=1) for test isolation
- Follows existing test patterns from init_test.go and list_test.go
- All 22 test cases passing

Total cmd/bd coverage improved to 39.6%

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 20:29:17 -07:00
Steve Yegge
d8ff53a662 Merge remote changes 2025-10-31 20:28:58 -07:00
Steve Yegge
4fd1e20091 bd sync: 2025-10-31 20:28:38 2025-10-31 20:28:38 -07:00
Steve Yegge
b2d66b54e0 bd sync: 2025-10-31 20:21:25 2025-10-31 20:21:25 -07:00
Steve Yegge
fae597c4f5 Bump version to 0.21.0
Amp-Thread-ID: https://ampcode.com/threads/T-a9a67394-37ca-4b79-aa23-c5c011f9c0cd
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 20:21:15 -07:00
Steve Yegge
8cbcde134a Make event-driven mode the default
Event-driven daemon is now production-ready after hardening fixes in
commit 349b892. Making it the default for v0.21.0.

Users can still opt back to polling mode with BEADS_DAEMON_MODE=poll
if needed.

Benefits:
- <500ms sync latency (vs 5000ms with polling)
- ~60% less CPU usage
- Instant reactivity to mutations and file changes
- Fallback polling when file watcher unavailable

Amp-Thread-ID: https://ampcode.com/threads/T-a9a67394-37ca-4b79-aa23-c5c011f9c0cd
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 20:20:44 -07:00
Steve Yegge
8415639a32 bd sync: 2025-10-31 20:18:15 2025-10-31 20:18:15 -07:00
Steve Yegge
349b892123 Harden event-driven daemon for production
Three critical fixes to make event-driven mode production-ready:

1. Skip redundant imports: Check JSONL mtime vs DB mtime to avoid
   self-triggered import loops after export writes JSONL

2. Add server.Stop() in serverErrChan case: Ensures clean RPC
   server shutdown on errors

3. Fallback ticker (60s): When file watcher unavailable (e.g., network
   filesystems), fall back to periodic polling to detect remote changes

These minimal fixes address Oracle's concerns without over-engineering.
Event-driven mode is now safe for default.

Amp-Thread-ID: https://ampcode.com/threads/T-a9a67394-37ca-4b79-aa23-c5c011f9c0cd
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 20:18:05 -07:00
Steve Yegge
c460d00861 bd sync: 2025-10-31 20:15:58 2025-10-31 20:15:58 -07:00