Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrDisabled = errors.New("contract enforcement is disabled") ErrInvalidDatasetFilter = errors.New("dataset filter must be in namespace/name form") )
Functions ¶
func EnforcementMode ¶
func EnforcementMode() string
EnforcementMode reads the W2-delta REST gate directly until C1's env accessor lands in pkg/env and W3 can unify callers on that typed field.
func RecordFindings ¶
func RecordFindings(graph internalcontract.Graph)
func ScopeGraphToDefinitions ¶
func ScopeGraphToDefinitions(graph internalcontract.Graph, defs []schema.Definition) internalcontract.Graph
ScopeGraphToDefinitions narrows a derived contract graph to the contracts the given definition batch actually participates in. Graph derivation unions the incoming definitions with every job persisted on the server, so the raw graph carries breaking producer/consumer pairs between jobs the caller never mentioned. Lint and check surfaces gate on breaking findings, so they must report the scoped subgraph: the batch's own jobs plus their direct producers and consumers on the server.
Types ¶
type Finding ¶
type Finding struct {
EdgeID string `json:"edgeId,omitempty"`
EdgeClass internalcontract.EdgeClass `json:"edgeClass,omitempty"`
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
Dataset *internalcontract.DatasetRef `json:"dataset,omitempty"`
Kind schemacompat.FindingKind `json:"kind,omitempty"`
Path string `json:"path,omitempty"`
Key string `json:"key,omitempty"`
Detail string `json:"detail,omitempty"`
Verdict schemacompat.Verdict `json:"verdict"`
}
func FilterFindingsForAlias ¶
FilterFindingsForAlias filters an already-materialized findings list, so callers iterating many aliases compute FindingsFromGraph once. The node ID comes from the graph package's canonical helper rather than a duplicated format string.
func FindingsForAlias ¶
func FindingsForAlias(graph internalcontract.Graph, alias string) []Finding
func FindingsFromGraph ¶
func FindingsFromGraph(graph internalcontract.Graph) []Finding
type FindingsSummary ¶
type FindingsSummary struct {
Breaking []Finding `json:"breaking"`
Warnings []Finding `json:"warnings"`
Edges int `json:"edges"`
}
func SummaryFromGraph ¶
func SummaryFromGraph(graph internalcontract.Graph) FindingsSummary