Cairnloop.Automation.ScoriaEngine (cairnloop v0.5.1)

Copy Markdown View Source

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

Generates structured grounded proposals for operator review without calling any external model: strong grounding yields a citation-anchored reply built from the primary canonical evidence, while weaker grounding asks for the missing detail (:clarification) or recommends a human handoff (:escalation). Hosts that want model-composed replies configure Cairnloop.Automation.DraftGenerator.Anthropic (which falls back to this engine when grounding is weak or no API key is set).

Summary

Functions

generate_article_suggestion(suggestion, grounding_bundle)

generate_draft(conversation_id, grounding_bundle)

Builds a structured proposal from the retrieval grounding bundle.