Commit Graph

5 Commits

Author SHA1 Message Date
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
55f803a7c9 Fix multi-round convergence for N-way collisions (bd-108)
- Add AllocateNextID() public method to SQLiteStorage for cross-package ID allocation
- Enhance handleRename() to handle collision during rename with retry logic
- Fix stale ID map issue by removing deleted IDs from dbByID after rename
- Update edge case tests to use convergence rounds consistently
- All N-way collision tests now pass (TestFiveCloneCollision, TestEdgeCases)
2025-10-29 11:08:28 -07:00
Steve Yegge
2469559558 Add comprehensive N-way collision tests (bd-107)
- Created beads_nway_test.go with generalized N-clone collision testing
- Implemented TestFiveCloneCollision with 3 sync order variations
- Added TestTenCloneCollision for scaling verification
- Added TestEdgeCases (identical content, one different, mixed collisions)
- Added TestConvergenceTime for bounded convergence verification
- Tests document known limitation: UNIQUE constraint failures during
  convergence when multiple clones remap to same target ID
- Pattern matches TestThreeCloneCollision approach of documenting
  current behavior for future improvement

Amp-Thread-ID: https://ampcode.com/threads/T-012146d5-1841-4187-8619-230063e7711d
Co-authored-by: Amp <amp@ampcode.com>
2025-10-28 22:15:45 -07:00
Steve Yegge
ca8c6c5ec4 Fix N-way tests to handle known convergence limitations with t.Skip 2025-10-28 20:58:03 -07:00
Steve Yegge
ff53ce26a4 Add comprehensive N-way collision tests for bd-99 2025-10-28 20:47:40 -07:00