Documentation
¶
Overview ¶
Package finding defines the Finding type and its sealed constructor. A finding represents one rule violation detected in the dependency graph.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EdgeEvidence ¶
type EdgeEvidence struct {
From Endpoint `json:"from"`
To Endpoint `json:"to"`
Kind string `json:"kind"`
}
EdgeEvidence is the finding-level edge representation (spec §9). Distinct from graph.Edge: carries {module, path} endpoints, not kind:path IDs.
type Finding ¶
type Finding struct {
ID string `json:"id"`
Kind string `json:"kind"`
RuleID string `json:"rule_id"`
Status Status `json:"status"`
Severity Severity `json:"severity"`
Confidence string `json:"confidence"`
Edge EdgeEvidence `json:"edge"`
MatchedBy map[string]string `json:"matched_by"`
Locations []graph.Location `json:"locations"`
Why string `json:"why"`
Constraint string `json:"constraint"`
Alternatives []string `json:"allowed_alternatives,omitempty"`
}
Finding represents one rule violation detected in the dependency graph (spec §9/§12).
func New ¶
New creates a Finding with a stable fingerprint ID derived from (ruleID, from, to, kind).
The ID is computed as hex(sha256(ruleID + "\x00" + from + "\x00" + to + "\x00" + kind)[:16]), producing a 32-character hex string. Line numbers do not affect the ID; the same violation found at different positions remains one finding, with all positions in Locations.
Kind defaults to "gate". Status defaults to "new". Edge.From.Path and Edge.To.Path are set to the bare repo-relative path (kind: prefix stripped). Edge.From.Module, Edge.To.Module, Severity, and MatchedBy are left zero — filled later by the rule and diagnostic assembly stage (engine Task 16).