infrastructure/eventbus/nats: relocate NATS transport #904

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

Create internal/infrastructure/eventbus/nats as a properly structured replacement for internal/nats. This is NOT a mechanical move: the existing code has no interfaces, leaks vendor types (Conn() *nats.Conn, PublishMsg(*nats.Msg), Fetch() jetstream.Msg) into all four consumers, uses a 7-positional-parameter publish with stringly-typed comma-separated labels, stores an unused logger, returns (nil, nil) for 'no message', and hardcodes stream/consumer/timeout config. Rebuild it with: separate files per concern; a Message wrapper so jetstream types stop crossing the boundary; Publisher/Consumer interfaces; a Config struct; sentinel errors; consistent %w wrapping; real logging. Then update cmd/archied, cmd/archie-agent, internal/daemon and internal/agentexec to the new API.

Acceptance Criteria

internal/nats no longer exists; internal/infrastructure/eventbus/nats has its contents. All imports updated. task check clean. Container and NATS behaviour unchanged.


Imported from beads archie-core-1786637499585-374-bf060b8b · GitHub #395 · type task · priority P2 · created 2026-08-08 · closed 2026-08-08

Create internal/infrastructure/eventbus/nats as a properly structured replacement for internal/nats. This is NOT a mechanical move: the existing code has no interfaces, leaks vendor types (Conn() *nats.Conn, PublishMsg(*nats.Msg), Fetch() jetstream.Msg) into all four consumers, uses a 7-positional-parameter publish with stringly-typed comma-separated labels, stores an unused logger, returns (nil, nil) for 'no message', and hardcodes stream/consumer/timeout config. Rebuild it with: separate files per concern; a Message wrapper so jetstream types stop crossing the boundary; Publisher/Consumer interfaces; a Config struct; sentinel errors; consistent %w wrapping; real logging. Then update cmd/archied, cmd/archie-agent, internal/daemon and internal/agentexec to the new API. ### Acceptance Criteria internal/nats no longer exists; internal/infrastructure/eventbus/nats has its contents. All imports updated. task check clean. Container and NATS behaviour unchanged. --- _Imported from beads `archie-core-1786637499585-374-bf060b8b` · GitHub #395 · type task · priority P2 · created 2026-08-08 · closed 2026-08-08_
sam added the mediumtask labels 2026-10-27 13:38:14 +00:00
sam self-assigned this 2026-10-27 13:38:14 +00:00
sam closed this issue 2026-10-27 13:38:14 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#904