Commit Graph

1004 Commits

Author SHA1 Message Date
Steve Yegge
aa567f6b9a feat: add Mermaid.js format for dependency tree visualization (#191)
Adds `bd dep tree --format mermaid` to export dependency trees as Mermaid.js flowcharts.

Features:
- Status indicators: ☐ open, ◧ in_progress, ⚠ blocked, ☑ closed
- Theme-agnostic design
- Works with --reverse flag
- Comprehensive unit tests following TDD

Co-authored-by: David Laing <david@davidlaing.com>
2025-10-31 15:11:29 -07:00
Steve Yegge
c070a9e7d4 bd sync: 2025-10-31 14:36:24 2025-10-31 14:36:24 -07:00
Steve Yegge
118d7541dd Add --json flag support to more bd commands
- stats: Added --json flag for programmatic output
- show, update: Added --json flag for issue details
- close, reopen: Added --json flag for bulk operations
- dep (add, remove, tree, cycles): Added --json flags
- label (add, remove, list, list-all): Added --json flags
- duplicates, merge: Added --json flags

Closes bd-4dcd2d09
2025-10-31 14:36:20 -07:00
Steve Yegge
b2b0373d08 bd sync: 2025-10-31 14:36:12 2025-10-31 14:36:12 -07:00
Steve Yegge
d5488cb97f Remove collision-era language from docs and code
- Updated FAQ.md, ADVANCED.md, TROUBLESHOOTING.md to explain hash IDs eliminate collisions
- Removed --resolve-collisions references from all documentation and examples
- Renamed handleCollisions() to detectUpdates() to reflect update semantics
- Updated test names: TestAutoImportWithCollision → TestAutoImportWithUpdate
- Clarified: with hash IDs, same-ID = update operation, not collision

Closes: bd-50a7, bd-b84f, bd-bda8, bd-650c, bd-3ef2, bd-c083, bd-85a6
2025-10-31 14:24:50 -07:00
Steve Yegge
b9b1b162d1 bd sync: 2025-10-31 14:24:43 2025-10-31 14:24:43 -07:00
Steve Yegge
6dc768797e Update issues: close bd-a5e2bd80 epic and children 2025-10-31 13:51:22 -07:00
Steve Yegge
427c88ea04 Remove outdated --resolve-collisions documentation (flag removed in v0.20.1) 2025-10-31 13:40:57 -07:00
Steve Yegge
223b2ced46 Merge branch 'main' of github.com:steveyegge/beads 2025-10-31 13:39:39 -07:00
Steve Yegge
eb18d342f4 Fix: Treat same-ID updates as normal updates, not collisions (bd-0134cc5a) 2025-10-31 13:39:38 -07:00
Steve Yegge
932b293118 Document hash-based IDs and hierarchical children (bd-a5e2bd80.15)
Amp-Thread-ID: https://ampcode.com/threads/T-afcbc67c-4b83-47d4-8361-7c1ad08906a0
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 12:51:10 -07:00
Steve Yegge
25e6fba866 bd sync: 2025-10-31 12:50:41 2025-10-31 12:50:41 -07:00
Steve Yegge
415f2e8206 bd sync: 2025-10-31 12:32:54 2025-10-31 12:32:54 -07:00
Steve Yegge
97f4bf0e2f Resolve merge conflict - accept remote 2025-10-31 12:32:49 -07:00
Steve Yegge
2e72823277 bd sync: 2025-10-31 12:32:32 2025-10-31 12:32:32 -07:00
Steve Yegge
0c908f1fd5 bd sync: 2025-10-31 12:22:35 2025-10-31 12:22:35 -07:00
Steve Yegge
75b8e23c14 bd sync: apply rename detection from import 2025-10-31 12:00:44 -07:00
Steve Yegge
f0858bbf38 bd sync: 2025-10-31 12:00:43 2025-10-31 12:00:43 -07:00
Steve Yegge
5842a77e11 Merge branch 'main' of github.com:steveyegge/beads 2025-10-31 12:00:12 -07:00
Steve Yegge
1e99b251a6 bd sync: 2025-10-31 12:00:10 2025-10-31 12:00:10 -07:00
Ryan
08bfe133d0 Add 'bd doctor' command to sanity check installation (#189)
* Add bd doctor command for installation health checks

Implements a comprehensive health check command similar to claude doctor
that validates beads installation and provides actionable recommendations.

Features:
- Installation check (.beads/ directory exists)
- Database version verification (compares with CLI version)
- ID format detection (hash-based vs sequential)
- CLI version check (fetches latest from GitHub)
- Storage type detection (SQLite vs JSONL-only mode)
- Tree-style output with color-coded warnings
- JSON output for scripting (--json flag)
- Actionable fix recommendations for each issue

Implementation improvements:
- Status constants instead of magic strings
- Semantic version comparison (fixes 0.10.0 vs 0.9.9 edge case)
- Documented defer pattern for intentional error ignore
- Comprehensive test coverage including version comparison edge cases
- Clean integration using slices.Contains for command list

Usage:
  bd doctor              # Check current directory
  bd doctor /path/to/repo # Check specific repository
  bd doctor --json       # Machine-readable output

* Simplify bd doctor documentation in README

Reduce verbose health check section to 2 lines as requested.

* Fix bd doctor to handle JSONL-only mode for ID format check

When no SQLite database exists (JSONL-only mode), skip the ID format
check instead of showing an error. This prevents the confusing
'Unable to query issues' error when the installation is actually fine.
2025-10-31 11:41:13 -07:00
Steve Yegge
053edadf14 bd sync: apply rename detection from import 2025-10-31 10:43:25 -07:00
Steve Yegge
042e4a1799 bd sync: 2025-10-31 10:43:24 2025-10-31 10:43:24 -07:00
Steve Yegge
ed5efe7f4b Update beads-mcp version to 0.16.0
Amp-Thread-ID: https://ampcode.com/threads/T-d4392285-dfd0-44d9-86e2-788fbb7aa7d1
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 02:04:13 -07:00
Steve Yegge
7dcde1330e Remove obsolete --db flag from MCP server
The --db flag was removed in bd v0.20.1 in favor of automatic database
discovery via cwd. The MCP server now relies on passing the workspace
directory via cwd parameter instead of the --db flag.

This fixes compatibility with bd v0.20.1+.
2025-10-31 02:02:38 -07:00
Steve Yegge
0b0b1d0bc6 Remove obsolete sequential ID and collision resolution docs
- Remove docs/collision-resolution-failure-analysis.md (sequential ID collision issues no longer exist)
- Remove commands/renumber.md (renumber command removed, hash IDs don't need renumbering)

These docs are obsolete since v0.20.1 uses hash IDs by default.

Amp-Thread-ID: https://ampcode.com/threads/T-0b000145-350a-4dfe-a3f1-67d4d52a6717
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 01:59:47 -07:00
Steve Yegge
95b424035c bd sync: 2025-10-31 01:58:36 2025-10-31 01:58:36 -07:00
Steve Yegge
a5be0d13bf Version bump to 0.20.1: Hash-based IDs
- Bump version across all components (CLI, plugin, MCP server)
- Update CHANGELOG.md with comprehensive hash ID migration notes
- Replace critical multi-clone warning with hash ID announcement
- Add Hash-Based Issue IDs section to README with:
  - ID format explanation (4/5/6 char progressive scaling)
  - Why hash IDs solve collision issues
  - Birthday paradox collision probability math
  - Migration instructions
- Update all examples to use hash IDs (bd-a1b2) instead of sequential (bd-1)

Breaking changes:
- Sequential ID generation removed (bd-c7af, bd-8e05, bd-4c74)
- issue_counters table removed from schema
- --resolve-collisions flag removed (no longer needed)

Migration: Run 'bd migrate' to upgrade database schema
Amp-Thread-ID: https://ampcode.com/threads/T-0b000145-350a-4dfe-a3f1-67d4d52a6717
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 01:47:54 -07:00
Steve Yegge
51fd63b107 Remove obsolete N-way collision tests, add focused hash ID tests
- Remove beads_nway_test.go (92s of obsolete sequential ID collision tests)
- Remove beads_twoclone_test.go (already skipped tests)
- Add beads_hash_multiclone_test.go (6s, tests hash ID multi-clone sync)
- Fix init.go git hook to remove --resolve-collisions flag

Result: 87% faster test suite (96s → 12s for full suite)

Hash-based IDs prevent collisions by design, making extensive N-way
collision resolution tests unnecessary. New tests verify that:
- Multiple clones can sync without ID collisions
- Identical content deduplicates correctly

Amp-Thread-ID: https://ampcode.com/threads/T-b256a7ad-c279-4c87-8b6b-6c34c6f05e7f
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 01:38:29 -07:00
Steve Yegge
9225114c0b Fix tests after --resolve-collisions removal
Remove obsolete test file and update remaining tests to not use the
removed --resolve-collisions flag. Hash-based IDs make collision
resolution unnecessary.

Changes:
- Delete internal/rpc/server_autoimport_test.go (obsolete)
- Remove --resolve-collisions from beads_nway_test.go
- Remove --resolve-collisions from beads_twoclone_test.go
- Remove --resolve-collisions from cmd/bd/sync.go

All tests now pass.
2025-10-31 01:25:05 -07:00
Steve Yegge
0725c33fcc Remove vestigial --resolve-collisions flag
Hash-based IDs make collision resolution unnecessary. The flag was
already non-functional (handleCollisions returns error on collision
regardless of flag value).

Removed:
- --resolve-collisions flag from bd import
- ResolveCollisions field from ImportOptions and importer.Options
- All references in daemon, auto-import, and tests
- Updated error messages to reflect hash IDs don't collide

All import tests pass.

Amp-Thread-ID: https://ampcode.com/threads/T-47dfa0cc-bb71-4467-ac86-f0966a7c5d58
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 01:07:42 -07:00
Steve Yegge
b0f6630d0d bd sync: 2025-10-31 00:48:50 2025-10-31 00:48:50 -07:00
Steve Yegge
64fe51d6bb Remove obsolete collision remapping code and tests
- Deleted collision remapping tests (obsolete with hash IDs bd-8e05)
- Simplified collision.go from 704 to 138 lines
- Removed RemapCollisions, ScoreCollisions, and reference update code
- Removed issue_counters table dependencies (bd-807b)
- Added COLLISION_MATH.md documentation
- Fixed RenameCounterPrefix and ResetCounter to be no-ops
- Closed bd-a58f, bd-3d65, bd-807b

Hash-based IDs make collision remapping unnecessary since collisions
are extremely rare (same ID = same content).

Amp-Thread-ID: https://ampcode.com/threads/T-cbb0f111-6a95-4598-b03e-c137112f9875
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 00:19:42 -07:00
Steve Yegge
4e9f6e131c bd sync: 2025-10-31 00:19:27 2025-10-31 00:19:27 -07:00
Steve Yegge
613f0dfff4 removed obsolete/wrong database file 2025-10-30 22:47:49 -07:00
Steve Yegge
892c22145f bd sync: 2025-10-30 22:30:33 2025-10-30 22:30:33 -07:00
Steve Yegge
5d137ffeeb Remove sequential ID generation and SyncAllCounters (bd-c7af, bd-8e05, bd-4c74)
- Removed SyncAllCounters() and all call sites (already no-op with hash IDs)
- Removed AllocateNextID() and getNextIDForPrefix() - sequential ID generation
- Removed collision remapping logic in internal/storage/sqlite/collision.go
- Removed rename collision handling in internal/importer/importer.go
- Removed branch-merge example (collision resolution no longer needed)
- Updated EXTENDING.md to remove counter sync examples

These were all deprecated code paths for sequential IDs that are obsolete
with hash-based IDs. Hash ID collisions are handled by extending the hash,
not by remapping to new sequential IDs.
2025-10-30 22:24:42 -07:00
Steve Yegge
4a21005a31 bd sync: 2025-10-30 22:24:33 2025-10-30 22:24:33 -07:00
Steve Yegge
e441a5c04c bd sync: 2025-10-30 22:17:47 2025-10-30 22:17:47 -07:00
Steve Yegge
016fc155f3 bd sync: 2025-10-30 21:58:53 2025-10-30 21:58:53 -07:00
Steve Yegge
e3afecca37 Remove sequential ID code path (bd-aa744b)
- Removed nextSequentialID() and getIDMode() functions
- Removed issue_counters table from schema
- Made SyncAllCounters() a no-op for backward compatibility
- Simplified ID generation to hash-only (adaptive length)
- Removed id_mode config setting
- Removed sequential ID tests and migration code
- Updated CONFIG.md and AGENTS.md to remove sequential ID references

Follow-up bd-2a70 will remove obsolete test files and renumber command.
2025-10-30 21:51:39 -07:00
Steve Yegge
0f7ed1bdb4 bd sync: 2025-10-30 21:51:32 2025-10-30 21:51:32 -07:00
Steve Yegge
76d3403d0a Implement adaptive ID length scaling (bd-ea2a13)
- Start with 4-char IDs for small databases (0-500 issues)
- Scale to 5-char at 500-1500 issues, 6-char at 1500+
- Configurable via max_collision_prob, min/max_hash_length
- Birthday paradox math ensures collision probability stays under threshold
- Comprehensive tests and documentation
- Collision calculator tool for analysis

Also filed bd-aa744b to remove sequential ID code path.
2025-10-30 21:40:52 -07:00
Steve Yegge
fb48d681a1 bd sync: 2025-10-30 21:40:44 2025-10-30 21:40:44 -07:00
Steve Yegge
7c36a68476 chore: Bump version to 0.20.0
Amp-Thread-ID: https://ampcode.com/threads/T-5d7f722e-ec33-499a-bd3d-e684c554d7fe
Co-authored-by: Amp <amp@ampcode.com>
2025-10-30 20:40:13 -07:00
Steve Yegge
3b89178ebc Add 0.20.0 release notes and fix golangci-lint config 2025-10-30 20:39:24 -07:00
Steve Yegge
bea70e1feb Fix golangci-lint config for v3 format (remove version field, rename exclude to exclude-patterns) 2025-10-30 20:26:42 -07:00
Steve Yegge
b0de8d54c2 bd sync: 2025-10-30 20:24:57 2025-10-30 20:24:57 -07:00
Steve Yegge
c41348228b Deprecate sequence-ID collision tests, keep TestFiveCloneCollision for hash-ID multi-clone testing 2025-10-30 20:24:44 -07:00
Steve Yegge
ea44725679 Fix TestTwoCloneCollision: configure git to use merge instead of rebase 2025-10-30 20:02:46 -07:00