Documentation
¶
Index ¶
Constants ¶
const ( // APIVersion is matched exactly, exactly as an annotation record's is. APIVersion = api.Version // KindPolicy is the resource kind of a repository policy. KindPolicy = "Policy" ModeStrict = "strict" FileName = ".koment/policy.yaml" SchemaURL = api.SchemaBase + "policy.schema.json" )
const LegacyVersion = 1
LegacyVersion is the only value the pre-v1alpha `version` field ever carried.
Variables ¶
var Principles = []Principle{PrincipleBackCompatEvidence}
Functions ¶
Types ¶
type AgentsPolicy ¶
type AgentsPolicy struct {
Adapters []Adapter `yaml:"adapters"`
Principles []Principle `yaml:"principles,omitempty"`
}
AgentsPolicy selects generated instruction adapters and the principles they state.
type CommentsPolicy ¶
type CommentsPolicy struct {
Mode string `yaml:"mode"`
Intrinsic []Intrinsic `yaml:"intrinsic"`
GeneratedPaths []string `yaml:"generatedPaths,omitempty"`
VendoredPaths []string `yaml:"vendoredPaths,omitempty"`
}
CommentsPolicy configures strict classification and repository exclusions.
type Intrinsic ¶
type Intrinsic string
Intrinsic names one class of source comment that may remain inline.
type Policy ¶
type Policy struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Spec Spec `yaml:"spec"`
}
Policy is the repository enforcement contract, shaped like every other committed koment resource (ADR 0121).
func Default ¶
func Default() Policy
Default returns the strict policy installed for a new repository.
func (Policy) Excludes ¶
Excludes reports whether a generated or vendored path is outside enforcement.
type Principle ¶ added in v1.1.0
type Principle string
Principle names one extra rule the generated agent contract states. A principle is a claim a reviewer can check, not a preference.
const (
PrincipleBackCompatEvidence Principle = "back-compat-evidence"
)
type Spec ¶ added in v1.1.0
type Spec struct {
Comments CommentsPolicy `yaml:"comments"`
Agents AgentsPolicy `yaml:"agents"`
}
Spec is everything the repository decided. A policy has no metadata because it is a singleton with no identity of its own: the file path is the name.