Remove dead BasePlatformAdapter interface from internal/gateway #1228

Closed
opened 2026-10-27 13:39:32 +00:00 by sam · 0 comments
Owner

gateway.BasePlatformAdapter (internal/gateway/adapter.go, Connect/Disconnect/Send/ChatInfo) is implemented by nothing outside its own test stub. It landed in commit bc1caf6 alongside the Session types and was never wired.

Every live channel instead implements channels.Channel (= gateway.Gateway: Name/Start/Stop, plus ConfigSchema/ValidateConfig) -- asserted at internal/channels/telegram/telegram.go:1229, internal/channels/email/email.go:389, internal/channels/webhook/webhook.go:224. So the repo carries two parallel channel abstractions and the newer one is inert.

It also has an internal contradiction that is likely why it was never implemented: the doc comment says the daemon instantiates 'one adapter per active bot identity x platform' (adapter.go:59) but ChatInfo(ctx) (ChatInfo, error) is documented as 'static metadata about the conversation a platform adapter is connected to' (adapter.go:36-38) with no chat argument. Telegram's Gateway is a single instance serving many chats, so ChatInfo(ctx) has no single answer. Send(ctx, MessageEvent) is fine for both models since MessageEvent carries ChannelID; ChatInfo is the part that only makes sense per-conversation.

Outbound delivery is assigned to the not-yet-built internal/domain/messaging by docs/architecture/migration-decisions.md section 2, so this interface should not be revived in place -- it should be deleted and its intent re-expressed there.

Scope

  • Delete BasePlatformAdapter and its test stub from internal/gateway/adapter.go / adapter_test.go.
  • Keep SendResult and ChatInfo structs if domain/messaging or the media work still wants them; they are separable from the interface.
  • Decouple gateway.CapabilitiesOf from BasePlatformAdapter (it currently takes one) so the capability mechanism survives the removal.

Acceptance criteria

  • BasePlatformAdapter no longer exists; task check passes.
  • No behaviour change: nothing implemented it, so nothing should need rewiring.
  • Any type retained from adapter.go has at least one live consumer, or is removed too.

Notes

Discovery confirmed CapabilitiesOf is absent from the current checkout and gateway history. SendResult and ChatInfo have no live consumers, so all three legacy declarations are removed. Red test: TestLegacyPlatformAdapterTypesAreRemoved failed on BasePlatformAdapter, ChatInfo, and SendResult before deletion; gateway package suite passes after deletion. Full task check currently reaches one unrelated pre-existing failure: internal/app/agentworker TestApplicationOwnsNoTransportWireMechanics reports persistent_runner.go imports JSON wire encoding.

Close reason

Removed the unwired BasePlatformAdapter, SendResult, ChatInfo, and their test-only stub. CapabilitiesOf is absent from the current checkout/history. Gateway and worktree tests pass. task check passes all packages except the pre-existing tracked agentworker architecture failure archie-core-hqst. [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]


Imported from beads archie-core-azbo · GitHub #595 · type task · priority P2 · created 2026-08-22 · closed 2026-08-24

`gateway.BasePlatformAdapter` (internal/gateway/adapter.go, Connect/Disconnect/Send/ChatInfo) is implemented by nothing outside its own test stub. It landed in commit bc1caf6 alongside the Session types and was never wired. Every live channel instead implements `channels.Channel` (= `gateway.Gateway`: Name/Start/Stop, plus ConfigSchema/ValidateConfig) -- asserted at internal/channels/telegram/telegram.go:1229, internal/channels/email/email.go:389, internal/channels/webhook/webhook.go:224. So the repo carries two parallel channel abstractions and the newer one is inert. It also has an internal contradiction that is likely why it was never implemented: the doc comment says the daemon instantiates 'one adapter per active bot identity x platform' (adapter.go:59) but `ChatInfo(ctx) (ChatInfo, error)` is documented as 'static metadata about the conversation a platform adapter is connected to' (adapter.go:36-38) with no chat argument. Telegram's Gateway is a single instance serving many chats, so ChatInfo(ctx) has no single answer. Send(ctx, MessageEvent) is fine for both models since MessageEvent carries ChannelID; ChatInfo is the part that only makes sense per-conversation. Outbound delivery is assigned to the not-yet-built `internal/domain/messaging` by docs/architecture/migration-decisions.md section 2, so this interface should not be revived in place -- it should be deleted and its intent re-expressed there. ## Scope - Delete BasePlatformAdapter and its test stub from internal/gateway/adapter.go / adapter_test.go. - Keep SendResult and ChatInfo structs if domain/messaging or the media work still wants them; they are separable from the interface. - Decouple gateway.CapabilitiesOf from BasePlatformAdapter (it currently takes one) so the capability mechanism survives the removal. ## Acceptance criteria - BasePlatformAdapter no longer exists; `task check` passes. - No behaviour change: nothing implemented it, so nothing should need rewiring. - Any type retained from adapter.go has at least one live consumer, or is removed too. ### Notes Discovery confirmed CapabilitiesOf is absent from the current checkout and gateway history. SendResult and ChatInfo have no live consumers, so all three legacy declarations are removed. Red test: TestLegacyPlatformAdapterTypesAreRemoved failed on BasePlatformAdapter, ChatInfo, and SendResult before deletion; gateway package suite passes after deletion. Full task check currently reaches one unrelated pre-existing failure: internal/app/agentworker TestApplicationOwnsNoTransportWireMechanics reports persistent_runner.go imports JSON wire encoding. ### Close reason Removed the unwired BasePlatformAdapter, SendResult, ChatInfo, and their test-only stub. CapabilitiesOf is absent from the current checkout/history. Gateway and worktree tests pass. task check passes all packages except the pre-existing tracked agentworker architecture failure archie-core-hqst. [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).] --- _Imported from beads `archie-core-azbo` · GitHub #595 · type task · priority P2 · created 2026-08-22 · closed 2026-08-24_
sam added the mediumtask labels 2026-10-27 13:39:32 +00:00
sam self-assigned this 2026-10-27 13:39:32 +00:00
sam closed this issue 2026-10-27 13:39:32 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1228