Remove dead Go types and event code

- Delete unused Grant struct (persona-era, zero references)
- Delete CompositeModelKey (never called)
- Remove dead comment-only type stubs (NoteGraph, ProjectChannel, etc.)
- Remove empty Chat/Channel event sections from route table
- Remove dead chat.typing/channel.typing condition in WS subscriber
- Update bus doc examples and test labels to use real event names

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-27 13:04:50 +00:00
parent 23aa457a01
commit 3aaf8dd2c0
5 changed files with 19 additions and 93 deletions

View File

@@ -12,13 +12,13 @@ func TestMatch(t *testing.T) {
label, pattern string
want bool
}{
{"chat.message.abc", "chat.message.abc", true},
{"chat.message.abc", "chat.message.*", true},
{"chat.message.abc", "chat.*", true},
{"chat.message.abc", "*", true},
{"chat.message.abc", "chat.message.xyz", false},
{"chat.message.abc", "channel.message.*", false},
{"chat.message.abc", "chat.message", false},
{"workflow.assigned.abc", "workflow.assigned.abc", true},
{"workflow.assigned.abc", "workflow.assigned.*", true},
{"workflow.assigned.abc", "workflow.*", true},
{"workflow.assigned.abc", "*", true},
{"workflow.assigned.abc", "workflow.assigned.xyz", false},
{"workflow.assigned.abc", "notification.new.*", false},
{"workflow.assigned.abc", "workflow.assigned", false},
{"ping", "ping", true},
{"ping", "pong", false},
{"plugin.hook.pre_completion", "plugin.hook.*", true},
@@ -37,12 +37,12 @@ func TestBusPublishExact(t *testing.T) {
bus := NewBus()
var count int32
bus.Subscribe("chat.message.abc", func(e Event) {
bus.Subscribe("workflow.assigned.abc", func(e Event) {
atomic.AddInt32(&count, 1)
})
bus.Publish(Event{Label: "chat.message.abc", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "chat.message.xyz", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "workflow.assigned.abc", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "workflow.assigned.xyz", Payload: json.RawMessage(`{}`)})
if atomic.LoadInt32(&count) != 1 {
t.Errorf("expected 1 dispatch, got %d", count)
@@ -53,13 +53,13 @@ func TestBusPublishWildcard(t *testing.T) {
bus := NewBus()
var count int32
bus.Subscribe("chat.message.*", func(e Event) {
bus.Subscribe("workflow.assigned.*", func(e Event) {
atomic.AddInt32(&count, 1)
})
bus.Publish(Event{Label: "chat.message.abc", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "chat.message.xyz", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "chat.typing.abc", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "workflow.assigned.abc", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "workflow.assigned.xyz", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "workflow.claimed.abc", Payload: json.RawMessage(`{}`)})
if atomic.LoadInt32(&count) != 2 {
t.Errorf("expected 2 dispatches, got %d", count)
@@ -91,7 +91,7 @@ func TestBusGlobalWildcard(t *testing.T) {
atomic.AddInt32(&count, 1)
})
bus.Publish(Event{Label: "chat.message.abc", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "workflow.assigned.abc", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "system.notify", Payload: json.RawMessage(`{}`)})
bus.Publish(Event{Label: "plugin.hook.pre_completion", Payload: json.RawMessage(`{}`)})
@@ -105,8 +105,6 @@ func TestRouteFor(t *testing.T) {
label string
want Direction
}{
{"chat.message.abc", DirLocal}, // chat routes removed in v0.1.0
{"chat.typing.abc", DirLocal}, // chat routes removed in v0.1.0
{"system.notify", DirToClient},
{"plugin.hook.pre_completion", DirLocal},
{"internal.db.write", DirLocal},