Documentation
¶
Overview ¶
Package gateadapter implements human_gate@v1 over the shared workflow/gate vocabulary and canonical workflow/wait continuation.
The adapter persists no application records and performs no polling. Product presentation and responder policy are supplied through injected extraction-ready seams. Payload stores must be idempotent and own cleanup if payload storage succeeds but durable suspension later fails.
Index ¶
Constants ¶
const ( Name = "human_gate" Version = "v1" CapabilityGate = "gate.respond" CapabilityWait = "wait.resume" CodeInvalidGate = "human_gate_invalid" CodeAuthorityFailed = "human_gate_authority_failed" CodePayloadFailed = "human_gate_payload_failed" CodeContinuation = "human_gate_continuation_invalid" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DecisionSchemaMode ¶
type DecisionSchemaMode string
DecisionSchemaMode selects whether a shared gate profile derives its resume schema from declared option IDs or requires an exact authored schema.
const ( DecisionSchemaDerived DecisionSchemaMode = "derived" DecisionSchemaConfigured DecisionSchemaMode = "configured" )
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor implements human_gate@v1. It is concurrency-safe when injected collaborators are concurrency-safe.
func NewProfile ¶
NewProfile constructs a gate executor with one immutable adapter-owned profile. The profile is copied and validated during construction.
func RegisterProfile ¶
func RegisterProfile(registry stepkind.Registry, profile Profile, options Options) (*Executor, error)
RegisterProfile constructs and registers one immutable shared gate profile.
func (*Executor) Execute ¶
func (e *Executor) Execute(ctx context.Context, prepared stepkind.PreparedInvocation) (stepkind.StepResult, error)
Execute stores private presentation payload, resolves app-owned authority, and suspends initially. An accepted continuation returns typed decision and resume metadata without exposing the resume credential.
func (*Executor) Spec ¶
func (e *Executor) Spec() stepkind.StepKindSpec
Spec returns immutable human_gate@v1 metadata. timed_out is const false on successful continuation; runtime timeout is a typed failed attempt and never fabricated as a successful adapter result.
func (*Executor) ValidateConfig ¶
func (e *Executor) ValidateConfig(_ context.Context, input graph.Config) []diagnostic.Diagnostic
ValidateConfig reports deterministic config paths. An optional non-blocking gate is valid shared vocabulary but rejected here until W07-T09 lowers it to ordinary graph readiness semantics.
type Options ¶
type Options struct {
Authority workflowgate.AuthorityResolver
Payloads workflowgate.PayloadStore
Now func() time.Time
}
Options supplies application-owned gate policy, private payload storage, and a deterministic clock. Authority and Payloads are required.
type Profile ¶
type Profile struct {
Name string
Version string
Label string
RespondCapability string
WaitCapability string
InvalidCode string
AuthorityFailedCode string
PayloadFailedCode string
ContinuationCode string
DecisionSchema DecisionSchemaMode
}
Profile gives a named gate-like adapter its immutable step-kind vocabulary while keeping parsing, suspension, continuation, timeout, and redaction in one implementation. Adapter packages should publish a fixed profile rather than accepting profile data from workflow authors.
func (Profile) StepKindSpec ¶
func (p Profile) StepKindSpec() stepkind.StepKindSpec
StepKindSpec returns the immutable static metadata described by p. Adapter constructors validate profiles before execution; callers defining a custom profile should use NewProfile rather than publishing unchecked metadata.