package config import ( "gitea.maximumdirect.net/eric/notarius/internal/framework/contracts" "go.maximumdirect.net/promptkit" ) // Document is the version 6 configuration shape decoded by ConfigKit. It is // deliberately separate from Config so YAML presence and composition concerns // do not reach runtime pipeline types. type Document struct { Version string `yaml:"version"` PromptKit promptkit.Settings `yaml:"promptkit"` Pipelines map[string]PipelineDocument `yaml:"pipelines,omitempty"` Concurrency *ConcurrencyDocument `yaml:"concurrency,omitempty"` Output *OutputDocument `yaml:"output,omitempty"` CacheDirectory *string `yaml:"cache_directory,omitempty"` Debug *DebugDocument `yaml:"debug,omitempty"` } type PipelineDocument struct { Mode *contracts.ExecutionMode `yaml:"mode,omitempty"` MaxAdditionalTurns *int `yaml:"max_additional_turns,omitempty"` Cache *contracts.CacheMode `yaml:"cache,omitempty"` LLMProfile *string `yaml:"llm_profile,omitempty"` Input BindingDocument `yaml:"input"` Chunk *BindingDocument `yaml:"chunk,omitempty"` Artifacts map[string]ArtifactLaneDocument `yaml:"artifacts,omitempty"` Steps []PipelineStepDocument `yaml:"steps,omitempty"` Output *BindingDocument `yaml:"output,omitempty"` References map[string]ReferenceDocument `yaml:"references,omitempty"` } type PipelineStepDocument struct { ID string `yaml:"id"` Artifacts map[string]ArtifactLaneDocument `yaml:"artifacts"` References map[string]ReferenceDocument `yaml:"references,omitempty"` } type ArtifactLaneDocument struct { Extract BindingDocument `yaml:"extract"` Merge *BindingDocument `yaml:"merge,omitempty"` Normalize *BindingDocument `yaml:"normalize,omitempty"` Validators []ValidatorDocument `yaml:"validators,omitempty"` References map[string]ReferenceDocument `yaml:"references,omitempty"` } // BindingDocument represents a producer binding. ValidatorDocument is a // deliberately finite subset so nested validator-only fields are rejected by // ConfigKit's strict decoder. type BindingDocument struct { Mode *contracts.ExecutionMode `yaml:"mode,omitempty"` MaxAdditionalTurns *int `yaml:"max_additional_turns,omitempty"` Cache *contracts.CacheMode `yaml:"cache,omitempty"` Module string `yaml:"module"` LLMProfile *string `yaml:"llm_profile,omitempty"` Options map[string]any `yaml:"options,omitempty"` References map[string]ReferenceDocument `yaml:"references,omitempty"` Validators []ValidatorDocument `yaml:"validators,omitempty"` } type ValidatorDocument struct { Module string `yaml:"module"` LLMProfile *string `yaml:"llm_profile,omitempty"` Options map[string]any `yaml:"options,omitempty"` } // ReferenceDocument is the explicit version 6 union. Later document // validation establishes which locations permit generated references and // requires exactly one populated branch. type ReferenceDocument struct { Path *string `yaml:"path,omitempty"` Artifact *ArtifactReferenceDocument `yaml:"artifact,omitempty"` } type ArtifactReferenceDocument struct { Step string `yaml:"step"` Lane string `yaml:"lane"` } type ConcurrencyDocument struct { Workers *int `yaml:"workers,omitempty"` } type OutputDocument struct { Directory *string `yaml:"directory,omitempty"` } type DebugDocument struct { Directory *string `yaml:"directory,omitempty"` }