Commit Graph

1777 Commits

Author SHA1 Message Date
Steve Yegge
37f9d3610d Complete Agent Mail documentation (bd-nl8z)
- Add AGENT_MAIL_QUICKSTART.md: 5-minute setup guide
- Add examples/python-agent/AGENT_MAIL_EXAMPLE.md: working code examples
- Add examples/python-agent/agent_with_mail.py: runnable multi-agent demo
- Update README.md: add Agent Mail to features and docs index
- Update AGENTS.md: enhance with quickstart/example references
- Update examples README: add Agent Mail example to index

Amp-Thread-ID: https://ampcode.com/threads/T-5d5e711d-7b5f-42ca-b75a-5b6cd843ad98
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:36:27 -08:00
Steve Yegge
3b39672e76 bd sync: 2025-11-08 02:28:57 2025-11-08 02:28:57 -08:00
Steve Yegge
a03737c89a feat: Add bd info --whats-new for agent version awareness (bd-eiz9)
- Add --whats-new flag to bd info command
- Display agent-relevant changes from last 3 versions
- Support both human-readable and JSON output
- Add version changelog data structure with workflow-impacting changes
- Add comprehensive tests for version changes structure
- Update AGENTS.md with whats-new documentation

Helps agents efficiently learn what changed between bd versions without
re-reading full documentation. Addresses weekly major version releases
requiring workflow adaptations.

Closes bd-eiz9

Amp-Thread-ID: https://ampcode.com/threads/T-5fe7e93d-7398-41c5-94bf-e914f2b331dd
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:28:54 -08:00
Steve Yegge
1da414fa34 Merge remote changes and add TTL/expiration tests (bd-d6aq)
- Resolved beads.jsonl merge conflict
- Created test_reservation_ttl.py with 4 integration tests
- Tests short TTL (30s), reservation blocking, auto-release, and renewal
- Mock server implements full TTL management with expiration tracking
- All tests passing in ~57s (includes 30s wait for expiration)
- Updated integration test README with new test documentation
2025-11-08 02:24:39 -08:00
Steve Yegge
00333ce082 bd sync: 2025-11-08 02:24:17 2025-11-08 02:24:17 -08:00
Steve Yegge
9d9386fa9b bd sync: 2025-11-08 02:22:18 2025-11-08 02:22:18 -08:00
Steve Yegge
773aa736e4 Document external_ref in content hash behavior (bd-9f4a)
- Added comprehensive code comments in collision.go explaining external_ref inclusion
- Documented content hash behavior in HASH_ID_DESIGN.md with examples
- Enhanced test documentation in collision_test.go
- Closes bd-9f4a, bd-df11, bd-537e

Amp-Thread-ID: https://ampcode.com/threads/T-47525168-d51c-4f56-b598-18402e5ea389
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:22:15 -08:00
Steve Yegge
5793ec32a9 bd sync: 2025-11-08 02:20:47 2025-11-08 02:20:47 -08:00
Steve Yegge
f862071c7e Refactor snapshot management into dedicated module (bd-urob)
- Created SnapshotManager type in snapshot_manager.go
- Encapsulates all snapshot operations with clean API
- Added SnapshotStats for observability
- Reduced deletion_tracking.go from 557 to 153 lines (72% reduction)
- Enhanced merge output with statistics
- All tests passing

Amp-Thread-ID: https://ampcode.com/threads/T-d82acce9-170d-4e58-b227-fd33d48b8598
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:20:33 -08:00
Steve Yegge
24bfb6afd2 Add comprehensive tests for Python Agent Mail adapter
- Add 24 new tests across 6 test classes
- Cover authorization headers, request body validation
- Test reservation edge cases (TTL, special chars, multiple reservations)
- Test timeout configuration and precedence
- Test inbox/notification edge cases (large payloads, Unicode, nested data)
- Fix timeout parameter precedence bug (constructor now overrides env var)
- All 51 tests pass

Closes bd-b134

Amp-Thread-ID: https://ampcode.com/threads/T-2f39e97d-38de-4df4-bf94-ef90184cee8a
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:19:31 -08:00
Steve Yegge
3b326cab61 Update bd JSONL - closed bd-ic1m
Amp-Thread-ID: https://ampcode.com/threads/T-0907bb40-ffc9-4f09-843f-b26716ef9ce0
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:14:06 -08:00
Steve Yegge
3bce3138a9 Add automated git traffic benchmark for Agent Mail
- Created tests/benchmarks/git_traffic.py with 50-issue workflow
- Measures git operations reduction: git-only vs Agent Mail
- Generates comparison reports with pass/fail (70% target)
- Results: 98.5% reduction (200 → 3 operations)
- Added documentation in tests/benchmarks/README.md

Closes bd-ic1m

Amp-Thread-ID: https://ampcode.com/threads/T-0907bb40-ffc9-4f09-843f-b26716ef9ce0
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:13:51 -08:00
Steve Yegge
b02a1ff63f Fix #258: Allow completion commands without database
Add bash/zsh/fish/powershell to noDbCommands list so shell completion
generation works without requiring a .beads database.

Fixes: bd-71ky, GH-258
2025-11-08 02:06:06 -08:00
Steve Yegge
f79735daa0 Ignore Python cache in integration tests 2025-11-08 01:58:40 -08:00
Steve Yegge
ce2afd18ae bd sync: 2025-11-08 01:58:15 2025-11-08 01:58:15 -08:00
Steve Yegge
d6aa078c30 Add Agent Mail failure scenario tests (bd-zi1v)
- Tests 7 failure modes: connection refused, server crash, timeout, 500 errors, invalid token, malformed JSON, consistency
- All agents gracefully degrade to Beads-only mode
- Uses --no-daemon flag for fast execution (33s vs 162s)
- Mock HTTP server simulates all failure scenarios
- JSONL consistency verified across all failures

Amp-Thread-ID: https://ampcode.com/threads/T-a1a3b39a-9002-44c8-8048-3292d894f404
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:58:13 -08:00
Steve Yegge
a31715c446 Fix .gitignore to exclude git merge driver temp files
Adds patterns for *.json[0-9] and *.jsonl[0-9] to ignore temporary files
created by git merge driver during conflicts (e.g., beads.base.json1)

Amp-Thread-ID: https://ampcode.com/threads/T-afef93f2-e073-47d8-a82e-b8c68412496f
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:53:57 -08:00
Steve Yegge
7d5ea2e6c9 bd sync: 2025-11-08 01:52:48 2025-11-08 01:52:48 -08:00
Steve Yegge
ab4ec900f0 Fix bd import to auto-initialize database when missing
Agents were failing with 'bd import' after nuking the database.
Now bd import automatically:
- Creates .beads/ directory if missing
- Detects prefix from imported issues (analyzes JSONL)
- Falls back to directory name if no issues
- Initializes database before proceeding

This fixes the common agent workflow: rm .beads/beads.db && bd import

Amp-Thread-ID: https://ampcode.com/threads/T-3ace45ce-3cd6-46ae-a201-39c3d7f48f0b
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:52:35 -08:00
Steve Yegge
068615f28a Add comprehensive Agent Mail adapter tests (bd-5ki8)
- 29 tests covering enabled, disabled, graceful degradation
- Reservation conflict handling (JSON and plain text errors)
- HTTP error scenarios (404, 500, 503)
- Health check edge cases
- Malformed responses and empty bodies
- All tests run in 10ms (fast!)

Amp-Thread-ID: https://ampcode.com/threads/T-8bcf1119-53f1-4602-9161-d804444cc314
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:34:01 -08:00
Steve Yegge
e6d580e14b Change bd list to one line per issue, add --long flag
Make bd list print exactly one line per issue by default to fix agent
miscounting. Agents were getting confused by the multi-line format and
incorrectly counting open issues.

The new compact format shows:
  bd-zo7o [P0] [task] open @assignee [labels] - Title

The original detailed multi-line format is preserved behind --long flag.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 01:32:13 -08:00
Steve Yegge
497f12fca5 Remove old install.sh script, replaced by bd hooks install
Amp-Thread-ID: https://ampcode.com/threads/T-6d470bf0-ada4-4b71-95ca-21d926837764
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:29:36 -08:00
Steve Yegge
187fdd258a Add bd hooks install command with embedded git hooks (bd-908z)
- Embed git hooks in binary using go:embed and templates directory
- Add bd hooks install/uninstall/list subcommands
- Install hooks with automatic backup of existing hooks
- Update AGENTS.md to reference 'bd hooks install' instead of install.sh
- Add comprehensive tests for hooks commands
- Update hook version to 0.22.1

