Automation Services Architecture

Automation services turn commands, source-control events, labels, review requests, HTTP webhooks, and schedules into scoped work.

ℹ️Static source scope

This page describes cloud automation boundaries present in Kilo-Org/cloud. Static source shows supported code paths, Worker bindings, and deployable surfaces. It does not prove live production enablement or rollout policy.

How to use this page

Use this page for trigger-to-execution workflows: what starts work, which owner authorizes it, where orchestration state lives, when Cloud Agent launches, how output returns, and how stuck work recovers. Use Cloud Platform for hosted service topology and Cloud Security for trust boundaries.

Ownership model

Automation state and credentials are scoped to owner where supported. Owner is personal user or organization. Personal and organization paths stay separate so credentials, concurrency, findings, and callbacks do not collapse into global automation state.

DimensionModel
Owner scopePersonal user owner or organization owner, handled separately where supported
Source-control targetGitHub is primary across automation; GitLab target support exists in selected paths
Command ingressGitHub, Slack, and Linear command surfaces are distinct from target repository support
CredentialsWeb control plane resolves user, bot, or installation token and passes scoped access to Worker or Cloud Agent
Callback authWorkers use internal secrets, service bindings, or per-run callback secrets depending on flow
Cloud Agent sandboxLaunches inherit policy-selected sandbox allocation and session-specific workspace paths; see Cloud Agent

Common lifecycle

Most automation paths follow same shape. Individual services can stop before Cloud Agent or select different destination.

flowchart LR
  trigger["Command, webhook, label, schedule, or manual dispatch"]
  web["Web control plane"]
  worker["Worker, queue, or Durable Object"]
  agent["Cloud Agent when coding work is needed"]
  output["Callback, status update, or product-facing output"]
  scm["GitHub or GitLab target repository"]

  trigger --> web
  trigger --> worker
  web --> worker
  worker --> agent
  worker --> output
  agent --> scm
  agent --> output
  output --> web
StageResponsibility
TriggerAccept command, source-control event, label, webhook, schedule, or manual dispatch
Authorization ownerResolve personal or organization scope and permitted credentials
OrchestrationStore durable work state and coordinate queues, Durable Objects, callbacks, and alarms
Execution targetLaunch Cloud Agent only when repository or structured coding work requires it; some flows stop earlier or select another destination
OutputPost review, label, pull request, finding state, callback, or destination message
RecoveryRetry queue delivery, enforce timeout alarm, reconcile stale state, or dispatch next waiting item

Service inventory

ServiceTriggerOrchestration boundaryExecution targetOutput or recovery
Kilo BotGitHub, Slack, or Linear command ingressWeb control plane bot librariesCloud Agent for requested repository workCommand response and coding-session result
Code ReviewPull-request webhook or review dispatchDatabase queue and code-review-infra Durable Object per reviewCloud Agent review sessionPull-request feedback; dispatch next waiting review
Auto TriageGitHub issue event or dispatch queueWeb duplicate check and auto-triage-infra Durable Object per ticketCloud Agent only when classification session is neededLabels, status, callback, and timeout alarm
Auto Fixkilo-auto-fix label or dispatch ruleauto-fix-infra Durable Object per fix ticketCloud Agent branch and pull-request workPull request and lifecycle status callback
Security AgentInteractive or scheduled Dependabot sync plus analysis queuesecurity-sync and security-auto-analysis WorkersModel triage in security-auto-analysis; Cloud Agent only for selected deep analysisFinding state, audit records, and stale-analysis cleanup
Webhook Agent IngestHTTP webhook or scheduled alarmwebhook-agent-ingest queue and TriggerDOCloud Agent or Kilo Chat destinationDestination delivery and queue retry behavior

Kilo Bot ingress and source-control targets

Kilo Bot command ingress and repository target support are separate concerns.

ConcernCurrent static-source statement
Command ingressGitHub, Slack, and Linear are current Kilo Bot command surfaces
GitHub targetSupported across bot, review, triage, fix, security, and Cloud Agent paths
GitLab targetSupported in selected Cloud Agent and bot context paths
GitLab command ingressGitLab repository support does not imply note or comment-triggered Kilo Bot commands

Do not document GitLab issue notes or merge-request comments as current Kilo Bot trigger surfaces unless source adds explicit ingress handling.

Code Review

Code Review queues pull-request work in database, enforces per-owner concurrency in Next.js dispatch layer, and starts CodeReviewOrchestrator Durable Object when slot is available.

