- migration-decisions.md: confirm curator/mapping/scheduling as legitimate domains that were never added to the confirmed list; document identity/agent/messaging/plugin as approved-but-unmaterialised targets rather than creating dead stub packages. - Resolve the open Session/Messaging decision (section 2): keep internal/gateway as-is rather than risk a big-bang rewrite of live session/compression/approval/branch logic; materialise internal/domain/messaging with the already-settled canonical Message/Conversation/ToolCall/ToolResult types. Actual gateway migration onto these types is tracked as sequenced follow-up bd issues (label messaging-migration). - ARCHITECTURE.md: add internal/gateway, internal/tools, internal/memory, internal/secret, internal/plugin, internal/skill to the Package Map.
43 lines
995 B
Go
43 lines
995 B
Go
package messaging
|
|
|
|
import "testing"
|
|
|
|
func TestConversationIsBranch(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
conv Conversation
|
|
want bool
|
|
}{
|
|
{
|
|
name: "root conversation",
|
|
conv: Conversation{ID: ConversationID{ChannelID: "chan-1"}},
|
|
want: false,
|
|
},
|
|
{
|
|
name: "forked conversation",
|
|
conv: Conversation{
|
|
ID: ConversationID{ChannelID: "chan-1", ThreadID: "fork-1"},
|
|
ParentConversationID: ConversationID{ChannelID: "chan-1"},
|
|
ForkMessageID: "msg-42",
|
|
},
|
|
want: true,
|
|
},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := tt.conv.IsBranch(); got != tt.want {
|
|
t.Fatalf("IsBranch() = %t, want %t", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestConversationIDDistinguishesThreads(t *testing.T) {
|
|
a := ConversationID{ChannelID: "chan-1", ThreadID: "t1"}
|
|
b := ConversationID{ChannelID: "chan-1", ThreadID: "t2"}
|
|
if a == b {
|
|
t.Fatal("distinct ThreadIDs must produce distinct ConversationIDs")
|
|
}
|
|
}
|