Skip to content

architecture review: findings for dispatch #105

@jongio

Description

@jongio

architecture review

  • internal/config imports internal/tui/styles - upward dependency violation. The config package (foundational infrastructure layer) depends on the tui/styles package (presentation layer) because Config.Schemes uses styles.ColorScheme. Lower-layer packages must not import from higher UI layers. The ColorScheme type should be defined in config or a shared types package, with tui/styles importing it from there.
  • internal/copilot (external API client) imports internal/data (local data store) - cross-layer coupling. The copilot Client struct holds a *data.Store reference and tool handlers in tools.go query the session store directly. This makes the API client layer tightly coupled to the local database layer; a service/mediator above both packages should own that coordination.
  • Application version (tui.Version) is defined in internal/tui and set via ldflags on that package. Version is application metadata, not a TUI concern - it should live in a dedicated internal/version package or cmd/dispatch, not embedded in the presentation layer. Currently cmd/dispatch, magefile.go, and .goreleaser.yml all reference the version through the TUI package path.

Automated analysis - 3 finding(s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    automatedFiled by automated analysis

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions