API Reference cairnloop v#0.5.1

Copy Markdown View Source

Modules

Documentation for Cairnloop.

Behaviour for providing host application auditing to Cairnloop.

Default Cairnloop.Auditor implementation backed by the governance audit trail.

A default, no-op implementation of the Cairnloop.Auditor behaviour.

Behaviour for the host-swappable reply-draft engine.

Reference Cairnloop.Automation.DraftGenerator backed by Anthropic's Claude (Messages API). Composes a customer-support reply only when grounding is strong, using the canonical Knowledge Base evidence the retrieval layer already gathered.

Deterministic, zero-dependency reply-draft engine — the library default Cairnloop.Automation.DraftGenerator.

Behaviour for providing host application AI policy boundaries. Allows host applications to dictate how AI drafts are handled.

Behaviour for providing host application context to Cairnloop.

Default implementation of Cairnloop.AutomationPolicy. Always returns :draft_only to ensure AI generated outputs are treated safely by default.

Default implementation of Cairnloop.ContextProvider. Returns an empty context {:ok, %{}} for any input to ensure a safe default.

Diagnoses a host application's Cairnloop wiring and returns calm, reason-forward findings.

Behaviour for generating vector embeddings from text chunks.

Implementation of Embedder behaviour using an external API. Uses OpenAI's text-embedding-ada-002 as default.

Public facade for the governed-tool proposal system (D-30).

Approval-mode resolver for governed tool proposals.

Total render/1 function for governed tool proposals — hides the live-vs-fallback branching behind a single public API.

Bounded telemetry for governed tool proposal events.

Optional OpenInference-conformant trace event module for the Cairnloop governed-action evidence lane (Phase 17, D17-01, D17-03).

Append-only audit event record for governed tool proposals.

Durable approval record for a governed tool proposal.

Durable proposal record capturing a governed tool invocation intent, propose-time snapshots, and idempotency key. Mirrors the ReviewTask idiom exactly (D-20).

Stable telemetry helpers for knowledge-maintenance workflow events.

Parses markdown into chunks for vector embeddings.

Public facade for the MCP token management and validation.

Durable token record for MCP OAuth Bearer authentication.

Behaviour for notifying the host application of important Cairnloop events.

Facade for programmatically triggering support lifecycle events (outbound messages).

Durable audit envelope for a bulk outbound action (D-13, OBS-02-shaped). Snapshots template_id, rendered_body, and recipient cohort at confirmation time. Per-recipient delivery flows through Outbound.trigger/2 (sealed) carrying the envelope id. Refused attempts persist with status: :refused_cap_exceeded.

Optional OpenInference-conformant trace event module for the Cairnloop outbound lane (Phase 26, D-03).

Normalized retrieval evidence shared across search, grounding, and telemetry summaries.

Stable Cairnloop-native telemetry helpers for retrieval search and draft grounding.

Host-router macros for mounting Cairnloop's operator surfaces.

Behaviour for providing SLA policies.

Centralizes telemetry event execution and documentation for Cairnloop.

Governed-tool behaviour and compile-time validating __using__ macro.

Pure data struct carrying compile-time governed-tool metadata.

Manages registration and advisory filtering of host-injected governed tools.

Example governed-write tool: appends an operator-only internal note to the host-owned cairnloop_messages store.

Operator audit log (AUDIT-01): a searchable, filterable timeline of Cairnloop.Auditor events.

Pure, total presenter for operator audit-log events (AUDIT-01).

Cairnloop's shared operator-UI component library.

A plug for liveness checks.

Cockpit Home — the operator dashboard's task-oriented landing (GDS "start with user needs"). Instead of dumping the operator into a bare list, it routes each persona to their job by intent + ONE actionable "needs-you" live count

Inbox surface — list of conversations + Phase 25 bulk-recovery cockpit.

Shared editorial nav function component for all four KB LiveViews.

Validates Bearer tokens for MCP. Does NOT halt the connection on failure. Simply assigns conn.assigns.mcp_token if valid.

Optional read-only MCP seam for Cairnloop-governed tools.

Pure total function transform: %Cairnloop.Tool.Spec{} + tool module → MCP tool definition map.

Serves RFC 9728 metadata for MCP authorization.

A plug for exposing Prometheus metrics.

The single source of truth for the operator dashboard's top-level navigation.

Oban worker that performs the scheduled :pending → :expired flip for governed tool approvals.

Oban worker that re-validates a governed tool approval before it can proceed to execution.

Oban worker that performs the per-recipient outbound delivery for a system_outbound message previously inserted by Cairnloop.Outbound.trigger/2 (sealed, Phase 22/23).

Oban worker that dispatches inbound messages to the correct handler by channel.

The ONLY place run/3 is ever called in Cairnloop.

Mix Tasks

Diagnoses your host application's Cairnloop wiring and prints calm, reason-forward findings.

Scaffolds a Cairnloop.Notifier implementation in your host application and injects the configuration into config/config.exs.

Igniter installer for Cairnloop.

Rebuild retrieval corpus state through Cairnloop.Retrieval.

Replay failed retrieval jobs through Cairnloop.Retrieval.