Commit Graph

1809 Commits

Author SHA1 Message Date
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
Steve Yegge
2618f9fed2 Prepare v0.23.0 release: update CHANGELOG and remove artifacts 2025-11-08 03:53:08 -08:00
Steve Yegge
87e4ae5f24 Add warning message to zombie issues.jsonl file
The renamed file needs a clear warning to prevent accidental use.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 03:17:58 -08:00
Steve Yegge
9ee45e1971 Auto-invoke 3-way merge for JSONL conflicts (bd-jjua)
When git pull encounters merge conflicts in .beads/beads.jsonl, the
post-merge hook runs 'bd sync --import-only' which previously failed
with an error message pointing users to manual resolution.

This commit adds automatic 3-way merge resolution as a fallback safety
net that works alongside the git merge driver.

Changes:
- Modified conflict detection in import.go to attempt automatic merge
- Added attemptAutoMerge() function that:
  - Extracts git conflict stages (:1 base, :2 ours, :3 theirs)
  - Invokes 'bd merge' command for intelligent field-level merging
  - Writes merged result back and auto-stages the file
  - Restarts import with merged JSONL on success
- Falls back to manual resolution instructions only if auto-merge fails

Defense-in-depth approach:
1. Primary: git merge driver prevents most conflicts during merge
2. Fallback: import auto-merge handles any that slip through

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 03:17:58 -08:00
Steve Yegge
54b459a2a2 bd sync: 2025-11-08 03:12:12 2025-11-08 03:12:12 -08:00
Steve Yegge
6aa7cf4a1e Add 'new' as alias for 'create' command
Amp-Thread-ID: https://ampcode.com/threads/T-fd346dc3-c2b3-4ffd-8c08-432b6563d378
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 03:12:11 -08:00
Steve Yegge
bfc0320a1f Merge remote changes
Amp-Thread-ID: https://ampcode.com/threads/T-fd346dc3-c2b3-4ffd-8c08-432b6563d378
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 03:12:07 -08:00
Steve Yegge
709fd1d3f7 bd sync: 2025-11-08 03:11:53 2025-11-08 03:11:53 -08:00
Steve Yegge
93e5a156c8 Update bd JSONL
Amp-Thread-ID: https://ampcode.com/threads/T-635e5cf4-fa2f-4ce3-9f05-43b48010baae
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 03:10:31 -08:00
Steve Yegge
ba2aef429c Fix bd-8kde: disable auto-import during delete operations
- Skip auto-import in PersistentPreRun for delete command
- Prevents resurrection of deleted issues from stale git JSONL
- Add TestBulkDeleteNoResurrection to prevent regression
- Verified with full test suite

Amp-Thread-ID: https://ampcode.com/threads/T-635e5cf4-fa2f-4ce3-9f05-43b48010baae
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 03:10:12 -08:00
Steve Yegge
288d62a32c bd sync: 2025-11-08 02:51:36 2025-11-08 02:51:36 -08:00
Steve Yegge
bc056cebcd Add comprehensive Agent Mail coordination tests (bd-pdjb)
- Created test_multi_agent_coordination.py with 4 fast tests (<11s total)
- Tests cover fairness (10 agents, 5 issues), notifications, handoff, idempotency
- Documented complete test coverage in AGENT_MAIL_TEST_COVERAGE.md
- 66 total tests across 5 files validating multi-agent reliability
- Closed bd-pdjb (Testing & Validation epic)
2025-11-08 02:48:05 -08:00
Steve Yegge
08ae95be95 Update bd JSONL 2025-11-08 02:46:08 -08:00
Steve Yegge
abb1d1c714 Fix post-merge hook to show actual error messages
Previously the hook redirected stderr to /dev/null, hiding useful error
messages like 'Git conflict markers detected'. Users only saw a generic
warning with no indication of the root cause.

Now captures and displays the actual error output, making it immediately
clear what went wrong (e.g., merge conflicts in JSONL).

Fixes bd-nszi

Amp-Thread-ID: https://ampcode.com/threads/T-6231e968-2c06-44ad-855d-bb5fafe452f6
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:46:04 -08:00
Steve Yegge
27fd6e4287 Update beads JSONL after closing bd-d6aq 2025-11-08 02:43:01 -08:00
Steve Yegge
6dc8ea1746 Merge branch 'main' of github.com:steveyegge/beads 2025-11-08 02:42:56 -08:00
Steve Yegge
e6dfcc606a Add Python cache files to .gitignore
- Added __pycache__/ directories
- Added *.py[cod] and *.class files
- Removed tests/integration/__pycache__/ specific entry (now covered by general rule)
2025-11-08 02:42:53 -08:00
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