Purpose of this page: mark the process boundary, explain the
composition root, and fix the startup order.
Layer 1
Process
The process boundary. One entry point, one composition root. main.ts is the only file allowed to name an implementation.
Components
kanthord bin (dist/main.js)
The published executable. The repository ships TypeScript; npm emits
dist/ through tsconfig.build.json and points bin at it.
src/main.ts · composition root
Binds every dependency once. Constructs each service implementation, injects it through its interface, builds the commander programs, and starts the server.
Startup order
- load config → acquire home lock → probe git tools
- open and migrate SQLite → bootstrap actor
- construct services → recover home → bind handlers → listen
Outbound edges
| From | To | Meaning |
|---|---|---|
| bin | main.ts | process entry |
| main.ts | cli/ | buildProgram, wires commander programs |
| main.ts | implementations | constructs + injects every adapter |
| serve | main.ts | invokes serve() |
| db migrate | main.ts | invokes migrate() |
Rules
- Nothing imports
main.ts. It sits at the top of the import matrix. - The transaction context belongs to storage. main.ts wires it, but never opens one.