idx

ADR 0007: Separate Inspect UI Interface from Core Service

Status

Accepted

Context

The inspect flow was implemented with UI execution details coupled to InitCommandService internals. This created architectural friction:

The project architecture requires clear ports/adapters boundaries and small, focused modules.

Decision

Introduce an explicit inspect UI port in core and inject its implementation through dependency injection.

Contract

Add ports.InspectUIRunner:

Service Integration

Update InitCommandService:

Provide constructors:

Adapter Boundary

Add TUI adapter implementation in handlers layer:

Wire adapter from bootstrap (cmd/idx/main.go) using dependency injection.

Alternatives Considered

Keep direct inspect UI call inside service

Move all inspect UI files immediately to adapters in one big change

Add a function callback only in tests

Consequences

Positive

Negative

Trade-offs

Implementation Notes

This ADR records the boundary decision. Further UI file decomposition for inspect (model/update/render split) is tracked as follow-up refactor work.