MCPcopy Create free account
hub / github.com/compozy/agh / Validate

Method Validate

internal/task/validate.go:925–936  ·  view source on GitHub ↗

Validate reports whether the run failure contains a message and bounded metadata.

(path string)

Source from the content-addressed store, hash-verified

923
924// Validate reports whether the run failure contains a message and bounded metadata.
925func (r RunFailure) Validate(path string) error {
926 if strings.TrimSpace(r.Error) == "" {
927 return fmt.Errorf("%w: %s is required", ErrValidation, nestedPath(path, "error"))
928 }
929 if err := ValidatePayloadSize(r.Metadata, nestedPath(path, "metadata")); err != nil {
930 return err
931 }
932 if hasRawClaimTokenField(r.Metadata) {
933 return fmt.Errorf("%w: %s must not contain raw lease credentials", ErrValidation, nestedPath(path, "metadata"))
934 }
935 return nil
936}
937
938// Validate reports whether the task-query filters are internally consistent.
939func (q Query) Validate(path string) error {

Callers 3

failTaskRunFromRequestFunction · 0.95
autonomyFailMethod · 0.95
failTaskRunFromRequestFunction · 0.95

Calls 3

ValidatePayloadSizeFunction · 0.85
hasRawClaimTokenFieldFunction · 0.85
nestedPathFunction · 0.70

Tested by

no test coverage detected