From ebd5c1b72a3f9ae56c9ba2d8129e30ca50e254fb Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Tue, 30 Dec 2025 00:38:32 -0800 Subject: [PATCH] fix: rename BondRef.ProtoID to SourceID for clarity (bd-ia3g) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ProtoID field in BondRef was misleading as it could hold both proto IDs (from proto+proto bonds) and molecule IDs (from mol+mol bonds). Rename to SourceID with updated JSON tag to better reflect its purpose. Changes: - Rename BondRef.ProtoID to SourceID in types.go - Update JSON tag from proto_id to source_id - Update all usages in mol_bond.go and tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- cmd/bd/mol_bond.go | 4 ++-- internal/types/types.go | 4 ++-- internal/types/types_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/bd/mol_bond.go b/cmd/bd/mol_bond.go index 1778d66c..58cf334a 100644 --- a/cmd/bd/mol_bond.go +++ b/cmd/bd/mol_bond.go @@ -317,8 +317,8 @@ func bondProtoProto(ctx context.Context, s storage.Storage, protoA, protoB *type Priority: minPriority(protoA.Priority, protoB.Priority), IssueType: types.TypeEpic, BondedFrom: []types.BondRef{ - {ProtoID: protoA.ID, BondType: bondType, BondPoint: ""}, - {ProtoID: protoB.ID, BondType: bondType, BondPoint: ""}, + {SourceID: protoA.ID, BondType: bondType, BondPoint: ""}, + {SourceID: protoB.ID, BondType: bondType, BondPoint: ""}, }, } if err := tx.CreateIssue(ctx, compound, actorName); err != nil { diff --git a/internal/types/types.go b/internal/types/types.go index e4da27a9..a4d9d100 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -128,7 +128,7 @@ func (i *Issue) ComputeContentHash() string { // Bonded molecules for _, br := range i.BondedFrom { - w.str(br.ProtoID) + w.str(br.SourceID) w.str(br.BondType) w.str(br.BondPoint) } @@ -795,7 +795,7 @@ type EpicStatus struct { // When protos or molecules are bonded together, BondRefs record // which sources were combined and how they were attached. type BondRef struct { - ProtoID string `json:"proto_id"` // Source proto/molecule ID + SourceID string `json:"source_id"` // Source proto or molecule ID BondType string `json:"bond_type"` // sequential, parallel, conditional BondPoint string `json:"bond_point,omitempty"` // Attachment site (issue ID or empty for root) } diff --git a/internal/types/types_test.go b/internal/types/types_test.go index 87b11cb5..40906aea 100644 --- a/internal/types/types_test.go +++ b/internal/types/types_test.go @@ -464,12 +464,12 @@ func TestIssueCompoundHelpers(t *testing.T) { t.Fatalf("expected nil constituents for non-compound issue") } - bonded := &Issue{BondedFrom: []BondRef{{ProtoID: "proto-1", BondType: BondTypeSequential}}} + bonded := &Issue{BondedFrom: []BondRef{{SourceID: "proto-1", BondType: BondTypeSequential}}} if !bonded.IsCompound() { t.Fatalf("issue with bonded refs should be compound") } refs := bonded.GetConstituents() - if len(refs) != 1 || refs[0].ProtoID != "proto-1" { + if len(refs) != 1 || refs[0].SourceID != "proto-1" { t.Fatalf("unexpected constituents: %#v", refs) } }