Documentation
¶
Overview ¶
Package baseline provides snapshot-based comparison for crawl results. A baseline captures the set of issues found during a crawl so that subsequent crawls can report only new or resolved issues.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Baseline ¶
type Baseline struct {
SeedURL string `json:"seed_url"`
Issues []model.Issue `json:"issues"`
CreatedAt time.Time `json:"created_at"`
Version string `json:"version"`
}
Baseline is a snapshot of issues from a single crawl session.
type DiffResult ¶
type DiffResult struct {
New []model.Issue `json:"new"` // issues in current but not baseline
Resolved []model.Issue `json:"resolved"` // issues in baseline but not current
Existing []model.Issue `json:"existing"` // issues in both
}
DiffResult categorises issues by comparing a baseline to a current crawl.
func Diff ¶
func Diff(baseline *Baseline, current *model.CrawlResult) *DiffResult
Diff compares a baseline snapshot against a current crawl result and classifies every issue as new, resolved, or existing. Duplicate issues (same CheckName+URL) are handled via count-based matching: if baseline has N copies and current has M copies, min(N,M) are existing, (M-N) are new (if M>N), and (N-M) are resolved (if N>M).