{
  "repo": "tidbcloud/jiraport",
  "binary": "resolver",
  "binary_path": "cmd/resolver/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "services": [
    {
      "name": "JiraportResolverLifecycle",
      "package": "main",
      "methods": [
        {
          "name": "Startup",
          "name_key": "Runtime JiraportResolverLifecycle.Startup",
          "input": "CONFIG_PATH + env vars + flags",
          "output": "initialized DBs, clients, handlers, resolver router, and runtime transport",
          "type": "local"
        },
        {
          "name": "LoadConfig",
          "name_key": "Runtime JiraportResolverLifecycle.LoadConfig",
          "input": "config directory path",
          "output": "viper configuration with resolved policy/matcher/template paths",
          "type": "local"
        },
        {
          "name": "InitializeDatastores",
          "name_key": "Runtime JiraportResolverLifecycle.InitializeDatastores",
          "input": "policy-db-dsn + data-db-dsn + info-db-dsn + policy-file",
          "output": "gorm handles plus db.Client with migrated tables and loaded notification policies",
          "type": "local"
        },
        {
          "name": "InitializeClients",
          "name_key": "Runtime JiraportResolverLifecycle.InitializeClients",
          "input": "resolver-url, resolver-function-name, jira/devops/clinic config",
          "output": "lambda, engineer, clinic, devops, lark, jira, and notification clients",
          "type": "local"
        },
        {
          "name": "RegisterHandlers",
          "name_key": "Runtime JiraportResolverLifecycle.RegisterHandlers",
          "input": "matcher files + template file + initialized clients",
          "output": "resolver routes for JiraIssue, NotificationAck, NotificationAction, and HookEvent",
          "type": "local"
        },
        {
          "name": "StartRuntime",
          "name_key": "Runtime JiraportResolverLifecycle.StartRuntime",
          "input": "server-mode flag + listen-address",
          "output": "either an HTTP event ingress server or an AWS Lambda handler",
          "type": "local"
        }
      ]
    },
    {
      "name": "JiraportResolverHTTP",
      "type": "http",
      "methods": [
        {
          "name": "GET /healthz",
          "name_key": "HTTP GET /healthz",
          "input": "none",
          "output": "HTTP 200",
          "path": "/healthz",
          "type": "http"
        },
        {
          "name": "POST /",
          "name_key": "HTTP POST /",
          "input": "lambda.Event JSON",
          "output": "HTTP 202 after spawning async event handling goroutine",
          "path": "/",
          "type": "http"
        }
      ]
    },
    {
      "name": "JiraportResolverEvents",
      "package": "resolver",
      "methods": [
        {
          "name": "Handle JiraIssue",
          "name_key": "Runtime JiraportResolverEvents.HandleJiraIssue",
          "input": "lambda.Event{Name=JiraIssue, Payload=api/jira.JiraEvent}",
          "output": "issue persisted, notifications created, and matching notification transitions executed",
          "type": "local"
        },
        {
          "name": "Handle NotificationAck",
          "name_key": "Runtime JiraportResolverEvents.HandleNotificationAck",
          "input": "lambda.Event{Name=NotificationAck, Payload=api/lark.AckWebhookEvent}",
          "output": "ack transition applied and Jira comment appended",
          "type": "local"
        },
        {
          "name": "Handle NotificationAction",
          "name_key": "Runtime JiraportResolverEvents.HandleNotificationAction",
          "input": "lambda.Event{Name=NotificationAction, Payload=entity.NotificationActionExecInfo}",
          "output": "one configured action command executed and the notification state machine advanced",
          "type": "local"
        },
        {
          "name": "Handle HookEvent",
          "name_key": "Runtime JiraportResolverEvents.HandleHookEvent",
          "input": "lambda.Event{Name=HookEvent, Payload=api/hooks.HookBody}",
          "output": "hook markdown appended to the target Jira issue",
          "type": "local"
        }
      ]
    }
  ],
  "extensions": {
    "notes": [
      "The resolver binary is event-driven. In server-mode it exposes POST / only as a transport shim that decodes lambda.Event JSON and then dispatches by event.Name in a goroutine.",
      "The real business surface is the four event handlers: JiraIssue, NotificationAck, NotificationAction, and HookEvent.",
      "cmd/scheduler/main.go is legacy commented-out code without a buildable main function, so it is excluded from the runtime interface surface."
    ]
  }
}
