Boot: from config.yaml to a listening port

Boot: from config.yaml to a listening port A workflow diagram generated by Archify. 01 / apps/platformkit · main.go, modules.go 02 / kit/app · App.Run 03 / Gate outcome · role? 04 / Role processes · kit/health platformkit · run --role <role> · apps/platformkit · main.go, modules.go · web · worker · all platformkit run --role <role> web · worker · all config.Load · PLATFORMKIT_<SECTION>_<KEY> · apps/platformkit · main.go, modules.go · missing/invalid file refused config.Load PLATFORMKIT_<SECTION>_<KEY> missing/invalid file refused compose(cfg) · Module(Deps{…}) in dependency order · apps/platformkit · main.go, modules.go · user→notification→auth→tenant→…→audit→admin compose(cfg) Module(Deps{…}) in dependency order user→notification→auth→tenant→…→audit→admin app.New · module.Validate(mods) · apps/platformkit · main.go, modules.go · role: web · worker · all app.New module.Validate(mods) role: web · worker · all db.Migrate · owner · advisory lock · kit/app · App.Run · one tx per file db.Migrate owner · advisory lock one tx per file db.Open · refuses a SUPERUSER or BYPASSRLS role · kit/app · App.Run · database.url · app role db.Open refuses a SUPERUSER or BYPASSRLS role database.url · app role buildAPI · httpx.New · m.Routes(api) · kit/app · App.Run · Declare · health.Register buildAPI httpx.New · m.Routes(api) Declare · health.Register Boot gates · ValidateDeclarations · kit/app · App.Run · permissions · events Boot gates ValidateDeclarations permissions · events Exit · nothing listens · Gate outcome · role? · failed gate returns Exit nothing listens failed gate returns role? · web, worker or all · Gate outcome · role? · decision role? web, worker or all decision all · both in one process · Gate outcome · role? · events.Memory() all both in one process events.Memory() worker · outbox-relay every 1s · outbox-purge · module Jobs · Role processes · kit/health · events.Consume · jobs.Scheduler · probes worker outbox-relay every 1s · outbox-purge · module Jobs events.Consume · jobs.Scheduler · probes web · serve HTTP · Role processes · kit/health · server.addr web serve HTTP server.addr Probes · GET /health · /ready · Role processes · kit/health · plain router Probes GET /health · /ready plain router cfg Run conn fail pass all worker web Legend User UI Agent logic Policy Tool action Context / trace

Every role runs the gates

  • • Every role runs the gates, so the worker refuses the composition the web role would refuse.
  • • The gates are api.ValidateDeclarations, validatePermissions and validateEvents; a failed gate returns before anything listens.

No migration job

  • • There is no migration job: every role migrates behind an advisory lock at start (ADR 0005).
  • • db.Migrate keeps a per-owner history; each file commits with its history row in one transaction.

Routes and probes

  • • api.Declare lists every module permission; each m.Routes(api) mounts rest.Spec routes: Spec.Mount registers a Resource and five routes.
  • • GET /health ignores checks; GET /ready answers 503 with the failing check named; both sit on the plain router.