Runtime
Source: ./src/runtime/
The runtime is the top-level orchestration layer. It owns the task state machine, coordinates agents, enforces levers, and surfaces events to the dashboard.
Orchestrator
Orchestrator (see ./src/runtime/orchestrator.ts) is the main state machine. Its loop:
- Load current state from
./memory/. - For each domain: ask the coordinator agent to evaluate its queue.
- For each
readytask: dispatch a worker (respectingconcurrent_task_dispatch). - For each
reviewtask: run reviewer fanout. - For each
gate_checktask: run hard gates. - Land accepted work per
landing_strategy. - Persist; emit events.
Call runOrchestrator({ cwd, maxTicks, domainFilter }) to drive one or more ticks.
Context builder
./src/runtime/context-builder.ts assembles per-turn context just-in-time for each agent:
- Applicable guilds (via
selectApplicableGuilds). - Current design system (
./src/core/design-system.ts). - Workspace memory (recent transcripts, relevant prior tasks).
- Current lever positions.
This keeps prompts tight — agents get only what they need for the current decision, not the whole project state.
Business envelope
./src/runtime/business-envelope.ts evaluates proposed work against the project's Goals and Guardrails. business_envelope_strictness decides whether a guardrail violation blocks, warns, or is ignored.
Reviewer dispatch and fanout
./src/runtime/reviewer-dispatch.ts— picks the review engine perreviewer_mode../src/runtime/reviewer-fanout.ts— runs multiple persona reviewers and aggregates perreviewer_fanout_policy.
Remediation
./src/runtime/remediation.ts handles self-healing actions. remediation_autonomy decides whether to act autonomously, confirm destructive actions, confirm all, or pause everything on issue.
Intake and setup shaping
./src/runtime/intake.ts— task-shaping flow used by the dashboard when work needs a clearer spec before it can run../src/runtime/meta-intake.ts— setup flow used by the dashboard to inspect a repo, infer internal routing, and draft starter tasks.
CLI and server entry points
./src/runtime/cli.ts—guildhall <command>dispatch../src/runtime/serve.ts— the Hono HTTP server backing the dashboard. See HTTP API reference.