internal/infra/inference/identity.go
internal/infra/inference · 70 lines · 5 declarations · source
Declarations
var extractionImplementation
var extractionImplementation []byte
Include request fencing, response parsing and prompt composition in the configuration identity. These are compiled sources, never paths read from the operator's filesystem at runtime.
var promptImplementation
var promptImplementation []byte
var reportImplementation
var reportImplementation []byte
method Model.ExtractionIdentity
func (m *Model) ExtractionIdentity() string
ExtractionIdentity deliberately omits keys and URL userinfo/query/path. A path may contain a credential; even hashing it would turn provenance into retained secret-derived data. Model aliases and routing changes behind the same origin are not immutable weight identities.
method Reporter.ReportIdentity
func (r *Reporter) ReportIdentity() string
ReportIdentity identifies what wrote a community report, on the same terms extraction is identified on: the origin, the model, the compiled code that composes the request and parses the reply, and the prompt file itself.
Why the prompt is hashed rather than versioned
A version field in the YAML is a number somebody has to remember to change, and the edit that matters most — a small change of wording, made while tuning — is exactly the one where they will not. Hashing the compiled file makes the identity maintain itself: change the prompt at all and every report written under the old wording becomes distinguishable from one written under the new, which is what rule 14 requires of a prompt edit.