How kaas-team/factory works
KaaS Factory is a goal-to-reviewed-PR automation product. Its main workflow turns goals into ticket graphs, reconciles tickets into parallel agent sessions, observes and verifies their changes, then submits passing work to a merge queue. The CLI is the principal entry point; the core coordinates the loop through ports, while tracker, dispatcher, observer, and queue implementations provide the work and integrations. The README documents additional planning, setup, steering, evaluation, and client capabilities. Some implementation paths are unsampled, so those branches are shown only where documented or evidenced by the source index.
Main entry points: core.go Control Core · main.go Factory CLI · reconcile/run.go Reconcile Loop · mergeq/run.go Merge Queue
Components 24
Entry and Clients
- Factory CLI
cmd/factory/main.go - MCP Server
internal/mcp/mcp.go - Terminal Board
internal/tui/tui.go - Web Dashboard
internal/dashboard/dashboard.go - Service Host
internal/serve/serve.go
Work Orchestration
- Control Core
internal/core/core.go - Goal Planner
internal/plancmd/plancmd.go - Ticket Graph
internal/graph/graph.go - Reconcile Loop
internal/reconcile/run.go
Execution and Verification
- Issue Tracker
internal/tracker/github/tracker.go - Agent Dispatcher
internal/dispatch/local/local.go - Run Observer
internal/observe/observe.go - Quality Gates
internal/gate/gate.go - Merge Queue
internal/mergeq/run.go
State and Insights
- Persistent Store
internal/store/store.go - Usage Meter
internal/meter/meter.go
Product Capabilities
- Repository Audit
internal/firstrun/firstrun.go - Workflow Packs
internal/packs/command.go - Agent Evaluation
internal/eval/eval.go - Workflow Design
internal/design/design.go - Integration Smoke
internal/smoke/run.go
Other components
- Operator
- GitHub
- Target Repository
Connections 30
- Operator → Factory CLI: runs commands
cmd/factory/main.go - Factory CLI → Goal Planner: invokes planning
cmd/factory/main.go - Goal Planner → Ticket Graph: builds plan
internal/plancmd/plancmd.go - Factory CLI → Control Core: mounts run commands
cmd/factory/main.go - Control Core → Reconcile Loop: runs decisions
internal/core/core.go - Control Core → Merge Queue: queues finished work
internal/core/core.go - Reconcile Loop → Agent Dispatcher: dispatches sessions
internal/reconcile/run.go - Reconcile Loop → Issue Tracker: updates ticket state
internal/reconcile/run.go - Control Core → Ticket Graph: uses workflows
internal/core/core.go - Control Core → Run Observer: reconciles observations
internal/core/core.go - Control Core → Usage Meter: tracks usage
internal/core/core.go - Merge Queue → Issue Tracker: coordinates landing
- Agent Dispatcher → Target Repository: changes code
- Quality Gates → Target Repository: checks changes
- Control Core → Persistent Store: persists state
- Operator → MCP Server: connects tools
README.md - MCP Server → Control Core: acts through control
internal/mcp/mcp.go - Operator → Terminal Board: steers tickets
internal/tui/tui.go - Terminal Board → Control Core: uses control API
internal/tui/tui.go - Operator → Service Host: starts service
README.md - Service Host → Web Dashboard: hosts dashboard
internal/dashboard/dashboard.go - Operator → Repository Audit: audits repository
README.md - Repository Audit → Target Repository: inspects files
README.md - Operator → Workflow Packs: manages packs
README.md - Operator → Agent Evaluation: runs evaluations
README.md - Operator → Workflow Design: designs workflows
README.md - Operator → Integration Smoke: runs smoke check
README.md - Issue Tracker → GitHub: reads and updates
- Merge Queue → GitHub: lands pull requests
README.md - Control Core → Quality Gates: verifies results
README.md