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>
This commit is contained in:
Steve Yegge
2025-10-31 00:19:42 -07:00
parent 4e9f6e131c
commit 64fe51d6bb
19 changed files with 307 additions and 3888 deletions

View File

@@ -1,7 +1,15 @@
# Test bd blocked command
bd init --prefix test
# Create first issue
bd create 'First issue'
bd create 'Second issue' --deps test-1
cp stdout first.txt
exec sh -c 'grep -oE "test-[a-f0-9]+" first.txt > first_id.txt'
# Create second issue that depends on first
exec sh -c 'bd create "Second issue" --deps $(cat first_id.txt)'
cp stdout second.txt
# Check for blocked issues
bd blocked
stdout 'Blocked issues'
stdout 'test-2'
stdout 'test-'

View File

@@ -1,8 +1,15 @@
# Test bd close command
bd init --prefix test
bd create 'Issue to close'
bd close test-1 --reason 'Fixed'
stdout 'Closed test-1'
bd show test-1
# Create issue and capture its hash ID
bd create 'Issue to close'
cp stdout issue.txt
exec sh -c 'grep -oE "test-[a-f0-9]+" issue.txt > issue_id.txt'
# Close the issue
exec sh -c 'bd close $(cat issue_id.txt) --reason Fixed'
stdout 'Closed test-'
# Verify it's closed
exec sh -c 'bd show $(cat issue_id.txt)'
stdout 'closed'

View File

@@ -1,10 +1,24 @@
# Test bd dep add command
bd init --prefix test
# Create issues and capture their hash IDs from output
bd create 'First issue'
bd create 'Second issue'
bd dep add test-2 test-1
cp stdout first.txt
grep 'Created issue: test-' first.txt
bd create 'Second issue'
cp stdout second.txt
grep 'Created issue: test-' second.txt
# Extract IDs using grep (hash IDs are test-XXXXXXXX format)
exec sh -c 'grep -oE "test-[a-f0-9]+" first.txt > first_id.txt'
exec sh -c 'grep -oE "test-[a-f0-9]+" second.txt > second_id.txt'
# Add dependency: second depends on first
exec sh -c 'bd dep add $(cat second_id.txt) $(cat first_id.txt)'
stdout 'Added dependency'
bd show test-2
# Verify the dependency was added
exec sh -c 'bd show $(cat second_id.txt)'
stdout 'Depends on'
stdout 'test-1'
stdout 'test-'

View File

@@ -1,10 +1,22 @@
# Test bd dep remove command
bd init --prefix test
# Create issues and capture their hash IDs
bd create 'First issue'
cp stdout first.txt
exec sh -c 'grep -oE "test-[a-f0-9]+" first.txt > first_id.txt'
bd create 'Second issue'
bd dep add test-2 test-1
bd dep remove test-2 test-1
cp stdout second.txt
exec sh -c 'grep -oE "test-[a-f0-9]+" second.txt > second_id.txt'
# Add dependency
exec sh -c 'bd dep add $(cat second_id.txt) $(cat first_id.txt)'
stdout 'Added dependency'
# Remove dependency
exec sh -c 'bd dep remove $(cat second_id.txt) $(cat first_id.txt)'
stdout 'Removed dependency'
bd show test-2
! stdout 'test-1'
# Verify dependency is gone
exec sh -c 'bd show $(cat second_id.txt) | grep -v "Depends on"'

View File

@@ -1,7 +1,18 @@
# Test bd dep tree command
bd init --prefix test
# Create issues and capture their hash IDs
bd create 'Root issue'
cp stdout root.txt
exec sh -c 'grep -oE "test-[a-f0-9]+" root.txt > root_id.txt'
bd create 'Child issue'
bd dep add test-2 test-1
bd dep tree test-1
stdout 'test-1'
cp stdout child.txt
exec sh -c 'grep -oE "test-[a-f0-9]+" child.txt > child_id.txt'
# Add dependency: child depends on root
exec sh -c 'bd dep add $(cat child_id.txt) $(cat root_id.txt)'
# Show dependency tree for root
exec sh -c 'bd dep tree $(cat root_id.txt)'
stdout 'test-'

View File

@@ -1,8 +1,16 @@
# Test bd show command
bd init --prefix test
bd create 'Test issue for show'
bd show test-1
# Create issue and capture its hash ID
bd create 'Test issue for show'
cp stdout issue.txt
grep 'Created issue: test-' issue.txt
# Extract ID using grep
exec sh -c 'grep -oE "test-[a-f0-9]+" issue.txt > issue_id.txt'
# Show the issue
exec sh -c 'bd show $(cat issue_id.txt)'
stdout 'Test issue for show'
stdout 'Status:'
stdout 'Priority:'

View File

@@ -1,8 +1,17 @@
# Test bd stats command
bd init --prefix test
# Create issues
bd create 'First issue'
cp stdout first.txt
exec sh -c 'grep -oE "test-[a-f0-9]+" first.txt > first_id.txt'
bd create 'Second issue'
bd close test-1
# Close one issue
exec sh -c 'bd close $(cat first_id.txt)'
# Check stats
bd stats
stdout 'Total Issues:'
stdout 'Open:'

View File

@@ -1,8 +1,18 @@
# Test bd update command
bd init --prefix test
# Create issue and capture its hash ID
bd create 'Issue to update'
bd update test-1 --status in_progress
cp stdout issue.txt
grep 'Created issue: test-' issue.txt
# Extract ID using grep
exec sh -c 'grep -oE "test-[a-f0-9]+" issue.txt > issue_id.txt'
# Update the issue status
exec sh -c 'bd update $(cat issue_id.txt) --status in_progress'
stdout 'Updated issue:'
bd show test-1
# Verify the update
exec sh -c 'bd show $(cat issue_id.txt)'
stdout 'in_progress'