Skip to main content

Runtime Internals

  • internal/clients/openai implements model discovery, chat requests, tool aliases, and the bounded tool loop.
  • internal/mcp owns stdio JSON-RPC, discovery, schemas, permission mapping, policy, timeouts, and result limits.
  • internal/rag owns index validation, BM25 search, excerpts, and the local retrieval tool.
  • internal/change owns snapshot discovery, structured proposals, temporary materialization, validators, diff construction, approval, and apply.
  • internal/audit owns append-only records, replay, state transitions, metadata sanitation, synchronization, and queries.
  • internal/web composes those domains into native and OpenAI-compatible HTTP workflows.

For Chat and Alertmanager, internal/web retrieves local context, forces one structured investigation-plan submission, filters the catalog to authorized read-only tools, validates the selected names and arguments, executes every planned check, and appends each ToolResult before final reasoning. The normal bounded tool loop remains available for adaptive follow-up calls. Retrieved runbook text is guidance and never changes the registry or policy.

The single-generation semaphore in Web protects a local inference server from concurrent overload.