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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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