Closes bd-908z
2025-11-08 01:28:19 -08:00
Steve Yegge
a140436db8 test: improve internal/daemon test coverage to 60%
Adds fast unit tests for previously uncovered functions in the daemon package:

- checkDaemonErrorFile: tests reading daemon error files
- StopDaemon: tests error handling for non-running daemons
- KillAllDaemons: tests empty lists and non-alive daemons
- FindDaemonByWorkspace: tests not found case
- discoverDaemon: tests missing socket scenario
- CleanupStaleSockets: tests edge cases (already removed, alive daemon)
- Registry: tests corrupted file handling and unregistering non-existent entries

Coverage improved from 22.5% to 60.0% with only fast tests (<1s runtime).
All new tests work in -short mode and don't start actual daemons.

Fixes bd-3f80d9e0

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 01:20:03 -08:00
Steve Yegge
e95885f453 Fix bd-yuf7: Add config to bd info JSON output
- bd info now includes config in JSON output
- Temporarily switches to direct mode to read config table
- Fixes issue where bd config set worked but bd info showed null config

Amp-Thread-ID: https://ampcode.com/threads/T-d2e6a5e4-7f85-4e9f-94bb-d20ea46ea13b
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:18:06 -08:00
Steve Yegge
af11521561 Update beads.jsonl with closed issues (bd-eimz, bd-fkdw, bd-sc57) 2025-11-08 01:14:22 -08:00
Steve Yegge
c3856bb140 Add Agent Mail documentation and bash-agent integration
- Added Agent Mail section to QUICKSTART.md with benefits and setup
- Integrated Agent Mail into bash-agent example with reservation/notification
- Added multi-agent usage instructions to bash-agent README
- Closed bd-eimz (QUICKSTART), bd-fkdw (bash-agent), bd-sc57 (production)
- Completed bd-nl8z documentation epic

Amp-Thread-ID: https://ampcode.com/threads/T-5b0d67ff-5eb2-41b3-bc9b-7f33719e0c85
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:10:20 -08:00
Steve Yegge
687c23cf71 Update issues (bd-2cvu closed)
Amp-Thread-ID: https://ampcode.com/threads/T-f8161cc4-d6d2-4f23-8854-4834dbdedb26
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:03:55 -08:00
Steve Yegge
6970fff613 bd sync: 2025-11-08 01:03:44 2025-11-08 01:03:44 -08:00
Steve Yegge
826a3b2047 Refactor AGENTS.md: extract supplemental docs
- Create docs/DAEMON.md (daemon mgmt, event-driven mode)
- Create docs/GIT_INTEGRATION.md (worktrees, conflicts, merge drivers)
- Create docs/CLI_REFERENCE.md (comprehensive command examples)
- Reduce AGENTS.md from 1047 → 906 lines (13% reduction)
- Add Agent Mail optional workflow section (bd-2cvu)

Improves navigability while preserving all content.

Amp-Thread-ID: https://ampcode.com/threads/T-f8161cc4-d6d2-4f23-8854-4834dbdedb26
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:03:28 -08:00
Steve Yegge
ef1634d850 bd sync: 2025-11-08 01:02:24 2025-11-08 01:02:24 -08:00
Steve Yegge
29a3dfe9a4 bd sync: 2025-11-08 00:50:07 2025-11-08 00:50:07 -08:00
Steve Yegge
596b616269 chore: Sync JSONL after closing bd-xzrv 2025-11-08 00:49:57 -08:00
Steve Yegge
9cffd39246 docs: Add comprehensive Agent Mail integration guide
- Installation and quick start
- Architecture and coordination flow
- Configuration reference (environment variables)
- When to use vs skip Agent Mail
- Multi-machine deployment patterns
- Troubleshooting and FAQ
- Migration guide from git-only mode

Closes bd-xzrv

Amp-Thread-ID: https://ampcode.com/threads/T-e8cf1b4b-38ae-4f6b-ae17-8b960d31608e
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 00:49:41 -08:00
Steve Yegge
bd59973170 Sync beads database 2025-11-08 00:36:42 -08:00
Steve Yegge
c864527e0e Update JSONL after closing bd-zo7o
Amp-Thread-ID: https://ampcode.com/threads/T-2fb10899-490f-4d41-b003-8bc4d467cc54
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 00:36:33 -08:00
Steve Yegge
ef94641541 Add multi-agent race condition test (bd-zo7o)
- Created test_agent_race.py with 3 test scenarios
- Tests collision prevention with Agent Mail reservations
- Validates that only one agent claims an issue when reservations active
- Demonstrates collision problem when Agent Mail disabled
- Includes stress test with 10 agents
- Non-interactive mode support for CI/automation

