Commit Graph

666 Commits

Author SHA1 Message Date
Steve Yegge
eb2563310b Update issue metadata
Amp-Thread-ID: https://ampcode.com/threads/T-f1cff202-188b-4850-a909-c2750d24ad22
Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 19:03:07 -07:00
Steve Yegge
4e38626361 Document bd daemons commands (bd-150)
Amp-Thread-ID: https://ampcode.com/threads/T-f1cff202-188b-4850-a909-c2750d24ad22
Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 19:03:03 -07:00
Steve Yegge
7980b9c9e9 Implement bd daemons killall and logs (bd-153, bd-152)
Amp-Thread-ID: https://ampcode.com/threads/T-f1cff202-188b-4850-a909-c2750d24ad22
Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 19:03:00 -07:00
Steve Yegge
43264dbf35 Add RECOVERY.md documenting lost work from git reset 2025-10-26 18:55:24 -07:00
Steve Yegge
881e0940a7 Add config.json support for database path configuration (bd-163)
- Create internal/configfile package for config.json handling
- bd init now creates .beads/config.json with database, version, and jsonl_export fields
- Database discovery checks config.json first, falls back to beads.db
- Update .gitignore to not ignore config.json (part of repo state)
- Update test to expect beads.db and config.json
- Backward compatible with existing beads.db-only setups
2025-10-26 18:44:27 -07:00
Steve Yegge
51abbb512e bd sync: 2025-10-26 18:44:19 2025-10-26 18:44:19 -07:00
Steve Yegge
7549bd86bc Implement stricter daemon lock file validation (bd-161)
- Add JSON format to daemon.lock with database path, version, PID, and timestamp
- Validate database path on client connection (fail if mismatch)
- Backward compatible with old plain-PID lock files
- Add comprehensive tests for JSON format and validation
- Update all lock acquisition callsites to pass database path

Amp-Thread-ID: https://ampcode.com/threads/T-137e6a9c-b690-4ade-9bec-13fcd7d0e4ed
Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 18:37:25 -07:00
Steve Yegge
50623f8be1 bd sync: 2025-10-26 18:35:28 2025-10-26 18:35:28 -07:00
Steve Yegge
93e170627d bd-154: Implement bd daemons stop and restart subcommands 2025-10-26 18:35:28 -07:00
Steve Yegge
cd86d7d2ba Implement bd-160: Add database schema versioning
- Added version validation on daemon startup
- Daemon checks bd_version metadata matches current version
- Clear error messages for version mismatches with 3 resolution options
- Auto-sets missing version metadata for old databases
- Added BEADS_IGNORE_VERSION_MISMATCH=1 override for emergencies
- Tested version mismatch detection, override flag, and missing metadata handling
2025-10-26 18:28:15 -07:00
Steve Yegge
b39420f748 bd sync: 2025-10-26 18:21:59 2025-10-26 18:21:59 -07:00
Steve Yegge
0a283d5148 bd-151: Implement bd daemons health subcommand 2025-10-26 18:21:55 -07:00
Steve Yegge
1c7de68bfc bd sync: 2025-10-26 18:17:38 2025-10-26 18:17:38 -07:00
Steve Yegge
9448d5227c bd-149: Add auto-cleanup of stale sockets and PID files to bd daemons list 2025-10-26 18:17:33 -07:00
Steve Yegge
991da5af0c bd sync: 2025-10-26 18:16:59 2025-10-26 18:16:59 -07:00
Steve Yegge
ae5aee279b Implement bd-162: Enforce canonical database name (beads.db)
- Changed bd init to always create beads.db instead of {prefix}.db
- Added migration logic to detect and rename old databases
- Updated findDatabaseInTree to prefer beads.db and warn on multiple .db files
- Daemon now refuses to start if multiple .db files exist (ambiguity error)
- Updated tests to expect beads.db instead of prefix-based naming
- Tested migration, ambiguity detection, and warning messages
2025-10-26 18:16:27 -07:00
Steve Yegge
dd82840886 Close bd-165 as duplicate 2025-10-26 18:10:51 -07:00
Steve Yegge
95f50d7943 bd sync: 2025-10-26 18:10:45 2025-10-26 18:10:45 -07:00
Steve Yegge
764915f6a6 bd sync: 2025-10-26 18:10:25 2025-10-26 18:10:25 -07:00
Steve Yegge
c61ca494fe feat(daemons): implement discovery and list command (bd-146, bd-147)
- Add daemon discovery mechanism with socket scanning
- Implement depth-limited filesystem walk to avoid hangs
- Add DaemonInfo struct with metadata collection
- Create 'bd daemons list' command with table and JSON output
- Add FindDaemonByWorkspace and CleanupStaleSockets utilities
- Fix workspace path to be parent of .beads directory
- Add comprehensive tests for discovery functionality

Closes bd-146
Closes bd-147
2025-10-26 18:10:24 -07:00
Steve Yegge
75c959e69c feat(daemon): add GET /status endpoint (bd-148)
- Add OpStatus operation and StatusResponse type to RPC protocol
- Add workspacePath and dbPath fields to Server struct
- Implement handleStatus() handler with daemon metadata
- Track last activity time with atomic.Value
- Add client.Status() method
- Check for exclusive locks via ShouldSkipDatabase()
- Update all test files to use new NewServer signature
- Add comprehensive status endpoint test

Closes bd-148
2025-10-26 17:55:39 -07:00
Steve Yegge
6bf5c9d2b9 bd sync: 2025-10-26 17:55:32 2025-10-26 17:55:32 -07:00
Steve Yegge
2dd96bff43 chore: Bump version to 0.17.5
Updated all component versions:
- bd CLI: 0.17.4 → 0.17.5
- Plugin: 0.17.4 → 0.17.5
- MCP server: 0.17.4 → 0.17.5
- Documentation: 0.17.4 → 0.17.5

Generated by scripts/bump-version.sh
2025-10-26 17:42:05 -07:00
Steve Yegge
5493559317 Sync AGENTS.md 2025-10-26 17:40:22 -07:00
Steve Yegge
2b43bde756 Update AGENTS.md with new sync workflow and batching behavior
- Document 30-second batching window
- Add 'Agent Session Workflow' section with bd sync instructions
- Update Pro Tips to emphasize running 'bd sync' at end of session
- Clarify auto-sync timing (30s debounce, 5s daemon poll)
2025-10-26 17:39:10 -07:00
Steve Yegge
e910d96bc6 Adjust sync timings for better batching behavior
- Increase flush debounce from 1s to 30s (provides transaction window for batch operations)
- Increase daemon poll from 2s to 5s (reduces commit spam)
- Agents should run 'bd sync' at end of session to force immediate commit
- Prevents creating dozens of commits when making multiple issue changes
2025-10-26 17:15:39 -07:00
Steve Yegge
fcff20a735 Reduce auto-sync delays for better UX
- Reduce flush debounce from 5s to 1s (BEADS_FLUSH_DEBOUNCE)
- Reduce daemon poll interval from 10s to 2s
- Makes issue changes sync much faster to JSONL and git
2025-10-26 17:14:25 -07:00
Steve Yegge
0f27c5abf1 Add bd daemons list and health subcommand tasks (bd-158, bd-157) 2025-10-26 17:11:08 -07:00
Steve Yegge
e657931186 Fix two daemon bugs: race condition on deletion (bd-155) and wrong project context (bd-156)
- bd-155: Add pre-import flush in daemon sync cycle to prevent deleted issues from being re-imported
- bd-155: Reduce default daemon polling interval from 5 minutes to 10 seconds
- bd-156: Fix hardcoded 'vc.db' - now properly detects existing .db files in local .beads/ directory
2025-10-26 17:09:20 -07:00
Steve Yegge
b5a2734f78 feat: Add --all flag to bd list for CLI familiarity
Common CLI pattern (git branch -a, docker ps -a, ls -a).
No-op since bd list already shows all issues by default,
but prevents error/retry cycles when agents reflexively use it.
2025-10-26 14:45:09 -07:00
Steve Yegge
f34eca1e2e feat: Add --version/-v flag support
Agents often try 'bd --version' as a standard CLI pattern.
Now supports both:
- bd --version (or -v)
- bd version (existing subcommand)
2025-10-26 14:24:05 -07:00
Steve Yegge
80b0af9457 chore: Bump version to 0.17.4
Updated all component versions:
- bd CLI: 0.17.3 → 0.17.4
- Plugin: 0.17.3 → 0.17.4
- MCP server: 0.17.3 → 0.17.4
- Documentation: 0.17.3 → 0.17.4

Generated by scripts/bump-version.sh
2025-10-26 14:20:03 -07:00
Steve Yegge
0ee45bf7de fix: Auto-sync RPC client/server versions from CLI version
- Set rpc.ServerVersion from Version in daemon startup
- Set rpc.ClientVersion from Version in main.go startup
- Eliminates need to manually update RPC versions
- Both now use 0.0.0 placeholder, overridden at runtime

Amp-Thread-ID: https://ampcode.com/threads/T-03c37f7f-f41e-4b87-8700-d346c21bad30
Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 14:18:35 -07:00
Steve Yegge
d297848f76 chore: Bump version to 0.17.3
Updated all component versions:
- bd CLI: 0.17.2 → 0.17.3
- Plugin: 0.17.2 → 0.17.3
- MCP server: 0.17.2 → 0.17.3
- Documentation: 0.17.2 → 0.17.3

