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
| Rule | Description |
|---|---|
pkg/types imports nothing from internal/ | The shared kernel has zero internal dependencies |
internal/supervisor imports from pkg/types and sibling packages | The core engine depends on types, hooks, runtime, and utility packages |
internal/daemon imports internal/supervisor | The daemon wraps the supervisor with IPC |
cmd/runix imports everything | The CLI is the composition root — it wires all packages together |
| No circular dependencies | All 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 configuredProcessState— state machine states and transitionsProcessInfo— runtime information about a managed processRunixConfig— top-level configuration file structureHookConfig/ProcessHooks— lifecycle hook definitionsHealthCheckConfig— health check configurationWatchConfig— file watch configurationCronJobConfig— cron job configurationSecretRef— secret reference typesDefaultsConfig— default configuration values
Because it has no internal imports, changes to pkg/types are safe to make without worrying about circular dependencies.
Package Sizes
| Package | Files | Approx Lines |
|---|---|---|
cmd/runix | 31 | ~3,600 |
internal/supervisor | 12 | ~2,400 |
sdk | 5 | ~1,500 |
internal/daemon | 6 | ~1,400 |
internal/mcp | 7 | ~1,250 |
internal/runtime | 13 | ~1,200 |
internal/tui | 8 | ~1,800 |
internal/config | 8 | ~850 |
internal/output | 8 | ~800 |
internal/metrics | 5 | ~780 |
internal/web | 4 | ~670 |
internal/scheduler | 3 | ~580 |
internal/hooks | 4 | ~480 |
internal/events | 4 | ~480 |
internal/e2e | 1 | ~530 |
internal/updater | 3 | ~420 |
internal/auth | 2 | ~750 |
internal/watcher | 3 | ~390 |
internal/healthcheck | 5 | ~360 |
internal/cgroups | 4 | ~210 |
internal/logrot | 2 | ~270 |
internal/secrets | 2 | ~130 |
pkg/types | 8 | ~550 |
internal/version | 1 | ~6 |
| Total | ~149 | ~21,300 |
What's Next
- Architecture Overview — How all modules work together
- Developer Guide: Contributing — How to navigate the codebase