Skip to main content

Dependency Graph

This document shows the import relationships between Runix modules. Understanding the dependency graph helps when modifying code — changes to a low-level package propagate upward.

Import Hierarchy​

Dependency Rules​

RuleDescription
pkg/types imports nothing from internal/The shared kernel has zero internal dependencies
internal/supervisor imports from pkg/types and sibling packagesThe core engine depends on types, hooks, runtime, and utility packages
internal/daemon imports internal/supervisorThe daemon wraps the supervisor with IPC
cmd/runix imports everythingThe CLI is the composition root — it wires all packages together
No circular dependenciesAll imports flow downward in the hierarchy

Shared Kernel: pkg/types​

The pkg/types package is imported by every other package in the project. It defines:

  • ProcessConfig — how a process is configured
  • ProcessState — state machine states and transitions
  • ProcessInfo — runtime information about a managed process
  • RunixConfig — top-level configuration file structure
  • HookConfig / ProcessHooks — lifecycle hook definitions
  • HealthCheckConfig — health check configuration
  • WatchConfig — file watch configuration
  • CronJobConfig — cron job configuration
  • SecretRef — secret reference types
  • DefaultsConfig — default configuration values

Because it has no internal imports, changes to pkg/types are safe to make without worrying about circular dependencies.

Package Sizes​

PackageFilesApprox Lines
cmd/runix31~3,600
internal/supervisor12~2,400
sdk5~1,500
internal/daemon6~1,400
internal/mcp7~1,250
internal/runtime13~1,200
internal/tui8~1,800
internal/config8~850
internal/output8~800
internal/metrics5~780
internal/web4~670
internal/scheduler3~580
internal/hooks4~480
internal/events4~480
internal/e2e1~530
internal/updater3~420
internal/auth2~750
internal/watcher3~390
internal/healthcheck5~360
internal/cgroups4~210
internal/logrot2~270
internal/secrets2~130
pkg/types8~550
internal/version1~6
Total~149~21,300

What's Next​