Documentation
¶
Overview ¶
Package config admits one project-local configuration and projects the fixed runtime policy consumed by review composition.
Index ¶
- Constants
- Variables
- func DefaultKimiDataHome(nativeHome string) string
- func NewAdmissionError(reason ReasonCode) error
- func RunTotalOutputCapBytes(config Config) (int64, error)
- type AGYProviderConfig
- type AdmissionError
- type ArtistInputsConfig
- type CIConfig
- type Codec
- type Config
- type EvidenceConfig
- type ExecutionConfig
- type KimiProviderConfig
- type NativeUserConfig
- type ProjectConfig
- type ProvenanceRow
- type ProvidersConfig
- type ReasonCode
- type RedactedConfig
- type RedactedPolicy
- 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) 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) RunTotalOutputCapBytes() int64
- func (resolved ResolvedConfig) Runtime() RuntimePolicy
- func (resolved ResolvedConfig) WorkspaceAccess() WorkspaceAccess
- type ResolvedRole
- type ResourcesConfig
- type ReviewConfig
- type RoleConfig
- type RolesConfig
- type RuntimePolicy
- type Service
- type ValidationConfig
- type WorkspaceAccess
- type ZCodeProviderConfig
Constants ¶
const ( ConfigVersion = 1 DefaultKimiModel = "kimi-code/kimi-for-coding" DefaultAGYPermissionMode = "safe" ConfigRelativePath = ".mulgae/config.yaml" MaximumConfigBytes = 1 << 20 ProjectKindNonUI = "non_ui" ProjectKindUI = "ui" DefaultArtistBriefPath = "ux-ui-info.md" )
Variables ¶
var DefaultArtistDesignSpecGlobs = []string{
"design-specs/**/*.png",
"design-specs/**/*.jpg",
"design-specs/**/*.jpeg",
"design-specs/**/*.webp",
}
Functions ¶
func DefaultKimiDataHome ¶
func NewAdmissionError ¶
func NewAdmissionError(reason ReasonCode) error
func RunTotalOutputCapBytes ¶
Types ¶
type AGYProviderConfig ¶
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 ArtistInputsConfig ¶
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"`
Execution ExecutionConfig `yaml:"execution" json:"execution"`
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 sole project-local Mulgae configuration authority.
type EvidenceConfig ¶
type EvidenceConfig struct {
RequireVerifiedFor []string `yaml:"require_verified_for" json:"require_verified_for"`
}
type ExecutionConfig ¶
type ExecutionConfig struct {
WorkspaceAccess string `yaml:"workspace_access" json:"workspace_access"`
}
type KimiProviderConfig ¶
type NativeUserConfig ¶
type NativeUserConfig struct {
Home string `yaml:"home" json:"home"`
}
type ProjectConfig ¶
type ProvenanceRow ¶
type ProvidersConfig ¶
type ProvidersConfig struct {
Kimi *KimiProviderConfig `yaml:"kimi,omitempty" json:"kimi,omitempty"`
ZCode *ZCodeProviderConfig `yaml:"zcode,omitempty" json:"zcode,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" 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"`
RequiredRoles []domain.Role `json:"required_roles" yaml:"required_roles"`
WorkspaceAccess WorkspaceAccess `json:"workspace_access" yaml:"workspace_access"`
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"`
RunTotalOutputCapBytes int64 `json:"run_total_output_cap_bytes" yaml:"run_total_output_cap_bytes"`
CIFailOnSeverity []domain.Severity `json:"ci_fail_on_severity" yaml:"ci_fail_on_severity"`
DegradedReviewFails bool `json:"degraded_review_fails" yaml:"degraded_review_fails"`
}
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) 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) RunTotalOutputCapBytes ¶
func (resolved ResolvedConfig) RunTotalOutputCapBytes() int64
func (ResolvedConfig) Runtime ¶
func (resolved ResolvedConfig) Runtime() RuntimePolicy
func (ResolvedConfig) WorkspaceAccess ¶
func (resolved ResolvedConfig) WorkspaceAccess() WorkspaceAccess
type ResolvedRole ¶
type ResolvedRole struct {
// contains filtered or unexported fields
}
func (ResolvedRole) Enabled ¶
func (role ResolvedRole) Enabled() bool
func (ResolvedRole) FallbackProvider ¶
func (role ResolvedRole) FallbackProvider() (string, 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"`
FallbackRepairAttempts int `yaml:"fallback_repair_attempts" json:"fallback_repair_attempts"`
RoleMaxInvocations int `yaml:"role_max_invocations" json:"role_max_invocations"`
RunMaxInvocations int `yaml:"run_max_invocations" json:"run_max_invocations"`
RunTotalOutputCap string `yaml:"run_total_output_cap" json:"run_total_output_cap"`
}
type ReviewConfig ¶
type RoleConfig ¶
type RoleConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
PrimaryProvider string `yaml:"primary_provider" json:"primary_provider"`
FallbackProvider string `yaml:"fallback_provider,omitempty" json:"fallback_provider,omitempty"`
Inputs *ArtistInputsConfig `yaml:"inputs,omitempty" json:"inputs,omitempty"`
}
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(families []string) (RolesConfig, error)
CanonicalRolesConfig derives init's deterministic role assignments from the selected provider subset. Persisted configs remain explicit; runtime never calls this function to invent an assignment.
func CanonicalRolesConfigForSelection ¶
func CanonicalRolesConfigForSelection(families, selectedRoles []string) (RolesConfig, error)
CanonicalRolesConfigForSelection derives the deterministic assignments for every Config v1 role while enabling only the canonical project role set. Logic forms the project-level floor, not a per-run selection.
func CanonicalRolesConfigForUI ¶
func CanonicalRolesConfigForUI(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 ValidationConfig ¶
type ValidationConfig struct {
Evidence EvidenceConfig `yaml:"evidence" json:"evidence"`
Repair RepairConfig `yaml:"repair" json:"repair"`
}
type WorkspaceAccess ¶
type WorkspaceAccess string
const ( WorkspaceNone WorkspaceAccess = "none" WorkspaceReadonlySnapshot WorkspaceAccess = "readonly_snapshot" )
func (WorkspaceAccess) Valid ¶
func (access WorkspaceAccess) Valid() bool