feat: add refs field for cross-references with relationship types (bd-irah)

- Add new DependencyType constants: until, caused-by, validates
- Add --refs flag to bd show for reverse reference lookups
- Group refs by type with appropriate emojis
- Update tests for new dependency types

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-30 15:51:54 -08:00
parent 4f5084a456
commit 407e75b363
4 changed files with 232 additions and 2 deletions

View File

@@ -523,6 +523,11 @@ const (
// Convoy tracking (non-blocking cross-project references)
DepTracks DependencyType = "tracks" // Convoy → issue tracking (non-blocking)
// Reference types (cross-referencing without blocking)
DepUntil DependencyType = "until" // Active until target closes (e.g., muted until issue resolved)
DepCausedBy DependencyType = "caused-by" // Triggered by target (audit trail)
DepValidates DependencyType = "validates" // Approval/validation relationship
)
// IsValid checks if the dependency type value is valid.
@@ -538,7 +543,8 @@ func (d DependencyType) IsWellKnown() bool {
switch d {
case DepBlocks, DepParentChild, DepConditionalBlocks, DepWaitsFor, DepRelated, DepDiscoveredFrom,
DepRepliesTo, DepRelatesTo, DepDuplicates, DepSupersedes,
DepAuthoredBy, DepAssignedTo, DepApprovedBy, DepTracks:
DepAuthoredBy, DepAssignedTo, DepApprovedBy, DepTracks,
DepUntil, DepCausedBy, DepValidates:
return true
}
return false

View File

@@ -522,6 +522,10 @@ func TestDependencyTypeIsWellKnown(t *testing.T) {
{DepAuthoredBy, true},
{DepAssignedTo, true},
{DepApprovedBy, true},
{DepTracks, true},
{DepUntil, true},
{DepCausedBy, true},
{DepValidates, true},
{DependencyType("custom-type"), false},
{DependencyType("unknown"), false},
}
@@ -553,6 +557,10 @@ func TestDependencyTypeAffectsReadyWork(t *testing.T) {
{DepAuthoredBy, false},
{DepAssignedTo, false},
{DepApprovedBy, false},
{DepTracks, false},
{DepUntil, false},
{DepCausedBy, false},
{DepValidates, false},
{DependencyType("custom-type"), false},
}