Skip to contents

Computes the protocol's content hash – over the codebook, the prompt template, the provider, model, all model parameters, the replicate count, and the parser (by its deparsed source; the parser decides the final label, so it is part of the instrument) – and freezes it. validate_protocol() on the sealed split and code_corpus() both require a locked protocol, so the validated instrument and the deployed instrument are the same object, verifiably. Hashes use LLMR::llm_hash(), the ecosystem-wide convention.

Usage

protocol_lock(x)

Arguments

x

A protocol().

Value

The protocol, locked, with $hash set.

Examples

cb <- codebook("tone", "one sentence",
  list(cb_category("positive", "Approving."),
       cb_category("negative", "Critical.")))
p  <- protocol(cb, LLMR::llm_config("groq", "openai/gpt-oss-20b"))
protocol_lock(p)