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

  1. load config → acquire home lock → probe git tools
  2. open and migrate SQLite → bootstrap actor
  3. construct services → recover home → bind handlers → listen

Outbound edges

FromToMeaning
binmain.tsprocess entry
main.tscli/buildProgram, wires commander programs
main.tsimplementationsconstructs + injects every adapter
servemain.tsinvokes serve()
db migratemain.tsinvokes migrate()

Rules

  1. Nothing imports main.ts. It sits at the top of the import matrix.
  2. The transaction context belongs to storage. main.ts wires it, but never opens one.