Architecture Finding
Type: coupling/interface-violation
Affected area: common/variables.go, common/logger.go, common/identities.go, htfs/directory.go, settings/settings.go
Foundational packages use init() to inspect CLI arguments, mutate exported process-global flags, start background goroutines, and create product/holotree directories. htfs additionally performs directory creation when it is merely imported. Consequently, package import order and test process state become implicit runtime inputs, and the command layer cannot construct an isolated configuration or use these packages safely as reusable libraries.
Impact
Tests must save and restore global state; embedding RCC or adding commands can trigger I/O and goroutines before configuration is validated; concurrent or multi-profile execution cannot be isolated. The dependency boundary is inverted: domain/storage packages own CLI lifecycle side effects.
Recommendation
Introduce an explicit runtime/bootstrap object owned by the composition root (cmd/rcc). Move argument/environment parsing, directory provisioning, logger lifecycle, and mutable execution flags into that bootstrap/context. Pass narrow dependencies into operations and storage packages; keep package initialization declarative only. Migrate incrementally, starting with filesystem provisioning in htfs and common runtime globals.
Filed by architect agent (ACMM L5 — hold-gated mode)
🐝 Hive Agent: architect | Instance: hive-loud-hen | SHA: 0e3a5e4
— hive: agent=architect backend=codex model=gpt-5.6-terra codex=0.146.0
Architecture Finding
Type: coupling/interface-violation
Affected area:
common/variables.go,common/logger.go,common/identities.go,htfs/directory.go,settings/settings.goFoundational packages use
init()to inspect CLI arguments, mutate exported process-global flags, start background goroutines, and create product/holotree directories.htfsadditionally performs directory creation when it is merely imported. Consequently, package import order and test process state become implicit runtime inputs, and the command layer cannot construct an isolated configuration or use these packages safely as reusable libraries.Impact
Tests must save and restore global state; embedding RCC or adding commands can trigger I/O and goroutines before configuration is validated; concurrent or multi-profile execution cannot be isolated. The dependency boundary is inverted: domain/storage packages own CLI lifecycle side effects.
Recommendation
Introduce an explicit runtime/bootstrap object owned by the composition root (
cmd/rcc). Move argument/environment parsing, directory provisioning, logger lifecycle, and mutable execution flags into that bootstrap/context. Pass narrow dependencies into operations and storage packages; keep package initialization declarative only. Migrate incrementally, starting with filesystem provisioning inhtfsand common runtime globals.Filed by architect agent (ACMM L5 — hold-gated mode)
🐝 Hive Agent:
architect| Instance:hive-loud-hen| SHA:0e3a5e4— hive: agent=architect backend=codex model=gpt-5.6-terra codex=0.146.0