Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClassifyIn ¶
ClassifyIn is a fragment sent to an LLM.
type ClassifyOut ¶
type ClassifyOut struct {
RuleSuggestion string `json:"rule_suggestion"`
Rationale string `json:"rationale"`
Confidence string `json:"confidence"`
Agent string `json:"agent,omitempty"`
}
ClassifyOut is schema-validated LLM output.
type Cleaner ¶
type Cleaner interface {
CanClean(domain.Finding) bool
Plan(u domain.Unit, findings []domain.Finding) (domain.Patch, error)
}
Cleaner plans byte-level mutations for a unit.
type Detector ¶
type Detector interface {
ID() string
Families() []domain.Family
Scan(ctx context.Context, u domain.Unit) ([]domain.Finding, error)
}
Detector scans one already-loaded unit.
type LLM ¶
type LLM interface {
Name() string
Classify(ctx context.Context, in ClassifyIn) (ClassifyOut, error)
Rewrite(ctx context.Context, in RewriteIn) (RewriteOut, error)
Close() error
}
LLM is optional. The default implementation is a noop.
type Layers ¶
type Layers struct {
A int `json:"a"`
Files int `json:"files"`
B int `json:"b"`
BOptional int `json:"b_optional,omitempty" yaml:"b_optional,omitempty"`
BFiles []string `json:"b_files,omitempty" yaml:"b_files,omitempty"`
Note string `json:"note,omitempty" yaml:"note,omitempty"`
}
Layers is the three-channel inspect summary (WR A / Files / B).
type Progress ¶
type Progress interface {
File(done, total int, path, detector string)
Finding(domain.Finding)
Finish()
}
Progress receives live scan updates. Calls are sequential.
type ProtectSpan ¶
ProtectSpan is a region that defaults to report-only cleaning.
type Report ¶
type Report struct {
FilesScanned int `json:"files_scanned" yaml:"files_scanned"`
FilesSkipped int `json:"files_skipped" yaml:"files_skipped"`
Findings []domain.Finding `json:"findings" yaml:"findings"`
Patches []domain.Patch `json:"patches,omitempty" yaml:"patches,omitempty"`
DryRun bool `json:"dry_run,omitempty" yaml:"dry_run,omitempty"`
Score domain.Score `json:"score" yaml:"score"`
After *domain.Score `json:"after,omitempty" yaml:"after,omitempty"`
Leftover []domain.Finding `json:"leftover,omitempty" yaml:"leftover,omitempty"`
Disclaimer string `json:"disclaimer,omitempty" yaml:"disclaimer,omitempty"`
Streamed bool `json:"-" yaml:"-"`
TextFiles int `json:"text_files,omitempty" yaml:"text_files,omitempty"`
ImageFiles int `json:"image_files,omitempty" yaml:"image_files,omitempty"`
DocFiles int `json:"doc_files,omitempty" yaml:"doc_files,omitempty"`
DetectorHits map[string]int `json:"detector_hits,omitempty" yaml:"detector_hits,omitempty"`
Layers *Layers `json:"layers,omitempty" yaml:"layers,omitempty"`
}
Report is the formatter view of a scan.
type RewriteOut ¶
RewriteOut is schema-validated LLM rewrite output.
Click to show internal directories.
Click to hide internal directories.