Architecture

Bosun is now organized around a monitor runtime, workflow/task ownership layers, and operator-facing surfaces. Older references to root-level files like monitor.mjs, config.mjs, or legacy orchestrator filenames are no longer accurate for the current repo.

Top-level layout

Module Role
cli.mjs Main CLI entrypoint and runtime command router.
setup.mjs Setup flow entrypoint.
infra/ Monitor loop, restart logic, maintenance, presence, sessions, runtime plumbing.
workflow/ Workflow engine, node implementations, adapters, and execution helpers.
workflow-templates/ Template library for lifecycle, review, maintenance, recovery, and orchestration flows.
task/ Task lifecycle, task CLI, execution ownership, claims, and archive behavior.
server/ Mini App backend, setup server, and related HTTP endpoints.
ui/ Mini App frontend and shared browser assets.
telegram/ Bot, sentinel, chat integration, and notification surfaces.
workspace/ Workspace registry, context indexing, worktree and shared-state support.
agent/ and shell/ Executor integrations, prompts, hooks, transport layers, and fleet coordination.
github/ and kanban/ GitHub auth/webhooks and board-adapter logic.

Runtime flow

cli.mjs
  ├─ setup and validation commands
  ├─ daemon / sentinel / desktop entrypoints
  └─ monitor startup

infra/monitor.mjs
  ├─ loads resolved config
  ├─ coordinates task and workflow execution
  ├─ talks to task backends and integrations
  ├─ updates operator-facing surfaces
  └─ manages recovery, retries, and lifecycle state

At a high level, Bosun now operates as:

  1. Configuration resolution from CLI, env, `.env`, and JSON config.
  2. Task and workflow intake from internal, GitHub, Jira, or other configured backends.
  3. Executor selection through agent and shell layers.
  4. Validation and lifecycle ownership through workflows, review, and merge gates.
  5. Observation and recovery through telemetry, sentinel, and maintenance loops.

Workflow-first ownership

Current Bosun development emphasizes workflow-first lifecycle ownership. That means task execution, review, PR management, and repair paths increasingly live in reusable workflow templates rather than ad hoc legacy runtime branches.

Operator surfaces

Surface Current backing modules
CLI cli.mjs, task/task-cli.mjs, related companion binaries
Mini App server/ui-server.mjs + ui/
Setup portal server/setup-web-server.mjs + setup flow
Telegram telegram/telegram-bot.mjs, telegram/telegram-sentinel.mjs
Desktop portal desktop/ plus CLI desktop entry flags
Voice voice/ and UI voice modules

Persistence and coordination

Bosun persists and coordinates multiple classes of runtime state:

Recovery model

Modern Bosun recovery is layered rather than handled by one restart loop: