Add schema selection values and ownership
This commit is contained in:
@@ -183,6 +183,15 @@ func validateArtifact(ctx context.Context, artifact *domain.Artifact, contract d
|
||||
}
|
||||
}
|
||||
|
||||
// DecodeInlineSchema converts a caller-supplied value to an owned JSON document.
|
||||
func DecodeInlineSchema(ctx context.Context, value any) (any, error) {
|
||||
encoded, err := json.Marshal(value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return decodeJSONValue(ctx, encoded)
|
||||
}
|
||||
|
||||
func decodeJSONValue(ctx context.Context, body []byte) (any, error) {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -6,6 +6,12 @@ import (
|
||||
"go.maximumdirect.net/promptkit/internal/domain"
|
||||
)
|
||||
|
||||
// Input describes the selected contract and its optional bound schema file.
|
||||
type Input struct {
|
||||
Contract domain.OutputContract
|
||||
File *domain.ResourceBinding
|
||||
}
|
||||
|
||||
// PreparedValidation validates artifacts against one frozen output contract.
|
||||
// Its cancellation boundary is synchronous: Validate does not detach schema
|
||||
// execution, and an observed context error prevents publication of a result.
|
||||
|
||||
Reference in New Issue
Block a user