Clarify collection contracts and migration docs

This commit is contained in:
2026-10-17 06:35:56 +00:00
parent 29f104fbc0
commit dfd8da843e
16 changed files with 236 additions and 102 deletions

View File

@@ -85,9 +85,13 @@ const (
// own private execution snapshot for RunPrepared. Excessively deep or large
// JSON-shaped values are rejected for safety.
type RunRequest struct {
// PromptID is the required non-empty prompt identifier.
// PromptID is the required prompt identifier. A namespace-scoped engine view
// qualifies a slashless caller value; otherwise it selects the exact
// configured ID. Descriptive prompt-version labels do not participate in
// selection.
PromptID string
// ProfileID selects an execution profile. When empty, the prompt's default
// ProfileID selects an execution profile. A namespace-scoped engine view
// qualifies a slashless caller value. When empty, the prompt's default
// profile is used; if both are empty, the error matches ErrProfileRequired
// and ErrInvalidRequest.
ProfileID string
@@ -159,9 +163,10 @@ type RunRequest struct {
type PreparedRun struct {
// PromptID is the selected prompt identifier.
PromptID string `json:"prompt_id"`
// PromptVersion is the selected definition's descriptive version label. Nil
// means no label was declared; a non-nil empty string is explicit. JSON omits
// nil and preserves a declared empty string.
// PromptVersion is the selected definition's descriptive version label and
// never participates in prompt selection. Nil means no label was declared; a
// non-nil empty string is explicit. JSON omits nil and preserves a declared
// empty string.
PromptVersion *string `json:"prompt_version,omitempty"`
// PromptHash is an opaque equality value for the selected definition.
PromptHash string `json:"prompt_hash,omitempty"`
@@ -219,9 +224,10 @@ type RunResult struct {
Validation ValidationResult `json:"validation"`
// PromptID is the selected prompt identifier.
PromptID string `json:"prompt_id"`
// PromptVersion is the selected definition's descriptive version label. Nil
// means no label was declared; a non-nil empty string is explicit. JSON omits
// nil and preserves a declared empty string.
// PromptVersion is the selected definition's descriptive version label and
// never participates in prompt selection. Nil means no label was declared; a
// non-nil empty string is explicit. JSON omits nil and preserves a declared
// empty string.
PromptVersion *string `json:"prompt_version,omitempty"`
// PromptHash is the same opaque definition equality value exposed by
// PreparedRun.
@@ -404,10 +410,12 @@ type PromptInputDefinition struct {
// OutputContract is the normalized contract declared by the prompt definition,
// rather than a request-level effective override. PromptHash is opaque.
type PromptInspection struct {
// PromptID is the normalized ID of the selected prompt definition.
// PromptID is the exact selected prompt ID after any namespace-view
// qualification.
PromptID string
// PromptVersion is the selected definition's descriptive version label. Nil
// means no label was declared; a non-nil empty string is an explicit label.
// PromptVersion is the selected definition's descriptive version label and
// never participates in definition selection. Nil means no label was
// declared; a non-nil empty string is an explicit label.
PromptVersion *string
// PromptHash is the opaque equality value for the selected definition.
PromptHash string