Documentation
¶
Overview ¶
Package config admits the project-local Config v5 pair and projects the fixed runtime policy consumed by review composition.
Index ¶
- Constants
- Variables
- func AdmitConfiguredNativeAccount(configuredHome string, account AccountObservation) (string, uint32, error)
- func BundleSHA256(project, local []byte) string
- func ConfirmLocality(ctx context.Context, source ports.ConfigSource, ...) error
- func EffectiveAccountUID(account AccountObservation) (uint32, error)
- func NewAdmissionError(reason ReasonCode) error
- func ParseProviderTimeout(value string) (time.Duration, error)
- func ProviderTimeoutText(timeout time.Duration) string
- func SameNativeHomeAuthority(left, right ports.NativeHomeLaunchAuthority) bool
- func ValidAgyModel(value string) bool
- func ValidAgyReasoningEffort(value string) bool
- func ValidGrokModel(value string) bool
- func ValidGrokReasoningEffort(value string) bool
- func ValidZCodeModel(value string) bool
- func ValidZCodeReasoningEffort(value string) bool
- type AccountObservation
- type AccountObserver
- type AdmissionError
- type AgyProviderConfig
- type ArtistInputsConfig
- type CIConfig
- type Codec
- type CodexCredentialHomeConfig
- type CodexProviderConfig
- type Config
- type CursorProviderConfig
- type EvidenceConfig
- type ExtractionConfig
- type GrokProviderConfig
- type LocalitySelector
- type NativeUserConfig
- type ProjectConfig
- type ProvenanceRow
- type ProvidersConfig
- type ReasonCode
- type RedactedConfig
- type RedactedPolicy
- type RedactedProviderTimeout
- type RedactedRoleAssignment
- type RepairConfig
- type Resolution
- func (resolution Resolution) CanonicalYAML() []byte
- func (resolution Resolution) Config() ResolvedConfig
- func (resolution Resolution) Provenance() []ProvenanceRow
- func (resolution Resolution) RedactedJSON() []byte
- func (resolution Resolution) Revalidate() error
- func (resolution Resolution) SHA256() string
- func (resolution Resolution) URI() string
- type ResolveRequest
- type ResolvedConfig
- func (resolved ResolvedConfig) CIFailOnSeverity() []domain.Severity
- func (resolved ResolvedConfig) DegradedReviewFails() bool
- func (resolved ResolvedConfig) ExtractionEnabled() bool
- func (resolved ResolvedConfig) ProviderTimeout(family string) (time.Duration, bool)
- func (resolved ResolvedConfig) Providers() ProvidersConfig
- func (resolved ResolvedConfig) Raw() Config
- func (resolved ResolvedConfig) Redacted() RedactedConfig
- func (resolved ResolvedConfig) RequestChangesOn() []domain.Severity
- func (resolved ResolvedConfig) RequireVerifiedFor() []domain.Severity
- func (resolved ResolvedConfig) RequiredRoles() []domain.Role
- func (resolved ResolvedConfig) Role(role domain.Role) (ResolvedRole, bool)
- func (resolved ResolvedConfig) RoleMaxInvocations() int
- func (resolved ResolvedConfig) RunMaxInvocations() int
- func (resolved ResolvedConfig) Runtime() RuntimePolicy
- type ResolvedRole
- type ResourcesConfig
- type ReviewConfig
- type RoleConfig
- type RoleDefault
- type RoleDefaults
- type RolesConfig
- type RuntimePolicy
- type Service
- type SplitCodec
- type ValidationConfig
- type ZCodeProviderConfig
Constants ¶
const ( ConfigVersion = 5 DefaultProviderTimeout = 60 * time.Minute MinimumProviderTimeout = time.Minute MaximumProviderTimeout = 60 * time.Minute ConfigRelativePath = ".mulgae/config.yaml" LocalConfigRelativePath = ".mulgae/local.yaml" MaximumConfigBytes = 1 << 20 ProjectKindNonUI = "non_ui" ProjectKindUI = "ui" )
Variables ¶
var ErrRoleProviderUnsupported = errors.New("role provider unsupported")
ErrRoleProviderUnsupported identifies a valid role selection that none of the configured provider families can run.
Functions ¶
func AdmitConfiguredNativeAccount ¶ added in v0.1.26
func AdmitConfiguredNativeAccount(configuredHome string, account AccountObservation) (string, uint32, error)
func BundleSHA256 ¶ added in v0.1.13
BundleSHA256 returns the stable identity of an ordered Config v5 pair.
func ConfirmLocality ¶ added in v0.1.26
func ConfirmLocality(ctx context.Context, source ports.ConfigSource, attestor ports.ConfigLocalityAttestor, request ports.ConfigLocalityRequest, expected ports.ConfigLocalityContext) error
ConfirmLocality retains both source confirmations around attestor confirmation. Callers retain dependency checks and error projection; causes pass through unchanged.
func EffectiveAccountUID ¶ added in v0.1.26
func EffectiveAccountUID(account AccountObservation) (uint32, error)
EffectiveAccountUID preserves the native-account comparison used by init and review.
func NewAdmissionError ¶
func NewAdmissionError(reason ReasonCode) error
func ParseProviderTimeout ¶ added in v0.1.2
ParseProviderTimeout resolves an optional Config v5 provider timeout. An omitted value uses the fixed 60-minute default, which is also the admitted maximum; explicit values are bounded inclusively between one and sixty minutes, so a project may only shorten a provider window.
func ProviderTimeoutText ¶ added in v0.1.2
ProviderTimeoutText returns the stable Config v5 spelling for a valid provider timeout. Whole-minute values use the concise "30m" form.
func SameNativeHomeAuthority ¶ added in v0.1.26
func SameNativeHomeAuthority(left, right ports.NativeHomeLaunchAuthority) bool
func ValidAgyModel ¶ added in v0.1.26
ValidAgyModel reports whether value has the model grammar the AGY adapter admits. The spelling is validated as supplied and is never normalized.
func ValidAgyReasoningEffort ¶ added in v0.1.26
ValidAgyReasoningEffort reports whether value is one effort of the closed enum the installed AGY CLI lists for --effort. The empty value means omitted, never an invented default.
func ValidGrokModel ¶ added in v0.1.23
ValidGrokModel reports whether value has the exact Config v5 Grok model grammar. The spelling is validated as supplied and is never normalized.
func ValidGrokReasoningEffort ¶ added in v0.1.23
ValidGrokReasoningEffort reports whether value has the exact Config v5 Grok reasoning-effort grammar.
func ValidZCodeModel ¶ added in v0.1.24
ValidZCodeModel reports whether value is one provider-qualified ZCode model selection in the exact provider/model form consumed by app-server.
func ValidZCodeReasoningEffort ¶ added in v0.1.24
ValidZCodeReasoningEffort reports whether value is a syntactically valid app-server thought level. Availability remains owned by the selected model.
Types ¶
type AccountObservation ¶ added in v0.1.26
AccountObservation contains raw installed-account facts, without OS types or policy.
type AccountObserver ¶ added in v0.1.26
type AccountObserver interface{ ObserveAccount() AccountObservation }
type AdmissionError ¶
type AdmissionError struct {
// contains filtered or unexported fields
}
func AsAdmissionError ¶
func AsAdmissionError(err error) (*AdmissionError, bool)
func (*AdmissionError) Error ¶
func (err *AdmissionError) Error() string
func (*AdmissionError) Reason ¶
func (err *AdmissionError) Reason() ReasonCode
type AgyProviderConfig ¶ added in v0.1.26
type AgyProviderConfig struct {
Executable string `yaml:"executable" json:"executable"`
Model string `yaml:"model,omitempty" json:"model,omitempty"`
ReasoningEffort string `yaml:"reasoning_effort,omitempty" json:"reasoning_effort,omitempty"`
Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty"`
}
AgyProviderConfig is the single-account AGY provider block. The executable is machine-local; model, reasoning effort, and timeout are project policy. AGY admits no credential profile, credential home, or account fields: the one default Gemini account is the only credential source.
type ArtistInputsConfig ¶
type CodexCredentialHomeConfig ¶ added in v0.1.14
type CodexProviderConfig ¶ added in v0.1.14
type CodexProviderConfig struct {
Executable string `yaml:"executable" json:"executable"`
DefaultCredentialProfile string `yaml:"default_credential_profile,omitempty" json:"default_credential_profile,omitempty"`
CredentialHomes []CodexCredentialHomeConfig `yaml:"credential_homes,omitempty" json:"credential_homes,omitempty"`
Model string `yaml:"model,omitempty" json:"model,omitempty"`
ReasoningEffort string `yaml:"reasoning_effort,omitempty" json:"reasoning_effort,omitempty"`
Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty"`
}
func (CodexProviderConfig) CredentialHome ¶ added in v0.1.14
func (provider CodexProviderConfig) CredentialHome(profile string) (string, bool)
type Config ¶
type Config struct {
Version int `yaml:"version" json:"version"`
Project ProjectConfig `yaml:"project" json:"project"`
NativeUser NativeUserConfig `yaml:"native_user" json:"native_user"`
Providers ProvidersConfig `yaml:"providers" json:"providers"`
Roles RolesConfig `yaml:"roles" json:"roles"`
Review ReviewConfig `yaml:"review" json:"review"`
Validation ValidationConfig `yaml:"validation" json:"validation"`
Resources ResourcesConfig `yaml:"resources" json:"resources"`
CI CIConfig `yaml:"ci" json:"ci"`
}
Config is the admitted effective value merged from Config v5's project and machine-local authorities.
type CursorProviderConfig ¶ added in v0.1.26
type EvidenceConfig ¶
type EvidenceConfig struct {
RequireVerifiedFor []string `yaml:"require_verified_for" json:"require_verified_for"`
}
type ExtractionConfig ¶ added in v0.1.16
type ExtractionConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
EnabledExplicit bool `yaml:"-" json:"-"`
}
ExtractionConfig enables the Mulgae-owned structured extraction trailer. It consumes the same single second invocation retry and repair compete for, so enabling it never widens a role path.
type GrokProviderConfig ¶ added in v0.1.22
type GrokProviderConfig struct {
Executable string `yaml:"executable" json:"executable"`
Model string `yaml:"model,omitempty" json:"model,omitempty"`
ReasoningEffort string `yaml:"reasoning_effort,omitempty" json:"reasoning_effort,omitempty"`
Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty"`
}
type LocalitySelector ¶ added in v0.1.26
type LocalitySelector func(ports.AnchoredRoot, ports.ConfigLocalityAttestor) (ports.ConfigLocalityAttestor, bool, error)
LocalitySelector chooses the existing Git or filesystem attestor at the caller's observation point. The boolean reports that independent Git binding is unavailable.
type NativeUserConfig ¶
type NativeUserConfig struct {
Home string `yaml:"home" json:"home"`
}
type ProjectConfig ¶
type ProvenanceRow ¶
type ProvidersConfig ¶
type ProvidersConfig struct {
ZCode *ZCodeProviderConfig `yaml:"zcode,omitempty" json:"zcode,omitempty"`
Grok *GrokProviderConfig `yaml:"grok,omitempty" json:"grok,omitempty"`
Codex *CodexProviderConfig `yaml:"codex,omitempty" json:"codex,omitempty"`
Cursor *CursorProviderConfig `yaml:"cursor,omitempty" json:"cursor,omitempty"`
Agy *AgyProviderConfig `yaml:"agy,omitempty" json:"agy,omitempty"`
}
func (ProvidersConfig) Count ¶
func (providers ProvidersConfig) Count() int
func (ProvidersConfig) Families ¶
func (providers ProvidersConfig) Families() []string
func (ProvidersConfig) HasFamily ¶
func (providers ProvidersConfig) HasFamily(family string) bool
HasFamily reports whether a provider family is explicitly configured.
type ReasonCode ¶
type ReasonCode string
const ( ReasonYAMLInvalid ReasonCode = "config_yaml_invalid" ReasonSizeInvalid ReasonCode = "config_size_invalid" ReasonProviderTimeoutInvalid ReasonCode = "config_provider_timeout_invalid" ReasonProviderIdentityInvalid ReasonCode = "config_provider_identity_invalid" ReasonProviderRetired ReasonCode = "config_provider_retired" ReasonRoleMappingInvalid ReasonCode = "config_role_mapping_invalid" ReasonCredentialKeyDetected ReasonCode = "config_credential_key_detected" ReasonCredentialValueDetected ReasonCode = "config_credential_value_detected" )
type RedactedConfig ¶
type RedactedConfig struct {
ConfiguredProviderIDs []string `json:"configured_provider_ids" yaml:"configured_provider_ids"`
Policy RedactedPolicy `json:"policy" yaml:"policy"`
}
func Redact ¶
func Redact(resolved ResolvedConfig) RedactedConfig
type RedactedPolicy ¶
type RedactedPolicy struct {
RoleAssignments []RedactedRoleAssignment `json:"role_assignments" yaml:"role_assignments"`
ProviderTimeouts []RedactedProviderTimeout `json:"provider_timeouts" yaml:"provider_timeouts"`
Warnings []string `json:"warnings" yaml:"warnings"`
RequiredRoles []domain.Role `json:"required_roles" yaml:"required_roles"`
RequestChangesOn []domain.Severity `json:"request_changes_on" yaml:"request_changes_on"`
RequireVerifiedFor []domain.Severity `json:"require_verified_for" yaml:"require_verified_for"`
RoleMaxInvocations int `json:"role_max_invocations" yaml:"role_max_invocations"`
RunMaxInvocations int `json:"run_max_invocations" yaml:"run_max_invocations"`
ExtractionEnabled bool `json:"extraction_enabled" yaml:"extraction_enabled"`
CIFailOnSeverity []domain.Severity `json:"ci_fail_on_severity" yaml:"ci_fail_on_severity"`
DegradedReviewFails bool `json:"degraded_review_fails" yaml:"degraded_review_fails"`
}
type RedactedProviderTimeout ¶ added in v0.1.2
type RedactedRoleAssignment ¶
type RepairConfig ¶
type Resolution ¶
type Resolution struct {
// contains filtered or unexported fields
}
func (Resolution) CanonicalYAML ¶
func (resolution Resolution) CanonicalYAML() []byte
func (Resolution) Config ¶
func (resolution Resolution) Config() ResolvedConfig
func (Resolution) Provenance ¶
func (resolution Resolution) Provenance() []ProvenanceRow
func (Resolution) RedactedJSON ¶
func (resolution Resolution) RedactedJSON() []byte
func (Resolution) Revalidate ¶
func (resolution Resolution) Revalidate() error
func (Resolution) SHA256 ¶
func (resolution Resolution) SHA256() string
func (Resolution) URI ¶
func (resolution Resolution) URI() string
type ResolveRequest ¶
type ResolveRequest struct {
Source ports.ConfigSource
}
type ResolvedConfig ¶
type ResolvedConfig struct {
// contains filtered or unexported fields
}
func ResolveConfiguration ¶
func ResolveConfiguration(raw Config) (ResolvedConfig, error)
func (ResolvedConfig) CIFailOnSeverity ¶
func (resolved ResolvedConfig) CIFailOnSeverity() []domain.Severity
func (ResolvedConfig) DegradedReviewFails ¶
func (resolved ResolvedConfig) DegradedReviewFails() bool
func (ResolvedConfig) ExtractionEnabled ¶ added in v0.1.16
func (resolved ResolvedConfig) ExtractionEnabled() bool
ExtractionEnabled reports whether Mulgae may run its structured extraction trailer after accepting a free-form role report.
func (ResolvedConfig) ProviderTimeout ¶ added in v0.1.2
func (resolved ResolvedConfig) ProviderTimeout(family string) (time.Duration, bool)
ProviderTimeout returns the effective timeout for a configured provider family. The boolean is false for an absent or unknown family.
func (ResolvedConfig) Providers ¶
func (resolved ResolvedConfig) Providers() ProvidersConfig
func (ResolvedConfig) Raw ¶
func (resolved ResolvedConfig) Raw() Config
func (ResolvedConfig) Redacted ¶
func (resolved ResolvedConfig) Redacted() RedactedConfig
func (ResolvedConfig) RequestChangesOn ¶
func (resolved ResolvedConfig) RequestChangesOn() []domain.Severity
func (ResolvedConfig) RequireVerifiedFor ¶
func (resolved ResolvedConfig) RequireVerifiedFor() []domain.Severity
func (ResolvedConfig) RequiredRoles ¶
func (resolved ResolvedConfig) RequiredRoles() []domain.Role
func (ResolvedConfig) Role ¶
func (resolved ResolvedConfig) Role(role domain.Role) (ResolvedRole, bool)
func (ResolvedConfig) RoleMaxInvocations ¶
func (resolved ResolvedConfig) RoleMaxInvocations() int
func (ResolvedConfig) RunMaxInvocations ¶
func (resolved ResolvedConfig) RunMaxInvocations() int
func (ResolvedConfig) Runtime ¶
func (resolved ResolvedConfig) Runtime() RuntimePolicy
type ResolvedRole ¶
type ResolvedRole struct {
// contains filtered or unexported fields
}
func (ResolvedRole) CredentialProfile ¶ added in v0.1.14
func (role ResolvedRole) CredentialProfile() string
func (ResolvedRole) Enabled ¶
func (role ResolvedRole) Enabled() bool
func (ResolvedRole) PrimaryProvider ¶
func (role ResolvedRole) PrimaryProvider() string
type ResourcesConfig ¶
type ResourcesConfig struct {
MaxActiveLanes int `yaml:"max_active_lanes" json:"max_active_lanes"`
PrimaryRepairAttempts int `yaml:"primary_repair_attempts" json:"primary_repair_attempts"`
RoleMaxInvocations int `yaml:"role_max_invocations" json:"role_max_invocations"`
RunMaxInvocations int `yaml:"run_max_invocations" json:"run_max_invocations"`
}
type ReviewConfig ¶
type RoleConfig ¶
type RoleConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
PrimaryProvider string `yaml:"primary_provider" json:"primary_provider"`
CredentialProfile string `yaml:"credential_profile,omitempty" json:"credential_profile,omitempty"`
Inputs *ArtistInputsConfig `yaml:"inputs,omitempty" json:"inputs,omitempty"`
}
type RoleDefault ¶ added in v0.1.4
type RoleDefault struct {
ProviderPreferences []string
ArtistTaskPath string
ArtistDesignSpecGlobs []string
}
RoleDefault is one role's build-owned generation-time default.
ProviderPreferences is an ordered family preference: the first configured family becomes the role's provider. Later entries keep the derivation total when a project configures a different provider set; they are not a fallback route, because a role runs on exactly one provider. The artist fields are populated only for the artist role.
type RoleDefaults ¶ added in v0.1.4
type RoleDefaults struct {
// contains filtered or unexported fields
}
RoleDefaults is the validated, immutable set of build-owned defaults for every fixed role. It is the sole source of init's default provider routing and of the artist input defaults; no default assignment is spelled in Go.
func NewRoleDefaults ¶ added in v0.1.4
func NewRoleDefaults(entries map[domain.Role]RoleDefault) (RoleDefaults, error)
NewRoleDefaults validates and deep-copies a complete set of role defaults.
Every core role must name all provider families. That keeps the derivation total: the intersection with any non-empty configured family set is never empty, so a role can never resolve to no primary provider.
func (RoleDefaults) Role ¶ added in v0.1.4
func (defaults RoleDefaults) Role(role domain.Role) (RoleDefault, bool)
Role returns a caller-owned copy of one role's defaults.
func (RoleDefaults) Valid ¶ added in v0.1.4
func (defaults RoleDefaults) Valid() bool
Valid reports whether the defaults carry every fixed role.
type RolesConfig ¶
type RolesConfig struct {
Logic RoleConfig `yaml:"logic" json:"logic"`
Security RoleConfig `yaml:"security" json:"security"`
Maintainability RoleConfig `yaml:"maintainability" json:"maintainability"`
Product RoleConfig `yaml:"product" json:"product"`
Documentation RoleConfig `yaml:"documentation" json:"documentation"`
Testing RoleConfig `yaml:"testing" json:"testing"`
Artist RoleConfig `yaml:"artist,omitempty" json:"artist,omitempty"`
}
func CanonicalRolesConfig ¶
func CanonicalRolesConfig(defaults RoleDefaults, families []string) (RolesConfig, error)
CanonicalRolesConfig derives init's deterministic role assignments from the build-owned role defaults and the selected provider subset. Persisted configs remain explicit; runtime never calls this function to invent an assignment.
func CanonicalRolesConfigForSelection ¶
func CanonicalRolesConfigForSelection(defaults RoleDefaults, families, selectedRoles []string) (RolesConfig, error)
CanonicalRolesConfigForSelection derives the deterministic assignments for every Config v5 role while enabling only the canonical project role set. Logic forms the project-level floor, not a per-run selection.
Each role resolves independently from its own build-owned preference order, so editing one role's defaults never moves another role's assignment.
func CanonicalRolesConfigForUI ¶
func CanonicalRolesConfigForUI(defaults RoleDefaults, families []string) (RolesConfig, error)
func (RolesConfig) Ordered ¶
func (roles RolesConfig) Ordered() []RoleConfig
Ordered returns the role configurations in canonical role order.
type RuntimePolicy ¶
type RuntimePolicy struct{ MaxActiveLanes int }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) Resolve ¶
func (service *Service) Resolve(ctx context.Context, request ResolveRequest) (Resolution, error)
type SplitCodec ¶ added in v0.1.13
type SplitCodec interface {
Codec
DecodeSplit([]byte, []byte) (Config, error)
EncodeSplit(Config) ([]byte, []byte, error)
ProjectProviderIDs([]byte) ([]string, error)
MergeProjectConfig([]byte, Config) (Config, error)
}
SplitCodec owns the disk projection and merge rules for Config v5's paired authorities.
type ValidationConfig ¶
type ValidationConfig struct {
Evidence EvidenceConfig `yaml:"evidence" json:"evidence"`
Repair RepairConfig `yaml:"repair" json:"repair"`
Extraction ExtractionConfig `yaml:"extraction" json:"extraction"`
}
type ZCodeProviderConfig ¶
type ZCodeProviderConfig struct {
AppBundle string `yaml:"app_bundle" json:"app_bundle"`
Model string `yaml:"model,omitempty" json:"model,omitempty"`
ReasoningEffort string `yaml:"reasoning_effort,omitempty" json:"reasoning_effort,omitempty"`
Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty"`
}