Discovery: pull wiring phases out of the archied boot struct #1777

Open
opened 2026-11-02 14:32:57 +00:00 by sam · 0 comments
Owner

From the 2026-08 architecture review (recommendation: strong).

What is wrong: the archied composition root has absorbed domain policy. internal/app/archied/bootstrap.go is 901 lines with a mutable boot struct of 54 fields and 35 phase methods; its header comment rationalizes the deviation from the repo rule that a composition root only calls constructors in order. Config publishing, requeue handling, and embedded-NATS fallback branches live in the root. Most-churned module in the repo (384 commits in 60 days).

Wanted: each phase group becomes a constructor returning its product; run() reads as the ordered constructor list; buildDaemon takes one deps parameter instead of reading 12 boot fields.

Done when:

  • run() is an ordered list of constructor calls with no shared mutable struct
  • buildDaemon signature is a single deps struct, not reads from 12 boot fields
  • task check green; archied boots and --once behaves as before
From the 2026-08 architecture review (recommendation: **strong**). **What is wrong:** the archied composition root has absorbed domain policy. `internal/app/archied/bootstrap.go` is 901 lines with a mutable `boot` struct of 54 fields and 35 phase methods; its header comment rationalizes the deviation from the repo rule that a composition root only calls constructors in order. Config publishing, requeue handling, and embedded-NATS fallback branches live in the root. Most-churned module in the repo (384 commits in 60 days). **Wanted:** each phase group becomes a constructor returning its product; `run()` reads as the ordered constructor list; `buildDaemon` takes one deps parameter instead of reading 12 boot fields. **Done when:** - `run()` is an ordered list of constructor calls with no shared mutable struct - `buildDaemon` signature is a single deps struct, not reads from 12 `boot` fields - `task check` green; archied boots and `--once` behaves as before
sam added the discovery label 2026-11-02 14:53:55 +00:00
sam added the medium label 2026-11-14 14:45:43 +00:00
sam added the deferred label 2026-11-15 17:26:13 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1777