synthesize

package
v0.0.0-...-323687c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package synthesize owns OpenUdon's deterministic artifact pipeline.

Synthesize starts from a project brief and optional existing intent, then discovers OpenAPI inputs, renders intent, workflow HCL, UWS YAML, expected plans, review evidence, handoff manifests, refinement evidence, and quality reports. Build, Promote, and Assess expose narrower entry points over the same artifact set for repair loops after hand edits. The package is intentionally validation-first: generated artifacts are treated as untrusted until quality checks and review handoff gates pass.

Index

Constants

View Source
const (
	QualityFailureArtifact       = "artifact"
	QualityFailureInfrastructure = "infrastructure"
)

Variables

This section is empty.

Functions

func PackageFromIntent

func PackageFromIntent(ctx context.Context, opts Options) (*Result, *QualityReport, error)

PackageFromIntent builds the normal OpenUdon review package artifacts from an already-authored intent.hcl without resolving an LLM provider. It writes the same workflow, UWS, plan, discovery, review, handoff, refinement, and quality artifacts used by synthesize/build, but returns quality failures in the report instead of treating them as infrastructure errors.

Types

type BindingHint

type BindingHint struct {
	From         string
	To           string
	Field        string
	StepSelector string
}

type FunctionContract

type FunctionContract struct {
	Name        string
	Inputs      []string
	Outputs     []string
	SideEffects string
}

type InputDecl

type InputDecl struct {
	Name        string
	Type        string
	Required    bool
	Description string
}

type Options

type Options struct {
	ExampleDir        string
	Provider          string
	Model             string
	Timeout           time.Duration
	MaxAttempts       int
	IntentTemperature *float64

	Discoverer *openapidisco.Discoverer
	LLMClient  rollout.LLMClient
	ChatClient rollout.ChatClient
	SchemaPath string
}

type OutputDecl

type OutputDecl struct {
	Name        string
	From        string
	Description string
}

type PlanBinding

type PlanBinding struct {
	From   string `json:"from,omitempty"`
	Target string `json:"target"`
	Source string `json:"source"`
}

type PlanGap

type PlanGap struct {
	Code   string `json:"code"`
	Step   string `json:"step,omitempty"`
	Detail string `json:"detail"`
	Query  string `json:"query,omitempty"`
}

type PlanParam

type PlanParam struct {
	Name               string `json:"name"`
	In                 string `json:"in,omitempty"`
	Required           bool   `json:"required,omitempty"`
	Credential         bool   `json:"credential,omitempty"`
	SourceKind         string `json:"source_kind,omitempty"`
	ExpectedSource     string `json:"expected_source,omitempty"`
	ExpectedCredential string `json:"expected_credential,omitempty"`
}

type PlanResult

type PlanResult struct {
	Name  string `json:"name"`
	Kind  string `json:"kind"`
	From  string `json:"from"`
	Value string `json:"value,omitempty"`
}

type PlanStep

type PlanStep struct {
	Name            string                `json:"name"`
	Type            string                `json:"type,omitempty"`
	Parent          string                `json:"parent,omitempty"`
	Branch          string                `json:"branch,omitempty"`
	BranchWhen      string                `json:"branch_when,omitempty"`
	Inferred        bool                  `json:"inferred,omitempty"`
	OpenAPI         string                `json:"openapi,omitempty"`
	Operation       string                `json:"operation,omitempty"`
	Timeout         *float64              `json:"timeout,omitempty"`
	Runtime         string                `json:"runtime,omitempty"`
	When            string                `json:"when,omitempty"`
	ForEach         string                `json:"for_each,omitempty"`
	Items           string                `json:"items,omitempty"`
	Mode            string                `json:"mode,omitempty"`
	BatchSize       string                `json:"batch_size,omitempty"`
	DependsOn       []string              `json:"depends_on,omitempty"`
	RequiredParams  []string              `json:"required_params,omitempty"`
	RequestParams   []PlanParam           `json:"request_params,omitempty"`
	Bindings        []PlanBinding         `json:"bindings,omitempty"`
	Credentials     []string              `json:"credentials,omitempty"`
	SuccessCriteria []*uws1.Criterion     `json:"successCriteria,omitempty"`
	OnFailure       []*uws1.FailureAction `json:"onFailure,omitempty"`
	OnSuccess       []*uws1.SuccessAction `json:"onSuccess,omitempty"`
}

