Scoria.PromptRegistry (scoria v0.1.3)

Copy Markdown View Source

Scoria.PromptRegistry stores prompt template versions so prompt changes can be reviewed, activated, and tied to eval and release evidence.

Use it when prompt text should have durable version lineage instead of living only in application code or provider dashboards. The host app owns prompt intent, policy values, release criteria, and business meaning. Scoria owns template version records, lifecycle transitions, token estimates, and the reviewer evidence needed to connect prompt changes to eval results.

See guides/ownership-boundary.md for the prompt ownership split and guides/reviewer-verification.md for reviewer verification suite guidance.

Summary

Functions

Promotes a prompt template as the only current active version for its entity.

Creates a new draft template.

Gets a single prompt template by ID.

Lists all prompt templates, ordered by inserted_at descending.

Transitions a template's status without bumping the version.

Updates a draft template in place. Rejects if not draft.

Updates an active or archived template immutably, bumping the version.

Functions

activate_prompt_template(template)

Promotes a prompt template as the only current active version for its entity.

activate_prompt_template!(template)

create_draft_template(attrs \\ %{})

Creates a new draft template.

get_prompt_template!(id)

Gets a single prompt template by ID.

list_prompt_templates()

Lists all prompt templates, ordered by inserted_at descending.

transition_status(template, new_status)

Transitions a template's status without bumping the version.

update_draft_template(template, attrs)

Updates a draft template in place. Rejects if not draft.

update_prompt_template(old_template, attrs)

Updates an active or archived template immutably, bumping the version.