ConcernBehavior
TriggerPull-request webhook or review dispatch
Authorization ownerPer-owner dispatch slots separate concurrent review work
QueueReviews wait in database as pending rows
OrchestrationDurable Object keeps Cloud Agent connection alive
OutputReview feedback is posted back to pull request
RecoveryWorker updates database and triggers dispatch of next pending review

Auto Triage

Auto Triage classifies GitHub issues and applies labels or status updates. Duplicate check happens through web backend. Non-duplicate issues can launch Cloud Agent classification through prepare, initiate, and callback flow.

ConcernBehavior
TriggerGitHub issue event or dispatch queue
Duplicate checkCalls Next.js API and can complete without Cloud Agent
ExecutionCloud Agent session runs structured classification prompt when needed
CallbackPOST /tickets/:ticketId/classification-callback with per-ticket secret
OutputHigh-confidence classification applies labels such as kilo-auto-fix for downstream Auto Fix
RecoveryDurable Object alarm marks stuck ticket failed

Auto Fix

Auto Fix receives dispatch requests when issues are selected for automated fixes. Durable Object manages fix session state, launches Cloud Agent, and reports status to backend.

ConcernBehavior
TriggerLabel or dispatch rule selects issue for fixing
OrchestrationAutoFixOrchestrator owns fix session state
ExecutionCloud Agent creates branch and pull request
OutputWorker reports lifecycle updates to internal backend API

Security Agent

Security Agent splits finding sync from analysis. Findings, queue rows, and owner state remain scoped to personal or organization owner.

ConcernOwner
Interactive finding syncWeb product checks owner integration permissions, fetches Dependabot alerts, normalizes results, and upserts findings
Scheduled finding syncsecurity-sync six-hour cron selects enabled GitHub security-scan owners and emits one owner-level queue message per owner
Scheduled sync consumersecurity-sync filters owner repositories, resolves owner-scoped GitHub credentials through Git Token Service binding, and updates findings, SLA dates, and audit state through Hyperdrive
Analysis lifecyclesecurity-auto-analysis claims queued analysis rows, runs model triage, and launches Cloud Agent only when deep analysis is needed
CleanupWeb cron reconciles stale running findings only when no matching queue row remains pending or running

Static source proves scheduled sync and separate auto-analysis infrastructure. It does not prove newly synced findings are automatically enqueued for analysis. See Cloud Platform for durable topology and Cloud Security for trust boundaries.

App Builder orchestration boundaries

App Builder is prompt-driven product orchestration, not normal automation ingress. Cloud Agent owns generated-app coding and iteration. Preview, deployment build, and public deployed-app ingress use separate service boundaries. See Cloud Platform for canonical phase topology and Cloud Security for trust boundaries.

Webhook Agent Ingest

Webhook Agent Ingest handles configured trigger endpoints and schedules. TriggerDO stores trigger config and scheduled alarms. Queue consumer dispatches selected destination.

DimensionVariantsNotes
ActivationHTTP webhookCan apply configured webhook authentication before queued delivery
ActivationScheduledUses cron expression and Durable Object alarm; webhook auth is not applicable
Destinationcloud_agentLaunches Cloud Agent session with webhook or scheduled platform marker
Destinationkiloclaw_chatPosts to user-scoped Kilo Chat destination through Kilo Chat service binding
flowchart LR
  http["HTTP webhook"]
  schedule["TriggerDO scheduled alarm"]
  queue["Webhook delivery queue"]
  consumer["Queue consumer"]
  agent["Cloud Agent"]
  chat["Kilo Chat destination"]

  http --> queue
  schedule --> queue
  queue --> consumer
  consumer --> agent
  consumer --> chat

Source map

Paths below are relative to Kilo-Org/cloud.

ServiceSource paths
Kilo Botapps/web/src/lib/bot/
apps/web/src/lib/bots/
apps/web/src/lib/slack-bot/
Code Reviewapps/web/src/lib/code-reviews/
services/code-review-infra/
Auto Triageapps/web/src/lib/auto-triage/
services/auto-triage-infra/
Auto Fixapps/web/src/lib/auto-fix/
services/auto-fix-infra/
Security Agentapps/web/src/lib/security-agent/
services/security-sync/
services/security-auto-analysis/
App Builder previewapps/web/src/lib/app-builder/
services/app-builder/
Generated-app deploymentservices/deploy-infra/builder/
services/deploy-infra/dispatcher/
Webhook Agent Ingestservices/webhook-agent-ingest/
Cloud Agentservices/cloud-agent-next/