Documentation
¶
Index ¶
Constants ¶
const ( ReasonUnsupportedFindingType = "unsupported_finding_type" ReasonMissingLocation = "missing_location" ReasonAmbiguousPatchTarget = "ambiguous_patch_target" ReasonMissingRuleTemplate = "missing_rule_template" )
Variables ¶
var ErrNoApplyCapableRemediations = errors.New("no apply-capable remediations available")
Functions ¶
This section is empty.
Types ¶
type PRArtifact ¶
func BuildApplyArtifacts ¶ added in v1.0.11
func BuildApplyArtifacts(snapshot state.Snapshot, plan Plan) ([]PRArtifact, error)
BuildApplyArtifacts renders deterministic repo files for the explicit apply surface. It fails closed when the selected plan has no apply-capable remediations.
func BuildPRArtifacts ¶
func BuildPRArtifacts(plan Plan) ([]PRArtifact, error)
BuildPRArtifacts renders deterministic repository files that document and apply remediation intent so --open-pr produces code changes instead of metadata-only PRs.
type PRGroup ¶ added in v1.0.11
func SplitPlanForPRs ¶ added in v1.0.11
SplitPlanForPRs partitions remediations into deterministic contiguous groups. Skipped findings stay attached to the first group only so the overall reason-code context is preserved without duplicating it across every PR payload.
type Plan ¶
type Plan struct {
RequestedTop int `json:"requested_top"`
Fingerprint string `json:"fingerprint"`
Remediations []Remediation `json:"remediations"`
Skipped []Skipped `json:"skipped"`
}
Plan is a deterministic remediation output for ranked findings.
func ApplyCapablePlan ¶ added in v1.0.11
type Remediation ¶
type Remediation struct {
ID string `json:"id"`
TemplateID string `json:"template_id"`
Category string `json:"category"`
RuleID string `json:"rule_id,omitempty"`
ApplySupported bool `json:"apply_supported,omitempty"`
Title string `json:"title"`
Rationale string `json:"rationale"`
CommitMessage string `json:"commit_message"`
PatchPreview string `json:"patch_preview"`
Finding model.Finding `json:"finding"`
}
Remediation describes one deterministic patch preview and commit intent.
type Skipped ¶
type Skipped struct {
CanonicalKey string `json:"canonical_key"`
FindingType string `json:"finding_type"`
RuleID string `json:"rule_id,omitempty"`
Location string `json:"location,omitempty"`
ReasonCode string `json:"reason_code"`
Message string `json:"message"`
}
Skipped is emitted for non-fixable findings with explicit reason codes.