Documentation
¶
Overview ¶
Package denial is the single client-error-envelope/v1 type for cost-bearing and entitlement denials. The schema lives in the workspace (kombify-Core/standards/client-error-envelope.v1.schema.json). Callers must not declare a parallel envelope; user_guidance is always an object.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidEnvelope = errors.New("denial: envelope is not client-error-envelope/v1") ErrGuidanceObject = errors.New("denial: user_guidance must be an object") )
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct {
ErrorCode string `json:"error_code"`
ReasonCode string `json:"reason_code"`
RequestID string `json:"request_id,omitempty"`
Capability string `json:"capability,omitempty"`
ProviderID string `json:"provider_id,omitempty"`
RequiredFeatures []string `json:"required_features,omitempty"`
MissingFeatures []string `json:"missing_features,omitempty"`
Retryable bool `json:"retryable"`
UserGuidance UserGuidance `json:"user_guidance"`
Remediation string `json:"remediation,omitempty"`
SupportContext map[string]any `json:"support_context,omitempty"`
}
Envelope is the machine-readable denial. Required fields match the workspace schema: error_code, reason_code, retryable, user_guidance.
func Parse ¶
Parse decodes a client-error-envelope/v1 document and fails closed when user_guidance is a string or any required field is missing.
func (Envelope) MarshalJSON ¶
MarshalJSON always writes user_guidance as an object.
type UserGuidance ¶
type UserGuidance struct {
Title string `json:"title"`
Body string `json:"body"`
NextSteps []string `json:"next_steps"`
}
UserGuidance is the human-facing part of a denial. It is always a JSON object with title, body, and at least one next step.