From 50a079d3b79a2416d1ca581607524267e39934b1 Mon Sep 17 00:00:00 2001 From: beads/refinery Date: Sat, 10 Jan 2026 22:00:32 -0800 Subject: [PATCH] fix: repair test build failures in types and sqlite packages - Add TypeRig constant to IssueType enum - Add IsBuiltIn() method to IssueType for multi-repo hydration trust logic - Fix parseCommaSeparated -> parseCommaSeparatedList function name in test Co-Authored-By: Claude Opus 4.5 --- internal/storage/sqlite/validators_test.go | 6 +++--- internal/types/types.go | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/internal/storage/sqlite/validators_test.go b/internal/storage/sqlite/validators_test.go index 7d092f8f..6b371e13 100644 --- a/internal/storage/sqlite/validators_test.go +++ b/internal/storage/sqlite/validators_test.go @@ -205,14 +205,14 @@ func TestParseCustomStatuses(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got := parseCommaSeparated(tt.value) + got := parseCommaSeparatedList(tt.value) if len(got) != len(tt.want) { - t.Errorf("parseCommaSeparated() = %v, want %v", got, tt.want) + t.Errorf("parseCommaSeparatedList() = %v, want %v", got, tt.want) return } for i := range got { if got[i] != tt.want[i] { - t.Errorf("parseCommaSeparated()[%d] = %v, want %v", i, got[i], tt.want[i]) + t.Errorf("parseCommaSeparatedList()[%d] = %v, want %v", i, got[i], tt.want[i]) } } }) diff --git a/internal/types/types.go b/internal/types/types.go index 856eb2dd..61a48d54 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -474,6 +474,7 @@ const ( TypeGate IssueType = "gate" // Async coordination gate TypeAgent IssueType = "agent" // Agent identity bead TypeRole IssueType = "role" // Agent role definition + TypeRig IssueType = "rig" // Rig identity bead TypeConvoy IssueType = "convoy" // Cross-project tracking with reactive completion TypeEvent IssueType = "event" // Operational state change record TypeSlot IssueType = "slot" // Exclusive access slot (merge-slot gate) @@ -482,12 +483,20 @@ const ( // IsValid checks if the issue type value is valid func (t IssueType) IsValid() bool { switch t { - case TypeBug, TypeFeature, TypeTask, TypeEpic, TypeChore, TypeMessage, TypeMergeRequest, TypeMolecule, TypeGate, TypeAgent, TypeRole, TypeConvoy, TypeEvent, TypeSlot: + case TypeBug, TypeFeature, TypeTask, TypeEpic, TypeChore, TypeMessage, TypeMergeRequest, TypeMolecule, TypeGate, TypeAgent, TypeRole, TypeRig, TypeConvoy, TypeEvent, TypeSlot: return true } return false } +// IsBuiltIn returns true if the type is a built-in type (same as IsValid). +// Used during multi-repo hydration to determine trust: +// - Built-in types: validate (catch typos) +// - Custom types (!IsBuiltIn): trust from source repo +func (t IssueType) IsBuiltIn() bool { + return t.IsValid() +} + // IsValidWithCustom checks if the issue type is valid, including custom types. // Custom types are user-defined via bd config set types.custom "type1,type2,..." func (t IssueType) IsValidWithCustom(customTypes []string) bool {