type QualityCheck

type QualityCheck struct {
	Code        string `json:"code"`
	Status      string `json:"status"`
	Message     string `json:"message"`
	Detail      string `json:"detail,omitempty"`
	FailureKind string `json:"failure_kind,omitempty"`
}

func LintProjectMarkdown

func LintProjectMarkdown(text string) []QualityCheck

type QualityReport

type QualityReport struct {
	Status    string         `json:"status"`
	Example   string         `json:"example"`
	Artifacts Result         `json:"artifacts"`
	Checks    []QualityCheck `json:"checks"`
}

func Assess

func Assess(opts Options) (*QualityReport, error)

func AssessContext

func AssessContext(ctx context.Context, opts Options) (*QualityReport, error)

func AssessCurrent

func AssessCurrent(ctx context.Context, opts Options) (*QualityReport, error)

func (*QualityReport) Passed

func (r *QualityReport) Passed() bool

type RefinementAttempt

type RefinementAttempt struct {
	Number        int      `json:"number"`
	Action        string   `json:"action"`
	Mode          string   `json:"mode,omitempty"`
	Status        string   `json:"status"`
	FailureClass  string   `json:"failure_class,omitempty"`
	FailingChecks []string `json:"failing_checks,omitempty"`
	Detail        string   `json:"detail,omitempty"`
	StopReason    string   `json:"stop_reason,omitempty"`
}

type RefinementReport

type RefinementReport struct {
	Status         string              `json:"status"`
	Example        string              `json:"example"`
	MaxAttempts    int                 `json:"max_attempts"`
	PromptVersion  string              `json:"prompt_version"`
	PromptSnapshot string              `json:"prompt_snapshot,omitempty"`
	Attempts       []RefinementAttempt `json:"attempts"`
	StopReason     string              `json:"stop_reason,omitempty"`
}

type Result

type Result struct {
	ExampleDir          string
	ProjectPath         string
	IntentPath          string
	WorkflowPath        string
	UWSPath             string
	PlanJSONPath        string
	PlanMDPath          string
	DiscoveryJSONPath   string
	RefinementJSONPath  string
	RefinementMDPath    string
	ReviewPath          string
	SymphonyHandoffPath string
	QualityJSONPath     string
	QualityMDPath       string
	PrimaryOpenAPI      string
	OpenAPICandidates   []openapidisco.Candidate
	DiscoveryReport     openapidisco.DiscoveryReport
}

func Build

func Build(ctx context.Context, opts Options) (*Result, error)

func Promote

func Promote(ctx context.Context, opts Options) (*Result, error)

func Run

func Run(ctx context.Context, opts Options) (*Result, error)

func Synthesize

func Synthesize(ctx context.Context, opts Options) (*Result, error)

type SymphonyApprovalState

type SymphonyApprovalState = authoring.ReviewApprovalState

type SymphonyCredentialBindings

type SymphonyCredentialBindings = authoring.ReviewCredentialBindings

type SymphonyExecutionPolicy

type SymphonyExecutionPolicy = authoring.ReviewExecutionPolicy

type SymphonyHandoff

type SymphonyHandoff = authoring.ReviewHandoff

type SymphonyHandoffInput

type SymphonyHandoffInput = authoring.ReviewHandoffInput

type SymphonyOwnerSplit

type SymphonyOwnerSplit = authoring.ReviewOwnerSplit

type SymphonyTrustedRunner

type SymphonyTrustedRunner = authoring.ReviewTrustedRunner

type WorkflowPlan

type WorkflowPlan struct {
	Version     string            `json:"version"`
	Example     string            `json:"example,omitempty"`
	Workflow    string            `json:"workflow,omitempty"`
	Summary     string            `json:"summary,omitempty"`
	Timeout     *float64          `json:"timeout,omitempty"`
	Idempotency *uws1.Idempotency `json:"idempotency,omitempty"`
	Steps       []PlanStep        `json:"steps"`
	Results     []PlanResult      `json:"results,omitempty"`
	Gaps        []PlanGap         `json:"gaps,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL