0530 — pkg/compaction stays two-layer; MessageRow lives in common
Edit this pagePosted: 2026-09-08 · Report this thread
Context
Every other domain follows pkg/
Decision
- Compaction stays two-layer as a deliberate exception: it owns no vocabulary, so no pkg/compaction package exists to hold none.
- MessageRow stays in pkg/common. It is shared across the producer and compaction stacks, and common is the sanctioned home for vocabulary shared across different stacks (same rule that places shared error sentinels there).
- Moving MessageRow into a new pkg/compaction was rejected: producer would import another domain’s vocabulary for a row the producer itself writes, and the package would exist to hold exactly one moved struct.
Consequences
- The three-layer template stays the default; compaction is the one recorded exception, revisited only if compaction grows vocabulary of its own (sentinels, enums, a second read-model).
- Callers keep common.MessageRow (or the producer alias) in signatures; no import changes anywhere.