Commit Graph

1082 Commits

Author SHA1 Message Date
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
Steve Yegge
ca81df93f0 bd sync: 2025-10-30 20:02:40 2025-10-30 20:02:40 -07:00
Steve Yegge
71fc67f4e3 bd sync: 2025-10-30 19:57:06 2025-10-30 19:57:06 -07:00
Steve Yegge
b8c5ca8330 bd sync: 2025-10-30 19:56:03 2025-10-30 19:56:03 -07:00
Steve Yegge
9ab3ffe6f9 bd sync: 2025-10-30 19:53:13 2025-10-30 19:53:13 -07:00
Steve Yegge
e781973736 Update N-way collision tests to use hash-based IDs
- Enable id_mode=hash in all test clones
- Remove expectation of ID collisions (hash IDs prevent this)
- Tests now properly demonstrate that hash IDs eliminate ID conflicts
- Git JSONL merge conflicts still occur but are simpler to resolve
- Related: bd-165 (hash-based ID implementation)

Amp-Thread-ID: https://ampcode.com/threads/T-fe7c6698-371e-467a-a340-ed73f31bff6a
Co-authored-by: Amp <amp@ampcode.com>
2025-10-30 19:48:22 -07:00
Steve Yegge
6dbf45c955 Merge PR #182: warn if multiple bd are in PATH
warn if multiple bd are in PATH
2025-10-30 19:39:50 -07:00
Steve Yegge
11c26d5af8 Add substring ID matching for all bd commands
- Enhanced ResolvePartialID to handle:
  - Bare hashes: 07b8c8 → bd-07b8c8
  - Prefix without hyphen: bd07b8c8 → bd-07b8c8
  - Full IDs: bd-07b8c8 (unchanged)
  - Substring matching: 07b → finds bd-07b8c8

- Added RPC support:
  - New OpResolveID operation
  - handleResolveID server handler
  - ResolveID client method

- Updated all commands to resolve IDs:
  - show, update, close, reopen
  - dep (add, remove, tree)
  - label (add, remove, list)

- Works in both daemon and direct modes

Fixes bd-0591c3
2025-10-30 19:20:50 -07:00
Steve Yegge
185c734d75 bd sync: 2025-10-30 19:14:20 2025-10-30 19:14:20 -07:00
Steve Yegge
dacf8de993 Implement daemon registry system (bd-07b8c8)
- Created global daemon registry at ~/.beads/registry.json
- Daemons auto-register on start, unregister on graceful shutdown
- DiscoverDaemons() now uses registry instead of filesystem scan
- Instant daemon discovery (35ms vs indefinite hang)
- Auto-cleanup of stale registry entries
- Full test coverage

Closes bd-07b8c8, bd-acb971c7
2025-10-30 18:37:12 -07:00
Steve Yegge
13fcccb14d bd sync: 2025-10-30 18:37:06 2025-10-30 18:37:06 -07:00
Steve Yegge
cd7bdb301d Generate 6-char hash IDs with progressive 7/8-char fallback on collision (bd-7c87cf24)
- Changed generateHashID to start with 6 chars (3 bytes), expand to 7/8 on collision
- Updated both CreateIssue and CreateIssues (batch) to use progressive length fallback
- Updated tests to accept 9-11 char IDs (bd- + 6-8 hex chars)
- All new issues now generate with shorter, more readable IDs
- Existing 8-char IDs preserved (no migration needed)

Amp-Thread-ID: https://ampcode.com/threads/T-8a6058af-9f42-4bff-be02-8c8bce41eeb5
Co-authored-by: Amp <amp@ampcode.com>
2025-10-30 18:16:24 -07:00
Steve Yegge
ba4ad179e0 bd sync: 2025-10-30 17:52:49 2025-10-30 17:52:49 -07:00
Steve Yegge
91cc129b47 bd sync: 2025-10-30 17:47:18 2025-10-30 17:47:18 -07:00
Steve Yegge
7aba8ad79c chore: Bump version to 0.19.1 2025-10-30 17:16:59 -07:00
Steve Yegge
78133d974b bd sync: hash ID migration 2025-10-30 17:16:43 -07:00
Steve Yegge
c48313162b bd sync: 2025-10-30 17:16:37 2025-10-30 17:16:37 -07:00
Steve Yegge
a5f5fcbee5 bd sync: 2025-10-30 17:00:15 2025-10-30 17:00:15 -07:00
Steve Yegge
01e243e3a6 Merge feature/hash-ids into main
Amp-Thread-ID: https://ampcode.com/threads/T-ffbe22bb-92f1-4763-aa5d-1bb84697c866
Co-authored-by: Amp <amp@ampcode.com>
2025-10-30 17:00:11 -07:00
Steve Yegge
1fbfe58ba7 Make hash IDs opt-in via id_mode config (bd-5404)
- Add id_mode config (sequential|hash), defaults to sequential
- Update CreateIssue/CreateIssues to check id_mode and generate appropriate IDs
- Implement lazy counter initialization from existing issues
- Update migrate --to-hash-ids to set id_mode=hash after migration
- Fix hash ID tests to set id_mode=hash
- Fix renumber test to use explicit IDs
- All 183 test packages pass

This makes hash IDs backward-compatible opt-in rather than forced default.
2025-10-30 16:50:38 -07:00
Steve Yegge
0858bdb7ed Implement hash ID migration tool (bd-173)
- Add migrate-hash-ids command for converting sequential to hash-based IDs
- Integrate into bd migrate --to-hash-ids for transparent user experience
- Generate hash IDs for top-level issues, hierarchical IDs for children
- Update all references: dependencies, comments, text mentions
- Auto-backup database before migration
- Comprehensive tests covering migration scenarios
- Update AGENTS.md with migration documentation

Amp-Thread-ID: https://ampcode.com/threads/T-492f81db-5b0e-437a-b54d-ae4525dd7827
Co-authored-by: Amp <amp@ampcode.com>
2025-10-30 16:28:13 -07:00
Steve Yegge
d348d90cbe bd sync: 2025-10-30 16:23:24 2025-10-30 16:23:24 -07:00
Steve Yegge
ccb4047e03 bd sync: 2025-10-30 15:42:07 2025-10-30 15:42:07 -07:00