P1: Refactor internal/gateway/ - duplicate implementation risk with messaging domain #1328

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

internal/gateway/ contains session/compression/approval/branch logic which is the exact 'parallel gateway implementation' that migration-decisions.md says must be replaced by the not-yet-built messaging domain.

This is a live duplicate-implementation risk - gateway logic should migrate to domain/messaging.

Need to:

  • Analyze current gateway responsibilities
  • Create domain/messaging package structure
  • Migrate gateway logic incrementally to messaging domain
  • Update callers to use domain/messaging
  • Ensure no behavior changes during migration

Blocked by: domain/messaging package not yet created

Close reason

Resolved migration-decisions.md's open Session/Messaging decision: keep internal/gateway as-is rather than risk a big-bang rewrite of live session/compression/approval/branch logic. Materialised internal/domain/messaging with the already-settled canonical Message/Conversation/ToolCall/ToolResult types (composite Conversation identity, immutable MessageID, branch lineage), with tests. Actual gateway migration onto these types is tracked as sequenced follow-up bd issues (d9dv, 4hof, o4e4, h3w2, label messaging-migration) so each channel lands with its own verification.


Imported from beads archie-core-g1y3 · GitHub #662 · type task · priority P1 · created 2026-08-28 · closed 2026-08-31

internal/gateway/ contains session/compression/approval/branch logic which is the exact 'parallel gateway implementation' that migration-decisions.md says must be replaced by the not-yet-built messaging domain. This is a live duplicate-implementation risk - gateway logic should migrate to domain/messaging. Need to: - Analyze current gateway responsibilities - Create domain/messaging package structure - Migrate gateway logic incrementally to messaging domain - Update callers to use domain/messaging - Ensure no behavior changes during migration Blocked by: domain/messaging package not yet created ### Close reason Resolved migration-decisions.md's open Session/Messaging decision: keep internal/gateway as-is rather than risk a big-bang rewrite of live session/compression/approval/branch logic. Materialised internal/domain/messaging with the already-settled canonical Message/Conversation/ToolCall/ToolResult types (composite Conversation identity, immutable MessageID, branch lineage), with tests. Actual gateway migration onto these types is tracked as sequenced follow-up bd issues (d9dv, 4hof, o4e4, h3w2, label messaging-migration) so each channel lands with its own verification. --- _Imported from beads `archie-core-g1y3` · GitHub #662 · type task · priority P1 · created 2026-08-28 · closed 2026-08-31_
sam added the hightask labels 2026-10-27 13:39:57 +00:00
sam self-assigned this 2026-10-27 13:39:57 +00:00
sam closed this issue 2026-10-27 13:39:57 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1328