Amp-Thread-ID: https://ampcode.com/threads/T-2fb10899-490f-4d41-b003-8bc4d467cc54
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 00:36:21 -08:00
Steve Yegge
7c6a7fc382 chore: sync beads database 2025-11-08 00:15:32 -08:00
Steve Yegge
9351044539 feat(agent-mail): Add Python adapter library for Agent Mail integration
- Created lib/beads_mail_adapter.py with AgentMailAdapter class
- Automatic health check on initialization
- Graceful degradation when server unavailable
- Methods: reserve_issue(), release_issue(), notify(), check_inbox()
- Environment-based configuration (AGENT_MAIL_URL, AGENT_MAIL_TOKEN)
- Comprehensive unit tests (15 tests, 100% passing)
- Full documentation in lib/README.md

Closes bd-m9th

Amp-Thread-ID: https://ampcode.com/threads/T-caa26228-0d18-4b35-b98a-9f95f6a099fe
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 00:15:07 -08:00
Steve Yegge
716424e52a Merge branch 'main' of github.com:steveyegge/beads 2025-11-08 00:11:04 -08:00
Steve Yegge
139c693020 bd sync: 2025-11-08 00:11:03 2025-11-08 00:11:03 -08:00
Travis Lyons
d8c04260b6 fix: remove unnecessary cd commands (#257) 2025-11-08 00:10:43 -08:00
Steve Yegge
f72a1d826d Fix bd-u4f5: Add warning when import syncs with working tree but not git HEAD
- Detect uncommitted changes in .beads/issues.jsonl
- Warn users when database matches working tree but differs from git HEAD
- Clarify import status messages (working tree vs git sync)
- Add comprehensive tests for dirty working tree scenarios
- Prevents false confidence about sync status

Amp-Thread-ID: https://ampcode.com/threads/T-5a0f1045-a690-42ef-8bfc-f8cf30ee4084
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 00:00:43 -08:00
Steve Yegge
0e6cb2d092 bd sync: 2025-11-08 00:00:04 2025-11-08 00:00:04 -08:00
Steve Yegge
44179d7326 Fix bd-8zf2: MCP server auto-detects workspace from CWD
- Add _find_beads_db_in_tree() to walk up looking for .beads/*.db
- Update _get_client() to auto-detect when workspace not set
- Matches CLI behavior (no manual set_context needed after restart)
- Add 8 comprehensive tests for auto-detection
- Update existing tests to mock auto-detection in error cases

Fixes silent failures after Amp restart.

Amp-Thread-ID: https://ampcode.com/threads/T-c47f524d-c101-40d5-839a-659f52b9be48
Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 23:59:57 -08:00
Steve Yegge
e6e458fc40 Close bd-27xm, update bd-6hji, file bd-8zf2 (MCP context bug)
- bd-27xm: No actual tool error, MCP Agent Mail works correctly
- bd-6hji: File reservations tested successfully, in progress
- bd-8zf2: Critical bug - MCP server loses context on Amp restart

Amp-Thread-ID: https://ampcode.com/threads/T-67bde23b-d637-40ab-add5-6c8f1296e8f8
Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 23:53:51 -08:00
Steve Yegge
4e97e0eb97 Clarify Agent Mail is external service, not embedded in beads
- bd-27xm: Mark as external debugging work
- Updated status doc to emphasize separation
- Agent Mail server at ~/src/mcp_agent_mail (separate repo)
- Beads integration will be lightweight HTTP client only
2025-11-07 23:21:50 -08:00
Steve Yegge
a47b69e4f3 Close test issues 2025-11-07 23:19:32 -08:00
Steve Yegge
a02467e4bd bd-muls: Add Agent Mail integration tracking 2025-11-07 23:18:19 -08:00
Steve Yegge
6355ee1448 feat: implement agent-driven compaction (bd-buol)
- Add --analyze mode to export candidates without API key
- Add --apply mode to accept agent-provided summaries
- Move --auto mode for legacy AI-powered compaction
- Update documentation for new workflow
- Addresses GH #243 complaint about API key requirement
2025-11-07 23:11:05 -08:00