Generated by scripts/bump-version.sh
2025-10-26 13:59:01 -07:00
Steve Yegge
9f9ea48ec1 Update beads.jsonl 2025-10-26 13:24:18 -07:00
Steve Yegge
4c71235377 Fix syntax error in onboard.go from PR #154
The backtick escaping was missing around .beads/issues.jsonl on line 69.
2025-10-26 13:24:18 -07:00
Steve Yegge
dde640a502 Add bd-144 for bd edit follow-ups 2025-10-26 13:24:18 -07:00
Ryan Newton
5727ec629d Add bd edit mode for human usage (#152)
Co-authored-by: Claude Code <claude@anthropic.com>
2025-10-26 13:23:49 -07:00
Steve Yegge
9cebb65410 Auto-update beads.jsonl 2025-10-26 13:21:49 -07:00
Steve Yegge
5228108d41 Update beads.jsonl: close bd-142, create bd-143 2025-10-26 13:21:49 -07:00
Steve Yegge
f01d81b468 Fix bd init --quiet to install git hooks inline
bd init --quiet was returning before git hooks installation code ran.
Also replaced external install.sh dependency with inline hook generation.

Changes:
- Move hooks installation before quiet mode return
- Embed hook scripts directly in installGitHooks()
- Remove dependency on examples/git-hooks/install.sh
- Remove unused os/exec import

Fixes bd-142 testing requirement.
2025-10-26 13:21:49 -07:00
Dennis Schön
4b150b0918 onboard: add step to commit JSONL with code changes (#154)
Add a new step to the onboarding workflow reminding AI agents to commit
the `.beads/issues.jsonl` file together with code changes. This ensures
issue state stays synchronized with code state, which is critical for
maintaining accurate project history and making issues meaningful when
reviewing past commits.
2025-10-26 13:21:34 -07:00
Dennis Schön
5f67dadec0 init: add daemon.lock to .gitignore (#156)
The daemon.lock file should be ignored in git since it's a runtime
file created by the daemon to manage exclusive database access.

Amp-Thread-ID: https://ampcode.com/threads/T-b77cef77-966d-4917-b605-4d2b2fb546e1

Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 13:21:22 -07:00
Steve Yegge
ec7d824897 Fix bd init --quiet and clarify agent usage in docs
- Fix: bd init --quiet now skips interactive prompts and auto-installs hooks
- Docs: Add Git Workflow & Auto-Sync section to README
- Docs: Update AGENTS.md with --quiet flag guidance for agents
- Docs: Update WORKFLOW.md to explain auto-import after git pull
- Docs: Add FAQ entries about auto-sync behavior and who runs init
- Closes bd-127, bd-140, bd-141

Amp-Thread-ID: https://ampcode.com/threads/T-72f55d41-f16c-4541-b72a-8acc9013e87b
Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 12:53:50 -07:00
Steve Yegge
c91e83e993 Add bd sync --import-only flag and git pull integration test (bd-124, bd-125)
- Add --import-only flag to bd sync command for manual JSONL import after git pull
- Show import summary output instead of suppressing it
- Add comprehensive integration test for git pull sync scenario
- Test covers non-daemon auto-import and bd sync command
- Verify performance of import operations

Closes bd-123, bd-114, bd-124, bd-125, bd-136, bd-137

Amp-Thread-ID: https://ampcode.com/threads/T-7d8dc20f-baf2-4d1d-add1-57fa67028c15
Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 12:37:46 -07:00
Steve Yegge
8fe0586080 Update bd-132 with current status and next steps 2025-10-26 12:11:24 -07:00
Steve Yegge
897bc6ace8 Merge duplicate bd-135 into bd-132 2025-10-26 11:59:55 -07:00
Steve Yegge
ada7bd0b73 Refactor autoImportIfNewer to internal/autoimport package (bd-128)
- Extracted auto-import logic from cmd/bd/main.go to internal/autoimport
- Removed global dependencies (store, dbPath) by using parameters
- Uses callback pattern (ImportFunc) for flexible import implementation
- Both CLI and daemon can now call auto-import after detecting staleness
- Added detailed ID remapping output for collision resolution
- Improved error reporting for parse failures
- All tests passing

Amp-Thread-ID: https://ampcode.com/threads/T-b7faaa33-fc52-409f-82b3-28db143b335d
Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 11:55:24 -07:00
Steve Yegge
744d7b67dc Merge duplicate issue bd-135 into bd-132 2025-10-26 11:49:55 -07:00
Steve Yegge
8eca47c4fb Fix database: restore clean 135 issues and add exclusive lock docs 2025-10-25 23:39:26 -07:00